Plugin Directory

Changeset 3207680


Ignore:
Timestamp:
12/13/2024 02:05:07 PM (16 months ago)
Author:
pcarvalho
Message:

Version 1.4.3

Location:
interactive-globes/trunk
Files:
8 added
3 deleted
49 edited

Legend:

Unmodified
Added
Removed
  • interactive-globes/trunk/README.txt

    r3171479 r3207680  
    55Tested up to: 6.6
    66Requires PHP: 7.0
    7 Stable tag: 1.3.1
     7Stable tag: 1.4.1
    88Donate link: https://wpinteractiveglobes.com/
    99License: GPLv2 or later
     
    1818This plugin offers a realistic 3D world map with clickable map elements, allowing users to explore geographic locations on a dynamic world map in an engaging and immersive way.
    1919
    20 No API Keys required!
    21 
    2220Perfect for displaying global data, travel maps, or educational content, this 3D interactive world map plugin enhances user experience with smooth, responsive design.
    2321
    2422Easily integrate a customizable 3D world map into your website to captivate your audience.
     23
     24No API Keys required!
    2525
    2626= 3D Globe =
     
    2929If you need to display locations a world map, this is the solution for you.
    3030
    31 Create your first globe in minutes! Use it to highligh locations, offices, projects, representatives, statistics, or other interactive marker visualization you need!
     31Create your first world map in minutes! Use it to highligh locations, offices, projects, representatives, statistics, or other interactive marker visualization you need!
    3232
    3333After you create a globe you'll get a unique shortcode that you can use in all popular page builders, including the block editor, elementor and others.
     
    5757= Where can I get coordinates for a marker? =
    5858You can get the latitude and longitude needed to a add a marker to a map using sites like [GetLatLong](https://getlatlong.net/) or [LatLong.net](https://www.latlong.net/) or any other similar website.
     59Clicking the globe preview will also return the coordinates of the clicked point.
    5960
    6061= Where can I learn how to use the plugin? =
    6162You can visit the [documentation pages on the official website](https://wpinteractiveglobes.com/).
    6263
    63 = Do I need any API Key? =
    64 No, the globes will work out of the box.
     64= Do I need an API Key? No =
     65No, the plugin and world maps/globes work without the need of API Keys.
     66
    6567
    6668== Screenshots ==
    67 1. Globe example 01
    68 2. Globe example 02
    69 3. Globe example 03
    70 4. Globe admin screen 01 - Style and settings
    71 5. Globe admin screen 02 - Container settings
    72 6. Globe admin screen 03 - Add Points
    73 7. Globe admin screen 04 - Add Dot Labels
     691. World map example 01
     702. World map example 02
     713. World map example 03
     724. Interactive Globes admin screen 01 - Style and settings
     735. Interactive Globes admin screen 02 - Container settings
     746. Interactive Globes admin screen 03 - Add Points
     757. Interactive Globes admin screen 04 - Add Dot Labels
    7476
    7577== Changelog ==
     78
     79= 1.4.3 =
     80- New: Duplicate/clone globe
     81- Fix: Allow word delimiters in rest api point
     82- Fix: Region json field when missing files
     83- Fix: Region list
     84- Fix: Action clicks
     85- Fix: Empty dot label name
     86- Fix: Redirect on license activation
     87- Fix: Loading model order
     88
     89
     90= 1.4.2 =
     91- Maintenance: Update globe gl, readme links
     92- Fix: Use region's name for sorting
     93
     94= 1.4.1 =
     95- Fix: Set bigger lightbox on smaller screens
     96- Fix: Prevent side color of regions in hollow globe
     97- Fix: TooltipTemplate and onlyActive for regions tooltips
     98- Fix: Visual issues when multiple features are enabled
     99- Fix: Better nl2br handling for html content
     100- Fix: Update freemius to signal addons
     101- Deprecate: Deprecate public method: get_globe_items
     102- Maintenance: Update build tasks, ignores
     103
     104= 1.4.0 =
     105- New: Connect existing markers into new lines
     106- New: Layers and filters
     107- New: Dropdown Search
     108- New: Custom geojson for regions
     109- New: Quick activation link in admin notice for pro users
     110- Fix: Pause rotation on hover by default for markers
     111- Fix: Shortcode footer loading in only plugin's related pages
     112- Several maintenance and integration fixes
     113
     114= 1.3.2 =
     115
     116- Fix: Update globe render meta filter
     117- Fix: Add a check on meta for shortcode
     118- Fix: Update dotlabel meta section name
     119- New: improved parent globe selection
     120- New: Tooltips template
    76121
    77122= 1.3.1 =
  • interactive-globes/trunk/dist/assets/css/admin/admin-style.min.css

    r3158721 r3207680  
    1 .itt_globe_info .csf-field-image_select img{max-width:125px}.geocoding-hide{display:none}.itt_globe_admin_example{display:-webkit-box;display:-ms-flexbox;display:flex}.itt_globe_admin_example img{max-width:220px}.itt_globe_meta .csf-section-title{display:none!important}.itt_globe_preview_container{display:-webkit-box;display:-ms-flexbox;display:flex}.itt_globe_preview{width:80%;position:relative}@media(max-width:960px){.itt_globe_preview{width:60%}}.itt_globe_preview_info{min-height:200px;max-width:400px;padding:5px}#poststuff .itt_globe_preview_info .inside{margin:6px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:left;-ms-flex-pack:left;justify-content:left;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.itt_globe_preview_info .itt_globe_preview_action{margin-left:auto}#itt_globe_preview_data_clicked .postbox-header{padding-right:20px}.itt_globe_preview_action,.itt_globe_preview_data{display:inline-block}.itt_globe_preview_title{--wp-admin--admin-bar--height:32px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;-webkit-font-smoothing:subpixel-antialiased;display:block;color:#1d2327;font-weight:400;font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.itt_globe_preview_info .ittglobe_altitude_s,.itt_globe_preview_info .ittglobe_lat_s,.itt_globe_preview_info .ittglobe_lng_s{color:#1f1f1f}.itt_globe_preview_info .ittglobe_lat,.itt_globe_preview_info .ittglobe_lng{min-width:50px;display:inline-block}.itt_globe_preview_info pre{font-size:.8em}.itt_globe_save_warning{display:none;text-align:center;padding:10px;background:#ab4545a8;position:absolute;width:100%;top:0;left:0;z-index:1;color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box}.itt_globe_preview_needs_update .itt_globe_save_warning{display:block}.itt_globes_cpt_manager_table{width:100%;border-collapse:collapse;border:1px solid #ccd0d4;margin-bottom:15px}.itt_globes_cpt_manager_table thead{border-bottom:1px solid #ccc}.itt_globes_cpt_manager_table td,.itt_globes_cpt_manager_table th{padding:10px;text-align:left}.itt_globes_cpt_manager_table tr:nth-child(2n){background-color:#f9f9f9}.itt_globes_cpt_manager_table tr:nth-child(odd){background-color:#fff}.itt_globes_cpt_manager_table :not(thead) tr:hover{background-color:#f1f1f1}.itt_globes_cpt_manager_table .buttons{text-align:right}.itt_globes_cpt_manager_table .buttons a.button{margin-left:5px}.modal{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.modal__overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:2}.modal__container{background-color:#fff;padding:30px;max-width:500px;max-height:100vh;border-radius:4px;overflow-y:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.modal__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.modal__title{margin-top:0;margin-bottom:0;font-weight:600;font-size:1.25rem;line-height:1.25;color:#00449e;-webkit-box-sizing:border-box;box-sizing:border-box}.modal__close{background:transparent;border:0}.modal__header .modal__close:before{content:"\2715"}.modal__content{margin-top:2rem;margin-bottom:2rem;line-height:1.5;color:rgba(0,0,0,.8)}.modal__btn{font-size:.875rem;padding:.5rem 1rem;background-color:#e6e6e6;color:rgba(0,0,0,.8);border-radius:.25rem;border-style:none;border-width:0;cursor:pointer;-webkit-appearance:button;text-transform:none;overflow:visible;line-height:1.15;margin:0;will-change:transform;-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-out;-webkit-transition:-webkit-transform .25s ease-out;-o-transition:transform .25s ease-out;transition:transform .25s ease-out;transition:transform .25s ease-out,-webkit-transform .25s ease-out}.modal__btn:focus,.modal__btn:hover{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}.modal__btn-primary{background-color:#00449e;color:#fff}.modal__title__block{display:-webkit-box;display:-ms-flexbox;display:flex}.modal__title__input{display:none}#pencil-icon{cursor:pointer;margin-left:1em}.modal__title__input.visible{display:block}.edit_mode__static.invisible{display:none}.postbox .csf-field-image_select figure:before,.postbox .csf-field-spinner .ui-spinner .ui-spinner-button:before{font-family:Font Awesome\ 5 Pro,Font Awesome\ 5 Free,Font Awesome\ 6 Free,FontAwesome}
     1.itt_globe_info .csf-field-image_select img{max-width:125px}.geocoding-hide{display:none}.itt_globe_admin_example{display:flex}.itt_globe_admin_example img{max-width:220px}.itt_globe_meta .csf-section-title{display:none!important}.itt_globe_preview_container{display:flex}.itt_globe_preview{position:relative;width:80%}@media(max-width:960px){.itt_globe_preview{width:60%}}.itt_globe_preview_info{max-width:400px;min-height:200px;padding:5px}#poststuff .itt_globe_preview_info .inside{display:flex;flex-wrap:nowrap;justify-content:left;margin:6px}.itt_globe_preview_info .itt_globe_preview_action{margin-left:auto}#itt_globe_preview_data_clicked .postbox-header{padding-right:20px}.itt_globe_preview_action,.itt_globe_preview_data{display:inline-block}.itt_globe_preview_title{--wp-admin--admin-bar--height:32px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;-webkit-font-smoothing:subpixel-antialiased;color:#1d2327;display:block;font-size:14px;font-weight:400;line-height:1.4;margin:0;padding:8px 12px}.itt_globe_preview_info .ittglobe_altitude_s,.itt_globe_preview_info .ittglobe_lat_s,.itt_globe_preview_info .ittglobe_lng_s{color:#1f1f1f}.itt_globe_preview_info .ittglobe_lat,.itt_globe_preview_info .ittglobe_lng{display:inline-block;min-width:50px}.itt_globe_preview_info pre{font-size:.8em}.itt_globe_save_warning{background:#ab4545a8;box-sizing:border-box;color:#fff;display:none;left:0;padding:10px;position:absolute;text-align:center;top:0;width:100%;z-index:10}.itt_globe_preview_needs_update .itt_globe_save_warning{display:block}.itt_globes_cpt_manager_table{border:1px solid #ccd0d4;border-collapse:collapse;margin-bottom:15px;width:100%}.itt_globes_cpt_manager_table thead{border-bottom:1px solid #ccc}.itt_globes_cpt_manager_table td,.itt_globes_cpt_manager_table th{padding:10px;text-align:left}.itt_globes_cpt_manager_table tr:nth-child(2n){background-color:#f9f9f9}.itt_globes_cpt_manager_table tr:nth-child(odd){background-color:#fff}.itt_globes_cpt_manager_table :not(thead) tr:hover{background-color:#f1f1f1}.itt_globes_cpt_manager_table .buttons{text-align:right}.itt_globes_cpt_manager_table .buttons a.button{margin-left:5px}.modal{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.modal__overlay{align-items:center;background:rgba(0,0,0,.6);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:11}.modal__container{background-color:#fff;border-radius:4px;box-sizing:border-box;max-height:100vh;max-width:500px;overflow-y:auto;padding:30px}.modal__header{align-items:center;display:flex;justify-content:space-between}.modal__title{box-sizing:border-box;color:#00449e;font-size:1.25rem;font-weight:600;line-height:1.25;margin-bottom:0;margin-top:0}.modal__close{background:transparent;border:0}.modal__header .modal__close:before{content:"\2715"}.modal__content{color:rgba(0,0,0,.8);line-height:1.5;margin-bottom:2rem;margin-top:2rem}.modal__btn{-webkit-appearance:button;background-color:#e6e6e6;border-radius:.25rem;border-style:none;border-width:0;color:rgba(0,0,0,.8);cursor:pointer;font-size:.875rem;line-height:1.15;margin:0;overflow:visible;padding:.5rem 1rem;text-transform:none;will-change:transform;-moz-osx-font-smoothing:grayscale;backface-visibility:hidden;transform:translateZ(0);transition:transform .25s ease-out}.modal__btn:focus,.modal__btn:hover{transform:scale(1.05)}.modal__btn-primary{background-color:#00449e;color:#fff}@keyframes mmfadeIn{0%{opacity:0}to{opacity:1}}@keyframes mmfadeOut{0%{opacity:1}to{opacity:0}}@keyframes mmslideIn{0%{transform:translateY(15%)}to{transform:translateY(0)}}@keyframes mmslideOut{0%{transform:translateY(0)}to{transform:translateY(-10%)}}.modal__title__block{display:flex}.modal__title__input{display:none}#pencil-icon{cursor:pointer;margin-left:1em}.modal__title__input.visible{display:block}.edit_mode__static.invisible{display:none}.postbox .csf-field-image_select figure:before,.postbox .csf-field-spinner .ui-spinner .ui-spinner-button:before{font-family:Font Awesome\ 5 Pro,Font Awesome\ 5 Free,Font Awesome\ 6 Free,FontAwesome}
  • interactive-globes/trunk/dist/assets/css/features/meta/meta-admin.min.css

    r3158721 r3207680  
    1 .meta_box_shortcode-code_container{padding:10px;background-color:beige}#ittglobe-copy-button{background:none;border:none;padding:0;outline:none;cursor:pointer}
     1.meta_box_shortcode-code_container{background-color:beige;padding:10px}#ittglobe-copy-button{background:none;border:none;cursor:pointer;outline:none;padding:0}
  • interactive-globes/trunk/dist/assets/css/features/sales/upsell-page.min.css

    r3158721 r3207680  
    1 .upsell-container{max-width:800px;margin:0 auto;padding:20px;font-family:Arial,sans-serif;color:#333}.upsell-container h1,.upsell-container h2{text-align:center;color:#06c}.upsell-container p{text-align:center;font-size:18px;margin-bottom:20px}.features{text-align:left;margin-bottom:20px}.features-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:20px}.features ul{list-style-type:none;padding:0}.features li{font-size:18px;margin:10px 0;padding-left:20px;position:relative}.features li:before{content:"✔";color:green;position:absolute;left:0}.features-image{max-width:300px;height:auto;border:1px solid #ddd;border-radius:5px}.pricing{text-align:center;margin-bottom:20px}.pricing-options{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;gap:40px}.pricing-option{border:1px solid #ddd;border-radius:5px;padding:20px;width:200px;background-color:#f9f9f9}.pricing-option h3{color:#06c;margin-bottom:10px}.price{font-size:24px;color:#333;margin-bottom:10px}.comparison table{width:100%;border-collapse:collapse;margin-bottom:20px}.comparison td,.comparison th{border:1px solid #ddd;padding:10px;text-align:center}.comparison th{background-color:#f4f4f4}.comparison .checkmark{color:green;font-size:20px}.comparison .cross{color:red;font-size:20px}.cta{text-align:center;margin-bottom:50px}.upgrade-button{display:inline-block;padding:15px 30px;font-size:18px;color:#fff;background-color:#06c;border:none;border-radius:5px;text-decoration:none;margin-top:20px}.upgrade-button:hover{background-color:#005bb5;color:#fff}
     1.upsell-container{color:#333;font-family:Arial,sans-serif;margin:0 auto;max-width:800px;padding:20px}.upsell-container h1,.upsell-container h2{color:#06c;text-align:center}.upsell-container p{font-size:18px;margin-bottom:20px;text-align:center}.features{margin-bottom:20px;text-align:left}.features-content{align-items:center;display:flex;gap:20px;justify-content:center}.features ul{list-style-type:none;padding:0}.features li{font-size:18px;margin:10px 0;padding-left:20px;position:relative}.features li:before{color:green;content:"✔";left:0;position:absolute}.features-image{border:1px solid #ddd;border-radius:5px;height:auto;max-width:300px}.pricing{margin-bottom:20px;text-align:center}.pricing-options{display:flex;gap:40px;justify-content:center}.pricing-option{background-color:#f9f9f9;border:1px solid #ddd;border-radius:5px;padding:20px;width:200px}.pricing-option h3{color:#06c;margin-bottom:10px}.price{color:#333;font-size:24px;margin-bottom:10px}.comparison table{border-collapse:collapse;margin-bottom:20px;width:100%}.comparison td,.comparison th{border:1px solid #ddd;padding:10px;text-align:center}.comparison th{background-color:#f4f4f4}.comparison .checkmark{color:green;font-size:20px}.comparison .cross{color:red;font-size:20px}.cta{margin-bottom:50px;text-align:center}.upgrade-button{background-color:#06c;border:none;border-radius:5px;color:#fff;display:inline-block;font-size:18px;margin-top:20px;padding:15px 30px;text-decoration:none}.upgrade-button:hover{background-color:#005bb5;color:#fff}
  • interactive-globes/trunk/dist/assets/css/public/itt-globes-style.min.css

    r3158721 r3207680  
    1 .itt_globe_wrapper{margin:0 auto;width:100%}.itt_globe_aspect_ratio{position:relative;height:0;width:100%}.itt_globe{width:100%;position:absolute;top:0;left:0;bottom:0;right:0;overflow:hidden}.itt_globe_tooltip{background:#fff;color:#000;padding:8px;border-radius:3px;-webkit-box-shadow:0 3px 15px rgba(0,0,0,.2);box-shadow:0 3px 15px rgba(0,0,0,.2)}.gbtn.disabled.glightbox-button-hidden{display:none}.itt_globe_display_content_left,.itt_globe_display_content_right{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:normal;-ms-flex-align:normal;align-items:normal;-ms-flex-line-pack:normal;align-content:normal}.itt_globe_display_content_left .itt_globe_content_left,.itt_globe_display_content_right .itt_globe_container,.itt_globe_display_content_right .itt_globe_content_right{width:48%}.itt_globe_display_content_above .itt_globe_content_above,.itt_globe_display_content_below .itt_globe_content_below{width:100%;-ms-flex-preferred-size:100%;flex-basis:100%}.itt_globe_content{padding:1%}
     1.itt_globe_wrapper{margin:0 auto;width:100%}.itt_globe_aspect_ratio{height:0;position:relative;width:100%}.itt_globe{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;width:100%}.itt_globe_tooltip{background:#fff;border-radius:3px;box-shadow:0 3px 15px rgba(0,0,0,.2);color:#000;padding:8px}.gbtn.disabled.glightbox-button-hidden{display:none}.itt_globe_display_content_left,.itt_globe_display_content_right{align-content:normal;align-items:normal;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.itt_globe_display_content_left .itt_globe_content_left,.itt_globe_display_content_right .itt_globe_container,.itt_globe_display_content_right .itt_globe_content_right{width:48%}.itt_globe_display_content_above .itt_globe_content_above,.itt_globe_display_content_below .itt_globe_content_below{flex-basis:100%;width:100%}.itt_globe_content{padding:1%}
  • interactive-globes/trunk/dist/assets/js/admin/admin.min.js

    r3158721 r3207680  
    1 const globe_ut_prepareURL=function(e){if("string"!=typeof e)return e;var t;(e=e.replace(/&amp;/gi,"&")).replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)}));try{t=new URL(e)}catch(e){t=!1}return t&&![null,"http:","https:","mailto:","tel:"].includes(t.protocol)?(console.log("URL protocol not allowed"),""):e};function setupClickEvent(e,t,i){if("none"===i.action)return;const n=i.action;n&&"function"==typeof window.ittGlobes.clickActions[n]&&window.ittGlobes.clickActions[n](e,t,i),ittGlobeData.isAdmin||("open_url"!==i.action&&"open_url_new"!==i.action||(i.content=globe_ut_prepareURL(i.content)),"open_url"===i.action&&""!==i.content?document.location=i.content:"open_url_new"===i.action&&""!==i.content&&window.open(i.content))}function addShortcodeCopyEvent(){document.getElementById("ittglobe-copy-button").addEventListener("click",(function(){const e=document.getElementById("meta_box_shortcode-code").innerText;navigator.clipboard?navigator.clipboard.writeText(e):document.execCommand("copy"),this.classList.remove("dashicons-admin-page"),this.classList.add("dashicons-yes"),setTimeout(()=>{this.classList.remove("dashicons-yes"),this.classList.add("dashicons-admin-page")},2e3)}))}let ittGlobesAdmin={preview:{},globeMeta:{},cptTabIndex:{itt_globe_point:2,itt_globe_dotlabel:3,itt_globe_region:4,itt_globe_line:5},init:function(){ittGlobesAdmin.buildPreview(),ittGlobesAdmin.setupGlobeReady(),ittGlobesAdmin.setMeta()},setMeta:function(){let e=document.querySelector(".itt_globe_render");e&&(ittGlobesAdmin.meta=e.dataset.globe_meta)},round:function(e){return Math.round(100*e)/100},setupGlobeReady:function(){document.addEventListener("adminGlobeReady",(function(){let e=Object.values(ittGlobes.globesIndex)[0];const t=JSON.parse(ittGlobesAdmin.meta);ittGlobesAdmin.preview.centerCoordinates={lat:0,lng:0,altitude:1.7},e.ringColor(()=>e=>`rgba(255,100,50,${1-e})`).ringMaxRadius(3.5).ringAltitude(.006).ringPropagationSpeed(5).ringRepeatPeriod(400/3),e.onGlobeClick((function(t,i){t.latitude=ittGlobesAdmin.round(t.lat),t.longitude=ittGlobesAdmin.round(t.lng);const n={lat:t.lat,lng:t.lng};e.ringsData([...e.ringsData(),n]),setTimeout(()=>e.ringsData(e.ringsData().filter(e=>e!==n)),400),ittGlobesAdmin.preview.clickedCoordinates=t,delete ittGlobesAdmin.preview.clickedElement,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo()})),e.onZoom((function(e){ittGlobesAdmin.preview.centerCoordinates=e,ittGlobesAdmin.updateCenterPreviewInfo()})),e.onPointClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Point",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_point",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)})),e.onLabelClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Dot Label",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_dotlabel",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)}))}))},setCenter:function(e){if(e.target){document.getElementsByName("globe_info[altitude]")[0].value=e.target.dataset.altitude,document.getElementsByName("globe_info[centerCoordinates][latitude]")[0].value=e.target.dataset.lat,document.getElementsByName("globe_info[centerCoordinates][longitude]")[0].value=e.target.dataset.lng,ittGlobesAdmin.onChange(),e.target.innerHTML=itt_admin_labels.newCenterSaved,e.target.setAttribute("disabled","disabled"),setTimeout((function(){e.target.innerHTML=itt_admin_labels.setInitialCenter,e.target.removeAttribute("disabled")}),2e3)}},updateClickedPreviewInfo:function(){let e=ittGlobesAdmin.preview;if(void 0!==e.clickedCoordinates){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked Location";let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.clickedCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.clickedCoordinates.longitude+"</span>";t.innerHTML=i,ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit").style.display="none";let n=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new"),o=n.dataset.latitude,l=n.dataset.longitude;Object.keys(n.dataset).forEach(e=>{delete n.dataset[e]}),n.dataset.prevlatitude=o,n.dataset.prevlongitude=l,n.dataset.latitude=e.clickedCoordinates.latitude,n.dataset.longitude=e.clickedCoordinates.longitude,void 0!==ittGlobesAdmin.preview.clickedDataset&&(Object.keys(ittGlobesAdmin.preview.clickedDataset).forEach(e=>{n.dataset[e]=ittGlobesAdmin.preview.clickedDataset[e]}),delete ittGlobesAdmin.preview.clickedDataset),n.style.display="inline-block"}if(void 0!==e.clickedElement){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked "+e.clickedElement.type+" : "+e.clickedElement.title;let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+ittGlobesAdmin.round(e.clickedElement.coordinates.latitude)+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)+"</span>";if(t.innerHTML=i,"itt_globe_point"===e.clickedElement.post_type||"itt_globe_dotlabel"===e.clickedElement.post_type||void 0!==e.clickedElement.post_id){let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit");t.dataset.id=e.clickedElement.post_id?e.clickedElement.post_id:e.clickedElement.id,t.dataset.post_type=e.clickedElement.post_type,t.style.display="inline-block";let i=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new");i.style.display="inline-block",i.dataset.prevlatitude=i.dataset.latitude,i.dataset.prevlongitude=i.dataset.longitude,i.dataset.latitude=ittGlobesAdmin.round(e.clickedElement.coordinates.latitude),i.dataset.longitude=ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)}}},updateCenterPreviewInfo:function(){let e=ittGlobesAdmin.preview;e.centerCoordinates.latitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lat),e.centerCoordinates.longitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lng),e.centerCoordinates.altitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.altitude);let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_center .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.centerCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.centerCoordinates.longitude+'</span><span class="ittglobe_altitude_s">Scale: </span><span class="ittglobe_altitude">'+e.centerCoordinates.altitude+"</span>";ittGlobesAdmin.setCenterButton.dataset.lat=e.centerCoordinates.lat,ittGlobesAdmin.setCenterButton.dataset.lng=e.centerCoordinates.lng,ittGlobesAdmin.setCenterButton.dataset.altitude=e.centerCoordinates.altitude,t.innerHTML=i},buildPreview:function(){let e=".itt_globe_info input, .itt_globe_info select, .itt_globe_info textarea",t=document.querySelectorAll(e);t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange})),document.querySelectorAll(".csf-cloneable-add").forEach((function(i){i.addEventListener("click",(function(i){t.forEach((function(e){e.onchange=null})),setTimeout((function(){t=document.querySelectorAll(e),t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange}))}),500)}))})),ittGlobesAdmin.preview.centerCoordinates={lat:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.latitude,lng:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.longitude,altitude:void 0===ittGlobesAdmin.globeMeta.altitude?1.7:ittGlobesAdmin.globeMeta.altitude};let i=document.getElementsByClassName("itt_globe_preview_info");i.length<1?ittGlobesAdmin.infoContainer=null:(ittGlobesAdmin.infoContainer=i[0],ittGlobesAdmin.setCenterButton=document.querySelector(".itt_globe_preview_info #itt_globe_preview_data_center .itt_globe_preview_action button"),ittGlobesAdmin.setCenterButton.addEventListener("click",ittGlobesAdmin.setCenter),ittGlobesAdmin.updateCenterPreviewInfo())},onChange:function(){let e=document.querySelector(".itt_globe_preview");e instanceof HTMLElement&&e.classList.add("itt_globe_preview_needs_update")},addNew:function(e){if(e){let t=document.getElementById("post_ID").value;console.log("Add new "+JSON.stringify(e.dataset)+" dataType:"+e.value+" parentGlobe: "+t);let i=ittGlobesAdmin.cptTabIndex[e.value],n=document.querySelectorAll(".csf-nav-metabox ul li a");if(n&&n[i].click(),"undefined"!=typeof addNew){let i=[];for(const t in e.dataset)e.dataset.hasOwnProperty(t)&&i.push([t,e.dataset[t]]);i.push(["post_type",e.value]),i.push(["parent_id",t]),addNew(e.value,t,i),e.value=""}else console.log("something went wrong")}},edit:function(e){if(e&&(console.log("edit "+JSON.stringify(e.dataset)),"undefined"!=typeof editEntry)){let t=[];for(const i in e.dataset)e.dataset.hasOwnProperty(i)&&t.push([i,e.dataset[i]]);let i=ittGlobesAdmin.cptTabIndex[e.dataset.post_type],n=document.querySelectorAll(".csf-nav-metabox ul li a");n&&n[i].click();let o=document.getElementById("post_ID").value;editEntry(e.dataset.post_type,e.dataset.id,o,t)}}};ittGlobesAdmin.init(),window.ittGlobesAdmin=ittGlobesAdmin,addShortcodeCopyEvent();export{ittGlobesAdmin};
     1const globe_ut_prepareURL=function(e){if("string"!=typeof e)return e;var t;(e=e.replace(/&amp;/gi,"&")).replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)}));try{t=new URL(e)}catch(e){t=!1}return t&&![null,"http:","https:","mailto:","tel:"].includes(t.protocol)?(console.log("URL protocol not allowed"),""):e};function setupClickEvent(e,t,i){let n={arcLines:"arcLineDefaults",points:"pointDefaults",dotLabels:"labelDefaults",regions:"regionDefaults"};if("regions"===i.type&&(i={...i.properties}),new URLSearchParams(window.location.search).has("debug")&&console.debug(i),"default"===i.action&&(i.action=t[n[i.type]].action),"none"===i.action)return;const o=i.action;o&&"function"==typeof window.ittGlobes.clickActions[o]&&window.ittGlobes.clickActions[o](e,t,i),ittGlobeData.isAdmin||("open_url"!==i.action&&"open_url_new"!==i.action||(i.content=globe_ut_prepareURL(i.content)),"open_url"===i.action&&""!==i.content?document.location=i.content:"open_url_new"===i.action&&""!==i.content&&window.open(i.content))}function addShortcodeCopyEvent(){document.getElementById("ittglobe-copy-button").addEventListener("click",(function(){const e=document.getElementById("meta_box_shortcode-code").innerText;navigator.clipboard?navigator.clipboard.writeText(e):document.execCommand("copy"),this.classList.remove("dashicons-admin-page"),this.classList.add("dashicons-yes"),setTimeout((()=>{this.classList.remove("dashicons-yes"),this.classList.add("dashicons-admin-page")}),2e3)}))}let ittGlobesAdmin={preview:{},globeMeta:{},cptTabIndex:{itt_globe_point:2,itt_globe_dotlabel:3,itt_globe_region:4,itt_globe_line:5},init:function(){ittGlobesAdmin.buildPreview(),ittGlobesAdmin.setupGlobeReady(),ittGlobesAdmin.setMeta()},setMeta:function(){let e=document.querySelector(".itt_globe_render");e&&(ittGlobesAdmin.meta=e.dataset.globe_meta)},round:function(e){return Math.round(100*e)/100},setupGlobeReady:function(){document.addEventListener("adminGlobeReady",(function(){let e=Object.values(ittGlobes.globesIndex)[0];const t=JSON.parse(ittGlobesAdmin.meta);ittGlobesAdmin.preview.centerCoordinates={lat:0,lng:0,altitude:1.7},e.ringColor((()=>e=>`rgba(255,100,50,${1-e})`)).ringMaxRadius(3.5).ringAltitude(.006).ringPropagationSpeed(5).ringRepeatPeriod(400/3),e.onGlobeClick((function(t,i){t.latitude=ittGlobesAdmin.round(t.lat),t.longitude=ittGlobesAdmin.round(t.lng);const n={lat:t.lat,lng:t.lng};e.ringsData([...e.ringsData(),n]),setTimeout((()=>e.ringsData(e.ringsData().filter((e=>e!==n)))),400),ittGlobesAdmin.preview.clickedCoordinates=t,delete ittGlobesAdmin.preview.clickedElement,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo()})),e.onZoom((function(e){ittGlobesAdmin.preview.centerCoordinates=e,ittGlobesAdmin.updateCenterPreviewInfo()})),e.onPointClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Point",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_point",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)})),e.onLabelClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Dot Label",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_dotlabel",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)}))}))},setCenter:function(e){if(e.target){document.getElementsByName("globe_info[altitude]")[0].value=e.target.dataset.altitude,document.getElementsByName("globe_info[centerCoordinates][latitude]")[0].value=e.target.dataset.lat,document.getElementsByName("globe_info[centerCoordinates][longitude]")[0].value=e.target.dataset.lng,ittGlobesAdmin.onChange(),e.target.innerHTML=itt_admin_labels.newCenterSaved,e.target.setAttribute("disabled","disabled"),setTimeout((function(){e.target.innerHTML=itt_admin_labels.setInitialCenter,e.target.removeAttribute("disabled")}),2e3)}},updateClickedPreviewInfo:function(){let e=ittGlobesAdmin.preview;if(void 0!==e.clickedCoordinates){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked Location";let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.clickedCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.clickedCoordinates.longitude+"</span>";t.innerHTML=i,ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit").style.display="none";let n=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new"),o=n.dataset.latitude,l=n.dataset.longitude;Object.keys(n.dataset).forEach((e=>{delete n.dataset[e]})),n.dataset.prevlatitude=o,n.dataset.prevlongitude=l,n.dataset.latitude=e.clickedCoordinates.latitude,n.dataset.longitude=e.clickedCoordinates.longitude,void 0!==ittGlobesAdmin.preview.clickedDataset&&(Object.keys(ittGlobesAdmin.preview.clickedDataset).forEach((e=>{n.dataset[e]=ittGlobesAdmin.preview.clickedDataset[e]})),delete ittGlobesAdmin.preview.clickedDataset),n.style.display="inline-block"}if(void 0!==e.clickedElement){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked "+e.clickedElement.type+" : "+e.clickedElement.title;let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+ittGlobesAdmin.round(e.clickedElement.coordinates.latitude)+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)+"</span>";if(t.innerHTML=i,"itt_globe_point"===e.clickedElement.post_type||"itt_globe_dotlabel"===e.clickedElement.post_type||void 0!==e.clickedElement.post_id){let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit");t.dataset.id=e.clickedElement.post_id?e.clickedElement.post_id:e.clickedElement.id,t.dataset.post_type=e.clickedElement.post_type,t.style.display="inline-block";let i=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new");i.style.display="inline-block",i.dataset.prevlatitude=i.dataset.latitude,i.dataset.prevlongitude=i.dataset.longitude,i.dataset.latitude=ittGlobesAdmin.round(e.clickedElement.coordinates.latitude),i.dataset.longitude=ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)}}},updateCenterPreviewInfo:function(){let e=ittGlobesAdmin.preview;e.centerCoordinates.latitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lat),e.centerCoordinates.longitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lng),e.centerCoordinates.altitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.altitude);let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_center .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.centerCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.centerCoordinates.longitude+'</span><span class="ittglobe_altitude_s">Scale: </span><span class="ittglobe_altitude">'+e.centerCoordinates.altitude+"</span>";ittGlobesAdmin.setCenterButton.dataset.lat=e.centerCoordinates.lat,ittGlobesAdmin.setCenterButton.dataset.lng=e.centerCoordinates.lng,ittGlobesAdmin.setCenterButton.dataset.altitude=e.centerCoordinates.altitude,t.innerHTML=i},buildPreview:function(){let e=".itt_globe_info input, .itt_globe_info select, .itt_globe_info textarea",t=document.querySelectorAll(e);t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange})),document.querySelectorAll(".csf-cloneable-add").forEach((function(i){i.addEventListener("click",(function(i){t.forEach((function(e){e.onchange=null})),setTimeout((function(){t=document.querySelectorAll(e),t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange}))}),500)}))})),ittGlobesAdmin.preview.centerCoordinates={lat:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.latitude,lng:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.longitude,altitude:void 0===ittGlobesAdmin.globeMeta.altitude?1.7:ittGlobesAdmin.globeMeta.altitude};let i=document.getElementsByClassName("itt_globe_preview_info");i.length<1?ittGlobesAdmin.infoContainer=null:(ittGlobesAdmin.infoContainer=i[0],ittGlobesAdmin.setCenterButton=document.querySelector(".itt_globe_preview_info #itt_globe_preview_data_center .itt_globe_preview_action button"),ittGlobesAdmin.setCenterButton.addEventListener("click",ittGlobesAdmin.setCenter),ittGlobesAdmin.updateCenterPreviewInfo())},onChange:function(){let e=document.querySelector(".itt_globe_preview");e instanceof HTMLElement&&e.classList.add("itt_globe_preview_needs_update")},addNew:function(e){if(e){let t=document.getElementById("post_ID").value;console.log("Add new "+JSON.stringify(e.dataset)+" dataType:"+e.value+" parentGlobe: "+t);let i=ittGlobesAdmin.cptTabIndex[e.value],n=document.querySelectorAll(".csf-nav-metabox ul li a");if(n&&n[i].click(),"undefined"!=typeof addNew){let i=[];for(const t in e.dataset)e.dataset.hasOwnProperty(t)&&i.push([t,e.dataset[t]]);i.push(["post_type",e.value]),i.push(["parent_id",t]),addNew(e.value,t,i),e.value=""}else console.log("something went wrong")}},edit:function(e){if(e&&(console.log("edit "+JSON.stringify(e.dataset)),"undefined"!=typeof editEntry)){let t=[];for(const i in e.dataset)e.dataset.hasOwnProperty(i)&&t.push([i,e.dataset[i]]);let i=ittGlobesAdmin.cptTabIndex[e.dataset.post_type],n=document.querySelectorAll(".csf-nav-metabox ul li a");n&&n[i].click();let o=document.getElementById("post_ID").value;editEntry(e.dataset.post_type,e.dataset.id,o,t)}}};ittGlobesAdmin.init(),window.ittGlobesAdmin=ittGlobesAdmin,addShortcodeCopyEvent();export{ittGlobesAdmin};
  • interactive-globes/trunk/dist/assets/js/admin/cpt-list-events.min.js

    r3158721 r3207680  
    1 function refresh_cpt_list(t,e){get_cpt_list(t,e).then(e=>{var o=document.getElementById("fill_"+t);return!!o&&(o.innerHTML=e,init_cpt_events(t),ittGlobesAdmin.onChange(),!0)})}async function get_cpt_list(t,e){try{const o=itt_globe_rest.namespace+e+"/"+t+itt_globe_rest.list_part,n=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce}});if(!n.ok)throw new Error("Network response was not OK");return await n.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}function init_cpt_events(t){let e="#block_"+t,o=document.querySelector(e);o&&(o.querySelectorAll(".js-remove-cpt").forEach((function(t){t.addEventListener("click",do_remove_event)})),o.querySelectorAll(".js-modal-edit-cpt").forEach((function(t){t.addEventListener("click",(function(t){let e=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&e.push([t,this.dataset[t]]);const o=this.getAttribute("data-cpt_post_id"),n=this.getAttribute("data-parent_id");editEntry(this.getAttribute("data-post_type"),o,n,e)}))})),o.querySelectorAll(".js-modal-add-new-cpt").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();const e=this.getAttribute("data-parent_id"),o=this.getAttribute("data-post_type");let n=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&n.push([t,this.dataset[t]]);addNew(o,e,n)}))})),o.querySelectorAll(".js-modal-close").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();closeModal(this.getAttribute("data-post_type"))}))})))}function do_remove_event(t){if(!confirm("Are you sure?"))return;t.preventDefault();const e=this.getAttribute("data-cpt_post_id"),o=this.getAttribute("data-parent_id"),n=this.getAttribute("data-post_type"),r=new XMLHttpRequest;r.open("POST",`/wp-json/wp/v2/${n}/${e}?_method=DELETE`,!0),r.setRequestHeader("Content-Type","application/json"),r.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce),r.onload=function(){r.status>=200&&r.status<300?(JSON.parse(r.responseText),refresh_cpt_list(n,o)):console.error("Error trashing post:",r.statusText)},r.onerror=function(){console.error("Network error occurred")},r.send()}function editEntry(t,e,o,n){query_params=[["action","edit"],["iframe",""],["post",e],["parent_id",o]].concat(n);const r=build_modal_url(itt_globe_data.admin_url,"post.php",query_params),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function addNew(t,e,o){let n=[["iframe",""]].concat(o);const r=build_modal_url(itt_globe_data.admin_url,"post-new.php",n),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function closeModal(t){document.getElementById(t+"_modal").style.display="none",document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="block",document.querySelector("#"+t+"_modal iframe").setAttribute("src","")}function build_modal_url(t,e,o){const n=new URLSearchParams;return o.forEach(t=>{if(!Array.isArray(t)||2!==t.length)throw new Error("Each param should be an array with two elements: [key, value]");n.append(t[0],t[1])}),t+e+"?"+n.toString()}window.addEventListener("message",(function(t){if(!t.data.hasOwnProperty("message")||!t.data.hasOwnProperty("params"))return;if("refresh-cpt-list"!==t.data.message)return;const e=t.data.params;(e.hasOwnProperty("post_type")||e.hasOwnProperty("parent_id"))&&refresh_cpt_list(e.post_type,e.parent_id)}));
     1function refresh_cpt_list(t,e){get_cpt_list(t,e).then((e=>{var o=document.getElementById("fill_"+t);return!!o&&(o.innerHTML=e,init_cpt_events(t),ittGlobesAdmin.onChange(),!0)}))}async function get_cpt_list(t,e){try{const o=itt_globe_rest.namespace+e+"/"+t+itt_globe_rest.list_part,n=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce}});if(!n.ok)throw new Error("Network response was not OK");return await n.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}function init_cpt_events(t){let e="#block_"+t,o=document.querySelector(e);o&&(o.querySelectorAll(".js-remove-cpt").forEach((function(t){t.addEventListener("click",do_remove_event)})),o.querySelectorAll(".js-modal-edit-cpt").forEach((function(t){t.addEventListener("click",(function(t){let e=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&e.push([t,this.dataset[t]]);const o=this.getAttribute("data-cpt_post_id"),n=this.getAttribute("data-parent_id");editEntry(this.getAttribute("data-post_type"),o,n,e)}))})),o.querySelectorAll(".js-modal-add-new-cpt").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();const e=this.getAttribute("data-parent_id"),o=this.getAttribute("data-post_type");let n=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&n.push([t,this.dataset[t]]);addNew(o,e,n)}))})),o.querySelectorAll(".js-modal-close").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();closeModal(this.getAttribute("data-post_type"))}))})))}function do_remove_event(t){if(!confirm("Are you sure?"))return;t.preventDefault();const e=this.getAttribute("data-cpt_post_id"),o=this.getAttribute("data-parent_id"),n=this.getAttribute("data-post_type"),r=new XMLHttpRequest;r.open("POST",`/wp-json/wp/v2/${n}/${e}?_method=DELETE`,!0),r.setRequestHeader("Content-Type","application/json"),r.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce),r.onload=function(){r.status>=200&&r.status<300?(JSON.parse(r.responseText),refresh_cpt_list(n,o)):console.error("Error trashing post:",r.statusText)},r.onerror=function(){console.error("Network error occurred")},r.send()}function editEntry(t,e,o,n){query_params=[["action","edit"],["iframe",""],["post",e],["parent_id",o]].concat(n);const r=build_modal_url(itt_globe_data.admin_url,"post.php",query_params),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function addNew(t,e,o){let n=[["iframe",""]].concat(o);const r=build_modal_url(itt_globe_data.admin_url,"post-new.php",n),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function closeModal(t){document.getElementById(t+"_modal").style.display="none",document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="block",document.querySelector("#"+t+"_modal iframe").setAttribute("src","")}function build_modal_url(t,e,o){const n=new URLSearchParams;return o.forEach((t=>{if(!Array.isArray(t)||2!==t.length)throw new Error("Each param should be an array with two elements: [key, value]");n.append(t[0],t[1])})),t+e+"?"+n.toString()}window.addEventListener("message",(function(t){if(!t.data.hasOwnProperty("message")||!t.data.hasOwnProperty("params"))return;if("refresh-cpt-list"!==t.data.message)return;const e=t.data.params;(e.hasOwnProperty("post_type")||e.hasOwnProperty("parent_id"))&&refresh_cpt_list(e.post_type,e.parent_id)}));
  • interactive-globes/trunk/dist/assets/js/admin/cpt-modal-events.min.js

    r3115164 r3207680  
    1 function jsonToObject(t){const e={};for(let n=0;n<t.length;n++){setObjectValue(e,t[n][0],t[n][1])}return e}function setObjectValue(t,e,n){const r=e.split("[").map(t=>t.replace("]",""));let o=t;for(let t=0;t<r.length;t++){const e=r[t];t===r.length-1?o[e]=n:(o[e]||(o[e]={}),o=o[e])}}async function submit_unserialized(t,e,n){try{const r=itt_globe_rest.url+t+"/"+e,o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce},body:JSON.stringify(n)});if(!o.ok)throw new Error("Network response was not OK");return await o.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}async function submit_data_as_meta(t,e,n){let r={meta:n};return await submit_unserialized(t,e,r)}async function submit_unserialized_meta_objet(t,e,n){const r={};for(let o in n)if(n.hasOwnProperty(o)){if("object"!=typeof n[o]||null===n[o])return r[o]=n[o],await submit_data_as_meta(t,e,r);submit_unserialized_meta_objet(t,e,n[o])}}async function submit_meta(t,e,n,r){const o=[],a=Array.from(n),i={};a.forEach(([t,e])=>{t=t.replace("[]",""),i[t]?(Array.isArray(i[t])||(i[t]=[i[t]]),i[t].push(e)):i[t]=e});const s=Object.entries(i);return console.log(a),console.log(s),Object.entries(r).forEach((async function(n){var r=n[0],a=n[1];if(void 0!==a.args){if("unserialize"===a.args.data_type){let n=jsonToObject(s.filter(([t])=>t.startsWith(r)));o.push(submit_unserialized_meta_objet(t,e,n))}if("serialize"===a.args.data_type){let n=jsonToObject(s.filter(([t])=>t.startsWith(r)));o.push(submit_data_as_meta(t,e,n))}}})),await Promise.all(o),!0}async function submit_cpt(t){const e=t.get("cpt_post_id");0==e&&(e=null);const n=t.get("relationship_parent_id");let r=Array.from(t).filter(([t])=>t.includes(itt_globe_meta.relationship_key));r.length>0&&r[0].hasOwnProperty(0)&&r[0].hasOwnProperty(1)&&""===r[0][1]&&t.set(r[0][0],n);let o=t.get("extra_values");o=JSON.parse(o);let a=t.get("cpt_meta_boxes");a=JSON.parse(a);const i=t.get("post_type");if(!i)return;const s=o.map(async n=>{let r={};return r[n]=t.get(n),r.status="publish",await submit_unserialized(i,e,r)}),l=await Promise.all(s);if(l.length>0){const n=l[0];0==e&&void 0!==n.id&&(e=n.id),await submit_meta(i,e,t,a)}return e}async function saveModal(t){const e=document.querySelector("#"+t+"_modal iframe");if(!e)return null;let n=e.contentWindow.document.getElementById("cpt-post"),r=new FormData(n);try{return await submit_cpt(r)}catch(t){console.error("Error:",t)}}function notifyParent(t,e){let n={message:t,params:e};window.parent.postMessage(n,"*")}document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".js-modal-save").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();let e=null;const n=this.getAttribute("data-post_type"),r=this.getAttribute("data-parent_id");this.innerHTML="Saving...",this.setAttribute("disabled","disabled"),saveModal(n).then(o=>void 0===o?null:(e=o,notifyParent("refresh-cpt-list",{post_type:n,parent_id:r}),t.target.innerHTML="Save",t.target.removeAttribute("disabled"),closeModal(n),e)).catch(t=>(console.error("Error processing items:",t),notifyParent("form-with-error",{error:t,post_type:n}),null))}))}))}));const pencilIcons=document.querySelectorAll(".edit_mode__trigger");pencilIcons.forEach(t=>{t.addEventListener("click",()=>{t.parentNode.querySelectorAll(".modal__title__input").forEach((function(t){t.classList.toggle("visible")})),t.parentNode.querySelectorAll(".edit_mode__static").forEach((function(t){t.classList.toggle("invisible")}))})});
     1function jsonToObject(t){const e={};for(let n=0;n<t.length;n++){setObjectValue(e,t[n][0],t[n][1])}return e}function setObjectValue(t,e,n){const r=e.split("[").map((t=>t.replace("]","")));let o=t;for(let t=0;t<r.length;t++){const e=r[t];t===r.length-1?o[e]=n:(o[e]||(o[e]={}),o=o[e])}}async function submit_unserialized(t,e,n){try{const r=itt_globe_rest.url+t+"/"+e,o=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce},body:JSON.stringify(n)});if(!o.ok)throw new Error("Network response was not OK");return await o.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}async function submit_data_as_meta(t,e,n){let r={meta:n};return await submit_unserialized(t,e,r)}async function submit_unserialized_meta_objet(t,e,n){const r={};for(let o in n)if(n.hasOwnProperty(o)){if("object"!=typeof n[o]||null===n[o])return r[o]=n[o],await submit_data_as_meta(t,e,r);submit_unserialized_meta_objet(t,e,n[o])}}async function submit_meta(t,e,n,r){const o=[],a=Array.from(n),i={};a.forEach((([t,e])=>{t=t.replace("[]",""),i[t]?(Array.isArray(i[t])||(i[t]=[i[t]]),i[t].push(e)):i[t]=e}));const s=Object.entries(i);return console.log(a),console.log(s),Object.entries(r).forEach((async function(n){var r=n[0],a=n[1];if(void 0!==a.args){if("unserialize"===a.args.data_type){let n=jsonToObject(s.filter((([t])=>t.startsWith(r))));o.push(submit_unserialized_meta_objet(t,e,n))}if("serialize"===a.args.data_type){let n=jsonToObject(s.filter((([t])=>t.startsWith(r))));o.push(submit_data_as_meta(t,e,n))}}})),await Promise.all(o),!0}async function submit_cpt(t){const e=t.get("cpt_post_id");0==e&&(e=null);const n=t.get("relationship_parent_id");let r=Array.from(t).filter((([t])=>t.includes(itt_globe_meta.relationship_key)));r.length>0&&r[0].hasOwnProperty(0)&&r[0].hasOwnProperty(1)&&""===r[0][1]&&t.set(r[0][0],n);let o=t.get("extra_values");o=JSON.parse(o);let a=t.get("cpt_meta_boxes");a=JSON.parse(a);const i=t.get("post_type");if(!i)return;const s=o.map((async n=>{let r={};return r[n]=t.get(n),r.status="publish",await submit_unserialized(i,e,r)})),l=await Promise.all(s);if(l.length>0){const n=l[0];0==e&&void 0!==n.id&&(e=n.id),await submit_meta(i,e,t,a)}return e}async function saveModal(t){const e=document.querySelector("#"+t+"_modal iframe");if(!e)return null;let n=e.contentWindow.document.getElementById("cpt-post"),r=new FormData(n);try{return await submit_cpt(r)}catch(t){console.error("Error:",t)}}function notifyParent(t,e){let n={message:t,params:e};window.parent.postMessage(n,"*")}document.addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".js-modal-save").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();let e=null;const n=this.getAttribute("data-post_type"),r=this.getAttribute("data-parent_id");this.innerHTML="Saving...",this.setAttribute("disabled","disabled"),saveModal(n).then((o=>void 0===o?null:(e=o,notifyParent("refresh-cpt-list",{post_type:n,parent_id:r}),t.target.innerHTML="Save",t.target.removeAttribute("disabled"),closeModal(n),e))).catch((t=>(console.error("Error processing items:",t),notifyParent("form-with-error",{error:t,post_type:n}),null)))}))}))}));const pencilIcons=document.querySelectorAll(".edit_mode__trigger");pencilIcons.forEach((t=>{t.addEventListener("click",(()=>{t.parentNode.querySelectorAll(".modal__title__input").forEach((function(t){t.classList.toggle("visible")})),t.parentNode.querySelectorAll(".edit_mode__static").forEach((function(t){t.classList.toggle("invisible")}))}))}));
  • interactive-globes/trunk/dist/assets/js/public/globe.min.js

    r3158721 r3207680  
    1 function setupTooltip(t){let e="";return t.tooltipContent&&""!==t.tooltipContent&&(e='<div class="itt_globe_tooltip">'+t.tooltipContent+"</div>"),e}const globe_ut_prepareURL=function(t){if("string"!=typeof t)return t;var e;(t=t.replace(/&amp;/gi,"&")).replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(e)}));try{e=new URL(t)}catch(t){e=!1}return e&&![null,"http:","https:","mailto:","tel:"].includes(e.protocol)?(console.log("URL protocol not allowed"),""):t},globe_ut_prepareData=function(t){t.hasOwnProperty("dotLabels")&&t.dotLabels||(t.dotlabels=[]),t.hasOwnProperty("points")&&t.points||(t.points=[]);let e={showGraticules:!1,backgroundColor:"transparent",atmosphere:{enabled:!1,atmosphereColor:null,atmosphereAltitude:null},globeImage:"earth-day.jpg"};return(0===Object.keys(t).length||t.emptyPreview)&&Object.assign(t,e),t.pointOfView={lat:0,lng:0,altitude:1.5},t.centerCoordinates&&(t.pointOfView.lat=globe_ut_float(t.centerCoordinates.latitude),t.pointOfView.lng=globe_ut_float(t.centerCoordinates.longitude),t.pointOfView.altitude=globe_ut_float(t.altitude)),t},globe_ut_setupData=function(t,e){for(const o in e){let n=e[o];Array.isArray(t[o])&&t[o]&&t[o].map((function(e){(void 0===e.useCustom||void 0!==e.useCustom&&!globe_ut_bool(e.useCustom))&&Object.assign(e,t[n]),e.action&&"default"===e.action&&(e.action=t[n].action)}))}},globe_ut_prepareViewport=function(t,e){var o=t.closest(".itt_globe_aspect_ratio");window.innerWidth<=780&&void 0!==e.paddingTop&&""!==e.paddingTop?o.style.paddingTop=String(e.paddingTopMobile)+"%":o.style.paddingTop=String(e.paddingTop)+"%"},globe_ut_float=function(t){var e=parseFloat(t);return isNaN(e)?0:e},globe_ut_bool=function(t){return 0!==Number(t)&&"false"!==t&&void 0!==t};function setupClickEvent(t,e,o){if("none"===o.action)return;const n=o.action;n&&"function"==typeof window.ittGlobes.clickActions[n]&&window.ittGlobes.clickActions[n](t,e,o),ittGlobeData.isAdmin||("open_url"!==o.action&&"open_url_new"!==o.action||(o.content=globe_ut_prepareURL(o.content)),"open_url"===o.action&&""!==o.content?document.location=o.content:"open_url_new"===o.action&&""!==o.content&&window.open(o.content))}function setupHoverEvent(t,e,o){return"point"===o&&t.pointColor(t=>t===e?t.hover:t.color),"dotlabel"!==o&&"label"!==o||t.labelColor(t=>t===e?t.hover:t.color),t}function addPointsLayer(t,e){t.pointsData(e.points).pointLat(t=>t.coordinates.latitude).pointLng(t=>t.coordinates.longitude).pointRadius(t=>t.radius/10).pointAltitude(t=>t.altitude/100).pointColor(t=>t.color).pointResolution(20),t.pointLabel((function(t){return setupTooltip(t)})),t.onPointClick((function(o){setupClickEvent(t,e,o)})),t.onPointHover((function(e){setupHoverEvent(t,e,"point")}))}function addLabelsLayer(t,e){if(t.labelsData(e.dotLabels).labelLat(t=>t.coordinates.latitude).labelLng(t=>t.coordinates.longitude).labelText(t=>t.title).labelAltitude(t=>t.altitude/100).labelSize(t=>t.size/10).labelColor(t=>t.color).labelResolution(20).labelIncludeDot(t=>globe_ut_bool(t.includeDot)).labelDotRadius(t=>t.radius/10).labelDotOrientation(t=>t.dotOrientation),e.labelFont&&"default"!==e.labelFont){let o=ittGlobeData.assetsUrl+"fonts/"+e.labelFont+".json";fetch(o).then(t=>t.json()).then(e=>{t.labelTypeFace(e)}).catch(t=>{console.error("Fetch error:",t)})}t.labelLabel((function(t){return setupTooltip(t)})),t.onLabelClick((function(o,n,l){setupClickEvent(t,e,o)})),t.onLabelHover((function(e){setupHoverEvent(t,e,"label")}))}function setupResizeEvent(t,e,o){var n=e.closest(".itt_globe_aspect_ratio");window.addEventListener("resize",(function(){window.innerWidth<=780&&void 0!==o.paddingTop&&""!==o.paddingTop?n.style.paddingTop=String(o.paddingTopMobile)+"%":n.style.paddingTop=String(o.paddingTop)+"%",t.width()!==e.offsetWidth&&t.width(e.offsetWidth).height(e.offsetHeight)}))}function setupInteractions(t,e){void 0!==e.interactions&&(t.controls().enableZoom=globe_ut_bool(e.interactions.zoom),t.controls().enablePan=globe_ut_bool(e.interactions.pan),t.controls().enableRotate=globe_ut_bool(e.interactions.pan))}let ittGlobes={globes:[],globesIndex:{},clickActions:{},init:function(){if("undefined"==typeof Globe)return void console.error("Globe lib not loaded properly");let t=document.getElementsByClassName("js-itt-globe-render");for(const e of t){if(!e.dataset.hasOwnProperty("globe_id"))continue;let t=0;try{t=parseInt(JSON.parse(e.dataset.globe_id))}catch(t){continue}if(void 0!==ittGlobes.globesIndex[t])continue;if(!e.dataset.hasOwnProperty("globe_meta"))continue;let o={};try{o=JSON.parse(e.dataset.globe_meta)}catch(t){o={}}create_globe(t,o)}}};var create_globe=function(t,e){let o=document.getElementById("itt_globe_"+t);globe_ut_prepareData(e),globe_ut_setupData(e,{points:"pointDefaults",dotLabels:"labelDefaults"}),globe_ut_prepareViewport(o,e);let n={rendererConfig:{antialias:!0,alpha:!0},waitForGlobeReady:!0,animateIn:void 0===e.animateIn||globe_ut_bool(e.animateIn)},l=Globe(n)(document.getElementById("itt_globe_"+t));"transparent"===e.backgroundColor&&(e.backgroundColor="rgba(0,0,0,0)"),null!==e.globeImage&&""!==e.globeImage&&"earth-hollow"!==e.globeImage&&"noImage"!==e.globeImage&&"customImage"!==e.globeImage&&l.globeImageUrl(ittGlobeData.imagesUrl+e.globeImage),l.backgroundColor(e.backgroundColor).width(o.offsetWidth).height(o.offsetHeight).showGraticules(globe_ut_bool(e.showGraticules)).showAtmosphere(globe_ut_bool(e.atmosphere.enabled)).atmosphereColor(e.atmosphere.atmosphereColor).atmosphereAltitude(e.atmosphere.atmosphereAltitude).pointOfView(e.pointOfView),setupInteractions(l,e),setupResizeEvent(l,o,e),ittGlobeData.isAdmin&&l.onGlobeReady((function(){const t=new Event("adminGlobeReady");document.dispatchEvent(t)})),e.points&&addPointsLayer(l,e),e.dotLabels&&addLabelsLayer(l,e),ittGlobes.globes.push(l),ittGlobes.globesIndex[t]=l};ittGlobes.init(),window.ittGlobes=ittGlobes;export{ittGlobes};
     1function setupTooltip(t,e){let o=t.tooltipContent??"";return void 0!==e&&"{tooltipContent}"!==e&&e.length>0&&(o=e.replace(/\{([^}]+)\}/g,(function(e,o){const n=o.split(".");let i=t;for(let t=0;t<n.length;t++)i=i?i[n[t]]:void 0;return void 0!==i?i:""}))),""!==o&&(o='<div class="itt_globe_'+t.globe_id+' itt_globe_tooltip">'+o+"</div>"),o}const globe_ut_prepareURL=function(t){if("string"!=typeof t)return t;var e;(t=t.replace(/&amp;/gi,"&")).replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(e)}));try{e=new URL(t)}catch(t){e=!1}return e&&![null,"http:","https:","mailto:","tel:"].includes(e.protocol)?(console.log("URL protocol not allowed"),""):t},globe_ut_prepareData=function(t){t.hasOwnProperty("dotLabels")&&t.dotLabels||(t.dotlabels=[]),t.hasOwnProperty("points")&&t.points||(t.points=[]);let e={showGraticules:!1,backgroundColor:"transparent",atmosphere:{enabled:!1,atmosphereColor:null,atmosphereAltitude:null},globeImage:"earth-day.jpg"};return(0===Object.keys(t).length||t.emptyPreview)&&Object.assign(t,e),t.pointOfView={lat:0,lng:0,altitude:1.5},t.centerCoordinates&&(t.pointOfView.lat=globe_ut_float(t.centerCoordinates.latitude),t.pointOfView.lng=globe_ut_float(t.centerCoordinates.longitude),t.pointOfView.altitude=globe_ut_float(t.altitude)),t},globe_ut_setupData=function(t,e){for(const o in e){let n=e[o];Array.isArray(t[o])&&t[o]&&t[o].map((function(e){(void 0===e.useCustom||void 0!==e.useCustom&&!globe_ut_bool(e.useCustom))&&Object.assign(e,t[n]),e.action&&"default"===e.action&&(e.action=t[n].action)}))}},globe_ut_prepareViewport=function(t,e){var o=t.closest(".itt_globe_aspect_ratio");window.innerWidth<=780&&void 0!==e.paddingTop&&""!==e.paddingTop?o.style.paddingTop=String(e.paddingTopMobile)+"%":o.style.paddingTop=String(e.paddingTop)+"%"},globe_ut_float=function(t){var e=parseFloat(t);return isNaN(e)?0:e},globe_ut_bool=function(t){return 0!==Number(t)&&"false"!==t&&void 0!==t},globe_ut_prepare_coordinates=function(t,e){return void 0!==e.coordinates&&e.coordinates[t]?parseFloat(e.coordinates[t]):void 0!==e[t]&&parseFloat(e[t])};function setupClickEvent(t,e,o){let n={arcLines:"arcLineDefaults",points:"pointDefaults",dotLabels:"labelDefaults",regions:"regionDefaults"};if("regions"===o.type&&(o={...o.properties}),new URLSearchParams(window.location.search).has("debug")&&console.debug(o),"default"===o.action&&(o.action=e[n[o.type]].action),"none"===o.action)return;const i=o.action;i&&"function"==typeof window.ittGlobes.clickActions[i]&&window.ittGlobes.clickActions[i](t,e,o),ittGlobeData.isAdmin||("open_url"!==o.action&&"open_url_new"!==o.action||(o.content=globe_ut_prepareURL(o.content)),"open_url"===o.action&&""!==o.content?document.location=o.content:"open_url_new"===o.action&&""!==o.content&&window.open(o.content))}function setupHoverEvent(t,e,o){let n=t.meta;return"regions"===o?t.polygonCapColor((function(t){return void 0===e||e&&void 0===e.properties?t.properties.color?t.properties.color:n.regionDefaults.inactive:t===e||t.properties.originalId&&e&&e.properties&&e.properties.id&&t.properties.originalId.includes(e.properties.id)||t.properties.originalId&&e&&e.properties&&Array.isArray(e.properties.id)&&e.properties.id.includes(t.properties.id)?t.properties.hover:t.properties.color?t.properties.color:n.regionDefaults.inactive})):(t.labelColor((function(t){return e&&t.id===e.id?t.hover:t.color})),t.pointColor((function(t){return e&&t.id===e.id?t.hover:t.color})),void 0!==n.rotate&&globe_ut_bool(n.rotate.enabled)&&(t.controls().autoRotate=!e)),t}function addPointsLayer(t,e){t.pointsData(e.points).pointLat((t=>globe_ut_prepare_coordinates("latitude",t))).pointLng((t=>globe_ut_prepare_coordinates("longitude",t))).pointRadius((t=>t.radius/10)).pointAltitude((t=>t.altitude/100)).pointColor((t=>t.color)).pointResolution(20),t.pointLabel((function(t){let o=e.tooltipTemplate??"{tooltipContent}";return e.pointsTooltipTemplate&&(o=e.pointsTooltipTemplate),setupTooltip(t,o)})),t.onPointClick((function(o){setupClickEvent(t,e,o)})),t.onPointHover((function(e){setupHoverEvent(t,e,"point")}))}function addLabelsLayer(t,e){if(t.labelsData(e.dotLabels).labelLat((t=>globe_ut_prepare_coordinates("latitude",t))).labelLng((t=>globe_ut_prepare_coordinates("longitude",t))).labelText((t=>t.title&&t.title.trim()?t.title:"_")).labelAltitude((t=>t.altitude/100)).labelSize((t=>t.size/10)).labelColor((t=>t.color)).labelResolution(20).labelIncludeDot((t=>globe_ut_bool(t.includeDot))).labelDotRadius((t=>t.radius/10)).labelDotOrientation((t=>t.dotOrientation)),e.labelFont&&"default"!==e.labelFont){let o=ittGlobeData.assetsUrl+"fonts/"+e.labelFont+".json";fetch(o).then((t=>t.json())).then((e=>{t.labelTypeFace(e)})).catch((t=>{console.error("Fetch error:",t)}))}t.labelLabel((function(t){let o=e.tooltipTemplate??"{tooltipContent}";return e.dotLabelsTooltipTemplate&&(o=e.dotLabelsTooltipTemplate),setupTooltip(t,o)})),t.onLabelClick((function(o,n,i){setupClickEvent(t,e,o)})),t.onLabelHover((function(e){setupHoverEvent(t,e,"label")}))}function setupResizeEvent(t,e,o){var n=e.closest(".itt_globe_aspect_ratio");window.addEventListener("resize",(function(){window.innerWidth<=780&&void 0!==o.paddingTop&&""!==o.paddingTop?n.style.paddingTop=String(o.paddingTopMobile)+"%":n.style.paddingTop=String(o.paddingTop)+"%",t.width()!==e.offsetWidth&&t.width(e.offsetWidth).height(e.offsetHeight)}))}function setupInteractions(t,e){void 0!==e.interactions&&(t.controls().enableZoom=globe_ut_bool(e.interactions.zoom),t.controls().enablePan=globe_ut_bool(e.interactions.pan),t.controls().enableRotate=globe_ut_bool(e.interactions.pan))}let ittGlobes={globes:[],globesIndex:{},clickActions:{},init:function(){if("undefined"==typeof Globe)return void console.error("Globe lib not loaded properly");let t=document.getElementsByClassName("js-itt-globe-render");for(const e of t){if(!e.dataset.hasOwnProperty("globe_id"))continue;let t=0;try{t=parseInt(JSON.parse(e.dataset.globe_id))}catch(t){continue}if(void 0!==ittGlobes.globesIndex[t])continue;if(!e.dataset.hasOwnProperty("globe_meta"))continue;let o={};try{o=JSON.parse(e.dataset.globe_meta)}catch(t){o={}}create_globe(t,o)}}};var create_globe=function(t,e){let o=document.getElementById("itt_globe_"+t);globe_ut_prepareData(e),globe_ut_setupData(e,{points:"pointDefaults",dotLabels:"labelDefaults"}),globe_ut_prepareViewport(o,e);let n={rendererConfig:{antialias:!0,alpha:!0},waitForGlobeReady:!0,animateIn:void 0===e.animateIn||globe_ut_bool(e.animateIn)},i=Globe(n)(document.getElementById("itt_globe_"+t));i.meta=e,"transparent"===e.backgroundColor&&(e.backgroundColor="rgba(0,0,0,0)"),null!==e.globeImage&&""!==e.globeImage&&"earth-hollow"!==e.globeImage&&"noImage"!==e.globeImage&&"customImage"!==e.globeImage&&i.globeImageUrl(ittGlobeData.imagesUrl+e.globeImage),i.backgroundColor(e.backgroundColor).width(o.offsetWidth).height(o.offsetHeight).showGraticules(globe_ut_bool(e.showGraticules)).showAtmosphere(globe_ut_bool(e.atmosphere.enabled)).atmosphereColor(e.atmosphere.atmosphereColor).atmosphereAltitude(e.atmosphere.atmosphereAltitude).pointOfView(e.pointOfView),setupInteractions(i,e),setupResizeEvent(i,o,e),ittGlobeData.isAdmin&&i.onGlobeReady((function(){const t=new Event("adminGlobeReady");document.dispatchEvent(t)})),e.points&&addPointsLayer(i,e),e.dotLabels&&addLabelsLayer(i,e),i.setupClickEvent=setupClickEvent,i.setupHoverEvent=setupHoverEvent,ittGlobes.globes.push(i),ittGlobes.globesIndex[t]=i};ittGlobes.init(),window.ittGlobes=ittGlobes;export{ittGlobes};
  • interactive-globes/trunk/dist/assets/js/vendor/public/globe.gl.min.js

    r3158721 r3207680  
    1 // Version 2.32.3 globe.gl - https://github.com/vasturiano/globe.gl
    2 !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Globe=e()}(this,(function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function r(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function a(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".scene-container .clickable {\n  cursor: pointer;\n}");const s="162",A={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},l=0,c=1,u=2,h=3,f=1,d=2,p=3,m=0,g=1,v=100,_=0,y=1,x=2,b=0,M=1,w=2,E=3,S=4,T=5,C=6,R=7,P=301,L=302,D=306,O=1e3,I=1001,q=1002,U=1003,N=1005,B=1006,k=1007,F=1008,z=1009,G=1012,H=1013,j=1014,V=1015,W=1016,X=1020,Q=1023,Y=1026,Z=1027,K=33776,J=33777,$=33778,tt=33779,et=36492,nt="",rt="srgb",it="srgb-linear",at="display-p3",ot="display-p3-linear",st="linear",At="srgb",lt="rec709",ct="p3",ut=7680,ht=35044,ft="300 es",dt=1035,pt=2e3,mt=2001;class gt{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,r=n.length;e<r;e++)n[e].call(this,t);t.target=null}}}const vt=["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 _t=1234567;const yt=Math.PI/180,xt=180/Math.PI;function bt(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(vt[255&t]+vt[t>>8&255]+vt[t>>16&255]+vt[t>>24&255]+"-"+vt[255&e]+vt[e>>8&255]+"-"+vt[e>>16&15|64]+vt[e>>24&255]+"-"+vt[63&n|128]+vt[n>>8&255]+"-"+vt[n>>16&255]+vt[n>>24&255]+vt[255&r]+vt[r>>8&255]+vt[r>>16&255]+vt[r>>24&255]).toLowerCase()}function Mt(t,e,n){return Math.max(e,Math.min(n,t))}function wt(t,e){return(t%e+e)%e}function Et(t,e,n){return(1-n)*t+n*e}function St(t){return!(t&t-1)&&0!==t}function Tt(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Ct(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Rt(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Pt={DEG2RAD:yt,RAD2DEG:xt,generateUUID:bt,clamp:Mt,euclideanModulo:wt,mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Et,damp:function(t,e,n,r){return Et(t,e,1-Math.exp(-n*r))},pingpong:function(t,e=1){return e-Math.abs(wt(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(_t=t);let e=_t+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*yt},radToDeg:function(t){return t*xt},isPowerOfTwo:St,ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:Tt,setQuaternionFromProperEuler:function(t,e,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),A=o(n/2),l=a((e+r)/2),c=o((e+r)/2),u=a((e-r)/2),h=o((e-r)/2),f=a((r-e)/2),d=o((r-e)/2);switch(i){case"XYX":t.set(s*c,A*u,A*h,s*l);break;case"YZY":t.set(A*h,s*c,A*u,s*l);break;case"ZXZ":t.set(A*u,A*h,s*c,s*l);break;case"XZX":t.set(s*c,A*d,A*f,s*l);break;case"YXY":t.set(A*f,s*c,A*d,s*l);break;case"ZYZ":t.set(A*d,A*f,s*c,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:Rt,denormalize:Ct};class Lt{constructor(t=0,e=0){Lt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Mt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*n-a*r+t.x,this.y=i*r+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Dt{constructor(t,e,n,r,i,a,o,s,A){Dt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,a,o,s,A)}set(t,e,n,r,i,a,o,s,A){const l=this.elements;return l[0]=t,l[1]=r,l[2]=o,l[3]=e,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=A,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[3],s=n[6],A=n[1],l=n[4],c=n[7],u=n[2],h=n[5],f=n[8],d=r[0],p=r[3],m=r[6],g=r[1],v=r[4],_=r[7],y=r[2],x=r[5],b=r[8];return i[0]=a*d+o*g+s*y,i[3]=a*p+o*v+s*x,i[6]=a*m+o*_+s*b,i[1]=A*d+l*g+c*y,i[4]=A*p+l*v+c*x,i[7]=A*m+l*_+c*b,i[2]=u*d+h*g+f*y,i[5]=u*p+h*v+f*x,i[8]=u*m+h*_+f*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8];return e*a*l-e*o*A-n*i*l+n*o*s+r*i*A-r*a*s}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8],c=l*a-o*A,u=o*s-l*i,h=A*i-a*s,f=e*c+n*u+r*h;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const d=1/f;return t[0]=c*d,t[1]=(r*A-l*n)*d,t[2]=(o*n-r*a)*d,t[3]=u*d,t[4]=(l*e-r*s)*d,t[5]=(r*i-o*e)*d,t[6]=h*d,t[7]=(n*s-A*e)*d,t[8]=(a*e-n*i)*d,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,i,a,o){const s=Math.cos(i),A=Math.sin(i);return this.set(n*s,n*A,-n*(s*a+A*o)+a+t,-r*A,r*s,-r*(-A*a+s*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Ot.makeScale(t,e)),this}rotate(t){return this.premultiply(Ot.makeRotation(-t)),this}translate(t,e){return this.premultiply(Ot.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const Ot=new Dt;function It(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function qt(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Ut(){const t=qt("canvas");return t.style.display="block",t}const Nt={};function Bt(t){t in Nt||(Nt[t]=!0,console.warn(t))}const kt=(new Dt).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Ft=(new Dt).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zt={[it]:{transfer:st,primaries:lt,toReference:t=>t,fromReference:t=>t},[rt]:{transfer:At,primaries:lt,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[ot]:{transfer:st,primaries:ct,toReference:t=>t.applyMatrix3(Ft),fromReference:t=>t.applyMatrix3(kt)},[at]:{transfer:At,primaries:ct,toReference:t=>t.convertSRGBToLinear().applyMatrix3(Ft),fromReference:t=>t.applyMatrix3(kt).convertLinearToSRGB()}},Gt=new Set([it,ot]),Ht={enabled:!0,_workingColorSpace:it,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Gt.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const r=zt[e].toReference;return(0,zt[n].fromReference)(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return zt[t].primaries},getTransfer:function(t){return t===nt?st:zt[t].transfer}};function jt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Vt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let Wt;class Xt{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Wt&&(Wt=qt("canvas")),Wt.width=t.width,Wt.height=t.height;const n=Wt.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Wt}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=qt("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height),i=r.data;for(let t=0;t<i.length;t++)i[t]=255*jt(i[t]/255);return n.putImageData(r,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*jt(e[t]/255)):e[t]=jt(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let Qt=0;class Yt{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Qt++}),this.uuid=bt(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e<n;e++)r[e].isDataTexture?t.push(Zt(r[e].image)):t.push(Zt(r[e]))}else t=Zt(r);n.url=t}return e||(t.images[this.uuid]=n),n}}function Zt(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Xt.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Kt=0;class Jt extends gt{constructor(t=Jt.DEFAULT_IMAGE,e=Jt.DEFAULT_MAPPING,n=1001,r=1001,i=1006,a=1008,o=1023,s=1009,A=Jt.DEFAULT_ANISOTROPY,l=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Kt++}),this.uuid=bt(),this.name="",this.source=new Yt(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=A,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Lt(0,0),this.repeat=new Lt(1,1),this.center=new Lt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).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&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case O:t.x=t.x-Math.floor(t.x);break;case I:t.x=t.x<0?0:1;break;case q:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case O:t.y=t.y-Math.floor(t.y);break;case I:t.y=t.y<0?0:1;break;case q:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}}Jt.DEFAULT_IMAGE=null,Jt.DEFAULT_MAPPING=300,Jt.DEFAULT_ANISOTROPY=1;class $t{constructor(t=0,e=0,n=0,r=1){$t.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,i;const a=.01,o=.1,s=t.elements,A=s[0],l=s[4],c=s[8],u=s[1],h=s[5],f=s[9],d=s[2],p=s[6],m=s[10];if(Math.abs(l-u)<a&&Math.abs(c-d)<a&&Math.abs(f-p)<a){if(Math.abs(l+u)<o&&Math.abs(c+d)<o&&Math.abs(f+p)<o&&Math.abs(A+h+m-3)<o)return this.set(1,0,0,0),this;e=Math.PI;const t=(A+1)/2,s=(h+1)/2,g=(m+1)/2,v=(l+u)/4,_=(c+d)/4,y=(f+p)/4;return t>s&&t>g?t<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(t),r=v/n,i=_/n):s>g?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=y/r):g<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(g),n=_/i,r=y/i),this.set(n,r,i,e),this}let g=Math.sqrt((p-f)*(p-f)+(c-d)*(c-d)+(u-l)*(u-l));return Math.abs(g)<.001&&(g=1),this.x=(p-f)/g,this.y=(c-d)/g,this.z=(u-l)/g,this.w=Math.acos((A+h+m-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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 te extends gt{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new $t(0,0,t,e),this.scissorTest=!1,this.viewport=new $t(0,0,t,e);const r={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:B,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const i=new Jt(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);i.flipY=!1,i.generateMipmaps=n.generateMipmaps,i.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let t=0;t<a;t++)this.textures[t]=i.clone(),this.textures[t].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++)this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new Yt(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ee extends te{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class ne extends Jt{constructor(t=null,e=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=U,this.minFilter=U,this.wrapR=I,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class re extends Jt{constructor(t=null,e=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=U,this.minFilter=U,this.wrapR=I,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ie{constructor(t=0,e=0,n=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=r}static slerpFlat(t,e,n,r,i,a,o){let s=n[r+0],A=n[r+1],l=n[r+2],c=n[r+3];const u=i[a+0],h=i[a+1],f=i[a+2],d=i[a+3];if(0===o)return t[e+0]=s,t[e+1]=A,t[e+2]=l,void(t[e+3]=c);if(1===o)return t[e+0]=u,t[e+1]=h,t[e+2]=f,void(t[e+3]=d);if(c!==d||s!==u||A!==h||l!==f){let t=1-o;const e=s*u+A*h+l*f+c*d,n=e>=0?1:-1,r=1-e*e;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,e*n);t=Math.sin(t*a)/i,o=Math.sin(o*a)/i}const i=o*n;if(s=s*t+u*i,A=A*t+h*i,l=l*t+f*i,c=c*t+d*i,t===1-o){const t=1/Math.sqrt(s*s+A*A+l*l+c*c);s*=t,A*=t,l*=t,c*=t}}t[e]=s,t[e+1]=A,t[e+2]=l,t[e+3]=c}static multiplyQuaternionsFlat(t,e,n,r,i,a){const o=n[r],s=n[r+1],A=n[r+2],l=n[r+3],c=i[a],u=i[a+1],h=i[a+2],f=i[a+3];return t[e]=o*f+l*c+s*h-A*u,t[e+1]=s*f+l*u+A*c-o*h,t[e+2]=A*f+l*h+o*u-s*c,t[e+3]=l*f-o*c-s*u-A*h,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,r=t._y,i=t._z,a=t._order,o=Math.cos,s=Math.sin,A=o(n/2),l=o(r/2),c=o(i/2),u=s(n/2),h=s(r/2),f=s(i/2);switch(a){case"XYZ":this._x=u*l*c+A*h*f,this._y=A*h*c-u*l*f,this._z=A*l*f+u*h*c,this._w=A*l*c-u*h*f;break;case"YXZ":this._x=u*l*c+A*h*f,this._y=A*h*c-u*l*f,this._z=A*l*f-u*h*c,this._w=A*l*c+u*h*f;break;case"ZXY":this._x=u*l*c-A*h*f,this._y=A*h*c+u*l*f,this._z=A*l*f+u*h*c,this._w=A*l*c-u*h*f;break;case"ZYX":this._x=u*l*c-A*h*f,this._y=A*h*c+u*l*f,this._z=A*l*f-u*h*c,this._w=A*l*c+u*h*f;break;case"YZX":this._x=u*l*c+A*h*f,this._y=A*h*c+u*l*f,this._z=A*l*f-u*h*c,this._w=A*l*c-u*h*f;break;case"XZY":this._x=u*l*c-A*h*f,this._y=A*h*c-u*l*f,this._z=A*l*f+u*h*c,this._w=A*l*c+u*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],i=e[8],a=e[1],o=e[5],s=e[9],A=e[2],l=e[6],c=e[10],u=n+o+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(l-s)*t,this._y=(i-A)*t,this._z=(a-r)*t}else if(n>o&&n>c){const t=2*Math.sqrt(1+n-o-c);this._w=(l-s)/t,this._x=.25*t,this._y=(r+a)/t,this._z=(i+A)/t}else if(o>c){const t=2*Math.sqrt(1+o-n-c);this._w=(i-A)/t,this._x=(r+a)/t,this._y=.25*t,this._z=(s+l)/t}else{const t=2*Math.sqrt(1+c-n-o);this._w=(a-r)/t,this._x=(i+A)/t,this._y=(s+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Mt(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const r=Math.min(1,e/n);return this.slerp(t,r),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,i=t._z,a=t._w,o=e._x,s=e._y,A=e._z,l=e._w;return this._x=n*l+a*o+r*A-i*s,this._y=r*l+a*s+i*o-n*A,this._z=i*l+a*A+n*s-r*o,this._w=a*l-n*o-r*s-i*A,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*t._w+n*t._x+r*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const t=1-e;return this._w=t*a+e*this._w,this._x=t*n+e*this._x,this._y=t*r+e*this._y,this._z=t*i+e*this._z,this.normalize(),this}const A=Math.sqrt(s),l=Math.atan2(A,o),c=Math.sin((1-e)*l)/A,u=Math.sin(e*l)/A;return this._w=a*c+this._w*u,this._x=n*c+this._x*u,this._y=r*c+this._y*u,this._z=i*c+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(t),r*Math.cos(t),i*Math.sin(e),i*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ae{constructor(t=0,e=0,n=0){ae.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(se.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(se.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=t.elements,a=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,i=t.x,a=t.y,o=t.z,s=t.w,A=2*(a*r-o*n),l=2*(o*e-i*r),c=2*(i*n-a*e);return this.x=e+s*A+a*c-o*l,this.y=n+s*l+o*A-i*c,this.z=r+s*c+i*l-a*A,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return oe.copy(this).projectOnVector(t),this.sub(oe)}reflect(t){return this.sub(oe.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Mt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const oe=new ae,se=new ie;class Ae{constructor(t=new ae(1/0,1/0,1/0),e=new ae(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(ce.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(ce.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=ce.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===e&&void 0!==r&&!0!==t.isInstancedMesh)for(let e=0,n=r.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,ce):ce.fromBufferAttribute(r,e),ce.applyMatrix4(t.matrixWorld),this.expandByPoint(ce);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),ue.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),ue.copy(n.boundingBox)),ue.applyMatrix4(t.matrixWorld),this.union(ue)}const r=t.children;for(let t=0,n=r.length;t<n;t++)this.expandByObject(r[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,ce),ce.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ve),_e.subVectors(this.max,ve),he.subVectors(t.a,ve),fe.subVectors(t.b,ve),de.subVectors(t.c,ve),pe.subVectors(fe,he),me.subVectors(de,fe),ge.subVectors(he,de);let e=[0,-pe.z,pe.y,0,-me.z,me.y,0,-ge.z,ge.y,pe.z,0,-pe.x,me.z,0,-me.x,ge.z,0,-ge.x,-pe.y,pe.x,0,-me.y,me.x,0,-ge.y,ge.x,0];return!!be(e,he,fe,de,_e)&&(e=[1,0,0,0,1,0,0,0,1],!!be(e,he,fe,de,_e)&&(ye.crossVectors(pe,me),e=[ye.x,ye.y,ye.z],be(e,he,fe,de,_e)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ce).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(ce).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(le[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),le[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),le[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),le[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),le[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),le[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),le[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),le[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(le)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const le=[new ae,new ae,new ae,new ae,new ae,new ae,new ae,new ae],ce=new ae,ue=new Ae,he=new ae,fe=new ae,de=new ae,pe=new ae,me=new ae,ge=new ae,ve=new ae,_e=new ae,ye=new ae,xe=new ae;function be(t,e,n,r,i){for(let a=0,o=t.length-3;a<=o;a+=3){xe.fromArray(t,a);const o=i.x*Math.abs(xe.x)+i.y*Math.abs(xe.y)+i.z*Math.abs(xe.z),s=e.dot(xe),A=n.dot(xe),l=r.dot(xe);if(Math.max(-Math.max(s,A,l),Math.min(s,A,l))>o)return!1}return!0}const Me=new Ae,we=new ae,Ee=new ae;class Se{constructor(t=new ae,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Me.setFromPoints(t).getCenter(n);let r=0;for(let e=0,i=t.length;e<i;e++)r=Math.max(r,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;we.subVectors(t,this.center);const e=we.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(we,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Ee.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(we.copy(t.center).add(Ee)),this.expandByPoint(we.copy(t.center).sub(Ee))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Te=new ae,Ce=new ae,Re=new ae,Pe=new ae,Le=new ae,De=new ae,Oe=new ae;class Ie{constructor(t=new ae,e=new ae(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Te)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Te.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Te.copy(this.origin).addScaledVector(this.direction,e),Te.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){Ce.copy(t).add(e).multiplyScalar(.5),Re.copy(e).sub(t).normalize(),Pe.copy(this.origin).sub(Ce);const i=.5*t.distanceTo(e),a=-this.direction.dot(Re),o=Pe.dot(this.direction),s=-Pe.dot(Re),A=Pe.lengthSq(),l=Math.abs(1-a*a);let c,u,h,f;if(l>0)if(c=a*s-o,u=a*o-s,f=i*l,c>=0)if(u>=-f)if(u<=f){const t=1/l;c*=t,u*=t,h=c*(c+a*u+2*o)+u*(a*c+u+2*s)+A}else u=i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;else u=-i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;else u<=-f?(c=Math.max(0,-(-a*i+o)),u=c>0?-i:Math.min(Math.max(-i,-s),i),h=-c*c+u*(u+2*s)+A):u<=f?(c=0,u=Math.min(Math.max(-i,-s),i),h=u*(u+2*s)+A):(c=Math.max(0,-(a*i+o)),u=c>0?i:Math.min(Math.max(-i,-s),i),h=-c*c+u*(u+2*s)+A);else u=a>0?-i:i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;return n&&n.copy(this.origin).addScaledVector(this.direction,c),r&&r.copy(Ce).addScaledVector(Re,u),h}intersectSphere(t,e){Te.subVectors(t.center,this.origin);const n=Te.dot(this.direction),r=Te.dot(Te)-n*n,i=t.radius*t.radius;if(r>i)return null;const a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,i,a,o,s;const A=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,u=this.origin;return A>=0?(n=(t.min.x-u.x)*A,r=(t.max.x-u.x)*A):(n=(t.max.x-u.x)*A,r=(t.min.x-u.x)*A),l>=0?(i=(t.min.y-u.y)*l,a=(t.max.y-u.y)*l):(i=(t.max.y-u.y)*l,a=(t.min.y-u.y)*l),n>a||i>r?null:((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),c>=0?(o=(t.min.z-u.z)*c,s=(t.max.z-u.z)*c):(o=(t.max.z-u.z)*c,s=(t.min.z-u.z)*c),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return null!==this.intersectBox(t,Te)}intersectTriangle(t,e,n,r,i){Le.subVectors(e,t),De.subVectors(n,t),Oe.crossVectors(Le,De);let a,o=this.direction.dot(Oe);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Pe.subVectors(this.origin,t);const s=a*this.direction.dot(De.crossVectors(Pe,De));if(s<0)return null;const A=a*this.direction.dot(Le.cross(Pe));if(A<0)return null;if(s+A>o)return null;const l=-a*Pe.dot(Oe);return l<0?null:this.at(l/o,i)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class qe{constructor(t,e,n,r,i,a,o,s,A,l,c,u,h,f,d,p){qe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,a,o,s,A,l,c,u,h,f,d,p)}set(t,e,n,r,i,a,o,s,A,l,c,u,h,f,d,p){const m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=r,m[1]=i,m[5]=a,m[9]=o,m[13]=s,m[2]=A,m[6]=l,m[10]=c,m[14]=u,m[3]=h,m[7]=f,m[11]=d,m[15]=p,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 qe).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Ue.setFromMatrixColumn(t,0).length(),i=1/Ue.setFromMatrixColumn(t,1).length(),a=1/Ue.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,r=t.y,i=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),A=Math.sin(r),l=Math.cos(i),c=Math.sin(i);if("XYZ"===t.order){const t=a*l,n=a*c,r=o*l,i=o*c;e[0]=s*l,e[4]=-s*c,e[8]=A,e[1]=n+r*A,e[5]=t-i*A,e[9]=-o*s,e[2]=i-t*A,e[6]=r+n*A,e[10]=a*s}else if("YXZ"===t.order){const t=s*l,n=s*c,r=A*l,i=A*c;e[0]=t+i*o,e[4]=r*o-n,e[8]=a*A,e[1]=a*c,e[5]=a*l,e[9]=-o,e[2]=n*o-r,e[6]=i+t*o,e[10]=a*s}else if("ZXY"===t.order){const t=s*l,n=s*c,r=A*l,i=A*c;e[0]=t-i*o,e[4]=-a*c,e[8]=r+n*o,e[1]=n+r*o,e[5]=a*l,e[9]=i-t*o,e[2]=-a*A,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){const t=a*l,n=a*c,r=o*l,i=o*c;e[0]=s*l,e[4]=r*A-n,e[8]=t*A+i,e[1]=s*c,e[5]=i*A+t,e[9]=n*A-r,e[2]=-A,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){const t=a*s,n=a*A,r=o*s,i=o*A;e[0]=s*l,e[4]=i-t*c,e[8]=r*c+n,e[1]=c,e[5]=a*l,e[9]=-o*l,e[2]=-A*l,e[6]=n*c+r,e[10]=t-i*c}else if("XZY"===t.order){const t=a*s,n=a*A,r=o*s,i=o*A;e[0]=s*l,e[4]=-c,e[8]=A*l,e[1]=t*c+i,e[5]=a*l,e[9]=n*c-r,e[2]=r*c-n,e[6]=o*l,e[10]=i*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Be,t,ke)}lookAt(t,e,n){const r=this.elements;return Ge.subVectors(t,e),0===Ge.lengthSq()&&(Ge.z=1),Ge.normalize(),Fe.crossVectors(n,Ge),0===Fe.lengthSq()&&(1===Math.abs(n.z)?Ge.x+=1e-4:Ge.z+=1e-4,Ge.normalize(),Fe.crossVectors(n,Ge)),Fe.normalize(),ze.crossVectors(Ge,Fe),r[0]=Fe.x,r[4]=ze.x,r[8]=Ge.x,r[1]=Fe.y,r[5]=ze.y,r[9]=Ge.y,r[2]=Fe.z,r[6]=ze.z,r[10]=Ge.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[4],s=n[8],A=n[12],l=n[1],c=n[5],u=n[9],h=n[13],f=n[2],d=n[6],p=n[10],m=n[14],g=n[3],v=n[7],_=n[11],y=n[15],x=r[0],b=r[4],M=r[8],w=r[12],E=r[1],S=r[5],T=r[9],C=r[13],R=r[2],P=r[6],L=r[10],D=r[14],O=r[3],I=r[7],q=r[11],U=r[15];return i[0]=a*x+o*E+s*R+A*O,i[4]=a*b+o*S+s*P+A*I,i[8]=a*M+o*T+s*L+A*q,i[12]=a*w+o*C+s*D+A*U,i[1]=l*x+c*E+u*R+h*O,i[5]=l*b+c*S+u*P+h*I,i[9]=l*M+c*T+u*L+h*q,i[13]=l*w+c*C+u*D+h*U,i[2]=f*x+d*E+p*R+m*O,i[6]=f*b+d*S+p*P+m*I,i[10]=f*M+d*T+p*L+m*q,i[14]=f*w+d*C+p*D+m*U,i[3]=g*x+v*E+_*R+y*O,i[7]=g*b+v*S+_*P+y*I,i[11]=g*M+v*T+_*L+y*q,i[15]=g*w+v*C+_*D+y*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],A=t[13],l=t[2],c=t[6],u=t[10],h=t[14];return t[3]*(+i*s*c-r*A*c-i*o*u+n*A*u+r*o*h-n*s*h)+t[7]*(+e*s*h-e*A*u+i*a*u-r*a*h+r*A*l-i*s*l)+t[11]*(+e*A*c-e*o*h-i*a*c+n*a*h+i*o*l-n*A*l)+t[15]*(-r*o*l-e*s*c+e*o*u+r*a*c-n*a*u+n*s*l)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8],c=t[9],u=t[10],h=t[11],f=t[12],d=t[13],p=t[14],m=t[15],g=c*p*A-d*u*A+d*s*h-o*p*h-c*s*m+o*u*m,v=f*u*A-l*p*A-f*s*h+a*p*h+l*s*m-a*u*m,_=l*d*A-f*c*A+f*o*h-a*d*h-l*o*m+a*c*m,y=f*c*s-l*d*s-f*o*u+a*d*u+l*o*p-a*c*p,x=e*g+n*v+r*_+i*y;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return t[0]=g*b,t[1]=(d*u*i-c*p*i-d*r*h+n*p*h+c*r*m-n*u*m)*b,t[2]=(o*p*i-d*s*i+d*r*A-n*p*A-o*r*m+n*s*m)*b,t[3]=(c*s*i-o*u*i-c*r*A+n*u*A+o*r*h-n*s*h)*b,t[4]=v*b,t[5]=(l*p*i-f*u*i+f*r*h-e*p*h-l*r*m+e*u*m)*b,t[6]=(f*s*i-a*p*i-f*r*A+e*p*A+a*r*m-e*s*m)*b,t[7]=(a*u*i-l*s*i+l*r*A-e*u*A-a*r*h+e*s*h)*b,t[8]=_*b,t[9]=(f*c*i-l*d*i-f*n*h+e*d*h+l*n*m-e*c*m)*b,t[10]=(a*d*i-f*o*i+f*n*A-e*d*A-a*n*m+e*o*m)*b,t[11]=(l*o*i-a*c*i-l*n*A+e*c*A+a*n*h-e*o*h)*b,t[12]=y*b,t[13]=(l*d*r-f*c*r+f*n*u-e*d*u-l*n*p+e*c*p)*b,t[14]=(f*o*r-a*d*r-f*n*s+e*d*s+a*n*p-e*o*p)*b,t[15]=(a*c*r-l*o*r+l*n*s-e*c*s-a*n*u+e*o*u)*b,this}scale(t){const e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),i=1-n,a=t.x,o=t.y,s=t.z,A=i*a,l=i*o;return this.set(A*a+n,A*o-r*s,A*s+r*o,0,A*o+r*s,l*o+n,l*s-r*a,0,A*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,i,a){return this.set(1,n,i,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,i=e._x,a=e._y,o=e._z,s=e._w,A=i+i,l=a+a,c=o+o,u=i*A,h=i*l,f=i*c,d=a*l,p=a*c,m=o*c,g=s*A,v=s*l,_=s*c,y=n.x,x=n.y,b=n.z;return r[0]=(1-(d+m))*y,r[1]=(h+_)*y,r[2]=(f-v)*y,r[3]=0,r[4]=(h-_)*x,r[5]=(1-(u+m))*x,r[6]=(p+g)*x,r[7]=0,r[8]=(f+v)*b,r[9]=(p-g)*b,r[10]=(1-(u+d))*b,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let i=Ue.set(r[0],r[1],r[2]).length();const a=Ue.set(r[4],r[5],r[6]).length(),o=Ue.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],Ne.copy(this);const s=1/i,A=1/a,l=1/o;return Ne.elements[0]*=s,Ne.elements[1]*=s,Ne.elements[2]*=s,Ne.elements[4]*=A,Ne.elements[5]*=A,Ne.elements[6]*=A,Ne.elements[8]*=l,Ne.elements[9]*=l,Ne.elements[10]*=l,e.setFromRotationMatrix(Ne),n.x=i,n.y=a,n.z=o,this}makePerspective(t,e,n,r,i,a,o=2e3){const s=this.elements,A=2*i/(e-t),l=2*i/(n-r),c=(e+t)/(e-t),u=(n+r)/(n-r);let h,f;if(o===pt)h=-(a+i)/(a-i),f=-2*a*i/(a-i);else{if(o!==mt)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);h=-a/(a-i),f=-a*i/(a-i)}return s[0]=A,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=f,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(t,e,n,r,i,a,o=2e3){const s=this.elements,A=1/(e-t),l=1/(n-r),c=1/(a-i),u=(e+t)*A,h=(n+r)*l;let f,d;if(o===pt)f=(a+i)*c,d=-2*c;else{if(o!==mt)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);f=i*c,d=-1*c}return s[0]=2*A,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=d,s[14]=-f,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Ue=new ae,Ne=new qe,Be=new ae(0,0,0),ke=new ae(1,1,1),Fe=new ae,ze=new ae,Ge=new ae,He=new qe,je=new ie;class Ve{constructor(t=0,e=0,n=0,r=Ve.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,i=r[0],a=r[4],o=r[8],s=r[1],A=r[5],l=r[9],c=r[2],u=r[6],h=r[10];switch(e){case"XYZ":this._y=Math.asin(Mt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,h),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(u,A),this._z=0);break;case"YXZ":this._x=Math.asin(-Mt(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,h),this._z=Math.atan2(s,A)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(Mt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-c,h),this._z=Math.atan2(-a,A)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-Mt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(u,h),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,A));break;case"YZX":this._z=Math.asin(Mt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,A),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(o,h));break;case"XZY":this._z=Math.asin(-Mt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,A),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return He.makeRotationFromQuaternion(t),this.setFromRotationMatrix(He,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return je.setFromEuler(this),this.setFromQuaternion(je,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ve.DEFAULT_ORDER="XYZ";class We{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return!!(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}let Xe=0;const Qe=new ae,Ye=new ie,Ze=new qe,Ke=new ae,Je=new ae,$e=new ae,tn=new ie,en=new ae(1,0,0),nn=new ae(0,1,0),rn=new ae(0,0,1),an={type:"added"},on={type:"removed"},sn={type:"childadded",child:null},An={type:"childremoved",child:null};class ln extends gt{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Xe++}),this.uuid=bt(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ln.DEFAULT_UP.clone();const t=new ae,e=new Ve,n=new ie,r=new ae(1,1,1);e._onChange((function(){n.setFromEuler(e,!1)})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new qe},normalMatrix:{value:new Dt}}),this.matrix=new qe,this.matrixWorld=new qe,this.matrixAutoUpdate=ln.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=ln.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new We,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Ye.setFromAxisAngle(t,e),this.quaternion.multiply(Ye),this}rotateOnWorldAxis(t,e){return Ye.setFromAxisAngle(t,e),this.quaternion.premultiply(Ye),this}rotateX(t){return this.rotateOnAxis(en,t)}rotateY(t){return this.rotateOnAxis(nn,t)}rotateZ(t){return this.rotateOnAxis(rn,t)}translateOnAxis(t,e){return Qe.copy(t).applyQuaternion(this.quaternion),this.position.add(Qe.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(en,t)}translateY(t){return this.translateOnAxis(nn,t)}translateZ(t){return this.translateOnAxis(rn,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ze.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Ke.copy(t):Ke.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Je.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ze.lookAt(Je,Ke,this.up):Ze.lookAt(Ke,Je,this.up),this.quaternion.setFromRotationMatrix(Ze),r&&(Ze.extractRotation(r.matrixWorld),Ye.setFromRotationMatrix(Ze),this.quaternion.premultiply(Ye.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(an),sn.child=t,this.dispatchEvent(sn),sn.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(on),An.child=t,this.dispatchEvent(An),An.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ze.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Ze.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ze),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Je,t,$e),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Je,tn,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++){const r=e[n];!0!==r.matrixWorldAutoUpdate&&!0!==t||r.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,r=n.length;e<r;e++){const r=n[e];i(t.shapes,r)}else i(t.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,r=this.material.length;n<r;n++)e.push(i(t.materials,this.material[n]));r.material=e}else r.material=i(t.materials,this.material);if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];r.animations.push(i(t.animations,n))}}if(e){const e=a(t.geometries),r=a(t.materials),i=a(t.textures),o=a(t.images),s=a(t.shapes),A=a(t.skeletons),l=a(t.animations),c=a(t.nodes);e.length>0&&(n.geometries=e),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),A.length>0&&(n.skeletons=A),l.length>0&&(n.animations=l),c.length>0&&(n.nodes=c)}return n.object=r,n;function a(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}}ln.DEFAULT_UP=new ae(0,1,0),ln.DEFAULT_MATRIX_AUTO_UPDATE=!0,ln.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const cn=new ae,un=new ae,hn=new ae,fn=new ae,dn=new ae,pn=new ae,mn=new ae,gn=new ae,vn=new ae,_n=new ae;class yn{constructor(t=new ae,e=new ae,n=new ae){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),cn.subVectors(t,e),r.cross(cn);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(t,e,n,r,i){cn.subVectors(r,e),un.subVectors(n,e),hn.subVectors(t,e);const a=cn.dot(cn),o=cn.dot(un),s=cn.dot(hn),A=un.dot(un),l=un.dot(hn),c=a*A-o*o;if(0===c)return i.set(0,0,0),null;const u=1/c,h=(A*s-o*l)*u,f=(a*l-o*s)*u;return i.set(1-h-f,f,h)}static containsPoint(t,e,n,r){return null!==this.getBarycoord(t,e,n,r,fn)&&(fn.x>=0&&fn.y>=0&&fn.x+fn.y<=1)}static getInterpolation(t,e,n,r,i,a,o,s){return null===this.getBarycoord(t,e,n,r,fn)?(s.x=0,s.y=0,"z"in s&&(s.z=0),"w"in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,fn.x),s.addScaledVector(a,fn.y),s.addScaledVector(o,fn.z),s)}static isFrontFacing(t,e,n,r){return cn.subVectors(n,e),un.subVectors(t,e),cn.cross(un).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,n,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,r),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return cn.subVectors(this.c,this.b),un.subVectors(this.a,this.b),.5*cn.cross(un).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return yn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return yn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,r,i){return yn.getInterpolation(t,this.a,this.b,this.c,e,n,r,i)}containsPoint(t){return yn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return yn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,i=this.c;let a,o;dn.subVectors(r,n),pn.subVectors(i,n),gn.subVectors(t,n);const s=dn.dot(gn),A=pn.dot(gn);if(s<=0&&A<=0)return e.copy(n);vn.subVectors(t,r);const l=dn.dot(vn),c=pn.dot(vn);if(l>=0&&c<=l)return e.copy(r);const u=s*c-l*A;if(u<=0&&s>=0&&l<=0)return a=s/(s-l),e.copy(n).addScaledVector(dn,a);_n.subVectors(t,i);const h=dn.dot(_n),f=pn.dot(_n);if(f>=0&&h<=f)return e.copy(i);const d=h*A-s*f;if(d<=0&&A>=0&&f<=0)return o=A/(A-f),e.copy(n).addScaledVector(pn,o);const p=l*f-h*c;if(p<=0&&c-l>=0&&h-f>=0)return mn.subVectors(i,r),o=(c-l)/(c-l+(h-f)),e.copy(r).addScaledVector(mn,o);const m=1/(p+d+u);return a=d*m,o=u*m,e.copy(n).addScaledVector(dn,a).addScaledVector(pn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const xn={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},bn={h:0,s:0,l:0},Mn={h:0,s:0,l:0};function wn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}let En=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=rt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,Ht.toWorkingColorSpace(this,e),this}setRGB(t,e,n,r=Ht.workingColorSpace){return this.r=t,this.g=e,this.b=n,Ht.toWorkingColorSpace(this,r),this}setHSL(t,e,n,r=Ht.workingColorSpace){if(t=wt(t,1),e=Mt(e,0,1),n=Mt(n,0,1),0===e)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=wn(i,r,t+1/3),this.g=wn(i,r,t),this.b=wn(i,r,t-1/3)}return Ht.toWorkingColorSpace(this,r),this}setStyle(t,e=rt){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let i;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(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,e);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(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,e);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 n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=r[1],i=n.length;if(3===i)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===i)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=rt){const n=xn[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=jt(t.r),this.g=jt(t.g),this.b=jt(t.b),this}copyLinearToSRGB(t){return this.r=Vt(t.r),this.g=Vt(t.g),this.b=Vt(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=rt){return Ht.fromWorkingColorSpace(Sn.copy(this),t),65536*Math.round(Mt(255*Sn.r,0,255))+256*Math.round(Mt(255*Sn.g,0,255))+Math.round(Mt(255*Sn.b,0,255))}getHexString(t=rt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ht.workingColorSpace){Ht.fromWorkingColorSpace(Sn.copy(this),e);const n=Sn.r,r=Sn.g,i=Sn.b,a=Math.max(n,r,i),o=Math.min(n,r,i);let s,A;const l=(o+a)/2;if(o===a)s=0,A=0;else{const t=a-o;switch(A=l<=.5?t/(a+o):t/(2-a-o),a){case n:s=(r-i)/t+(r<i?6:0);break;case r:s=(i-n)/t+2;break;case i:s=(n-r)/t+4}s/=6}return t.h=s,t.s=A,t.l=l,t}getRGB(t,e=Ht.workingColorSpace){return Ht.fromWorkingColorSpace(Sn.copy(this),e),t.r=Sn.r,t.g=Sn.g,t.b=Sn.b,t}getStyle(t=rt){Ht.fromWorkingColorSpace(Sn.copy(this),t);const e=Sn.r,n=Sn.g,r=Sn.b;return t!==rt?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(t,e,n){return this.getHSL(bn),this.setHSL(bn.h+t,bn.s+e,bn.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(bn),t.getHSL(Mn);const n=Et(bn.h,Mn.h,e),r=Et(bn.s,Mn.s,e),i=Et(bn.l,Mn.l,e);return this.setHSL(n,r,i),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,r=this.b,i=t.elements;return this.r=i[0]*e+i[3]*n+i[6]*r,this.g=i[1]*e+i[4]*n+i[7]*r,this.b=i[2]*e+i[5]*n+i[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const Sn=new En;En.NAMES=xn;let Tn=0;class Cn extends gt{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Tn++}),this.uuid=bt(),this.name="",this.type="Material",this.blending=1,this.side=m,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=v,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new En(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ut,this.stencilZFail=ut,this.stencilZPass=ut,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(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==m&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==v&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ut&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ut&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ut&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=r(t.textures),i=r(t.images);e.length>0&&(n.textures=e),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let r=0;r!==t;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class Rn extends Cn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new En(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 Ve,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Pn=new ae,Ln=new Lt;class Dn{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=ht,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=V,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return Bt("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Ln.fromBufferAttribute(this,e),Ln.applyMatrix3(t),this.setXY(e,Ln.x,Ln.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.applyMatrix3(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.applyMatrix4(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.applyNormalMatrix(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.transformDirection(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Ct(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Rt(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ct(e,this.array)),e}setX(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ct(e,this.array)),e}setY(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ct(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ct(e,this.array)),e}setW(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array),i=Rt(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==ht&&(t.usage=this.usage),t}}class On extends Dn{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class In extends Dn{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class qn extends Dn{constructor(t,e,n){super(new Float32Array(t),e,n)}}let Un=0;const Nn=new qe,Bn=new ln,kn=new ae,Fn=new Ae,zn=new Ae,Gn=new ae;class Hn extends gt{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Un++}),this.uuid=bt(),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(t){return Array.isArray(t)?this.index=new(It(t)?In:On)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Dt).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return Nn.makeRotationFromQuaternion(t),this.applyMatrix4(Nn),this}rotateX(t){return Nn.makeRotationX(t),this.applyMatrix4(Nn),this}rotateY(t){return Nn.makeRotationY(t),this.applyMatrix4(Nn),this}rotateZ(t){return Nn.makeRotationZ(t),this.applyMatrix4(Nn),this}translate(t,e,n){return Nn.makeTranslation(t,e,n),this.applyMatrix4(Nn),this}scale(t,e,n){return Nn.makeScale(t,e,n),this.applyMatrix4(Nn),this}lookAt(t){return Bn.lookAt(t),Bn.updateMatrix(),this.applyMatrix4(Bn.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(kn).negate(),this.translate(kn.x,kn.y,kn.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new qn(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Ae);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new ae(-1/0,-1/0,-1/0),new ae(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];Fn.setFromBufferAttribute(n),this.morphTargetsRelative?(Gn.addVectors(this.boundingBox.min,Fn.min),this.boundingBox.expandByPoint(Gn),Gn.addVectors(this.boundingBox.max,Fn.max),this.boundingBox.expandByPoint(Gn)):(this.boundingBox.expandByPoint(Fn.min),this.boundingBox.expandByPoint(Fn.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 Se);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new ae,1/0);if(t){const n=this.boundingSphere.center;if(Fn.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];zn.setFromBufferAttribute(n),this.morphTargetsRelative?(Gn.addVectors(Fn.min,zn.min),Fn.expandByPoint(Gn),Gn.addVectors(Fn.max,zn.max),Fn.expandByPoint(Gn)):(Fn.expandByPoint(zn.min),Fn.expandByPoint(zn.max))}Fn.getCenter(n);let r=0;for(let e=0,i=t.count;e<i;e++)Gn.fromBufferAttribute(t,e),r=Math.max(r,n.distanceToSquared(Gn));if(e)for(let i=0,a=e.length;i<a;i++){const a=e[i],o=this.morphTargetsRelative;for(let e=0,i=a.count;e<i;e++)Gn.fromBufferAttribute(a,e),o&&(kn.fromBufferAttribute(t,e),Gn.add(kn)),r=Math.max(r,n.distanceToSquared(Gn))}this.boundingSphere.radius=Math.sqrt(r),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 t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.position,r=e.normal,i=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Dn(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],s=[];for(let t=0;t<n.count;t++)o[t]=new ae,s[t]=new ae;const A=new ae,l=new ae,c=new ae,u=new Lt,h=new Lt,f=new Lt,d=new ae,p=new ae;function m(t,e,r){A.fromBufferAttribute(n,t),l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,r),u.fromBufferAttribute(i,t),h.fromBufferAttribute(i,e),f.fromBufferAttribute(i,r),l.sub(A),c.sub(A),h.sub(u),f.sub(u);const a=1/(h.x*f.y-f.x*h.y);isFinite(a)&&(d.copy(l).multiplyScalar(f.y).addScaledVector(c,-h.y).multiplyScalar(a),p.copy(c).multiplyScalar(h.x).addScaledVector(l,-f.x).multiplyScalar(a),o[t].add(d),o[e].add(d),o[r].add(d),s[t].add(p),s[e].add(p),s[r].add(p))}let g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(let e=0,n=g.length;e<n;++e){const n=g[e],r=n.start;for(let e=r,i=r+n.count;e<i;e+=3)m(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const v=new ae,_=new ae,y=new ae,x=new ae;function b(t){y.fromBufferAttribute(r,t),x.copy(y);const e=o[t];v.copy(e),v.sub(y.multiplyScalar(y.dot(e))).normalize(),_.crossVectors(x,e);const n=_.dot(s[t])<0?-1:1;a.setXYZW(t,v.x,v.y,v.z,n)}for(let e=0,n=g.length;e<n;++e){const n=g[e],r=n.start;for(let e=r,i=r+n.count;e<i;e+=3)b(t.getX(e+0)),b(t.getX(e+1)),b(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Dn(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const r=new ae,i=new ae,a=new ae,o=new ae,s=new ae,A=new ae,l=new ae,c=new ae;if(t)for(let u=0,h=t.count;u<h;u+=3){const h=t.getX(u+0),f=t.getX(u+1),d=t.getX(u+2);r.fromBufferAttribute(e,h),i.fromBufferAttribute(e,f),a.fromBufferAttribute(e,d),l.subVectors(a,i),c.subVectors(r,i),l.cross(c),o.fromBufferAttribute(n,h),s.fromBufferAttribute(n,f),A.fromBufferAttribute(n,d),o.add(l),s.add(l),A.add(l),n.setXYZ(h,o.x,o.y,o.z),n.setXYZ(f,s.x,s.y,s.z),n.setXYZ(d,A.x,A.y,A.z)}else for(let t=0,o=e.count;t<o;t+=3)r.fromBufferAttribute(e,t+0),i.fromBufferAttribute(e,t+1),a.fromBufferAttribute(e,t+2),l.subVectors(a,i),c.subVectors(r,i),l.cross(c),n.setXYZ(t+0,l.x,l.y,l.z),n.setXYZ(t+1,l.x,l.y,l.z),n.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Gn.fromBufferAttribute(t,e),Gn.normalize(),t.setXYZ(e,Gn.x,Gn.y,Gn.z)}toNonIndexed(){function t(t,e){const n=t.array,r=t.itemSize,i=t.normalized,a=new n.constructor(e.length*r);let o=0,s=0;for(let i=0,A=e.length;i<A;i++){o=t.isInterleavedBufferAttribute?e[i]*t.data.stride+t.offset:e[i]*r;for(let t=0;t<r;t++)a[s++]=n[o++]}return new Dn(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Hn,n=this.index.array,r=this.attributes;for(const i in r){const a=t(r[i],n);e.setAttribute(i,a)}const i=this.morphAttributes;for(const r in i){const a=[],o=i[r];for(let e=0,r=o.length;e<r;e++){const r=t(o[e],n);a.push(r)}e.morphAttributes[r]=a}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let t=0,n=a.length;t<n;t++){const n=a[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const r=n[e];t.data.attributes[e]=r.toJSON(t.data)}const r={};let i=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],a=[];for(let e=0,r=n.length;e<r;e++){const r=n[e];a.push(r.toJSON(t.data))}a.length>0&&(r[e]=a,i=!0)}i&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const r=t.attributes;for(const t in r){const n=r[t];this.setAttribute(t,n.clone(e))}const i=t.morphAttributes;for(const t in i){const n=[],r=i[t];for(let t=0,i=r.length;t<i;t++)n.push(r[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const a=t.groups;for(let t=0,e=a.length;t<e;t++){const e=a[t];this.addGroup(e.start,e.count,e.materialIndex)}const o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());const s=t.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const jn=new qe,Vn=new Ie,Wn=new Se,Xn=new ae,Qn=new ae,Yn=new ae,Zn=new ae,Kn=new ae,Jn=new ae,$n=new Lt,tr=new Lt,er=new Lt,nr=new ae,rr=new ae,ir=new ae,ar=new ae,or=new ae;class sr extends ln{constructor(t=new Hn,e=new Rn){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(r,t);const o=this.morphTargetInfluences;if(i&&o){Jn.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=o[n],s=i[n];0!==r&&(Kn.fromBufferAttribute(s,t),a?Jn.addScaledVector(Kn,r):Jn.addScaledVector(Kn.sub(e),r))}e.add(Jn)}return e}raycast(t,e){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),Wn.copy(n.boundingSphere),Wn.applyMatrix4(i),Vn.copy(t.ray).recast(t.near),!1===Wn.containsPoint(Vn.origin)){if(null===Vn.intersectSphere(Wn,Xn))return;if(Vn.origin.distanceToSquared(Xn)>(t.far-t.near)**2)return}jn.copy(i).invert(),Vn.copy(t.ray).applyMatrix4(jn),null!==n.boundingBox&&!1===Vn.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,Vn)}}_computeIntersections(t,e,n){let r;const i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,A=i.attributes.uv,l=i.attributes.uv1,c=i.attributes.normal,u=i.groups,h=i.drawRange;if(null!==o)if(Array.isArray(a))for(let i=0,s=u.length;i<s;i++){const s=u[i],f=a[s.materialIndex];for(let i=Math.max(s.start,h.start),a=Math.min(o.count,Math.min(s.start+s.count,h.start+h.count));i<a;i+=3){r=Ar(this,f,t,n,A,l,c,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,e.push(r))}}else{for(let i=Math.max(0,h.start),s=Math.min(o.count,h.start+h.count);i<s;i+=3){r=Ar(this,a,t,n,A,l,c,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),e.push(r))}}else if(void 0!==s)if(Array.isArray(a))for(let i=0,o=u.length;i<o;i++){const o=u[i],f=a[o.materialIndex];for(let i=Math.max(o.start,h.start),a=Math.min(s.count,Math.min(o.start+o.count,h.start+h.count));i<a;i+=3){r=Ar(this,f,t,n,A,l,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,e.push(r))}}else{for(let i=Math.max(0,h.start),o=Math.min(s.count,h.start+h.count);i<o;i+=3){r=Ar(this,a,t,n,A,l,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),e.push(r))}}}}function Ar(t,e,n,r,i,a,o,s,A,l){t.getVertexPosition(s,Qn),t.getVertexPosition(A,Yn),t.getVertexPosition(l,Zn);const c=function(t,e,n,r,i,a,o,s){let A;if(A=e.side===g?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,e.side===m,s),null===A)return null;or.copy(s),or.applyMatrix4(t.matrixWorld);const l=n.ray.origin.distanceTo(or);return l<n.near||l>n.far?null:{distance:l,point:or.clone(),object:t}}(t,e,n,r,Qn,Yn,Zn,ar);if(c){i&&($n.fromBufferAttribute(i,s),tr.fromBufferAttribute(i,A),er.fromBufferAttribute(i,l),c.uv=yn.getInterpolation(ar,Qn,Yn,Zn,$n,tr,er,new Lt)),a&&($n.fromBufferAttribute(a,s),tr.fromBufferAttribute(a,A),er.fromBufferAttribute(a,l),c.uv1=yn.getInterpolation(ar,Qn,Yn,Zn,$n,tr,er,new Lt)),o&&(nr.fromBufferAttribute(o,s),rr.fromBufferAttribute(o,A),ir.fromBufferAttribute(o,l),c.normal=yn.getInterpolation(ar,Qn,Yn,Zn,nr,rr,ir,new ae),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const t={a:s,b:A,c:l,normal:new ae,materialIndex:0};yn.getNormal(Qn,Yn,Zn,t.normal),c.face=t}return c}class lr extends Hn{constructor(t=1,e=1,n=1,r=1,i=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};const o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);const s=[],A=[],l=[],c=[];let u=0,h=0;function f(t,e,n,r,i,a,f,d,p,m,g){const v=a/p,_=f/m,y=a/2,x=f/2,b=d/2,M=p+1,w=m+1;let E=0,S=0;const T=new ae;for(let a=0;a<w;a++){const o=a*_-x;for(let s=0;s<M;s++){const u=s*v-y;T[t]=u*r,T[e]=o*i,T[n]=b,A.push(T.x,T.y,T.z),T[t]=0,T[e]=0,T[n]=d>0?1:-1,l.push(T.x,T.y,T.z),c.push(s/p),c.push(1-a/m),E+=1}}for(let t=0;t<m;t++)for(let e=0;e<p;e++){const n=u+e+M*t,r=u+e+M*(t+1),i=u+(e+1)+M*(t+1),a=u+(e+1)+M*t;s.push(n,r,a),s.push(r,i,a),S+=6}o.addGroup(h,S,g),h+=S,u+=E}f("z","y","x",-1,-1,n,e,t,a,i,0),f("z","y","x",1,-1,n,e,-t,a,i,1),f("x","z","y",1,1,t,n,e,r,a,2),f("x","z","y",1,-1,t,n,-e,r,a,3),f("x","y","z",1,-1,t,e,n,r,i,4),f("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new qn(A,3)),this.setAttribute("normal",new qn(l,3)),this.setAttribute("uv",new qn(c,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new lr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function cr(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];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()."),e[n][r]=null):e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function ur(t){const e={};for(let n=0;n<t.length;n++){const r=cr(t[n]);for(const t in r)e[t]=r[t]}return e}function hr(t){return null===t.getRenderTarget()?t.outputColorSpace:Ht.workingColorSpace}const fr={clone:cr,merge:ur};class dr extends Cn{constructor(t){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!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=cr(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class pr extends ln{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qe,this.projectionMatrix=new qe,this.projectionMatrixInverse=new qe,this.coordinateSystem=pt}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const mr=new ae,gr=new Lt,vr=new Lt;class _r extends pr{constructor(t=50,e=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*xt*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*yt*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*xt*Math.atan(Math.tan(.5*yt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){mr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(mr.x,mr.y).multiplyScalar(-t/mr.z),mr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(mr.x,mr.y).multiplyScalar(-t/mr.z)}getViewSize(t,e){return this.getViewBounds(t,gr,vr),e.subVectors(vr,gr)}setViewOffset(t,e,n,r,i,a){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*yt*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const t=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/t,e-=a.offsetY*n/o,r*=a.width/t,n*=a.height/o}const o=this.filmOffset;0!==o&&(i+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const yr=-90;class xr extends ln{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new _r(yr,1,t,e);r.layers=this.layers,this.add(r);const i=new _r(yr,1,t,e);i.layers=this.layers,this.add(i);const a=new _r(yr,1,t,e);a.layers=this.layers,this.add(a);const o=new _r(yr,1,t,e);o.layers=this.layers,this.add(o);const s=new _r(yr,1,t,e);s.layers=this.layers,this.add(s);const A=new _r(yr,1,t,e);A.layers=this.layers,this.add(A)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,r,i,a,o,s]=e;for(const t of e)this.remove(t);if(t===pt)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else{if(t!==mt)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[i,a,o,s,A,l]=this.children,c=t.getRenderTarget(),u=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),f=t.xr.enabled;t.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,r),t.render(e,i),t.setRenderTarget(n,1,r),t.render(e,a),t.setRenderTarget(n,2,r),t.render(e,o),t.setRenderTarget(n,3,r),t.render(e,s),t.setRenderTarget(n,4,r),t.render(e,A),n.texture.generateMipmaps=d,t.setRenderTarget(n,5,r),t.render(e,l),t.setRenderTarget(c,u,h),t.xr.enabled=f,n.texture.needsPMREMUpdate=!0}}class br extends Jt{constructor(t,e,n,r,i,a,o,s,A,l){super(t=void 0!==t?t:[],e=void 0!==e?e:P,n,r,i,a,o,s,A,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Mr extends ee{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},r=[n,n,n,n,n,n];this.texture=new br(r,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:B}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={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"},r=new lr(5,5,5),i=new dr({name:"CubemapFromEquirect",uniforms:cr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:g,blending:0});i.uniforms.tEquirect.value=e;const a=new sr(r,i),o=e.minFilter;e.minFilter===F&&(e.minFilter=B);return new xr(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,r){const i=t.getRenderTarget();for(let i=0;i<6;i++)t.setRenderTarget(this,i),t.clear(e,n,r);t.setRenderTarget(i)}}const wr=new ae,Er=new ae,Sr=new Dt;class Tr{constructor(t=new ae(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const r=wr.subVectors(n,e).cross(Er.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(wr),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:e.copy(t.start).addScaledVector(n,i)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Sr.getNormalMatrix(t),r=this.coplanarPoint(wr).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Cr=new Se,Rr=new ae;class Pr{constructor(t=new Tr,e=new Tr,n=new Tr,r=new Tr,i=new Tr,a=new Tr){this.planes=[t,e,n,r,i,a]}set(t,e,n,r,i,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,r=t.elements,i=r[0],a=r[1],o=r[2],s=r[3],A=r[4],l=r[5],c=r[6],u=r[7],h=r[8],f=r[9],d=r[10],p=r[11],m=r[12],g=r[13],v=r[14],_=r[15];if(n[0].setComponents(s-i,u-A,p-h,_-m).normalize(),n[1].setComponents(s+i,u+A,p+h,_+m).normalize(),n[2].setComponents(s+a,u+l,p+f,_+g).normalize(),n[3].setComponents(s-a,u-l,p-f,_-g).normalize(),n[4].setComponents(s-o,u-c,p-d,_-v).normalize(),e===pt)n[5].setComponents(s+o,u+c,p+d,_+v).normalize();else{if(e!==mt)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(o,c,d,v).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Cr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Cr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Cr)}intersectsSprite(t){return Cr.center.set(0,0,0),Cr.radius=.7071067811865476,Cr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Cr)}intersectsSphere(t){const e=this.planes,n=t.center,r=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<r)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const r=e[n];if(Rr.x=r.normal.x>0?t.max.x:t.min.x,Rr.y=r.normal.y>0?t.max.y:t.min.y,Rr.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Rr)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Lr(){let t=null,e=!1,n=null,r=null;function i(e,a){n(e,a),r=t.requestAnimationFrame(i)}return{start:function(){!0!==e&&null!==n&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Dr(t,e){const n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){if(e.isGLBufferAttribute){const t=r.get(e);return void((!t||t.version<e.version)&&r.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const a=r.get(e);if(void 0===a)r.set(e,function(e,r){const i=e.array,a=e.usage,o=i.byteLength,s=t.createBuffer();let A;if(t.bindBuffer(r,s),t.bufferData(r,i,a),e.onUploadCallback(),i instanceof Float32Array)A=t.FLOAT;else if(i instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");A=t.HALF_FLOAT}else A=t.UNSIGNED_SHORT;else if(i instanceof Int16Array)A=t.SHORT;else if(i instanceof Uint32Array)A=t.UNSIGNED_INT;else if(i instanceof Int32Array)A=t.INT;else if(i instanceof Int8Array)A=t.BYTE;else if(i instanceof Uint8Array)A=t.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);A=t.UNSIGNED_BYTE}return{buffer:s,type:A,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,size:o}}(e,i));else if(a.version<e.version){if(a.size!==e.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(e,r,i){const a=r.array,o=r._updateRange,s=r.updateRanges;if(t.bindBuffer(i,e),-1===o.count&&0===s.length&&t.bufferSubData(i,0,a),0!==s.length){for(let e=0,r=s.length;e<r;e++){const r=s[e];n?t.bufferSubData(i,r.start*a.BYTES_PER_ELEMENT,a,r.start,r.count):t.bufferSubData(i,r.start*a.BYTES_PER_ELEMENT,a.subarray(r.start,r.start+r.count))}r.clearUpdateRanges()}-1!==o.count&&(n?t.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):t.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1),r.onUploadCallback()}(a.buffer,e,i),a.version=e.version}}}}class Or extends Hn{constructor(t=1,e=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};const i=t/2,a=e/2,o=Math.floor(n),s=Math.floor(r),A=o+1,l=s+1,c=t/o,u=e/s,h=[],f=[],d=[],p=[];for(let t=0;t<l;t++){const e=t*u-a;for(let n=0;n<A;n++){const r=n*c-i;f.push(r,-e,0),d.push(0,0,1),p.push(n/o),p.push(1-t/s)}}for(let t=0;t<s;t++)for(let e=0;e<o;e++){const n=e+A*t,r=e+A*(t+1),i=e+1+A*(t+1),a=e+1+A*t;h.push(n,r,a),h.push(r,i,a)}this.setIndex(h),this.setAttribute("position",new qn(f,3)),this.setAttribute("normal",new qn(d,3)),this.setAttribute("uv",new qn(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Or(t.width,t.height,t.widthSegments,t.heightSegments)}}const Ir={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}"},qr={common:{diffuse:{value:new En(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},envMapRotation:{value:new Dt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new Lt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new En(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 En(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new En(16777215)},opacity:{value:1},center:{value:new Lt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},Ur={basic:{uniforms:ur([qr.common,qr.specularmap,qr.envmap,qr.aomap,qr.lightmap,qr.fog]),vertexShader:Ir.meshbasic_vert,fragmentShader:Ir.meshbasic_frag},lambert:{uniforms:ur([qr.common,qr.specularmap,qr.envmap,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.fog,qr.lights,{emissive:{value:new En(0)}}]),vertexShader:Ir.meshlambert_vert,fragmentShader:Ir.meshlambert_frag},phong:{uniforms:ur([qr.common,qr.specularmap,qr.envmap,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.fog,qr.lights,{emissive:{value:new En(0)},specular:{value:new En(1118481)},shininess:{value:30}}]),vertexShader:Ir.meshphong_vert,fragmentShader:Ir.meshphong_frag},standard:{uniforms:ur([qr.common,qr.envmap,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.roughnessmap,qr.metalnessmap,qr.fog,qr.lights,{emissive:{value:new En(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ir.meshphysical_vert,fragmentShader:Ir.meshphysical_frag},toon:{uniforms:ur([qr.common,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.gradientmap,qr.fog,qr.lights,{emissive:{value:new En(0)}}]),vertexShader:Ir.meshtoon_vert,fragmentShader:Ir.meshtoon_frag},matcap:{uniforms:ur([qr.common,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.fog,{matcap:{value:null}}]),vertexShader:Ir.meshmatcap_vert,fragmentShader:Ir.meshmatcap_frag},points:{uniforms:ur([qr.points,qr.fog]),vertexShader:Ir.points_vert,fragmentShader:Ir.points_frag},dashed:{uniforms:ur([qr.common,qr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ir.linedashed_vert,fragmentShader:Ir.linedashed_frag},depth:{uniforms:ur([qr.common,qr.displacementmap]),vertexShader:Ir.depth_vert,fragmentShader:Ir.depth_frag},normal:{uniforms:ur([qr.common,qr.bumpmap,qr.normalmap,qr.displacementmap,{opacity:{value:1}}]),vertexShader:Ir.meshnormal_vert,fragmentShader:Ir.meshnormal_frag},sprite:{uniforms:ur([qr.sprite,qr.fog]),vertexShader:Ir.sprite_vert,fragmentShader:Ir.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ir.background_vert,fragmentShader:Ir.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Dt}},vertexShader:Ir.backgroundCube_vert,fragmentShader:Ir.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ir.cube_vert,fragmentShader:Ir.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ir.equirect_vert,fragmentShader:Ir.equirect_frag},distanceRGBA:{uniforms:ur([qr.common,qr.displacementmap,{referencePosition:{value:new ae},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ir.distanceRGBA_vert,fragmentShader:Ir.distanceRGBA_frag},shadow:{uniforms:ur([qr.lights,qr.fog,{color:{value:new En(0)},opacity:{value:1}}]),vertexShader:Ir.shadow_vert,fragmentShader:Ir.shadow_frag}};Ur.physical={uniforms:ur([Ur.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new Lt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new En(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new Lt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new En(0)},specularColor:{value:new En(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new Lt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:Ir.meshphysical_vert,fragmentShader:Ir.meshphysical_frag};const Nr={r:0,b:0,g:0},Br=new Ve,kr=new qe;function Fr(t,e,n,r,i,a,o){const s=new En(0);let A,l,c=!0===a?0:1,u=null,h=0,f=null;function d(e,n){e.getRGB(Nr,hr(t)),r.buffers.color.setClear(Nr.r,Nr.g,Nr.b,n,o)}return{getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),c=e,d(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(t){c=t,d(s,c)},render:function(a,p){let v=!1,_=!0===p.isScene?p.background:null;if(_&&_.isTexture){_=(p.backgroundBlurriness>0?n:e).get(_)}null===_?d(s,c):_&&_.isColor&&(d(_,1),v=!0);const y=t.xr.getEnvironmentBlendMode();"additive"===y?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===y&&r.buffers.color.setClear(0,0,0,0,o),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),_&&(_.isCubeTexture||_.mapping===D)?(void 0===l&&(l=new sr(new lr(1,1,1),new dr({name:"BackgroundCubeMaterial",uniforms:cr(Ur.backgroundCube.uniforms),vertexShader:Ur.backgroundCube.vertexShader,fragmentShader:Ur.backgroundCube.fragmentShader,side:g,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),Br.copy(p.backgroundRotation),Br.x*=-1,Br.y*=-1,Br.z*=-1,_.isCubeTexture&&!1===_.isRenderTargetTexture&&(Br.y*=-1,Br.z*=-1),l.material.uniforms.envMap.value=_,l.material.uniforms.flipEnvMap.value=_.isCubeTexture&&!1===_.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=p.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(kr.makeRotationFromEuler(Br)),l.material.toneMapped=Ht.getTransfer(_.colorSpace)!==At,u===_&&h===_.version&&f===t.toneMapping||(l.material.needsUpdate=!0,u=_,h=_.version,f=t.toneMapping),l.layers.enableAll(),a.unshift(l,l.geometry,l.material,0,0,null)):_&&_.isTexture&&(void 0===A&&(A=new sr(new Or(2,2),new dr({name:"BackgroundMaterial",uniforms:cr(Ur.background.uniforms),vertexShader:Ur.background.vertexShader,fragmentShader:Ur.background.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.deleteAttribute("normal"),Object.defineProperty(A.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(A)),A.material.uniforms.t2D.value=_,A.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,A.material.toneMapped=Ht.getTransfer(_.colorSpace)!==At,!0===_.matrixAutoUpdate&&_.updateMatrix(),A.material.uniforms.uvTransform.value.copy(_.matrix),u===_&&h===_.version&&f===t.toneMapping||(A.material.needsUpdate=!0,u=_,h=_.version,f=t.toneMapping),A.layers.enableAll(),a.unshift(A,A.geometry,A.material,0,0,null))}}}function zr(t,e,n,r){const i=t.getParameter(t.MAX_VERTEX_ATTRIBS),a=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},A=f(null);let l=A,c=!1;function u(e){return r.isWebGL2?t.bindVertexArray(e):a.bindVertexArrayOES(e)}function h(e){return r.isWebGL2?t.deleteVertexArray(e):a.deleteVertexArrayOES(e)}function f(t){const e=[],n=[],r=[];for(let t=0;t<i;t++)e[t]=0,n[t]=0,r[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:r,object:t,attributes:{},index:null}}function d(){const t=l.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function p(t){m(t,0)}function m(n,i){const a=l.newAttributes,o=l.enabledAttributes,s=l.attributeDivisors;if(a[n]=1,0===o[n]&&(t.enableVertexAttribArray(n),o[n]=1),s[n]!==i){(r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i}}function g(){const e=l.newAttributes,n=l.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==e[r]&&(t.disableVertexAttribArray(r),n[r]=0)}function v(e,n,r,i,a,o,s){!0===s?t.vertexAttribIPointer(e,n,r,a,o):t.vertexAttribPointer(e,n,r,i,a,o)}function _(){y(),c=!0,l!==A&&(l=A,u(l.object))}function y(){A.geometry=null,A.program=null,A.wireframe=!1}return{setup:function(i,A,h,_,y){let x=!1;if(o){const e=function(e,n,i){const o=!0===i.wireframe;let A=s[e.id];void 0===A&&(A={},s[e.id]=A);let l=A[n.id];void 0===l&&(l={},A[n.id]=l);let c=l[o];void 0===c&&(c=f(r.isWebGL2?t.createVertexArray():a.createVertexArrayOES()),l[o]=c);return c}(_,h,A);l!==e&&(l=e,u(l.object)),x=function(t,e,n,r){const i=l.attributes,a=e.attributes;let o=0;const s=n.getAttributes();for(const e in s){if(s[e].location>=0){const n=i[e];let r=a[e];if(void 0===r&&("instanceMatrix"===e&&t.instanceMatrix&&(r=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(r=t.instanceColor)),void 0===n)return!0;if(n.attribute!==r)return!0;if(r&&n.data!==r.data)return!0;o++}}return l.attributesNum!==o||l.index!==r}(i,_,h,y),x&&function(t,e,n,r){const i={},a=e.attributes;let o=0;const s=n.getAttributes();for(const e in s){if(s[e].location>=0){let n=a[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[e]=r,o++}}l.attributes=i,l.attributesNum=o,l.index=r}(i,_,h,y)}else{const t=!0===A.wireframe;l.geometry===_.id&&l.program===h.id&&l.wireframe===t||(l.geometry=_.id,l.program=h.id,l.wireframe=t,x=!0)}null!==y&&n.update(y,t.ELEMENT_ARRAY_BUFFER),(x||c)&&(c=!1,function(i,a,o,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;d();const A=s.attributes,l=o.getAttributes(),c=a.defaultAttributeValues;for(const e in l){const a=l[e];if(a.location>=0){let o=A[e];if(void 0===o&&("instanceMatrix"===e&&i.instanceMatrix&&(o=i.instanceMatrix),"instanceColor"===e&&i.instanceColor&&(o=i.instanceColor)),void 0!==o){const e=o.normalized,A=o.itemSize,l=n.get(o);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement,f=!0===r.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||o.gpuType===H);if(o.isInterleavedBufferAttribute){const n=o.data,r=n.stride,l=o.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<a.locationSize;t++)m(a.location+t,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let t=0;t<a.locationSize;t++)p(a.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<a.locationSize;t++)v(a.location+t,A/a.locationSize,u,e,r*h,(l+A/a.locationSize*t)*h,f)}else{if(o.isInstancedBufferAttribute){for(let t=0;t<a.locationSize;t++)m(a.location+t,o.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let t=0;t<a.locationSize;t++)p(a.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<a.locationSize;t++)v(a.location+t,A/a.locationSize,u,e,A*h,A/a.locationSize*t*h,f)}}else if(void 0!==c){const n=c[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(a.location,n);break;case 3:t.vertexAttrib3fv(a.location,n);break;case 4:t.vertexAttrib4fv(a.location,n);break;default:t.vertexAttrib1fv(a.location,n)}}}}g()}(i,A,h,_),null!==y&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(y).buffer))},reset:_,resetDefaultState:y,dispose:function(){_();for(const t in s){const e=s[t];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t]}},releaseStatesOfGeometry:function(t){if(void 0===s[t.id])return;const e=s[t.id];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t.id]},releaseStatesOfProgram:function(t){for(const e in s){const n=s[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)h(r[t].object),delete r[t];delete n[t.id]}},initAttributes:d,enableAttribute:p,disableUnusedAttributes:g}}function Gr(t,e,n,r){const i=r.isWebGL2;let a;this.setMode=function(t){a=t},this.render=function(e,r){t.drawArrays(a,e,r),n.update(r,a,1)},this.renderInstances=function(r,o,s){if(0===s)return;let A,l;if(i)A=t,l="drawArraysInstanced";else if(A=e.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===A)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");A[l](a,r,o,s),n.update(o,a,s)},this.renderMultiDraw=function(t,r,i){if(0===i)return;const o=e.get("WEBGL_multi_draw");if(null===o)for(let e=0;e<i;e++)this.render(t[e],r[e]);else{o.multiDrawArraysWEBGL(a,t,0,r,0,i);let e=0;for(let t=0;t<i;t++)e+=r[t];n.update(e,a,1)}}}function Hr(t,e,n){let r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let o=void 0!==n.precision?n.precision:"highp";const s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const A=a||e.has("WEBGL_draw_buffers"),l=!0===n.logarithmicDepthBuffer,c=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_TEXTURE_SIZE),f=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),d=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),g=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=u>0,_=a||e.has("OES_texture_float");return{isWebGL2:a,drawBuffers:A,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:f,maxAttributes:d,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:v&&_,maxSamples:a?t.getParameter(t.MAX_SAMPLES):0}}function jr(t){const e=this;let n=null,r=0,i=!1,a=!1;const o=new Tr,s=new Dt,A={value:null,needsUpdate:!1};function l(t,n,r,i){const a=null!==t?t.length:0;let l=null;if(0!==a){if(l=A.value,!0!==i||null===l){const e=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===l||l.length<e)&&(l=new Float32Array(e));for(let e=0,n=r;e!==a;++e,n+=4)o.copy(t[e]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant}A.value=l,A.needsUpdate=!0}return e.numPlanes=a,e.numIntersection=0,l}this.uniform=A,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const n=0!==t.length||e||0!==r||i;return i=e,r=t.length,n},this.beginShadows=function(){a=!0,l(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(t,e){n=l(t,e,0)},this.setState=function(o,s,c){const u=o.clippingPlanes,h=o.clipIntersection,f=o.clipShadows,d=t.get(o);if(!i||null===u||0===u.length||a&&!f)a?l(null):function(){A.value!==n&&(A.value=n,A.needsUpdate=r>0);e.numPlanes=r,e.numIntersection=0}();else{const t=a?0:r,e=4*t;let i=d.clippingState||null;A.value=i,i=l(u,s,e,c);for(let t=0;t!==e;++t)i[t]=n[t];d.clippingState=i,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=t}}}function Vr(t){let e=new WeakMap;function n(t,e){return 303===e?t.mapping=P:304===e&&(t.mapping=L),t}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping;if(303===a||304===a){if(e.has(i)){return n(e.get(i).texture,i.mapping)}{const a=i.image;if(a&&a.height>0){const o=new Mr(a.height);return o.fromEquirectangularTexture(t,i),e.set(i,o),i.addEventListener("dispose",r),n(o.texture,i.mapping)}return null}}}return i},dispose:function(){e=new WeakMap}}}class Wr extends pr{constructor(t=-1,e=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,i,a){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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-t,a=n+t,o=r+e,s=r-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=t*this.view.offsetX,a=i+t*this.view.width,o-=e*this.view.offsetY,s=o-e*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Xr=[.125,.215,.35,.446,.526,.582],Qr=20,Yr=new Wr,Zr=new En;let Kr=null,Jr=0,$r=0;const ti=(1+Math.sqrt(5))/2,ei=1/ti,ni=[new ae(1,1,1),new ae(-1,1,1),new ae(1,1,-1),new ae(-1,1,-1),new ae(0,ti,ei),new ae(0,ti,-ei),new ae(ei,0,ti),new ae(-ei,0,ti),new ae(ti,ei,0),new ae(-ti,ei,0)];class ri{constructor(t){this._renderer=t,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(t,e=0,n=.1,r=100){Kr=this._renderer.getRenderTarget(),Jr=this._renderer.getActiveCubeFace(),$r=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(t,n,r,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=si(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=oi(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Kr,Jr,$r),t.scissorTest=!1,ai(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===P||t.mapping===L?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Kr=this._renderer.getRenderTarget(),Jr=this._renderer.getActiveCubeFace(),$r=this._renderer.getActiveMipmapLevel();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:B,minFilter:B,generateMipmaps:!1,type:W,format:Q,colorSpace:it,depthBuffer:!1},r=ii(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ii(t,e,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],n=[],r=[];let i=t;const a=t-4+1+Xr.length;for(let o=0;o<a;o++){const a=Math.pow(2,i);n.push(a);let s=1/a;o>t-4?s=Xr[o-t+4-1]:0===o&&(s=0),r.push(s);const A=1/(a-2),l=-A,c=1+A,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,f=6,d=3,p=2,m=1,g=new Float32Array(d*f*h),v=new Float32Array(p*f*h),_=new Float32Array(m*f*h);for(let t=0;t<h;t++){const e=t%3*2/3-1,n=t>2?0:-1,r=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(r,d*f*t),v.set(u,p*f*t);const i=[t,t,t,t,t,t];_.set(i,m*f*t)}const y=new Hn;y.setAttribute("position",new Dn(g,d)),y.setAttribute("uv",new Dn(v,p)),y.setAttribute("faceIndex",new Dn(_,m)),e.push(y),i>4&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(t,e,n){const r=new Float32Array(Qr),i=new ae(0,1,0),a=new dr({name:"SphericalGaussianBlur",defines:{n:Qr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ai(),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:0,depthTest:!1,depthWrite:!1});return a}(r,t,e)}return r}_compileMaterial(t){const e=new sr(this._lodPlanes[0],t);this._renderer.compile(e,Yr)}_sceneToCubeUV(t,e,n,r){const i=new _r(90,1,e,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,A=s.autoClear,l=s.toneMapping;s.getClearColor(Zr),s.toneMapping=b,s.autoClear=!1;const c=new Rn({name:"PMREM.Background",side:g,depthWrite:!1,depthTest:!1}),u=new sr(new lr,c);let h=!1;const f=t.background;f?f.isColor&&(c.color.copy(f),t.background=null,h=!0):(c.color.copy(Zr),h=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(i.up.set(0,a[e],0),i.lookAt(o[e],0,0)):1===n?(i.up.set(0,0,a[e]),i.lookAt(0,o[e],0)):(i.up.set(0,a[e],0),i.lookAt(0,0,o[e]));const A=this._cubeSize;ai(r,n*A,e>2?A:0,A,A),s.setRenderTarget(r),h&&s.render(u,i),s.render(t,i)}u.geometry.dispose(),u.material.dispose(),s.toneMapping=l,s.autoClear=A,t.background=f}_textureToCubeUV(t,e){const n=this._renderer,r=t.mapping===P||t.mapping===L;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=si()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=oi());const i=r?this._cubemapMaterial:this._equirectMaterial,a=new sr(this._lodPlanes[0],i);i.uniforms.envMap.value=t;const o=this._cubeSize;ai(e,0,0,3*o,2*o),n.setRenderTarget(e),n.render(a,Yr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=ni[(e-1)%ni.length];this._blur(t,e-1,e,n,r)}e.autoClear=n}_blur(t,e,n,r,i){const a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,r,"latitudinal",i),this._halfBlur(a,t,n,n,r,"longitudinal",i)}_halfBlur(t,e,n,r,i,a,o){const s=this._renderer,A=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const l=new sr(this._lodPlanes[r],A),c=A.uniforms,u=this._sizeLods[n]-1,h=isFinite(i)?Math.PI/(2*u):2*Math.PI/39,f=i/h,d=isFinite(i)?1+Math.floor(3*f):Qr;d>Qr&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${d} samples when the maximum is set to 20`);const p=[];let m=0;for(let t=0;t<Qr;++t){const e=t/f,n=Math.exp(-e*e/2);p.push(n),0===t?m+=n:t<d&&(m+=2*n)}for(let t=0;t<p.length;t++)p[t]=p[t]/m;c.envMap.value=t.texture,c.samples.value=d,c.weights.value=p,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o);const{_lodMax:g}=this;c.dTheta.value=h,c.mipInt.value=g-n;const v=this._sizeLods[r];ai(e,3*v*(r>g-4?r-g+4:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(e),s.render(l,Yr)}}function ii(t,e,n){const r=new ee(t,e,n);return r.texture.mapping=D,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function ai(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function oi(){return new dr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ai(),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:0,depthTest:!1,depthWrite:!1})}function si(){return new dr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ai(),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:0,depthTest:!1,depthWrite:!1})}function Ai(){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 li(t){let e=new WeakMap,n=null;function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping,o=303===a||304===a,s=a===P||a===L;if(o||s){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=e.get(i);return null===n&&(n=new ri(t)),r=o?n.fromEquirectangular(i,r):n.fromCubemap(i,r),e.set(i,r),r.texture}if(e.has(i))return e.get(i).texture;{const a=i.image;if(o&&a&&a.height>0||s&&a&&function(t){let e=0;const n=6;for(let r=0;r<n;r++)void 0!==t[r]&&e++;return e===n}(a)){null===n&&(n=new ri(t));const a=o?n.fromEquirectangular(i):n.fromCubemap(i);return e.set(i,a),i.addEventListener("dispose",r),a.texture}return null}}}return i},dispose:function(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function ci(t){const e={};function n(n){if(void 0!==e[n])return e[n];let r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return e[n]=r,r}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?(n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance")):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function ui(t,e,n,r){const i={},a=new WeakMap;function o(t){const s=t.target;null!==s.index&&e.remove(s.index);for(const t in s.attributes)e.remove(s.attributes[t]);for(const t in s.morphAttributes){const n=s.morphAttributes[t];for(let t=0,r=n.length;t<r;t++)e.remove(n[t])}s.removeEventListener("dispose",o),delete i[s.id];const A=a.get(s);A&&(e.remove(A),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t){const n=[],r=t.index,i=t.attributes.position;let o=0;if(null!==r){const t=r.array;o=r.version;for(let e=0,r=t.length;e<r;e+=3){const r=t[e+0],i=t[e+1],a=t[e+2];n.push(r,i,i,a,a,r)}}else{if(void 0===i)return;{const t=i.array;o=i.version;for(let e=0,r=t.length/3-1;e<r;e+=3){const t=e+0,r=e+1,i=e+2;n.push(t,r,r,i,i,t)}}}const s=new(It(n)?In:On)(n,1);s.version=o;const A=a.get(t);A&&e.remove(A),a.set(t,s)}return{get:function(t,e){return!0===i[e.id]||(e.addEventListener("dispose",o),i[e.id]=!0,n.memory.geometries++),e},update:function(n){const r=n.attributes;for(const n in r)e.update(r[n],t.ARRAY_BUFFER);const i=n.morphAttributes;for(const n in i){const r=i[n];for(let n=0,i=r.length;n<i;n++)e.update(r[n],t.ARRAY_BUFFER)}},getWireframeAttribute:function(t){const e=a.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&s(t)}else s(t);return a.get(t)}}}function hi(t,e,n,r){const i=r.isWebGL2;let a,o,s;this.setMode=function(t){a=t},this.setIndex=function(t){o=t.type,s=t.bytesPerElement},this.render=function(e,r){t.drawElements(a,r,o,e*s),n.update(r,a,1)},this.renderInstances=function(r,A,l){if(0===l)return;let c,u;if(i)c=t,u="drawElementsInstanced";else if(c=e.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===c)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](a,A,o,r*s,l),n.update(A,a,l)},this.renderMultiDraw=function(t,r,i){if(0===i)return;const A=e.get("WEBGL_multi_draw");if(null===A)for(let e=0;e<i;e++)this.render(t[e]/s,r[e]);else{A.multiDrawElementsWEBGL(a,r,0,o,t,0,i);let e=0;for(let t=0;t<i;t++)e+=r[t];n.update(e,a,1)}}}function fi(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(n,r,i){switch(e.calls++,r){case t.TRIANGLES:e.triangles+=i*(n/3);break;case t.LINES:e.lines+=i*(n/2);break;case t.LINE_STRIP:e.lines+=i*(n-1);break;case t.LINE_LOOP:e.lines+=i*n;break;case t.POINTS:e.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function di(t,e){return t[0]-e[0]}function pi(t,e){return Math.abs(e[1])-Math.abs(t[1])}function mi(t,e,n){const r={},i=new Float32Array(8),a=new WeakMap,o=new $t,s=[];for(let t=0;t<8;t++)s[t]=[t,0];return{update:function(A,l,c){const u=A.morphTargetInfluences;if(!0===e.isWebGL2){const h=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,f=void 0!==h?h.length:0;let d=a.get(l);if(void 0===d||d.count!==f){void 0!==d&&d.texture.dispose();const p=void 0!==l.morphAttributes.position,m=void 0!==l.morphAttributes.normal,g=void 0!==l.morphAttributes.color,v=l.morphAttributes.position||[],_=l.morphAttributes.normal||[],y=l.morphAttributes.color||[];let x=0;!0===p&&(x=1),!0===m&&(x=2),!0===g&&(x=3);let b=l.attributes.position.count*x,M=1;b>e.maxTextureSize&&(M=Math.ceil(b/e.maxTextureSize),b=e.maxTextureSize);const w=new Float32Array(b*M*4*f),E=new ne(w,b,M,f);E.type=V,E.needsUpdate=!0;const S=4*x;for(let C=0;C<f;C++){const R=v[C],P=_[C],L=y[C],D=b*M*4*C;for(let O=0;O<R.count;O++){const I=O*S;!0===p&&(o.fromBufferAttribute(R,O),w[D+I+0]=o.x,w[D+I+1]=o.y,w[D+I+2]=o.z,w[D+I+3]=0),!0===m&&(o.fromBufferAttribute(P,O),w[D+I+4]=o.x,w[D+I+5]=o.y,w[D+I+6]=o.z,w[D+I+7]=0),!0===g&&(o.fromBufferAttribute(L,O),w[D+I+8]=o.x,w[D+I+9]=o.y,w[D+I+10]=o.z,w[D+I+11]=4===L.itemSize?o.w:1)}}function T(){E.dispose(),a.delete(l),l.removeEventListener("dispose",T)}d={count:f,texture:E,size:new Lt(b,M)},a.set(l,d),l.addEventListener("dispose",T)}if(!0===A.isInstancedMesh&&null!==A.morphTexture)c.getUniforms().setValue(t,"morphTexture",A.morphTexture,n);else{let q=0;for(let N=0;N<u.length;N++)q+=u[N];const U=l.morphTargetsRelative?1:1-q;c.getUniforms().setValue(t,"morphTargetBaseInfluence",U),c.getUniforms().setValue(t,"morphTargetInfluences",u)}c.getUniforms().setValue(t,"morphTargetsTexture",d.texture,n),c.getUniforms().setValue(t,"morphTargetsTextureSize",d.size)}else{const B=void 0===u?0:u.length;let k=r[l.id];if(void 0===k||k.length!==B){k=[];for(let j=0;j<B;j++)k[j]=[j,0];r[l.id]=k}for(let W=0;W<B;W++){const X=k[W];X[0]=W,X[1]=u[W]}k.sort(pi);for(let Q=0;Q<8;Q++)Q<B&&k[Q][1]?(s[Q][0]=k[Q][0],s[Q][1]=k[Q][1]):(s[Q][0]=Number.MAX_SAFE_INTEGER,s[Q][1]=0);s.sort(di);const F=l.morphAttributes.position,z=l.morphAttributes.normal;let G=0;for(let Y=0;Y<8;Y++){const Z=s[Y],K=Z[0],J=Z[1];K!==Number.MAX_SAFE_INTEGER&&J?(F&&l.getAttribute("morphTarget"+Y)!==F[K]&&l.setAttribute("morphTarget"+Y,F[K]),z&&l.getAttribute("morphNormal"+Y)!==z[K]&&l.setAttribute("morphNormal"+Y,z[K]),i[Y]=J,G+=J):(F&&!0===l.hasAttribute("morphTarget"+Y)&&l.deleteAttribute("morphTarget"+Y),z&&!0===l.hasAttribute("morphNormal"+Y)&&l.deleteAttribute("morphNormal"+Y),i[Y]=0)}const H=l.morphTargetsRelative?1:1-G;c.getUniforms().setValue(t,"morphTargetBaseInfluence",H),c.getUniforms().setValue(t,"morphTargetInfluences",i)}}}}function gi(t,e,n,r){let i=new WeakMap;function a(t){const e=t.target;e.removeEventListener("dispose",a),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(o){const s=r.render.frame,A=o.geometry,l=e.get(o,A);if(i.get(l)!==s&&(e.update(l),i.set(l,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),i.get(o)!==s&&(n.update(o.instanceMatrix,t.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,t.ARRAY_BUFFER),i.set(o,s))),o.isSkinnedMesh){const t=o.skeleton;i.get(t)!==s&&(t.update(),i.set(t,s))}return l},dispose:function(){i=new WeakMap}}}class vi extends Jt{constructor(t,e,n,r,i,a,o,s,A,l){if((l=void 0!==l?l:Y)!==Y&&l!==Z)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Y&&(n=j),void 0===n&&l===Z&&(n=X),super(null,r,i,a,o,s,l,n,A),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==o?o:U,this.minFilter=void 0!==s?s:U,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}const _i=new Jt,yi=new vi(1,1);yi.compareFunction=515;const xi=new ne,bi=new re,Mi=new br,wi=[],Ei=[],Si=new Float32Array(16),Ti=new Float32Array(9),Ci=new Float32Array(4);function Ri(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let a=wi[i];if(void 0===a&&(a=new Float32Array(i),wi[i]=a),0!==e){r.toArray(a,0);for(let r=1,i=0;r!==e;++r)i+=n,t[r].toArray(a,i)}return a}function Pi(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Li(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n]}function Di(t,e){let n=Ei[e];void 0===n&&(n=new Int32Array(e),Ei[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function Oi(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Ii(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Pi(n,e))return;t.uniform2fv(this.addr,e),Li(n,e)}}function qi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Pi(n,e))return;t.uniform3fv(this.addr,e),Li(n,e)}}function Ui(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Pi(n,e))return;t.uniform4fv(this.addr,e),Li(n,e)}}function Ni(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Pi(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Li(n,e)}else{if(Pi(n,r))return;Ci.set(r),t.uniformMatrix2fv(this.addr,!1,Ci),Li(n,r)}}function Bi(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Pi(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Li(n,e)}else{if(Pi(n,r))return;Ti.set(r),t.uniformMatrix3fv(this.addr,!1,Ti),Li(n,r)}}function ki(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Pi(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Li(n,e)}else{if(Pi(n,r))return;Si.set(r),t.uniformMatrix4fv(this.addr,!1,Si),Li(n,r)}}function Fi(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function zi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Pi(n,e))return;t.uniform2iv(this.addr,e),Li(n,e)}}function Gi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Pi(n,e))return;t.uniform3iv(this.addr,e),Li(n,e)}}function Hi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Pi(n,e))return;t.uniform4iv(this.addr,e),Li(n,e)}}function ji(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Vi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Pi(n,e))return;t.uniform2uiv(this.addr,e),Li(n,e)}}function Wi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Pi(n,e))return;t.uniform3uiv(this.addr,e),Li(n,e)}}function Xi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Pi(n,e))return;t.uniform4uiv(this.addr,e),Li(n,e)}}function Qi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i);const a=this.type===t.SAMPLER_2D_SHADOW?yi:_i;n.setTexture2D(e||a,i)}function Yi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||bi,i)}function Zi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||Mi,i)}function Ki(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||xi,i)}function Ji(t,e){t.uniform1fv(this.addr,e)}function $i(t,e){const n=Ri(e,this.size,2);t.uniform2fv(this.addr,n)}function ta(t,e){const n=Ri(e,this.size,3);t.uniform3fv(this.addr,n)}function ea(t,e){const n=Ri(e,this.size,4);t.uniform4fv(this.addr,n)}function na(t,e){const n=Ri(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function ra(t,e){const n=Ri(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function ia(t,e){const n=Ri(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function aa(t,e){t.uniform1iv(this.addr,e)}function oa(t,e){t.uniform2iv(this.addr,e)}function sa(t,e){t.uniform3iv(this.addr,e)}function Aa(t,e){t.uniform4iv(this.addr,e)}function la(t,e){t.uniform1uiv(this.addr,e)}function ca(t,e){t.uniform2uiv(this.addr,e)}function ua(t,e){t.uniform3uiv(this.addr,e)}function ha(t,e){t.uniform4uiv(this.addr,e)}function fa(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTexture2D(e[t]||_i,a[t])}function da(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTexture3D(e[t]||bi,a[t])}function pa(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTextureCube(e[t]||Mi,a[t])}function ma(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTexture2DArray(e[t]||xi,a[t])}class ga{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=function(t){switch(t){case 5126:return Oi;case 35664:return Ii;case 35665:return qi;case 35666:return Ui;case 35674:return Ni;case 35675:return Bi;case 35676:return ki;case 5124:case 35670:return Fi;case 35667:case 35671:return zi;case 35668:case 35672:return Gi;case 35669:case 35673:return Hi;case 5125:return ji;case 36294:return Vi;case 36295:return Wi;case 36296:return Xi;case 35678:case 36198:case 36298:case 36306:case 35682:return Qi;case 35679:case 36299:case 36307:return Yi;case 35680:case 36300:case 36308:case 36293:return Zi;case 36289:case 36303:case 36311:case 36292:return Ki}}(e.type)}}class va{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Ji;case 35664:return $i;case 35665:return ta;case 35666:return ea;case 35674:return na;case 35675:return ra;case 35676:return ia;case 5124:case 35670:return aa;case 35667:case 35671:return oa;case 35668:case 35672:return sa;case 35669:case 35673:return Aa;case 5125:return la;case 36294:return ca;case 36295:return ua;case 36296:return ha;case 35678:case 36198:case 36298:case 36306:case 35682:return fa;case 35679:case 36299:case 36307:return da;case 35680:case 36300:case 36308:case 36293:return pa;case 36289:case 36303:case 36311:case 36292:return ma}}(e.type)}}class _a{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const r=this.seq;for(let i=0,a=r.length;i!==a;++i){const a=r[i];a.setValue(t,e[a.id],n)}}}const ya=/(\w+)(\])?(\[|\.)?/g;function xa(t,e){t.seq.push(e),t.map[e.id]=e}function ba(t,e,n){const r=t.name,i=r.length;for(ya.lastIndex=0;;){const a=ya.exec(r),o=ya.lastIndex;let s=a[1];const A="]"===a[2],l=a[3];if(A&&(s|=0),void 0===l||"["===l&&o+2===i){xa(n,void 0===l?new ga(s,t,e):new va(s,t,e));break}{let t=n.map[s];void 0===t&&(t=new _a(s),xa(n,t)),n=t}}}class Ma{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=t.getActiveUniform(e,r);ba(n,t.getUniformLocation(e,n.name),this)}}setValue(t,e,n,r){const i=this.map[e];void 0!==i&&i.setValue(t,n,r)}setOptional(t,e,n){const r=e[n];void 0!==r&&this.setValue(t,n,r)}static upload(t,e,n,r){for(let i=0,a=e.length;i!==a;++i){const a=e[i],o=n[a.id];!1!==o.needsUpdate&&a.setValue(t,o.value,r)}}static seqWithValue(t,e){const n=[];for(let r=0,i=t.length;r!==i;++r){const i=t[r];i.id in e&&n.push(i)}return n}}function wa(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}const Ea=37297;let Sa=0;function Ta(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&""===i)return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const r=parseInt(a[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(t,e){const n=t.split("\n"),r=[],i=Math.max(e-6,0),a=Math.min(e+6,n.length);for(let t=i;t<a;t++){const i=t+1;r.push(`${i===e?">":" "} ${i}: ${n[t]}`)}return r.join("\n")}(t.getShaderSource(e),r)}return i}function Ca(t,e){const n=function(t){const e=Ht.getPrimaries(Ht.workingColorSpace),n=Ht.getPrimaries(t);let r;switch(e===n?r="":e===ct&&n===lt?r="LinearDisplayP3ToLinearSRGB":e===lt&&n===ct&&(r="LinearSRGBToLinearDisplayP3"),t){case it:case ot:return[r,"LinearTransferOETF"];case rt:case at:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function Ra(t,e){let n;switch(e){case M:n="Linear";break;case w:n="Reinhard";break;case E:n="OptimizedCineon";break;case S:n="ACESFilmic";break;case C:n="AgX";break;case R:n="Neutral";break;case T:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Pa(t){return""!==t}function La(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Da(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Oa=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ia(t){return t.replace(Oa,Ua)}const qa=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function Ua(t,e){let n=Ir[e];if(void 0===n){const t=qa.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=Ir[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return Ia(n)}const Na=/#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 Ba(t){return t.replace(Na,ka)}function ka(t,e,n,r){let i="";for(let t=parseInt(e);t<parseInt(n);t++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return i}function Fa(t){let e=`precision ${t.precision} float;\n\tprecision ${t.precision} int;\n\tprecision ${t.precision} sampler2D;\n\tprecision ${t.precision} samplerCube;\n\t`;return t.isWebGL2&&(e+=`precision ${t.precision} sampler3D;\n\t\tprecision ${t.precision} sampler2DArray;\n\t\tprecision ${t.precision} sampler2DShadow;\n\t\tprecision ${t.precision} samplerCubeShadow;\n\t\tprecision ${t.precision} sampler2DArrayShadow;\n\t\tprecision ${t.precision} isampler2D;\n\t\tprecision ${t.precision} isampler3D;\n\t\tprecision ${t.precision} isamplerCube;\n\t\tprecision ${t.precision} isampler2DArray;\n\t\tprecision ${t.precision} usampler2D;\n\t\tprecision ${t.precision} usampler3D;\n\t\tprecision ${t.precision} usamplerCube;\n\t\tprecision ${t.precision} usampler2DArray;\n\t\t`),"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function za(t,e,n,r){const i=t.getContext(),a=n.defines;let o=n.vertexShader,s=n.fragmentShader;const A=function(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===f?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===d?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===p&&(e="SHADOWMAP_TYPE_VSM"),e}(n),l=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case P:case L:e="ENVMAP_TYPE_CUBE";break;case D:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),c=function(t){let e="ENVMAP_MODE_REFLECTION";t.envMap&&t.envMapMode===L&&(e="ENVMAP_MODE_REFRACTION");return e}(n),u=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case _:e="ENVMAP_BLENDING_MULTIPLY";break;case y:e="ENVMAP_BLENDING_MIX";break;case x:e="ENVMAP_BLENDING_ADD"}return e}(n),h=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),m=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.alphaToCoverage||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Pa).join("\n")}(n),g=function(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Pa).join("\n")}(n),v=function(t){const e=[];for(const n in t){const r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(a),M=i.createProgram();let w,E,S=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(w=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Pa).join("\n"),w.length>0&&(w+="\n"),E=[m,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Pa).join("\n"),E.length>0&&(E+="\n")):(w=[Fa(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+A:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.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(Pa).join("\n"),E=[m,Fa(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+A:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==b?"#define TONE_MAPPING":"",n.toneMapping!==b?Ir.tonemapping_pars_fragment:"",n.toneMapping!==b?Ra("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Ir.colorspace_pars_fragment,Ca("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Pa).join("\n")),o=Ia(o),o=La(o,n),o=Da(o,n),s=Ia(s),s=La(s,n),s=Da(s,n),o=Ba(o),s=Ba(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(S="#version 300 es\n",w=[g,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+w,E=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===ft?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===ft?"":"#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"+E);const T=S+w+o,C=S+E+s,R=wa(i,i.VERTEX_SHADER,T),O=wa(i,i.FRAGMENT_SHADER,C);function I(e){if(t.debug.checkShaderErrors){const n=i.getProgramInfoLog(M).trim(),r=i.getShaderInfoLog(R).trim(),a=i.getShaderInfoLog(O).trim();let o=!0,s=!0;if(!1===i.getProgramParameter(M,i.LINK_STATUS))if(o=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(i,M,R,O);else{const t=Ta(i,R,"vertex"),r=Ta(i,O,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(M,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+e.name+"\nMaterial Type: "+e.type+"\n\nProgram Info Log: "+n+"\n"+t+"\n"+r)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==r&&""!==a||(s=!1);s&&(e.diagnostics={runnable:o,programLog:n,vertexShader:{log:r,prefix:w},fragmentShader:{log:a,prefix:E}})}i.deleteShader(R),i.deleteShader(O),q=new Ma(i,M),U=function(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=t.getActiveAttrib(e,i),a=r.name;let o=1;r.type===t.FLOAT_MAT2&&(o=2),r.type===t.FLOAT_MAT3&&(o=3),r.type===t.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:t.getAttribLocation(e,a),locationSize:o}}return n}(i,M)}let q,U;i.attachShader(M,R),i.attachShader(M,O),void 0!==n.index0AttributeName?i.bindAttribLocation(M,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(M,0,"position"),i.linkProgram(M),this.getUniforms=function(){return void 0===q&&I(this),q},this.getAttributes=function(){return void 0===U&&I(this),U};let N=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===N&&(N=i.getProgramParameter(M,Ea)),N},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(M),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Sa++,this.cacheKey=e,this.usedTimes=1,this.program=M,this.vertexShader=R,this.fragmentShader=O,this}let Ga=0;class Ha{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,r=this._getShaderStage(e),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return!1===a.has(r)&&(a.add(r),r.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new ja(t),e.set(t,n)),n}}class ja{constructor(t){this.id=Ga++,this.code=t,this.usedTimes=0}}function Va(t,e,n,r,i,a,o){const s=new We,A=new Ha,l=new Set,c=[],u=i.isWebGL2,h=i.logarithmicDepthBuffer,f=i.vertexTextures;let d=i.precision;const p={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 m(t){return l.add(t),0===t?"uv":`uv${t}`}return{getParameters:function(a,s,c,v,_){const y=v.fog,x=_.geometry,M=a.isMeshStandardMaterial?v.environment:null,w=(a.isMeshStandardMaterial?n:e).get(a.envMap||M),E=w&&w.mapping===D?w.image.height:null,S=p[a.type];null!==a.precision&&(d=i.getMaxPrecision(a.precision),d!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",d,"instead."));const T=x.morphAttributes.position||x.morphAttributes.normal||x.morphAttributes.color,C=void 0!==T?T.length:0;let R,P,L,O,I=0;if(void 0!==x.morphAttributes.position&&(I=1),void 0!==x.morphAttributes.normal&&(I=2),void 0!==x.morphAttributes.color&&(I=3),S){const t=Ur[S];R=t.vertexShader,P=t.fragmentShader}else R=a.vertexShader,P=a.fragmentShader,A.update(a),L=A.getVertexShaderID(a),O=A.getFragmentShaderID(a);const q=t.getRenderTarget(),U=!0===_.isInstancedMesh,N=!0===_.isBatchedMesh,B=!!a.map,k=!!a.matcap,F=!!w,z=!!a.aoMap,G=!!a.lightMap,H=!!a.bumpMap,j=!!a.normalMap,V=!!a.displacementMap,W=!!a.emissiveMap,X=!!a.metalnessMap,Q=!!a.roughnessMap,Y=a.anisotropy>0,Z=a.clearcoat>0,K=a.iridescence>0,J=a.sheen>0,$=a.transmission>0,tt=Y&&!!a.anisotropyMap,et=Z&&!!a.clearcoatMap,nt=Z&&!!a.clearcoatNormalMap,rt=Z&&!!a.clearcoatRoughnessMap,at=K&&!!a.iridescenceMap,ot=K&&!!a.iridescenceThicknessMap,st=J&&!!a.sheenColorMap,lt=J&&!!a.sheenRoughnessMap,ct=!!a.specularMap,ut=!!a.specularColorMap,ht=!!a.specularIntensityMap,ft=$&&!!a.transmissionMap,dt=$&&!!a.thicknessMap,pt=!!a.gradientMap,mt=!!a.alphaMap,gt=a.alphaTest>0,vt=!!a.alphaHash,_t=!!a.extensions;let yt=b;a.toneMapped&&(null!==q&&!0!==q.isXRRenderTarget||(yt=t.toneMapping));const xt={isWebGL2:u,shaderID:S,shaderType:a.type,shaderName:a.name,vertexShader:R,fragmentShader:P,defines:a.defines,customVertexShaderID:L,customFragmentShaderID:O,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:d,batching:N,instancing:U,instancingColor:U&&null!==_.instanceColor,instancingMorph:U&&null!==_.morphTexture,supportsVertexTextures:f,outputColorSpace:null===q?t.outputColorSpace:!0===q.isXRRenderTarget?q.texture.colorSpace:it,alphaToCoverage:!!a.alphaToCoverage,map:B,matcap:k,envMap:F,envMapMode:F&&w.mapping,envMapCubeUVHeight:E,aoMap:z,lightMap:G,bumpMap:H,normalMap:j,displacementMap:f&&V,emissiveMap:W,normalMapObjectSpace:j&&1===a.normalMapType,normalMapTangentSpace:j&&0===a.normalMapType,metalnessMap:X,roughnessMap:Q,anisotropy:Y,anisotropyMap:tt,clearcoat:Z,clearcoatMap:et,clearcoatNormalMap:nt,clearcoatRoughnessMap:rt,iridescence:K,iridescenceMap:at,iridescenceThicknessMap:ot,sheen:J,sheenColorMap:st,sheenRoughnessMap:lt,specularMap:ct,specularColorMap:ut,specularIntensityMap:ht,transmission:$,transmissionMap:ft,thicknessMap:dt,gradientMap:pt,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:mt,alphaTest:gt,alphaHash:vt,combine:a.combine,mapUv:B&&m(a.map.channel),aoMapUv:z&&m(a.aoMap.channel),lightMapUv:G&&m(a.lightMap.channel),bumpMapUv:H&&m(a.bumpMap.channel),normalMapUv:j&&m(a.normalMap.channel),displacementMapUv:V&&m(a.displacementMap.channel),emissiveMapUv:W&&m(a.emissiveMap.channel),metalnessMapUv:X&&m(a.metalnessMap.channel),roughnessMapUv:Q&&m(a.roughnessMap.channel),anisotropyMapUv:tt&&m(a.anisotropyMap.channel),clearcoatMapUv:et&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:nt&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:rt&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:at&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ot&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:st&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:lt&&m(a.sheenRoughnessMap.channel),specularMapUv:ct&&m(a.specularMap.channel),specularColorMapUv:ut&&m(a.specularColorMap.channel),specularIntensityMapUv:ht&&m(a.specularIntensityMap.channel),transmissionMapUv:ft&&m(a.transmissionMap.channel),thicknessMapUv:dt&&m(a.thicknessMap.channel),alphaMapUv:mt&&m(a.alphaMap.channel),vertexTangents:!!x.attributes.tangent&&(j||Y),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,pointsUvs:!0===_.isPoints&&!!x.attributes.uv&&(B||mt),fog:!!y,useFog:!0===a.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:C,morphTextureStride:I,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:yt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:B&&!0===a.map.isVideoTexture&&Ht.getTransfer(a.map.colorSpace)===At,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:a.side===g,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionDerivatives:_t&&!0===a.extensions.derivatives,extensionFragDepth:_t&&!0===a.extensions.fragDepth,extensionDrawBuffers:_t&&!0===a.extensions.drawBuffers,extensionShaderTextureLOD:_t&&!0===a.extensions.shaderTextureLOD,extensionClipCullDistance:_t&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:_t&&!0===a.extensions.multiDraw&&r.has("WEBGL_multi_draw"),rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return xt.vertexUv1s=l.has(1),xt.vertexUv2s=l.has(2),xt.vertexUv3s=l.has(3),l.clear(),xt},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){s.disableAll(),e.isWebGL2&&s.enable(0);e.supportsVertexTextures&&s.enable(1);e.instancing&&s.enable(2);e.instancingColor&&s.enable(3);e.instancingMorph&&s.enable(4);e.matcap&&s.enable(5);e.envMap&&s.enable(6);e.normalMapObjectSpace&&s.enable(7);e.normalMapTangentSpace&&s.enable(8);e.clearcoat&&s.enable(9);e.iridescence&&s.enable(10);e.alphaTest&&s.enable(11);e.vertexColors&&s.enable(12);e.vertexAlphas&&s.enable(13);e.vertexUv1s&&s.enable(14);e.vertexUv2s&&s.enable(15);e.vertexUv3s&&s.enable(16);e.vertexTangents&&s.enable(17);e.anisotropy&&s.enable(18);e.alphaHash&&s.enable(19);e.batching&&s.enable(20);t.push(s.mask),s.disableAll(),e.fog&&s.enable(0);e.useFog&&s.enable(1);e.flatShading&&s.enable(2);e.logarithmicDepthBuffer&&s.enable(3);e.skinning&&s.enable(4);e.morphTargets&&s.enable(5);e.morphNormals&&s.enable(6);e.morphColors&&s.enable(7);e.premultipliedAlpha&&s.enable(8);e.shadowMapEnabled&&s.enable(9);e.useLegacyLights&&s.enable(10);e.doubleSided&&s.enable(11);e.flipSided&&s.enable(12);e.useDepthPacking&&s.enable(13);e.dithering&&s.enable(14);e.transmission&&s.enable(15);e.sheen&&s.enable(16);e.opaque&&s.enable(17);e.pointsUvs&&s.enable(18);e.decodeVideoTexture&&s.enable(19);e.alphaToCoverage&&s.enable(20);t.push(s.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=p[t.type];let n;if(e){const t=Ur[e];n=fr.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let r;for(let t=0,e=c.length;t<e;t++){const e=c[t];if(e.cacheKey===n){r=e,++r.usedTimes;break}}return void 0===r&&(r=new za(t,n,e,a),c.push(r)),r},releaseProgram:function(t){if(0==--t.usedTimes){const e=c.indexOf(t);c[e]=c[c.length-1],c.pop(),t.destroy()}},releaseShaderCache:function(t){A.remove(t)},programs:c,dispose:function(){A.dispose()}}}function Wa(){let t=new WeakMap;return{get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,r){t.get(e)[n]=r},dispose:function(){t=new WeakMap}}}function Xa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Qa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ya(){const t=[];let e=0;const n=[],r=[],i=[];function a(n,r,i,a,o,s){let A=t[e];return void 0===A?(A={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},t[e]=A):(A.id=n.id,A.object=n,A.geometry=r,A.material=i,A.groupOrder=a,A.renderOrder=n.renderOrder,A.z=o,A.group=s),e++,A}return{opaque:n,transmissive:r,transparent:i,init:function(){e=0,n.length=0,r.length=0,i.length=0},push:function(t,e,o,s,A,l){const c=a(t,e,o,s,A,l);o.transmission>0?r.push(c):!0===o.transparent?i.push(c):n.push(c)},unshift:function(t,e,o,s,A,l){const c=a(t,e,o,s,A,l);o.transmission>0?r.unshift(c):!0===o.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=e,r=t.length;n<r;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){n.length>1&&n.sort(t||Xa),r.length>1&&r.sort(e||Qa),i.length>1&&i.sort(e||Qa)}}}function Za(){let t=new WeakMap;return{get:function(e,n){const r=t.get(e);let i;return void 0===r?(i=new Ya,t.set(e,[i])):n>=r.length?(i=new Ya,r.push(i)):i=r[n],i},dispose:function(){t=new WeakMap}}}function Ka(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ae,color:new En};break;case"SpotLight":n={position:new ae,direction:new ae,color:new En,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ae,color:new En,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ae,skyColor:new En,groundColor:new En};break;case"RectAreaLight":n={color:new En,position:new ae,halfWidth:new ae,halfHeight:new ae}}return t[e.id]=n,n}}}let Ja=0;function $a(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function to(t,e){const n=new Ka,r=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),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 t=0;t<9;t++)i.probe.push(new ae);const a=new ae,o=new qe,s=new qe;return{setup:function(a,o){let s=0,A=0,l=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;a.sort($a);const x=!0===o?Math.PI:1;for(let t=0,e=a.length;t<e;t++){const e=a[t],o=e.color,b=e.intensity,M=e.distance,w=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)s+=o.r*b*x,A+=o.g*b*x,l+=o.b*b*x;else if(e.isLightProbe){for(let t=0;t<9;t++)i.probe[t].addScaledVector(e.sh.coefficients[t],b);y++}else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.directionalShadow[c]=n,i.directionalShadowMap[c]=w,i.directionalShadowMatrix[c]=e.shadow.matrix,p++}i.directional[c]=t,c++}else if(e.isSpotLight){const t=n.get(e);t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(o).multiplyScalar(b*x),t.distance=M,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,i.spot[h]=t;const a=e.shadow;if(e.map&&(i.spotLightMap[v]=e.map,v++,a.updateMatrices(e),e.castShadow&&_++),i.spotLightMatrix[h]=a.matrix,e.castShadow){const t=r.get(e);t.shadowBias=a.bias,t.shadowNormalBias=a.normalBias,t.shadowRadius=a.radius,t.shadowMapSize=a.mapSize,i.spotShadow[h]=t,i.spotShadowMap[h]=w,g++}h++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(o).multiplyScalar(b),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),i.rectArea[f]=t,f++}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,i.pointShadow[u]=n,i.pointShadowMap[u]=w,i.pointShadowMatrix[u]=e.shadow.matrix,m++}i.point[u]=t,u++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(b*x),t.groundColor.copy(e.groundColor).multiplyScalar(b*x),i.hemi[d]=t,d++}}f>0&&(e.isWebGL2?!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=qr.LTC_FLOAT_1,i.rectAreaLTC2=qr.LTC_FLOAT_2):(i.rectAreaLTC1=qr.LTC_HALF_1,i.rectAreaLTC2=qr.LTC_HALF_2):!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=qr.LTC_FLOAT_1,i.rectAreaLTC2=qr.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=qr.LTC_HALF_1,i.rectAreaLTC2=qr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=s,i.ambient[1]=A,i.ambient[2]=l;const b=i.hash;b.directionalLength===c&&b.pointLength===u&&b.spotLength===h&&b.rectAreaLength===f&&b.hemiLength===d&&b.numDirectionalShadows===p&&b.numPointShadows===m&&b.numSpotShadows===g&&b.numSpotMaps===v&&b.numLightProbes===y||(i.directional.length=c,i.spot.length=h,i.rectArea.length=f,i.point.length=u,i.hemi.length=d,i.directionalShadow.length=p,i.directionalShadowMap.length=p,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=p,i.pointShadowMatrix.length=m,i.spotLightMatrix.length=g+v-_,i.spotLightMap.length=v,i.numSpotLightShadowsWithMaps=_,i.numLightProbes=y,b.directionalLength=c,b.pointLength=u,b.spotLength=h,b.rectAreaLength=f,b.hemiLength=d,b.numDirectionalShadows=p,b.numPointShadows=m,b.numSpotShadows=g,b.numSpotMaps=v,b.numLightProbes=y,i.version=Ja++)},setupView:function(t,e){let n=0,r=0,A=0,l=0,c=0;const u=e.matrixWorldInverse;for(let e=0,h=t.length;e<h;e++){const h=t[e];if(h.isDirectionalLight){const t=i.directional[n];t.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),n++}else if(h.isSpotLight){const t=i.spot[A];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),t.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),A++}else if(h.isRectAreaLight){const t=i.rectArea[l];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),s.identity(),o.copy(h.matrixWorld),o.premultiply(u),s.extractRotation(o),t.halfWidth.set(.5*h.width,0,0),t.halfHeight.set(0,.5*h.height,0),t.halfWidth.applyMatrix4(s),t.halfHeight.applyMatrix4(s),l++}else if(h.isPointLight){const t=i.point[r];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),r++}else if(h.isHemisphereLight){const t=i.hemi[c];t.direction.setFromMatrixPosition(h.matrixWorld),t.direction.transformDirection(u),c++}}},state:i}}function eo(t,e){const n=new to(t,e),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(t){n.setup(r,t)},setupLightsView:function(t){n.setupView(r,t)},pushLight:function(t){r.push(t)},pushShadow:function(t){i.push(t)}}}function no(t,e){let n=new WeakMap;return{get:function(r,i=0){const a=n.get(r);let o;return void 0===a?(o=new eo(t,e),n.set(r,[o])):i>=a.length?(o=new eo(t,e),a.push(o)):o=a[i],o},dispose:function(){n=new WeakMap}}}class ro extends Cn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class io extends Cn{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function ao(t,e,n){let r=new Pr;const i=new Lt,a=new Lt,o=new $t,s=new ro({depthPacking:3201}),A=new io,l={},c=n.maxTextureSize,u={[m]:g,[g]:m,2:2},h=new dr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Lt},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}"}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const v=new Hn;v.setAttribute("position",new Dn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new sr(v,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=f;let x=this.type;function b(n,r){const a=e.update(_);h.defines.VSM_SAMPLES!==n.blurSamples&&(h.defines.VSM_SAMPLES=n.blurSamples,d.defines.VSM_SAMPLES=n.blurSamples,h.needsUpdate=!0,d.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new ee(i.x,i.y)),h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,a,h,_,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,a,d,_,null)}function M(e,n,r,i){let a=null;const o=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?A:s,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=a.uuid,e=n.uuid;let r=l[t];void 0===r&&(r={},l[t]=r);let i=r[e];void 0===i&&(i=a.clone(),r[e]=i,n.addEventListener("dispose",E)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=i===p?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial){t.properties.get(a).light=r}return a}function w(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===p)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=e.update(n),A=n.material;if(Array.isArray(A)){const e=r.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l],u=A[c.materialIndex];if(u&&u.visible){const e=M(n,u,o,s);n.onBeforeShadow(t,n,i,a,r,e,c),t.renderBufferDirect(a,null,r,e,n,c),n.onAfterShadow(t,n,i,a,r,e,c)}}}else if(A.visible){const e=M(n,A,o,s);n.onBeforeShadow(t,n,i,a,r,e,null),t.renderBufferDirect(a,null,r,e,n,null),n.onAfterShadow(t,n,i,a,r,e,null)}}const A=n.children;for(let t=0,e=A.length;t<e;t++)w(A[t],i,a,o,s)}function E(t){t.target.removeEventListener("dispose",E);for(const e in l){const n=l[e],r=t.target.uuid;if(r in n){n[r].dispose(),delete n[r]}}}this.render=function(e,n,s){if(!1===y.enabled)return;if(!1===y.autoUpdate&&!1===y.needsUpdate)return;if(0===e.length)return;const A=t.getRenderTarget(),l=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),h=t.state;h.setBlending(0),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const f=x!==p&&this.type===p,d=x===p&&this.type!==p;for(let A=0,l=e.length;A<l;A++){const l=e[A],u=l.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;i.copy(u.mapSize);const m=u.getFrameExtents();if(i.multiply(m),a.copy(u.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/m.x),i.x=a.x*m.x,u.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/m.y),i.y=a.y*m.y,u.mapSize.y=a.y)),null===u.map||!0===f||!0===d){const t=this.type!==p?{minFilter:U,magFilter:U}:{};null!==u.map&&u.map.dispose(),u.map=new ee(i.x,i.y,t),u.map.texture.name=l.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const g=u.getViewportCount();for(let t=0;t<g;t++){const e=u.getViewport(t);o.set(a.x*e.x,a.y*e.y,a.x*e.z,a.y*e.w),h.viewport(o),u.updateMatrices(l,t),r=u.getFrustum(),w(n,s,u.camera,l,this.type)}!0!==u.isPointLightShadow&&this.type===p&&b(u,s),u.needsUpdate=!1}x=this.type,y.needsUpdate=!1,t.setRenderTarget(A,l,u)}}function oo(t,e,n){const r=n.isWebGL2;const i=new function(){let e=!1;const n=new $t;let r=null;const i=new $t(0,0,0,0);return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,a,o,s){!0===s&&(e*=o,r*=o,a*=o),n.set(e,r,a,o),!1===i.equals(n)&&(t.clearColor(e,r,a,o),i.copy(n))},reset:function(){e=!1,r=null,i.set(-1,0,0,0)}}},a=new function(){let e=!1,n=null,r=null,i=null;return{setTest:function(e){e?j(t.DEPTH_TEST):V(t.DEPTH_TEST)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,n=null,r=null,i=null}}},o=new function(){let e=!1,n=null,r=null,i=null,a=null,o=null,s=null,A=null,l=null;return{setTest:function(n){e||(n?j(t.STENCIL_TEST):V(t.STENCIL_TEST))},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,o){r===e&&i===n&&a===o||(t.stencilFunc(e,n,o),r=e,i=n,a=o)},setOp:function(e,n,r){o===e&&s===n&&A===r||(t.stencilOp(e,n,r),o=e,s=n,A=r)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,n=null,r=null,i=null,a=null,o=null,s=null,A=null,l=null}}},s=new WeakMap,A=new WeakMap;let l={},c={},u=new WeakMap,h=[],f=null,d=!1,p=null,m=null,_=null,y=null,x=null,b=null,M=null,w=new En(0,0,0),E=0,S=!1,T=null,C=null,R=null,P=null,L=null;const D=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,I=0;const q=t.getParameter(t.VERSION);-1!==q.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(q)[1]),O=I>=1):-1!==q.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),O=I>=2);let U=null,N={};const B=t.getParameter(t.SCISSOR_BOX),k=t.getParameter(t.VIEWPORT),F=(new $t).fromArray(B),z=(new $t).fromArray(k);function G(e,n,i,a){const o=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let s=0;s<i;s++)!r||e!==t.TEXTURE_3D&&e!==t.TEXTURE_2D_ARRAY?t.texImage2D(n+s,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,o):t.texImage3D(n,0,t.RGBA,1,1,a,0,t.RGBA,t.UNSIGNED_BYTE,o);return s}const H={};function j(e){!0!==l[e]&&(t.enable(e),l[e]=!0)}function V(e){!1!==l[e]&&(t.disable(e),l[e]=!1)}H[t.TEXTURE_2D]=G(t.TEXTURE_2D,t.TEXTURE_2D,1),H[t.TEXTURE_CUBE_MAP]=G(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(H[t.TEXTURE_2D_ARRAY]=G(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),H[t.TEXTURE_3D]=G(t.TEXTURE_3D,t.TEXTURE_3D,1,1)),i.setClear(0,0,0,1),a.setClear(1),o.setClear(0),j(t.DEPTH_TEST),a.setFunc(3),Y(!1),Z(1),j(t.CULL_FACE),Q(0);const W={[v]:t.FUNC_ADD,101:t.FUNC_SUBTRACT,102:t.FUNC_REVERSE_SUBTRACT};if(r)W[103]=t.MIN,W[104]=t.MAX;else{const t=e.get("EXT_blend_minmax");null!==t&&(W[103]=t.MIN_EXT,W[104]=t.MAX_EXT)}const X={200:t.ZERO,201:t.ONE,202:t.SRC_COLOR,204:t.SRC_ALPHA,210:t.SRC_ALPHA_SATURATE,208:t.DST_COLOR,206:t.DST_ALPHA,203:t.ONE_MINUS_SRC_COLOR,205:t.ONE_MINUS_SRC_ALPHA,209:t.ONE_MINUS_DST_COLOR,207:t.ONE_MINUS_DST_ALPHA,211:t.CONSTANT_COLOR,212:t.ONE_MINUS_CONSTANT_COLOR,213:t.CONSTANT_ALPHA,214:t.ONE_MINUS_CONSTANT_ALPHA};function Q(e,n,r,i,a,o,s,A,l,c){if(0!==e){if(!1===d&&(j(t.BLEND),d=!0),5===e)a=a||n,o=o||r,s=s||i,n===m&&a===x||(t.blendEquationSeparate(W[n],W[a]),m=n,x=a),r===_&&i===y&&o===b&&s===M||(t.blendFuncSeparate(X[r],X[i],X[o],X[s]),_=r,y=i,b=o,M=s),!1!==A.equals(w)&&l===E||(t.blendColor(A.r,A.g,A.b,l),w.copy(A),E=l),p=e,S=!1;else if(e!==p||c!==S){if(m===v&&x===v||(t.blendEquation(t.FUNC_ADD),m=v,x=v),c)switch(e){case 1:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.ONE,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}_=null,y=null,b=null,M=null,w.set(0,0,0),E=0,p=e,S=c}}else!0===d&&(V(t.BLEND),d=!1)}function Y(e){T!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),T=e)}function Z(e){0!==e?(j(t.CULL_FACE),e!==C&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):V(t.CULL_FACE),C=e}function K(e,n,r){e?(j(t.POLYGON_OFFSET_FILL),P===n&&L===r||(t.polygonOffset(n,r),P=n,L=r)):V(t.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:a,stencil:o},enable:j,disable:V,bindFramebuffer:function(e,n){return c[e]!==n&&(t.bindFramebuffer(e,n),c[e]=n,r&&(e===t.DRAW_FRAMEBUFFER&&(c[t.FRAMEBUFFER]=n),e===t.FRAMEBUFFER&&(c[t.DRAW_FRAMEBUFFER]=n)),!0)},drawBuffers:function(r,i){let a=h,o=!1;if(r){a=u.get(i),void 0===a&&(a=[],u.set(i,a));const e=r.textures;if(a.length!==e.length||a[0]!==t.COLOR_ATTACHMENT0){for(let n=0,r=e.length;n<r;n++)a[n]=t.COLOR_ATTACHMENT0+n;a.length=e.length,o=!0}}else a[0]!==t.BACK&&(a[0]=t.BACK,o=!0);if(o)if(n.isWebGL2)t.drawBuffers(a);else{if(!0!==e.has("WEBGL_draw_buffers"))throw new Error("THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension");e.get("WEBGL_draw_buffers").drawBuffersWEBGL(a)}},useProgram:function(e){return f!==e&&(t.useProgram(e),f=e,!0)},setBlending:Q,setMaterial:function(e,n){2===e.side?V(t.CULL_FACE):j(t.CULL_FACE);let r=e.side===g;n&&(r=!r),Y(r),1===e.blending&&!1===e.transparent?Q(0):Q(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.blendColor,e.blendAlpha,e.premultipliedAlpha),a.setFunc(e.depthFunc),a.setTest(e.depthTest),a.setMask(e.depthWrite),i.setMask(e.colorWrite);const s=e.stencilWrite;o.setTest(s),s&&(o.setMask(e.stencilWriteMask),o.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),o.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),K(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?j(t.SAMPLE_ALPHA_TO_COVERAGE):V(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:Y,setCullFace:Z,setLineWidth:function(e){e!==R&&(O&&t.lineWidth(e),R=e)},setPolygonOffset:K,setScissorTest:function(e){e?j(t.SCISSOR_TEST):V(t.SCISSOR_TEST)},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+D-1),U!==e&&(t.activeTexture(e),U=e)},bindTexture:function(e,n,r){void 0===r&&(r=null===U?t.TEXTURE0+D-1:U);let i=N[r];void 0===i&&(i={type:void 0,texture:void 0},N[r]=i),i.type===e&&i.texture===n||(U!==r&&(t.activeTexture(r),U=r),t.bindTexture(e,n||H[e]),i.type=e,i.texture=n)},unbindTexture:function(){const e=N[U];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(e,n){let r=A.get(n);void 0===r&&(r=new WeakMap,A.set(n,r));let i=r.get(e);void 0===i&&(i=t.getUniformBlockIndex(n,e.name),r.set(e,i))},uniformBlockBinding:function(e,n){const r=A.get(n).get(e);s.get(n)!==r&&(t.uniformBlockBinding(n,r,e.__bindingPointIndex),s.set(n,r))},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===F.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),F.copy(e))},viewport:function(e){!1===z.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),z.copy(e))},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),!0===r&&(t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),l={},U=null,N={},c={},u=new WeakMap,h=[],f=null,d=!1,p=null,m=null,_=null,y=null,x=null,b=null,M=null,w=new En(0,0,0),E=0,S=!1,T=null,C=null,R=null,P=null,L=null,F.set(0,0,t.canvas.width,t.canvas.height),z.set(0,0,t.canvas.width,t.canvas.height),i.reset(),a.reset(),o.reset()}}}function so(t,e,n,r,i,a,o){const s=i.isWebGL2,A=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new Lt,u=new WeakMap;let h;const f=new WeakMap;let d=!1;try{d="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function p(t,e){return d?new OffscreenCanvas(t,e):qt("canvas")}function m(t,e,n,r){let i=1;const a=at(t);if((a.width>r||a.height>r)&&(i=r/Math.max(a.width,a.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&t instanceof VideoFrame){const r=e?Tt:Math.floor,o=r(i*a.width),s=r(i*a.height);void 0===h&&(h=p(o,s));const A=n?p(o,s):h;A.width=o,A.height=s;return A.getContext("2d").drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+o+"x"+s+")."),A}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+")."),t}return t}function g(t){const e=at(t);return St(e.width)&&St(e.height)}function v(t,e){return t.generateMipmaps&&e&&t.minFilter!==U&&t.minFilter!==B}function _(e){t.generateMipmap(e)}function y(n,r,i,a,o=!1){if(!1===s)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let A=r;if(r===t.RED&&(i===t.FLOAT&&(A=t.R32F),i===t.HALF_FLOAT&&(A=t.R16F),i===t.UNSIGNED_BYTE&&(A=t.R8)),r===t.RED_INTEGER&&(i===t.UNSIGNED_BYTE&&(A=t.R8UI),i===t.UNSIGNED_SHORT&&(A=t.R16UI),i===t.UNSIGNED_INT&&(A=t.R32UI),i===t.BYTE&&(A=t.R8I),i===t.SHORT&&(A=t.R16I),i===t.INT&&(A=t.R32I)),r===t.RG&&(i===t.FLOAT&&(A=t.RG32F),i===t.HALF_FLOAT&&(A=t.RG16F),i===t.UNSIGNED_BYTE&&(A=t.RG8)),r===t.RG_INTEGER&&(i===t.UNSIGNED_BYTE&&(A=t.RG8UI),i===t.UNSIGNED_SHORT&&(A=t.RG16UI),i===t.UNSIGNED_INT&&(A=t.RG32UI),i===t.BYTE&&(A=t.RG8I),i===t.SHORT&&(A=t.RG16I),i===t.INT&&(A=t.RG32I)),r===t.RGBA){const e=o?st:Ht.getTransfer(a);i===t.FLOAT&&(A=t.RGBA32F),i===t.HALF_FLOAT&&(A=t.RGBA16F),i===t.UNSIGNED_BYTE&&(A=e===At?t.SRGB8_ALPHA8:t.RGBA8),i===t.UNSIGNED_SHORT_4_4_4_4&&(A=t.RGBA4),i===t.UNSIGNED_SHORT_5_5_5_1&&(A=t.RGB5_A1)}return A!==t.R16F&&A!==t.R32F&&A!==t.RG16F&&A!==t.RG32F&&A!==t.RGBA16F&&A!==t.RGBA32F||e.get("EXT_color_buffer_float"),A}function x(t,e,n){return!0===v(t,n)||t.isFramebufferTexture&&t.minFilter!==U&&t.minFilter!==B?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function b(e){return e===U||1004===e||e===N?t.NEAREST:t.LINEAR}function M(t){const e=t.target;e.removeEventListener("dispose",M),function(t){const e=r.get(t);if(void 0===e.__webglInit)return;const n=t.source,i=f.get(n);if(i){const r=i[e.__cacheKey];r.usedTimes--,0===r.usedTimes&&E(t),0===Object.keys(i).length&&f.delete(n)}r.remove(t)}(e),e.isVideoTexture&&u.delete(e)}function w(e){const n=e.target;n.removeEventListener("dispose",w),function(e){const n=r.get(e);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let r=0;r<n.__webglFramebuffer[e].length;r++)t.deleteFramebuffer(n.__webglFramebuffer[e][r]);else t.deleteFramebuffer(n.__webglFramebuffer[e]);n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e])}else{if(Array.isArray(n.__webglFramebuffer))for(let e=0;e<n.__webglFramebuffer.length;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let e=0;e<n.__webglColorRenderbuffer.length;e++)n.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(n.__webglColorRenderbuffer[e]);n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const i=e.textures;for(let e=0,n=i.length;e<n;e++){const n=r.get(i[e]);n.__webglTexture&&(t.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[e])}r.remove(e)}(n)}function E(e){const n=r.get(e);t.deleteTexture(n.__webglTexture);const i=e.source;delete f.get(i)[n.__cacheKey],o.memory.textures--}let S=0;function T(e,i){const a=r.get(e);if(e.isVideoTexture&&function(t){const e=o.render.frame;u.get(t)!==e&&(u.set(t,e),t.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&a.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void H(a,e,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,a.__webglTexture,t.TEXTURE0+i)}const C={[O]:t.REPEAT,[I]:t.CLAMP_TO_EDGE,[q]:t.MIRRORED_REPEAT},R={[U]:t.NEAREST,1004:t.NEAREST_MIPMAP_NEAREST,[N]:t.NEAREST_MIPMAP_LINEAR,[B]:t.LINEAR,[k]:t.LINEAR_MIPMAP_NEAREST,[F]:t.LINEAR_MIPMAP_LINEAR},P={512:t.NEVER,519:t.ALWAYS,513:t.LESS,515:t.LEQUAL,514:t.EQUAL,518:t.GEQUAL,516:t.GREATER,517:t.NOTEQUAL};function L(n,a,o){if(a.type!==V||!1!==e.has("OES_texture_float_linear")||a.magFilter!==B&&a.magFilter!==k&&a.magFilter!==N&&a.magFilter!==F&&a.minFilter!==B&&a.minFilter!==k&&a.minFilter!==N&&a.minFilter!==F||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),o?(t.texParameteri(n,t.TEXTURE_WRAP_S,C[a.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,C[a.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,C[a.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,R[a.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,R[a.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),a.wrapS===I&&a.wrapT===I||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,b(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,b(a.minFilter)),a.minFilter!==U&&a.minFilter!==B&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),a.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,P[a.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){if(a.magFilter===U)return;if(a.minFilter!==N&&a.minFilter!==F)return;if(a.type===V&&!1===e.has("OES_texture_float_linear"))return;if(!1===s&&a.type===W&&!1===e.has("OES_texture_half_float_linear"))return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){const o=e.get("EXT_texture_filter_anisotropic");t.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function D(e,n){let r=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",M));const i=n.source;let a=f.get(i);void 0===a&&(a={},f.set(i,a));const s=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(s!==e.__cacheKey){void 0===a[s]&&(a[s]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;const i=a[e.__cacheKey];void 0!==i&&(a[e.__cacheKey].usedTimes--,0===i.usedTimes&&E(n)),e.__cacheKey=s,e.__webglTexture=a[s].texture}return r}function H(e,o,A){let l=t.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=t.TEXTURE_3D);const c=D(e,o),u=o.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+A);const h=r.get(u);if(u.version!==h.__version||!0===c){n.activeTexture(t.TEXTURE0+A);const e=Ht.getPrimaries(Ht.workingColorSpace),r=o.colorSpace===nt?null:Ht.getPrimaries(o.colorSpace),f=o.colorSpace===nt||e===r?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);const d=function(t){return!s&&(t.wrapS!==I||t.wrapT!==I||t.minFilter!==U&&t.minFilter!==B)}(o)&&!1===g(o.image);let p=m(o.image,d,!1,i.maxTextureSize);p=rt(o,p);const b=g(p)||s,M=a.convert(o.format,o.colorSpace);let w,E=a.convert(o.type),S=y(o.internalFormat,M,E,o.colorSpace,o.isVideoTexture);L(l,o,b);const T=o.mipmaps,C=s&&!0!==o.isVideoTexture&&36196!==S,R=void 0===h.__version||!0===c,P=u.dataReady,D=x(o,p,b);if(o.isDepthTexture)S=t.DEPTH_COMPONENT,s?S=o.type===V?t.DEPTH_COMPONENT32F:o.type===j?t.DEPTH_COMPONENT24:o.type===X?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:o.type===V&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),o.format===Y&&S===t.DEPTH_COMPONENT&&o.type!==G&&o.type!==j&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),o.type=j,E=a.convert(o.type)),o.format===Z&&S===t.DEPTH_COMPONENT&&(S=t.DEPTH_STENCIL,o.type!==X&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),o.type=X,E=a.convert(o.type))),R&&(C?n.texStorage2D(t.TEXTURE_2D,1,S,p.width,p.height):n.texImage2D(t.TEXTURE_2D,0,S,p.width,p.height,0,M,E,null));else if(o.isDataTexture)if(T.length>0&&b){C&&R&&n.texStorage2D(t.TEXTURE_2D,D,S,T[0].width,T[0].height);for(let e=0,r=T.length;e<r;e++)w=T[e],C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,E,w.data):n.texImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,M,E,w.data);o.generateMipmaps=!1}else C?(R&&n.texStorage2D(t.TEXTURE_2D,D,S,p.width,p.height),P&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,p.width,p.height,M,E,p.data)):n.texImage2D(t.TEXTURE_2D,0,S,p.width,p.height,0,M,E,p.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){C&&R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,D,S,T[0].width,T[0].height,p.depth);for(let e=0,r=T.length;e<r;e++)w=T[e],o.format!==Q?null!==M?C?P&&n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,p.depth,M,w.data,0,0):n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,S,w.width,w.height,p.depth,0,w.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?P&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,p.depth,M,E,w.data):n.texImage3D(t.TEXTURE_2D_ARRAY,e,S,w.width,w.height,p.depth,0,M,E,w.data)}else{C&&R&&n.texStorage2D(t.TEXTURE_2D,D,S,T[0].width,T[0].height);for(let e=0,r=T.length;e<r;e++)w=T[e],o.format!==Q?null!==M?C?P&&n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,w.data):n.compressedTexImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,E,w.data):n.texImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,M,E,w.data)}else if(o.isDataArrayTexture)C?(R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,D,S,p.width,p.height,p.depth),P&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,M,E,p.data)):n.texImage3D(t.TEXTURE_2D_ARRAY,0,S,p.width,p.height,p.depth,0,M,E,p.data);else if(o.isData3DTexture)C?(R&&n.texStorage3D(t.TEXTURE_3D,D,S,p.width,p.height,p.depth),P&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,M,E,p.data)):n.texImage3D(t.TEXTURE_3D,0,S,p.width,p.height,p.depth,0,M,E,p.data);else if(o.isFramebufferTexture){if(R)if(C)n.texStorage2D(t.TEXTURE_2D,D,S,p.width,p.height);else{let e=p.width,r=p.height;for(let i=0;i<D;i++)n.texImage2D(t.TEXTURE_2D,i,S,e,r,0,M,E,null),e>>=1,r>>=1}}else if(T.length>0&&b){if(C&&R){const e=at(T[0]);n.texStorage2D(t.TEXTURE_2D,D,S,e.width,e.height)}for(let e=0,r=T.length;e<r;e++)w=T[e],C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,M,E,w):n.texImage2D(t.TEXTURE_2D,e,S,M,E,w);o.generateMipmaps=!1}else if(C){if(R){const e=at(p);n.texStorage2D(t.TEXTURE_2D,D,S,e.width,e.height)}P&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,M,E,p)}else n.texImage2D(t.TEXTURE_2D,0,S,M,E,p);v(o,b)&&_(l),h.__version=u.version,o.onUpdate&&o.onUpdate(o)}e.__version=o.version}function K(e,i,o,s,l,c){const u=a.convert(o.format,o.colorSpace),h=a.convert(o.type),f=y(o.internalFormat,u,h,o.colorSpace);if(!r.get(i).__hasExternalTextures){const e=Math.max(1,i.width>>c),r=Math.max(1,i.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?n.texImage3D(l,c,f,e,r,i.depth,0,u,h,null):n.texImage2D(l,c,f,e,r,0,u,h,null)}n.bindFramebuffer(t.FRAMEBUFFER,e),et(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,s,l,r.get(o).__webglTexture,0,tt(i)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,s,l,r.get(o).__webglTexture,c),n.bindFramebuffer(t.FRAMEBUFFER,null)}function J(e,n,r){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let i=!0===s?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(r||et(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===V?i=t.DEPTH_COMPONENT32F:e.type===j&&(i=t.DEPTH_COMPONENT24));const r=tt(n);et(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,i,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,r,i,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,i,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const i=tt(n);r&&!1===et(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,i,t.DEPTH24_STENCIL8,n.width,n.height):et(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=n.textures;for(let i=0;i<e.length;i++){const o=e[i],s=a.convert(o.format,o.colorSpace),l=a.convert(o.type),c=y(o.internalFormat,s,l,o.colorSpace),u=tt(n);r&&!1===et(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,u,c,n.width,n.height):et(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,u,c,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,c,n.width,n.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function $(e){const i=r.get(e),a=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.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),T(i.depthTexture,0);const a=r.get(i.depthTexture).__webglTexture,o=tt(i);if(i.depthTexture.format===Y)et(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0);else{if(i.depthTexture.format!==Z)throw new Error("Unknown depthTexture format");et(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0)}}(i.__webglFramebuffer,e)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=t.createRenderbuffer(),J(i.__webglDepthbuffer[r],e,!1)}else n.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),J(i.__webglDepthbuffer,e,!1);n.bindFramebuffer(t.FRAMEBUFFER,null)}function tt(t){return Math.min(i.maxSamples,t.samples)}function et(t){const n=r.get(t);return s&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function rt(t,n){const r=t.colorSpace,i=t.format,a=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===dt||r!==it&&r!==nt&&(Ht.getTransfer(r)===At?!1===s?!0===e.has("EXT_sRGB")&&i===Q?(t.format=dt,t.minFilter=B,t.generateMipmaps=!1):n=Xt.sRGBToLinear(n):i===Q&&a===z||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",r)),n}function at(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?(c.width=t.naturalWidth||t.width,c.height=t.naturalHeight||t.height):"undefined"!=typeof VideoFrame&&t instanceof VideoFrame?(c.width=t.displayWidth,c.height=t.displayHeight):(c.width=t.width,c.height=t.height),c}this.allocateTextureUnit=function(){const t=S;return t>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+i.maxTextures),S+=1,t},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?H(a,e,i):n.bindTexture(t.TEXTURE_2D_ARRAY,a.__webglTexture,t.TEXTURE0+i)},this.setTexture3D=function(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?H(a,e,i):n.bindTexture(t.TEXTURE_3D,a.__webglTexture,t.TEXTURE0+i)},this.setTextureCube=function(e,o){const A=r.get(e);e.version>0&&A.__version!==e.version?function(e,o,A){if(6!==o.image.length)return;const l=D(e,o),c=o.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+A);const u=r.get(c);if(c.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+A);const e=Ht.getPrimaries(Ht.workingColorSpace),r=o.colorSpace===nt?null:Ht.getPrimaries(o.colorSpace),h=o.colorSpace===nt||e===r?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);const f=o.isCompressedTexture||o.image[0].isCompressedTexture,d=o.image[0]&&o.image[0].isDataTexture,p=[];for(let t=0;t<6;t++)p[t]=f||d?d?o.image[t].image:o.image[t]:m(o.image[t],!1,!0,i.maxCubemapSize),p[t]=rt(o,p[t]);const b=p[0],M=g(b)||s,w=a.convert(o.format,o.colorSpace),E=a.convert(o.type),S=y(o.internalFormat,w,E,o.colorSpace),T=s&&!0!==o.isVideoTexture,C=void 0===u.__version||!0===l,R=c.dataReady;let P,D=x(o,b,M);if(L(t.TEXTURE_CUBE_MAP,o,M),f){T&&C&&n.texStorage2D(t.TEXTURE_CUBE_MAP,D,S,b.width,b.height);for(let e=0;e<6;e++){P=p[e].mipmaps;for(let r=0;r<P.length;r++){const i=P[r];o.format!==Q?null!==w?T?R&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,i.width,i.height,w,i.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,S,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,i.width,i.height,w,E,i.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,S,i.width,i.height,0,w,E,i.data)}}}else{if(P=o.mipmaps,T&&C){P.length>0&&D++;const e=at(p[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,D,S,e.width,e.height)}for(let e=0;e<6;e++)if(d){T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,p[e].width,p[e].height,w,E,p[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,p[e].width,p[e].height,0,w,E,p[e].data);for(let r=0;r<P.length;r++){const i=P[r].image[e].image;T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,i.width,i.height,w,E,i.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,S,i.width,i.height,0,w,E,i.data)}}else{T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,w,E,p[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,w,E,p[e]);for(let r=0;r<P.length;r++){const i=P[r];T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,w,E,i.image[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,S,w,E,i.image[e])}}}v(o,M)&&_(t.TEXTURE_CUBE_MAP),u.__version=c.version,o.onUpdate&&o.onUpdate(o)}e.__version=o.version}(A,e,o):n.bindTexture(t.TEXTURE_CUBE_MAP,A.__webglTexture,t.TEXTURE0+o)},this.rebindTextures=function(e,n,i){const a=r.get(e);void 0!==n&&K(a.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),void 0!==i&&$(e)},this.setupRenderTarget=function(e){const A=e.texture,l=r.get(e),c=r.get(A);e.addEventListener("dispose",w);const u=e.textures,h=!0===e.isWebGLCubeRenderTarget,f=u.length>1,d=g(e)||s;if(f||(void 0===c.__webglTexture&&(c.__webglTexture=t.createTexture()),c.__version=A.version,o.memory.textures++),h){l.__webglFramebuffer=[];for(let e=0;e<6;e++)if(s&&A.mipmaps&&A.mipmaps.length>0){l.__webglFramebuffer[e]=[];for(let n=0;n<A.mipmaps.length;n++)l.__webglFramebuffer[e][n]=t.createFramebuffer()}else l.__webglFramebuffer[e]=t.createFramebuffer()}else{if(s&&A.mipmaps&&A.mipmaps.length>0){l.__webglFramebuffer=[];for(let e=0;e<A.mipmaps.length;e++)l.__webglFramebuffer[e]=t.createFramebuffer()}else l.__webglFramebuffer=t.createFramebuffer();if(f)if(i.drawBuffers)for(let e=0,n=u.length;e<n;e++){const n=r.get(u[e]);void 0===n.__webglTexture&&(n.__webglTexture=t.createTexture(),o.memory.textures++)}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(s&&e.samples>0&&!1===et(e)){l.__webglMultisampledFramebuffer=t.createFramebuffer(),l.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,l.__webglMultisampledFramebuffer);for(let n=0;n<u.length;n++){const r=u[n];l.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,l.__webglColorRenderbuffer[n]);const i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),s=y(r.internalFormat,i,o,r.colorSpace,!0===e.isXRRenderTarget),A=tt(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,A,s,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,l.__webglColorRenderbuffer[n])}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(l.__webglDepthRenderbuffer=t.createRenderbuffer(),J(l.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(h){n.bindTexture(t.TEXTURE_CUBE_MAP,c.__webglTexture),L(t.TEXTURE_CUBE_MAP,A,d);for(let n=0;n<6;n++)if(s&&A.mipmaps&&A.mipmaps.length>0)for(let r=0;r<A.mipmaps.length;r++)K(l.__webglFramebuffer[n][r],e,A,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else K(l.__webglFramebuffer[n],e,A,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);v(A,d)&&_(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(f){for(let i=0,a=u.length;i<a;i++){const a=u[i],o=r.get(a);n.bindTexture(t.TEXTURE_2D,o.__webglTexture),L(t.TEXTURE_2D,a,d),K(l.__webglFramebuffer,e,a,t.COLOR_ATTACHMENT0+i,t.TEXTURE_2D,0),v(a,d)&&_(t.TEXTURE_2D)}n.unbindTexture()}else{let r=t.TEXTURE_2D;if((e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(s?r=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(r,c.__webglTexture),L(r,A,d),s&&A.mipmaps&&A.mipmaps.length>0)for(let n=0;n<A.mipmaps.length;n++)K(l.__webglFramebuffer[n],e,A,t.COLOR_ATTACHMENT0,r,n);else K(l.__webglFramebuffer,e,A,t.COLOR_ATTACHMENT0,r,0);v(A,d)&&_(r),n.unbindTexture()}e.depthBuffer&&$(e)},this.updateRenderTargetMipmap=function(e){const i=g(e)||s,a=e.textures;for(let o=0,s=a.length;o<s;o++){const s=a[o];if(v(s,i)){const i=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=r.get(s).__webglTexture;n.bindTexture(i,a),_(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(s&&e.samples>0&&!1===et(e)){const i=e.textures,a=e.width,o=e.height;let s=t.COLOR_BUFFER_BIT;const A=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,u=r.get(e),h=i.length>1;if(h)for(let e=0;e<i.length;e++)n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){A.push(t.COLOR_ATTACHMENT0+n),e.depthBuffer&&A.push(c);const f=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===f&&(e.depthBuffer&&(s|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&(s|=t.STENCIL_BUFFER_BIT)),h&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,u.__webglColorRenderbuffer[n]),!0===f&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[c]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[c])),h){const e=r.get(i[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,a,o,0,0,a,o,s,t.NEAREST),l&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,A)}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),h)for(let e=0;e<i.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,u.__webglColorRenderbuffer[e]);const a=r.get(i[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,a,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=$,this.setupFrameBufferTexture=K,this.useMultisampledRTT=et}function Ao(t,e,n){const r=n.isWebGL2;return{convert:function(n,i=""){let a;const o=Ht.getTransfer(i);if(n===z)return t.UNSIGNED_BYTE;if(1017===n)return t.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return t.UNSIGNED_SHORT_5_5_5_1;if(1010===n)return t.BYTE;if(1011===n)return t.SHORT;if(n===G)return t.UNSIGNED_SHORT;if(n===H)return t.INT;if(n===j)return t.UNSIGNED_INT;if(n===V)return t.FLOAT;if(n===W)return r?t.HALF_FLOAT:(a=e.get("OES_texture_half_float"),null!==a?a.HALF_FLOAT_OES:null);if(1021===n)return t.ALPHA;if(n===Q)return t.RGBA;if(1024===n)return t.LUMINANCE;if(1025===n)return t.LUMINANCE_ALPHA;if(n===Y)return t.DEPTH_COMPONENT;if(n===Z)return t.DEPTH_STENCIL;if(n===dt)return a=e.get("EXT_sRGB"),null!==a?a.SRGB_ALPHA_EXT:null;if(1028===n)return t.RED;if(1029===n)return t.RED_INTEGER;if(1030===n)return t.RG;if(1031===n)return t.RG_INTEGER;if(1033===n)return t.RGBA_INTEGER;if(n===K||n===J||n===$||n===tt)if(o===At){if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===a)return null;if(n===K)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===J)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===$)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===tt)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(a=e.get("WEBGL_compressed_texture_s3tc"),null===a)return null;if(n===K)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===J)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===$)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===tt)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(a=e.get("WEBGL_compressed_texture_pvrtc"),null===a)return null;if(35840===n)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n)return a=e.get("WEBGL_compressed_texture_etc1"),null!==a?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===n||37496===n){if(a=e.get("WEBGL_compressed_texture_etc"),null===a)return null;if(37492===n)return o===At?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(37496===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(a=e.get("WEBGL_compressed_texture_astc"),null===a)return null;if(37808===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===et||36494===n||36495===n){if(a=e.get("EXT_texture_compression_bptc"),null===a)return null;if(n===et)return o===At?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(a=e.get("EXT_texture_compression_rgtc"),null===a)return null;if(n===et)return a.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===X?r?t.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),null!==a?a.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[n]?t[n]:null}}}class lo extends _r{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}let co=class extends ln{constructor(){super(),this.isGroup=!0,this.type="Group"}};const uo={type:"move"};class ho{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new co,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 co,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ae,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ae),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new co,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ae,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ae),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,A=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(A&&t.hand){a=!0;for(const r of t.hand.values()){const t=e.getJointPose(r,n),i=this._getHandJoint(A,r);null!==t&&(i.matrix.fromArray(t.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=t.radius),i.visible=null!==t}const r=A.joints["index-finger-tip"],i=A.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,l=.005;A.inputState.pinching&&o>s+l?(A.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!A.inputState.pinching&&o<=s-l&&(A.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==s&&t.gripSpace&&(i=e.getPose(t.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));null!==o&&(r=e.getPose(t.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(uo)))}return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==A&&(A.visible=null!==a),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new co;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class fo{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(null===this.texture){const r=new Jt;t.properties.get(r).__webglTexture=e.texture,e.depthNear==n.depthNear&&e.depthFar==n.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}render(t,e){if(null!==this.texture){if(null===this.mesh){const t=e.cameras[0].viewport,n=new dr({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:t.z},depthHeight:{value:t.w}}});this.mesh=new sr(new Or(20,20),n)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}}class po extends gt{constructor(t,e){super();const n=this;let r=null,i=1,a=null,o="local-floor",s=1,A=null,l=null,c=null,u=null,h=null,f=null;const d=new fo,p=e.getContextAttributes();let m=null,g=null;const v=[],_=[],y=new Lt;let x=null;const b=new _r;b.layers.enable(1),b.viewport=new $t;const M=new _r;M.layers.enable(2),M.viewport=new $t;const w=[b,M],E=new lo;E.layers.enable(1),E.layers.enable(2);let S=null,T=null;function C(t){const e=_.indexOf(t.inputSource);if(-1===e)return;const n=v[e];void 0!==n&&(n.update(t.inputSource,t.frame,A||a),n.dispatchEvent({type:t.type,data:t.inputSource}))}function R(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",R),r.removeEventListener("inputsourceschange",P);for(let t=0;t<v.length;t++){const e=_[t];null!==e&&(_[t]=null,v[t].disconnect(e))}S=null,T=null,d.reset(),t.setRenderTarget(m),h=null,u=null,c=null,r=null,g=null,q.stop(),n.isPresenting=!1,t.setPixelRatio(x),t.setSize(y.width,y.height,!1),n.dispatchEvent({type:"sessionend"})}function P(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],r=_.indexOf(n);r>=0&&(_[r]=null,v[r].disconnect(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e];let r=_.indexOf(n);if(-1===r){for(let t=0;t<v.length;t++){if(t>=_.length){_.push(n),r=t;break}if(null===_[t]){_[t]=n,r=t;break}}if(-1===r)break}const i=v[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=v[t];return void 0===e&&(e=new ho,v[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=v[t];return void 0===e&&(e=new ho,v[t]=e),e.getGripSpace()},this.getHand=function(t){let e=v[t];return void 0===e&&(e=new ho,v[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){i=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return A||a},this.setReferenceSpace=function(t){A=t},this.getBaseLayer=function(){return null!==u?u:h},this.getBinding=function(){return c},this.getFrame=function(){return f},this.getSession=function(){return r},this.setSession=async function(l){if(r=l,null!==r){if(m=t.getRenderTarget(),r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",R),r.addEventListener("inputsourceschange",P),!0!==p.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(y),void 0===r.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:i};h=new XRWebGLLayer(r,e,n),r.updateRenderState({baseLayer:h}),t.setPixelRatio(1),t.setSize(h.framebufferWidth,h.framebufferHeight,!1),g=new ee(h.framebufferWidth,h.framebufferHeight,{format:Q,type:z,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil})}else{let n=null,a=null,o=null;p.depth&&(o=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=p.stencil?Z:Y,a=p.stencil?X:j);const s={colorFormat:e.RGBA8,depthFormat:o,scaleFactor:i};c=new XRWebGLBinding(r,e),u=c.createProjectionLayer(s),r.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),g=new ee(u.textureWidth,u.textureHeight,{format:Q,type:z,depthTexture:new vi(u.textureWidth,u.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0});t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(s),A=null,a=await r.requestReferenceSpace(o),q.setContext(r),q.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode};const L=new ae,D=new ae;function O(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===r)return;null!==d.texture&&(t.near=d.depthNear,t.far=d.depthFar),E.near=M.near=b.near=t.near,E.far=M.far=b.far=t.far,S===E.near&&T===E.far||(r.updateRenderState({depthNear:E.near,depthFar:E.far}),S=E.near,T=E.far,b.near=S,b.far=T,M.near=S,M.far=T,b.updateProjectionMatrix(),M.updateProjectionMatrix(),t.updateProjectionMatrix());const e=t.parent,n=E.cameras;O(E,e);for(let t=0;t<n.length;t++)O(n[t],e);2===n.length?function(t,e,n){L.setFromMatrixPosition(e.matrixWorld),D.setFromMatrixPosition(n.matrixWorld);const r=L.distanceTo(D),i=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),A=(i[9]+1)/i[5],l=(i[9]-1)/i[5],c=(i[8]-1)/i[0],u=(a[8]+1)/a[0],h=o*c,f=o*u,d=r/(-c+u),p=d*-c;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(p),t.translateZ(d),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const m=o+d,g=s+d,v=h-p,_=f+(r-p),y=A*s/g*m,x=l*s/g*m;t.projectionMatrix.makePerspective(v,_,y,x,m,g),t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}(E,b,M):E.projectionMatrix.copy(b.projectionMatrix),function(t,e,n){null===n?t.matrix.copy(e.matrixWorld):(t.matrix.copy(n.matrixWorld),t.matrix.invert(),t.matrix.multiply(e.matrixWorld));t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*xt*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)}(t,E,e)},this.getCamera=function(){return E},this.getFoveation=function(){if(null!==u||null!==h)return s},this.setFoveation=function(t){s=t,null!==u&&(u.fixedFoveation=t),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=t)},this.hasDepthSensing=function(){return null!==d.texture};let I=null;const q=new Lr;q.setAnimationLoop((function(e,i){if(l=i.getViewerPose(A||a),f=i,null!==l){const e=l.views;null!==h&&(t.setRenderTargetFramebuffer(g,h.framebuffer),t.setRenderTarget(g));let n=!1;e.length!==E.cameras.length&&(E.cameras.length=0,n=!0);for(let r=0;r<e.length;r++){const i=e[r];let a=null;if(null!==h)a=h.getViewport(i);else{const e=c.getViewSubImage(u,i);a=e.viewport,0===r&&(t.setRenderTargetTextures(g,e.colorTexture,u.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(g))}let o=w[r];void 0===o&&(o=new _r,o.layers.enable(r),o.viewport=new $t,w[r]=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(a.x,a.y,a.width,a.height),0===r&&(E.matrix.copy(o.matrix),E.matrix.decompose(E.position,E.quaternion,E.scale)),!0===n&&E.cameras.push(o)}const i=r.enabledFeatures;if(i&&i.includes("depth-sensing")){const n=c.getDepthInformation(e[0]);n&&n.isValid&&n.texture&&d.init(t,n,r.renderState)}}for(let t=0;t<v.length;t++){const e=_[t],n=v[t];null!==e&&void 0!==n&&n.update(e,i,A||a)}d.render(t,E),I&&I(e,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),f=null})),this.setAnimationLoop=function(t){I=t},this.dispose=function(){}}}const mo=new Ve,go=new qe;function vo(t,e){function n(t,e){!0===t.matrixAutoUpdate&&t.updateMatrix(),e.value.copy(t.matrix)}function r(r,i){r.opacity.value=i.opacity,i.color&&r.diffuse.value.copy(i.color),i.emissive&&r.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(r.map.value=i.map,n(i.map,r.mapTransform)),i.alphaMap&&(r.alphaMap.value=i.alphaMap,n(i.alphaMap,r.alphaMapTransform)),i.bumpMap&&(r.bumpMap.value=i.bumpMap,n(i.bumpMap,r.bumpMapTransform),r.bumpScale.value=i.bumpScale,i.side===g&&(r.bumpScale.value*=-1)),i.normalMap&&(r.normalMap.value=i.normalMap,n(i.normalMap,r.normalMapTransform),r.normalScale.value.copy(i.normalScale),i.side===g&&r.normalScale.value.negate()),i.displacementMap&&(r.displacementMap.value=i.displacementMap,n(i.displacementMap,r.displacementMapTransform),r.displacementScale.value=i.displacementScale,r.displacementBias.value=i.displacementBias),i.emissiveMap&&(r.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,r.emissiveMapTransform)),i.specularMap&&(r.specularMap.value=i.specularMap,n(i.specularMap,r.specularMapTransform)),i.alphaTest>0&&(r.alphaTest.value=i.alphaTest);const a=e.get(i),o=a.envMap,s=a.envMapRotation;if(o&&(r.envMap.value=o,mo.copy(s),mo.x*=-1,mo.y*=-1,mo.z*=-1,o.isCubeTexture&&!1===o.isRenderTargetTexture&&(mo.y*=-1,mo.z*=-1),r.envMapRotation.value.setFromMatrix4(go.makeRotationFromEuler(mo)),r.flipEnvMap.value=o.isCubeTexture&&!1===o.isRenderTargetTexture?-1:1,r.reflectivity.value=i.reflectivity,r.ior.value=i.ior,r.refractionRatio.value=i.refractionRatio),i.lightMap){r.lightMap.value=i.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;r.lightMapIntensity.value=i.lightMapIntensity*e,n(i.lightMap,r.lightMapTransform)}i.aoMap&&(r.aoMap.value=i.aoMap,r.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,r.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,hr(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,i,a,o,s){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(t,i):i.isMeshToonMaterial?(r(t,i),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,i)):i.isMeshPhongMaterial?(r(t,i),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,i)):i.isMeshStandardMaterial?(r(t,i),function(t,r){t.metalness.value=r.metalness,r.metalnessMap&&(t.metalnessMap.value=r.metalnessMap,n(r.metalnessMap,t.metalnessMapTransform));t.roughness.value=r.roughness,r.roughnessMap&&(t.roughnessMap.value=r.roughnessMap,n(r.roughnessMap,t.roughnessMapTransform));const i=e.get(r).envMap;i&&(t.envMapIntensity.value=r.envMapIntensity)}(t,i),i.isMeshPhysicalMaterial&&function(t,e,r){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===g&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=r.texture,t.transmissionSamplerSize.value.set(r.width,r.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,i,s)):i.isMeshMatcapMaterial?(r(t,i),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,i)):i.isMeshDepthMaterial?r(t,i):i.isMeshDistanceMaterial?(r(t,i),function(t,n){const r=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(r.matrixWorld),t.nearDistance.value=r.shadow.camera.near,t.farDistance.value=r.shadow.camera.far}(t,i)):i.isMeshNormalMaterial?r(t,i):i.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,i),i.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,i)):i.isPointsMaterial?function(t,e,r,i){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*r,t.scale.value=.5*i,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,i,a,o):i.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,i):i.isShadowMaterial?(t.color.value.copy(i.color),t.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function _o(t,e,n,r){let i={},a={},o=[];const s=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function A(t,e,n,r){const i=t.value,a=e+"_"+n;if(void 0===r[a])return r[a]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const t=r[a];if("number"==typeof i||"boolean"==typeof i){if(t!==i)return r[a]=i,!0}else if(!1===t.equals(i))return t.copy(i),!0}return!1}function l(t){const e={boundary:0,storage:0};return"number"==typeof t||"boolean"==typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function c(e){const n=e.target;n.removeEventListener("dispose",c);const r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),t.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(t,e){const n=e.program;r.uniformBlockBinding(t,n)},update:function(n,u){let h=i[n.id];void 0===h&&(!function(t){const e=t.uniforms;let n=0;const r=16;for(let t=0,i=e.length;t<i;t++){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0,e=i.length;t<e;t++){const e=i[t],a=Array.isArray(e.value)?e.value:[e.value];for(let t=0,i=a.length;t<i;t++){const i=l(a[t]),o=n%r;0!==o&&r-o<i.boundary&&(n+=r-o),e.__data=new Float32Array(i.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,n+=i.storage}}}const i=n%r;i>0&&(n+=r-i);t.__size=n,t.__cache={}}(n),h=function(e){const n=function(){for(let t=0;t<s;t++)if(-1===o.indexOf(t))return o.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=n;const r=t.createBuffer(),i=e.__size,a=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,r),t.bufferData(t.UNIFORM_BUFFER,i,a),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=h,n.addEventListener("dispose",c));const f=u.program;r.updateUBOMapping(n,f);const d=e.render.frame;a[n.id]!==d&&(!function(e){const n=i[e.id],r=e.uniforms,a=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=r.length;e<n;e++){const n=Array.isArray(r[e])?r[e]:[r[e]];for(let r=0,i=n.length;r<i;r++){const i=n[r];if(!0===A(i,e,r,a)){const e=i.__offset,n=Array.isArray(i.value)?i.value:[i.value];let r=0;for(let a=0;a<n.length;a++){const o=n[a],s=l(o);"number"==typeof o||"boolean"==typeof o?(i.__data[0]=o,t.bufferSubData(t.UNIFORM_BUFFER,e+r,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,r),r+=s.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,e,i.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}(n),a[n.id]=d)},dispose:function(){for(const e in i)t.deleteBuffer(i[e]);o=[],i={},a={}}}}class yo{constructor(t={}){const{canvas:e=Ut(),context:n=null,depth:r=!0,stencil:i=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:A=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=t;let h;this.isWebGLRenderer=!0,h=null!==n?n.getContextAttributes().alpha:a;const f=new Uint32Array(4),d=new Int32Array(4);let p=null,v=null;const _=[],y=[];this.domElement=e,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=rt,this._useLegacyLights=!1,this.toneMapping=b,this.toneMappingExposure=1;const x=this;let M=!1,w=0,E=0,S=null,T=-1,C=null;const R=new $t,P=new $t;let L=null;const D=new En(0);let O=0,I=e.width,q=e.height,U=1,N=null,B=null;const k=new $t(0,0,I,q),H=new $t(0,0,I,q);let Y=!1;const Z=new Pr;let K=!1,J=!1,$=null;const tt=new qe,et=new Lt,nt=new ae,at={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ot(){return null===S?U:1}let st,At,lt,ct,ut,ht,ft,dt,pt,mt,gt,vt,_t,yt,xt,bt,Mt,wt,Et,St,Ct,Rt,Pt,Dt,Ot=n;function It(t,n){for(let r=0;r<t.length;r++){const i=t[r],a=e.getContext(i,n);if(null!==a)return a}return null}try{const t={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:A,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${s}`),e.addEventListener("webglcontextlost",Bt,!1),e.addEventListener("webglcontextrestored",kt,!1),e.addEventListener("webglcontextcreationerror",Ft,!1),null===Ot){const e=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&e.shift(),Ot=It(e,t),null===Ot)throw It(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}"undefined"!=typeof WebGLRenderingContext&&Ot instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),void 0===Ot.getShaderPrecisionFormat&&(Ot.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function qt(){st=new ci(Ot),At=new Hr(Ot,st,t),st.init(At),Rt=new Ao(Ot,st,At),lt=new oo(Ot,st,At),ct=new fi(Ot),ut=new Wa,ht=new so(Ot,st,lt,ut,At,Rt,ct),ft=new Vr(x),dt=new li(x),pt=new Dr(Ot,At),Pt=new zr(Ot,st,pt,At),mt=new ui(Ot,pt,ct,Pt),gt=new gi(Ot,mt,pt,ct),Et=new mi(Ot,At,ht),bt=new jr(ut),vt=new Va(x,ft,dt,st,At,Pt,bt),_t=new vo(x,ut),yt=new Za,xt=new no(st,At),wt=new Fr(x,ft,dt,lt,gt,h,A),Mt=new ao(x,gt,At),Dt=new _o(Ot,ct,At,lt),St=new Gr(Ot,st,ct,At),Ct=new hi(Ot,st,ct,At),ct.programs=vt.programs,x.capabilities=At,x.extensions=st,x.properties=ut,x.renderLists=yt,x.shadowMap=Mt,x.state=lt,x.info=ct}qt();const Nt=new po(x,Ot);function Bt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function kt(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const t=ct.autoReset,e=Mt.enabled,n=Mt.autoUpdate,r=Mt.needsUpdate,i=Mt.type;qt(),ct.autoReset=t,Mt.enabled=e,Mt.autoUpdate=n,Mt.needsUpdate=r,Mt.type=i}function Ft(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function zt(t){const e=t.target;e.removeEventListener("dispose",zt),function(t){(function(t){const e=ut.get(t).programs;void 0!==e&&(e.forEach((function(t){vt.releaseProgram(t)})),t.isShaderMaterial&&vt.releaseShaderCache(t))})(t),ut.remove(t)}(e)}function Gt(t,e,n){!0===t.transparent&&2===t.side&&!1===t.forceSinglePass?(t.side=g,t.needsUpdate=!0,Kt(t,e,n),t.side=m,t.needsUpdate=!0,Kt(t,e,n),t.side=2):Kt(t,e,n)}this.xr=Nt,this.getContext=function(){return Ot},this.getContextAttributes=function(){return Ot.getContextAttributes()},this.forceContextLoss=function(){const t=st.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=st.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return U},this.setPixelRatio=function(t){void 0!==t&&(U=t,this.setSize(I,q,!1))},this.getSize=function(t){return t.set(I,q)},this.setSize=function(t,n,r=!0){Nt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(I=t,q=n,e.width=Math.floor(t*U),e.height=Math.floor(n*U),!0===r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(I*U,q*U).floor()},this.setDrawingBufferSize=function(t,n,r){I=t,q=n,U=r,e.width=Math.floor(t*r),e.height=Math.floor(n*r),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(R)},this.getViewport=function(t){return t.copy(k)},this.setViewport=function(t,e,n,r){t.isVector4?k.set(t.x,t.y,t.z,t.w):k.set(t,e,n,r),lt.viewport(R.copy(k).multiplyScalar(U).round())},this.getScissor=function(t){return t.copy(H)},this.setScissor=function(t,e,n,r){t.isVector4?H.set(t.x,t.y,t.z,t.w):H.set(t,e,n,r),lt.scissor(P.copy(H).multiplyScalar(U).round())},this.getScissorTest=function(){return Y},this.setScissorTest=function(t){lt.setScissorTest(Y=t)},this.setOpaqueSort=function(t){N=t},this.setTransparentSort=function(t){B=t},this.getClearColor=function(t){return t.copy(wt.getClearColor())},this.setClearColor=function(){wt.setClearColor.apply(wt,arguments)},this.getClearAlpha=function(){return wt.getClearAlpha()},this.setClearAlpha=function(){wt.setClearAlpha.apply(wt,arguments)},this.clear=function(t=!0,e=!0,n=!0){let r=0;if(t){let t=!1;if(null!==S){const e=S.texture.format;t=1033===e||1031===e||1029===e}if(t){const t=S.texture.type,e=t===z||t===j||t===G||t===X||1017===t||1018===t,n=wt.getClearColor(),r=wt.getClearAlpha(),i=n.r,a=n.g,o=n.b;e?(f[0]=i,f[1]=a,f[2]=o,f[3]=r,Ot.clearBufferuiv(Ot.COLOR,0,f)):(d[0]=i,d[1]=a,d[2]=o,d[3]=r,Ot.clearBufferiv(Ot.COLOR,0,d))}else r|=Ot.COLOR_BUFFER_BIT}e&&(r|=Ot.DEPTH_BUFFER_BIT),n&&(r|=Ot.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Ot.clear(r)},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(){e.removeEventListener("webglcontextlost",Bt,!1),e.removeEventListener("webglcontextrestored",kt,!1),e.removeEventListener("webglcontextcreationerror",Ft,!1),yt.dispose(),xt.dispose(),ut.dispose(),ft.dispose(),dt.dispose(),gt.dispose(),Pt.dispose(),Dt.dispose(),vt.dispose(),Nt.dispose(),Nt.removeEventListener("sessionstart",jt),Nt.removeEventListener("sessionend",Vt),$&&($.dispose(),$=null),Wt.stop()},this.renderBufferDirect=function(t,e,n,r,i,a){null===e&&(e=at);const o=i.isMesh&&i.matrixWorld.determinant()<0,s=function(t,e,n,r,i){!0!==e.isScene&&(e=at);ht.resetTextureUnits();const a=e.fog,o=r.isMeshStandardMaterial?e.environment:null,s=null===S?x.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:it,A=(r.isMeshStandardMaterial?dt:ft).get(r.envMap||o),l=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),u=!!n.morphAttributes.position,h=!!n.morphAttributes.normal,f=!!n.morphAttributes.color;let d=b;r.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(d=x.toneMapping));const p=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,m=void 0!==p?p.length:0,g=ut.get(r),_=v.state.lights;if(!0===K&&(!0===J||t!==C)){const e=t===C&&r.id===T;bt.setState(r,t,e)}let y=!1;r.version===g.__version?g.needsLights&&g.lightsStateVersion!==_.state.version||g.outputColorSpace!==s||i.isBatchedMesh&&!1===g.batching?y=!0:i.isBatchedMesh||!0!==g.batching?i.isInstancedMesh&&!1===g.instancing?y=!0:i.isInstancedMesh||!0!==g.instancing?i.isSkinnedMesh&&!1===g.skinning?y=!0:i.isSkinnedMesh||!0!==g.skinning?i.isInstancedMesh&&!0===g.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===g.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===g.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===g.instancingMorph&&null!==i.morphTexture||g.envMap!==A||!0===r.fog&&g.fog!==a?y=!0:void 0===g.numClippingPlanes||g.numClippingPlanes===bt.numPlanes&&g.numIntersection===bt.numIntersection?(g.vertexAlphas!==l||g.vertexTangents!==c||g.morphTargets!==u||g.morphNormals!==h||g.morphColors!==f||g.toneMapping!==d||!0===At.isWebGL2&&g.morphTargetsCount!==m)&&(y=!0):y=!0:y=!0:y=!0:y=!0:(y=!0,g.__version=r.version);let M=g.currentProgram;!0===y&&(M=Kt(r,e,i));let w=!1,E=!1,R=!1;const P=M.getUniforms(),L=g.uniforms;lt.useProgram(M.program)&&(w=!0,E=!0,R=!0);r.id!==T&&(T=r.id,E=!0);if(w||C!==t){P.setValue(Ot,"projectionMatrix",t.projectionMatrix),P.setValue(Ot,"viewMatrix",t.matrixWorldInverse);const e=P.map.cameraPosition;void 0!==e&&e.setValue(Ot,nt.setFromMatrixPosition(t.matrixWorld)),At.logarithmicDepthBuffer&&P.setValue(Ot,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&P.setValue(Ot,"isOrthographic",!0===t.isOrthographicCamera),C!==t&&(C=t,E=!0,R=!0)}if(i.isSkinnedMesh){P.setOptional(Ot,i,"bindMatrix"),P.setOptional(Ot,i,"bindMatrixInverse");const t=i.skeleton;t&&(At.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),P.setValue(Ot,"boneTexture",t.boneTexture,ht)):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&&(P.setOptional(Ot,i,"batchingTexture"),P.setValue(Ot,"batchingTexture",i._matricesTexture,ht));const D=n.morphAttributes;(void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===At.isWebGL2)&&Et.update(i,n,M);(E||g.receiveShadow!==i.receiveShadow)&&(g.receiveShadow=i.receiveShadow,P.setValue(Ot,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(L.envMap.value=A,L.flipEnvMap.value=A.isCubeTexture&&!1===A.isRenderTargetTexture?-1:1);E&&(P.setValue(Ot,"toneMappingExposure",x.toneMappingExposure),g.needsLights&&(I=R,(O=L).ambientLightColor.needsUpdate=I,O.lightProbe.needsUpdate=I,O.directionalLights.needsUpdate=I,O.directionalLightShadows.needsUpdate=I,O.pointLights.needsUpdate=I,O.pointLightShadows.needsUpdate=I,O.spotLights.needsUpdate=I,O.spotLightShadows.needsUpdate=I,O.rectAreaLights.needsUpdate=I,O.hemisphereLights.needsUpdate=I),a&&!0===r.fog&&_t.refreshFogUniforms(L,a),_t.refreshMaterialUniforms(L,r,U,q,$),Ma.upload(Ot,Jt(g),L,ht));var O,I;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Ma.upload(Ot,Jt(g),L,ht),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&P.setValue(Ot,"center",i.center);if(P.setValue(Ot,"modelViewMatrix",i.modelViewMatrix),P.setValue(Ot,"normalMatrix",i.normalMatrix),P.setValue(Ot,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const t=r.uniformsGroups;for(let e=0,n=t.length;e<n;e++)if(At.isWebGL2){const n=t[e];Dt.update(n,M),Dt.bind(n,M)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return M}(t,e,n,r,i);lt.setMaterial(r,o);let A=n.index,l=1;if(!0===r.wireframe){if(A=mt.getWireframeAttribute(n),void 0===A)return;l=2}const c=n.drawRange,u=n.attributes.position;let h=c.start*l,f=(c.start+c.count)*l;null!==a&&(h=Math.max(h,a.start*l),f=Math.min(f,(a.start+a.count)*l)),null!==A?(h=Math.max(h,0),f=Math.min(f,A.count)):null!=u&&(h=Math.max(h,0),f=Math.min(f,u.count));const d=f-h;if(d<0||d===1/0)return;let p;Pt.setup(i,r,s,n,A);let m=St;if(null!==A&&(p=pt.get(A),m=Ct,m.setIndex(p)),i.isMesh)!0===r.wireframe?(lt.setLineWidth(r.wireframeLinewidth*ot()),m.setMode(Ot.LINES)):m.setMode(Ot.TRIANGLES);else if(i.isLine){let t=r.linewidth;void 0===t&&(t=1),lt.setLineWidth(t*ot()),i.isLineSegments?m.setMode(Ot.LINES):i.isLineLoop?m.setMode(Ot.LINE_LOOP):m.setMode(Ot.LINE_STRIP)}else i.isPoints?m.setMode(Ot.POINTS):i.isSprite&&m.setMode(Ot.TRIANGLES);if(i.isBatchedMesh)m.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else if(i.isInstancedMesh)m.renderInstances(h,d,i.count);else if(n.isInstancedBufferGeometry){const t=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,e=Math.min(n.instanceCount,t);m.renderInstances(h,d,e)}else m.render(h,d)},this.compile=function(t,e,n=null){null===n&&(n=t),v=xt.get(n),v.init(),y.push(v),n.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t))})),t!==n&&t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t))})),v.setupLights(x._useLegacyLights);const r=new Set;return t.traverse((function(t){const e=t.material;if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++){const a=e[i];Gt(a,n,t),r.add(a)}else Gt(e,n,t),r.add(e)})),y.pop(),v=null,r},this.compileAsync=function(t,e,n=null){const r=this.compile(t,e,n);return new Promise((e=>{function n(){r.forEach((function(t){ut.get(t).currentProgram.isReady()&&r.delete(t)})),0!==r.size?setTimeout(n,10):e(t)}null!==st.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let Ht=null;function jt(){Wt.stop()}function Vt(){Wt.start()}const Wt=new Lr;function Xt(t,e,n,r){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)v.pushLight(t),t.castShadow&&v.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Z.intersectsSprite(t)){r&&nt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(tt);const e=gt.update(t),i=t.material;i.visible&&p.push(t,e,i,n,nt.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Z.intersectsObject(t))){const e=gt.update(t),i=t.material;if(r&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),nt.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),nt.copy(e.boundingSphere.center)),nt.applyMatrix4(t.matrixWorld).applyMatrix4(tt)),Array.isArray(i)){const r=e.groups;for(let a=0,o=r.length;a<o;a++){const o=r[a],s=i[o.materialIndex];s&&s.visible&&p.push(t,e,s,n,nt.z,o)}}else i.visible&&p.push(t,e,i,n,nt.z,null)}const i=t.children;for(let t=0,a=i.length;t<a;t++)Xt(i[t],e,n,r)}function Qt(t,e,n,r){const i=t.opaque,a=t.transmissive,o=t.transparent;v.setupLightsView(n),!0===K&&bt.setGlobalState(x.clippingPlanes,n),a.length>0&&function(t,e,n,r){const i=!0===n.isScene?n.overrideMaterial:null;if(null!==i)return;const a=At.isWebGL2;null===$&&($=new ee(1,1,{generateMipmaps:!0,type:st.has("EXT_color_buffer_half_float")?W:z,minFilter:F,samples:a?4:0}));x.getDrawingBufferSize(et),a?$.setSize(et.x,et.y):$.setSize(Tt(et.x),Tt(et.y));const o=x.getRenderTarget();x.setRenderTarget($),x.getClearColor(D),O=x.getClearAlpha(),O<1&&x.setClearColor(16777215,.5);x.clear();const s=x.toneMapping;x.toneMapping=b,Yt(t,n,r),ht.updateMultisampleRenderTarget($),ht.updateRenderTargetMipmap($);let A=!1;for(let t=0,i=e.length;t<i;t++){const i=e[t],a=i.object,o=i.geometry,s=i.material,l=i.group;if(2===s.side&&a.layers.test(r.layers)){const t=s.side;s.side=g,s.needsUpdate=!0,Zt(a,n,r,o,s,l),s.side=t,s.needsUpdate=!0,A=!0}}!0===A&&(ht.updateMultisampleRenderTarget($),ht.updateRenderTargetMipmap($));x.setRenderTarget(o),x.setClearColor(D,O),x.toneMapping=s}(i,a,e,n),r&&lt.viewport(R.copy(r)),i.length>0&&Yt(i,e,n),a.length>0&&Yt(a,e,n),o.length>0&&Yt(o,e,n),lt.buffers.depth.setTest(!0),lt.buffers.depth.setMask(!0),lt.buffers.color.setMask(!0),lt.setPolygonOffset(!1)}function Yt(t,e,n){const r=!0===e.isScene?e.overrideMaterial:null;for(let i=0,a=t.length;i<a;i++){const a=t[i],o=a.object,s=a.geometry,A=null===r?a.material:r,l=a.group;o.layers.test(n.layers)&&Zt(o,e,n,s,A,l)}}function Zt(t,e,n,r,i,a){t.onBeforeRender(x,e,n,r,i,a),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),i.onBeforeRender(x,e,n,r,t,a),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=g,i.needsUpdate=!0,x.renderBufferDirect(n,e,r,i,t,a),i.side=m,i.needsUpdate=!0,x.renderBufferDirect(n,e,r,i,t,a),i.side=2):x.renderBufferDirect(n,e,r,i,t,a),t.onAfterRender(x,e,n,r,i,a)}function Kt(t,e,n){!0!==e.isScene&&(e=at);const r=ut.get(t),i=v.state.lights,a=v.state.shadowsArray,o=i.state.version,s=vt.getParameters(t,i.state,a,e,n),A=vt.getProgramCacheKey(s);let l=r.programs;r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.envMap=(t.isMeshStandardMaterial?dt:ft).get(t.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===t.envMap?e.environmentRotation:t.envMapRotation,void 0===l&&(t.addEventListener("dispose",zt),l=new Map,r.programs=l);let c=l.get(A);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===o)return te(t,s),c}else s.uniforms=vt.getUniforms(t),t.onBuild(n,s,x),t.onBeforeCompile(s,x),c=vt.acquireProgram(s,A),l.set(A,c),r.uniforms=s.uniforms;const u=r.uniforms;return(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(u.clippingPlanes=bt.uniform),te(t,s),r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=o,r.needsLights&&(u.ambientLightColor.value=i.state.ambient,u.lightProbe.value=i.state.probe,u.directionalLights.value=i.state.directional,u.directionalLightShadows.value=i.state.directionalShadow,u.spotLights.value=i.state.spot,u.spotLightShadows.value=i.state.spotShadow,u.rectAreaLights.value=i.state.rectArea,u.ltc_1.value=i.state.rectAreaLTC1,u.ltc_2.value=i.state.rectAreaLTC2,u.pointLights.value=i.state.point,u.pointLightShadows.value=i.state.pointShadow,u.hemisphereLights.value=i.state.hemi,u.directionalShadowMap.value=i.state.directionalShadowMap,u.directionalShadowMatrix.value=i.state.directionalShadowMatrix,u.spotShadowMap.value=i.state.spotShadowMap,u.spotLightMatrix.value=i.state.spotLightMatrix,u.spotLightMap.value=i.state.spotLightMap,u.pointShadowMap.value=i.state.pointShadowMap,u.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=c,r.uniformsList=null,c}function Jt(t){if(null===t.uniformsList){const e=t.currentProgram.getUniforms();t.uniformsList=Ma.seqWithValue(e.seq,t.uniforms)}return t.uniformsList}function te(t,e){const n=ut.get(t);n.outputColorSpace=e.outputColorSpace,n.batching=e.batching,n.instancing=e.instancing,n.instancingColor=e.instancingColor,n.instancingMorph=e.instancingMorph,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}Wt.setAnimationLoop((function(t){Ht&&Ht(t)})),"undefined"!=typeof self&&Wt.setContext(self),this.setAnimationLoop=function(t){Ht=t,Nt.setAnimationLoop(t),null===t?Wt.stop():Wt.start()},Nt.addEventListener("sessionstart",jt),Nt.addEventListener("sessionend",Vt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===M)return;!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===Nt.enabled&&!0===Nt.isPresenting&&(!0===Nt.cameraAutoUpdate&&Nt.updateCamera(e),e=Nt.getCamera()),!0===t.isScene&&t.onBeforeRender(x,t,e,S),v=xt.get(t,y.length),v.init(),y.push(v),tt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Z.setFromProjectionMatrix(tt),J=this.localClippingEnabled,K=bt.init(this.clippingPlanes,J),p=yt.get(t,_.length),p.init(),_.push(p),Xt(t,e,0,x.sortObjects),p.finish(),!0===x.sortObjects&&p.sort(N,B),this.info.render.frame++,!0===K&&bt.beginShadows();const n=v.state.shadowsArray;if(Mt.render(n,t,e),!0===K&&bt.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1!==Nt.enabled&&!1!==Nt.isPresenting&&!1!==Nt.hasDepthSensing()||wt.render(p,t),v.setupLights(x._useLegacyLights),e.isArrayCamera){const n=e.cameras;for(let e=0,r=n.length;e<r;e++){const r=n[e];Qt(p,t,r,r.viewport)}}else Qt(p,t,e);null!==S&&(ht.updateMultisampleRenderTarget(S),ht.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(x,t,e),Pt.resetDefaultState(),T=-1,C=null,y.pop(),v=y.length>0?y[y.length-1]:null,_.pop(),p=_.length>0?_[_.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,n){ut.get(t.texture).__webglTexture=e,ut.get(t.depthTexture).__webglTexture=n;const r=ut.get(t);r.__hasExternalTextures=!0,r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===st.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(t,e){const n=ut.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){S=t,w=e,E=n;let r=!0,i=null,a=!1,o=!1;if(t){const s=ut.get(t);void 0!==s.__useDefaultFramebuffer?(lt.bindFramebuffer(Ot.FRAMEBUFFER,null),r=!1):void 0===s.__webglFramebuffer?ht.setupRenderTarget(t):s.__hasExternalTextures&&ht.rebindTextures(t,ut.get(t.texture).__webglTexture,ut.get(t.depthTexture).__webglTexture);const A=t.texture;(A.isData3DTexture||A.isDataArrayTexture||A.isCompressedArrayTexture)&&(o=!0);const l=ut.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=Array.isArray(l[e])?l[e][n]:l[e],a=!0):i=At.isWebGL2&&t.samples>0&&!1===ht.useMultisampledRTT(t)?ut.get(t).__webglMultisampledFramebuffer:Array.isArray(l)?l[n]:l,R.copy(t.viewport),P.copy(t.scissor),L=t.scissorTest}else R.copy(k).multiplyScalar(U).floor(),P.copy(H).multiplyScalar(U).floor(),L=Y;if(lt.bindFramebuffer(Ot.FRAMEBUFFER,i)&&At.drawBuffers&&r&&lt.drawBuffers(t,i),lt.viewport(R),lt.scissor(P),lt.setScissorTest(L),a){const r=ut.get(t.texture);Ot.framebufferTexture2D(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,Ot.TEXTURE_CUBE_MAP_POSITIVE_X+e,r.__webglTexture,n)}else if(o){const r=ut.get(t.texture),i=e||0;Ot.framebufferTextureLayer(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i)}T=-1},this.readRenderTargetPixels=function(t,e,n,r,i,a,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=ut.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){lt.bindFramebuffer(Ot.FRAMEBUFFER,s);try{const o=t.texture,s=o.format,A=o.type;if(s!==Q&&Rt.convert(s)!==Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const l=A===W&&(st.has("EXT_color_buffer_half_float")||At.isWebGL2&&st.has("EXT_color_buffer_float"));if(!(A===z||Rt.convert(A)===Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_TYPE)||A===V&&(At.isWebGL2||st.has("OES_texture_float")||st.has("WEBGL_color_buffer_float"))||l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&Ot.readPixels(e,n,r,i,Rt.convert(s),Rt.convert(A),a)}finally{const t=null!==S?ut.get(S).__webglFramebuffer:null;lt.bindFramebuffer(Ot.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r);ht.setTexture2D(e,0),Ot.copyTexSubImage2D(Ot.TEXTURE_2D,n,0,0,t.x,t.y,i,a),lt.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r=0){const i=e.image.width,a=e.image.height,o=Rt.convert(n.format),s=Rt.convert(n.type);ht.setTexture2D(n,0),Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,n.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,i,a,o,s,e.image.data):e.isCompressedTexture?Ot.compressedTexSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,o,s,e.image),0===r&&n.generateMipmaps&&Ot.generateMipmap(Ot.TEXTURE_2D),lt.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,r,i=0){if(x.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const a=Math.round(t.max.x-t.min.x),o=Math.round(t.max.y-t.min.y),s=t.max.z-t.min.z+1,A=Rt.convert(r.format),l=Rt.convert(r.type);let c;if(r.isData3DTexture)ht.setTexture3D(r,0),c=Ot.TEXTURE_3D;else{if(!r.isDataArrayTexture&&!r.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ht.setTexture2DArray(r,0),c=Ot.TEXTURE_2D_ARRAY}Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,r.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,r.unpackAlignment);const u=Ot.getParameter(Ot.UNPACK_ROW_LENGTH),h=Ot.getParameter(Ot.UNPACK_IMAGE_HEIGHT),f=Ot.getParameter(Ot.UNPACK_SKIP_PIXELS),d=Ot.getParameter(Ot.UNPACK_SKIP_ROWS),p=Ot.getParameter(Ot.UNPACK_SKIP_IMAGES),m=n.isCompressedTexture?n.mipmaps[i]:n.image;Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,m.width),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,m.height),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,t.min.x),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,t.min.y),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?Ot.texSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,l,m.data):r.isCompressedArrayTexture?Ot.compressedTexSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,m.data):Ot.texSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,l,m),Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,u),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,h),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,f),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,d),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,p),0===i&&r.generateMipmaps&&Ot.generateMipmap(c),lt.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?ht.setTextureCube(t,0):t.isData3DTexture?ht.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?ht.setTexture2DArray(t,0):ht.setTexture2D(t,0),lt.unbindTexture()},this.resetState=function(){w=0,E=0,S=null,lt.reset(),Pt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return pt}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===at?"display-p3":"srgb",e.unpackColorSpace=Ht.workingColorSpace===ot?"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(t){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=t}}(class extends yo{}).prototype.isWebGL1Renderer=!0;class xo{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ht,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=bt()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return Bt("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=bt()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=bt()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.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 bo=new ae;class Mo{constructor(t,e,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.applyMatrix4(t),this.setXYZ(e,bo.x,bo.y,bo.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.applyNormalMatrix(t),this.setXYZ(e,bo.x,bo.y,bo.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.transformDirection(t),this.setXYZ(e,bo.x,bo.y,bo.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Ct(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Rt(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Ct(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Ct(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Ct(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Ct(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array),i=Rt(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new Dn(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Mo(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class wo extends Dn{constructor(t,e,n,r=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}class Eo extends Cn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new En(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const So=new ae,To=new ae,Co=new qe,Ro=new Ie,Po=new Se;class Lo extends ln{constructor(t=new Hn,e=new Eo){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,r=e.count;t<r;t++)So.fromBufferAttribute(e,t-1),To.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=So.distanceTo(To);t.setAttribute("lineDistance",new qn(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Po.copy(n.boundingSphere),Po.applyMatrix4(r),Po.radius+=i,!1===t.ray.intersectsSphere(Po))return;Co.copy(r).invert(),Ro.copy(t.ray).applyMatrix4(Co);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,A=new ae,l=new ae,c=new ae,u=new ae,h=this.isLineSegments?2:1,f=n.index,d=n.attributes.position;if(null!==f){for(let n=Math.max(0,a.start),r=Math.min(f.count,a.start+a.count)-1;n<r;n+=h){const r=f.getX(n),i=f.getX(n+1);A.fromBufferAttribute(d,r),l.fromBufferAttribute(d,i);if(Ro.distanceSqToSegment(A,l,u,c)>s)continue;u.applyMatrix4(this.matrixWorld);const a=t.ray.origin.distanceTo(u);a<t.near||a>t.far||e.push({distance:a,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,a.start),r=Math.min(d.count,a.start+a.count)-1;n<r;n+=h){A.fromBufferAttribute(d,n),l.fromBufferAttribute(d,n+1);if(Ro.distanceSqToSegment(A,l,u,c)>s)continue;u.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(u);r<t.near||r>t.far||e.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}const Do=new ae,Oo=new ae;class Io extends Lo{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,r=e.count;t<r;t+=2)Do.fromBufferAttribute(e,t),Oo.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+Do.distanceTo(Oo);t.setAttribute("lineDistance",new qn(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class qo{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),i=0;e.push(0);for(let a=1;a<=t;a++)n=this.getPoint(a/t),i+=n.distanceTo(r),e.push(i),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const i=n.length;let a;a=e||t*n[i-1];let o,s=0,A=i-1;for(;s<=A;)if(r=Math.floor(s+(A-s)/2),o=n[r]-a,o<0)s=r+1;else{if(!(o>0)){A=r;break}A=r-1}if(r=A,n[r]===a)return r/(i-1);const l=n[r];return(r+(a-l)/(n[r+1]-l))/(i-1)}getTangent(t,e){const n=1e-4;let r=t-n,i=t+n;r<0&&(r=0),i>1&&(i=1);const a=this.getPoint(r),o=this.getPoint(i),s=e||(a.isVector2?new Lt:new ae);return s.copy(o).sub(a).normalize(),s}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new ae,r=[],i=[],a=[],o=new ae,s=new qe;for(let e=0;e<=t;e++){const n=e/t;r[e]=this.getTangentAt(n,new ae)}i[0]=new ae,a[0]=new ae;let A=Number.MAX_VALUE;const l=Math.abs(r[0].x),c=Math.abs(r[0].y),u=Math.abs(r[0].z);l<=A&&(A=l,n.set(1,0,0)),c<=A&&(A=c,n.set(0,1,0)),u<=A&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let e=1;e<=t;e++){if(i[e]=i[e-1].clone(),a[e]=a[e-1].clone(),o.crossVectors(r[e-1],r[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(Mt(r[e-1].dot(r[e]),-1,1));i[e].applyMatrix4(s.makeRotationAxis(o,t))}a[e].crossVectors(r[e],i[e])}if(!0===e){let e=Math.acos(Mt(i[0].dot(i[t]),-1,1));e/=t,r[0].dot(o.crossVectors(i[0],i[t]))>0&&(e=-e);for(let n=1;n<=t;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],e*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Uo extends qo{constructor(t=0,e=0,n=1,r=1,i=0,a=2*Math.PI,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(t,e=new Lt){const n=e,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);const o=this.aStartAngle+t*i;let s=this.aX+this.xRadius*Math.cos(o),A=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=s-this.aX,r=A-this.aY;s=n*t-r*e+this.aX,A=n*e+r*t+this.aY}return n.set(s,A)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}function No(){let t=0,e=0,n=0,r=0;function i(i,a,o,s){t=i,e=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(t,e,n,r,a){i(e,n,a*(n-t),a*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,a,o,s){let A=(e-t)/a-(n-t)/(a+o)+(n-e)/o,l=(n-e)/o-(r-e)/(o+s)+(r-n)/s;A*=o,l*=o,i(e,n,A,l)},calc:function(i){const a=i*i;return t+e*i+n*a+r*(a*i)}}}const Bo=new ae,ko=new No,Fo=new No,zo=new No;function Go(t,e,n,r,i){const a=.5*(r-e),o=.5*(i-n),s=t*t;return(2*n-2*r+a+o)*(t*s)+(-3*n+3*r-2*a-o)*s+a*t+n}function Ho(t,e,n,r){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function jo(t,e,n,r,i){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}class Vo extends qo{constructor(t=new Lt,e=new Lt,n=new Lt,r=new Lt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new Lt){const n=e,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(jo(t,r.x,i.x,a.x,o.x),jo(t,r.y,i.y,a.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Wo extends qo{constructor(t=new ae,e=new ae,n=new ae,r=new ae){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new ae){const n=e,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(jo(t,r.x,i.x,a.x,o.x),jo(t,r.y,i.y,a.y,o.y),jo(t,r.z,i.z,a.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Xo extends qo{constructor(t=new Lt,e=new Lt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Lt){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Lt){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Qo extends qo{constructor(t=new Lt,e=new Lt,n=new Lt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new Lt){const n=e,r=this.v0,i=this.v1,a=this.v2;return n.set(Ho(t,r.x,i.x,a.x),Ho(t,r.y,i.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Yo extends qo{constructor(t=new ae,e=new ae,n=new ae){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new ae){const n=e,r=this.v0,i=this.v1,a=this.v2;return n.set(Ho(t,r.x,i.x,a.x),Ho(t,r.y,i.y,a.y),Ho(t,r.z,i.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Zo extends qo{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Lt){const n=e,r=this.points,i=(r.length-1)*t,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],A=r[a],l=r[a>r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(Go(o,s.x,A.x,l.x,c.x),Go(o,s.y,A.y,l.y,c.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Lt).fromArray(n))}return this}}var Ko=Object.freeze({__proto__:null,ArcCurve:class extends Uo{constructor(t,e,n,r,i,a){super(t,e,n,n,r,i,a),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends qo{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}getPoint(t,e=new ae){const n=e,r=this.points,i=r.length,a=(i-(this.closed?0:1))*t;let o,s,A=Math.floor(a),l=a-A;this.closed?A+=A>0?0:(Math.floor(Math.abs(A)/i)+1)*i:0===l&&A===i-1&&(A=i-2,l=1),this.closed||A>0?o=r[(A-1)%i]:(Bo.subVectors(r[0],r[1]).add(r[0]),o=Bo);const c=r[A%i],u=r[(A+1)%i];if(this.closed||A+2<i?s=r[(A+2)%i]:(Bo.subVectors(r[i-1],r[i-2]).add(r[i-1]),s=Bo),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(o.distanceToSquared(c),t),n=Math.pow(c.distanceToSquared(u),t),r=Math.pow(u.distanceToSquared(s),t);n<1e-4&&(n=1),e<1e-4&&(e=n),r<1e-4&&(r=n),ko.initNonuniformCatmullRom(o.x,c.x,u.x,s.x,e,n,r),Fo.initNonuniformCatmullRom(o.y,c.y,u.y,s.y,e,n,r),zo.initNonuniformCatmullRom(o.z,c.z,u.z,s.z,e,n,r)}else"catmullrom"===this.curveType&&(ko.initCatmullRom(o.x,c.x,u.x,s.x,this.tension),Fo.initCatmullRom(o.y,c.y,u.y,s.y,this.tension),zo.initCatmullRom(o.z,c.z,u.z,s.z,this.tension));return n.set(ko.calc(l),Fo.calc(l),zo.calc(l)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new ae).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},CubicBezierCurve:Vo,CubicBezierCurve3:Wo,EllipseCurve:Uo,LineCurve:Xo,LineCurve3:class extends qo{constructor(t=new ae,e=new ae){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new ae){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new ae){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},QuadraticBezierCurve:Qo,QuadraticBezierCurve3:Yo,SplineCurve:Zo});class Jo extends qo{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const n=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Ko[n](e,t))}return this}getPoint(t,e){const n=t*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const t=r[i]-n,a=this.curves[i],o=a.getLength(),s=0===o?0:1-t/o;return a.getPointAt(s,e)}i++}return null}getLength(){const t=this.getCurveLengths();return t[t.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 t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const a=i[r],o=a.isEllipseCurve?2*t:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o);for(let t=0;t<s.length;t++){const r=s[t];n&&n.equals(r)||(e.push(r),n=r)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new Ko[n.type]).fromJSON(n))}return this}}let $o=class extends Jo{constructor(t){super(),this.type="Path",this.currentPoint=new Lt,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new Xo(this.currentPoint.clone(),new Lt(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const i=new Qo(this.currentPoint.clone(),new Lt(t,e),new Lt(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,i,a){const o=new Vo(this.currentPoint.clone(),new Lt(t,e),new Lt(n,r),new Lt(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new Zo(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,i,a){const o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,n,r,i,a),this}absarc(t,e,n,r,i,a){return this.absellipse(t,e,n,n,r,i,a),this}ellipse(t,e,n,r,i,a,o,s){const A=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+A,e+l,n,r,i,a,o,s),this}absellipse(t,e,n,r,i,a,o,s){const A=new Uo(t,e,n,r,i,a,o,s);if(this.curves.length>0){const t=A.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(A);const l=A.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};class ts extends Hn{constructor(t=1,e=32,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},e=Math.max(3,e);const i=[],a=[],o=[],s=[],A=new ae,l=new Lt;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(let i=0,c=3;i<=e;i++,c+=3){const u=n+i/e*r;A.x=t*Math.cos(u),A.y=t*Math.sin(u),a.push(A.x,A.y,A.z),o.push(0,0,1),l.x=(a[c]/t+1)/2,l.y=(a[c+1]/t+1)/2,s.push(l.x,l.y)}for(let t=1;t<=e;t++)i.push(t,t+1,0);this.setIndex(i),this.setAttribute("position",new qn(a,3)),this.setAttribute("normal",new qn(o,3)),this.setAttribute("uv",new qn(s,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ts(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class es extends Hn{constructor(t=1,e=1,n=1,r=32,i=1,a=!1,o=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};const A=this;r=Math.floor(r),i=Math.floor(i);const l=[],c=[],u=[],h=[];let f=0;const d=[],p=n/2;let m=0;function g(n){const i=f,a=new Lt,d=new ae;let g=0;const v=!0===n?t:e,_=!0===n?1:-1;for(let t=1;t<=r;t++)c.push(0,p*_,0),u.push(0,_,0),h.push(.5,.5),f++;const y=f;for(let t=0;t<=r;t++){const e=t/r*s+o,n=Math.cos(e),i=Math.sin(e);d.x=v*i,d.y=p*_,d.z=v*n,c.push(d.x,d.y,d.z),u.push(0,_,0),a.x=.5*n+.5,a.y=.5*i*_+.5,h.push(a.x,a.y),f++}for(let t=0;t<r;t++){const e=i+t,r=y+t;!0===n?l.push(r,r+1,e):l.push(r+1,r,e),g+=3}A.addGroup(m,g,!0===n?1:2),m+=g}!function(){const a=new ae,g=new ae;let v=0;const _=(e-t)/n;for(let A=0;A<=i;A++){const l=[],m=A/i,v=m*(e-t)+t;for(let t=0;t<=r;t++){const e=t/r,i=e*s+o,A=Math.sin(i),d=Math.cos(i);g.x=v*A,g.y=-m*n+p,g.z=v*d,c.push(g.x,g.y,g.z),a.set(A,_,d).normalize(),u.push(a.x,a.y,a.z),h.push(e,1-m),l.push(f++)}d.push(l)}for(let t=0;t<r;t++)for(let e=0;e<i;e++){const n=d[e][t],r=d[e+1][t],i=d[e+1][t+1],a=d[e][t+1];l.push(n,r,a),l.push(r,i,a),v+=6}A.addGroup(m,v,0),m+=v}(),!1===a&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new qn(c,3)),this.setAttribute("normal",new qn(u,3)),this.setAttribute("uv",new qn(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new es(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ns extends $o{constructor(t){super(t),this.uuid=bt(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new $o).fromJSON(n))}return this}}const rs=function(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let a=is(t,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,A,l,c,u,h,f;if(r&&(a=function(t,e,n,r){const i=[];let a,o,s,A,l;for(a=0,o=e.length;a<o;a++)s=e[a]*r,A=a<o-1?e[a+1]*r:t.length,l=is(t,s,A,r,!1),l===l.next&&(l.steiner=!0),i.push(ps(l));for(i.sort(us),a=0;a<i.length;a++)n=hs(i[a],n);return n}(t,e,a,n)),t.length>80*n){s=l=t[0],A=c=t[1];for(let e=n;e<i;e+=n)u=t[e],h=t[e+1],u<s&&(s=u),h<A&&(A=h),u>l&&(l=u),h>c&&(c=h);f=Math.max(l-s,c-A),f=0!==f?32767/f:0}return os(a,o,n,s,A,f,0),o};function is(t,e,n,r,i){let a,o;if(i===function(t,e,n,r){let i=0;for(let a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}(t,e,n,r)>0)for(a=e;a<n;a+=r)o=Es(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=Es(a,t[a],t[a+1],o);return o&&_s(o,o.next)&&(Ss(o),o=o.next),o}function as(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!_s(r,r.next)&&0!==vs(r.prev,r,r.next))r=r.next;else{if(Ss(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function os(t,e,n,r,i,a,o){if(!t)return;!o&&a&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=ds(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n,r,i,a,o,s,A,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ,r);e++);for(A=l;s>0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(t,r,i,a);let s,A,l=t;for(;t.prev!==t.next;)if(s=t.prev,A=t.next,a?As(t,r,i,a):ss(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),Ss(t),t=A.next,l=A.next;else if((t=A)===l){o?1===o?os(t=ls(as(t),e,n),e,n,r,i,a,2):2===o&&cs(t,e,n,r,i,a):os(as(t),e,n,r,i,a,1);break}}function ss(t){const e=t.prev,n=t,r=t.next;if(vs(e,n,r)>=0)return!1;const i=e.x,a=n.x,o=r.x,s=e.y,A=n.y,l=r.y,c=i<a?i<o?i:o:a<o?a:o,u=s<A?s<l?s:l:A<l?A:l,h=i>a?i>o?i:o:a>o?a:o,f=s>A?s>l?s:l:A>l?A:l;let d=r.next;for(;d!==e;){if(d.x>=c&&d.x<=h&&d.y>=u&&d.y<=f&&ms(i,s,a,A,o,l,d.x,d.y)&&vs(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function As(t,e,n,r){const i=t.prev,a=t,o=t.next;if(vs(i,a,o)>=0)return!1;const s=i.x,A=a.x,l=o.x,c=i.y,u=a.y,h=o.y,f=s<A?s<l?s:l:A<l?A:l,d=c<u?c<h?c:h:u<h?u:h,p=s>A?s>l?s:l:A>l?A:l,m=c>u?c>h?c:h:u>h?u:h,g=ds(f,d,e,n,r),v=ds(p,m,e,n,r);let _=t.prevZ,y=t.nextZ;for(;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ms(s,c,A,u,l,h,_.x,_.y)&&vs(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ms(s,c,A,u,l,h,y.x,y.y)&&vs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ms(s,c,A,u,l,h,_.x,_.y)&&vs(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ms(s,c,A,u,l,h,y.x,y.y)&&vs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function ls(t,e,n){let r=t;do{const i=r.prev,a=r.next.next;!_s(i,a)&&ys(i,r,r.next,a)&&Ms(i,a)&&Ms(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),Ss(r),Ss(r.next),r=t=a),r=r.next}while(r!==t);return as(r)}function cs(t,e,n,r,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&gs(o,t)){let s=ws(o,t);return o=as(o,o.next),s=as(s,s.next),os(o,e,n,r,i,a,0),void os(s,e,n,r,i,a,0)}t=t.next}o=o.next}while(o!==t)}function us(t,e){return t.x-e.x}function hs(t,e){const n=function(t,e){let n,r=e,i=-1/0;const a=t.x,o=t.y;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){const t=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=a&&t>i&&(i=t,n=r.x<r.next.x?r:r.next,t===a))return n}r=r.next}while(r!==e);if(!n)return null;const s=n,A=n.x,l=n.y;let c,u=1/0;r=n;do{a>=r.x&&r.x>=A&&a!==r.x&&ms(o<l?a:i,o,A,l,o<l?i:a,o,r.x,r.y)&&(c=Math.abs(o-r.y)/(a-r.x),Ms(r,t)&&(c<u||c===u&&(r.x>n.x||r.x===n.x&&fs(n,r)))&&(n=r,u=c)),r=r.next}while(r!==s);return n}(t,e);if(!n)return e;const r=ws(n,t);return as(r,r.next),as(n,n.next)}function fs(t,e){return vs(t.prev,t,e.prev)<0&&vs(e.next,t,t.next)<0}function ds(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ps(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function ms(t,e,n,r,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(n-o)*(e-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function gs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ys(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ms(t,e)&&Ms(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(vs(t.prev,t,e.prev)||vs(t,e.prev,e))||_s(t,e)&&vs(t.prev,t,t.next)>0&&vs(e.prev,e,e.next)>0)}function vs(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _s(t,e){return t.x===e.x&&t.y===e.y}function ys(t,e,n,r){const i=bs(vs(t,e,n)),a=bs(vs(t,e,r)),o=bs(vs(n,r,t)),s=bs(vs(n,r,e));return i!==a&&o!==s||(!(0!==i||!xs(t,n,e))||(!(0!==a||!xs(t,r,e))||(!(0!==o||!xs(n,t,r))||!(0!==s||!xs(n,e,r)))))}function xs(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function bs(t){return t>0?1:t<0?-1:0}function Ms(t,e){return vs(t.prev,t,t.next)<0?vs(t,e,t.next)>=0&&vs(t,t.prev,e)>=0:vs(t,e,t.prev)<0||vs(t,t.next,e)<0}function ws(t,e){const n=new Ts(t.i,t.x,t.y),r=new Ts(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Es(t,e,n,r){const i=new Ts(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ss(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ts(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Cs{static area(t){const e=t.length;let n=0;for(let r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n}static isClockWise(t){return Cs.area(t)<0}static triangulateShape(t,e){const n=[],r=[],i=[];Rs(t),Ps(n,t);let a=t.length;e.forEach(Rs);for(let t=0;t<e.length;t++)r.push(a),a+=e[t].length,Ps(n,e[t]);const o=rs(n,r);for(let t=0;t<o.length;t+=3)i.push(o.slice(t,t+3));return i}}function Rs(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Ps(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class Ls extends Hn{constructor(t=new ns([new Lt(.5,.5),new Lt(-.5,.5),new Lt(-.5,-.5),new Lt(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],i=[];for(let e=0,n=t.length;e<n;e++){a(t[e])}function a(t){const a=[],o=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,A=void 0!==e.depth?e.depth:1;let l=void 0===e.bevelEnabled||e.bevelEnabled,c=void 0!==e.bevelThickness?e.bevelThickness:.2,u=void 0!==e.bevelSize?e.bevelSize:c-.1,h=void 0!==e.bevelOffset?e.bevelOffset:0,f=void 0!==e.bevelSegments?e.bevelSegments:3;const d=e.extrudePath,p=void 0!==e.UVGenerator?e.UVGenerator:Ds;let m,g,v,_,y,x=!1;d&&(m=d.getSpacedPoints(s),x=!0,l=!1,g=d.computeFrenetFrames(s,!1),v=new ae,_=new ae,y=new ae),l||(f=0,c=0,u=0,h=0);const b=t.extractPoints(o);let M=b.shape;const w=b.holes;if(!Cs.isClockWise(M)){M=M.reverse();for(let t=0,e=w.length;t<e;t++){const e=w[t];Cs.isClockWise(e)&&(w[t]=e.reverse())}}const E=Cs.triangulateShape(M,w),S=M;for(let t=0,e=w.length;t<e;t++){const e=w[t];M=M.concat(e)}function T(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,n)}const C=M.length,R=E.length;function P(t,e,n){let r,i,a;const o=t.x-e.x,s=t.y-e.y,A=n.x-t.x,l=n.y-t.y,c=o*o+s*s,u=o*l-s*A;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(c),h=Math.sqrt(A*A+l*l),f=e.x-s/u,d=e.y+o/u,p=((n.x-l/h-f)*l-(n.y+A/h-d)*A)/(o*l-s*A);r=f+o*p-t.x,i=d+s*p-t.y;const m=r*r+i*i;if(m<=2)return new Lt(r,i);a=Math.sqrt(m/2)}else{let t=!1;o>Number.EPSILON?A>Number.EPSILON&&(t=!0):o<-Number.EPSILON?A<-Number.EPSILON&&(t=!0):Math.sign(s)===Math.sign(l)&&(t=!0),t?(r=-s,i=o,a=Math.sqrt(c)):(r=o,i=s,a=Math.sqrt(c/2))}return new Lt(r/a,i/a)}const L=[];for(let t=0,e=S.length,n=e-1,r=t+1;t<e;t++,n++,r++)n===e&&(n=0),r===e&&(r=0),L[t]=P(S[t],S[n],S[r]);const D=[];let O,I=L.concat();for(let t=0,e=w.length;t<e;t++){const e=w[t];O=[];for(let t=0,n=e.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),O[t]=P(e[t],e[r],e[i]);D.push(O),I=I.concat(O)}for(let t=0;t<f;t++){const e=t/f,n=c*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+h;for(let t=0,e=S.length;t<e;t++){const e=T(S[t],L[t],r);N(e.x,e.y,-n)}for(let t=0,e=w.length;t<e;t++){const e=w[t];O=D[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],O[t],r);N(i.x,i.y,-n)}}}const q=u+h;for(let t=0;t<C;t++){const e=l?T(M[t],I[t],q):M[t];x?(_.copy(g.normals[0]).multiplyScalar(e.x),v.copy(g.binormals[0]).multiplyScalar(e.y),y.copy(m[0]).add(_).add(v),N(y.x,y.y,y.z)):N(e.x,e.y,0)}for(let t=1;t<=s;t++)for(let e=0;e<C;e++){const n=l?T(M[e],I[e],q):M[e];x?(_.copy(g.normals[t]).multiplyScalar(n.x),v.copy(g.binormals[t]).multiplyScalar(n.y),y.copy(m[t]).add(_).add(v),N(y.x,y.y,y.z)):N(n.x,n.y,A/s*t)}for(let t=f-1;t>=0;t--){const e=t/f,n=c*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+h;for(let t=0,e=S.length;t<e;t++){const e=T(S[t],L[t],r);N(e.x,e.y,A+n)}for(let t=0,e=w.length;t<e;t++){const e=w[t];O=D[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],O[t],r);x?N(i.x,i.y+m[s-1].y,m[s-1].x+n):N(i.x,i.y,A+n)}}}function U(t,e){let n=t.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=t.length-1);for(let t=0,n=s+2*f;t<n;t++){const n=C*t,a=C*(t+1);k(e+r+n,e+i+n,e+i+a,e+r+a)}}}function N(t,e,n){a.push(t),a.push(e),a.push(n)}function B(t,e,i){F(t),F(e),F(i);const a=r.length/3,o=p.generateTopUV(n,r,a-3,a-2,a-1);z(o[0]),z(o[1]),z(o[2])}function k(t,e,i,a){F(t),F(e),F(a),F(e),F(i),F(a);const o=r.length/3,s=p.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);z(s[0]),z(s[1]),z(s[3]),z(s[1]),z(s[2]),z(s[3])}function F(t){r.push(a[3*t+0]),r.push(a[3*t+1]),r.push(a[3*t+2])}function z(t){i.push(t.x),i.push(t.y)}!function(){const t=r.length/3;if(l){let t=0,e=C*t;for(let t=0;t<R;t++){const n=E[t];B(n[2]+e,n[1]+e,n[0]+e)}t=s+2*f,e=C*t;for(let t=0;t<R;t++){const n=E[t];B(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<R;t++){const e=E[t];B(e[2],e[1],e[0])}for(let t=0;t<R;t++){const e=E[t];B(e[0]+C*s,e[1]+C*s,e[2]+C*s)}}n.addGroup(t,r.length/3-t,0)}(),function(){const t=r.length/3;let e=0;U(S,e),e+=S.length;for(let t=0,n=w.length;t<n;t++){const n=w[t];U(n,e),e+=n.length}n.addGroup(t,r.length/3-t,1)}()}this.setAttribute("position",new qn(r,3)),this.setAttribute("uv",new qn(i,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,r=t.length;e<r;e++){const r=t[e];n.shapes.push(r.uuid)}else n.shapes.push(t.uuid);n.options=Object.assign({},e),void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let r=0,i=t.shapes.length;r<i;r++){const i=e[t.shapes[r]];n.push(i)}const r=t.options.extrudePath;return void 0!==r&&(t.options.extrudePath=(new Ko[r.type]).fromJSON(r)),new Ls(n,t.options)}}const Ds={generateTopUV:function(t,e,n,r,i){const a=e[3*n],o=e[3*n+1],s=e[3*r],A=e[3*r+1],l=e[3*i],c=e[3*i+1];return[new Lt(a,o),new Lt(s,A),new Lt(l,c)]},generateSideWallUV:function(t,e,n,r,i,a){const o=e[3*n],s=e[3*n+1],A=e[3*n+2],l=e[3*r],c=e[3*r+1],u=e[3*r+2],h=e[3*i],f=e[3*i+1],d=e[3*i+2],p=e[3*a],m=e[3*a+1],g=e[3*a+2];return Math.abs(s-c)<Math.abs(o-l)?[new Lt(o,1-A),new Lt(l,1-u),new Lt(h,1-d),new Lt(p,1-g)]:[new Lt(s,1-A),new Lt(c,1-u),new Lt(f,1-d),new Lt(m,1-g)]}};class Os extends Hn{constructor(t=1,e=32,n=16,r=0,i=2*Math.PI,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const s=Math.min(a+o,Math.PI);let A=0;const l=[],c=new ae,u=new ae,h=[],f=[],d=[],p=[];for(let h=0;h<=n;h++){const m=[],g=h/n;let v=0;0===h&&0===a?v=.5/e:h===n&&s===Math.PI&&(v=-.5/e);for(let n=0;n<=e;n++){const s=n/e;c.x=-t*Math.cos(r+s*i)*Math.sin(a+g*o),c.y=t*Math.cos(a+g*o),c.z=t*Math.sin(r+s*i)*Math.sin(a+g*o),f.push(c.x,c.y,c.z),u.copy(c).normalize(),d.push(u.x,u.y,u.z),p.push(s+v,1-g),m.push(A++)}l.push(m)}for(let t=0;t<n;t++)for(let r=0;r<e;r++){const e=l[t][r+1],i=l[t][r],o=l[t+1][r],A=l[t+1][r+1];(0!==t||a>0)&&h.push(e,i,A),(t!==n-1||s<Math.PI)&&h.push(i,o,A)}this.setIndex(h),this.setAttribute("position",new qn(f,3)),this.setAttribute("normal",new qn(d,3)),this.setAttribute("uv",new qn(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Os(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Is extends Hn{constructor(t=new Yo(new ae(-1,-1,0),new ae(-1,1,0),new ae(1,1,0)),e=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i};const a=t.computeFrenetFrames(e,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new ae,s=new ae,A=new Lt;let l=new ae;const c=[],u=[],h=[],f=[];function d(i){l=t.getPointAt(i/e,l);const A=a.normals[i],h=a.binormals[i];for(let t=0;t<=r;t++){const e=t/r*Math.PI*2,i=Math.sin(e),a=-Math.cos(e);s.x=a*A.x+i*h.x,s.y=a*A.y+i*h.y,s.z=a*A.z+i*h.z,s.normalize(),u.push(s.x,s.y,s.z),o.x=l.x+n*s.x,o.y=l.y+n*s.y,o.z=l.z+n*s.z,c.push(o.x,o.y,o.z)}}!function(){for(let t=0;t<e;t++)d(t);d(!1===i?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=r;n++)A.x=t/e,A.y=n/r,h.push(A.x,A.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=r;e++){const n=(r+1)*(t-1)+(e-1),i=(r+1)*t+(e-1),a=(r+1)*t+e,o=(r+1)*(t-1)+e;f.push(n,i,o),f.push(i,a,o)}}()}(),this.setIndex(f),this.setAttribute("position",new qn(c,3)),this.setAttribute("normal",new qn(u,3)),this.setAttribute("uv",new qn(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Is((new Ko[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}function qs(t,e,n){const r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}class Us extends Cn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new En(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new En(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ve,this.combine=_,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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}const Ns={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class Bs{constructor(t,e,n){const r=this;let i,a=!1,o=0,s=0;const A=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){s++,!1===a&&void 0!==r.onStart&&r.onStart(t,o,s),a=!0},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,s),o===s&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return i?i(t):t},this.setURLModifier=function(t){return i=t,this},this.addHandler=function(t,e){return A.push(t,e),this},this.removeHandler=function(t){const e=A.indexOf(t);return-1!==e&&A.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=A.length;e<n;e+=2){const n=A[e],r=A[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}}const ks=new Bs;class Fs{constructor(t){this.manager=void 0!==t?t:ks,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(r,i){n.load(t,r,e,i)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}Fs.DEFAULT_MATERIAL_NAME="__DEFAULT";class zs extends Fs{constructor(t){super(t)}load(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,a=Ns.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout((function(){e&&e(a),i.manager.itemEnd(t)}),0),a;const o=qt("img");function s(){l(),Ns.add(t,this),e&&e(this),i.manager.itemEnd(t)}function A(e){l(),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}function l(){o.removeEventListener("load",s,!1),o.removeEventListener("error",A,!1)}return o.addEventListener("load",s,!1),o.addEventListener("error",A,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o}}class Gs extends Fs{constructor(t){super(t)}load(t,e,n,r){const i=new Jt,a=new zs(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,(function(t){i.image=t,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}class Hs extends ln{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new En(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}const js=new qe,Vs=new ae,Ws=new ae;class Xs{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Lt(512,512),this.map=null,this.mapPass=null,this.matrix=new qe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Pr,this._frameExtents=new Lt(1,1),this._viewportCount=1,this._viewports=[new $t(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Vs.setFromMatrixPosition(t.matrixWorld),e.position.copy(Vs),Ws.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Ws),e.updateMatrixWorld(),js.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(js),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(js)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Qs extends Xs{constructor(){super(new Wr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Ys{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Zs(),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 t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Zs();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Zs(){return("undefined"==typeof performance?Date:performance).now()}class Ks extends xo{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}const Js=new qe;function $s(t,e){return t.distance-e.distance}function tA(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r){const r=t.children;for(let t=0,i=r.length;t<i;t++)tA(r[t],e,n,!0)}}class eA{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Mt(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const nA=new ae,rA=new ae;class iA{constructor(){this.type="ShapePath",this.color=new En,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new $o,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this}bezierCurveTo(t,e,n,r,i,a){return this.currentPath.bezierCurveTo(t,e,n,r,i,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let r=!1;for(let i=n-1,a=0;a<n;i=a++){let n=e[i],o=e[a],s=o.x-n.x,A=o.y-n.y;if(Math.abs(A)>Number.EPSILON){if(A<0&&(n=e[a],s=-s,o=e[i],A=-A),t.y<n.y||t.y>o.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=A*(t.x-n.x)-s*(t.y-n.y);if(0===e)return!0;if(e<0)continue;r=!r}}else{if(t.y!==n.y)continue;if(o.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=o.x)return!0}}return r}const n=Cs.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,a,o;const s=[];if(1===r.length)return a=r[0],o=new ns,o.curves=a.curves,s.push(o),s;let A=!n(r[0].getPoints());A=t?!A:A;const l=[],c=[];let u,h,f=[],d=0;c[d]=void 0,f[d]=[];for(let e=0,o=r.length;e<o;e++)a=r[e],u=a.getPoints(),i=n(u),i=t?!i:i,i?(!A&&c[d]&&d++,c[d]={s:new ns,p:u},c[d].s.curves=a.curves,A&&d++,f[d]=[]):f[d].push({h:a,p:u[0]});if(!c[0])return function(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n],i=new ns;i.curves=r.curves,e.push(i)}return e}(r);if(c.length>1){let t=!1,n=0;for(let t=0,e=c.length;t<e;t++)l[t]=[];for(let r=0,i=c.length;r<i;r++){const i=f[r];for(let a=0;a<i.length;a++){const o=i[a];let s=!0;for(let i=0;i<c.length;i++)e(o.p,c[i].p)&&(r!==i&&n++,s?(s=!1,l[i].push(o)):t=!0);s&&l[r].push(o)}}n>0&&!1===t&&(f=l)}for(let t=0,e=c.length;t<e;t++){o=c[t].s,s.push(o),h=f[t];for(let t=0,e=h.length;t<e;t++)o.holes.push(h[t].h)}return s}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:s}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=s);const aA=new ae,oA=new qe,sA=new qe,AA=new ae,lA=new ae;function cA(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var uA="object"==typeof global&&global&&global.Object===Object&&global,hA="object"==typeof self&&self&&self.Object===Object&&self,fA=uA||hA||Function("return this")(),dA=function(){return fA.Date.now()},pA=/\s/;var mA=/^\s+/;function gA(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&pA.test(t.charAt(e)););return e}(t)+1).replace(mA,""):t}var vA=fA.Symbol,_A=Object.prototype,yA=_A.hasOwnProperty,xA=_A.toString,bA=vA?vA.toStringTag:void 0;var MA=Object.prototype.toString;var wA="[object Null]",EA="[object Undefined]",SA=vA?vA.toStringTag:void 0;function TA(t){return null==t?void 0===t?EA:wA:SA&&SA in Object(t)?function(t){var e=yA.call(t,bA),n=t[bA];try{t[bA]=void 0;var r=!0}catch(t){}var i=xA.call(t);return r&&(e?t[bA]=n:delete t[bA]),i}(t):function(t){return MA.call(t)}(t)}var CA="[object Symbol]";var RA=NaN,PA=/^[-+]0x[0-9a-f]+$/i,LA=/^0b[01]+$/i,DA=/^0o[0-7]+$/i,OA=parseInt;function IA(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&TA(t)==CA}(t))return RA;if(cA(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=cA(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=gA(t);var n=LA.test(t);return n||DA.test(t)?OA(t.slice(2),n?2:8):PA.test(t)?RA:+t}var qA="Expected a function",UA=Math.max,NA=Math.min;function BA(t,e,n){var r,i,a,o,s,A,l=0,c=!1,u=!1,h=!0;if("function"!=typeof t)throw new TypeError(qA);function f(e){var n=r,a=i;return r=i=void 0,l=e,o=t.apply(a,n)}function d(t){var n=t-A;return void 0===A||n>=e||n<0||u&&t-l>=a}function p(){var t=dA();if(d(t))return m(t);s=setTimeout(p,function(t){var n=e-(t-A);return u?NA(n,a-(t-l)):n}(t))}function m(t){return s=void 0,h&&r?f(t):(r=i=void 0,o)}function g(){var t=dA(),n=d(t);if(r=arguments,i=this,A=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(p,e),c?f(t):o}(A);if(u)return clearTimeout(s),s=setTimeout(p,e),f(A)}return void 0===s&&(s=setTimeout(p,e)),o}return e=IA(e)||0,cA(n)&&(c=!!n.leading,a=(u="maxWait"in n)?UA(IA(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=A=i=s=void 0},g.flush=function(){return void 0===s?o:m(dA())},g}function kA(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=r.key,a=void 0,"symbol"==typeof(a=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"))?a:String(a)),r)}var i,a}function FA(t,e,n){return e&&kA(t.prototype,e),n&&kA(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function zA(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return GA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GA(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function GA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var HA=FA((function t(e,n){var r=n.default,i=void 0===r?null:r,a=n.triggerUpdate,o=void 0===a||a,s=n.onChange,A=void 0===s?function(t,e){}:s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=i,this.triggerUpdate=o,this.onChange=A}));function jA(t){var e=t.stateInit,n=void 0===e?function(){return{}}:e,r=t.props,i=void 0===r?{}:r,a=t.methods,o=void 0===a?{}:a,s=t.aliases,A=void 0===s?{}:s,l=t.init,c=void 0===l?function(){}:l,u=t.update,h=void 0===u?function(){}:u,f=Object.keys(i).map((function(t){return new HA(t,i[t])}));return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},n instanceof Function?n(t):n,{initialised:!1}),r={};function i(e){return a(e,t),s(),i}var a=function(t,n){c.call(i,t,e,n),e.initialised=!0},s=BA((function(){e.initialised&&(h.call(i,e,r),r={})}),1);return f.forEach((function(t){i[t.name]=function(t){var n=t.name,a=t.triggerUpdate,o=void 0!==a&&a,A=t.onChange,l=void 0===A?function(t,e){}:A,c=t.defaultVal,u=void 0===c?null:c;return function(t){var a=e[n];if(!arguments.length)return a;var A=void 0===t?u:t;return e[n]=A,l.call(i,A,e,a),!r.hasOwnProperty(n)&&(r[n]=a),o&&s(),i}}(t)})),Object.keys(o).forEach((function(t){i[t]=function(){for(var n,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return(n=o[t]).call.apply(n,[i,e].concat(a))}})),Object.entries(A).forEach((function(t){var e=zA(t,2),n=e[0],r=e[1];return i[n]=i[r]})),i.resetProps=function(){return f.forEach((function(t){i[t.name](t.defaultVal)})),i},i.resetProps(),e._rerender=s,i}}var VA,WA=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return this.None(t)},Out:function(t){return this.None(t)},InOut:function(t){return this.None(t)}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-WA.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*WA.Bounce.In(2*t):.5*WA.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),XA=function(){return performance.now()},QA=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=XA()),void 0===e&&(e=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]],a=!e;i&&!1===i.update(t,a)&&!e&&delete this._tweens[n[r]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),YA={Linear:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=YA.Utils.Linear;return e<0?a(t[0],t[1],r):e>1?a(t[n],t[n-1],n-r):a(t[i],t[i+1>n?n:i+1],r-i)},Bezier:function(t,e){for(var n=0,r=t.length-1,i=Math.pow,a=YA.Utils.Bernstein,o=0;o<=r;o++)n+=i(1-e,r-o)*i(e,o)*t[o]*a(r,o);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=YA.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(i=Math.floor(r=n*(1+e))),a(t[(i-1+n)%n],t[i],t[(i+1)%n],t[(i+2)%n],r-i)):e<0?t[0]-(a(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(a(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):a(t[i?i-1:0],t[i],t[n<i+1?n:i+1],t[n<i+2?n:i+2],r-i)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=YA.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(VA=[1],function(t){var e=1;if(VA[t])return VA[t];for(var n=t;n>1;n--)e*=n;return VA[t]=e,e}),CatmullRom:function(t,e,n,r,i){var a=.5*(n-t),o=.5*(r-e),s=i*i;return(2*e-2*n+a+o)*(i*s)+(-3*e+3*n-2*a-o)*s+a*i+e}}},ZA=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),KA=new QA,JA=function(){function t(t,e){void 0===e&&(e=KA),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=WA.Linear.None,this._interpolationFunction=YA.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ZA.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=XA()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var i in this._valuesEnd)r[i]=this._valuesEnd[i];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,r,i){for(var a in n){var o=t[a],s=Array.isArray(o),A=s?"array":typeof o,l=!s&&Array.isArray(n[a]);if("undefined"!==A&&"function"!==A){if(l){if(0===(m=n[a]).length)continue;for(var c=[o],u=0,h=m.length;u<h;u+=1){var f=this._handleRelativeValue(o,m[u]);if(isNaN(f)){l=!1,console.warn("Found invalid interpolation list. Skipping.");break}c.push(f)}l&&(n[a]=c)}if("object"!==A&&!s||!o||l)(void 0===e[a]||i)&&(e[a]=o),s||(e[a]*=1),r[a]=l?n[a].slice().reverse():e[a]||0;else{e[a]=s?[]:{};var d=o;for(var p in d)e[a][p]=d[p];r[a]=s?[]:{};var m=n[a];if(!this._isDynamic){var g={};for(var p in m)g[p]=m[p];n[a]=m=g}this._setupProperties(d,e[a],m,r[a],i)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=XA()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=XA()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return void 0===t&&(t=KA),this._group=t,this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=WA.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=YA.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){var n,r,i=this;if(void 0===t&&(t=XA()),void 0===e&&(e=!0),this._isPaused)return!0;var a=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>a)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=t-this._startTime,s=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),A=this._duration+this._repeat*s,l=function(){if(0===i._duration)return 1;if(o>A)return 1;var t=Math.trunc(o/s),e=o-t*s,n=Math.min(e/i._duration,1);return 0===n&&o===i._duration?1:n}(),c=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,c),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),0===this._duration||o>=this._duration){if(this._repeat>0){var u=Math.min(Math.trunc((o-this._duration)/s)+1,this._repeat);for(r in isFinite(this._repeat)&&(this._repeat-=u),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*u,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var h=0,f=this._chainedTweens.length;h<f;h++)this._chainedTweens[h].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,r){for(var i in n)if(void 0!==e[i]){var a=e[i]||0,o=n[i],s=Array.isArray(t[i]),A=Array.isArray(o);!s&&A?t[i]=this._interpolationFunction(o,r):"object"==typeof o&&o?this._updateProperties(t[i],a,o,r):"number"==typeof(o=this._handleRelativeValue(a,o))&&(t[i]=a+(o-a)*r)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),$A=KA;$A.getAll.bind($A),$A.removeAll.bind($A),$A.add.bind($A),$A.remove.bind($A);var tl=$A.update.bind($A);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function el(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var nl={exports:{}};function rl(t,e,n){n=n||2;var r,i,a,o,s,A,l,c=e&&e.length,u=c?e[0]*n:t.length,h=il(t,0,u,n,!0),f=[];if(!h||h.next===h.prev)return f;if(c&&(h=function(t,e,n,r){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=il(t,e[i]*r,i<a-1?e[i+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),s.push(pl(o));for(s.sort(ul),i=0;i<s.length;i++)n=hl(s[i],n);return n}(t,e,h,n)),t.length>80*n){r=a=t[0],i=o=t[1];for(var d=n;d<u;d+=n)(s=t[d])<r&&(r=s),(A=t[d+1])<i&&(i=A),s>a&&(a=s),A>o&&(o=A);l=0!==(l=Math.max(a-r,o-i))?32767/l:0}return ol(h,f,n,r,i,l,0),f}function il(t,e,n,r,i){var a,o;if(i===Cl(t,e,n,r)>0)for(a=e;a<n;a+=r)o=El(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=El(a,t[a],t[a+1],o);return o&&_l(o,o.next)&&(Sl(o),o=o.next),o}function al(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!_l(r,r.next)&&0!==vl(r.prev,r,r.next))r=r.next;else{if(Sl(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function ol(t,e,n,r,i,a,o){if(t){!o&&a&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=dl(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,a,o,s,A,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(A=l;s>0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(t,r,i,a);for(var s,A,l=t;t.prev!==t.next;)if(s=t.prev,A=t.next,a?Al(t,r,i,a):sl(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),Sl(t),t=A.next,l=A.next;else if((t=A)===l){o?1===o?ol(t=ll(al(t),e,n),e,n,r,i,a,2):2===o&&cl(t,e,n,r,i,a):ol(al(t),e,n,r,i,a,1);break}}}function sl(t){var e=t.prev,n=t,r=t.next;if(vl(e,n,r)>=0)return!1;for(var i=e.x,a=n.x,o=r.x,s=e.y,A=n.y,l=r.y,c=i<a?i<o?i:o:a<o?a:o,u=s<A?s<l?s:l:A<l?A:l,h=i>a?i>o?i:o:a>o?a:o,f=s>A?s>l?s:l:A>l?A:l,d=r.next;d!==e;){if(d.x>=c&&d.x<=h&&d.y>=u&&d.y<=f&&ml(i,s,a,A,o,l,d.x,d.y)&&vl(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Al(t,e,n,r){var i=t.prev,a=t,o=t.next;if(vl(i,a,o)>=0)return!1;for(var s=i.x,A=a.x,l=o.x,c=i.y,u=a.y,h=o.y,f=s<A?s<l?s:l:A<l?A:l,d=c<u?c<h?c:h:u<h?u:h,p=s>A?s>l?s:l:A>l?A:l,m=c>u?c>h?c:h:u>h?u:h,g=dl(f,d,e,n,r),v=dl(p,m,e,n,r),_=t.prevZ,y=t.nextZ;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ml(s,c,A,u,l,h,_.x,_.y)&&vl(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ml(s,c,A,u,l,h,y.x,y.y)&&vl(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ml(s,c,A,u,l,h,_.x,_.y)&&vl(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ml(s,c,A,u,l,h,y.x,y.y)&&vl(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function ll(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!_l(i,a)&&yl(i,r,r.next,a)&&Ml(i,a)&&Ml(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),Sl(r),Sl(r.next),r=t=a),r=r.next}while(r!==t);return al(r)}function cl(t,e,n,r,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&gl(o,s)){var A=wl(o,s);return o=al(o,o.next),A=al(A,A.next),ol(o,e,n,r,i,a,0),void ol(A,e,n,r,i,a,0)}s=s.next}o=o.next}while(o!==t)}function ul(t,e){return t.x-e.x}function hl(t,e){var n=function(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o&&(o=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next}while(r!==e);if(!n)return null;var A,l=n,c=n.x,u=n.y,h=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&ml(a<u?i:o,a,c,u,a<u?o:i,a,r.x,r.y)&&(A=Math.abs(a-r.y)/(i-r.x),Ml(r,t)&&(A<h||A===h&&(r.x>n.x||r.x===n.x&&fl(n,r)))&&(n=r,h=A)),r=r.next}while(r!==l);return n}(t,e);if(!n)return e;var r=wl(n,t);return al(r,r.next),al(n,n.next)}function fl(t,e){return vl(t.prev,t,e.prev)<0&&vl(e.next,t,t.next)<0}function dl(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function pl(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function ml(t,e,n,r,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(n-o)*(e-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function gl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&yl(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ml(t,e)&&Ml(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(vl(t.prev,t,e.prev)||vl(t,e.prev,e))||_l(t,e)&&vl(t.prev,t,t.next)>0&&vl(e.prev,e,e.next)>0)}function vl(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _l(t,e){return t.x===e.x&&t.y===e.y}function yl(t,e,n,r){var i=bl(vl(t,e,n)),a=bl(vl(t,e,r)),o=bl(vl(n,r,t)),s=bl(vl(n,r,e));return i!==a&&o!==s||(!(0!==i||!xl(t,n,e))||(!(0!==a||!xl(t,r,e))||(!(0!==o||!xl(n,t,r))||!(0!==s||!xl(n,e,r)))))}function xl(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function bl(t){return t>0?1:t<0?-1:0}function Ml(t,e){return vl(t.prev,t,t.next)<0?vl(t,e,t.next)>=0&&vl(t,t.prev,e)>=0:vl(t,e,t.prev)<0||vl(t,t.next,e)<0}function wl(t,e){var n=new Tl(t.i,t.x,t.y),r=new Tl(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function El(t,e,n,r){var i=new Tl(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Sl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Tl(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cl(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}nl.exports=rl,nl.exports.default=rl,rl.deviation=function(t,e,n,r){var i=e&&e.length,a=i?e[0]*n:t.length,o=Math.abs(Cl(t,0,a,n));if(i)for(var s=0,A=e.length;s<A;s++){var l=e[s]*n,c=s<A-1?e[s+1]*n:t.length;o-=Math.abs(Cl(t,l,c,n))}var u=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,f=r[s+1]*n,d=r[s+2]*n;u+=Math.abs((t[h]-t[d])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[d+1]-t[h+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},rl.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)n.vertices.push(t[i][a][o]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n};var Rl=el(nl.exports);function Pl(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ll(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Dl(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e}while(i<a)}return i}return 2!==t.length?(e=Pl,n=(e,n)=>Pl(t(e),n),r=(e,n)=>t(e)-n):(e=t===Pl||t===Ll?t:Ol,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const o=i(t,e,n,a-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e}while(i<a)}return i}}}function Ol(){return 0}const Il=Dl(Pl).right;function ql(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(void 0===n?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}Dl((function(t){return null===t?NaN:+t})).center;class Ul{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],a=t+i,o=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);o&&(e[n++]=o),t=a}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,a=0;if(i>0){for(a=t[--i];i>0&&(e=a,n=t[--i],a=e+n,r=n-(a-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=a+n,n==e-a&&(a=e))}return a}}const Nl=Math.sqrt(50),Bl=Math.sqrt(10),kl=Math.sqrt(2);function Fl(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Nl?10:a>=Bl?5:a>=kl?2:1;let s,A,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),A=Math.round(e*l),s/l<t&&++s,A/l>e&&--A,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),A=Math.round(e/l),s*l<t&&++s,A*l>e&&--A),A<s&&.5<=n&&n<2?Fl(t,e,2*n):[s,A,l]}function zl(t,e,n){return Fl(t=+t,e=+e,n=+n)[2]}function Gl(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Hl(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}var jl=1e-6,Vl=1e-12,Wl=Math.PI,Xl=Wl/2,Ql=Wl/4,Yl=2*Wl,Zl=180/Wl,Kl=Wl/180,Jl=Math.abs,$l=Math.atan,tc=Math.atan2,ec=Math.cos,nc=Math.ceil,rc=Math.hypot,ic=Math.sin,ac=Math.sign||function(t){return t>0?1:t<0?-1:0},oc=Math.sqrt;function sc(t){return t>1?Xl:t<-1?-Xl:Math.asin(t)}function Ac(t){return(t=ic(t/2))*t}function lc(){}function cc(t,e){t&&hc.hasOwnProperty(t.type)&&hc[t.type](t,e)}var uc={Feature:function(t,e){cc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)cc(n[r].geometry,e)}},hc={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){fc(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)fc(n[r],e,0)},Polygon:function(t,e){dc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)dc(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)cc(n[r],e)}};function fc(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function dc(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)fc(t[n],e,1);e.polygonEnd()}function pc(t,e){t&&uc.hasOwnProperty(t.type)?uc[t.type](t,e):cc(t,e)}var mc,gc,vc,_c,yc,xc,bc,Mc,wc,Ec,Sc,Tc,Cc,Rc,Pc,Lc,Dc=new Ul,Oc=new Ul,Ic={point:lc,lineStart:lc,lineEnd:lc,polygonStart:function(){Dc=new Ul,Ic.lineStart=qc,Ic.lineEnd=Uc},polygonEnd:function(){var t=+Dc;Oc.add(t<0?Yl+t:t),this.lineStart=this.lineEnd=this.point=lc},sphere:function(){Oc.add(Yl)}};function qc(){Ic.point=Nc}function Uc(){Bc(mc,gc)}function Nc(t,e){Ic.point=Bc,mc=t,gc=e,vc=t*=Kl,_c=ec(e=(e*=Kl)/2+Ql),yc=ic(e)}function Bc(t,e){var n=(t*=Kl)-vc,r=n>=0?1:-1,i=r*n,a=ec(e=(e*=Kl)/2+Ql),o=ic(e),s=yc*o,A=_c*a+s*ec(i),l=s*r*ic(i);Dc.add(tc(l,A)),vc=t,_c=a,yc=o}function kc(t){return[tc(t[1],t[0]),sc(t[2])]}function Fc(t){var e=t[0],n=t[1],r=ec(n);return[r*ec(e),r*ic(e),ic(n)]}function zc(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Gc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Hc(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function jc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Vc(t){var e=oc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Wc,Xc,Qc,Yc,Zc,Kc,Jc,$c,tu,eu,nu,ru,iu,au,ou,su,Au={point:lu,lineStart:uu,lineEnd:hu,polygonStart:function(){Au.point=fu,Au.lineStart=du,Au.lineEnd=pu,Rc=new Ul,Ic.polygonStart()},polygonEnd:function(){Ic.polygonEnd(),Au.point=lu,Au.lineStart=uu,Au.lineEnd=hu,Dc<0?(xc=-(Mc=180),bc=-(wc=90)):Rc>jl?wc=90:Rc<-jl&&(bc=-90),Lc[0]=xc,Lc[1]=Mc},sphere:function(){xc=-(Mc=180),bc=-(wc=90)}};function lu(t,e){Pc.push(Lc=[xc=t,Mc=t]),e<bc&&(bc=e),e>wc&&(wc=e)}function cu(t,e){var n=Fc([t*Kl,e*Kl]);if(Cc){var r=Gc(Cc,n),i=Gc([r[1],-r[0],0],r);Vc(i),i=kc(i);var a,o=t-Ec,s=o>0?1:-1,A=i[0]*Zl*s,l=Jl(o)>180;l^(s*Ec<A&&A<s*t)?(a=i[1]*Zl)>wc&&(wc=a):l^(s*Ec<(A=(A+360)%360-180)&&A<s*t)?(a=-i[1]*Zl)<bc&&(bc=a):(e<bc&&(bc=e),e>wc&&(wc=e)),l?t<Ec?mu(xc,t)>mu(xc,Mc)&&(Mc=t):mu(t,Mc)>mu(xc,Mc)&&(xc=t):Mc>=xc?(t<xc&&(xc=t),t>Mc&&(Mc=t)):t>Ec?mu(xc,t)>mu(xc,Mc)&&(Mc=t):mu(t,Mc)>mu(xc,Mc)&&(xc=t)}else Pc.push(Lc=[xc=t,Mc=t]);e<bc&&(bc=e),e>wc&&(wc=e),Cc=n,Ec=t}function uu(){Au.point=cu}function hu(){Lc[0]=xc,Lc[1]=Mc,Au.point=lu,Cc=null}function fu(t,e){if(Cc){var n=t-Ec;Rc.add(Jl(n)>180?n+(n>0?360:-360):n)}else Sc=t,Tc=e;Ic.point(t,e),cu(t,e)}function du(){Ic.lineStart()}function pu(){fu(Sc,Tc),Ic.lineEnd(),Jl(Rc)>jl&&(xc=-(Mc=180)),Lc[0]=xc,Lc[1]=Mc,Cc=null}function mu(t,e){return(e-=t)<0?e+360:e}function gu(t,e){return t[0]-e[0]}function vu(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function _u(t){var e,n,r,i,a,o,s;if(wc=Mc=-(xc=bc=1/0),Pc=[],pc(t,Au),n=Pc.length){for(Pc.sort(gu),e=1,a=[r=Pc[0]];e<n;++e)vu(r,(i=Pc[e])[0])||vu(r,i[1])?(mu(r[0],i[1])>mu(r[0],r[1])&&(r[1]=i[1]),mu(i[0],r[1])>mu(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(s=mu(r[1],i[0]))>o&&(o=s,xc=i[0],Mc=r[1])}return Pc=Lc=null,xc===1/0||bc===1/0?[[NaN,NaN],[NaN,NaN]]:[[xc,bc],[Mc,wc]]}var yu={sphere:lc,point:xu,lineStart:Mu,lineEnd:Su,polygonStart:function(){yu.lineStart=Tu,yu.lineEnd=Cu},polygonEnd:function(){yu.lineStart=Mu,yu.lineEnd=Su}};function xu(t,e){t*=Kl;var n=ec(e*=Kl);bu(n*ec(t),n*ic(t),ic(e))}function bu(t,e,n){++Wc,Qc+=(t-Qc)/Wc,Yc+=(e-Yc)/Wc,Zc+=(n-Zc)/Wc}function Mu(){yu.point=wu}function wu(t,e){t*=Kl;var n=ec(e*=Kl);au=n*ec(t),ou=n*ic(t),su=ic(e),yu.point=Eu,bu(au,ou,su)}function Eu(t,e){t*=Kl;var n=ec(e*=Kl),r=n*ec(t),i=n*ic(t),a=ic(e),o=tc(oc((o=ou*a-su*i)*o+(o=su*r-au*a)*o+(o=au*i-ou*r)*o),au*r+ou*i+su*a);Xc+=o,Kc+=o*(au+(au=r)),Jc+=o*(ou+(ou=i)),$c+=o*(su+(su=a)),bu(au,ou,su)}function Su(){yu.point=xu}function Tu(){yu.point=Ru}function Cu(){Pu(ru,iu),yu.point=xu}function Ru(t,e){ru=t,iu=e,t*=Kl,e*=Kl,yu.point=Pu;var n=ec(e);au=n*ec(t),ou=n*ic(t),su=ic(e),bu(au,ou,su)}function Pu(t,e){t*=Kl;var n=ec(e*=Kl),r=n*ec(t),i=n*ic(t),a=ic(e),o=ou*a-su*i,s=su*r-au*a,A=au*i-ou*r,l=rc(o,s,A),c=sc(l),u=l&&-c/l;tu.add(u*o),eu.add(u*s),nu.add(u*A),Xc+=c,Kc+=c*(au+(au=r)),Jc+=c*(ou+(ou=i)),$c+=c*(su+(su=a)),bu(au,ou,su)}function Lu(t){Wc=Xc=Qc=Yc=Zc=Kc=Jc=$c=0,tu=new Ul,eu=new Ul,nu=new Ul,pc(t,yu);var e=+tu,n=+eu,r=+nu,i=rc(e,n,r);return i<Vl&&(e=Kc,n=Jc,r=$c,Xc<jl&&(e=Qc,n=Yc,r=Zc),(i=rc(e,n,r))<Vl)?[NaN,NaN]:[tc(n,e)*Zl,sc(r/i)*Zl]}function Du(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Ou(t,e){return Jl(t)>Wl&&(t-=Math.round(t/Yl)*Yl),[t,e]}function Iu(t,e,n){return(t%=Yl)?e||n?Du(Uu(t),Nu(e,n)):Uu(t):e||n?Nu(e,n):Ou}function qu(t){return function(e,n){return Jl(e+=t)>Wl&&(e-=Math.round(e/Yl)*Yl),[e,n]}}function Uu(t){var e=qu(t);return e.invert=qu(-t),e}function Nu(t,e){var n=ec(t),r=ic(t),i=ec(e),a=ic(e);function o(t,e){var o=ec(e),s=ec(t)*o,A=ic(t)*o,l=ic(e),c=l*n+s*r;return[tc(A*i-c*a,s*n-l*r),sc(c*i+A*a)]}return o.invert=function(t,e){var o=ec(e),s=ec(t)*o,A=ic(t)*o,l=ic(e),c=l*i-A*a;return[tc(A*i+l*a,s*n+c*r),sc(c*n-s*r)]},o}function Bu(t,e){(e=Fc(e))[0]-=t,Vc(e);var n,r=(n=-e[1])>1?0:n<-1?Wl:Math.acos(n);return((-e[2]<0?-r:r)+Yl-jl)%Yl}function ku(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:lc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Fu(t,e){return Jl(t[0]-e[0])<jl&&Jl(t[1]-e[1])<jl}function zu(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Gu(t,e,n,r,i){var a,o,s=[],A=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(Fu(r,o)){if(!r[2]&&!o[2]){for(i.lineStart(),a=0;a<e;++a)i.point((r=t[a])[0],r[1]);return void i.lineEnd()}o[0]+=2*jl}s.push(n=new zu(r,t,null,!0)),A.push(n.o=new zu(r,null,n,!1)),s.push(n=new zu(o,t,null,!1)),A.push(n.o=new zu(o,null,n,!0))}})),s.length){for(A.sort(e),Hu(s),Hu(A),a=0,o=A.length;a<o;++a)A[a].e=n=!n;for(var l,c,u=s[0];;){for(var h=u,f=!0;h.v;)if((h=h.n)===u)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(a=0,o=l.length;a<o;++a)i.point((c=l[a])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(l=h.p.z,a=l.length-1;a>=0;--a)i.point((c=l[a])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,f=!f}while(!h.v);i.lineEnd()}}}function Hu(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function ju(t){return Jl(t[0])<=Wl?t[0]:ac(t[0])*((Jl(t[0])+Wl)%Yl-Wl)}function Vu(t,e){var n=ju(e),r=e[1],i=ic(r),a=[ic(n),-ec(n),0],o=0,s=0,A=new Ul;1===i?r=Xl+jl:-1===i&&(r=-Xl-jl);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=ju(f),p=f[1]/2+Ql,m=ic(p),g=ec(p),v=0;v<h;++v,d=y,m=b,g=M,f=_){var _=u[v],y=ju(_),x=_[1]/2+Ql,b=ic(x),M=ec(x),w=y-d,E=w>=0?1:-1,S=E*w,T=S>Wl,C=m*b;if(A.add(tc(C*E*ic(S),g*M+C*ec(S))),o+=T?w+E*Yl:w,T^d>=n^y>=n){var R=Gc(Fc(f),Fc(_));Vc(R);var P=Gc(a,R);Vc(P);var L=(T^w>=0?-1:1)*sc(P[2]);(r>L||r===L&&(R[0]||R[1]))&&(s+=T^w>=0?1:-1)}}return(o<-jl||o<jl&&A<-Vl)^1&s}function Wu(t,e,n,r){return function(i){var a,o,s,A=e(i),l=ku(),c=e(l),u=!1,h={point:f,lineStart:p,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=v,h.lineEnd=_,o=[],a=[]},polygonEnd:function(){h.point=f,h.lineStart=p,h.lineEnd=m,o=Gl(o);var t=Vu(a,r);o.length?(u||(i.polygonStart(),u=!0),Gu(o,Qu,t,n,i)):t&&(u||(i.polygonStart(),u=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(e,n){t(e,n)&&i.point(e,n)}function d(t,e){A.point(t,e)}function p(){h.point=d,A.lineStart()}function m(){h.point=f,A.lineEnd()}function g(t,e){s.push([t,e]),c.point(t,e)}function v(){c.lineStart(),s=[]}function _(){g(s[0][0],s[0][1]),c.lineEnd();var t,e,n,r,A=c.clean(),h=l.result(),f=h.length;if(s.pop(),a.push(s),s=null,f)if(1&A){if((e=(n=h[0]).length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else f>1&&2&A&&h.push(h.pop().concat(h.shift())),o.push(h.filter(Xu))}return h}}function Xu(t){return t.length>1}function Qu(t,e){return((t=t.x)[0]<0?t[1]-Xl-jl:Xl-t[1])-((e=e.x)[0]<0?e[1]-Xl-jl:Xl-e[1])}Ou.invert=Ou;var Yu=Wu((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Wl:-Wl,A=Jl(a-n);Jl(A-Wl)<jl?(t.point(n,r=(r+o)/2>0?Xl:-Xl),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&A>=Wl&&(Jl(n-i)<jl&&(n-=i*jl),Jl(a-s)<jl&&(a-=s*jl),r=function(t,e,n,r){var i,a,o=ic(t-n);return Jl(o)>jl?$l((ic(e)*(a=ec(r))*ic(n)-ic(r)*(i=ec(e))*ic(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Xl,r.point(-Wl,i),r.point(0,i),r.point(Wl,i),r.point(Wl,0),r.point(Wl,-i),r.point(0,-i),r.point(-Wl,-i),r.point(-Wl,0),r.point(-Wl,i);else if(Jl(t[0]-e[0])>jl){var a=t[0]<e[0]?Wl:-Wl;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])}),[-Wl,-Xl]);function Zu(t){var e=ec(t),n=2*Kl,r=e>0,i=Jl(e)>jl;function a(t,n){return ec(t)*ec(n)>e}function o(t,n,r){var i=[1,0,0],a=Gc(Fc(t),Fc(n)),o=zc(a,a),s=a[0],A=o-s*s;if(!A)return!r&&t;var l=e*o/A,c=-e*s/A,u=Gc(i,a),h=jc(i,l);Hc(h,jc(a,c));var f=u,d=zc(h,f),p=zc(f,f),m=d*d-p*(zc(h,h)-1);if(!(m<0)){var g=oc(m),v=jc(f,(-d-g)/p);if(Hc(v,h),v=kc(v),!r)return v;var _,y=t[0],x=n[0],b=t[1],M=n[1];x<y&&(_=y,y=x,x=_);var w=x-y,E=Jl(w-Wl)<jl;if(!E&&M<b&&(_=b,b=M,M=_),E||w<jl?E?b+M>0^v[1]<(Jl(v[0]-y)<jl?b:M):b<=v[1]&&v[1]<=M:w>Wl^(y<=v[0]&&v[0]<=x)){var S=jc(f,(-d+g)/p);return Hc(S,h),[v,kc(S)]}}}function s(e,n){var i=r?t:Wl-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return Wu(a,(function(t){var e,n,A,l,c;return{lineStart:function(){l=A=!1,c=1},point:function(u,h){var f,d=[u,h],p=a(u,h),m=r?p?0:s(u,h):p?s(u+(u<0?Wl:-Wl),h):0;if(!e&&(l=A=p)&&t.lineStart(),p!==A&&(!(f=o(e,d))||Fu(e,f)||Fu(d,f))&&(d[2]=1),p!==A)c=0,p?(t.lineStart(),f=o(d,e),t.point(f[0],f[1])):(f=o(e,d),t.point(f[0],f[1],2),t.lineEnd()),e=f;else if(i&&e&&r^p){var g;m&n||!(g=o(d,e,!0))||(c=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1],3)))}!p||e&&Fu(e,d)||t.point(d[0],d[1]),e=d,A=p,n=m},lineEnd:function(){A&&t.lineEnd(),e=null},clean:function(){return c|(l&&A)<<1}}}),(function(e,r,i,a){!function(t,e,n,r,i,a){if(n){var o=ec(e),s=ic(e),A=r*n;null==i?(i=e+r*Yl,a=e-A/2):(i=Bu(o,i),a=Bu(o,a),(r>0?i<a:i>a)&&(i+=r*Yl));for(var l,c=i;r>0?c>a:c<a;c-=A)l=kc([o,-s*ec(c),-s*ic(c)]),t.point(l[0],l[1])}}(a,t,n,i,e,r)}),r?[0,-t]:[-Wl,t-Wl])}var Ku,Ju,$u,th,eh=1e9,nh=-eh;function rh(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,l){var c=0,u=0;if(null==i||(c=o(i,s))!==(u=o(a,s))||A(i,a)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==u);else l.point(a[0],a[1])}function o(r,i){return Jl(r[0]-t)<jl?i>0?0:3:Jl(r[0]-n)<jl?i>0?2:1:Jl(r[1]-e)<jl?i>0?1:0:i>0?3:2}function s(t,e){return A(t.x,e.x)}function A(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var A,l,c,u,h,f,d,p,m,g,v,_=o,y=ku(),x={point:b,lineStart:function(){x.point=M,l&&l.push(c=[]);g=!0,m=!1,d=p=NaN},lineEnd:function(){A&&(M(u,h),f&&m&&y.rejoin(),A.push(y.result()));x.point=b,m&&_.lineEnd()},polygonStart:function(){_=y,A=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var a,o,s=l[n],A=1,c=s.length,u=s[0],h=u[0],f=u[1];A<c;++A)a=h,o=f,h=(u=s[A])[0],f=u[1],o<=r?f>r&&(h-a)*(r-o)>(f-o)*(t-a)&&++e:f<=r&&(h-a)*(r-o)<(f-o)*(t-a)&&--e;return e}(),n=v&&e,i=(A=Gl(A)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&Gu(A,s,e,a,o),o.polygonEnd());_=o,A=l=c=null}};function b(t,e){i(t,e)&&_.point(t,e)}function M(a,o){var s=i(a,o);if(l&&c.push([a,o]),g)u=a,h=o,f=s,g=!1,s&&(_.lineStart(),_.point(a,o));else if(s&&m)_.point(a,o);else{var A=[d=Math.max(nh,Math.min(eh,d)),p=Math.max(nh,Math.min(eh,p))],y=[a=Math.max(nh,Math.min(eh,a)),o=Math.max(nh,Math.min(eh,o))];!function(t,e,n,r,i,a){var o,s=t[0],A=t[1],l=0,c=1,u=e[0]-s,h=e[1]-A;if(o=n-s,u||!(o>0)){if(o/=u,u<0){if(o<l)return;o<c&&(c=o)}else if(u>0){if(o>c)return;o>l&&(l=o)}if(o=i-s,u||!(o<0)){if(o/=u,u<0){if(o>c)return;o>l&&(l=o)}else if(u>0){if(o<l)return;o<c&&(c=o)}if(o=r-A,h||!(o>0)){if(o/=h,h<0){if(o<l)return;o<c&&(c=o)}else if(h>0){if(o>c)return;o>l&&(l=o)}if(o=a-A,h||!(o<0)){if(o/=h,h<0){if(o>c)return;o>l&&(l=o)}else if(h>0){if(o<l)return;o<c&&(c=o)}return l>0&&(t[0]=s+l*u,t[1]=A+l*h),c<1&&(e[0]=s+c*u,e[1]=A+c*h),!0}}}}}(A,y,t,e,n,r)?s&&(_.lineStart(),_.point(a,o),v=!1):(m||(_.lineStart(),_.point(A[0],A[1])),_.point(y[0],y[1]),s||_.lineEnd(),v=!1)}d=a,p=o,m=s}return x}}var ih={sphere:lc,point:lc,lineStart:function(){ih.point=oh,ih.lineEnd=ah},lineEnd:lc,polygonStart:lc,polygonEnd:lc};function ah(){ih.point=ih.lineEnd=lc}function oh(t,e){Ju=t*=Kl,$u=ic(e*=Kl),th=ec(e),ih.point=sh}function sh(t,e){t*=Kl;var n=ic(e*=Kl),r=ec(e),i=Jl(t-Ju),a=ec(i),o=r*ic(i),s=th*n-$u*r*a,A=$u*n+th*r*a;Ku.add(tc(oc(o*o+s*s),A)),Ju=t,$u=n,th=r}var Ah=[null,null],lh={type:"LineString",coordinates:Ah};function ch(t,e){return Ah[0]=t,Ah[1]=e,function(t){return Ku=new Ul,pc(t,ih),+Ku}(lh)}var uh={Feature:function(t,e){return fh(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)if(fh(n[r].geometry,e))return!0;return!1}},hh={Sphere:function(){return!0},Point:function(t,e){return dh(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(dh(n[r],e))return!0;return!1},LineString:function(t,e){return ph(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(ph(n[r],e))return!0;return!1},Polygon:function(t,e){return mh(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(mh(n[r],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)if(fh(n[r],e))return!0;return!1}};function fh(t,e){return!(!t||!hh.hasOwnProperty(t.type))&&hh[t.type](t,e)}function dh(t,e){return 0===ch(t,e)}function ph(t,e){for(var n,r,i,a=0,o=t.length;a<o;a++){if(0===(r=ch(t[a],e)))return!0;if(a>0&&(i=ch(t[a],t[a-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Vl*i)return!0;n=r}return!1}function mh(t,e){return!!Vu(t.map(gh),vh(e))}function gh(t){return(t=t.map(vh)).pop(),t}function vh(t){return[t[0]*Kl,t[1]*Kl]}function _h(t,e,n){var r=Hl(t,e-jl,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function yh(t,e,n){var r=Hl(t,e-jl,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function xh(){return function(){var t,e,n,r,i,a,o,s,A,l,c,u,h=10,f=h,d=90,p=360,m=2.5;function g(){return{type:"MultiLineString",coordinates:v()}}function v(){return Hl(nc(r/d)*d,n,d).map(c).concat(Hl(nc(s/p)*p,o,p).map(u)).concat(Hl(nc(e/h)*h,t,h).filter((function(t){return Jl(t%d)>jl})).map(A)).concat(Hl(nc(a/f)*f,i,f).filter((function(t){return Jl(t%p)>jl})).map(l))}return g.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},g.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(u(o).slice(1),c(n).reverse().slice(1),u(s).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),g.precision(m)):[[r,s],[n,o]]},g.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),g.precision(m)):[[e,a],[t,i]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(d=+t[0],p=+t[1],g):[d,p]},g.stepMinor=function(t){return arguments.length?(h=+t[0],f=+t[1],g):[h,f]},g.precision=function(h){return arguments.length?(m=+h,A=_h(a,i,90),l=yh(e,t,m),c=_h(s,o,90),u=yh(r,n,m),g):m},g.extentMajor([[-180,-90+jl],[180,90-jl]]).extentMinor([[-180,-80-jl],[180,80+jl]])}()()}function bh(t,e){var n=t[0]*Kl,r=t[1]*Kl,i=e[0]*Kl,a=e[1]*Kl,o=ec(r),s=ic(r),A=ec(a),l=ic(a),c=o*ec(n),u=o*ic(n),h=A*ec(i),f=A*ic(i),d=2*sc(oc(Ac(a-r)+o*A*Ac(i-n))),p=ic(d),m=d?function(t){var e=ic(t*=d)/p,n=ic(d-t)/p,r=n*c+e*h,i=n*u+e*f,a=n*s+e*l;return[tc(i,r)*Zl,tc(a,oc(r*r+i*i))*Zl]}:function(){return[n*Zl,r*Zl]};return m.distance=d,m}var Mh=t=>t,wh=1/0,Eh=wh,Sh=-wh,Th=Sh;var Ch={point:function(t,e){t<wh&&(wh=t);t>Sh&&(Sh=t);e<Eh&&(Eh=e);e>Th&&(Th=e)},lineStart:lc,lineEnd:lc,polygonStart:lc,polygonEnd:lc,result:function(){var t=[[wh,Eh],[Sh,Th]];return Sh=Th=-(Eh=wh=1/0),t}};function Rh(t){return function(e){var n=new Ph;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Ph(){}function Lh(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),pc(n,t.stream(Ch)),e(Ch.result()),null!=r&&t.clipExtent(r),t}function Dh(t,e,n){return Lh(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}Ph.prototype={constructor:Ph,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Oh=16,Ih=ec(30*Kl);function qh(t,e){return+e?function(t,e){function n(r,i,a,o,s,A,l,c,u,h,f,d,p,m){var g=l-r,v=c-i,_=g*g+v*v;if(_>4*e&&p--){var y=o+h,x=s+f,b=A+d,M=oc(y*y+x*x+b*b),w=sc(b/=M),E=Jl(Jl(b)-1)<jl||Jl(a-u)<jl?(a+u)/2:tc(x,y),S=t(E,w),T=S[0],C=S[1],R=T-r,P=C-i,L=v*R-g*P;(L*L/_>e||Jl((g*R+v*P)/_-.5)>.3||o*h+s*f+A*d<Ih)&&(n(r,i,a,o,s,A,T,C,E,y/=M,x/=M,b,p,m),m.point(T,C),n(T,C,E,y,x,b,l,c,u,h,f,d,p,m))}}return function(e){var r,i,a,o,s,A,l,c,u,h,f,d,p={point:m,lineStart:g,lineEnd:_,polygonStart:function(){e.polygonStart(),p.lineStart=y},polygonEnd:function(){e.polygonEnd(),p.lineStart=g}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function g(){c=NaN,p.point=v,e.lineStart()}function v(r,i){var a=Fc([r,i]),o=t(r,i);n(c,u,l,h,f,d,c=o[0],u=o[1],l=r,h=a[0],f=a[1],d=a[2],Oh,e),e.point(c,u)}function _(){p.point=m,e.lineEnd()}function y(){g(),p.point=x,p.lineEnd=b}function x(t,e){v(r=t,e),i=c,a=u,o=h,s=f,A=d,p.point=v}function b(){n(c,u,l,h,f,d,i,a,r,o,s,A,Oh,e),p.lineEnd=_,_()}return p}}(t,e):function(t){return Rh({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Uh=Rh({point:function(t,e){this.stream.point(t*Kl,e*Kl)}});function Nh(t,e,n,r,i,a){if(!a)return function(t,e,n,r,i){function a(a,o){return[e+t*(a*=r),n-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*r,(n-o)/t*i]},a}(t,e,n,r,i);var o=ec(a),s=ic(a),A=o*t,l=s*t,c=o/t,u=s/t,h=(s*n-o*e)/t,f=(s*e+o*n)/t;function d(t,a){return[A*(t*=r)-l*(a*=i)+e,n-l*t-A*a]}return d.invert=function(t,e){return[r*(c*t-u*e+h),i*(f-u*t-c*e)]},d}function Bh(t){return function(t){var e,n,r,i,a,o,s,A,l,c,u=150,h=480,f=250,d=0,p=0,m=0,g=0,v=0,_=0,y=1,x=1,b=null,M=Yu,w=null,E=Mh,S=.5;function T(t){return A(t[0]*Kl,t[1]*Kl)}function C(t){return(t=A.invert(t[0],t[1]))&&[t[0]*Zl,t[1]*Zl]}function R(){var t=Nh(u,0,0,y,x,_).apply(null,e(d,p)),r=Nh(u,h-t[0],f-t[1],y,x,_);return n=Iu(m,g,v),s=Du(e,r),A=Du(n,s),o=qh(s,S),P()}function P(){return l=c=null,T}return T.stream=function(t){return l&&c===t?l:l=Uh(function(t){return Rh({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(o(E(c=t)))))},T.preclip=function(t){return arguments.length?(M=t,b=void 0,P()):M},T.postclip=function(t){return arguments.length?(E=t,w=r=i=a=null,P()):E},T.clipAngle=function(t){return arguments.length?(M=+t?Zu(b=t*Kl):(b=null,Yu),P()):b*Zl},T.clipExtent=function(t){return arguments.length?(E=null==t?(w=r=i=a=null,Mh):rh(w=+t[0][0],r=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==w?null:[[w,r],[i,a]]},T.scale=function(t){return arguments.length?(u=+t,R()):u},T.translate=function(t){return arguments.length?(h=+t[0],f=+t[1],R()):[h,f]},T.center=function(t){return arguments.length?(d=t[0]%360*Kl,p=t[1]%360*Kl,R()):[d*Zl,p*Zl]},T.rotate=function(t){return arguments.length?(m=t[0]%360*Kl,g=t[1]%360*Kl,v=t.length>2?t[2]%360*Kl:0,R()):[m*Zl,g*Zl,v*Zl]},T.angle=function(t){return arguments.length?(_=t%360*Kl,R()):_*Zl},T.reflectX=function(t){return arguments.length?(y=t?-1:1,R()):y<0},T.reflectY=function(t){return arguments.length?(x=t?-1:1,R()):x<0},T.precision=function(t){return arguments.length?(o=qh(s,S=t*t),P()):oc(S)},T.fitExtent=function(t,e){return Dh(T,t,e)},T.fitSize=function(t,e){return function(t,e,n){return Dh(t,[[0,0],e],n)}(T,t,e)},T.fitWidth=function(t,e){return function(t,e,n){return Lh(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])}),n)}(T,t,e)},T.fitHeight=function(t,e){return function(t,e,n){return Lh(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])}),n)}(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&C,R()}}((function(){return t}))()}function kh(t,e){var n=ec(e),r=1+ec(t)*n;return[n*ic(t)/r,ic(e)/r]}function Fh(){return Bh(kh).scale(250).clipAngle(142)}function zh(t,e,n){return e=Vh(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gh()?Reflect.construct(e,n||[],Vh(t).constructor):e.apply(t,n))}function Gh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gh=function(){return!!t})()}function Hh(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function jh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hh(r.key),r)}}function Vh(t){return Vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vh(t)}function Wh(t,e){return Wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wh(t,e)}function Xh(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Qh(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qh(t,e){if(t){if("string"==typeof t)return Yh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yh(t,e):void 0}}function Yh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}kh.invert=function(t){return function(e,n){var r=oc(e*e+n*n),i=t(r),a=ic(i),o=ec(i);return[tc(e*a,r*o),sc(r&&n*a/r)]}}((function(t){return 2*$l(t)}));var Zh=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){var i=180*ch(r,n)/Math.PI;if(i>t)for(var a=bh(n,r),o=1/Math.ceil(i/t),s=o;s<1;)e.push(a(s)),s+=o}e.push(n=r)})),e},Kh="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:Hn,Float32BufferAttribute:qn},Jh=(new Kh.BufferGeometry).setAttribute?"setAttribute":"addAttribute",$h=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=zh(this,e)).type="GeoJsonGeometry",n.parameters={geoJson:t,radius:r,resolution:i};var a=({Point:l,MultiPoint:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return l(t,e)})).forEach((function(t){var e=Xh(t,1)[0];tf(n,e)})),[n]},LineString:c,MultiLineString:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return c(t,e)})).forEach((function(t){var e=Xh(t,1)[0];tf(n,e)})),[n]},Polygon:u,MultiPolygon:function(t,e){var n={vertices:[],indices:[]},r={vertices:[],indices:[]};t.map((function(t){return u(t,e)})).forEach((function(t){var e=Xh(t,2),i=e[0],a=e[1];tf(n,i),a&&tf(r,a)}));var i=[n];return r.vertices.length&&i.push(r),i}}[t.type]||function(){return[]})(t.coordinates,r),o=[],s=[],A=0;function l(t,e){return[{vertices:nf(t[1],t[0],e),indices:[]}]}function c(t,e){for(var n=Zh(t,i).map((function(t){var n=Xh(t,2),r=n[0];return nf(n[1],r,e)})),r=Rl.flatten([n]).vertices,a=Math.round(r.length/3),o=[],s=1;s<a;s++)o.push(s-1,s);return[{vertices:r,indices:o}]}function u(t,e){for(var n=t.map((function(t){return Zh(t,i).map((function(t){var n=Xh(t,2),r=n[0];return nf(n[1],r,e)}))})),r=Rl.flatten(n),a=r.vertices,o=r.holes,s=o[0]||1/0,A=a.slice(0,3*s),l=a.slice(3*s),c=new Set(o),u=Math.round(a.length/3),h=[],f=[],d=1;d<u;d++)c.has(d)||(d<s?h.push(d-1,d):f.push(d-1-s,d-s));var p=[{indices:h,vertices:A}];return o.length&&p.push({indices:f,vertices:l}),p}return a.forEach((function(t){var e=o.length;tf({indices:o,vertices:s},t),n.addGroup(e,o.length-e,A++)})),o.length&&n.setIndex(o),s.length&&n[Jh]("position",new Kh.Float32BufferAttribute(s,3)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wh(t,e)}(e,t),n=e,r&&jh(n.prototype,r),i&&jh(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(Kh.BufferGeometry);function tf(t,e){var n=Math.round(t.vertices.length/3);ef(t.vertices,e.vertices),ef(t.indices,e.indices.map((function(t){return t+n})))}function ef(t,e){var n,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Qh(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.push(i)}}catch(t){r.e(t)}finally{r.f()}}function nf(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}function rf(t){let e,n,r,i=-1,a=0;for(let o=0;o<t.length;++o){const s=t[o];if(void 0===e&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=s.itemSize),n!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=s.normalized),r!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===i&&(i=s.gpuType),i!==s.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;a+=s.count*n}const o=new e(a),s=new Dn(o,n,r);let A=0;for(let e=0;e<t.length;++e){const r=t[e];if(r.isInterleavedBufferAttribute){const t=A/n;for(let e=0,i=r.count;e<i;e++)for(let i=0;i<n;i++){const n=r.getComponent(e,i);s.setComponent(e+t,i,n)}}else o.set(r.array,A);A+=r.count*n}return void 0!==i&&(s.gpuType=i),s}function af(t){const e=t.data.array.constructor,n=t.count,r=t.itemSize,i=t.normalized,a=new e(n*r);let o;o=t.isInstancedInterleavedBufferAttribute?new wo(a,r,i,t.meshPerAttribute):new Dn(a,r,i);for(let e=0;e<n;e++)o.setX(e,t.getX(e)),r>=2&&o.setY(e,t.getY(e)),r>=3&&o.setZ(e,t.getZ(e)),r>=4&&o.setW(e,t.getW(e));return o}var of=Object.freeze({__proto__:null,computeMikkTSpaceTangents:function(t,e,n=!0){if(!e||!e.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!t.hasAttribute("position")||!t.hasAttribute("normal")||!t.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function r(t){if(t.normalized||t.isInterleavedBufferAttribute){const e=new Float32Array(t.count*t.itemSize);for(let n=0,r=0;n<t.count;n++)e[r++]=t.getX(n),e[r++]=t.getY(n),t.itemSize>2&&(e[r++]=t.getZ(n));return e}return t.array instanceof Float32Array?t.array:new Float32Array(t.array)}const i=t.index?t.toNonIndexed():t,a=e.generateTangents(r(i.attributes.position),r(i.attributes.normal),r(i.attributes.uv));if(n)for(let t=3;t<a.length;t+=4)a[t]*=-1;return i.setAttribute("tangent",new Dn(a,4)),t!==i&&t.copy(i),t},computeMorphedAttributes:function(t){const e=new ae,n=new ae,r=new ae,i=new ae,a=new ae,o=new ae,s=new ae,A=new ae,l=new ae;function c(t,c,u,h,f,d,p,m){e.fromBufferAttribute(c,f),n.fromBufferAttribute(c,d),r.fromBufferAttribute(c,p);const g=t.morphTargetInfluences;if(u&&g){s.set(0,0,0),A.set(0,0,0),l.set(0,0,0);for(let t=0,c=u.length;t<c;t++){const c=g[t],m=u[t];0!==c&&(i.fromBufferAttribute(m,f),a.fromBufferAttribute(m,d),o.fromBufferAttribute(m,p),h?(s.addScaledVector(i,c),A.addScaledVector(a,c),l.addScaledVector(o,c)):(s.addScaledVector(i.sub(e),c),A.addScaledVector(a.sub(n),c),l.addScaledVector(o.sub(r),c)))}e.add(s),n.add(A),r.add(l)}t.isSkinnedMesh&&(t.applyBoneTransform(f,e),t.applyBoneTransform(d,n),t.applyBoneTransform(p,r)),m[3*f+0]=e.x,m[3*f+1]=e.y,m[3*f+2]=e.z,m[3*d+0]=n.x,m[3*d+1]=n.y,m[3*d+2]=n.z,m[3*p+0]=r.x,m[3*p+1]=r.y,m[3*p+2]=r.z}const u=t.geometry,h=t.material;let f,d,p;const m=u.index,g=u.attributes.position,v=u.morphAttributes.position,_=u.morphTargetsRelative,y=u.attributes.normal,x=u.morphAttributes.position,b=u.groups,M=u.drawRange;let w,E,S,T,C,R,P;const L=new Float32Array(g.count*g.itemSize),D=new Float32Array(y.count*y.itemSize);if(null!==m)if(Array.isArray(h))for(w=0,S=b.length;w<S;w++)for(C=b[w],R=Math.max(C.start,M.start),P=Math.min(C.start+C.count,M.start+M.count),E=R,T=P;E<T;E+=3)f=m.getX(E),d=m.getX(E+1),p=m.getX(E+2),c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);else for(R=Math.max(0,M.start),P=Math.min(m.count,M.start+M.count),w=R,S=P;w<S;w+=3)f=m.getX(w),d=m.getX(w+1),p=m.getX(w+2),c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);else if(Array.isArray(h))for(w=0,S=b.length;w<S;w++)for(C=b[w],R=Math.max(C.start,M.start),P=Math.min(C.start+C.count,M.start+M.count),E=R,T=P;E<T;E+=3)f=E,d=E+1,p=E+2,c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);else for(R=Math.max(0,M.start),P=Math.min(g.count,M.start+M.count),w=R,S=P;w<S;w+=3)f=w,d=w+1,p=w+2,c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);return{positionAttribute:g,normalAttribute:y,morphedPositionAttribute:new qn(L,3),morphedNormalAttribute:new qn(D,3)}},deepCloneAttribute:function(t){return t.isInstancedInterleavedBufferAttribute||t.isInterleavedBufferAttribute?af(t):t.isInstancedBufferAttribute?(new wo).copy(t):(new Dn).copy(t)},deinterleaveAttribute:af,deinterleaveGeometry:function(t){const e=t.attributes,n=t.morphTargets,r=new Map;for(const t in e){const n=e[t];n.isInterleavedBufferAttribute&&(r.has(n)||r.set(n,af(n)),e[t]=r.get(n))}for(const t in n){const e=n[t];e.isInterleavedBufferAttribute&&(r.has(e)||r.set(e,af(e)),n[t]=r.get(e))}},estimateBytesUsed:function(t){let e=0;for(const n in t.attributes){const r=t.getAttribute(n);e+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}const n=t.getIndex();return e+=n?n.count*n.itemSize*n.array.BYTES_PER_ELEMENT:0,e},interleaveAttributes:function(t){let e,n=0,r=0;for(let i=0,a=t.length;i<a;++i){const a=t[i];if(void 0===e&&(e=a.array.constructor),e!==a.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=a.array.length,r+=a.itemSize}const i=new xo(new e(n),r);let a=0;const o=[],s=["getX","getY","getZ","getW"],A=["setX","setY","setZ","setW"];for(let e=0,n=t.length;e<n;e++){const n=t[e],r=n.itemSize,l=n.count,c=new Mo(i,r,a,n.normalized);o.push(c),a+=r;for(let t=0;t<l;t++)for(let e=0;e<r;e++)c[A[e]](t,n[s[e]](t))}return o},mergeAttributes:rf,mergeGeometries:function(t,e=!1){const n=null!==t[0].index,r=new Set(Object.keys(t[0].attributes)),i=new Set(Object.keys(t[0].morphAttributes)),a={},o={},s=t[0].morphTargetsRelative,A=new Hn;let l=0;for(let c=0;c<t.length;++c){const u=t[c];let h=0;if(n!==(null!==u.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const t in u.attributes){if(!r.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+'. All geometries must have compatible attributes; make sure "'+t+'" attribute exists among all geometries, or in none of them.'),null;void 0===a[t]&&(a[t]=[]),a[t].push(u.attributes[t]),h++}if(h!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". Make sure all geometries have the same number of attributes."),null;if(s!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const t in u.morphAttributes){if(!i.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+".  .morphAttributes must be consistent throughout all geometries."),null;void 0===o[t]&&(o[t]=[]),o[t].push(u.morphAttributes[t])}if(e){let t;if(n)t=u.index.count;else{if(void 0===u.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". The geometry must have either an index or a position attribute"),null;t=u.attributes.position.count}A.addGroup(l,t,c),l+=t}}if(n){let e=0;const n=[];for(let r=0;r<t.length;++r){const i=t[r].index;for(let t=0;t<i.count;++t)n.push(i.getX(t)+e);e+=t[r].attributes.position.count}A.setIndex(n)}for(const t in a){const e=rf(a[t]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;A.setAttribute(t,e)}for(const t in o){const e=o[t][0].length;if(0===e)break;A.morphAttributes=A.morphAttributes||{},A.morphAttributes[t]=[];for(let n=0;n<e;++n){const e=[];for(let r=0;r<o[t].length;++r)e.push(o[t][r][n]);const r=rf(e);if(!r)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;A.morphAttributes[t].push(r)}}return A},mergeGroups:function(t){if(0===t.groups.length)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),t;let e=t.groups;if(e=e.sort(((t,e)=>t.materialIndex!==e.materialIndex?t.materialIndex-e.materialIndex:t.start-e.start)),null===t.getIndex()){const e=t.getAttribute("position"),n=[];for(let t=0;t<e.count;t+=3)n.push(t,t+1,t+2);t.setIndex(n)}const n=t.getIndex(),r=[];for(let t=0;t<e.length;t++){const i=e[t],a=i.start,o=a+i.count;for(let t=a;t<o;t++)r.push(n.getX(t))}t.dispose(),t.setIndex(r);let i=0;for(let t=0;t<e.length;t++){const n=e[t];n.start=i,i+=n.count}let a=e[0];t.groups=[a];for(let n=1;n<e.length;n++){const r=e[n];a.materialIndex===r.materialIndex?a.count+=r.count:(a=r,t.groups.push(a))}return t},mergeVertices:function(t,e=1e-4){e=Math.max(e,Number.EPSILON);const n={},r=t.getIndex(),i=t.getAttribute("position"),a=r?r.count:i.count;let o=0;const s=Object.keys(t.attributes),A={},l={},c=[],u=["getX","getY","getZ","getW"],h=["setX","setY","setZ","setW"];for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.attributes[n];A[n]=new Dn(new r.array.constructor(r.count*r.itemSize),r.itemSize,r.normalized);const i=t.morphAttributes[n];i&&(l[n]=new Dn(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized))}const f=.5*e,d=Math.log10(1/e),p=Math.pow(10,d),m=f*p;for(let e=0;e<a;e++){const i=r?r.getX(e):e;let a="";for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.getAttribute(n),o=r.itemSize;for(let t=0;t<o;t++)a+=~~(r[u[t]](i)*p+m)+","}if(a in n)c.push(n[a]);else{for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.getAttribute(n),a=t.morphAttributes[n],c=r.itemSize,f=A[n],d=l[n];for(let t=0;t<c;t++){const e=u[t],n=h[t];if(f[n](o,r[e](i)),a)for(let t=0,r=a.length;t<r;t++)d[t][n](o,a[t][e](i))}}n[a]=o,c.push(o),o++}}const g=t.clone();for(const e in t.attributes){const t=A[e];if(g.setAttribute(e,new Dn(t.array.slice(0,o*t.itemSize),t.itemSize,t.normalized)),e in l)for(let t=0;t<l[e].length;t++){const n=l[e][t];g.morphAttributes[e][t]=new Dn(n.array.slice(0,o*n.itemSize),n.itemSize,n.normalized)}}return g.setIndex(c),g},toCreasedNormals:function(t,e=Math.PI/3){const n=Math.cos(e),r=100*(1+1e-10),i=[new ae,new ae,new ae],a=new ae,o=new ae,s=new ae,A=new ae;function l(t){return`${~~(t.x*r)},${~~(t.y*r)},${~~(t.z*r)}`}const c=t.index?t.toNonIndexed():t,u=c.attributes.position,h={};for(let t=0,e=u.count/3;t<e;t++){const e=3*t,n=i[0].fromBufferAttribute(u,e+0),r=i[1].fromBufferAttribute(u,e+1),s=i[2].fromBufferAttribute(u,e+2);a.subVectors(s,r),o.subVectors(n,r);const A=(new ae).crossVectors(a,o).normalize();for(let t=0;t<3;t++){const e=l(i[t]);e in h||(h[e]=[]),h[e].push(A)}}const f=new Float32Array(3*u.count),d=new Dn(f,3,!1);for(let t=0,e=u.count/3;t<e;t++){const e=3*t,r=i[0].fromBufferAttribute(u,e+0),c=i[1].fromBufferAttribute(u,e+1),f=i[2].fromBufferAttribute(u,e+2);a.subVectors(f,c),o.subVectors(r,c),s.crossVectors(a,o).normalize();for(let t=0;t<3;t++){const r=h[l(i[t])];A.set(0,0,0);for(let t=0,e=r.length;t<e;t++){const e=r[t];s.dot(e)>n&&A.add(e)}A.normalize(),d.setXYZ(e+t,A.x,A.y,A.z)}}return c.setAttribute("normal",d),c},toTrianglesDrawMode:function(t,e){if(0===e)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(2===e||1===e){let n=t.getIndex();if(null===n){const e=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<r.count;t++)e.push(t);t.setIndex(e),n=t.getIndex()}const r=n.count-2,i=[];if(2===e)for(let t=1;t<=r;t++)i.push(n.getX(0)),i.push(n.getX(t)),i.push(n.getX(t+1));else for(let t=0;t<r;t++)t%2==0?(i.push(n.getX(t)),i.push(n.getX(t+1)),i.push(n.getX(t+2))):(i.push(n.getX(t+2)),i.push(n.getX(t+1)),i.push(n.getX(t)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=t.clone();return a.setIndex(i),a.clearGroups(),a}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}}),sf=function(t){return"function"==typeof t?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}};function Af(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function lf(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function cf(){}var uf=.7,hf=1/uf,ff="\\s*([+-]?\\d+)\\s*",df="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mf=/^#([0-9a-f]{3,8})$/,gf=new RegExp(`^rgb\\(${ff},${ff},${ff}\\)$`),vf=new RegExp(`^rgb\\(${pf},${pf},${pf}\\)$`),_f=new RegExp(`^rgba\\(${ff},${ff},${ff},${df}\\)$`),yf=new RegExp(`^rgba\\(${pf},${pf},${pf},${df}\\)$`),xf=new RegExp(`^hsl\\(${df},${pf},${pf}\\)$`),bf=new RegExp(`^hsla\\(${df},${pf},${pf},${df}\\)$`),Mf={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};function wf(){return this.rgb().formatHex()}function Ef(){return this.rgb().formatRgb()}function Sf(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=mf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Tf(e):3===n?new Pf(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Cf(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Cf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=gf.exec(t))?new Pf(e[1],e[2],e[3],1):(e=vf.exec(t))?new Pf(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=_f.exec(t))?Cf(e[1],e[2],e[3],e[4]):(e=yf.exec(t))?Cf(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xf.exec(t))?Uf(e[1],e[2]/100,e[3]/100,1):(e=bf.exec(t))?Uf(e[1],e[2]/100,e[3]/100,e[4]):Mf.hasOwnProperty(t)?Tf(Mf[t]):"transparent"===t?new Pf(NaN,NaN,NaN,0):null}function Tf(t){return new Pf(t>>16&255,t>>8&255,255&t,1)}function Cf(t,e,n,r){return r<=0&&(t=e=n=NaN),new Pf(t,e,n,r)}function Rf(t,e,n,r){return 1===arguments.length?((i=t)instanceof cf||(i=Sf(i)),i?new Pf((i=i.rgb()).r,i.g,i.b,i.opacity):new Pf):new Pf(t,e,n,null==r?1:r);var i}function Pf(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Lf(){return`#${qf(this.r)}${qf(this.g)}${qf(this.b)}`}function Df(){const t=Of(this.opacity);return`${1===t?"rgb(":"rgba("}${If(this.r)}, ${If(this.g)}, ${If(this.b)}${1===t?")":`, ${t})`}`}function Of(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function If(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function qf(t){return((t=If(t))<16?"0":"")+t.toString(16)}function Uf(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Bf(t,e,n,r)}function Nf(t){if(t instanceof Bf)return new Bf(t.h,t.s,t.l,t.opacity);if(t instanceof cf||(t=Sf(t)),!t)return new Bf;if(t instanceof Bf)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,A=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=A<.5?a+i:2-a-i,o*=60):s=A>0&&A<1?0:o,new Bf(o,s,A,t.opacity)}function Bf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function kf(t){return(t=(t||0)%360)<0?t+360:t}function Ff(t){return Math.max(0,Math.min(1,t||0))}function zf(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Gf(t){return Gf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(t)}Af(cf,Sf,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:wf,formatHex:wf,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Nf(this).formatHsl()},formatRgb:Ef,toString:Ef}),Af(Pf,Rf,lf(cf,{brighter(t){return t=null==t?hf:Math.pow(hf,t),new Pf(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?uf:Math.pow(uf,t),new Pf(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Pf(If(this.r),If(this.g),If(this.b),Of(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Lf,formatHex:Lf,formatHex8:function(){return`#${qf(this.r)}${qf(this.g)}${qf(this.b)}${qf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Df,toString:Df})),Af(Bf,(function(t,e,n,r){return 1===arguments.length?Nf(t):new Bf(t,e,n,null==r?1:r)}),lf(cf,{brighter(t){return t=null==t?hf:Math.pow(hf,t),new Bf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?uf:Math.pow(uf,t),new Bf(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Pf(zf(t>=240?t-240:t+120,i,r),zf(t,i,r),zf(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Bf(kf(this.h),Ff(this.s),Ff(this.l),Of(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Of(this.opacity);return`${1===t?"hsl(":"hsla("}${kf(this.h)}, ${100*Ff(this.s)}%, ${100*Ff(this.l)}%${1===t?")":`, ${t})`}`}}));var Hf=/^\s+/,jf=/\s+$/;function Vf(t,e){if(e=e||{},(t=t||"")instanceof Vf)return t;if(!(this instanceof Vf))return new Vf(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;"string"==typeof t&&(t=function(t){t=t.replace(Hf,"").replace(jf,"").toLowerCase();var e,n=!1;if(Ad[t])t=Ad[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=xd.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=xd.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=xd.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=xd.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=xd.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=xd.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=xd.hex8.exec(t))return{r:fd(e[1]),g:fd(e[2]),b:fd(e[3]),a:gd(e[4]),format:n?"name":"hex8"};if(e=xd.hex6.exec(t))return{r:fd(e[1]),g:fd(e[2]),b:fd(e[3]),format:n?"name":"hex"};if(e=xd.hex4.exec(t))return{r:fd(e[1]+""+e[1]),g:fd(e[2]+""+e[2]),b:fd(e[3]+""+e[3]),a:gd(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=xd.hex3.exec(t))return{r:fd(e[1]+""+e[1]),g:fd(e[2]+""+e[2]),b:fd(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==Gf(t)&&(bd(t.r)&&bd(t.g)&&bd(t.b)?(A=t.r,l=t.g,c=t.b,e={r:255*ud(A,255),g:255*ud(l,255),b:255*ud(c,255)},o=!0,s="%"===String(t.r).substr(-1)?"prgb":"rgb"):bd(t.h)&&bd(t.s)&&bd(t.v)?(r=pd(t.s),i=pd(t.v),e=function(t,e,n){t=6*ud(t,360),e=ud(e,100),n=ud(n,100);var r=Math.floor(t),i=t-r,a=n*(1-e),o=n*(1-i*e),s=n*(1-(1-i)*e),A=r%6,l=[n,o,a,a,s,n][A],c=[s,n,n,o,a,a][A],u=[a,a,s,n,n,o][A];return{r:255*l,g:255*c,b:255*u}}(t.h,r,i),o=!0,s="hsv"):bd(t.h)&&bd(t.s)&&bd(t.l)&&(r=pd(t.s),a=pd(t.l),e=function(t,e,n){var r,i,a;function o(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=ud(t,360),e=ud(e,100),n=ud(n,100),0===e)r=i=a=n;else{var s=n<.5?n*(1+e):n+e-n*e,A=2*n-s;r=o(A,s,t+1/3),i=o(A,s,t),a=o(A,s,t-1/3)}return{r:255*r,g:255*i,b:255*a}}(t.h,r,a),o=!0,s="hsl"),t.hasOwnProperty("a")&&(n=t.a));var A,l,c;return n=cd(n),{ok:o,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Wf(t,e,n){t=ud(t,255),e=ud(e,255),n=ud(n,255);var r,i,a=Math.max(t,e,n),o=Math.min(t,e,n),s=(a+o)/2;if(a==o)r=i=0;else{var A=a-o;switch(i=s>.5?A/(2-a-o):A/(a+o),a){case t:r=(e-n)/A+(e<n?6:0);break;case e:r=(n-t)/A+2;break;case n:r=(t-e)/A+4}r/=6}return{h:r,s:i,l:s}}function Xf(t,e,n){t=ud(t,255),e=ud(e,255),n=ud(n,255);var r,i,a=Math.max(t,e,n),o=Math.min(t,e,n),s=a,A=a-o;if(i=0===a?0:A/a,a==o)r=0;else{switch(a){case t:r=(e-n)/A+(e<n?6:0);break;case e:r=(n-t)/A+2;break;case n:r=(t-e)/A+4}r/=6}return{h:r,s:i,v:s}}function Qf(t,e,n,r){var i=[dd(Math.round(t).toString(16)),dd(Math.round(e).toString(16)),dd(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Yf(t,e,n,r){return[dd(md(r)),dd(Math.round(t).toString(16)),dd(Math.round(e).toString(16)),dd(Math.round(n).toString(16))].join("")}function Zf(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.s-=e/100,n.s=hd(n.s),Vf(n)}function Kf(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.s+=e/100,n.s=hd(n.s),Vf(n)}function Jf(t){return Vf(t).desaturate(100)}function $f(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.l+=e/100,n.l=hd(n.l),Vf(n)}function td(t,e){e=0===e?0:e||10;var n=Vf(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),Vf(n)}function ed(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.l-=e/100,n.l=hd(n.l),Vf(n)}function nd(t,e){var n=Vf(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,Vf(n)}function rd(t){var e=Vf(t).toHsl();return e.h=(e.h+180)%360,Vf(e)}function id(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Vf(t).toHsl(),r=[Vf(t)],i=360/e,a=1;a<e;a++)r.push(Vf({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function ad(t){var e=Vf(t).toHsl(),n=e.h;return[Vf(t),Vf({h:(n+72)%360,s:e.s,l:e.l}),Vf({h:(n+216)%360,s:e.s,l:e.l})]}function od(t,e,n){e=e||6,n=n||30;var r=Vf(t).toHsl(),i=360/n,a=[Vf(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(Vf(r));return a}function sd(t,e){e=e||6;for(var n=Vf(t).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/e;e--;)o.push(Vf({h:r,s:i,v:a})),a=(a+s)%1;return o}Vf.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=cd(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Xf(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Xf(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=Wf(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Wf(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return Qf(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var a=[dd(Math.round(t).toString(16)),dd(Math.round(e).toString(16)),dd(Math.round(n).toString(16)),dd(md(r))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*ud(this._r,255))+"%",g:Math.round(100*ud(this._g,255))+"%",b:Math.round(100*ud(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*ud(this._r,255))+"%, "+Math.round(100*ud(this._g,255))+"%, "+Math.round(100*ud(this._b,255))+"%)":"rgba("+Math.round(100*ud(this._r,255))+"%, "+Math.round(100*ud(this._g,255))+"%, "+Math.round(100*ud(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ld[Qf(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+Yf(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=Vf(t);n="#"+Yf(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Vf(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification($f,arguments)},brighten:function(){return this._applyModification(td,arguments)},darken:function(){return this._applyModification(ed,arguments)},desaturate:function(){return this._applyModification(Zf,arguments)},saturate:function(){return this._applyModification(Kf,arguments)},greyscale:function(){return this._applyModification(Jf,arguments)},spin:function(){return this._applyModification(nd,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(od,arguments)},complement:function(){return this._applyCombination(rd,arguments)},monochromatic:function(){return this._applyCombination(sd,arguments)},splitcomplement:function(){return this._applyCombination(ad,arguments)},triad:function(){return this._applyCombination(id,[3])},tetrad:function(){return this._applyCombination(id,[4])}},Vf.fromRatio=function(t,e){if("object"==Gf(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:pd(t[r]));t=n}return Vf(t,e)},Vf.equals=function(t,e){return!(!t||!e)&&Vf(t).toRgbString()==Vf(e).toRgbString()},Vf.random=function(){return Vf.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Vf.mix=function(t,e,n){n=0===n?0:n||50;var r=Vf(t).toRgb(),i=Vf(e).toRgb(),a=n/100;return Vf({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},
     1// Version 2.33.1 globe.gl - https://github.com/vasturiano/globe.gl
     2!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Globe=e()}(this,(function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function e(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function i(t){for(var i=1;i<arguments.length;i++){var r=null!=arguments[i]?arguments[i]:{};i%2?n(Object(r),!0).forEach((function(n){e(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function r(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}(".scene-container .clickable {\n  cursor: pointer;\n}");const s="169",a={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o=0,l=1,u=2,h=3,c=0,A=1,d=2,p=100,f=101,m=102,g=200,y=201,v=202,_=203,x=204,b=205,S=206,M=207,w=208,T=209,E=210,C=211,R=212,N=213,P=214,D=0,I=1,L=2,B=3,U=4,O=5,F=6,k=7,z=301,q=302,G=306,V=1e3,H=1001,j=1002,W=1003,X=1004,Y=1005,Q=1006,$=1007,Z=1008,K=1009,J=1010,tt=1011,et=1012,nt=1013,it=1014,rt=1015,st=1016,at=1017,ot=1018,lt=1020,ut=35902,ht=1023,ct=1026,At=1027,dt=1029,pt=1031,ft=1033,mt=33776,gt=33777,yt=33778,vt=33779,_t=35840,xt=35841,bt=35842,St=35843,Mt=36196,wt=37492,Tt=37496,Et=37808,Ct=37809,Rt=37810,Nt=37811,Pt=37812,Dt=37813,It=37814,Lt=37815,Bt=37816,Ut=37817,Ot=37818,Ft=37819,kt=37820,zt=37821,qt=36492,Gt=36494,Vt=36495,Ht=36284,jt=36285,Wt=36286,Xt="",Yt="srgb",Qt="srgb-linear",$t="display-p3",Zt="display-p3-linear",Kt="linear",Jt="srgb",te="rec709",ee="p3",ne=7680,ie=512,re=513,se=514,ae=515,oe=516,le=517,ue=518,he=519,ce=35044,Ae="300 es",de=2e3,pe=2001;let fe=class{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e<i;e++)n[e].call(this,t);t.target=null}}};const me=["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 ge=1234567;const ye=Math.PI/180,ve=180/Math.PI;function _e(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(me[255&t]+me[t>>8&255]+me[t>>16&255]+me[t>>24&255]+"-"+me[255&e]+me[e>>8&255]+"-"+me[e>>16&15|64]+me[e>>24&255]+"-"+me[63&n|128]+me[n>>8&255]+"-"+me[n>>16&255]+me[n>>24&255]+me[255&i]+me[i>>8&255]+me[i>>16&255]+me[i>>24&255]).toLowerCase()}function xe(t,e,n){return Math.max(e,Math.min(n,t))}function be(t,e){return(t%e+e)%e}function Se(t,e,n){return(1-n)*t+n*e}function Me(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function we(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Te={DEG2RAD:ye,RAD2DEG:ve,generateUUID:_e,clamp:xe,euclideanModulo:be,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Se,damp:function(t,e,n,i){return Se(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(be(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(ge=t);let e=ge+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*ye},radToDeg:function(t){return t*ve},isPowerOfTwo:function(t){return!(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),u=s((e+i)/2),h=a((e+i)/2),c=s((e-i)/2),A=a((e-i)/2),d=s((i-e)/2),p=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*c,l*A,o*u);break;case"YZY":t.set(l*A,o*h,l*c,o*u);break;case"ZXZ":t.set(l*c,l*A,o*h,o*u);break;case"XZX":t.set(o*h,l*p,l*d,o*u);break;case"YXY":t.set(l*d,o*h,l*p,o*u);break;case"ZYZ":t.set(l*p,l*d,o*h,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:we,denormalize:Me};let Ee=class t{constructor(e=0,n=0){t.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(xe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Ce=class t{constructor(e,n,i,r,s,a,o,l,u){t.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,n,i,r,s,a,o,l,u)}set(t,e,n,i,r,s,a,o,l){const u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=r,u[5]=o,u[6]=n,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],u=n[4],h=n[7],c=n[2],A=n[5],d=n[8],p=i[0],f=i[3],m=i[6],g=i[1],y=i[4],v=i[7],_=i[2],x=i[5],b=i[8];return r[0]=s*p+a*g+o*_,r[3]=s*f+a*y+o*x,r[6]=s*m+a*v+o*b,r[1]=l*p+u*g+h*_,r[4]=l*f+u*y+h*x,r[7]=l*m+u*v+h*b,r[2]=c*p+A*g+d*_,r[5]=c*f+A*y+d*x,r[8]=c*m+A*v+d*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8];return e*s*u-e*a*l-n*r*u+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],h=u*s-a*l,c=a*o-u*r,A=l*r-s*o,d=e*h+n*c+i*A;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;return t[0]=h*p,t[1]=(i*l-u*n)*p,t[2]=(a*n-i*s)*p,t[3]=c*p,t[4]=(u*e-i*o)*p,t[5]=(i*r-a*e)*p,t[6]=A*p,t[7]=(n*o-l*e)*p,t[8]=(s*e-n*r)*p,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Re.makeScale(t,e)),this}rotate(t){return this.premultiply(Re.makeRotation(-t)),this}translate(t,e){return this.premultiply(Re.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}};const Re=new Ce;function Ne(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Pe(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function De(){const t=Pe("canvas");return t.style.display="block",t}const Ie={};function Le(t){t in Ie||(Ie[t]=!0,console.warn(t))}const Be=(new Ce).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Ue=(new Ce).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Oe={[Qt]:{transfer:Kt,primaries:te,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t,fromReference:t=>t},[Yt]:{transfer:Jt,primaries:te,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Zt]:{transfer:Kt,primaries:ee,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.applyMatrix3(Ue),fromReference:t=>t.applyMatrix3(Be)},[$t]:{transfer:Jt,primaries:ee,luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.convertSRGBToLinear().applyMatrix3(Ue),fromReference:t=>t.applyMatrix3(Be).convertLinearToSRGB()}},Fe=new Set([Qt,Zt]),ke={enabled:!0,_workingColorSpace:Qt,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Fe.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=Oe[e].toReference;return(0,Oe[n].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Oe[t].primaries},getTransfer:function(t){return t===Xt?Kt:Oe[t].transfer},getLuminanceCoefficients:function(t,e=this._workingColorSpace){return t.fromArray(Oe[e].luminanceCoefficients)}};function ze(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function qe(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let Ge,Ve=class{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Ge&&(Ge=Pe("canvas")),Ge.width=t.width,Ge.height=t.height;const n=Ge.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Ge}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Pe("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t<r.length;t++)r[t]=255*ze(r[t]/255);return n.putImageData(i,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*ze(e[t]/255)):e[t]=ze(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},He=0,je=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:He++}),this.uuid=_e(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(We(i[e].image)):t.push(We(i[e]))}else t=We(i);n.url=t}return e||(t.images[this.uuid]=n),n}};function We(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Ve.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Xe=0,Ye=class t extends fe{constructor(e=t.DEFAULT_IMAGE,n=t.DEFAULT_MAPPING,i=1001,r=1001,s=1006,a=1008,o=1023,l=1009,u=t.DEFAULT_ANISOTROPY,h=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Xe++}),this.uuid=_e(),this.name="",this.source=new je(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Ee(0,0),this.repeat=new Ee(1,1),this.center=new Ee(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ce,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).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&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case V:t.x=t.x-Math.floor(t.x);break;case H:t.x=t.x<0?0:1;break;case j:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case V:t.y=t.y-Math.floor(t.y);break;case H:t.y=t.y<0?0:1;break;case j:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}};Ye.DEFAULT_IMAGE=null,Ye.DEFAULT_MAPPING=300,Ye.DEFAULT_ANISOTROPY=1;let Qe=class t{constructor(e=0,n=0,i=0,r=1){t.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],u=o[4],h=o[8],c=o[1],A=o[5],d=o[9],p=o[2],f=o[6],m=o[10];if(Math.abs(u-c)<s&&Math.abs(h-p)<s&&Math.abs(d-f)<s){if(Math.abs(u+c)<a&&Math.abs(h+p)<a&&Math.abs(d+f)<a&&Math.abs(l+A+m-3)<a)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,o=(A+1)/2,g=(m+1)/2,y=(u+c)/4,v=(h+p)/4,_=(d+f)/4;return t>o&&t>g?t<s?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=y/n,r=v/n):o>g?o<s?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(o),n=y/i,r=_/i):g<s?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(g),n=v/r,i=_/r),this.set(n,i,r,e),this}let g=Math.sqrt((f-d)*(f-d)+(h-p)*(h-p)+(c-u)*(c-u));return Math.abs(g)<.001&&(g=1),this.x=(f-d)/g,this.y=(h-p)/g,this.z=(c-u)/g,this.w=Math.acos((l+A+m-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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}},$e=class extends fe{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Qe(0,0,t,e),this.scissorTest=!1,this.viewport=new Qe(0,0,t,e);const i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Q,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new Ye(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const s=n.count;for(let t=0;t<s;t++)this.textures[t]=r.clone(),this.textures[t].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++)this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new je(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},Ze=class extends $e{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},Ke=class extends Ye{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=W,this.minFilter=W,this.wrapR=H,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}};class Je extends Ye{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=W,this.minFilter=W,this.wrapR=H,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let tn=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,s,a){let o=n[i+0],l=n[i+1],u=n[i+2],h=n[i+3];const c=r[s+0],A=r[s+1],d=r[s+2],p=r[s+3];if(0===a)return t[e+0]=o,t[e+1]=l,t[e+2]=u,void(t[e+3]=h);if(1===a)return t[e+0]=c,t[e+1]=A,t[e+2]=d,void(t[e+3]=p);if(h!==p||o!==c||l!==A||u!==d){let t=1-a;const e=o*c+l*A+u*d+h*p,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+c*r,l=l*t+A*r,u=u*t+d*r,h=h*t+p*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+u*u+h*h);o*=t,l*=t,u*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=u,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],u=n[i+3],h=r[s],c=r[s+1],A=r[s+2],d=r[s+3];return t[e]=a*d+u*h+o*A-l*c,t[e+1]=o*d+u*c+l*h-a*A,t[e+2]=l*d+u*A+a*c-o*h,t[e+3]=u*d-a*h-o*c-l*A,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),u=a(i/2),h=a(r/2),c=o(n/2),A=o(i/2),d=o(r/2);switch(s){case"XYZ":this._x=c*u*h+l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h-c*A*d;break;case"YXZ":this._x=c*u*h+l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h+c*A*d;break;case"ZXY":this._x=c*u*h-l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h-c*A*d;break;case"ZYX":this._x=c*u*h-l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h+c*A*d;break;case"YZX":this._x=c*u*h+l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h-c*A*d;break;case"XZY":this._x=c*u*h-l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h+c*A*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],u=e[6],h=e[10],c=n+a+h;if(c>0){const t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(u-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(u-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+u)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+u)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(xe(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,u=e._w;return this._x=n*u+s*a+i*l-r*o,this._y=i*u+s*o+r*a-n*l,this._z=r*u+s*l+n*o-i*a,this._w=s*u-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this}const l=Math.sqrt(o),u=Math.atan2(l,a),h=Math.sin((1-e)*u)/l,c=Math.sin(e*u)/l;return this._w=s*h+this._w*c,this._x=n*h+this._x*c,this._y=i*h+this._y*c,this._z=r*h+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},en=class t{constructor(e=0,n=0,i=0){t.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(rn.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(rn.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=2*(s*i-a*n),u=2*(a*e-r*i),h=2*(r*n-s*e);return this.x=e+o*l+s*h-a*u,this.y=n+o*u+a*l-r*h,this.z=i+o*h+r*u-s*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return nn.copy(this).projectOnVector(t),this.sub(nn)}reflect(t){return this.sub(nn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(xe(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};const nn=new en,rn=new tn;let sn=class{constructor(t=new en(1/0,1/0,1/0),e=new en(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(on.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(on.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=on.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===e&&void 0!==i&&!0!==t.isInstancedMesh)for(let e=0,n=i.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,on):on.fromBufferAttribute(i,e),on.applyMatrix4(t.matrixWorld),this.expandByPoint(on);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),ln.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),ln.copy(n.boundingBox)),ln.applyMatrix4(t.matrixWorld),this.union(ln)}const i=t.children;for(let t=0,n=i.length;t<n;t++)this.expandByObject(i[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,on),on.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(fn),mn.subVectors(this.max,fn),un.subVectors(t.a,fn),hn.subVectors(t.b,fn),cn.subVectors(t.c,fn),An.subVectors(hn,un),dn.subVectors(cn,hn),pn.subVectors(un,cn);let e=[0,-An.z,An.y,0,-dn.z,dn.y,0,-pn.z,pn.y,An.z,0,-An.x,dn.z,0,-dn.x,pn.z,0,-pn.x,-An.y,An.x,0,-dn.y,dn.x,0,-pn.y,pn.x,0];return!!vn(e,un,hn,cn,mn)&&(e=[1,0,0,0,1,0,0,0,1],!!vn(e,un,hn,cn,mn)&&(gn.crossVectors(An,dn),e=[gn.x,gn.y,gn.z],vn(e,un,hn,cn,mn)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,on).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(on).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(an[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),an[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),an[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),an[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),an[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),an[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),an[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),an[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(an)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}};const an=[new en,new en,new en,new en,new en,new en,new en,new en],on=new en,ln=new sn,un=new en,hn=new en,cn=new en,An=new en,dn=new en,pn=new en,fn=new en,mn=new en,gn=new en,yn=new en;function vn(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){yn.fromArray(t,s);const a=r.x*Math.abs(yn.x)+r.y*Math.abs(yn.y)+r.z*Math.abs(yn.z),o=e.dot(yn),l=n.dot(yn),u=i.dot(yn);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>a)return!1}return!0}const _n=new sn,xn=new en,bn=new en;let Sn=class{constructor(t=new en,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):_n.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;e<r;e++)i=Math.max(i,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;xn.subVectors(t,this.center);const e=xn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(xn,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(bn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(xn.copy(t.center).add(bn)),this.expandByPoint(xn.copy(t.center).sub(bn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}};const Mn=new en,wn=new en,Tn=new en,En=new en,Cn=new en,Rn=new en,Nn=new en;let Pn=class{constructor(t=new en,e=new en(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Mn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Mn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Mn.copy(this.origin).addScaledVector(this.direction,e),Mn.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){wn.copy(t).add(e).multiplyScalar(.5),Tn.copy(e).sub(t).normalize(),En.copy(this.origin).sub(wn);const r=.5*t.distanceTo(e),s=-this.direction.dot(Tn),a=En.dot(this.direction),o=-En.dot(Tn),l=En.lengthSq(),u=Math.abs(1-s*s);let h,c,A,d;if(u>0)if(h=s*o-a,c=s*a-o,d=r*u,h>=0)if(c>=-d)if(c<=d){const t=1/u;h*=t,c*=t,A=h*(h+s*c+2*a)+c*(s*h+c+2*o)+l}else c=r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;else c=-r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;else c<=-d?(h=Math.max(0,-(-s*r+a)),c=h>0?-r:Math.min(Math.max(-r,-o),r),A=-h*h+c*(c+2*o)+l):c<=d?(h=0,c=Math.min(Math.max(-r,-o),r),A=c*(c+2*o)+l):(h=Math.max(0,-(s*r+a)),c=h>0?r:Math.min(Math.max(-r,-o),r),A=-h*h+c*(c+2*o)+l);else c=s>0?-r:r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(wn).addScaledVector(Tn,c),A}intersectSphere(t,e){Mn.subVectors(t.center,this.origin);const n=Mn.dot(this.direction),i=Mn.dot(Mn)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,c=this.origin;return l>=0?(n=(t.min.x-c.x)*l,i=(t.max.x-c.x)*l):(n=(t.max.x-c.x)*l,i=(t.min.x-c.x)*l),u>=0?(r=(t.min.y-c.y)*u,s=(t.max.y-c.y)*u):(r=(t.max.y-c.y)*u,s=(t.min.y-c.y)*u),n>s||r>i?null:((r>n||isNaN(n))&&(n=r),(s<i||isNaN(i))&&(i=s),h>=0?(a=(t.min.z-c.z)*h,o=(t.max.z-c.z)*h):(a=(t.max.z-c.z)*h,o=(t.min.z-c.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o<i||i!=i)&&(i=o),i<0?null:this.at(n>=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,Mn)}intersectTriangle(t,e,n,i,r){Cn.subVectors(e,t),Rn.subVectors(n,t),Nn.crossVectors(Cn,Rn);let s,a=this.direction.dot(Nn);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}En.subVectors(this.origin,t);const o=s*this.direction.dot(Rn.crossVectors(En,Rn));if(o<0)return null;const l=s*this.direction.dot(Cn.cross(En));if(l<0)return null;if(o+l>a)return null;const u=-s*En.dot(Nn);return u<0?null:this.at(u/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}},Dn=class t{constructor(e,n,i,r,s,a,o,l,u,h,c,A,d,p,f,m){t.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,n,i,r,s,a,o,l,u,h,c,A,d,p,f,m)}set(t,e,n,i,r,s,a,o,l,u,h,c,A,d,p,f){const m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=i,m[1]=r,m[5]=s,m[9]=a,m[13]=o,m[2]=l,m[6]=u,m[10]=h,m[14]=c,m[3]=A,m[7]=d,m[11]=p,m[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 t).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/In.setFromMatrixColumn(t,0).length(),r=1/In.setFromMatrixColumn(t,1).length(),s=1/In.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),u=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*u,n=s*h,i=a*u,r=a*h;e[0]=o*u,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*u,n=o*h,i=l*u,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*u,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*u,n=o*h,i=l*u,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*u,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*u,n=s*h,i=a*u,r=a*h;e[0]=o*u,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*u,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*u,e[9]=-a*u,e[2]=-l*u,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*u,e[4]=-h,e[8]=l*u,e[1]=t*h+r,e[5]=s*u,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*u,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Bn,t,Un)}lookAt(t,e,n){const i=this.elements;return kn.subVectors(t,e),0===kn.lengthSq()&&(kn.z=1),kn.normalize(),On.crossVectors(n,kn),0===On.lengthSq()&&(1===Math.abs(n.z)?kn.x+=1e-4:kn.z+=1e-4,kn.normalize(),On.crossVectors(n,kn)),On.normalize(),Fn.crossVectors(kn,On),i[0]=On.x,i[4]=Fn.x,i[8]=kn.x,i[1]=On.y,i[5]=Fn.y,i[9]=kn.y,i[2]=On.z,i[6]=Fn.z,i[10]=kn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],u=n[1],h=n[5],c=n[9],A=n[13],d=n[2],p=n[6],f=n[10],m=n[14],g=n[3],y=n[7],v=n[11],_=n[15],x=i[0],b=i[4],S=i[8],M=i[12],w=i[1],T=i[5],E=i[9],C=i[13],R=i[2],N=i[6],P=i[10],D=i[14],I=i[3],L=i[7],B=i[11],U=i[15];return r[0]=s*x+a*w+o*R+l*I,r[4]=s*b+a*T+o*N+l*L,r[8]=s*S+a*E+o*P+l*B,r[12]=s*M+a*C+o*D+l*U,r[1]=u*x+h*w+c*R+A*I,r[5]=u*b+h*T+c*N+A*L,r[9]=u*S+h*E+c*P+A*B,r[13]=u*M+h*C+c*D+A*U,r[2]=d*x+p*w+f*R+m*I,r[6]=d*b+p*T+f*N+m*L,r[10]=d*S+p*E+f*P+m*B,r[14]=d*M+p*C+f*D+m*U,r[3]=g*x+y*w+v*R+_*I,r[7]=g*b+y*T+v*N+_*L,r[11]=g*S+y*E+v*P+_*B,r[15]=g*M+y*C+v*D+_*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],u=t[2],h=t[6],c=t[10],A=t[14];return t[3]*(+r*o*h-i*l*h-r*a*c+n*l*c+i*a*A-n*o*A)+t[7]*(+e*o*A-e*l*c+r*s*c-i*s*A+i*l*u-r*o*u)+t[11]*(+e*l*h-e*a*A-r*s*h+n*s*A+r*a*u-n*l*u)+t[15]*(-i*a*u-e*o*h+e*a*c+i*s*h-n*s*c+n*o*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],h=t[9],c=t[10],A=t[11],d=t[12],p=t[13],f=t[14],m=t[15],g=h*f*l-p*c*l+p*o*A-a*f*A-h*o*m+a*c*m,y=d*c*l-u*f*l-d*o*A+s*f*A+u*o*m-s*c*m,v=u*p*l-d*h*l+d*a*A-s*p*A-u*a*m+s*h*m,_=d*h*o-u*p*o-d*a*c+s*p*c+u*a*f-s*h*f,x=e*g+n*y+i*v+r*_;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return t[0]=g*b,t[1]=(p*c*r-h*f*r-p*i*A+n*f*A+h*i*m-n*c*m)*b,t[2]=(a*f*r-p*o*r+p*i*l-n*f*l-a*i*m+n*o*m)*b,t[3]=(h*o*r-a*c*r-h*i*l+n*c*l+a*i*A-n*o*A)*b,t[4]=y*b,t[5]=(u*f*r-d*c*r+d*i*A-e*f*A-u*i*m+e*c*m)*b,t[6]=(d*o*r-s*f*r-d*i*l+e*f*l+s*i*m-e*o*m)*b,t[7]=(s*c*r-u*o*r+u*i*l-e*c*l-s*i*A+e*o*A)*b,t[8]=v*b,t[9]=(d*h*r-u*p*r-d*n*A+e*p*A+u*n*m-e*h*m)*b,t[10]=(s*p*r-d*a*r+d*n*l-e*p*l-s*n*m+e*a*m)*b,t[11]=(u*a*r-s*h*r-u*n*l+e*h*l+s*n*A-e*a*A)*b,t[12]=_*b,t[13]=(u*p*i-d*h*i+d*n*c-e*p*c-u*n*f+e*h*f)*b,t[14]=(d*a*i-s*p*i-d*n*o+e*p*o+s*n*f-e*a*f)*b,t[15]=(s*h*i-u*a*i+u*n*o-e*h*o-s*n*c+e*a*c)*b,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,u=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,u*a+n,u*o-i*s,0,l*o-i*a,u*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,s){return this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,u=s+s,h=a+a,c=r*l,A=r*u,d=r*h,p=s*u,f=s*h,m=a*h,g=o*l,y=o*u,v=o*h,_=n.x,x=n.y,b=n.z;return i[0]=(1-(p+m))*_,i[1]=(A+v)*_,i[2]=(d-y)*_,i[3]=0,i[4]=(A-v)*x,i[5]=(1-(c+m))*x,i[6]=(f+g)*x,i[7]=0,i[8]=(d+y)*b,i[9]=(f-g)*b,i[10]=(1-(c+p))*b,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=In.set(i[0],i[1],i[2]).length();const s=In.set(i[4],i[5],i[6]).length(),a=In.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Ln.copy(this);const o=1/r,l=1/s,u=1/a;return Ln.elements[0]*=o,Ln.elements[1]*=o,Ln.elements[2]*=o,Ln.elements[4]*=l,Ln.elements[5]*=l,Ln.elements[6]*=l,Ln.elements[8]*=u,Ln.elements[9]*=u,Ln.elements[10]*=u,e.setFromRotationMatrix(Ln),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s,a=2e3){const o=this.elements,l=2*r/(e-t),u=2*r/(n-i),h=(e+t)/(e-t),c=(n+i)/(n-i);let A,d;if(a===de)A=-(s+r)/(s-r),d=-2*s*r/(s-r);else{if(a!==pe)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);A=-s/(s-r),d=-s*r/(s-r)}return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=u,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=A,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,n,i,r,s,a=2e3){const o=this.elements,l=1/(e-t),u=1/(n-i),h=1/(s-r),c=(e+t)*l,A=(n+i)*u;let d,p;if(a===de)d=(s+r)*h,p=-2*h;else{if(a!==pe)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);d=r*h,p=-1*h}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-A,o[2]=0,o[6]=0,o[10]=p,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}};const In=new en,Ln=new Dn,Bn=new en(0,0,0),Un=new en(1,1,1),On=new en,Fn=new en,kn=new en,zn=new Dn,qn=new tn;let Gn=class t{constructor(e=0,n=0,i=0,r=t.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],s=i[4],a=i[8],o=i[1],l=i[5],u=i[9],h=i[2],c=i[6],A=i[10];switch(e){case"XYZ":this._y=Math.asin(xe(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,A),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-xe(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,A),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(xe(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-h,A),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-xe(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(c,A),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(xe(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,A));break;case"XZY":this._z=Math.asin(-xe(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(c,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,A),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return zn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(zn,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return qn.setFromEuler(this),this.setFromQuaternion(qn,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Gn.DEFAULT_ORDER="XYZ";let Vn=class{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return!!(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}},Hn=0;const jn=new en,Wn=new tn,Xn=new Dn,Yn=new en,Qn=new en,$n=new en,Zn=new tn,Kn=new en(1,0,0),Jn=new en(0,1,0),ti=new en(0,0,1),ei={type:"added"},ni={type:"removed"},ii={type:"childadded",child:null},ri={type:"childremoved",child:null};let si=class t extends fe{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Hn++}),this.uuid=_e(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=t.DEFAULT_UP.clone();const e=new en,n=new Gn,i=new tn,r=new en(1,1,1);n._onChange((function(){i.setFromEuler(n,!1)})),i._onChange((function(){n.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Dn},normalMatrix:{value:new Ce}}),this.matrix=new Dn,this.matrixWorld=new Dn,this.matrixAutoUpdate=t.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=t.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Vn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Wn.setFromAxisAngle(t,e),this.quaternion.multiply(Wn),this}rotateOnWorldAxis(t,e){return Wn.setFromAxisAngle(t,e),this.quaternion.premultiply(Wn),this}rotateX(t){return this.rotateOnAxis(Kn,t)}rotateY(t){return this.rotateOnAxis(Jn,t)}rotateZ(t){return this.rotateOnAxis(ti,t)}translateOnAxis(t,e){return jn.copy(t).applyQuaternion(this.quaternion),this.position.add(jn.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Kn,t)}translateY(t){return this.translateOnAxis(Jn,t)}translateZ(t){return this.translateOnAxis(ti,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Xn.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Yn.copy(t):Yn.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Qn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Xn.lookAt(Qn,Yn,this.up):Xn.lookAt(Yn,Qn,this.up),this.quaternion.setFromRotationMatrix(Xn),i&&(Xn.extractRotation(i.matrixWorld),Wn.setFromRotationMatrix(Xn),this.quaternion.premultiply(Wn.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(ei),ii.child=t,this.dispatchEvent(ii),ii.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ni),ri.child=t,this.dispatchEvent(ri),ri.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Xn.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Xn.multiply(t.parent.matrixWorld)),t.applyMatrix4(Xn),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(ei),ii.child=t,this.dispatchEvent(ii),ii.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const i=this.children;for(let r=0,s=i.length;r<s;r++)i[r].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qn,t,$n),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qn,Zn,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++){e[n].updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){t[e].updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}else r(t.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++)e.push(r(t.materials,this.material[n]));i.material=e}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=s(t.geometries),i=s(t.materials),r=s(t.textures),a=s(t.images),o=s(t.shapes),l=s(t.skeletons),u=s(t.animations),h=s(t.nodes);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),h.length>0&&(n.nodes=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}};si.DEFAULT_UP=new en(0,1,0),si.DEFAULT_MATRIX_AUTO_UPDATE=!0,si.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const ai=new en,oi=new en,li=new en,ui=new en,hi=new en,ci=new en,Ai=new en,di=new en,pi=new en,fi=new en,mi=new Qe,gi=new Qe,yi=new Qe;let vi=class t{constructor(t=new en,e=new en,n=new en){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),ai.subVectors(t,e),i.cross(ai);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){ai.subVectors(i,e),oi.subVectors(n,e),li.subVectors(t,e);const s=ai.dot(ai),a=ai.dot(oi),o=ai.dot(li),l=oi.dot(oi),u=oi.dot(li),h=s*l-a*a;if(0===h)return r.set(0,0,0),null;const c=1/h,A=(l*o-a*u)*c,d=(s*u-a*o)*c;return r.set(1-A-d,d,A)}static containsPoint(t,e,n,i){return null!==this.getBarycoord(t,e,n,i,ui)&&(ui.x>=0&&ui.y>=0&&ui.x+ui.y<=1)}static getInterpolation(t,e,n,i,r,s,a,o){return null===this.getBarycoord(t,e,n,i,ui)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,ui.x),o.addScaledVector(s,ui.y),o.addScaledVector(a,ui.z),o)}static getInterpolatedAttribute(t,e,n,i,r,s){return mi.setScalar(0),gi.setScalar(0),yi.setScalar(0),mi.fromBufferAttribute(t,e),gi.fromBufferAttribute(t,n),yi.fromBufferAttribute(t,i),s.setScalar(0),s.addScaledVector(mi,r.x),s.addScaledVector(gi,r.y),s.addScaledVector(yi,r.z),s}static isFrontFacing(t,e,n,i){return ai.subVectors(n,e),oi.subVectors(t,e),ai.cross(oi).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return ai.subVectors(this.c,this.b),oi.subVectors(this.a,this.b),.5*ai.cross(oi).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return t.getNormal(this.a,this.b,this.c,e)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return t.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return t.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return t.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return t.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;hi.subVectors(i,n),ci.subVectors(r,n),di.subVectors(t,n);const o=hi.dot(di),l=ci.dot(di);if(o<=0&&l<=0)return e.copy(n);pi.subVectors(t,i);const u=hi.dot(pi),h=ci.dot(pi);if(u>=0&&h<=u)return e.copy(i);const c=o*h-u*l;if(c<=0&&o>=0&&u<=0)return s=o/(o-u),e.copy(n).addScaledVector(hi,s);fi.subVectors(t,r);const A=hi.dot(fi),d=ci.dot(fi);if(d>=0&&A<=d)return e.copy(r);const p=A*l-o*d;if(p<=0&&l>=0&&d<=0)return a=l/(l-d),e.copy(n).addScaledVector(ci,a);const f=u*d-A*h;if(f<=0&&h-u>=0&&A-d>=0)return Ai.subVectors(r,i),a=(h-u)/(h-u+(A-d)),e.copy(i).addScaledVector(Ai,a);const m=1/(f+p+c);return s=p*m,a=c*m,e.copy(n).addScaledVector(hi,s).addScaledVector(ci,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}};const _i={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},xi={h:0,s:0,l:0},bi={h:0,s:0,l:0};function Si(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}let Mi=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Yt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,ke.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=ke.workingColorSpace){return this.r=t,this.g=e,this.b=n,ke.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=ke.workingColorSpace){if(t=be(t,1),e=xe(e,0,1),n=xe(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=Si(r,i,t+1/3),this.g=Si(r,i,t),this.b=Si(r,i,t-1/3)}return ke.toWorkingColorSpace(this,i),this}setStyle(t,e=Yt){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Yt){const n=_i[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=ze(t.r),this.g=ze(t.g),this.b=ze(t.b),this}copyLinearToSRGB(t){return this.r=qe(t.r),this.g=qe(t.g),this.b=qe(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Yt){return ke.fromWorkingColorSpace(wi.copy(this),t),65536*Math.round(xe(255*wi.r,0,255))+256*Math.round(xe(255*wi.g,0,255))+Math.round(xe(255*wi.b,0,255))}getHexString(t=Yt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=ke.workingColorSpace){ke.fromWorkingColorSpace(wi.copy(this),e);const n=wi.r,i=wi.g,r=wi.b,s=Math.max(n,i,r),a=Math.min(n,i,r);let o,l;const u=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=u<=.5?t/(s+a):t/(2-s-a),s){case n:o=(i-r)/t+(i<r?6:0);break;case i:o=(r-n)/t+2;break;case r:o=(n-i)/t+4}o/=6}return t.h=o,t.s=l,t.l=u,t}getRGB(t,e=ke.workingColorSpace){return ke.fromWorkingColorSpace(wi.copy(this),e),t.r=wi.r,t.g=wi.g,t.b=wi.b,t}getStyle(t=Yt){ke.fromWorkingColorSpace(wi.copy(this),t);const e=wi.r,n=wi.g,i=wi.b;return t!==Yt?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(t,e,n){return this.getHSL(xi),this.setHSL(xi.h+t,xi.s+e,xi.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(xi),t.getHSL(bi);const n=Se(xi.h,bi.h,e),i=Se(xi.s,bi.s,e),r=Se(xi.l,bi.l,e);return this.setHSL(n,i,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.elements;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const wi=new Mi;Mi.NAMES=_i;let Ti=0,Ei=class extends fe{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Ti++}),this.uuid=_e(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=p,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Mi(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ne,this.stencilZFail=ne,this.stencilZPass=ne,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(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==p&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ne&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ne&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ne&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}},Ci=class extends Ei{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Mi(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 Gn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};const Ri=new en,Ni=new Ee;let Pi=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=ce,this.updateRanges=[],this.gpuType=rt,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Ni.fromBufferAttribute(this,e),Ni.applyMatrix3(t),this.setXY(e,Ni.x,Ni.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)Ri.fromBufferAttribute(this,e),Ri.applyMatrix3(t),this.setXYZ(e,Ri.x,Ri.y,Ri.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Ri.fromBufferAttribute(this,e),Ri.applyMatrix4(t),this.setXYZ(e,Ri.x,Ri.y,Ri.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Ri.fromBufferAttribute(this,e),Ri.applyNormalMatrix(t),this.setXYZ(e,Ri.x,Ri.y,Ri.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Ri.fromBufferAttribute(this,e),Ri.transformDirection(t),this.setXYZ(e,Ri.x,Ri.y,Ri.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Me(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=we(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Me(e,this.array)),e}setX(t,e){return this.normalized&&(e=we(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Me(e,this.array)),e}setY(t,e){return this.normalized&&(e=we(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Me(e,this.array)),e}setZ(t,e){return this.normalized&&(e=we(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Me(e,this.array)),e}setW(t,e){return this.normalized&&(e=we(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=we(e,this.array),n=we(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=we(e,this.array),n=we(n,this.array),i=we(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=we(e,this.array),n=we(n,this.array),i=we(i,this.array),r=we(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==ce&&(t.usage=this.usage),t}},Di=class extends Pi{constructor(t,e,n){super(new Uint16Array(t),e,n)}},Ii=class extends Pi{constructor(t,e,n){super(new Uint32Array(t),e,n)}},Li=class extends Pi{constructor(t,e,n){super(new Float32Array(t),e,n)}},Bi=0;const Ui=new Dn,Oi=new si,Fi=new en,ki=new sn,zi=new sn,qi=new en;let Gi=class t extends fe{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Bi++}),this.uuid=_e(),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(t){return Array.isArray(t)?this.index=new(Ne(t)?Ii:Di)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Ce).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ui.makeRotationFromQuaternion(t),this.applyMatrix4(Ui),this}rotateX(t){return Ui.makeRotationX(t),this.applyMatrix4(Ui),this}rotateY(t){return Ui.makeRotationY(t),this.applyMatrix4(Ui),this}rotateZ(t){return Ui.makeRotationZ(t),this.applyMatrix4(Ui),this}translate(t,e,n){return Ui.makeTranslation(t,e,n),this.applyMatrix4(Ui),this}scale(t,e,n){return Ui.makeScale(t,e,n),this.applyMatrix4(Ui),this}lookAt(t){return Oi.lookAt(t),Oi.updateMatrix(),this.applyMatrix4(Oi.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Fi).negate(),this.translate(Fi.x,Fi.y,Fi.z),this}setFromPoints(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new Li(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new sn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new en(-1/0,-1/0,-1/0),new en(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];ki.setFromBufferAttribute(n),this.morphTargetsRelative?(qi.addVectors(this.boundingBox.min,ki.min),this.boundingBox.expandByPoint(qi),qi.addVectors(this.boundingBox.max,ki.max),this.boundingBox.expandByPoint(qi)):(this.boundingBox.expandByPoint(ki.min),this.boundingBox.expandByPoint(ki.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 Sn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new en,1/0);if(t){const n=this.boundingSphere.center;if(ki.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];zi.setFromBufferAttribute(n),this.morphTargetsRelative?(qi.addVectors(ki.min,zi.min),ki.expandByPoint(qi),qi.addVectors(ki.max,zi.max),ki.expandByPoint(qi)):(ki.expandByPoint(zi.min),ki.expandByPoint(zi.max))}ki.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)qi.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(qi));if(e)for(let r=0,s=e.length;r<s;r++){const s=e[r],a=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++)qi.fromBufferAttribute(s,e),a&&(Fi.fromBufferAttribute(t,e),qi.add(Fi)),i=Math.max(i,n.distanceToSquared(qi))}this.boundingSphere.radius=Math.sqrt(i),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 t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.position,i=e.normal,r=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Pi(new Float32Array(4*n.count),4));const s=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<n.count;t++)a[t]=new en,o[t]=new en;const l=new en,u=new en,h=new en,c=new Ee,A=new Ee,d=new Ee,p=new en,f=new en;function m(t,e,i){l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,e),h.fromBufferAttribute(n,i),c.fromBufferAttribute(r,t),A.fromBufferAttribute(r,e),d.fromBufferAttribute(r,i),u.sub(l),h.sub(l),A.sub(c),d.sub(c);const s=1/(A.x*d.y-d.x*A.y);isFinite(s)&&(p.copy(u).multiplyScalar(d.y).addScaledVector(h,-A.y).multiplyScalar(s),f.copy(h).multiplyScalar(A.x).addScaledVector(u,-d.x).multiplyScalar(s),a[t].add(p),a[e].add(p),a[i].add(p),o[t].add(f),o[e].add(f),o[i].add(f))}let g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(let e=0,n=g.length;e<n;++e){const n=g[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)m(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const y=new en,v=new en,_=new en,x=new en;function b(t){_.fromBufferAttribute(i,t),x.copy(_);const e=a[t];y.copy(e),y.sub(_.multiplyScalar(_.dot(e))).normalize(),v.crossVectors(x,e);const n=v.dot(o[t])<0?-1:1;s.setXYZW(t,y.x,y.y,y.z,n)}for(let e=0,n=g.length;e<n;++e){const n=g[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)b(t.getX(e+0)),b(t.getX(e+1)),b(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Pi(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new en,r=new en,s=new en,a=new en,o=new en,l=new en,u=new en,h=new en;if(t)for(let c=0,A=t.count;c<A;c+=3){const A=t.getX(c+0),d=t.getX(c+1),p=t.getX(c+2);i.fromBufferAttribute(e,A),r.fromBufferAttribute(e,d),s.fromBufferAttribute(e,p),u.subVectors(s,r),h.subVectors(i,r),u.cross(h),a.fromBufferAttribute(n,A),o.fromBufferAttribute(n,d),l.fromBufferAttribute(n,p),a.add(u),o.add(u),l.add(u),n.setXYZ(A,a.x,a.y,a.z),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let t=0,a=e.count;t<a;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),u.subVectors(s,r),h.subVectors(i,r),u.cross(h),n.setXYZ(t+0,u.x,u.y,u.z),n.setXYZ(t+1,u.x,u.y,u.z),n.setXYZ(t+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)qi.fromBufferAttribute(t,e),qi.normalize(),t.setXYZ(e,qi.x,qi.y,qi.z)}toNonIndexed(){function e(t,e){const n=t.array,i=t.itemSize,r=t.normalized,s=new n.constructor(e.length*i);let a=0,o=0;for(let r=0,l=e.length;r<l;r++){a=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*i;for(let t=0;t<i;t++)s[o++]=n[a++]}return new Pi(s,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new t,i=this.index.array,r=this.attributes;for(const t in r){const s=e(r[t],i);n.setAttribute(t,s)}const s=this.morphAttributes;for(const t in s){const r=[],a=s[t];for(let t=0,n=a.length;t<n;t++){const n=e(a[t],i);r.push(n)}n.morphAttributes[t]=r}n.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let t=0,e=a.length;t<e;t++){const e=a[t];n.addGroup(e.start,e.count,e.materialIndex)}return n}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];s.push(i.toJSON(t.data))}s.length>0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t<r;t++)n.push(i[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}};const Vi=new Dn,Hi=new Pn,ji=new Sn,Wi=new en,Xi=new en,Yi=new en,Qi=new en,$i=new en,Zi=new en,Ki=new en,Ji=new en;let tr=class extends si{constructor(t=new Gi,e=new Ci){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,s=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const a=this.morphTargetInfluences;if(r&&a){Zi.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=a[n],o=r[n];0!==i&&($i.fromBufferAttribute(o,t),s?Zi.addScaledVector($i,i):Zi.addScaledVector($i.sub(e),i))}e.add(Zi)}return e}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),ji.copy(n.boundingSphere),ji.applyMatrix4(r),Hi.copy(t.ray).recast(t.near),!1===ji.containsPoint(Hi.origin)){if(null===Hi.intersectSphere(ji,Wi))return;if(Hi.origin.distanceToSquared(Wi)>(t.far-t.near)**2)return}Vi.copy(r).invert(),Hi.copy(t.ray).applyMatrix4(Vi),null!==n.boundingBox&&!1===Hi.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,Hi)}}_computeIntersections(t,e,n){let i;const r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,h=r.attributes.normal,c=r.groups,A=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=c.length;r<o;r++){const o=c[r],d=s[o.materialIndex];for(let r=Math.max(o.start,A.start),s=Math.min(a.count,Math.min(o.start+o.count,A.start+A.count));r<s;r+=3){i=er(this,d,t,n,l,u,h,a.getX(r),a.getX(r+1),a.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,e.push(i))}}else{for(let r=Math.max(0,A.start),o=Math.min(a.count,A.start+A.count);r<o;r+=3){i=er(this,s,t,n,l,u,h,a.getX(r),a.getX(r+1),a.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}else if(void 0!==o)if(Array.isArray(s))for(let r=0,a=c.length;r<a;r++){const a=c[r],d=s[a.materialIndex];for(let r=Math.max(a.start,A.start),s=Math.min(o.count,Math.min(a.start+a.count,A.start+A.count));r<s;r+=3){i=er(this,d,t,n,l,u,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=a.materialIndex,e.push(i))}}else{for(let r=Math.max(0,A.start),a=Math.min(o.count,A.start+A.count);r<a;r+=3){i=er(this,s,t,n,l,u,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}}};function er(t,e,n,i,r,s,a,o,l,u){t.getVertexPosition(o,Xi),t.getVertexPosition(l,Yi),t.getVertexPosition(u,Qi);const h=function(t,e,n,i,r,s,a,o){let l;if(l=1===e.side?i.intersectTriangle(a,s,r,!0,o):i.intersectTriangle(r,s,a,0===e.side,o),null===l)return null;Ji.copy(o),Ji.applyMatrix4(t.matrixWorld);const u=n.ray.origin.distanceTo(Ji);return u<n.near||u>n.far?null:{distance:u,point:Ji.clone(),object:t}}(t,e,n,i,Xi,Yi,Qi,Ki);if(h){const t=new en;vi.getBarycoord(Ki,Xi,Yi,Qi,t),r&&(h.uv=vi.getInterpolatedAttribute(r,o,l,u,t,new Ee)),s&&(h.uv1=vi.getInterpolatedAttribute(s,o,l,u,t,new Ee)),a&&(h.normal=vi.getInterpolatedAttribute(a,o,l,u,t,new en),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const e={a:o,b:l,c:u,normal:new en,materialIndex:0};vi.getNormal(Xi,Yi,Qi,e.normal),h.face=e,h.barycoord=t}return h}let nr=class t extends Gi{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],u=[],h=[];let c=0,A=0;function d(t,e,n,i,r,s,d,p,f,m,g){const y=s/f,v=d/m,_=s/2,x=d/2,b=p/2,S=f+1,M=m+1;let w=0,T=0;const E=new en;for(let s=0;s<M;s++){const a=s*v-x;for(let o=0;o<S;o++){const c=o*y-_;E[t]=c*i,E[e]=a*r,E[n]=b,l.push(E.x,E.y,E.z),E[t]=0,E[e]=0,E[n]=p>0?1:-1,u.push(E.x,E.y,E.z),h.push(o/f),h.push(1-s/m),w+=1}}for(let t=0;t<m;t++)for(let e=0;e<f;e++){const n=c+e+S*t,i=c+e+S*(t+1),r=c+(e+1)+S*(t+1),s=c+(e+1)+S*t;o.push(n,i,s),o.push(i,r,s),T+=6}a.addGroup(A,T,g),A+=T,c+=w}d("z","y","x",-1,-1,n,e,t,s,r,0),d("z","y","x",1,-1,n,e,-t,s,r,1),d("x","z","y",1,1,t,n,e,i,s,2),d("x","z","y",1,-1,t,n,-e,i,s,3),d("x","y","z",1,-1,t,e,n,i,r,4),d("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(o),this.setAttribute("position",new Li(l,3)),this.setAttribute("normal",new Li(u,3)),this.setAttribute("uv",new Li(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(e){return new t(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}};function ir(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function rr(t){const e={};for(let n=0;n<t.length;n++){const i=ir(t[n]);for(const t in i)e[t]=i[t]}return e}function sr(t){const e=t.getRenderTarget();return null===e?t.outputColorSpace:!0===e.isXRRenderTarget?e.texture.colorSpace:ke.workingColorSpace}const ar={clone:ir,merge:rr};let or=class extends Ei{constructor(t){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={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!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ir(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},lr=class extends si{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Dn,this.projectionMatrix=new Dn,this.projectionMatrixInverse=new Dn,this.coordinateSystem=de}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}};const ur=new en,hr=new Ee,cr=new Ee;let Ar=class extends lr{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*ve*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*ye*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*ve*Math.atan(Math.tan(.5*ye*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){ur.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(ur.x,ur.y).multiplyScalar(-t/ur.z),ur.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(ur.x,ur.y).multiplyScalar(-t/ur.z)}getViewSize(t,e){return this.getViewBounds(t,hr,cr),e.subVectors(cr,hr)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*ye*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}};const dr=-90;let pr=class extends si{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Ar(dr,1,t,e);i.layers=this.layers,this.add(i);const r=new Ar(dr,1,t,e);r.layers=this.layers,this.add(r);const s=new Ar(dr,1,t,e);s.layers=this.layers,this.add(s);const a=new Ar(dr,1,t,e);a.layers=this.layers,this.add(a);const o=new Ar(dr,1,t,e);o.layers=this.layers,this.add(o);const l=new Ar(dr,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,s,a,o]=e;for(const t of e)this.remove(t);if(t===de)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(t!==pe)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,s,a,o,l,u]=this.children,h=t.getRenderTarget(),c=t.getActiveCubeFace(),A=t.getActiveMipmapLevel(),d=t.xr.enabled;t.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,r),t.setRenderTarget(n,1,i),t.render(e,s),t.setRenderTarget(n,2,i),t.render(e,a),t.setRenderTarget(n,3,i),t.render(e,o),t.setRenderTarget(n,4,i),t.render(e,l),n.texture.generateMipmaps=p,t.setRenderTarget(n,5,i),t.render(e,u),t.setRenderTarget(h,c,A),t.xr.enabled=d,n.texture.needsPMREMUpdate=!0}},fr=class extends Ye{constructor(t,e,n,i,r,s,a,o,l,u){super(t=void 0!==t?t:[],e=void 0!==e?e:z,n,i,r,s,a,o,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},mr=class extends Ze{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new fr(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:Q}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={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"},i=new nr(5,5,5),r=new or({name:"CubemapFromEquirect",uniforms:ir(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new tr(i,r),a=e.minFilter;e.minFilter===Z&&(e.minFilter=Q);return new pr(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}};const gr=new en,yr=new en,vr=new Ce;let _r=class{constructor(t=new en(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=gr.subVectors(n,e).cross(yr.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(gr),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||vr.getNormalMatrix(t),i=this.coplanarPoint(gr).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}};const xr=new Sn,br=new en;let Sr=class{constructor(t=new _r,e=new _r,n=new _r,i=new _r,r=new _r,s=new _r){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,i=t.elements,r=i[0],s=i[1],a=i[2],o=i[3],l=i[4],u=i[5],h=i[6],c=i[7],A=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],y=i[14],v=i[15];if(n[0].setComponents(o-r,c-l,f-A,v-m).normalize(),n[1].setComponents(o+r,c+l,f+A,v+m).normalize(),n[2].setComponents(o+s,c+u,f+d,v+g).normalize(),n[3].setComponents(o-s,c-u,f-d,v-g).normalize(),n[4].setComponents(o-a,c-h,f-p,v-y).normalize(),e===de)n[5].setComponents(o+a,c+h,f+p,v+y).normalize();else{if(e!==pe)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(a,h,p,y).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),xr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),xr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(xr)}intersectsSprite(t){return xr.center.set(0,0,0),xr.radius=.7071067811865476,xr.applyMatrix4(t.matrixWorld),this.intersectsSphere(xr)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<i)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(br.x=i.normal.x>0?t.max.x:t.min.x,br.y=i.normal.y>0?t.max.y:t.min.y,br.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(br)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}};function Mr(){let t=null,e=!1,n=null,i=null;function r(e,s){n(e,s),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function wr(t){const e=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const i=e.get(n);i&&(t.deleteBuffer(i.buffer),e.delete(n))},update:function(n,i){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){const t=e.get(n);return void((!t||t.version<n.version)&&e.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}const r=e.get(n);if(void 0===r)e.set(n,function(e,n){const i=e.array,r=e.usage,s=i.byteLength,a=t.createBuffer();let o;if(t.bindBuffer(n,a),t.bufferData(n,i,r),e.onUploadCallback(),i instanceof Float32Array)o=t.FLOAT;else if(i instanceof Uint16Array)o=e.isFloat16BufferAttribute?t.HALF_FLOAT:t.UNSIGNED_SHORT;else if(i instanceof Int16Array)o=t.SHORT;else if(i instanceof Uint32Array)o=t.UNSIGNED_INT;else if(i instanceof Int32Array)o=t.INT;else if(i instanceof Int8Array)o=t.BYTE;else if(i instanceof Uint8Array)o=t.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);o=t.UNSIGNED_BYTE}return{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,size:s}}(n,i));else if(r.version<n.version){if(r.size!==n.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(e,n,i){const r=n.array,s=n.updateRanges;if(t.bindBuffer(i,e),0===s.length)t.bufferSubData(i,0,r);else{s.sort(((t,e)=>t.start-e.start));let e=0;for(let t=1;t<s.length;t++){const n=s[e],i=s[t];i.start<=n.start+n.count+1?n.count=Math.max(n.count,i.start+i.count-n.start):(++e,s[e]=i)}s.length=e+1;for(let e=0,n=s.length;e<n;e++){const n=s[e];t.bufferSubData(i,n.start*r.BYTES_PER_ELEMENT,r,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}(r.buffer,n,i),r.version=n.version}}}}class Tr extends Gi{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=t/2,s=e/2,a=Math.floor(n),o=Math.floor(i),l=a+1,u=o+1,h=t/a,c=e/o,A=[],d=[],p=[],f=[];for(let t=0;t<u;t++){const e=t*c-s;for(let n=0;n<l;n++){const i=n*h-r;d.push(i,-e,0),p.push(0,0,1),f.push(n/a),f.push(1-t/o)}}for(let t=0;t<o;t++)for(let e=0;e<a;e++){const n=e+l*t,i=e+l*(t+1),r=e+1+l*(t+1),s=e+1+l*t;A.push(n,i,s),A.push(i,r,s)}this.setIndex(A),this.setAttribute("position",new Li(d,3)),this.setAttribute("normal",new Li(p,3)),this.setAttribute("uv",new Li(f,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Tr(t.width,t.height,t.widthSegments,t.heightSegments)}}const Er={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\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\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\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\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 ) || defined( USE_BATCHING_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 ) || defined( USE_BATCHING_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\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.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}\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}",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_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\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\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_DISPERSION\n\tmaterial.dispersion = dispersion;\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\tfloat dispersion;\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.shadowIntensity, 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.shadowIntensity, 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.shadowIntensity, 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 )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\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 )\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\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\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.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in 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( const in 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 shadowIntensity;\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 shadowIntensity;\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 shadowIntensity;\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 shadowIntensity, 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 mix( 1.0, shadow, shadowIntensity );\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 shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\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 shadowIntensity;\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 shadowIntensity;\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 shadowIntensity;\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.shadowIntensity, 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.shadowIntensity, 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.shadowIntensity, 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 CineonToneMapping( 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\tconst float StartCompression = 0.8 - 0.04;\n\tconst float 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( newPeak ), 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.dispersion, 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 dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\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#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\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_DISPERSION\n\tuniform float dispersion;\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[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\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}"},Cr={common:{diffuse:{value:new Mi(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ce},alphaMap:{value:null},alphaMapTransform:{value:new Ce},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ce}},envmap:{envMap:{value:null},envMapRotation:{value:new Ce},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ce}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ce}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ce},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ce},normalScale:{value:new Ee(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ce},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ce}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ce}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ce}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Mi(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 Mi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ce},alphaTest:{value:0},uvTransform:{value:new Ce}},sprite:{diffuse:{value:new Mi(16777215)},opacity:{value:1},center:{value:new Ee(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ce},alphaMap:{value:null},alphaMapTransform:{value:new Ce},alphaTest:{value:0}}},Rr={basic:{uniforms:rr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.fog]),vertexShader:Er.meshbasic_vert,fragmentShader:Er.meshbasic_frag},lambert:{uniforms:rr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,Cr.lights,{emissive:{value:new Mi(0)}}]),vertexShader:Er.meshlambert_vert,fragmentShader:Er.meshlambert_frag},phong:{uniforms:rr([Cr.common,Cr.specularmap,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,Cr.lights,{emissive:{value:new Mi(0)},specular:{value:new Mi(1118481)},shininess:{value:30}}]),vertexShader:Er.meshphong_vert,fragmentShader:Er.meshphong_frag},standard:{uniforms:rr([Cr.common,Cr.envmap,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.roughnessmap,Cr.metalnessmap,Cr.fog,Cr.lights,{emissive:{value:new Mi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Er.meshphysical_vert,fragmentShader:Er.meshphysical_frag},toon:{uniforms:rr([Cr.common,Cr.aomap,Cr.lightmap,Cr.emissivemap,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.gradientmap,Cr.fog,Cr.lights,{emissive:{value:new Mi(0)}}]),vertexShader:Er.meshtoon_vert,fragmentShader:Er.meshtoon_frag},matcap:{uniforms:rr([Cr.common,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,Cr.fog,{matcap:{value:null}}]),vertexShader:Er.meshmatcap_vert,fragmentShader:Er.meshmatcap_frag},points:{uniforms:rr([Cr.points,Cr.fog]),vertexShader:Er.points_vert,fragmentShader:Er.points_frag},dashed:{uniforms:rr([Cr.common,Cr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Er.linedashed_vert,fragmentShader:Er.linedashed_frag},depth:{uniforms:rr([Cr.common,Cr.displacementmap]),vertexShader:Er.depth_vert,fragmentShader:Er.depth_frag},normal:{uniforms:rr([Cr.common,Cr.bumpmap,Cr.normalmap,Cr.displacementmap,{opacity:{value:1}}]),vertexShader:Er.meshnormal_vert,fragmentShader:Er.meshnormal_frag},sprite:{uniforms:rr([Cr.sprite,Cr.fog]),vertexShader:Er.sprite_vert,fragmentShader:Er.sprite_frag},background:{uniforms:{uvTransform:{value:new Ce},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Er.background_vert,fragmentShader:Er.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ce}},vertexShader:Er.backgroundCube_vert,fragmentShader:Er.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Er.cube_vert,fragmentShader:Er.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Er.equirect_vert,fragmentShader:Er.equirect_frag},distanceRGBA:{uniforms:rr([Cr.common,Cr.displacementmap,{referencePosition:{value:new en},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Er.distanceRGBA_vert,fragmentShader:Er.distanceRGBA_frag},shadow:{uniforms:rr([Cr.lights,Cr.fog,{color:{value:new Mi(0)},opacity:{value:1}}]),vertexShader:Er.shadow_vert,fragmentShader:Er.shadow_frag}};Rr.physical={uniforms:rr([Rr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ce},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ce},clearcoatNormalScale:{value:new Ee(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ce},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ce},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ce},sheen:{value:0},sheenColor:{value:new Mi(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ce},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ce},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ce},transmissionSamplerSize:{value:new Ee},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ce},attenuationDistance:{value:0},attenuationColor:{value:new Mi(0)},specularColor:{value:new Mi(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ce},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ce},anisotropyVector:{value:new Ee},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ce}}]),vertexShader:Er.meshphysical_vert,fragmentShader:Er.meshphysical_frag};const Nr={r:0,b:0,g:0},Pr=new Gn,Dr=new Dn;function Ir(t,e,n,i,r,s,a){const o=new Mi(0);let l,u,h=!0===s?0:1,c=null,A=0,d=null;function p(t){let i=!0===t.isScene?t.background:null;if(i&&i.isTexture){i=(t.backgroundBlurriness>0?n:e).get(i)}return i}function f(e,n){e.getRGB(Nr,sr(t)),i.buffers.color.setClear(Nr.r,Nr.g,Nr.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),h=e,f(o,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,f(o,h)},render:function(e){let n=!1;const r=p(e);null===r?f(o,h):r&&r.isColor&&(f(r,1),n=!0);const s=t.xr.getEnvironmentBlendMode();"additive"===s?i.buffers.color.setClear(0,0,0,1,a):"alpha-blend"===s&&i.buffers.color.setClear(0,0,0,0,a),(t.autoClear||n)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))},addToRenderList:function(e,n){const i=p(n);i&&(i.isCubeTexture||i.mapping===G)?(void 0===u&&(u=new tr(new nr(1,1,1),new or({name:"BackgroundCubeMaterial",uniforms:ir(Rr.backgroundCube.uniforms),vertexShader:Rr.backgroundCube.vertexShader,fragmentShader:Rr.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Pr.copy(n.backgroundRotation),Pr.x*=-1,Pr.y*=-1,Pr.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(Pr.y*=-1,Pr.z*=-1),u.material.uniforms.envMap.value=i,u.material.uniforms.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Dr.makeRotationFromEuler(Pr)),u.material.toneMapped=ke.getTransfer(i.colorSpace)!==Jt,c===i&&A===i.version&&d===t.toneMapping||(u.material.needsUpdate=!0,c=i,A=i.version,d=t.toneMapping),u.layers.enableAll(),e.unshift(u,u.geometry,u.material,0,0,null)):i&&i.isTexture&&(void 0===l&&(l=new tr(new Tr(2,2),new or({name:"BackgroundMaterial",uniforms:ir(Rr.background.uniforms),vertexShader:Rr.background.vertexShader,fragmentShader:Rr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(l)),l.material.uniforms.t2D.value=i,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=ke.getTransfer(i.colorSpace)!==Jt,!0===i.matrixAutoUpdate&&i.updateMatrix(),l.material.uniforms.uvTransform.value.copy(i.matrix),c===i&&A===i.version&&d===t.toneMapping||(l.material.needsUpdate=!0,c=i,A=i.version,d=t.toneMapping),l.layers.enableAll(),e.unshift(l,l.geometry,l.material,0,0,null))}}}function Lr(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=u(null);let s=r,a=!1;function o(e){return t.bindVertexArray(e)}function l(e){return t.deleteVertexArray(e)}function u(t){const e=[],i=[],r=[];for(let t=0;t<n;t++)e[t]=0,i[t]=0,r[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:r,object:t,attributes:{},index:null}}function h(){const t=s.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function c(t){A(t,0)}function A(e,n){const i=s.newAttributes,r=s.enabledAttributes,a=s.attributeDivisors;i[e]=1,0===r[e]&&(t.enableVertexAttribArray(e),r[e]=1),a[e]!==n&&(t.vertexAttribDivisor(e,n),a[e]=n)}function d(){const e=s.newAttributes,n=s.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==e[i]&&(t.disableVertexAttribArray(i),n[i]=0)}function p(e,n,i,r,s,a,o){!0===o?t.vertexAttribIPointer(e,n,i,s,a):t.vertexAttribPointer(e,n,i,r,s,a)}function f(){m(),a=!0,s!==r&&(s=r,o(s.object))}function m(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:function(n,r,l,f,m){let g=!1;const y=function(e,n,r){const s=!0===r.wireframe;let a=i[e.id];void 0===a&&(a={},i[e.id]=a);let o=a[n.id];void 0===o&&(o={},a[n.id]=o);let l=o[s];void 0===l&&(l=u(t.createVertexArray()),o[s]=l);return l}(f,l,r);s!==y&&(s=y,o(s.object)),g=function(t,e,n,i){const r=s.attributes,a=e.attributes;let o=0;const l=n.getAttributes();for(const e in l){if(l[e].location>=0){const n=r[e];let i=a[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;o++}}return s.attributesNum!==o||s.index!==i}(n,f,l,m),g&&function(t,e,n,i){const r={},a=e.attributes;let o=0;const l=n.getAttributes();for(const e in l){if(l[e].location>=0){let n=a[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[e]=i,o++}}s.attributes=r,s.attributesNum=o,s.index=i}(n,f,l,m),null!==m&&e.update(m,t.ELEMENT_ARRAY_BUFFER),(g||a)&&(a=!1,function(n,i,r,s){h();const a=s.attributes,o=r.getAttributes(),l=i.defaultAttributeValues;for(const i in o){const r=o[i];if(r.location>=0){let o=a[i];if(void 0===o&&("instanceMatrix"===i&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){const i=o.normalized,a=o.itemSize,l=e.get(o);if(void 0===l)continue;const u=l.buffer,h=l.type,d=l.bytesPerElement,f=h===t.INT||h===t.UNSIGNED_INT||o.gpuType===nt;if(o.isInterleavedBufferAttribute){const e=o.data,l=e.stride,m=o.offset;if(e.isInstancedInterleavedBuffer){for(let t=0;t<r.locationSize;t++)A(r.location+t,e.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=e.meshPerAttribute*e.count)}else for(let t=0;t<r.locationSize;t++)c(r.location+t);t.bindBuffer(t.ARRAY_BUFFER,u);for(let t=0;t<r.locationSize;t++)p(r.location+t,a/r.locationSize,h,i,l*d,(m+a/r.locationSize*t)*d,f)}else{if(o.isInstancedBufferAttribute){for(let t=0;t<r.locationSize;t++)A(r.location+t,o.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let t=0;t<r.locationSize;t++)c(r.location+t);t.bindBuffer(t.ARRAY_BUFFER,u);for(let t=0;t<r.locationSize;t++)p(r.location+t,a/r.locationSize,h,i,a*d,a/r.locationSize*t*d,f)}}else if(void 0!==l){const e=l[i];if(void 0!==e)switch(e.length){case 2:t.vertexAttrib2fv(r.location,e);break;case 3:t.vertexAttrib3fv(r.location,e);break;case 4:t.vertexAttrib4fv(r.location,e);break;default:t.vertexAttrib1fv(r.location,e)}}}}d()}(n,r,l,f),null!==m&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(m).buffer))},reset:f,resetDefaultState:m,dispose:function(){f();for(const t in i){const e=i[t];for(const t in e){const n=e[t];for(const t in n)l(n[t].object),delete n[t];delete e[t]}delete i[t]}},releaseStatesOfGeometry:function(t){if(void 0===i[t.id])return;const e=i[t.id];for(const t in e){const n=e[t];for(const t in n)l(n[t].object),delete n[t];delete e[t]}delete i[t.id]},releaseStatesOfProgram:function(t){for(const e in i){const n=i[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)l(r[t].object),delete r[t];delete n[t.id]}},initAttributes:h,enableAttribute:c,disableUnusedAttributes:d}}function Br(t,e,n){let i;function r(e,r,s){0!==s&&(t.drawArraysInstanced(i,e,r,s),n.update(r,i,s))}this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i,1)},this.renderInstances=r,this.renderMultiDraw=function(t,r,s){if(0===s)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,t,0,r,0,s);let a=0;for(let t=0;t<s;t++)a+=r[t];n.update(a,i,1)},this.renderMultiDrawInstances=function(t,s,a,o){if(0===a)return;const l=e.get("WEBGL_multi_draw");if(null===l)for(let e=0;e<t.length;e++)r(t[e],s[e],o[e]);else{l.multiDrawArraysInstancedWEBGL(i,t,0,s,0,o,0,a);let e=0;for(let t=0;t<a;t++)e+=s[t];for(let t=0;t<o.length;t++)n.update(e,i,o[t])}}}function Ur(t,e,n,i){let r;function s(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let a=void 0!==n.precision?n.precision:"highp";const o=s(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=!0===n.logarithmicDepthBuffer,u=!0===n.reverseDepthBuffer&&e.has("EXT_clip_control");if(!0===u){const t=e.get("EXT_clip_control");t.clipControlEXT(t.LOWER_LEFT_EXT,t.ZERO_TO_ONE_EXT)}const h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),c=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:s,textureFormatReadable:function(e){return e===ht||i.convert(e)===t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const r=n===st&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(n!==K&&i.convert(n)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==rt&&!r)},precision:a,logarithmicDepthBuffer:l,reverseDepthBuffer:u,maxTextures:h,maxVertexTextures:c,maxTextureSize:t.getParameter(t.MAX_TEXTURE_SIZE),maxCubemapSize:t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:t.getParameter(t.MAX_VERTEX_ATTRIBS),maxVertexUniforms:t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:t.getParameter(t.MAX_VARYING_VECTORS),maxFragmentUniforms:t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:c>0,maxSamples:t.getParameter(t.MAX_SAMPLES)}}function Or(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new _r,o=new Ce,l={value:null,needsUpdate:!1};function u(t,n,i,r){const s=null!==t?t.length:0;let u=null;if(0!==s){if(u=l.value,!0!==r||null===u){const e=i+4*s,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===u||u.length<e)&&(u=new Float32Array(e));for(let e=0,n=i;e!==s;++e,n+=4)a.copy(t[e]).applyMatrix4(r,o),a.normal.toArray(u,n),u[n+3]=a.constant}l.value=u,l.needsUpdate=!0}return e.numPlanes=s,e.numIntersection=0,u}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const n=0!==t.length||e||0!==i||r;return r=e,i=t.length,n},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(t,e){n=u(t,e,0)},this.setState=function(a,o,h){const c=a.clippingPlanes,A=a.clipIntersection,d=a.clipShadows,p=t.get(a);if(!r||null===c||0===c.length||s&&!d)s?u(null):function(){l.value!==n&&(l.value=n,l.needsUpdate=i>0);e.numPlanes=i,e.numIntersection=0}();else{const t=s?0:i,e=4*t;let r=p.clippingState||null;l.value=r,r=u(c,o,e,h);for(let t=0;t!==e;++t)r[t]=n[t];p.clippingState=r,this.numIntersection=A?this.numPlanes:0,this.numPlanes+=t}}}function Fr(t){let e=new WeakMap;function n(t,e){return 303===e?t.mapping=z:304===e&&(t.mapping=q),t}function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping;if(303===s||304===s){if(e.has(r)){return n(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const a=new mr(s.height);return a.fromEquirectangularTexture(t,r),e.set(r,a),r.addEventListener("dispose",i),n(a.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}let kr=class extends lr{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,s=n+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}};const zr=[.125,.215,.35,.446,.526,.582],qr=20,Gr=new kr,Vr=new Mi;let Hr=null,jr=0,Wr=0,Xr=!1;const Yr=(1+Math.sqrt(5))/2,Qr=1/Yr,$r=[new en(-Yr,Qr,0),new en(Yr,Qr,0),new en(-Qr,0,Yr),new en(Qr,0,Yr),new en(0,Yr,-Qr),new en(0,Yr,Qr),new en(-1,1,-1),new en(1,1,-1),new en(-1,1,1),new en(1,1,1)];let Zr=class{constructor(t){this._renderer=t,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(t,e=0,n=.1,i=100){Hr=this._renderer.getRenderTarget(),jr=this._renderer.getActiveCubeFace(),Wr=this._renderer.getActiveMipmapLevel(),Xr=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=es(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=ts(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Hr,jr,Wr),this._renderer.xr.enabled=Xr,t.scissorTest=!1,Jr(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===z||t.mapping===q?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Hr=this._renderer.getRenderTarget(),jr=this._renderer.getActiveCubeFace(),Wr=this._renderer.getActiveMipmapLevel(),Xr=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:Q,minFilter:Q,generateMipmaps:!1,type:st,format:ht,colorSpace:Qt,depthBuffer:!1},i=Kr(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Kr(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],n=[],i=[];let r=t;const s=t-4+1+zr.length;for(let a=0;a<s;a++){const s=Math.pow(2,r);n.push(s);let o=1/s;a>t-4?o=zr[a-t+4-1]:0===a&&(o=0),i.push(o);const l=1/(s-2),u=-l,h=1+l,c=[u,u,h,u,h,h,u,u,h,h,u,h],A=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*A),y=new Float32Array(f*d*A),v=new Float32Array(m*d*A);for(let t=0;t<A;t++){const e=t%3*2/3-1,n=t>2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(i,p*d*t),y.set(c,f*d*t);const r=[t,t,t,t,t,t];v.set(r,m*d*t)}const _=new Gi;_.setAttribute("position",new Pi(g,p)),_.setAttribute("uv",new Pi(y,f)),_.setAttribute("faceIndex",new Pi(v,m)),e.push(_),r>4&&r--}return{lodPlanes:e,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(t,e,n){const i=new Float32Array(qr),r=new en(0,1,0),s=new or({name:"SphericalGaussianBlur",defines:{n:qr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:ns(),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:0,depthTest:!1,depthWrite:!1});return s}(i,t,e)}return i}_compileMaterial(t){const e=new tr(this._lodPlanes[0],t);this._renderer.compile(e,Gr)}_sceneToCubeUV(t,e,n,i){const r=new Ar(90,1,e,n),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,u=o.toneMapping;o.getClearColor(Vr),o.toneMapping=0,o.autoClear=!1;const h=new Ci({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),c=new tr(new nr,h);let A=!1;const d=t.background;d?d.isColor&&(h.color.copy(d),t.background=null,A=!0):(h.color.copy(Vr),A=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===n?(r.up.set(0,0,s[e]),r.lookAt(0,a[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,a[e]));const l=this._cubeSize;Jr(i,n*l,e>2?l:0,l,l),o.setRenderTarget(i),A&&o.render(c,r),o.render(t,r)}c.geometry.dispose(),c.material.dispose(),o.toneMapping=u,o.autoClear=l,t.background=d}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===z||t.mapping===q;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=es()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=ts());const r=i?this._cubemapMaterial:this._equirectMaterial,s=new tr(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const a=this._cubeSize;Jr(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(s,Gr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const i=this._lodPlanes.length;for(let e=1;e<i;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=$r[(i-e-1)%$r.length];this._blur(t,e-1,e,n,r)}e.autoClear=n}_blur(t,e,n,i,r){const s=this._pingPongRenderTarget;this._halfBlur(t,s,e,n,i,"latitudinal",r),this._halfBlur(s,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,s,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const u=new tr(this._lodPlanes[i],l),h=l.uniforms,c=this._sizeLods[n]-1,A=isFinite(r)?Math.PI/(2*c):2*Math.PI/39,d=r/A,p=isFinite(r)?1+Math.floor(3*d):qr;p>qr&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const f=[];let m=0;for(let t=0;t<qr;++t){const e=t/d,n=Math.exp(-e*e/2);f.push(n),0===t?m+=n:t<p&&(m+=2*n)}for(let t=0;t<f.length;t++)f[t]=f[t]/m;h.envMap.value=t.texture,h.samples.value=p,h.weights.value=f,h.latitudinal.value="latitudinal"===s,a&&(h.poleAxis.value=a);const{_lodMax:g}=this;h.dTheta.value=A,h.mipInt.value=g-n;const y=this._sizeLods[i];Jr(e,3*y*(i>g-4?i-g+4:0),4*(this._cubeSize-y),3*y,2*y),o.setRenderTarget(e),o.render(u,Gr)}};function Kr(t,e,n){const i=new Ze(t,e,n);return i.texture.mapping=G,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Jr(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function ts(){return new or({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ns(),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:0,depthTest:!1,depthWrite:!1})}function es(){return new or({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ns(),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:0,depthTest:!1,depthWrite:!1})}function ns(){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 is(t){let e=new WeakMap,n=null;function i(t){const n=t.target;n.removeEventListener("dispose",i);const r=e.get(n);void 0!==r&&(e.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,a=303===s||304===s,o=s===z||s===q;if(a||o){let s=e.get(r);const l=void 0!==s?s.texture.pmremVersion:0;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return null===n&&(n=new Zr(t)),s=a?n.fromEquirectangular(r,s):n.fromCubemap(r,s),s.texture.pmremVersion=r.pmremVersion,e.set(r,s),s.texture;if(void 0!==s)return s.texture;{const l=r.image;return a&&l&&l.height>0||o&&l&&function(t){let e=0;const n=6;for(let i=0;i<n;i++)void 0!==t[i]&&e++;return e===n}(l)?(null===n&&(n=new Zr(t)),s=a?n.fromEquirectangular(r):n.fromCubemap(r),s.texture.pmremVersion=r.pmremVersion,e.set(r,s),r.addEventListener("dispose",i),s.texture):null}}}return r},dispose:function(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function rs(t){const e={};function n(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}return{has:function(t){return null!==n(t)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(t){const e=n(t);return null===e&&Le("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function ss(t,e,n,i){const r={},s=new WeakMap;function a(t){const o=t.target;null!==o.index&&e.remove(o.index);for(const t in o.attributes)e.remove(o.attributes[t]);for(const t in o.morphAttributes){const n=o.morphAttributes[t];for(let t=0,i=n.length;t<i;t++)e.remove(n[t])}o.removeEventListener("dispose",a),delete r[o.id];const l=s.get(o);l&&(e.remove(l),s.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(t){const n=[],i=t.index,r=t.attributes.position;let a=0;if(null!==i){const t=i.array;a=i.version;for(let e=0,i=t.length;e<i;e+=3){const i=t[e+0],r=t[e+1],s=t[e+2];n.push(i,r,r,s,s,i)}}else{if(void 0===r)return;{const t=r.array;a=r.version;for(let e=0,i=t.length/3-1;e<i;e+=3){const t=e+0,i=e+1,r=e+2;n.push(t,i,i,r,r,t)}}}const o=new(Ne(n)?Ii:Di)(n,1);o.version=a;const l=s.get(t);l&&e.remove(l),s.set(t,o)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",a),r[e.id]=!0,n.memory.geometries++),e},update:function(n){const i=n.attributes;for(const n in i)e.update(i[n],t.ARRAY_BUFFER);const r=n.morphAttributes;for(const n in r){const i=r[n];for(let n=0,r=i.length;n<r;n++)e.update(i[n],t.ARRAY_BUFFER)}},getWireframeAttribute:function(t){const e=s.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&o(t)}else o(t);return s.get(t)}}}function as(t,e,n){let i,r,s;function a(e,a,o){0!==o&&(t.drawElementsInstanced(i,a,r,e*s,o),n.update(a,i,o))}this.setMode=function(t){i=t},this.setIndex=function(t){r=t.type,s=t.bytesPerElement},this.render=function(e,a){t.drawElements(i,a,r,e*s),n.update(a,i,1)},this.renderInstances=a,this.renderMultiDraw=function(t,s,a){if(0===a)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,s,0,r,t,0,a);let o=0;for(let t=0;t<a;t++)o+=s[t];n.update(o,i,1)},this.renderMultiDrawInstances=function(t,o,l,u){if(0===l)return;const h=e.get("WEBGL_multi_draw");if(null===h)for(let e=0;e<t.length;e++)a(t[e]/s,o[e],u[e]);else{h.multiDrawElementsInstancedWEBGL(i,o,0,r,t,0,u,0,l);let e=0;for(let t=0;t<l;t++)e+=o[t];for(let t=0;t<u.length;t++)n.update(e,i,u[t])}}}function os(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(n,i,r){switch(e.calls++,i){case t.TRIANGLES:e.triangles+=r*(n/3);break;case t.LINES:e.lines+=r*(n/2);break;case t.LINE_STRIP:e.lines+=r*(n-1);break;case t.LINE_LOOP:e.lines+=r*n;break;case t.POINTS:e.points+=r*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function ls(t,e,n){const i=new WeakMap,r=new Qe;return{update:function(s,a,o){const l=s.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,h=void 0!==u?u.length:0;let c=i.get(a);if(void 0===c||c.count!==h){void 0!==c&&c.texture.dispose();const A=void 0!==a.morphAttributes.position,d=void 0!==a.morphAttributes.normal,p=void 0!==a.morphAttributes.color,f=a.morphAttributes.position||[],m=a.morphAttributes.normal||[],g=a.morphAttributes.color||[];let y=0;!0===A&&(y=1),!0===d&&(y=2),!0===p&&(y=3);let v=a.attributes.position.count*y,_=1;v>e.maxTextureSize&&(_=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const x=new Float32Array(v*_*4*h),b=new Ke(x,v,_,h);b.type=rt,b.needsUpdate=!0;const S=4*y;for(let w=0;w<h;w++){const T=f[w],E=m[w],C=g[w],R=v*_*4*w;for(let N=0;N<T.count;N++){const P=N*S;!0===A&&(r.fromBufferAttribute(T,N),x[R+P+0]=r.x,x[R+P+1]=r.y,x[R+P+2]=r.z,x[R+P+3]=0),!0===d&&(r.fromBufferAttribute(E,N),x[R+P+4]=r.x,x[R+P+5]=r.y,x[R+P+6]=r.z,x[R+P+7]=0),!0===p&&(r.fromBufferAttribute(C,N),x[R+P+8]=r.x,x[R+P+9]=r.y,x[R+P+10]=r.z,x[R+P+11]=4===C.itemSize?r.w:1)}}function M(){b.dispose(),i.delete(a),a.removeEventListener("dispose",M)}c={count:h,texture:b,size:new Ee(v,_)},i.set(a,c),a.addEventListener("dispose",M)}if(!0===s.isInstancedMesh&&null!==s.morphTexture)o.getUniforms().setValue(t,"morphTexture",s.morphTexture,n);else{let D=0;for(let L=0;L<l.length;L++)D+=l[L];const I=a.morphTargetsRelative?1:1-D;o.getUniforms().setValue(t,"morphTargetBaseInfluence",I),o.getUniforms().setValue(t,"morphTargetInfluences",l)}o.getUniforms().setValue(t,"morphTargetsTexture",c.texture,n),o.getUniforms().setValue(t,"morphTargetsTextureSize",c.size)}}}function us(t,e,n,i){let r=new WeakMap;function s(t){const e=t.target;e.removeEventListener("dispose",s),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(a){const o=i.render.frame,l=a.geometry,u=e.get(a,l);if(r.get(u)!==o&&(e.update(u),r.set(u,o)),a.isInstancedMesh&&(!1===a.hasEventListener("dispose",s)&&a.addEventListener("dispose",s),r.get(a)!==o&&(n.update(a.instanceMatrix,t.ARRAY_BUFFER),null!==a.instanceColor&&n.update(a.instanceColor,t.ARRAY_BUFFER),r.set(a,o))),a.isSkinnedMesh){const t=a.skeleton;r.get(t)!==o&&(t.update(),r.set(t,o))}return u},dispose:function(){r=new WeakMap}}}let hs=class extends Ye{constructor(t,e,n,i,r,s,a,o,l,u=1026){if(u!==ct&&u!==At)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===ct&&(n=it),void 0===n&&u===At&&(n=lt),super(null,i,r,s,a,o,u,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:W,this.minFilter=void 0!==o?o:W,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}};const cs=new Ye,As=new hs(1,1),ds=new Ke,ps=new Je,fs=new fr,ms=[],gs=[],ys=new Float32Array(16),vs=new Float32Array(9),_s=new Float32Array(4);function xs(t,e,n){const i=t[0];if(i<=0||i>0)return t;const r=e*n;let s=ms[r];if(void 0===s&&(s=new Float32Array(r),ms[r]=s),0!==e){i.toArray(s,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(s,r)}return s}function bs(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Ss(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function Ms(t,e){let n=gs[e];void 0===n&&(n=new Int32Array(e),gs[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function ws(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Ts(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(bs(n,e))return;t.uniform2fv(this.addr,e),Ss(n,e)}}function Es(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(bs(n,e))return;t.uniform3fv(this.addr,e),Ss(n,e)}}function Cs(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(bs(n,e))return;t.uniform4fv(this.addr,e),Ss(n,e)}}function Rs(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(bs(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ss(n,e)}else{if(bs(n,i))return;_s.set(i),t.uniformMatrix2fv(this.addr,!1,_s),Ss(n,i)}}function Ns(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(bs(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ss(n,e)}else{if(bs(n,i))return;vs.set(i),t.uniformMatrix3fv(this.addr,!1,vs),Ss(n,i)}}function Ps(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(bs(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ss(n,e)}else{if(bs(n,i))return;ys.set(i),t.uniformMatrix4fv(this.addr,!1,ys),Ss(n,i)}}function Ds(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Is(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(bs(n,e))return;t.uniform2iv(this.addr,e),Ss(n,e)}}function Ls(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(bs(n,e))return;t.uniform3iv(this.addr,e),Ss(n,e)}}function Bs(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(bs(n,e))return;t.uniform4iv(this.addr,e),Ss(n,e)}}function Us(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Os(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(bs(n,e))return;t.uniform2uiv(this.addr,e),Ss(n,e)}}function Fs(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(bs(n,e))return;t.uniform3uiv(this.addr,e),Ss(n,e)}}function ks(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(bs(n,e))return;t.uniform4uiv(this.addr,e),Ss(n,e)}}function zs(t,e,n){const i=this.cache,r=n.allocateTextureUnit();let s;i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),this.type===t.SAMPLER_2D_SHADOW?(As.compareFunction=515,s=As):s=cs,n.setTexture2D(e||s,r)}function qs(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||ps,r)}function Gs(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||fs,r)}function Vs(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||ds,r)}function Hs(t,e){t.uniform1fv(this.addr,e)}function js(t,e){const n=xs(e,this.size,2);t.uniform2fv(this.addr,n)}function Ws(t,e){const n=xs(e,this.size,3);t.uniform3fv(this.addr,n)}function Xs(t,e){const n=xs(e,this.size,4);t.uniform4fv(this.addr,n)}function Ys(t,e){const n=xs(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Qs(t,e){const n=xs(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function $s(t,e){const n=xs(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function Zs(t,e){t.uniform1iv(this.addr,e)}function Ks(t,e){t.uniform2iv(this.addr,e)}function Js(t,e){t.uniform3iv(this.addr,e)}function ta(t,e){t.uniform4iv(this.addr,e)}function ea(t,e){t.uniform1uiv(this.addr,e)}function na(t,e){t.uniform2uiv(this.addr,e)}function ia(t,e){t.uniform3uiv(this.addr,e)}function ra(t,e){t.uniform4uiv(this.addr,e)}function sa(t,e,n){const i=this.cache,r=e.length,s=Ms(n,r);bs(i,s)||(t.uniform1iv(this.addr,s),Ss(i,s));for(let t=0;t!==r;++t)n.setTexture2D(e[t]||cs,s[t])}function aa(t,e,n){const i=this.cache,r=e.length,s=Ms(n,r);bs(i,s)||(t.uniform1iv(this.addr,s),Ss(i,s));for(let t=0;t!==r;++t)n.setTexture3D(e[t]||ps,s[t])}function oa(t,e,n){const i=this.cache,r=e.length,s=Ms(n,r);bs(i,s)||(t.uniform1iv(this.addr,s),Ss(i,s));for(let t=0;t!==r;++t)n.setTextureCube(e[t]||fs,s[t])}function la(t,e,n){const i=this.cache,r=e.length,s=Ms(n,r);bs(i,s)||(t.uniform1iv(this.addr,s),Ss(i,s));for(let t=0;t!==r;++t)n.setTexture2DArray(e[t]||ds,s[t])}class ua{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=function(t){switch(t){case 5126:return ws;case 35664:return Ts;case 35665:return Es;case 35666:return Cs;case 35674:return Rs;case 35675:return Ns;case 35676:return Ps;case 5124:case 35670:return Ds;case 35667:case 35671:return Is;case 35668:case 35672:return Ls;case 35669:case 35673:return Bs;case 5125:return Us;case 36294:return Os;case 36295:return Fs;case 36296:return ks;case 35678:case 36198:case 36298:case 36306:case 35682:return zs;case 35679:case 36299:case 36307:return qs;case 35680:case 36300:case 36308:case 36293:return Gs;case 36289:case 36303:case 36311:case 36292:return Vs}}(e.type)}}class ha{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Hs;case 35664:return js;case 35665:return Ws;case 35666:return Xs;case 35674:return Ys;case 35675:return Qs;case 35676:return $s;case 5124:case 35670:return Zs;case 35667:case 35671:return Ks;case 35668:case 35672:return Js;case 35669:case 35673:return ta;case 5125:return ea;case 36294:return na;case 36295:return ia;case 36296:return ra;case 35678:case 36198:case 36298:case 36306:case 35682:return sa;case 35679:case 36299:case 36307:return aa;case 35680:case 36300:case 36308:case 36293:return oa;case 36289:case 36303:case 36311:case 36292:return la}}(e.type)}}class ca{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const i=this.seq;for(let r=0,s=i.length;r!==s;++r){const s=i[r];s.setValue(t,e[s.id],n)}}}const Aa=/(\w+)(\])?(\[|\.)?/g;function da(t,e){t.seq.push(e),t.map[e.id]=e}function pa(t,e,n){const i=t.name,r=i.length;for(Aa.lastIndex=0;;){const s=Aa.exec(i),a=Aa.lastIndex;let o=s[1];const l="]"===s[2],u=s[3];if(l&&(o|=0),void 0===u||"["===u&&a+2===r){da(n,void 0===u?new ua(o,t,e):new ha(o,t,e));break}{let t=n.map[o];void 0===t&&(t=new ca(o),da(n,t)),n=t}}}class fa{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=t.getActiveUniform(e,i);pa(n,t.getUniformLocation(e,n.name),this)}}setValue(t,e,n,i){const r=this.map[e];void 0!==r&&r.setValue(t,n,i)}setOptional(t,e,n){const i=e[n];void 0!==i&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let r=0,s=e.length;r!==s;++r){const s=e[r],a=n[s.id];!1!==a.needsUpdate&&s.setValue(t,a.value,i)}}static seqWithValue(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const r=t[i];r.id in e&&n.push(r)}return n}}function ma(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}let ga=0;function ya(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(i&&""===r)return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const i=parseInt(s[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(t,e){const n=t.split("\n"),i=[],r=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let t=r;t<s;t++){const r=t+1;i.push(`${r===e?">":" "} ${r}: ${n[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return r}function va(t,e){const n=function(t){const e=ke.getPrimaries(ke.workingColorSpace),n=ke.getPrimaries(t);let i;switch(e===n?i="":e===ee&&n===te?i="LinearDisplayP3ToLinearSRGB":e===te&&n===ee&&(i="LinearSRGBToLinearDisplayP3"),t){case Qt:case Zt:return[i,"LinearTransferOETF"];case Yt:case $t:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function _a(t,e){let n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Cineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const xa=new en;function ba(){ke.getLuminanceCoefficients(xa);return["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${xa.x.toFixed(4)}, ${xa.y.toFixed(4)}, ${xa.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")}function Sa(t){return""!==t}function Ma(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function wa(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Ta=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ea(t){return t.replace(Ta,Ra)}const Ca=new Map;function Ra(t,e){let n=Er[e];if(void 0===n){const t=Ca.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=Er[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return Ea(n)}const Na=/#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 Pa(t){return t.replace(Na,Da)}function Da(t,e,n,i){let r="";for(let t=parseInt(e);t<parseInt(n);t++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return r}function Ia(t){let e=`precision ${t.precision} float;\n\tprecision ${t.precision} int;\n\tprecision ${t.precision} sampler2D;\n\tprecision ${t.precision} samplerCube;\n\tprecision ${t.precision} sampler3D;\n\tprecision ${t.precision} sampler2DArray;\n\tprecision ${t.precision} sampler2DShadow;\n\tprecision ${t.precision} samplerCubeShadow;\n\tprecision ${t.precision} sampler2DArrayShadow;\n\tprecision ${t.precision} isampler2D;\n\tprecision ${t.precision} isampler3D;\n\tprecision ${t.precision} isamplerCube;\n\tprecision ${t.precision} isampler2DArray;\n\tprecision ${t.precision} usampler2D;\n\tprecision ${t.precision} usampler3D;\n\tprecision ${t.precision} usamplerCube;\n\tprecision ${t.precision} usampler2DArray;\n\t`;return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function La(t,e,n,i){const r=t.getContext(),s=n.defines;let a=n.vertexShader,o=n.fragmentShader;const l=function(t){let e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(n),u=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case z:case q:e="ENVMAP_TYPE_CUBE";break;case G:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),h=function(t){let e="ENVMAP_MODE_REFLECTION";t.envMap&&t.envMapMode===q&&(e="ENVMAP_MODE_REFRACTION");return e}(n),c=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(n),A=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}(n),d=function(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Sa).join("\n")}(n),p=function(t){const e=[];for(const n in t){const i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(s),f=r.createProgram();let m,g,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(m=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Sa).join("\n"),m.length>0&&(m+="\n"),g=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Sa).join("\n"),g.length>0&&(g+="\n")):(m=[Ia(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Sa).join("\n"),g=[Ia(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.envMap?"#define "+c:"",A?"#define CUBEUV_TEXEL_WIDTH "+A.texelWidth:"",A?"#define CUBEUV_TEXEL_HEIGHT "+A.texelHeight:"",A?"#define CUBEUV_MAX_MIP "+A.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Er.tonemapping_pars_fragment:"",0!==n.toneMapping?_a("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Er.colorspace_pars_fragment,va("linearToOutputTexel",n.outputColorSpace),ba(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Sa).join("\n")),a=Ea(a),a=Ma(a,n),a=wa(a,n),o=Ea(o),o=Ma(o,n),o=wa(o,n),a=Pa(a),o=Pa(o),!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",m=[d,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#define varying in",n.glslVersion===Ae?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Ae?"":"#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"+g);const v=y+m+a,_=y+g+o,x=ma(r,r.VERTEX_SHADER,v),b=ma(r,r.FRAGMENT_SHADER,_);function S(e){if(t.debug.checkShaderErrors){const n=r.getProgramInfoLog(f).trim(),i=r.getShaderInfoLog(x).trim(),s=r.getShaderInfoLog(b).trim();let a=!0,o=!0;if(!1===r.getProgramParameter(f,r.LINK_STATUS))if(a=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(r,f,x,b);else{const t=ya(r,x,"vertex"),i=ya(r,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(f,r.VALIDATE_STATUS)+"\n\nMaterial Name: "+e.name+"\nMaterial Type: "+e.type+"\n\nProgram Info Log: "+n+"\n"+t+"\n"+i)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==i&&""!==s||(o=!1);o&&(e.diagnostics={runnable:a,programLog:n,vertexShader:{log:i,prefix:m},fragmentShader:{log:s,prefix:g}})}r.deleteShader(x),r.deleteShader(b),M=new fa(r,f),w=function(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r),s=i.name;let a=1;i.type===t.FLOAT_MAT2&&(a=2),i.type===t.FLOAT_MAT3&&(a=3),i.type===t.FLOAT_MAT4&&(a=4),n[s]={type:i.type,location:t.getAttribLocation(e,s),locationSize:a}}return n}(r,f)}let M,w;r.attachShader(f,x),r.attachShader(f,b),void 0!==n.index0AttributeName?r.bindAttribLocation(f,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(f,0,"position"),r.linkProgram(f),this.getUniforms=function(){return void 0===M&&S(this),M},this.getAttributes=function(){return void 0===w&&S(this),w};let T=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===T&&(T=r.getProgramParameter(f,37297)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(f),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=ga++,this.cacheKey=e,this.usedTimes=1,this.program=f,this.vertexShader=x,this.fragmentShader=b,this}let Ba=0;class Ua{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),r=this._getShaderStage(n),s=this._getShaderCacheForMaterial(t);return!1===s.has(i)&&(s.add(i),i.usedTimes++),!1===s.has(r)&&(s.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new Oa(t),e.set(t,n)),n}}class Oa{constructor(t){this.id=Ba++,this.code=t,this.usedTimes=0}}function Fa(t,e,n,i,r,s,a){const o=new Vn,l=new Ua,u=new Set,h=[],c=r.logarithmicDepthBuffer,A=r.reverseDepthBuffer,d=r.vertexTextures;let p=r.precision;const f={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 m(t){return u.add(t),0===t?"uv":`uv${t}`}return{getParameters:function(s,o,h,g,y){const v=g.fog,_=y.geometry,x=s.isMeshStandardMaterial?g.environment:null,b=(s.isMeshStandardMaterial?n:e).get(s.envMap||x),S=b&&b.mapping===G?b.image.height:null,M=f[s.type];null!==s.precision&&(p=r.getMaxPrecision(s.precision),p!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",p,"instead."));const w=_.morphAttributes.position||_.morphAttributes.normal||_.morphAttributes.color,T=void 0!==w?w.length:0;let E,C,R,N,P=0;if(void 0!==_.morphAttributes.position&&(P=1),void 0!==_.morphAttributes.normal&&(P=2),void 0!==_.morphAttributes.color&&(P=3),M){const t=Rr[M];E=t.vertexShader,C=t.fragmentShader}else E=s.vertexShader,C=s.fragmentShader,l.update(s),R=l.getVertexShaderID(s),N=l.getFragmentShaderID(s);const D=t.getRenderTarget(),I=!0===y.isInstancedMesh,L=!0===y.isBatchedMesh,B=!!s.map,U=!!s.matcap,O=!!b,F=!!s.aoMap,k=!!s.lightMap,z=!!s.bumpMap,q=!!s.normalMap,V=!!s.displacementMap,H=!!s.emissiveMap,j=!!s.metalnessMap,W=!!s.roughnessMap,X=s.anisotropy>0,Y=s.clearcoat>0,Q=s.dispersion>0,$=s.iridescence>0,Z=s.sheen>0,K=s.transmission>0,J=X&&!!s.anisotropyMap,tt=Y&&!!s.clearcoatMap,et=Y&&!!s.clearcoatNormalMap,nt=Y&&!!s.clearcoatRoughnessMap,it=$&&!!s.iridescenceMap,rt=$&&!!s.iridescenceThicknessMap,st=Z&&!!s.sheenColorMap,at=Z&&!!s.sheenRoughnessMap,ot=!!s.specularMap,lt=!!s.specularColorMap,ut=!!s.specularIntensityMap,ht=K&&!!s.transmissionMap,ct=K&&!!s.thicknessMap,At=!!s.gradientMap,dt=!!s.alphaMap,pt=s.alphaTest>0,ft=!!s.alphaHash,mt=!!s.extensions;let gt=0;s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(gt=t.toneMapping));const yt={shaderID:M,shaderType:s.type,shaderName:s.name,vertexShader:E,fragmentShader:C,defines:s.defines,customVertexShaderID:R,customFragmentShaderID:N,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,batching:L,batchingColor:L&&null!==y._colorsTexture,instancing:I,instancingColor:I&&null!==y.instanceColor,instancingMorph:I&&null!==y.morphTexture,supportsVertexTextures:d,outputColorSpace:null===D?t.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Qt,alphaToCoverage:!!s.alphaToCoverage,map:B,matcap:U,envMap:O,envMapMode:O&&b.mapping,envMapCubeUVHeight:S,aoMap:F,lightMap:k,bumpMap:z,normalMap:q,displacementMap:d&&V,emissiveMap:H,normalMapObjectSpace:q&&1===s.normalMapType,normalMapTangentSpace:q&&0===s.normalMapType,metalnessMap:j,roughnessMap:W,anisotropy:X,anisotropyMap:J,clearcoat:Y,clearcoatMap:tt,clearcoatNormalMap:et,clearcoatRoughnessMap:nt,dispersion:Q,iridescence:$,iridescenceMap:it,iridescenceThicknessMap:rt,sheen:Z,sheenColorMap:st,sheenRoughnessMap:at,specularMap:ot,specularColorMap:lt,specularIntensityMap:ut,transmission:K,transmissionMap:ht,thicknessMap:ct,gradientMap:At,opaque:!1===s.transparent&&1===s.blending&&!1===s.alphaToCoverage,alphaMap:dt,alphaTest:pt,alphaHash:ft,combine:s.combine,mapUv:B&&m(s.map.channel),aoMapUv:F&&m(s.aoMap.channel),lightMapUv:k&&m(s.lightMap.channel),bumpMapUv:z&&m(s.bumpMap.channel),normalMapUv:q&&m(s.normalMap.channel),displacementMapUv:V&&m(s.displacementMap.channel),emissiveMapUv:H&&m(s.emissiveMap.channel),metalnessMapUv:j&&m(s.metalnessMap.channel),roughnessMapUv:W&&m(s.roughnessMap.channel),anisotropyMapUv:J&&m(s.anisotropyMap.channel),clearcoatMapUv:tt&&m(s.clearcoatMap.channel),clearcoatNormalMapUv:et&&m(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:nt&&m(s.clearcoatRoughnessMap.channel),iridescenceMapUv:it&&m(s.iridescenceMap.channel),iridescenceThicknessMapUv:rt&&m(s.iridescenceThicknessMap.channel),sheenColorMapUv:st&&m(s.sheenColorMap.channel),sheenRoughnessMapUv:at&&m(s.sheenRoughnessMap.channel),specularMapUv:ot&&m(s.specularMap.channel),specularColorMapUv:lt&&m(s.specularColorMap.channel),specularIntensityMapUv:ut&&m(s.specularIntensityMap.channel),transmissionMapUv:ht&&m(s.transmissionMap.channel),thicknessMapUv:ct&&m(s.thicknessMap.channel),alphaMapUv:dt&&m(s.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(q||X),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,pointsUvs:!0===y.isPoints&&!!_.attributes.uv&&(B||dt),fog:!!v,useFog:!0===s.fog,fogExp2:!!v&&v.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:c,reverseDepthBuffer:A,skinning:!0===y.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:T,morphTextureStride:P,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:gt,decodeVideoTexture:B&&!0===s.map.isVideoTexture&&ke.getTransfer(s.map.colorSpace)===Jt,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionClipCullDistance:mt&&!0===s.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(mt&&!0===s.extensions.multiDraw||L)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()};return yt.vertexUv1s=u.has(1),yt.vertexUv2s=u.has(2),yt.vertexUv3s=u.has(3),u.clear(),yt},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){o.disableAll(),e.supportsVertexTextures&&o.enable(0);e.instancing&&o.enable(1);e.instancingColor&&o.enable(2);e.instancingMorph&&o.enable(3);e.matcap&&o.enable(4);e.envMap&&o.enable(5);e.normalMapObjectSpace&&o.enable(6);e.normalMapTangentSpace&&o.enable(7);e.clearcoat&&o.enable(8);e.iridescence&&o.enable(9);e.alphaTest&&o.enable(10);e.vertexColors&&o.enable(11);e.vertexAlphas&&o.enable(12);e.vertexUv1s&&o.enable(13);e.vertexUv2s&&o.enable(14);e.vertexUv3s&&o.enable(15);e.vertexTangents&&o.enable(16);e.anisotropy&&o.enable(17);e.alphaHash&&o.enable(18);e.batching&&o.enable(19);e.dispersion&&o.enable(20);e.batchingColor&&o.enable(21);t.push(o.mask),o.disableAll(),e.fog&&o.enable(0);e.useFog&&o.enable(1);e.flatShading&&o.enable(2);e.logarithmicDepthBuffer&&o.enable(3);e.reverseDepthBuffer&&o.enable(4);e.skinning&&o.enable(5);e.morphTargets&&o.enable(6);e.morphNormals&&o.enable(7);e.morphColors&&o.enable(8);e.premultipliedAlpha&&o.enable(9);e.shadowMapEnabled&&o.enable(10);e.doubleSided&&o.enable(11);e.flipSided&&o.enable(12);e.useDepthPacking&&o.enable(13);e.dithering&&o.enable(14);e.transmission&&o.enable(15);e.sheen&&o.enable(16);e.opaque&&o.enable(17);e.pointsUvs&&o.enable(18);e.decodeVideoTexture&&o.enable(19);e.alphaToCoverage&&o.enable(20);t.push(o.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=f[t.type];let n;if(e){const t=Rr[e];n=ar.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let i;for(let t=0,e=h.length;t<e;t++){const e=h[t];if(e.cacheKey===n){i=e,++i.usedTimes;break}}return void 0===i&&(i=new La(t,n,e,s),h.push(i)),i},releaseProgram:function(t){if(0==--t.usedTimes){const e=h.indexOf(t);h[e]=h[h.length-1],h.pop(),t.destroy()}},releaseShaderCache:function(t){l.remove(t)},programs:h,dispose:function(){l.dispose()}}}function ka(){let t=new WeakMap;return{has:function(e){return t.has(e)},get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}}function za(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function qa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ga(){const t=[];let e=0;const n=[],i=[],r=[];function s(n,i,r,s,a,o){let l=t[e];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:s,renderOrder:n.renderOrder,z:a,group:o},t[e]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=s,l.renderOrder=n.renderOrder,l.z=a,l.group=o),e++,l}return{opaque:n,transmissive:i,transparent:r,init:function(){e=0,n.length=0,i.length=0,r.length=0},push:function(t,e,a,o,l,u){const h=s(t,e,a,o,l,u);a.transmission>0?i.push(h):!0===a.transparent?r.push(h):n.push(h)},unshift:function(t,e,a,o,l,u){const h=s(t,e,a,o,l,u);a.transmission>0?i.unshift(h):!0===a.transparent?r.unshift(h):n.unshift(h)},finish:function(){for(let n=e,i=t.length;n<i;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){n.length>1&&n.sort(t||za),i.length>1&&i.sort(e||qa),r.length>1&&r.sort(e||qa)}}}function Va(){let t=new WeakMap;return{get:function(e,n){const i=t.get(e);let r;return void 0===i?(r=new Ga,t.set(e,[r])):n>=i.length?(r=new Ga,i.push(r)):r=i[n],r},dispose:function(){t=new WeakMap}}}function Ha(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new en,color:new Mi};break;case"SpotLight":n={position:new en,direction:new en,color:new Mi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new en,color:new Mi,distance:0,decay:0};break;case"HemisphereLight":n={direction:new en,skyColor:new Mi,groundColor:new Mi};break;case"RectAreaLight":n={color:new Mi,position:new en,halfWidth:new en,halfHeight:new en}}return t[e.id]=n,n}}}let ja=0;function Wa(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Xa(t){const e=new Ha,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),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 t=0;t<9;t++)i.probe.push(new en);const r=new en,s=new Dn,a=new Dn;return{setup:function(r){let s=0,a=0,o=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0;r.sort(Wa);for(let t=0,v=r.length;t<v;t++){const v=r[t],_=v.color,x=v.intensity,b=v.distance,S=v.shadow&&v.shadow.map?v.shadow.map.texture:null;if(v.isAmbientLight)s+=_.r*x,a+=_.g*x,o+=_.b*x;else if(v.isLightProbe){for(let t=0;t<9;t++)i.probe[t].addScaledVector(v.sh.coefficients[t],x);y++}else if(v.isDirectionalLight){const t=e.get(v);if(t.color.copy(v.color).multiplyScalar(v.intensity),v.castShadow){const t=v.shadow,e=n.get(v);e.shadowIntensity=t.intensity,e.shadowBias=t.bias,e.shadowNormalBias=t.normalBias,e.shadowRadius=t.radius,e.shadowMapSize=t.mapSize,i.directionalShadow[l]=e,i.directionalShadowMap[l]=S,i.directionalShadowMatrix[l]=v.shadow.matrix,d++}i.directional[l]=t,l++}else if(v.isSpotLight){const t=e.get(v);t.position.setFromMatrixPosition(v.matrixWorld),t.color.copy(_).multiplyScalar(x),t.distance=b,t.coneCos=Math.cos(v.angle),t.penumbraCos=Math.cos(v.angle*(1-v.penumbra)),t.decay=v.decay,i.spot[h]=t;const r=v.shadow;if(v.map&&(i.spotLightMap[m]=v.map,m++,r.updateMatrices(v),v.castShadow&&g++),i.spotLightMatrix[h]=r.matrix,v.castShadow){const t=n.get(v);t.shadowIntensity=r.intensity,t.shadowBias=r.bias,t.shadowNormalBias=r.normalBias,t.shadowRadius=r.radius,t.shadowMapSize=r.mapSize,i.spotShadow[h]=t,i.spotShadowMap[h]=S,f++}h++}else if(v.isRectAreaLight){const t=e.get(v);t.color.copy(_).multiplyScalar(x),t.halfWidth.set(.5*v.width,0,0),t.halfHeight.set(0,.5*v.height,0),i.rectArea[c]=t,c++}else if(v.isPointLight){const t=e.get(v);if(t.color.copy(v.color).multiplyScalar(v.intensity),t.distance=v.distance,t.decay=v.decay,v.castShadow){const t=v.shadow,e=n.get(v);e.shadowIntensity=t.intensity,e.shadowBias=t.bias,e.shadowNormalBias=t.normalBias,e.shadowRadius=t.radius,e.shadowMapSize=t.mapSize,e.shadowCameraNear=t.camera.near,e.shadowCameraFar=t.camera.far,i.pointShadow[u]=e,i.pointShadowMap[u]=S,i.pointShadowMatrix[u]=v.shadow.matrix,p++}i.point[u]=t,u++}else if(v.isHemisphereLight){const t=e.get(v);t.skyColor.copy(v.color).multiplyScalar(x),t.groundColor.copy(v.groundColor).multiplyScalar(x),i.hemi[A]=t,A++}}c>0&&(!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=Cr.LTC_FLOAT_1,i.rectAreaLTC2=Cr.LTC_FLOAT_2):(i.rectAreaLTC1=Cr.LTC_HALF_1,i.rectAreaLTC2=Cr.LTC_HALF_2)),i.ambient[0]=s,i.ambient[1]=a,i.ambient[2]=o;const v=i.hash;v.directionalLength===l&&v.pointLength===u&&v.spotLength===h&&v.rectAreaLength===c&&v.hemiLength===A&&v.numDirectionalShadows===d&&v.numPointShadows===p&&v.numSpotShadows===f&&v.numSpotMaps===m&&v.numLightProbes===y||(i.directional.length=l,i.spot.length=h,i.rectArea.length=c,i.point.length=u,i.hemi.length=A,i.directionalShadow.length=d,i.directionalShadowMap.length=d,i.pointShadow.length=p,i.pointShadowMap.length=p,i.spotShadow.length=f,i.spotShadowMap.length=f,i.directionalShadowMatrix.length=d,i.pointShadowMatrix.length=p,i.spotLightMatrix.length=f+m-g,i.spotLightMap.length=m,i.numSpotLightShadowsWithMaps=g,i.numLightProbes=y,v.directionalLength=l,v.pointLength=u,v.spotLength=h,v.rectAreaLength=c,v.hemiLength=A,v.numDirectionalShadows=d,v.numPointShadows=p,v.numSpotShadows=f,v.numSpotMaps=m,v.numLightProbes=y,i.version=ja++)},setupView:function(t,e){let n=0,o=0,l=0,u=0,h=0;const c=e.matrixWorldInverse;for(let e=0,A=t.length;e<A;e++){const A=t[e];if(A.isDirectionalLight){const t=i.directional[n];t.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),t.direction.sub(r),t.direction.transformDirection(c),n++}else if(A.isSpotLight){const t=i.spot[l];t.position.setFromMatrixPosition(A.matrixWorld),t.position.applyMatrix4(c),t.direction.setFromMatrixPosition(A.matrixWorld),r.setFromMatrixPosition(A.target.matrixWorld),t.direction.sub(r),t.direction.transformDirection(c),l++}else if(A.isRectAreaLight){const t=i.rectArea[u];t.position.setFromMatrixPosition(A.matrixWorld),t.position.applyMatrix4(c),a.identity(),s.copy(A.matrixWorld),s.premultiply(c),a.extractRotation(s),t.halfWidth.set(.5*A.width,0,0),t.halfHeight.set(0,.5*A.height,0),t.halfWidth.applyMatrix4(a),t.halfHeight.applyMatrix4(a),u++}else if(A.isPointLight){const t=i.point[o];t.position.setFromMatrixPosition(A.matrixWorld),t.position.applyMatrix4(c),o++}else if(A.isHemisphereLight){const t=i.hemi[h];t.direction.setFromMatrixPosition(A.matrixWorld),t.direction.transformDirection(c),h++}}},state:i}}function Ya(t){const e=new Xa(t),n=[],i=[];const r={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:function(t){r.camera=t,n.length=0,i.length=0},state:r,setupLights:function(){e.setup(n)},setupLightsView:function(t){e.setupView(n,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){i.push(t)}}}function Qa(t){let e=new WeakMap;return{get:function(n,i=0){const r=e.get(n);let s;return void 0===r?(s=new Ya(t),e.set(n,[s])):i>=r.length?(s=new Ya(t),r.push(s)):s=r[i],s},dispose:function(){e=new WeakMap}}}class $a extends Ei{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class Za extends Ei{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function Ka(t,e,n){let i=new Sr;const r=new Ee,s=new Ee,a=new Qe,o=new $a({depthPacking:3201}),l=new Za,u={},h=n.maxTextureSize,p={[c]:1,[A]:0,[d]:2},f=new or({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ee},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}"}),m=f.clone();m.defines.HORIZONTAL_PASS=1;const g=new Gi;g.setAttribute("position",new Pi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const y=new tr(g,f),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;function x(n,i){const s=e.update(y);f.defines.VSM_SAMPLES!==n.blurSamples&&(f.defines.VSM_SAMPLES=n.blurSamples,m.defines.VSM_SAMPLES=n.blurSamples,f.needsUpdate=!0,m.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Ze(r.x,r.y)),f.uniforms.shadow_pass.value=n.map.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,s,f,y,null),m.uniforms.shadow_pass.value=n.mapPass.texture,m.uniforms.resolution.value=n.mapSize,m.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,s,m,y,null)}function b(e,n,i,r){let s=null;const a=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===i.isPointLight?l:o,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=s.uuid,e=n.uuid;let i=u[t];void 0===i&&(i={},u[t]=i);let r=i[e];void 0===r&&(r=s.clone(),i[e]=r,n.addEventListener("dispose",M)),s=r}if(s.visible=n.visible,s.wireframe=n.wireframe,s.side=3===r?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:p[n.side],s.alphaMap=n.alphaMap,s.alphaTest=n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial){t.properties.get(s).light=i}return s}function S(n,r,s,a,o){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n),l=n.material;if(Array.isArray(l)){const e=i.groups;for(let u=0,h=e.length;u<h;u++){const h=e[u],c=l[h.materialIndex];if(c&&c.visible){const e=b(n,c,a,o);n.onBeforeShadow(t,n,r,s,i,e,h),t.renderBufferDirect(s,null,i,e,n,h),n.onAfterShadow(t,n,r,s,i,e,h)}}}else if(l.visible){const e=b(n,l,a,o);n.onBeforeShadow(t,n,r,s,i,e,null),t.renderBufferDirect(s,null,i,e,n,null),n.onAfterShadow(t,n,r,s,i,e,null)}}const l=n.children;for(let t=0,e=l.length;t<e;t++)S(l[t],r,s,a,o)}function M(t){t.target.removeEventListener("dispose",M);for(const e in u){const n=u[e],i=t.target.uuid;if(i in n){n[i].dispose(),delete n[i]}}}this.render=function(e,n,o){if(!1===v.enabled)return;if(!1===v.autoUpdate&&!1===v.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),u=t.getActiveCubeFace(),c=t.getActiveMipmapLevel(),A=t.state;A.setBlending(0),A.buffers.color.setClear(1,1,1,1),A.buffers.depth.setTest(!0),A.setScissorTest(!1);const d=3!==_&&3===this.type,p=3===_&&3!==this.type;for(let l=0,u=e.length;l<u;l++){const u=e[l],c=u.shadow;if(void 0===c){console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");continue}if(!1===c.autoUpdate&&!1===c.needsUpdate)continue;r.copy(c.mapSize);const f=c.getFrameExtents();if(r.multiply(f),s.copy(c.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/f.x),r.x=s.x*f.x,c.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/f.y),r.y=s.y*f.y,c.mapSize.y=s.y)),null===c.map||!0===d||!0===p){const t=3!==this.type?{minFilter:W,magFilter:W}:{};null!==c.map&&c.map.dispose(),c.map=new Ze(r.x,r.y,t),c.map.texture.name=u.name+".shadowMap",c.camera.updateProjectionMatrix()}t.setRenderTarget(c.map),t.clear();const m=c.getViewportCount();for(let t=0;t<m;t++){const e=c.getViewport(t);a.set(s.x*e.x,s.y*e.y,s.x*e.z,s.y*e.w),A.viewport(a),c.updateMatrices(u,t),i=c.getFrustum(),S(n,o,c.camera,u,this.type)}!0!==c.isPointLightShadow&&3===this.type&&x(c,o),c.needsUpdate=!1}_=this.type,v.needsUpdate=!1,t.setRenderTarget(l,u,c)}}const Ja={[D]:1,[L]:6,[U]:7,[B]:5,[I]:0,[F]:2,[k]:4,[O]:3};function to(t){const e=new function(){let e=!1;const n=new Qe;let i=null;const r=new Qe(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,s,a,o){!0===o&&(e*=a,i*=a,s*=a),n.set(e,i,s,a),!1===r.equals(n)&&(t.clearColor(e,i,s,a),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},n=new function(){let e=!1,n=!1,i=null,r=null,s=null;return{setReversed:function(t){n=t},setTest:function(e){e?it(t.DEPTH_TEST):rt(t.DEPTH_TEST)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n&&(e=Ja[e]),r!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}r=e}},setLocked:function(t){e=t},setClear:function(e){s!==e&&(t.clearDepth(e),s=e)},reset:function(){e=!1,i=null,r=null,s=null}}},i=new function(){let e=!1,n=null,i=null,r=null,s=null,a=null,o=null,l=null,u=null;return{setTest:function(n){e||(n?it(t.STENCIL_TEST):rt(t.STENCIL_TEST))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&s===a||(t.stencilFunc(e,n,a),i=e,r=n,s=a)},setOp:function(e,n,i){a===e&&o===n&&l===i||(t.stencilOp(e,n,i),a=e,o=n,l=i)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,n=null,i=null,r=null,s=null,a=null,o=null,l=null,u=null}}},r=new WeakMap,s=new WeakMap;let a={},o={},l=new WeakMap,u=[],h=null,c=!1,A=null,d=null,D=null,I=null,L=null,B=null,U=null,O=new Mi(0,0,0),F=0,k=!1,z=null,q=null,G=null,V=null,H=null;const j=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let W=!1,X=0;const Y=t.getParameter(t.VERSION);-1!==Y.indexOf("WebGL")?(X=parseFloat(/^WebGL (\d)/.exec(Y)[1]),W=X>=1):-1!==Y.indexOf("OpenGL ES")&&(X=parseFloat(/^OpenGL ES (\d)/.exec(Y)[1]),W=X>=2);let Q=null,$={};const Z=t.getParameter(t.SCISSOR_BOX),K=t.getParameter(t.VIEWPORT),J=(new Qe).fromArray(Z),tt=(new Qe).fromArray(K);function et(e,n,i,r){const s=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let a=0;a<i;a++)e===t.TEXTURE_3D||e===t.TEXTURE_2D_ARRAY?t.texImage3D(n,0,t.RGBA,1,1,r,0,t.RGBA,t.UNSIGNED_BYTE,s):t.texImage2D(n+a,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,s);return a}const nt={};function it(e){!0!==a[e]&&(t.enable(e),a[e]=!0)}function rt(e){!1!==a[e]&&(t.disable(e),a[e]=!1)}nt[t.TEXTURE_2D]=et(t.TEXTURE_2D,t.TEXTURE_2D,1),nt[t.TEXTURE_CUBE_MAP]=et(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),nt[t.TEXTURE_2D_ARRAY]=et(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),nt[t.TEXTURE_3D]=et(t.TEXTURE_3D,t.TEXTURE_3D,1,1),e.setClear(0,0,0,1),n.setClear(1),i.setClear(0),it(t.DEPTH_TEST),n.setFunc(3),lt(!1),ut(1),it(t.CULL_FACE),ot(0);const st={[p]:t.FUNC_ADD,[f]:t.FUNC_SUBTRACT,[m]:t.FUNC_REVERSE_SUBTRACT};st[103]=t.MIN,st[104]=t.MAX;const at={[g]:t.ZERO,[y]:t.ONE,[v]:t.SRC_COLOR,[x]:t.SRC_ALPHA,[E]:t.SRC_ALPHA_SATURATE,[w]:t.DST_COLOR,[S]:t.DST_ALPHA,[_]:t.ONE_MINUS_SRC_COLOR,[b]:t.ONE_MINUS_SRC_ALPHA,[T]:t.ONE_MINUS_DST_COLOR,[M]:t.ONE_MINUS_DST_ALPHA,[C]:t.CONSTANT_COLOR,[R]:t.ONE_MINUS_CONSTANT_COLOR,[N]:t.CONSTANT_ALPHA,[P]:t.ONE_MINUS_CONSTANT_ALPHA};function ot(e,n,i,r,s,a,o,l,u,h){if(0!==e){if(!1===c&&(it(t.BLEND),c=!0),5===e)s=s||n,a=a||i,o=o||r,n===d&&s===L||(t.blendEquationSeparate(st[n],st[s]),d=n,L=s),i===D&&r===I&&a===B&&o===U||(t.blendFuncSeparate(at[i],at[r],at[a],at[o]),D=i,I=r,B=a,U=o),!1!==l.equals(O)&&u===F||(t.blendColor(l.r,l.g,l.b,u),O.copy(l),F=u),A=e,k=!1;else if(e!==A||h!==k){if(d===p&&L===p||(t.blendEquation(t.FUNC_ADD),d=p,L=p),h)switch(e){case 1:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.ONE,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}D=null,I=null,B=null,U=null,O.set(0,0,0),F=0,A=e,k=h}}else!0===c&&(rt(t.BLEND),c=!1)}function lt(e){z!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),z=e)}function ut(e){0!==e?(it(t.CULL_FACE),e!==q&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):rt(t.CULL_FACE),q=e}function ht(e,n,i){e?(it(t.POLYGON_OFFSET_FILL),V===n&&H===i||(t.polygonOffset(n,i),V=n,H=i)):rt(t.POLYGON_OFFSET_FILL)}return{buffers:{color:e,depth:n,stencil:i},enable:it,disable:rt,bindFramebuffer:function(e,n){return o[e]!==n&&(t.bindFramebuffer(e,n),o[e]=n,e===t.DRAW_FRAMEBUFFER&&(o[t.FRAMEBUFFER]=n),e===t.FRAMEBUFFER&&(o[t.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(e,n){let i=u,r=!1;if(e){i=l.get(n),void 0===i&&(i=[],l.set(n,i));const s=e.textures;if(i.length!==s.length||i[0]!==t.COLOR_ATTACHMENT0){for(let e=0,n=s.length;e<n;e++)i[e]=t.COLOR_ATTACHMENT0+e;i.length=s.length,r=!0}}else i[0]!==t.BACK&&(i[0]=t.BACK,r=!0);r&&t.drawBuffers(i)},useProgram:function(e){return h!==e&&(t.useProgram(e),h=e,!0)},setBlending:ot,setMaterial:function(r,s){2===r.side?rt(t.CULL_FACE):it(t.CULL_FACE);let a=1===r.side;s&&(a=!a),lt(a),1===r.blending&&!1===r.transparent?ot(0):ot(r.blending,r.blendEquation,r.blendSrc,r.blendDst,r.blendEquationAlpha,r.blendSrcAlpha,r.blendDstAlpha,r.blendColor,r.blendAlpha,r.premultipliedAlpha),n.setFunc(r.depthFunc),n.setTest(r.depthTest),n.setMask(r.depthWrite),e.setMask(r.colorWrite);const o=r.stencilWrite;i.setTest(o),o&&(i.setMask(r.stencilWriteMask),i.setFunc(r.stencilFunc,r.stencilRef,r.stencilFuncMask),i.setOp(r.stencilFail,r.stencilZFail,r.stencilZPass)),ht(r.polygonOffset,r.polygonOffsetFactor,r.polygonOffsetUnits),!0===r.alphaToCoverage?it(t.SAMPLE_ALPHA_TO_COVERAGE):rt(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:lt,setCullFace:ut,setLineWidth:function(e){e!==G&&(W&&t.lineWidth(e),G=e)},setPolygonOffset:ht,setScissorTest:function(e){e?it(t.SCISSOR_TEST):rt(t.SCISSOR_TEST)},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+j-1),Q!==e&&(t.activeTexture(e),Q=e)},bindTexture:function(e,n,i){void 0===i&&(i=null===Q?t.TEXTURE0+j-1:Q);let r=$[i];void 0===r&&(r={type:void 0,texture:void 0},$[i]=r),r.type===e&&r.texture===n||(Q!==i&&(t.activeTexture(i),Q=i),t.bindTexture(e,n||nt[e]),r.type=e,r.texture=n)},unbindTexture:function(){const e=$[Q];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(e,n){let i=s.get(n);void 0===i&&(i=new WeakMap,s.set(n,i));let r=i.get(e);void 0===r&&(r=t.getUniformBlockIndex(n,e.name),i.set(e,r))},uniformBlockBinding:function(e,n){const i=s.get(n).get(e);r.get(n)!==i&&(t.uniformBlockBinding(n,i,e.__bindingPointIndex),r.set(n,i))},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===J.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),J.copy(e))},viewport:function(e){!1===tt.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),tt.copy(e))},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),a={},Q=null,$={},o={},l=new WeakMap,u=[],h=null,c=!1,A=null,d=null,D=null,I=null,L=null,B=null,U=null,O=new Mi(0,0,0),F=0,k=!1,z=null,q=null,G=null,V=null,H=null,J.set(0,0,t.canvas.width,t.canvas.height),tt.set(0,0,t.canvas.width,t.canvas.height),e.reset(),n.reset(),i.reset()}}}function eo(t,e,n,i){const r=function(t){switch(t){case K:case J:return{byteLength:1,components:1};case et:case tt:case st:return{byteLength:2,components:1};case at:case ot:return{byteLength:2,components:4};case it:case nt:case rt:return{byteLength:4,components:1};case ut:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}(i);switch(n){case 1021:case 1024:return t*e;case 1025:return t*e*2;case 1028:case dt:return t*e/r.components*r.byteLength;case 1030:case pt:return t*e*2/r.components*r.byteLength;case 1022:return t*e*3/r.components*r.byteLength;case ht:case ft:return t*e*4/r.components*r.byteLength;case mt:case gt:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case yt:case vt:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case xt:case St:return Math.max(t,16)*Math.max(e,8)/4;case _t:case bt:return Math.max(t,8)*Math.max(e,8)/2;case Mt:case wt:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case Tt:case Et:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case Ct:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case Rt:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case Nt:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case Pt:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case Dt:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case It:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case Lt:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case Bt:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case Ut:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case Ot:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case Ft:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case kt:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case zt:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case qt:case Gt:case Vt:return Math.ceil(t/4)*Math.ceil(e/4)*16;case 36283:case Ht:return Math.ceil(t/4)*Math.ceil(e/4)*8;case jt:case Wt:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function no(t,e,n,i,r,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),u=new Ee,h=new WeakMap;let c;const A=new WeakMap;let d=!1;try{d="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function p(t,e){return d?new OffscreenCanvas(t,e):Pe("canvas")}function f(t,e,n){let i=1;const r=z(t);if((r.width>n||r.height>n)&&(i=n/Math.max(r.width,r.height)),i<1){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&t instanceof VideoFrame){const n=Math.floor(i*r.width),s=Math.floor(i*r.height);void 0===c&&(c=p(n,s));const a=e?p(n,s):c;a.width=n,a.height=s;return a.getContext("2d").drawImage(t,0,0,n,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+r.width+"x"+r.height+") to ("+n+"x"+s+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+r.width+"x"+r.height+")."),t}return t}function m(t){return t.generateMipmaps&&t.minFilter!==W&&t.minFilter!==Q}function g(e){t.generateMipmap(e)}function y(n,i,r,s,a=!1){if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=i;if(i===t.RED&&(r===t.FLOAT&&(o=t.R32F),r===t.HALF_FLOAT&&(o=t.R16F),r===t.UNSIGNED_BYTE&&(o=t.R8)),i===t.RED_INTEGER&&(r===t.UNSIGNED_BYTE&&(o=t.R8UI),r===t.UNSIGNED_SHORT&&(o=t.R16UI),r===t.UNSIGNED_INT&&(o=t.R32UI),r===t.BYTE&&(o=t.R8I),r===t.SHORT&&(o=t.R16I),r===t.INT&&(o=t.R32I)),i===t.RG&&(r===t.FLOAT&&(o=t.RG32F),r===t.HALF_FLOAT&&(o=t.RG16F),r===t.UNSIGNED_BYTE&&(o=t.RG8)),i===t.RG_INTEGER&&(r===t.UNSIGNED_BYTE&&(o=t.RG8UI),r===t.UNSIGNED_SHORT&&(o=t.RG16UI),r===t.UNSIGNED_INT&&(o=t.RG32UI),r===t.BYTE&&(o=t.RG8I),r===t.SHORT&&(o=t.RG16I),r===t.INT&&(o=t.RG32I)),i===t.RGB_INTEGER&&(r===t.UNSIGNED_BYTE&&(o=t.RGB8UI),r===t.UNSIGNED_SHORT&&(o=t.RGB16UI),r===t.UNSIGNED_INT&&(o=t.RGB32UI),r===t.BYTE&&(o=t.RGB8I),r===t.SHORT&&(o=t.RGB16I),r===t.INT&&(o=t.RGB32I)),i===t.RGBA_INTEGER&&(r===t.UNSIGNED_BYTE&&(o=t.RGBA8UI),r===t.UNSIGNED_SHORT&&(o=t.RGBA16UI),r===t.UNSIGNED_INT&&(o=t.RGBA32UI),r===t.BYTE&&(o=t.RGBA8I),r===t.SHORT&&(o=t.RGBA16I),r===t.INT&&(o=t.RGBA32I)),i===t.RGB&&r===t.UNSIGNED_INT_5_9_9_9_REV&&(o=t.RGB9_E5),i===t.RGBA){const e=a?Kt:ke.getTransfer(s);r===t.FLOAT&&(o=t.RGBA32F),r===t.HALF_FLOAT&&(o=t.RGBA16F),r===t.UNSIGNED_BYTE&&(o=e===Jt?t.SRGB8_ALPHA8:t.RGBA8),r===t.UNSIGNED_SHORT_4_4_4_4&&(o=t.RGBA4),r===t.UNSIGNED_SHORT_5_5_5_1&&(o=t.RGB5_A1)}return o!==t.R16F&&o!==t.R32F&&o!==t.RG16F&&o!==t.RG32F&&o!==t.RGBA16F&&o!==t.RGBA32F||e.get("EXT_color_buffer_float"),o}function v(e,n){let i;return e?null===n||n===it||n===lt?i=t.DEPTH24_STENCIL8:n===rt?i=t.DEPTH32F_STENCIL8:n===et&&(i=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||n===it||n===lt?i=t.DEPTH_COMPONENT24:n===rt?i=t.DEPTH_COMPONENT32F:n===et&&(i=t.DEPTH_COMPONENT16),i}function _(t,e){return!0===m(t)||t.isFramebufferTexture&&t.minFilter!==W&&t.minFilter!==Q?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function x(t){const e=t.target;e.removeEventListener("dispose",x),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const n=t.source,r=A.get(n);if(r){const i=r[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&S(t),0===Object.keys(r).length&&A.delete(n)}i.remove(t)}(e),e.isVideoTexture&&h.delete(e)}function b(e){const n=e.target;n.removeEventListener("dispose",b),function(e){const n=i.get(e);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let i=0;i<n.__webglFramebuffer[e].length;i++)t.deleteFramebuffer(n.__webglFramebuffer[e][i]);else t.deleteFramebuffer(n.__webglFramebuffer[e]);n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e])}else{if(Array.isArray(n.__webglFramebuffer))for(let e=0;e<n.__webglFramebuffer.length;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let e=0;e<n.__webglColorRenderbuffer.length;e++)n.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(n.__webglColorRenderbuffer[e]);n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const r=e.textures;for(let e=0,n=r.length;e<n;e++){const n=i.get(r[e]);n.__webglTexture&&(t.deleteTexture(n.__webglTexture),a.memory.textures--),i.remove(r[e])}i.remove(e)}(n)}function S(e){const n=i.get(e);t.deleteTexture(n.__webglTexture);const r=e.source;delete A.get(r)[n.__cacheKey],a.memory.textures--}let M=0;function w(e,r){const s=i.get(e);if(e.isVideoTexture&&function(t){const e=a.render.frame;h.get(t)!==e&&(h.set(t,e),t.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&s.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void P(s,e,r);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+r)}const T={[V]:t.REPEAT,[H]:t.CLAMP_TO_EDGE,[j]:t.MIRRORED_REPEAT},E={[W]:t.NEAREST,[X]:t.NEAREST_MIPMAP_NEAREST,[Y]:t.NEAREST_MIPMAP_LINEAR,[Q]:t.LINEAR,[$]:t.LINEAR_MIPMAP_NEAREST,[Z]:t.LINEAR_MIPMAP_LINEAR},C={[ie]:t.NEVER,[he]:t.ALWAYS,[re]:t.LESS,[ae]:t.LEQUAL,[se]:t.EQUAL,[ue]:t.GEQUAL,[oe]:t.GREATER,[le]:t.NOTEQUAL};function R(n,s){if(s.type!==rt||!1!==e.has("OES_texture_float_linear")||s.magFilter!==Q&&s.magFilter!==$&&s.magFilter!==Y&&s.magFilter!==Z&&s.minFilter!==Q&&s.minFilter!==$&&s.minFilter!==Y&&s.minFilter!==Z||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(n,t.TEXTURE_WRAP_S,T[s.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,T[s.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,T[s.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,E[s.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,E[s.minFilter]),s.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,C[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){if(s.magFilter===W)return;if(s.minFilter!==Y&&s.minFilter!==Z)return;if(s.type===rt&&!1===e.has("OES_texture_float_linear"))return;if(s.anisotropy>1||i.get(s).__currentAnisotropy){const a=e.get("EXT_texture_filter_anisotropic");t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy}}}function N(e,n){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",x));const r=n.source;let s=A.get(r);void 0===s&&(s={},A.set(r,s));const o=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(o!==e.__cacheKey){void 0===s[o]&&(s[o]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,i=!0),s[o].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&S(n)),e.__cacheKey=o,e.__webglTexture=s[o].texture}return i}function P(e,a,o){let l=t.TEXTURE_2D;(a.isDataArrayTexture||a.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),a.isData3DTexture&&(l=t.TEXTURE_3D);const u=N(e,a),h=a.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+o);const c=i.get(h);if(h.version!==c.__version||!0===u){n.activeTexture(t.TEXTURE0+o);const e=ke.getPrimaries(ke.workingColorSpace),i=a.colorSpace===Xt?null:ke.getPrimaries(a.colorSpace),A=a.colorSpace===Xt||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,a.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,a.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,A);let d=f(a.image,!1,r.maxTextureSize);d=k(a,d);const p=s.convert(a.format,a.colorSpace),x=s.convert(a.type);let b,S=y(a.internalFormat,p,x,a.colorSpace,a.isVideoTexture);R(l,a);const M=a.mipmaps,w=!0!==a.isVideoTexture,T=void 0===c.__version||!0===u,E=h.dataReady,C=_(a,d);if(a.isDepthTexture)S=v(a.format===At,a.type),T&&(w?n.texStorage2D(t.TEXTURE_2D,1,S,d.width,d.height):n.texImage2D(t.TEXTURE_2D,0,S,d.width,d.height,0,p,x,null));else if(a.isDataTexture)if(M.length>0){w&&T&&n.texStorage2D(t.TEXTURE_2D,C,S,M[0].width,M[0].height);for(let e=0,i=M.length;e<i;e++)b=M[e],w?E&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,b.width,b.height,p,x,b.data):n.texImage2D(t.TEXTURE_2D,e,S,b.width,b.height,0,p,x,b.data);a.generateMipmaps=!1}else w?(T&&n.texStorage2D(t.TEXTURE_2D,C,S,d.width,d.height),E&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,d.width,d.height,p,x,d.data)):n.texImage2D(t.TEXTURE_2D,0,S,d.width,d.height,0,p,x,d.data);else if(a.isCompressedTexture)if(a.isCompressedArrayTexture){w&&T&&n.texStorage3D(t.TEXTURE_2D_ARRAY,C,S,M[0].width,M[0].height,d.depth);for(let e=0,i=M.length;e<i;e++)if(b=M[e],a.format!==ht)if(null!==p)if(w){if(E)if(a.layerUpdates.size>0){const i=eo(b.width,b.height,a.format,a.type);for(const r of a.layerUpdates){const s=b.data.subarray(r*i/b.data.BYTES_PER_ELEMENT,(r+1)*i/b.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,r,b.width,b.height,1,p,s,0,0)}a.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,b.width,b.height,d.depth,p,b.data,0,0)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,S,b.width,b.height,d.depth,0,b.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else w?E&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,b.width,b.height,d.depth,p,x,b.data):n.texImage3D(t.TEXTURE_2D_ARRAY,e,S,b.width,b.height,d.depth,0,p,x,b.data)}else{w&&T&&n.texStorage2D(t.TEXTURE_2D,C,S,M[0].width,M[0].height);for(let e=0,i=M.length;e<i;e++)b=M[e],a.format!==ht?null!==p?w?E&&n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,b.width,b.height,p,b.data):n.compressedTexImage2D(t.TEXTURE_2D,e,S,b.width,b.height,0,b.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):w?E&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,b.width,b.height,p,x,b.data):n.texImage2D(t.TEXTURE_2D,e,S,b.width,b.height,0,p,x,b.data)}else if(a.isDataArrayTexture)if(w){if(T&&n.texStorage3D(t.TEXTURE_2D_ARRAY,C,S,d.width,d.height,d.depth),E)if(a.layerUpdates.size>0){const e=eo(d.width,d.height,a.format,a.type);for(const i of a.layerUpdates){const r=d.data.subarray(i*e/d.data.BYTES_PER_ELEMENT,(i+1)*e/d.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,i,d.width,d.height,1,p,x,r)}a.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,d.width,d.height,d.depth,p,x,d.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,S,d.width,d.height,d.depth,0,p,x,d.data);else if(a.isData3DTexture)w?(T&&n.texStorage3D(t.TEXTURE_3D,C,S,d.width,d.height,d.depth),E&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,d.width,d.height,d.depth,p,x,d.data)):n.texImage3D(t.TEXTURE_3D,0,S,d.width,d.height,d.depth,0,p,x,d.data);else if(a.isFramebufferTexture){if(T)if(w)n.texStorage2D(t.TEXTURE_2D,C,S,d.width,d.height);else{let e=d.width,i=d.height;for(let r=0;r<C;r++)n.texImage2D(t.TEXTURE_2D,r,S,e,i,0,p,x,null),e>>=1,i>>=1}}else if(M.length>0){if(w&&T){const e=z(M[0]);n.texStorage2D(t.TEXTURE_2D,C,S,e.width,e.height)}for(let e=0,i=M.length;e<i;e++)b=M[e],w?E&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,p,x,b):n.texImage2D(t.TEXTURE_2D,e,S,p,x,b);a.generateMipmaps=!1}else if(w){if(T){const e=z(d);n.texStorage2D(t.TEXTURE_2D,C,S,e.width,e.height)}E&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,p,x,d)}else n.texImage2D(t.TEXTURE_2D,0,S,p,x,d);m(a)&&g(l),c.__version=h.version,a.onUpdate&&a.onUpdate(a)}e.__version=a.version}function D(e,r,a,l,u,h){const c=s.convert(a.format,a.colorSpace),A=s.convert(a.type),d=y(a.internalFormat,c,A,a.colorSpace);if(!i.get(r).__hasExternalTextures){const e=Math.max(1,r.width>>h),i=Math.max(1,r.height>>h);u===t.TEXTURE_3D||u===t.TEXTURE_2D_ARRAY?n.texImage3D(u,h,d,e,i,r.depth,0,c,A,null):n.texImage2D(u,h,d,e,i,0,c,A,null)}n.bindFramebuffer(t.FRAMEBUFFER,e),F(r)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,l,u,i.get(a).__webglTexture,0,O(r)):(u===t.TEXTURE_2D||u>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,l,u,i.get(a).__webglTexture,h),n.bindFramebuffer(t.FRAMEBUFFER,null)}function I(e,n,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer){const r=n.depthTexture,s=r&&r.isDepthTexture?r.type:null,a=v(n.stencilBuffer,s),l=n.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,u=O(n);F(n)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,u,a,n.width,n.height):i?t.renderbufferStorageMultisample(t.RENDERBUFFER,u,a,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,a,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,l,t.RENDERBUFFER,e)}else{const e=n.textures;for(let r=0;r<e.length;r++){const a=e[r],l=s.convert(a.format,a.colorSpace),u=s.convert(a.type),h=y(a.internalFormat,l,u,a.colorSpace),c=O(n);i&&!1===F(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,c,h,n.width,n.height):F(n)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,c,h,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,h,n.width,n.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function L(e){const r=i.get(e),s=!0===e.isWebGLCubeRenderTarget;if(r.__boundDepthTexture!==e.depthTexture){const t=e.depthTexture;if(r.__depthDisposeCallback&&r.__depthDisposeCallback(),t){const e=()=>{delete r.__boundDepthTexture,delete r.__depthDisposeCallback,t.removeEventListener("dispose",e)};t.addEventListener("dispose",e),r.__depthDisposeCallback=e}r.__boundDepthTexture=t}if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),w(r.depthTexture,0);const s=i.get(r.depthTexture).__webglTexture,a=O(r);if(r.depthTexture.format===ct)F(r)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,s,0);else{if(r.depthTexture.format!==At)throw new Error("Unknown depthTexture format");F(r)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,s,0)}}(r.__webglFramebuffer,e)}else if(s){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)if(n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer[i]),void 0===r.__webglDepthbuffer[i])r.__webglDepthbuffer[i]=t.createRenderbuffer(),I(r.__webglDepthbuffer[i],e,!1);else{const n=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,s=r.__webglDepthbuffer[i];t.bindRenderbuffer(t.RENDERBUFFER,s),t.framebufferRenderbuffer(t.FRAMEBUFFER,n,t.RENDERBUFFER,s)}}else if(n.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer),void 0===r.__webglDepthbuffer)r.__webglDepthbuffer=t.createRenderbuffer(),I(r.__webglDepthbuffer,e,!1);else{const n=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,i=r.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,i),t.framebufferRenderbuffer(t.FRAMEBUFFER,n,t.RENDERBUFFER,i)}n.bindFramebuffer(t.FRAMEBUFFER,null)}const B=[],U=[];function O(t){return Math.min(r.maxSamples,t.samples)}function F(t){const n=i.get(t);return t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function k(t,e){const n=t.colorSpace,i=t.format,r=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||n!==Qt&&n!==Xt&&(ke.getTransfer(n)===Jt?i===ht&&r===K||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),e}function z(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?(u.width=t.naturalWidth||t.width,u.height=t.naturalHeight||t.height):"undefined"!=typeof VideoFrame&&t instanceof VideoFrame?(u.width=t.displayWidth,u.height=t.displayHeight):(u.width=t.width,u.height=t.height),u}this.allocateTextureUnit=function(){const t=M;return t>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+r.maxTextures),M+=1,t},this.resetTextureUnits=function(){M=0},this.setTexture2D=w,this.setTexture2DArray=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?P(s,e,r):n.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+r)},this.setTexture3D=function(e,r){const s=i.get(e);e.version>0&&s.__version!==e.version?P(s,e,r):n.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+r)},this.setTextureCube=function(e,a){const o=i.get(e);e.version>0&&o.__version!==e.version?function(e,a,o){if(6!==a.image.length)return;const l=N(e,a),u=a.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+o);const h=i.get(u);if(u.version!==h.__version||!0===l){n.activeTexture(t.TEXTURE0+o);const e=ke.getPrimaries(ke.workingColorSpace),i=a.colorSpace===Xt?null:ke.getPrimaries(a.colorSpace),c=a.colorSpace===Xt||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,a.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,a.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,c);const A=a.isCompressedTexture||a.image[0].isCompressedTexture,d=a.image[0]&&a.image[0].isDataTexture,p=[];for(let t=0;t<6;t++)p[t]=A||d?d?a.image[t].image:a.image[t]:f(a.image[t],!0,r.maxCubemapSize),p[t]=k(a,p[t]);const v=p[0],x=s.convert(a.format,a.colorSpace),b=s.convert(a.type),S=y(a.internalFormat,x,b,a.colorSpace),M=!0!==a.isVideoTexture,w=void 0===h.__version||!0===l,T=u.dataReady;let E,C=_(a,v);if(R(t.TEXTURE_CUBE_MAP,a),A){M&&w&&n.texStorage2D(t.TEXTURE_CUBE_MAP,C,S,v.width,v.height);for(let e=0;e<6;e++){E=p[e].mipmaps;for(let i=0;i<E.length;i++){const r=E[i];a.format!==ht?null!==x?M?T&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,r.width,r.height,x,r.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,S,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,0,0,r.width,r.height,x,b,r.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i,S,r.width,r.height,0,x,b,r.data)}}}else{if(E=a.mipmaps,M&&w){E.length>0&&C++;const e=z(p[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,C,S,e.width,e.height)}for(let e=0;e<6;e++)if(d){M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,p[e].width,p[e].height,x,b,p[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,p[e].width,p[e].height,0,x,b,p[e].data);for(let i=0;i<E.length;i++){const r=E[i].image[e].image;M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,r.width,r.height,x,b,r.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,S,r.width,r.height,0,x,b,r.data)}}else{M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,x,b,p[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,x,b,p[e]);for(let i=0;i<E.length;i++){const r=E[i];M?T&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,0,0,x,b,r.image[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i+1,S,x,b,r.image[e])}}}m(a)&&g(t.TEXTURE_CUBE_MAP),h.__version=u.version,a.onUpdate&&a.onUpdate(a)}e.__version=a.version}(o,e,a):n.bindTexture(t.TEXTURE_CUBE_MAP,o.__webglTexture,t.TEXTURE0+a)},this.rebindTextures=function(e,n,r){const s=i.get(e);void 0!==n&&D(s.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),void 0!==r&&L(e)},this.setupRenderTarget=function(e){const r=e.texture,o=i.get(e),l=i.get(r);e.addEventListener("dispose",b);const u=e.textures,h=!0===e.isWebGLCubeRenderTarget,c=u.length>1;if(c||(void 0===l.__webglTexture&&(l.__webglTexture=t.createTexture()),l.__version=r.version,a.memory.textures++),h){o.__webglFramebuffer=[];for(let e=0;e<6;e++)if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer[e]=[];for(let n=0;n<r.mipmaps.length;n++)o.__webglFramebuffer[e][n]=t.createFramebuffer()}else o.__webglFramebuffer[e]=t.createFramebuffer()}else{if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer=[];for(let e=0;e<r.mipmaps.length;e++)o.__webglFramebuffer[e]=t.createFramebuffer()}else o.__webglFramebuffer=t.createFramebuffer();if(c)for(let e=0,n=u.length;e<n;e++){const n=i.get(u[e]);void 0===n.__webglTexture&&(n.__webglTexture=t.createTexture(),a.memory.textures++)}if(e.samples>0&&!1===F(e)){o.__webglMultisampledFramebuffer=t.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n<u.length;n++){const i=u[n];o.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,o.__webglColorRenderbuffer[n]);const r=s.convert(i.format,i.colorSpace),a=s.convert(i.type),l=y(i.internalFormat,r,a,i.colorSpace,!0===e.isXRRenderTarget),h=O(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,h,l,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,o.__webglColorRenderbuffer[n])}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(o.__webglDepthRenderbuffer=t.createRenderbuffer(),I(o.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(h){n.bindTexture(t.TEXTURE_CUBE_MAP,l.__webglTexture),R(t.TEXTURE_CUBE_MAP,r);for(let n=0;n<6;n++)if(r.mipmaps&&r.mipmaps.length>0)for(let i=0;i<r.mipmaps.length;i++)D(o.__webglFramebuffer[n][i],e,r,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,i);else D(o.__webglFramebuffer[n],e,r,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);m(r)&&g(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(c){for(let r=0,s=u.length;r<s;r++){const s=u[r],a=i.get(s);n.bindTexture(t.TEXTURE_2D,a.__webglTexture),R(t.TEXTURE_2D,s),D(o.__webglFramebuffer,e,s,t.COLOR_ATTACHMENT0+r,t.TEXTURE_2D,0),m(s)&&g(t.TEXTURE_2D)}n.unbindTexture()}else{let i=t.TEXTURE_2D;if((e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(i=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(i,l.__webglTexture),R(i,r),r.mipmaps&&r.mipmaps.length>0)for(let n=0;n<r.mipmaps.length;n++)D(o.__webglFramebuffer[n],e,r,t.COLOR_ATTACHMENT0,i,n);else D(o.__webglFramebuffer,e,r,t.COLOR_ATTACHMENT0,i,0);m(r)&&g(i),n.unbindTexture()}e.depthBuffer&&L(e)},this.updateRenderTargetMipmap=function(e){const r=e.textures;for(let s=0,a=r.length;s<a;s++){const a=r[s];if(m(a)){const r=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,s=i.get(a).__webglTexture;n.bindTexture(r,s),g(r),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(e.samples>0)if(!1===F(e)){const r=e.textures,s=e.width,a=e.height;let o=t.COLOR_BUFFER_BIT;const u=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),c=r.length>1;if(c)for(let e=0;e<r.length;e++)n.bindFramebuffer(t.FRAMEBUFFER,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,h.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,h.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,h.__webglFramebuffer);for(let n=0;n<r.length;n++){if(e.resolveDepthBuffer&&(e.depthBuffer&&(o|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&e.resolveStencilBuffer&&(o|=t.STENCIL_BUFFER_BIT)),c){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,h.__webglColorRenderbuffer[n]);const e=i.get(r[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,s,a,0,0,s,a,o,t.NEAREST),!0===l&&(B.length=0,U.length=0,B.push(t.COLOR_ATTACHMENT0+n),e.depthBuffer&&!1===e.resolveDepthBuffer&&(B.push(u),U.push(u),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,U)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,B))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),c)for(let e=0;e<r.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,h.__webglColorRenderbuffer[e]);const s=i.get(r[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,h.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,s,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,h.__webglMultisampledFramebuffer)}else if(e.depthBuffer&&!1===e.resolveDepthBuffer&&l){const n=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=L,this.setupFrameBufferTexture=D,this.useMultisampledRTT=F}function io(t,e){return{convert:function(n,i=""){let r;const s=ke.getTransfer(i);if(n===K)return t.UNSIGNED_BYTE;if(n===at)return t.UNSIGNED_SHORT_4_4_4_4;if(n===ot)return t.UNSIGNED_SHORT_5_5_5_1;if(n===ut)return t.UNSIGNED_INT_5_9_9_9_REV;if(n===J)return t.BYTE;if(n===tt)return t.SHORT;if(n===et)return t.UNSIGNED_SHORT;if(n===nt)return t.INT;if(n===it)return t.UNSIGNED_INT;if(n===rt)return t.FLOAT;if(n===st)return t.HALF_FLOAT;if(1021===n)return t.ALPHA;if(1022===n)return t.RGB;if(n===ht)return t.RGBA;if(1024===n)return t.LUMINANCE;if(1025===n)return t.LUMINANCE_ALPHA;if(n===ct)return t.DEPTH_COMPONENT;if(n===At)return t.DEPTH_STENCIL;if(1028===n)return t.RED;if(n===dt)return t.RED_INTEGER;if(1030===n)return t.RG;if(n===pt)return t.RG_INTEGER;if(n===ft)return t.RGBA_INTEGER;if(n===mt||n===gt||n===yt||n===vt)if(s===Jt){if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(n===mt)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===gt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===yt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===vt)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=e.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(n===mt)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===gt)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===yt)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===vt)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===_t||n===xt||n===bt||n===St){if(r=e.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(n===_t)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===xt)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===bt)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===St)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===Mt||n===wt||n===Tt){if(r=e.get("WEBGL_compressed_texture_etc"),null===r)return null;if(n===Mt||n===wt)return s===Jt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Tt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(n===Et||n===Ct||n===Rt||n===Nt||n===Pt||n===Dt||n===It||n===Lt||n===Bt||n===Ut||n===Ot||n===Ft||n===kt||n===zt){if(r=e.get("WEBGL_compressed_texture_astc"),null===r)return null;if(n===Et)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ct)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Rt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Nt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Pt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Dt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===It)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Lt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Bt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ut)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Ot)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Ft)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===kt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===zt)return s===Jt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===qt||n===Gt||n===Vt){if(r=e.get("EXT_texture_compression_bptc"),null===r)return null;if(n===qt)return s===Jt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===Gt)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===Vt)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||n===Ht||n===jt||n===Wt){if(r=e.get("EXT_texture_compression_rgtc"),null===r)return null;if(n===qt)return r.COMPRESSED_RED_RGTC1_EXT;if(n===Ht)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===jt)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===Wt)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===lt?t.UNSIGNED_INT_24_8:void 0!==t[n]?t[n]:null}}}class ro extends Ar{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}let so=class extends si{constructor(){super(),this.isGroup=!0,this.type="Group"}};const ao={type:"move"};class oo{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new so,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 so,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new en,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new en),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new so,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new en,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new en),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let i=null,r=null,s=null;const a=this._targetRay,o=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(l&&t.hand){s=!0;for(const i of t.hand.values()){const t=e.getJointPose(i,n),r=this._getHandJoint(l,i);null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=t.radius),r.visible=null!==t}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],a=i.position.distanceTo(r.position),o=.02,u=.005;l.inputState.pinching&&a>o+u?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-u&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(i=e.getPose(t.targetRaySpace,n),null===i&&null!==r&&(i=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,this.dispatchEvent(ao)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new so;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class lo{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(null===this.texture){const i=new Ye;t.properties.get(i).__webglTexture=e.texture,e.depthNear==n.depthNear&&e.depthFar==n.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(t){if(null!==this.texture&&null===this.mesh){const e=t.cameras[0].viewport,n=new or({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_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = 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 tr(new Tr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class uo extends fe{constructor(t,e){super();const n=this;let i=null,r=1,s=null,a="local-floor",o=1,l=null,u=null,h=null,c=null,A=null,d=null;const p=new lo,f=e.getContextAttributes();let m=null,g=null;const y=[],v=[],_=new Ee;let x=null;const b=new Ar;b.layers.enable(1),b.viewport=new Qe;const S=new Ar;S.layers.enable(2),S.viewport=new Qe;const M=[b,S],w=new ro;w.layers.enable(1),w.layers.enable(2);let T=null,E=null;function C(t){const e=v.indexOf(t.inputSource);if(-1===e)return;const n=y[e];void 0!==n&&(n.update(t.inputSource,t.frame,l||s),n.dispatchEvent({type:t.type,data:t.inputSource}))}function R(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",R),i.removeEventListener("inputsourceschange",N);for(let t=0;t<y.length;t++){const e=v[t];null!==e&&(v[t]=null,y[t].disconnect(e))}T=null,E=null,p.reset(),t.setRenderTarget(m),A=null,c=null,h=null,i=null,g=null,B.stop(),n.isPresenting=!1,t.setPixelRatio(x),t.setSize(_.width,_.height,!1),n.dispatchEvent({type:"sessionend"})}function N(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],i=v.indexOf(n);i>=0&&(v[i]=null,y[i].disconnect(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e];let i=v.indexOf(n);if(-1===i){for(let t=0;t<y.length;t++){if(t>=v.length){v.push(n),i=t;break}if(null===v[t]){v[t]=n,i=t;break}}if(-1===i)break}const r=y[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=y[t];return void 0===e&&(e=new oo,y[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=y[t];return void 0===e&&(e=new oo,y[t]=e),e.getGripSpace()},this.getHand=function(t){let e=y[t];return void 0===e&&(e=new oo,y[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==c?c:A},this.getBinding=function(){return h},this.getFrame=function(){return d},this.getSession=function(){return i},this.setSession=async function(u){if(i=u,null!==i){if(m=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",R),i.addEventListener("inputsourceschange",N),!0!==f.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(_),void 0===i.renderState.layers){const n={antialias:f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:r};A=new XRWebGLLayer(i,e,n),i.updateRenderState({baseLayer:A}),t.setPixelRatio(1),t.setSize(A.framebufferWidth,A.framebufferHeight,!1),g=new Ze(A.framebufferWidth,A.framebufferHeight,{format:ht,type:K,colorSpace:t.outputColorSpace,stencilBuffer:f.stencil})}else{let n=null,s=null,a=null;f.depth&&(a=f.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=f.stencil?At:ct,s=f.stencil?lt:it);const o={colorFormat:e.RGBA8,depthFormat:a,scaleFactor:r};h=new XRWebGLBinding(i,e),c=h.createProjectionLayer(o),i.updateRenderState({layers:[c]}),t.setPixelRatio(1),t.setSize(c.textureWidth,c.textureHeight,!1),g=new Ze(c.textureWidth,c.textureHeight,{format:ht,type:K,depthTexture:new hs(c.textureWidth,c.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:f.stencil,colorSpace:t.outputColorSpace,samples:f.antialias?4:0,resolveDepthBuffer:!1===c.ignoreDepthValues})}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await i.requestReferenceSpace(a),B.setContext(i),B.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};const P=new en,D=new en;function I(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===i)return;let e=t.near,n=t.far;null!==p.texture&&(p.depthNear>0&&(e=p.depthNear),p.depthFar>0&&(n=p.depthFar)),w.near=S.near=b.near=e,w.far=S.far=b.far=n,T===w.near&&E===w.far||(i.updateRenderState({depthNear:w.near,depthFar:w.far}),T=w.near,E=w.far);const r=t.parent,s=w.cameras;I(w,r);for(let t=0;t<s.length;t++)I(s[t],r);2===s.length?function(t,e,n){P.setFromMatrixPosition(e.matrixWorld),D.setFromMatrixPosition(n.matrixWorld);const i=P.distanceTo(D),r=e.projectionMatrix.elements,s=n.projectionMatrix.elements,a=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],u=(r[9]-1)/r[5],h=(r[8]-1)/r[0],c=(s[8]+1)/s[0],A=a*h,d=a*c,p=i/(-h+c),f=p*-h;if(e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(f),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert(),-1===r[10])t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse);else{const e=a+p,n=o+p,r=A-f,s=d+(i-f),h=l*o/n*e,c=u*o/n*e;t.projectionMatrix.makePerspective(r,s,h,c,e,n),t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}}(w,b,S):w.projectionMatrix.copy(b.projectionMatrix),function(t,e,n){null===n?t.matrix.copy(e.matrixWorld):(t.matrix.copy(n.matrixWorld),t.matrix.invert(),t.matrix.multiply(e.matrixWorld));t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*ve*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)}(t,w,r)},this.getCamera=function(){return w},this.getFoveation=function(){if(null!==c||null!==A)return o},this.setFoveation=function(t){o=t,null!==c&&(c.fixedFoveation=t),null!==A&&void 0!==A.fixedFoveation&&(A.fixedFoveation=t)},this.hasDepthSensing=function(){return null!==p.texture},this.getDepthSensingMesh=function(){return p.getMesh(w)};let L=null;const B=new Mr;B.setAnimationLoop((function(e,r){if(u=r.getViewerPose(l||s),d=r,null!==u){const e=u.views;null!==A&&(t.setRenderTargetFramebuffer(g,A.framebuffer),t.setRenderTarget(g));let n=!1;e.length!==w.cameras.length&&(w.cameras.length=0,n=!0);for(let i=0;i<e.length;i++){const r=e[i];let s=null;if(null!==A)s=A.getViewport(r);else{const e=h.getViewSubImage(c,r);s=e.viewport,0===i&&(t.setRenderTargetTextures(g,e.colorTexture,c.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(g))}let a=M[i];void 0===a&&(a=new Ar,a.layers.enable(i),a.viewport=new Qe,M[i]=a),a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.quaternion,a.scale),a.projectionMatrix.fromArray(r.projectionMatrix),a.projectionMatrixInverse.copy(a.projectionMatrix).invert(),a.viewport.set(s.x,s.y,s.width,s.height),0===i&&(w.matrix.copy(a.matrix),w.matrix.decompose(w.position,w.quaternion,w.scale)),!0===n&&w.cameras.push(a)}const r=i.enabledFeatures;if(r&&r.includes("depth-sensing")){const n=h.getDepthInformation(e[0]);n&&n.isValid&&n.texture&&p.init(t,n,i.renderState)}}for(let t=0;t<y.length;t++){const e=v[t],n=y[t];null!==e&&void 0!==n&&n.update(e,r,l||s)}L&&L(e,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),d=null})),this.setAnimationLoop=function(t){L=t},this.dispose=function(){}}}const ho=new Gn,co=new Dn;function Ao(t,e){function n(t,e){!0===t.matrixAutoUpdate&&t.updateMatrix(),e.value.copy(t.matrix)}function i(t,i){t.opacity.value=i.opacity,i.color&&t.diffuse.value.copy(i.color),i.emissive&&t.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(t.map.value=i.map,n(i.map,t.mapTransform)),i.alphaMap&&(t.alphaMap.value=i.alphaMap,n(i.alphaMap,t.alphaMapTransform)),i.bumpMap&&(t.bumpMap.value=i.bumpMap,n(i.bumpMap,t.bumpMapTransform),t.bumpScale.value=i.bumpScale,1===i.side&&(t.bumpScale.value*=-1)),i.normalMap&&(t.normalMap.value=i.normalMap,n(i.normalMap,t.normalMapTransform),t.normalScale.value.copy(i.normalScale),1===i.side&&t.normalScale.value.negate()),i.displacementMap&&(t.displacementMap.value=i.displacementMap,n(i.displacementMap,t.displacementMapTransform),t.displacementScale.value=i.displacementScale,t.displacementBias.value=i.displacementBias),i.emissiveMap&&(t.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,t.emissiveMapTransform)),i.specularMap&&(t.specularMap.value=i.specularMap,n(i.specularMap,t.specularMapTransform)),i.alphaTest>0&&(t.alphaTest.value=i.alphaTest);const r=e.get(i),s=r.envMap,a=r.envMapRotation;s&&(t.envMap.value=s,ho.copy(a),ho.x*=-1,ho.y*=-1,ho.z*=-1,s.isCubeTexture&&!1===s.isRenderTargetTexture&&(ho.y*=-1,ho.z*=-1),t.envMapRotation.value.setFromMatrix4(co.makeRotationFromEuler(ho)),t.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,t.reflectivity.value=i.reflectivity,t.ior.value=i.ior,t.refractionRatio.value=i.refractionRatio),i.lightMap&&(t.lightMap.value=i.lightMap,t.lightMapIntensity.value=i.lightMapIntensity,n(i.lightMap,t.lightMapTransform)),i.aoMap&&(t.aoMap.value=i.aoMap,t.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,t.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,sr(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,r,s,a,o){r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(t,r):r.isMeshToonMaterial?(i(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,r)):r.isMeshPhongMaterial?(i(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,r)):r.isMeshStandardMaterial?(i(t,r),function(t,e){t.metalness.value=e.metalness,e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap,n(e.metalnessMap,t.metalnessMapTransform));t.roughness.value=e.roughness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap,n(e.roughnessMap,t.roughnessMapTransform));e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}(t,r),r.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),1===e.side&&t.clearcoatNormalScale.value.negate()));e.dispersion>0&&(t.dispersion.value=e.dispersion);e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,r,o)):r.isMeshMatcapMaterial?(i(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,r)):r.isMeshDepthMaterial?i(t,r):r.isMeshDistanceMaterial?(i(t,r),function(t,n){const i=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,r)):r.isMeshNormalMaterial?i(t,r):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,i,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*r,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r,s,a):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function po(t,e,n,i){let r={},s={},a=[];const o=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(t,e,n,i){const r=t.value,s=e+"_"+n;if(void 0===i[s])return i[s]="number"==typeof r||"boolean"==typeof r?r:r.clone(),!0;{const t=i[s];if("number"==typeof r||"boolean"==typeof r){if(t!==r)return i[s]=r,!0}else if(!1===t.equals(r))return t.copy(r),!0}return!1}function u(t){const e={boundary:0,storage:0};return"number"==typeof t||"boolean"==typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function h(e){const n=e.target;n.removeEventListener("dispose",h);const i=a.indexOf(n.__bindingPointIndex);a.splice(i,1),t.deleteBuffer(r[n.id]),delete r[n.id],delete s[n.id]}return{bind:function(t,e){const n=e.program;i.uniformBlockBinding(t,n)},update:function(n,c){let A=r[n.id];void 0===A&&(!function(t){const e=t.uniforms;let n=0;const i=16;for(let t=0,r=e.length;t<r;t++){const r=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0,e=r.length;t<e;t++){const e=r[t],s=Array.isArray(e.value)?e.value:[e.value];for(let t=0,r=s.length;t<r;t++){const r=u(s[t]),a=n%i,o=a%r.boundary,l=a+o;n+=o,0!==l&&i-l<r.storage&&(n+=i-l),e.__data=new Float32Array(r.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,n+=r.storage}}}const r=n%i;r>0&&(n+=i-r);t.__size=n,t.__cache={}}(n),A=function(e){const n=function(){for(let t=0;t<o;t++)if(-1===a.indexOf(t))return a.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=n;const i=t.createBuffer(),r=e.__size,s=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,i),t.bufferData(t.UNIFORM_BUFFER,r,s),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,n,i),i}(n),r[n.id]=A,n.addEventListener("dispose",h));const d=c.program;i.updateUBOMapping(n,d);const p=e.render.frame;s[n.id]!==p&&(!function(e){const n=r[e.id],i=e.uniforms,s=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=i.length;e<n;e++){const n=Array.isArray(i[e])?i[e]:[i[e]];for(let i=0,r=n.length;i<r;i++){const r=n[i];if(!0===l(r,e,i,s)){const e=r.__offset,n=Array.isArray(r.value)?r.value:[r.value];let i=0;for(let s=0;s<n.length;s++){const a=n[s],o=u(a);"number"==typeof a||"boolean"==typeof a?(r.__data[0]=a,t.bufferSubData(t.UNIFORM_BUFFER,e+i,r.__data)):a.isMatrix3?(r.__data[0]=a.elements[0],r.__data[1]=a.elements[1],r.__data[2]=a.elements[2],r.__data[3]=0,r.__data[4]=a.elements[3],r.__data[5]=a.elements[4],r.__data[6]=a.elements[5],r.__data[7]=0,r.__data[8]=a.elements[6],r.__data[9]=a.elements[7],r.__data[10]=a.elements[8],r.__data[11]=0):(a.toArray(r.__data,i),i+=o.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,e,r.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}(n),s[n.id]=p)},dispose:function(){for(const e in r)t.deleteBuffer(r[e]);a=[],r={},s={}}}}let fo=class{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ce,this.updateRanges=[],this.version=0,this.uuid=_e()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=_e()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=_e()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.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 mo=new en;let go=class t{constructor(t,e,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)mo.fromBufferAttribute(this,e),mo.applyMatrix4(t),this.setXYZ(e,mo.x,mo.y,mo.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)mo.fromBufferAttribute(this,e),mo.applyNormalMatrix(t),this.setXYZ(e,mo.x,mo.y,mo.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)mo.fromBufferAttribute(this,e),mo.transformDirection(t),this.setXYZ(e,mo.x,mo.y,mo.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Me(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=we(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=we(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=we(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=we(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=we(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Me(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Me(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Me(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Me(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=we(e,this.array),n=we(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=we(e,this.array),n=we(n,this.array),i=we(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=we(e,this.array),n=we(n,this.array),i=we(i,this.array),r=we(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new Pi(new this.array.constructor(t),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 t(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},yo=class extends Pi{constructor(t,e,n,i=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}},vo=class extends Ei{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Mi(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}};const _o=new en,xo=new en,bo=new Dn,So=new Pn,Mo=new Sn,wo=new en,To=new en;class Eo extends si{constructor(t=new Gi,e=new vo){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,i=e.count;t<i;t++)_o.fromBufferAttribute(e,t-1),xo.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=_o.distanceTo(xo);t.setAttribute("lineDistance",new Li(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Mo.copy(n.boundingSphere),Mo.applyMatrix4(i),Mo.radius+=r,!1===t.ray.intersectsSphere(Mo))return;bo.copy(i).invert(),So.copy(t.ray).applyMatrix4(bo);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=this.isLineSegments?2:1,u=n.index,h=n.attributes.position;if(null!==u){const n=Math.max(0,s.start),i=Math.min(u.count,s.start+s.count);for(let r=n,s=i-1;r<s;r+=l){const n=u.getX(r),i=u.getX(r+1),s=Co(this,t,So,o,n,i);s&&e.push(s)}if(this.isLineLoop){const r=u.getX(i-1),s=u.getX(n),a=Co(this,t,So,o,r,s);a&&e.push(a)}}else{const n=Math.max(0,s.start),i=Math.min(h.count,s.start+s.count);for(let r=n,s=i-1;r<s;r+=l){const n=Co(this,t,So,o,r,r+1);n&&e.push(n)}if(this.isLineLoop){const r=Co(this,t,So,o,i-1,n);r&&e.push(r)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}function Co(t,e,n,i,r,s){const a=t.geometry.attributes.position;_o.fromBufferAttribute(a,r),xo.fromBufferAttribute(a,s);if(n.distanceSqToSegment(_o,xo,wo,To)>i)return;wo.applyMatrix4(t.matrixWorld);const o=e.ray.origin.distanceTo(wo);return o<e.near||o>e.far?void 0:{distance:o,point:To.clone().applyMatrix4(t.matrixWorld),index:r,face:null,faceIndex:null,barycoord:null,object:t}}const Ro=new en,No=new en;class Po extends Eo{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,i=e.count;t<i;t+=2)Ro.fromBufferAttribute(e,t),No.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+Ro.distanceTo(No);t.setAttribute("lineDistance",new Li(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Do{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;s=e||t*n[r-1];let a,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const u=n[i];return(i+(s-u)/(n[i+1]-u))/(r-1)}getTangent(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const s=this.getPoint(i),a=this.getPoint(r),o=e||(s.isVector2?new Ee:new en);return o.copy(a).sub(s).normalize(),o}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new en,i=[],r=[],s=[],a=new en,o=new Dn;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new en)}r[0]=new en,s[0]=new en;let l=Number.MAX_VALUE;const u=Math.abs(i[0].x),h=Math.abs(i[0].y),c=Math.abs(i[0].z);u<=l&&(l=u,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),c<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(xe(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(xe(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Io extends Do{constructor(t=0,e=0,n=1,i=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e=new Ee){const n=e,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=s?0:i),!0!==this.aClockwise||s||(r===i?r=-i:r-=i);const a=this.aStartAngle+t*r;let o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=o-this.aX,i=l-this.aY;o=n*t-i*e+this.aX,l=n*e+i*t+this.aY}return n.set(o,l)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}function Lo(){let t=0,e=0,n=0,i=0;function r(r,s,a,o){t=r,e=a,n=-3*r+3*s-2*a-o,i=2*r-2*s+a+o}return{initCatmullRom:function(t,e,n,i,s){r(e,n,s*(n-t),s*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,s,a,o){let l=(e-t)/s-(n-t)/(s+a)+(n-e)/a,u=(n-e)/a-(i-e)/(a+o)+(i-n)/o;l*=a,u*=a,r(e,n,l,u)},calc:function(r){const s=r*r;return t+e*r+n*s+i*(s*r)}}}const Bo=new en,Uo=new Lo,Oo=new Lo,Fo=new Lo;function ko(t,e,n,i,r){const s=.5*(i-e),a=.5*(r-n),o=t*t;return(2*n-2*i+s+a)*(t*o)+(-3*n+3*i-2*s-a)*o+s*t+n}function zo(t,e,n,i){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}function qo(t,e,n,i,r){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,i)+function(t,e){return t*t*t*e}(t,r)}class Go extends Do{constructor(t=new Ee,e=new Ee,n=new Ee,i=new Ee){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new Ee){const n=e,i=this.v0,r=this.v1,s=this.v2,a=this.v3;return n.set(qo(t,i.x,r.x,s.x,a.x),qo(t,i.y,r.y,s.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Vo extends Do{constructor(t=new en,e=new en,n=new en,i=new en){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=i}getPoint(t,e=new en){const n=e,i=this.v0,r=this.v1,s=this.v2,a=this.v3;return n.set(qo(t,i.x,r.x,s.x,a.x),qo(t,i.y,r.y,s.y,a.y),qo(t,i.z,r.z,s.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Ho extends Do{constructor(t=new Ee,e=new Ee){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Ee){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Ee){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class jo extends Do{constructor(t=new Ee,e=new Ee,n=new Ee){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new Ee){const n=e,i=this.v0,r=this.v1,s=this.v2;return n.set(zo(t,i.x,r.x,s.x),zo(t,i.y,r.y,s.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Wo extends Do{constructor(t=new en,e=new en,n=new en){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new en){const n=e,i=this.v0,r=this.v1,s=this.v2;return n.set(zo(t,i.x,r.x,s.x),zo(t,i.y,r.y,s.y),zo(t,i.z,r.z,s.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Xo extends Do{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Ee){const n=e,i=this.points,r=(i.length-1)*t,s=Math.floor(r),a=r-s,o=i[0===s?s:s-1],l=i[s],u=i[s>i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(ko(a,o.x,l.x,u.x,h.x),ko(a,o.y,l.y,u.y,h.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Ee).fromArray(n))}return this}}var Yo=Object.freeze({__proto__:null,ArcCurve:class extends Io{constructor(t,e,n,i,r,s){super(t,e,n,n,i,r,s),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends Do{constructor(t=[],e=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=i}getPoint(t,e=new en){const n=e,i=this.points,r=i.length,s=(r-(this.closed?0:1))*t;let a,o,l=Math.floor(s),u=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===u&&l===r-1&&(l=r-2,u=1),this.closed||l>0?a=i[(l-1)%r]:(Bo.subVectors(i[0],i[1]).add(i[0]),a=Bo);const h=i[l%r],c=i[(l+1)%r];if(this.closed||l+2<r?o=i[(l+2)%r]:(Bo.subVectors(i[r-1],i[r-2]).add(i[r-1]),o=Bo),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(a.distanceToSquared(h),t),n=Math.pow(h.distanceToSquared(c),t),i=Math.pow(c.distanceToSquared(o),t);n<1e-4&&(n=1),e<1e-4&&(e=n),i<1e-4&&(i=n),Uo.initNonuniformCatmullRom(a.x,h.x,c.x,o.x,e,n,i),Oo.initNonuniformCatmullRom(a.y,h.y,c.y,o.y,e,n,i),Fo.initNonuniformCatmullRom(a.z,h.z,c.z,o.z,e,n,i)}else"catmullrom"===this.curveType&&(Uo.initCatmullRom(a.x,h.x,c.x,o.x,this.tension),Oo.initCatmullRom(a.y,h.y,c.y,o.y,this.tension),Fo.initCatmullRom(a.z,h.z,c.z,o.z,this.tension));return n.set(Uo.calc(u),Oo.calc(u),Fo.calc(u)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new en).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},CubicBezierCurve:Go,CubicBezierCurve3:Vo,EllipseCurve:Io,LineCurve:Ho,LineCurve3:class extends Do{constructor(t=new en,e=new en){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new en){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new en){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},QuadraticBezierCurve:jo,QuadraticBezierCurve3:Wo,SplineCurve:Xo});class Qo extends Do{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const n=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Yo[n](e,t))}return this}getPoint(t,e){const n=t*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=n){const t=i[r]-n,s=this.curves[r],a=s.getLength(),o=0===a?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.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 t=[];let e=0;for(let n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const s=r[i],a=s.isEllipseCurve?2*t:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t,o=s.getPoints(a);for(let t=0;t<o.length;t++){const i=o[t];n&&n.equals(i)||(e.push(i),n=i)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new Yo[n.type]).fromJSON(n))}return this}}let $o=class extends Qo{constructor(t){super(),this.type="Path",this.currentPoint=new Ee,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new Ho(this.currentPoint.clone(),new Ee(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,i){const r=new jo(this.currentPoint.clone(),new Ee(t,e),new Ee(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this}bezierCurveTo(t,e,n,i,r,s){const a=new Go(this.currentPoint.clone(),new Ee(t,e),new Ee(n,i),new Ee(r,s));return this.curves.push(a),this.currentPoint.set(r,s),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new Xo(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,i,r,s){const a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(t+a,e+o,n,i,r,s),this}absarc(t,e,n,i,r,s){return this.absellipse(t,e,n,n,i,r,s),this}ellipse(t,e,n,i,r,s,a,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(t+l,e+u,n,i,r,s,a,o),this}absellipse(t,e,n,i,r,s,a,o){const l=new Io(t,e,n,i,r,s,a,o);if(this.curves.length>0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};class Zo extends Gi{constructor(t=1,e=32,n=0,i=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},e=Math.max(3,e);const r=[],s=[],a=[],o=[],l=new en,u=new Ee;s.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let r=0,h=3;r<=e;r++,h+=3){const c=n+r/e*i;l.x=t*Math.cos(c),l.y=t*Math.sin(c),s.push(l.x,l.y,l.z),a.push(0,0,1),u.x=(s[h]/t+1)/2,u.y=(s[h+1]/t+1)/2,o.push(u.x,u.y)}for(let t=1;t<=e;t++)r.push(t,t+1,0);this.setIndex(r),this.setAttribute("position",new Li(s,3)),this.setAttribute("normal",new Li(a,3)),this.setAttribute("uv",new Li(o,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Zo(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class Ko extends Gi{constructor(t=1,e=1,n=1,i=32,r=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:a,thetaLength:o};const l=this;i=Math.floor(i),r=Math.floor(r);const u=[],h=[],c=[],A=[];let d=0;const p=[],f=n/2;let m=0;function g(n){const r=d,s=new Ee,p=new en;let g=0;const y=!0===n?t:e,v=!0===n?1:-1;for(let t=1;t<=i;t++)h.push(0,f*v,0),c.push(0,v,0),A.push(.5,.5),d++;const _=d;for(let t=0;t<=i;t++){const e=t/i*o+a,n=Math.cos(e),r=Math.sin(e);p.x=y*r,p.y=f*v,p.z=y*n,h.push(p.x,p.y,p.z),c.push(0,v,0),s.x=.5*n+.5,s.y=.5*r*v+.5,A.push(s.x,s.y),d++}for(let t=0;t<i;t++){const e=r+t,i=_+t;!0===n?u.push(i,i+1,e):u.push(i+1,i,e),g+=3}l.addGroup(m,g,!0===n?1:2),m+=g}!function(){const s=new en,g=new en;let y=0;const v=(e-t)/n;for(let l=0;l<=r;l++){const u=[],m=l/r,y=m*(e-t)+t;for(let t=0;t<=i;t++){const e=t/i,r=e*o+a,l=Math.sin(r),p=Math.cos(r);g.x=y*l,g.y=-m*n+f,g.z=y*p,h.push(g.x,g.y,g.z),s.set(l,v,p).normalize(),c.push(s.x,s.y,s.z),A.push(e,1-m),u.push(d++)}p.push(u)}for(let n=0;n<i;n++)for(let i=0;i<r;i++){const r=p[i][n],s=p[i+1][n],a=p[i+1][n+1],o=p[i][n+1];t>0&&(u.push(r,s,o),y+=3),e>0&&(u.push(s,a,o),y+=3)}l.addGroup(m,y,0),m+=y}(),!1===s&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(u),this.setAttribute("position",new Li(h,3)),this.setAttribute("normal",new Li(c,3)),this.setAttribute("uv",new Li(A,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ko(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Jo extends $o{constructor(t){super(t),this.uuid=_e(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new $o).fromJSON(n))}return this}}const tl=function(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let s=el(t,0,r,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u,h,c,A,d;if(i&&(s=function(t,e,n,i){const r=[];let s,a,o,l,u;for(s=0,a=e.length;s<a;s++)o=e[s]*i,l=s<a-1?e[s+1]*i:t.length,u=el(t,o,l,i,!1),u===u.next&&(u.steiner=!0),r.push(Al(u));for(r.sort(ll),s=0;s<r.length;s++)n=ul(r[s],n);return n}(t,e,s,n)),t.length>80*n){o=u=t[0],l=h=t[1];for(let e=n;e<r;e+=n)c=t[e],A=t[e+1],c<o&&(o=c),A<l&&(l=A),c>u&&(u=c),A>h&&(h=A);d=Math.max(u-o,h-l),d=0!==d?32767/d:0}return il(s,a,n,o,l,d,0),a};function el(t,e,n,i,r){let s,a;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s<n;s+=i)r+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return r}(t,e,n,i)>0)for(s=e;s<n;s+=i)a=bl(s,t[s],t[s+1],a);else for(s=n-i;s>=e;s-=i)a=bl(s,t[s],t[s+1],a);return a&&ml(a,a.next)&&(Sl(a),a=a.next),a}function nl(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!ml(i,i.next)&&0!==fl(i.prev,i,i.next))i=i.next;else{if(Sl(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function il(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=cl(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,s,a,o,l,u=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,i=n,o=0,e=0;e<u&&(o++,i=i.nextZ,i);e++);for(l=u;o>0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=i}s.nextZ=null,u*=2}while(a>1)}(r)}(t,i,r,s);let o,l,u=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?sl(t,i,r,s):rl(t))e.push(o.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),Sl(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?il(t=al(nl(t),e,n),e,n,i,r,s,2):2===a&&ol(t,e,n,i,r,s):il(nl(t),e,n,i,r,s,1);break}}function rl(t){const e=t.prev,n=t,i=t.next;if(fl(e,n,i)>=0)return!1;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,u=i.y,h=r<s?r<a?r:a:s<a?s:a,c=o<l?o<u?o:u:l<u?l:u,A=r>s?r>a?r:a:s>a?s:a,d=o>l?o>u?o:u:l>u?l:u;let p=i.next;for(;p!==e;){if(p.x>=h&&p.x<=A&&p.y>=c&&p.y<=d&&dl(r,o,s,l,a,u,p.x,p.y)&&fl(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function sl(t,e,n,i){const r=t.prev,s=t,a=t.next;if(fl(r,s,a)>=0)return!1;const o=r.x,l=s.x,u=a.x,h=r.y,c=s.y,A=a.y,d=o<l?o<u?o:u:l<u?l:u,p=h<c?h<A?h:A:c<A?c:A,f=o>l?o>u?o:u:l>u?l:u,m=h>c?h>A?h:A:c>A?c:A,g=cl(d,p,e,n,i),y=cl(f,m,e,n,i);let v=t.prevZ,_=t.nextZ;for(;v&&v.z>=g&&_&&_.z<=y;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==r&&v!==a&&dl(o,h,l,c,u,A,v.x,v.y)&&fl(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&dl(o,h,l,c,u,A,_.x,_.y)&&fl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;v&&v.z>=g;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==r&&v!==a&&dl(o,h,l,c,u,A,v.x,v.y)&&fl(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;_&&_.z<=y;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&dl(o,h,l,c,u,A,_.x,_.y)&&fl(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function al(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;!ml(r,s)&&gl(r,i,i.next,s)&&_l(r,s)&&_l(s,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(s.i/n|0),Sl(i),Sl(i.next),i=t=s),i=i.next}while(i!==t);return nl(i)}function ol(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&pl(a,t)){let o=xl(a,t);return a=nl(a,a.next),o=nl(o,o.next),il(a,e,n,i,r,s,0),void il(o,e,n,i,r,s,0)}t=t.next}a=a.next}while(a!==t)}function ll(t,e){return t.x-e.x}function ul(t,e){const n=function(t,e){let n,i=e,r=-1/0;const s=t.x,a=t.y;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){const t=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>r&&(r=t,n=i.x<i.next.x?i:i.next,t===s))return n}i=i.next}while(i!==e);if(!n)return null;const o=n,l=n.x,u=n.y;let h,c=1/0;i=n;do{s>=i.x&&i.x>=l&&s!==i.x&&dl(a<u?s:r,a,l,u,a<u?r:s,a,i.x,i.y)&&(h=Math.abs(a-i.y)/(s-i.x),_l(i,t)&&(h<c||h===c&&(i.x>n.x||i.x===n.x&&hl(n,i)))&&(n=i,c=h)),i=i.next}while(i!==o);return n}(t,e);if(!n)return e;const i=xl(n,t);return nl(i,i.next),nl(n,n.next)}function hl(t,e){return fl(t.prev,t,e.prev)<0&&fl(e.next,t,t.next)<0}function cl(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Al(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function dl(t,e,n,i,r,s,a,o){return(r-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function pl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&gl(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(_l(t,e)&&_l(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(fl(t.prev,t,e.prev)||fl(t,e.prev,e))||ml(t,e)&&fl(t.prev,t,t.next)>0&&fl(e.prev,e,e.next)>0)}function fl(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ml(t,e){return t.x===e.x&&t.y===e.y}function gl(t,e,n,i){const r=vl(fl(t,e,n)),s=vl(fl(t,e,i)),a=vl(fl(n,i,t)),o=vl(fl(n,i,e));return r!==s&&a!==o||(!(0!==r||!yl(t,n,e))||(!(0!==s||!yl(t,i,e))||(!(0!==a||!yl(n,t,i))||!(0!==o||!yl(n,e,i)))))}function yl(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function vl(t){return t>0?1:t<0?-1:0}function _l(t,e){return fl(t.prev,t,t.next)<0?fl(t,e,t.next)>=0&&fl(t,t.prev,e)>=0:fl(t,e,t.prev)<0||fl(t,t.next,e)<0}function xl(t,e){const n=new Ml(t.i,t.x,t.y),i=new Ml(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function bl(t,e,n,i){const r=new Ml(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Sl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ml(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class wl{static area(t){const e=t.length;let n=0;for(let i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n}static isClockWise(t){return wl.area(t)<0}static triangulateShape(t,e){const n=[],i=[],r=[];Tl(t),El(n,t);let s=t.length;e.forEach(Tl);for(let t=0;t<e.length;t++)i.push(s),s+=e[t].length,El(n,e[t]);const a=tl(n,i);for(let t=0;t<a.length;t+=3)r.push(a.slice(t,t+3));return r}}function Tl(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function El(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class Cl extends Gi{constructor(t=new Jo([new Ee(.5,.5),new Ee(-.5,.5),new Ee(-.5,-.5),new Ee(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,i=[],r=[];for(let e=0,n=t.length;e<n;e++){s(t[e])}function s(t){const s=[],a=void 0!==e.curveSegments?e.curveSegments:12,o=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:1;let u=void 0===e.bevelEnabled||e.bevelEnabled,h=void 0!==e.bevelThickness?e.bevelThickness:.2,c=void 0!==e.bevelSize?e.bevelSize:h-.1,A=void 0!==e.bevelOffset?e.bevelOffset:0,d=void 0!==e.bevelSegments?e.bevelSegments:3;const p=e.extrudePath,f=void 0!==e.UVGenerator?e.UVGenerator:Rl;let m,g,y,v,_,x=!1;p&&(m=p.getSpacedPoints(o),x=!0,u=!1,g=p.computeFrenetFrames(o,!1),y=new en,v=new en,_=new en),u||(d=0,h=0,c=0,A=0);const b=t.extractPoints(a);let S=b.shape;const M=b.holes;if(!wl.isClockWise(S)){S=S.reverse();for(let t=0,e=M.length;t<e;t++){const e=M[t];wl.isClockWise(e)&&(M[t]=e.reverse())}}const w=wl.triangulateShape(S,M),T=S;for(let t=0,e=M.length;t<e;t++){const e=M[t];S=S.concat(e)}function E(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,n)}const C=S.length,R=w.length;function N(t,e,n){let i,r,s;const a=t.x-e.x,o=t.y-e.y,l=n.x-t.x,u=n.y-t.y,h=a*a+o*o,c=a*u-o*l;if(Math.abs(c)>Number.EPSILON){const c=Math.sqrt(h),A=Math.sqrt(l*l+u*u),d=e.x-o/c,p=e.y+a/c,f=((n.x-u/A-d)*u-(n.y+l/A-p)*l)/(a*u-o*l);i=d+a*f-t.x,r=p+o*f-t.y;const m=i*i+r*r;if(m<=2)return new Ee(i,r);s=Math.sqrt(m/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(u)&&(t=!0),t?(i=-o,r=a,s=Math.sqrt(h)):(i=a,r=o,s=Math.sqrt(h/2))}return new Ee(i/s,r/s)}const P=[];for(let t=0,e=T.length,n=e-1,i=t+1;t<e;t++,n++,i++)n===e&&(n=0),i===e&&(i=0),P[t]=N(T[t],T[n],T[i]);const D=[];let I,L=P.concat();for(let t=0,e=M.length;t<e;t++){const e=M[t];I=[];for(let t=0,n=e.length,i=n-1,r=t+1;t<n;t++,i++,r++)i===n&&(i=0),r===n&&(r=0),I[t]=N(e[t],e[i],e[r]);D.push(I),L=L.concat(I)}for(let t=0;t<d;t++){const e=t/d,n=h*Math.cos(e*Math.PI/2),i=c*Math.sin(e*Math.PI/2)+A;for(let t=0,e=T.length;t<e;t++){const e=E(T[t],P[t],i);O(e.x,e.y,-n)}for(let t=0,e=M.length;t<e;t++){const e=M[t];I=D[t];for(let t=0,r=e.length;t<r;t++){const r=E(e[t],I[t],i);O(r.x,r.y,-n)}}}const B=c+A;for(let t=0;t<C;t++){const e=u?E(S[t],L[t],B):S[t];x?(v.copy(g.normals[0]).multiplyScalar(e.x),y.copy(g.binormals[0]).multiplyScalar(e.y),_.copy(m[0]).add(v).add(y),O(_.x,_.y,_.z)):O(e.x,e.y,0)}for(let t=1;t<=o;t++)for(let e=0;e<C;e++){const n=u?E(S[e],L[e],B):S[e];x?(v.copy(g.normals[t]).multiplyScalar(n.x),y.copy(g.binormals[t]).multiplyScalar(n.y),_.copy(m[t]).add(v).add(y),O(_.x,_.y,_.z)):O(n.x,n.y,l/o*t)}for(let t=d-1;t>=0;t--){const e=t/d,n=h*Math.cos(e*Math.PI/2),i=c*Math.sin(e*Math.PI/2)+A;for(let t=0,e=T.length;t<e;t++){const e=E(T[t],P[t],i);O(e.x,e.y,l+n)}for(let t=0,e=M.length;t<e;t++){const e=M[t];I=D[t];for(let t=0,r=e.length;t<r;t++){const r=E(e[t],I[t],i);x?O(r.x,r.y+m[o-1].y,m[o-1].x+n):O(r.x,r.y,l+n)}}}function U(t,e){let n=t.length;for(;--n>=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=o+2*d;t<n;t++){const n=C*t,s=C*(t+1);k(e+i+n,e+r+n,e+r+s,e+i+s)}}}function O(t,e,n){s.push(t),s.push(e),s.push(n)}function F(t,e,r){z(t),z(e),z(r);const s=i.length/3,a=f.generateTopUV(n,i,s-3,s-2,s-1);q(a[0]),q(a[1]),q(a[2])}function k(t,e,r,s){z(t),z(e),z(s),z(e),z(r),z(s);const a=i.length/3,o=f.generateSideWallUV(n,i,a-6,a-3,a-2,a-1);q(o[0]),q(o[1]),q(o[3]),q(o[1]),q(o[2]),q(o[3])}function z(t){i.push(s[3*t+0]),i.push(s[3*t+1]),i.push(s[3*t+2])}function q(t){r.push(t.x),r.push(t.y)}!function(){const t=i.length/3;if(u){let t=0,e=C*t;for(let t=0;t<R;t++){const n=w[t];F(n[2]+e,n[1]+e,n[0]+e)}t=o+2*d,e=C*t;for(let t=0;t<R;t++){const n=w[t];F(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<R;t++){const e=w[t];F(e[2],e[1],e[0])}for(let t=0;t<R;t++){const e=w[t];F(e[0]+C*o,e[1]+C*o,e[2]+C*o)}}n.addGroup(t,i.length/3-t,0)}(),function(){const t=i.length/3;let e=0;U(T,e),e+=T.length;for(let t=0,n=M.length;t<n;t++){const n=M[t];U(n,e),e+=n.length}n.addGroup(t,i.length/3-t,1)}()}this.setAttribute("position",new Li(i,3)),this.setAttribute("uv",new Li(r,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,i=t.length;e<i;e++){const i=t[e];n.shapes.push(i.uuid)}else n.shapes.push(t.uuid);n.options=Object.assign({},e),void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let i=0,r=t.shapes.length;i<r;i++){const r=e[t.shapes[i]];n.push(r)}const i=t.options.extrudePath;return void 0!==i&&(t.options.extrudePath=(new Yo[i.type]).fromJSON(i)),new Cl(n,t.options)}}const Rl={generateTopUV:function(t,e,n,i,r){const s=e[3*n],a=e[3*n+1],o=e[3*i],l=e[3*i+1],u=e[3*r],h=e[3*r+1];return[new Ee(s,a),new Ee(o,l),new Ee(u,h)]},generateSideWallUV:function(t,e,n,i,r,s){const a=e[3*n],o=e[3*n+1],l=e[3*n+2],u=e[3*i],h=e[3*i+1],c=e[3*i+2],A=e[3*r],d=e[3*r+1],p=e[3*r+2],f=e[3*s],m=e[3*s+1],g=e[3*s+2];return Math.abs(o-h)<Math.abs(a-u)?[new Ee(a,1-l),new Ee(u,1-c),new Ee(A,1-p),new Ee(f,1-g)]:[new Ee(o,1-l),new Ee(h,1-c),new Ee(d,1-p),new Ee(m,1-g)]}};let Nl=class t extends Gi{constructor(t=1,e=32,n=16,i=0,r=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:s,thetaLength:a},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const u=[],h=new en,c=new en,A=[],d=[],p=[],f=[];for(let A=0;A<=n;A++){const m=[],g=A/n;let y=0;0===A&&0===s?y=.5/e:A===n&&o===Math.PI&&(y=-.5/e);for(let n=0;n<=e;n++){const o=n/e;h.x=-t*Math.cos(i+o*r)*Math.sin(s+g*a),h.y=t*Math.cos(s+g*a),h.z=t*Math.sin(i+o*r)*Math.sin(s+g*a),d.push(h.x,h.y,h.z),c.copy(h).normalize(),p.push(c.x,c.y,c.z),f.push(o+y,1-g),m.push(l++)}u.push(m)}for(let t=0;t<n;t++)for(let i=0;i<e;i++){const e=u[t][i+1],r=u[t][i],a=u[t+1][i],l=u[t+1][i+1];(0!==t||s>0)&&A.push(e,r,l),(t!==n-1||o<Math.PI)&&A.push(r,a,l)}this.setIndex(A),this.setAttribute("position",new Li(d,3)),this.setAttribute("normal",new Li(p,3)),this.setAttribute("uv",new Li(f,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(e){return new t(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}};class Pl extends Gi{constructor(t=new Wo(new en(-1,-1,0),new en(-1,1,0),new en(1,1,0)),e=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r};const s=t.computeFrenetFrames(e,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new en,o=new en,l=new Ee;let u=new en;const h=[],c=[],A=[],d=[];function p(r){u=t.getPointAt(r/e,u);const l=s.normals[r],A=s.binormals[r];for(let t=0;t<=i;t++){const e=t/i*Math.PI*2,r=Math.sin(e),s=-Math.cos(e);o.x=s*l.x+r*A.x,o.y=s*l.y+r*A.y,o.z=s*l.z+r*A.z,o.normalize(),c.push(o.x,o.y,o.z),a.x=u.x+n*o.x,a.y=u.y+n*o.y,a.z=u.z+n*o.z,h.push(a.x,a.y,a.z)}}!function(){for(let t=0;t<e;t++)p(t);p(!1===r?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=i;n++)l.x=t/e,l.y=n/i,A.push(l.x,l.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=i;e++){const n=(i+1)*(t-1)+(e-1),r=(i+1)*t+(e-1),s=(i+1)*t+e,a=(i+1)*(t-1)+e;d.push(n,r,a),d.push(r,s,a)}}()}(),this.setIndex(d),this.setAttribute("position",new Li(h,3)),this.setAttribute("normal",new Li(c,3)),this.setAttribute("uv",new Li(A,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Pl((new Yo[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class Dl extends Gi{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],n=new Set,i=new en,r=new en;if(null!==t.index){const s=t.attributes.position,a=t.index;let o=t.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let t=0,l=o.length;t<l;++t){const l=o[t],u=l.start;for(let t=u,o=u+l.count;t<o;t+=3)for(let o=0;o<3;o++){const l=a.getX(t+o),u=a.getX(t+(o+1)%3);i.fromBufferAttribute(s,l),r.fromBufferAttribute(s,u),!0===Il(i,r,n)&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}}else{const s=t.attributes.position;for(let t=0,a=s.count/3;t<a;t++)for(let a=0;a<3;a++){const o=3*t+a,l=3*t+(a+1)%3;i.fromBufferAttribute(s,o),r.fromBufferAttribute(s,l),!0===Il(i,r,n)&&(e.push(i.x,i.y,i.z),e.push(r.x,r.y,r.z))}}this.setAttribute("position",new Li(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function Il(t,e,n){const i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==n.has(i)&&!0!==n.has(r)&&(n.add(i),n.add(r),!0)}let Ll=class extends Ei{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Mi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Mi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Gn,this.combine=0,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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}};const Bl={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class Ul{constructor(t,e,n){const i=this;let r,s=!1,a=0,o=0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,!1===s&&void 0!==i.onStart&&i.onStart(t,a,o),s=!0},this.itemEnd=function(t){a++,void 0!==i.onProgress&&i.onProgress(t,a,o),a===o&&(s=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return r?r(t):t},this.setURLModifier=function(t){return r=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=l.length;e<n;e+=2){const n=l[e],i=l[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return i}return null}}}const Ol=new Ul;class Fl{constructor(t){this.manager=void 0!==t?t:Ol,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(i,r){n.load(t,i,e,r)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}Fl.DEFAULT_MATERIAL_NAME="__DEFAULT";class kl extends Fl{constructor(t){super(t)}load(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=Bl.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const a=Pe("img");function o(){u(),Bl.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){u(),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}function u(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a}}class zl extends Fl{constructor(t){super(t)}load(t,e,n,i){const r=new Ye,s=new kl(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,(function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r}}let ql=class extends si{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new Mi(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(e.object.target=this.target.uuid),e}};const Gl=new Dn,Vl=new en,Hl=new en;let jl=class{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ee(512,512),this.map=null,this.mapPass=null,this.matrix=new Dn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Sr,this._frameExtents=new Ee(1,1),this._viewportCount=1,this._viewports=[new Qe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Vl.setFromMatrixPosition(t.matrixWorld),e.position.copy(Vl),Hl.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Hl),e.updateMatrixWorld(),Gl.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Gl),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Gl)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 1!==this.intensity&&(t.intensity=this.intensity),0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}},Wl=class extends jl{constructor(){super(new kr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}};class Xl extends Gi{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}class Yl{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Ql(),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 t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Ql();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Ql(){return performance.now()}let $l=class extends fo{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}};const Zl=new Dn;function Kl(t,e){return t.distance-e.distance}function Jl(t,e,n,i){let r=!0;if(t.layers.test(e.layers)){!1===t.raycast(e,n)&&(r=!1)}if(!0===r&&!0===i){const i=t.children;for(let t=0,r=i.length;t<r;t++)Jl(i[t],e,n,!0)}}class tu{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(xe(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const eu=new en,nu=new en;class iu{constructor(){this.type="ShapePath",this.color=new Mi,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new $o,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.currentPath.bezierCurveTo(t,e,n,i,r,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let i=!1;for(let r=n-1,s=0;s<n;r=s++){let n=e[r],a=e[s],o=a.x-n.x,l=a.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=e[s],o=-o,a=e[r],l=-l),t.y<n.y||t.y>a.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return i}const n=wl.isClockWise,i=this.subPaths;if(0===i.length)return[];let r,s,a;const o=[];if(1===i.length)return s=i[0],a=new Jo,a.curves=s.curves,o.push(a),o;let l=!n(i[0].getPoints());l=t?!l:l;const u=[],h=[];let c,A,d=[],p=0;h[p]=void 0,d[p]=[];for(let e=0,a=i.length;e<a;e++)s=i[e],c=s.getPoints(),r=n(c),r=t?!r:r,r?(!l&&h[p]&&p++,h[p]={s:new Jo,p:c},h[p].s.curves=s.curves,l&&p++,d[p]=[]):d[p].push({h:s,p:c[0]});if(!h[0])return function(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n],r=new Jo;r.curves=i.curves,e.push(r)}return e}(i);if(h.length>1){let t=!1,n=0;for(let t=0,e=h.length;t<e;t++)u[t]=[];for(let i=0,r=h.length;i<r;i++){const r=d[i];for(let s=0;s<r.length;s++){const a=r[s];let o=!0;for(let r=0;r<h.length;r++)e(a.p,h[r].p)&&(i!==r&&n++,o?(o=!1,u[r].push(a)):t=!0);o&&u[i].push(a)}}n>0&&!1===t&&(d=u)}for(let t=0,e=h.length;t<e;t++){a=h[t].s,o.push(a),A=d[t];for(let t=0,e=A.length;t<e;t++)a.holes.push(A[t].h)}return o}}class ru extends fe{constructor(t,e=null){super(),this.object=t,this.domElement=e,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(){}disconnect(){}dispose(){}update(){}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:s}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=s);const su=new en,au=new Dn,ou=new Dn,lu=new en,uu=new en;function hu(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var cu="object"==typeof global&&global&&global.Object===Object&&global,Au="object"==typeof self&&self&&self.Object===Object&&self,du=cu||Au||Function("return this")(),pu=function(){return du.Date.now()},fu=/\s/;var mu=/^\s+/;function gu(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&fu.test(t.charAt(e)););return e}(t)+1).replace(mu,""):t}var yu=du.Symbol,vu=Object.prototype,_u=vu.hasOwnProperty,xu=vu.toString,bu=yu?yu.toStringTag:void 0;var Su=Object.prototype.toString;var Mu=yu?yu.toStringTag:void 0;function wu(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Mu&&Mu in Object(t)?function(t){var e=_u.call(t,bu),n=t[bu];try{t[bu]=void 0;var i=!0}catch(t){}var r=xu.call(t);return i&&(e?t[bu]=n:delete t[bu]),r}(t):function(t){return Su.call(t)}(t)}var Tu=/^[-+]0x[0-9a-f]+$/i,Eu=/^0b[01]+$/i,Cu=/^0o[0-7]+$/i,Ru=parseInt;function Nu(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==wu(t)}(t))return NaN;if(hu(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=hu(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=gu(t);var n=Eu.test(t);return n||Cu.test(t)?Ru(t.slice(2),n?2:8):Tu.test(t)?NaN:+t}var Pu=Math.max,Du=Math.min;function Iu(t,e,n){var i,r,s,a,o,l,u=0,h=!1,c=!1,A=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=i,s=r;return i=r=void 0,u=e,a=t.apply(s,n)}function p(t){var n=t-l;return void 0===l||n>=e||n<0||c&&t-u>=s}function f(){var t=pu();if(p(t))return m(t);o=setTimeout(f,function(t){var n=e-(t-l);return c?Du(n,s-(t-u)):n}(t))}function m(t){return o=void 0,A&&i?d(t):(i=r=void 0,a)}function g(){var t=pu(),n=p(t);if(i=arguments,r=this,l=t,n){if(void 0===o)return function(t){return u=t,o=setTimeout(f,e),h?d(t):a}(l);if(c)return clearTimeout(o),o=setTimeout(f,e),d(l)}return void 0===o&&(o=setTimeout(f,e)),a}return e=Nu(e)||0,hu(n)&&(h=!!n.leading,s=(c="maxWait"in n)?Pu(Nu(n.maxWait)||0,e):s,A="trailing"in n?!!n.trailing:A),g.cancel=function(){void 0!==o&&clearTimeout(o),u=0,i=l=r=o=void 0},g.flush=function(){return void 0===o?a:m(pu())},g}function Lu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Bu(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}function Uu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Lu(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lu(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ou=Bu((function t(e,n){var i=n.default,r=void 0===i?null:i,s=n.triggerUpdate,a=void 0===s||s,o=n.onChange,l=void 0===o?function(t,e){}:o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=r,this.triggerUpdate=a,this.onChange=l}));function Fu(t){var e=t.stateInit,n=void 0===e?function(){return{}}:e,i=t.props,r=void 0===i?{}:i,s=t.methods,a=void 0===s?{}:s,o=t.aliases,l=void 0===o?{}:o,u=t.init,h=void 0===u?function(){}:u,c=t.update,A=void 0===c?function(){}:c,d=Object.keys(r).map((function(t){return new Ou(t,r[t])}));return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},n instanceof Function?n(t):n,{initialised:!1}),i={};function r(e){return s(e,t),o(),r}var s=function(t,n){h.call(r,t,e,n),e.initialised=!0},o=Iu((function(){e.initialised&&(A.call(r,e,i),i={})}),1);return d.forEach((function(t){r[t.name]=function(t){var n=t.name,s=t.triggerUpdate,a=void 0!==s&&s,l=t.onChange,u=void 0===l?function(t,e){}:l,h=t.defaultVal,c=void 0===h?null:h;return function(t){var s=e[n];if(!arguments.length)return s;var l=void 0===t?c:t;return e[n]=l,u.call(r,l,e,s),!i.hasOwnProperty(n)&&(i[n]=s),a&&o(),r}}(t)})),Object.keys(a).forEach((function(t){r[t]=function(){for(var n,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return(n=a[t]).call.apply(n,[r,e].concat(s))}})),Object.entries(l).forEach((function(t){var e=Uu(t,2),n=e[0],i=e[1];return r[n]=r[i]})),r.resetProps=function(){return d.forEach((function(t){r[t.name](t.defaultVal)})),r},r.resetProps(),e._rerender=o,r}}var ku,zu=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return t},Out:function(t){return t},InOut:function(t){return t}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-zu.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*zu.Bounce.In(2*t):.5*zu.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),qu=function(){return performance.now()},Gu=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var i=0,r=e;i<r.length;i++){var s=r[i];null===(t=s._group)||void 0===t||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},t.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0,i=t;n<i.length;n++){var r=i[n];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},t.prototype.allStopped=function(){return this.getAll().every((function(t){return!t.isPlaying()}))},t.prototype.update=function(t,e){void 0===t&&(t=qu()),void 0===e&&(e=!0);var n=Object.keys(this._tweens);if(0!==n.length)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var r=this._tweens[n[i]],s=!e;r&&!1===r.update(t,s)&&!e&&this.remove(r)}n=Object.keys(this._tweensAddedDuringUpdate)}},t}(),Vu={Linear:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),s=Vu.Utils.Linear;return e<0?s(t[0],t[1],i):e>1?s(t[n],t[n-1],n-i):s(t[r],t[r+1>n?n:r+1],i-r)},Bezier:function(t,e){for(var n=0,i=t.length-1,r=Math.pow,s=Vu.Utils.Bernstein,a=0;a<=i;a++)n+=r(1-e,i-a)*r(e,a)*t[a]*s(i,a);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),s=Vu.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(r=Math.floor(i=n*(1+e))),s(t[(r-1+n)%n],t[r],t[(r+1)%n],t[(r+2)%n],i-r)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(s(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):s(t[r?r-1:0],t[r],t[n<r+1?n:r+1],t[n<r+2?n:r+2],i-r)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=Vu.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(ku=[1],function(t){var e=1;if(ku[t])return ku[t];for(var n=t;n>1;n--)e*=n;return ku[t]=e,e}),CatmullRom:function(t,e,n,i,r){var s=.5*(n-t),a=.5*(i-e),o=r*r;return(2*e-2*n+s+a)*(r*o)+(-3*e+3*n-2*s-a)*o+s*r+e}}},Hu=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),ju=new Gu,Wu=function(){function t(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=zu.Linear.None,this._interpolationFunction=Vu.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Hu.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,"object"==typeof e?(this._group=e,e.add(this)):!0===e&&(this._group=ju,ju.add(this))}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=qu()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var r in this._valuesEnd)i[r]=this._valuesEnd[r];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,i,r){for(var s in n){var a=t[s],o=Array.isArray(a),l=o?"array":typeof a,u=!o&&Array.isArray(n[s]);if("undefined"!==l&&"function"!==l){if(u){if(0===(m=n[s]).length)continue;for(var h=[a],c=0,A=m.length;c<A;c+=1){var d=this._handleRelativeValue(a,m[c]);if(isNaN(d)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}h.push(d)}u&&(n[s]=h)}if("object"!==l&&!o||!a||u)(void 0===e[s]||r)&&(e[s]=a),o||(e[s]*=1),i[s]=u?n[s].slice().reverse():e[s]||0;else{e[s]=o?[]:{};var p=a;for(var f in p)e[s][f]=p[f];i[s]=o?[]:{};var m=n[s];if(!this._isDynamic){var g={};for(var f in m)g[f]=m[f];n[s]=m=g}this._setupProperties(p,e[s],m,i[s],r)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},t.prototype.pause=function(t){return void 0===t&&(t=qu()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t),this},t.prototype.resume=function(t){return void 0===t&&(t=qu()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},t.prototype.remove=function(){var t;return null===(t=this._group)||void 0===t||t.remove(this),this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=zu.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=Vu.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(e,n){var i,r,s=this;if(void 0===e&&(e=qu()),void 0===n&&(n=t.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!n)return!1;this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,o=this._duration+(null!==(i=this._repeatDelayTime)&&void 0!==i?i:this._delayTime),l=this._duration+this._repeat*o,u=function(){if(0===s._duration)return 1;if(a>l)return 1;var t=Math.trunc(a/o),e=a-t*o,n=Math.min(e/s._duration,1);return 0===n&&a===s._duration?1:n}(),h=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),0===this._duration||a>=this._duration){if(this._repeat>0){var c=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);for(r in isFinite(this._repeat)&&(this._repeat-=c),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*c,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var A=0,d=this._chainedTweens.length;A<d;A++)this._chainedTweens[A].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,i){for(var r in n)if(void 0!==e[r]){var s=e[r]||0,a=n[r],o=Array.isArray(t[r]),l=Array.isArray(a);!o&&l?t[r]=this._interpolationFunction(a,i):"object"==typeof a&&a?this._updateProperties(t[r],s,a,i):"number"==typeof(a=this._handleRelativeValue(s,a))&&(t[r]=s+(a-s)*i)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t.autoStartOnUpdate=!1,t}(),Xu=ju;function Yu(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let s=Qu(t,0,r,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u;if(i&&(s=function(t,e,n,i){const r=[];for(let n=0,s=e.length;n<s;n++){const a=Qu(t,e[n]*i,n<s-1?e[n+1]*i:t.length,i,!1);a===a.next&&(a.steiner=!0),r.push(ah(a))}r.sort(nh);for(let t=0;t<r.length;t++)n=ih(r[t],n);return n}(t,e,s,n)),t.length>80*n){o=1/0,l=1/0;let e=-1/0,i=-1/0;for(let s=n;s<r;s+=n){const n=t[s],r=t[s+1];n<o&&(o=n),r<l&&(l=r),n>e&&(e=n),r>i&&(i=r)}u=Math.max(e-o,i-l),u=0!==u?32767/u:0}return Zu(s,a,n,o,l,u,0),a}function Qu(t,e,n,i,r){let s;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s<n;s+=i)r+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return r}(t,e,n,i)>0)for(let r=e;r<n;r+=i)s=mh(r/i|0,t[r],t[r+1],s);else for(let r=n-i;r>=e;r-=i)s=mh(r/i|0,t[r],t[r+1],s);return s&&hh(s,s.next)&&(gh(s),s=s.next),s}function $u(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!hh(i,i.next)&&0!==uh(i.prev,i,i.next))i=i.next;else{if(gh(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function Zu(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{0===r.z&&(r.z=sh(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n=1;do{let i,r=t;t=null;let s=null;for(e=0;r;){e++;let a=r,o=0;for(let t=0;t<n&&(o++,a=a.nextZ,a);t++);let l=n;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||r.z<=a.z)?(i=r,r=r.nextZ,o--):(i=a,a=a.nextZ,l--),s?s.nextZ=i:t=i,i.prevZ=s,s=i;r=a}s.nextZ=null,n*=2}while(e>1)}(r)}(t,i,r,s);let o=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(s?Ju(t,i,r,s):Ku(t))e.push(l.i,t.i,u.i),gh(t),t=u.next,o=u.next;else if((t=u)===o){a?1===a?Zu(t=th($u(t),e),e,n,i,r,s,2):2===a&&eh(t,e,n,i,r,s):Zu($u(t),e,n,i,r,s,1);break}}}function Ku(t){const e=t.prev,n=t,i=t.next;if(uh(e,n,i)>=0)return!1;const r=e.x,s=n.x,a=i.x,o=e.y,l=n.y,u=i.y,h=r<s?r<a?r:a:s<a?s:a,c=o<l?o<u?o:u:l<u?l:u,A=r>s?r>a?r:a:s>a?s:a,d=o>l?o>u?o:u:l>u?l:u;let p=i.next;for(;p!==e;){if(p.x>=h&&p.x<=A&&p.y>=c&&p.y<=d&&oh(r,o,s,l,a,u,p.x,p.y)&&uh(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Ju(t,e,n,i){const r=t.prev,s=t,a=t.next;if(uh(r,s,a)>=0)return!1;const o=r.x,l=s.x,u=a.x,h=r.y,c=s.y,A=a.y,d=o<l?o<u?o:u:l<u?l:u,p=h<c?h<A?h:A:c<A?c:A,f=o>l?o>u?o:u:l>u?l:u,m=h>c?h>A?h:A:c>A?c:A,g=sh(d,p,e,n,i),y=sh(f,m,e,n,i);let v=t.prevZ,_=t.nextZ;for(;v&&v.z>=g&&_&&_.z<=y;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==r&&v!==a&&oh(o,h,l,c,u,A,v.x,v.y)&&uh(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&oh(o,h,l,c,u,A,_.x,_.y)&&uh(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;v&&v.z>=g;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==r&&v!==a&&oh(o,h,l,c,u,A,v.x,v.y)&&uh(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;_&&_.z<=y;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==a&&oh(o,h,l,c,u,A,_.x,_.y)&&uh(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function th(t,e){let n=t;do{const i=n.prev,r=n.next.next;!hh(i,r)&&ch(i,n,n.next,r)&&ph(i,r)&&ph(r,i)&&(e.push(i.i,n.i,r.i),gh(n),gh(n.next),n=t=r),n=n.next}while(n!==t);return $u(n)}function eh(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&lh(a,t)){let o=fh(a,t);return a=$u(a,a.next),o=$u(o,o.next),Zu(a,e,n,i,r,s,0),void Zu(o,e,n,i,r,s,0)}t=t.next}a=a.next}while(a!==t)}function nh(t,e){return t.x-e.x}function ih(t,e){const n=function(t,e){let n=e;const i=t.x,r=t.y;let s,a=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const t=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=i&&t>a&&(a=t,s=n.x<n.next.x?n:n.next,t===i))return s}n=n.next}while(n!==e);if(!s)return null;const o=s,l=s.x,u=s.y;let h=1/0;n=s;do{if(i>=n.x&&n.x>=l&&i!==n.x&&oh(r<u?i:a,r,l,u,r<u?a:i,r,n.x,n.y)){const e=Math.abs(r-n.y)/(i-n.x);ph(n,t)&&(e<h||e===h&&(n.x>s.x||n.x===s.x&&rh(s,n)))&&(s=n,h=e)}n=n.next}while(n!==o);return s}(t,e);if(!n)return e;const i=fh(n,t);return $u(i,i.next),$u(n,n.next)}function rh(t,e){return uh(t.prev,t,e.prev)<0&&uh(e.next,t,t.next)<0}function sh(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ah(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function oh(t,e,n,i,r,s,a,o){return(r-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(i-o)>=(n-a)*(e-o)&&(n-a)*(s-o)>=(r-a)*(i-o)}function lh(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ch(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(ph(t,e)&&ph(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(uh(t.prev,t,e.prev)||uh(t,e.prev,e))||hh(t,e)&&uh(t.prev,t,t.next)>0&&uh(e.prev,e,e.next)>0)}function uh(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function hh(t,e){return t.x===e.x&&t.y===e.y}function ch(t,e,n,i){const r=dh(uh(t,e,n)),s=dh(uh(t,e,i)),a=dh(uh(n,i,t)),o=dh(uh(n,i,e));return r!==s&&a!==o||(!(0!==r||!Ah(t,n,e))||(!(0!==s||!Ah(t,i,e))||(!(0!==a||!Ah(n,t,i))||!(0!==o||!Ah(n,e,i)))))}function Ah(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function dh(t){return t>0?1:t<0?-1:0}function ph(t,e){return uh(t.prev,t,t.next)<0?uh(t,e,t.next)>=0&&uh(t,t.prev,e)>=0:uh(t,e,t.prev)<0||uh(t,t.next,e)<0}function fh(t,e){const n=yh(t.i,t.x,t.y),i=yh(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function mh(t,e,n,i){const r=yh(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function gh(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yh(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vh(t){const e=[],n=[],i=t[0][0].length;let r=0,s=0;for(const a of t){for(const t of a)for(let n=0;n<i;n++)e.push(t[n]);s&&(r+=s,n.push(r)),s=a.length}return{vertices:e,holes:n,dimensions:i}}function _h(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function xh(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function bh(t){let e,n,i;function r(t,i,r=0,s=t.length){if(r<s){if(0!==e(i,i))return s;do{const e=r+s>>>1;n(t[e],i)<0?r=e+1:s=e}while(r<s)}return r}return 2!==t.length?(e=_h,n=(e,n)=>_h(t(e),n),i=(e,n)=>t(e)-n):(e=t===_h||t===xh?t:Sh,n=t,i=t),{left:r,center:function(t,e,n=0,s=t.length){const a=r(t,e,n,s-1);return a>n&&i(t[a-1],e)>-i(t[a],e)?a-1:a},right:function(t,i,r=0,s=t.length){if(r<s){if(0!==e(i,i))return s;do{const e=r+s>>>1;n(t[e],i)<=0?r=e+1:s=e}while(r<s)}return r}}}function Sh(){return 0}Xu.getAll.bind(Xu),Xu.removeAll.bind(Xu),Xu.add.bind(Xu),Xu.remove.bind(Xu),Xu.update.bind(Xu);const Mh=bh(_h).right;function wh(t,e){let n,i;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=i=e):(n>e&&(n=e),i<e&&(i=e)));else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(void 0===n?s>=s&&(n=i=s):(n>s&&(n=s),i<s&&(i=s)))}return[n,i]}bh((function(t){return null===t?NaN:+t})).center;class Th{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=e[i],s=t+r,a=Math.abs(t)<Math.abs(r)?t-(s-r):r-(s-t);a&&(e[n++]=a),t=s}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,i,r=this._n,s=0;if(r>0){for(s=t[--r];r>0&&(e=s,n=t[--r],s=e+n,i=n-(s-e),!i););r>0&&(i<0&&t[r-1]<0||i>0&&t[r-1]>0)&&(n=2*i,e=s+n,n==e-s&&(s=e))}return s}}const Eh=Math.sqrt(50),Ch=Math.sqrt(10),Rh=Math.sqrt(2);function Nh(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),a=s>=Eh?10:s>=Ch?5:s>=Rh?2:1;let o,l,u;return r<0?(u=Math.pow(10,-r)/a,o=Math.round(t*u),l=Math.round(e*u),o/u<t&&++o,l/u>e&&--l,u=-u):(u=Math.pow(10,r)*a,o=Math.round(t/u),l=Math.round(e/u),o*u<t&&++o,l*u>e&&--l),l<o&&.5<=n&&n<2?Nh(t,e,2*n):[o,l,u]}function Ph(t,e,n){return Nh(t=+t,e=+e,n=+n)[2]}function Dh(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Ih(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),s=new Array(r);++i<r;)s[i]=t+i*n;return s}var Lh=1e-6,Bh=1e-12,Uh=Math.PI,Oh=Uh/2,Fh=Uh/4,kh=2*Uh,zh=180/Uh,qh=Uh/180,Gh=Math.abs,Vh=Math.atan,Hh=Math.atan2,jh=Math.cos,Wh=Math.ceil,Xh=Math.hypot,Yh=Math.sin,Qh=Math.sign||function(t){return t>0?1:t<0?-1:0},$h=Math.sqrt;function Zh(t){return t>1?Oh:t<-1?-Oh:Math.asin(t)}function Kh(t){return(t=Yh(t/2))*t}function Jh(){}function tc(t,e){t&&nc.hasOwnProperty(t.type)&&nc[t.type](t,e)}var ec={Feature:function(t,e){tc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)tc(n[i].geometry,e)}},nc={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){ic(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)ic(n[i],e,0)},Polygon:function(t,e){rc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)rc(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)tc(n[i],e)}};function ic(t,e,n){var i,r=-1,s=t.length-n;for(e.lineStart();++r<s;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function rc(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)ic(t[n],e,1);e.polygonEnd()}function sc(t,e){t&&ec.hasOwnProperty(t.type)?ec[t.type](t,e):tc(t,e)}var ac,oc,lc,uc,hc,cc,Ac,dc,pc,fc,mc,gc,yc,vc,_c,xc,bc=new Th,Sc=new Th,Mc={point:Jh,lineStart:Jh,lineEnd:Jh,polygonStart:function(){bc=new Th,Mc.lineStart=wc,Mc.lineEnd=Tc},polygonEnd:function(){var t=+bc;Sc.add(t<0?kh+t:t),this.lineStart=this.lineEnd=this.point=Jh},sphere:function(){Sc.add(kh)}};function wc(){Mc.point=Ec}function Tc(){Cc(ac,oc)}function Ec(t,e){Mc.point=Cc,ac=t,oc=e,lc=t*=qh,uc=jh(e=(e*=qh)/2+Fh),hc=Yh(e)}function Cc(t,e){var n=(t*=qh)-lc,i=n>=0?1:-1,r=i*n,s=jh(e=(e*=qh)/2+Fh),a=Yh(e),o=hc*a,l=uc*s+o*jh(r),u=o*i*Yh(r);bc.add(Hh(u,l)),lc=t,uc=s,hc=a}function Rc(t){return[Hh(t[1],t[0]),Zh(t[2])]}function Nc(t){var e=t[0],n=t[1],i=jh(n);return[i*jh(e),i*Yh(e),Yh(n)]}function Pc(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Dc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ic(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Lc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Bc(t){var e=$h(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Uc,Oc,Fc,kc,zc,qc,Gc,Vc,Hc,jc,Wc,Xc,Yc,Qc,$c,Zc,Kc={point:Jc,lineStart:eA,lineEnd:nA,polygonStart:function(){Kc.point=iA,Kc.lineStart=rA,Kc.lineEnd=sA,vc=new Th,Mc.polygonStart()},polygonEnd:function(){Mc.polygonEnd(),Kc.point=Jc,Kc.lineStart=eA,Kc.lineEnd=nA,bc<0?(cc=-(dc=180),Ac=-(pc=90)):vc>Lh?pc=90:vc<-1e-6&&(Ac=-90),xc[0]=cc,xc[1]=dc},sphere:function(){cc=-(dc=180),Ac=-(pc=90)}};function Jc(t,e){_c.push(xc=[cc=t,dc=t]),e<Ac&&(Ac=e),e>pc&&(pc=e)}function tA(t,e){var n=Nc([t*qh,e*qh]);if(yc){var i=Dc(yc,n),r=Dc([i[1],-i[0],0],i);Bc(r),r=Rc(r);var s,a=t-fc,o=a>0?1:-1,l=r[0]*zh*o,u=Gh(a)>180;u^(o*fc<l&&l<o*t)?(s=r[1]*zh)>pc&&(pc=s):u^(o*fc<(l=(l+360)%360-180)&&l<o*t)?(s=-r[1]*zh)<Ac&&(Ac=s):(e<Ac&&(Ac=e),e>pc&&(pc=e)),u?t<fc?aA(cc,t)>aA(cc,dc)&&(dc=t):aA(t,dc)>aA(cc,dc)&&(cc=t):dc>=cc?(t<cc&&(cc=t),t>dc&&(dc=t)):t>fc?aA(cc,t)>aA(cc,dc)&&(dc=t):aA(t,dc)>aA(cc,dc)&&(cc=t)}else _c.push(xc=[cc=t,dc=t]);e<Ac&&(Ac=e),e>pc&&(pc=e),yc=n,fc=t}function eA(){Kc.point=tA}function nA(){xc[0]=cc,xc[1]=dc,Kc.point=Jc,yc=null}function iA(t,e){if(yc){var n=t-fc;vc.add(Gh(n)>180?n+(n>0?360:-360):n)}else mc=t,gc=e;Mc.point(t,e),tA(t,e)}function rA(){Mc.lineStart()}function sA(){iA(mc,gc),Mc.lineEnd(),Gh(vc)>Lh&&(cc=-(dc=180)),xc[0]=cc,xc[1]=dc,yc=null}function aA(t,e){return(e-=t)<0?e+360:e}function oA(t,e){return t[0]-e[0]}function lA(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function uA(t){var e,n,i,r,s,a,o;if(pc=dc=-(cc=Ac=1/0),_c=[],sc(t,Kc),n=_c.length){for(_c.sort(oA),e=1,s=[i=_c[0]];e<n;++e)lA(i,(r=_c[e])[0])||lA(i,r[1])?(aA(i[0],r[1])>aA(i[0],i[1])&&(i[1]=r[1]),aA(r[0],i[1])>aA(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(a=-1/0,e=0,i=s[n=s.length-1];e<=n;i=r,++e)r=s[e],(o=aA(i[1],r[0]))>a&&(a=o,cc=r[0],dc=i[1])}return _c=xc=null,cc===1/0||Ac===1/0?[[NaN,NaN],[NaN,NaN]]:[[cc,Ac],[dc,pc]]}var hA={sphere:Jh,point:cA,lineStart:dA,lineEnd:mA,polygonStart:function(){hA.lineStart=gA,hA.lineEnd=yA},polygonEnd:function(){hA.lineStart=dA,hA.lineEnd=mA}};function cA(t,e){t*=qh;var n=jh(e*=qh);AA(n*jh(t),n*Yh(t),Yh(e))}function AA(t,e,n){++Uc,Fc+=(t-Fc)/Uc,kc+=(e-kc)/Uc,zc+=(n-zc)/Uc}function dA(){hA.point=pA}function pA(t,e){t*=qh;var n=jh(e*=qh);Qc=n*jh(t),$c=n*Yh(t),Zc=Yh(e),hA.point=fA,AA(Qc,$c,Zc)}function fA(t,e){t*=qh;var n=jh(e*=qh),i=n*jh(t),r=n*Yh(t),s=Yh(e),a=Hh($h((a=$c*s-Zc*r)*a+(a=Zc*i-Qc*s)*a+(a=Qc*r-$c*i)*a),Qc*i+$c*r+Zc*s);Oc+=a,qc+=a*(Qc+(Qc=i)),Gc+=a*($c+($c=r)),Vc+=a*(Zc+(Zc=s)),AA(Qc,$c,Zc)}function mA(){hA.point=cA}function gA(){hA.point=vA}function yA(){_A(Xc,Yc),hA.point=cA}function vA(t,e){Xc=t,Yc=e,t*=qh,e*=qh,hA.point=_A;var n=jh(e);Qc=n*jh(t),$c=n*Yh(t),Zc=Yh(e),AA(Qc,$c,Zc)}function _A(t,e){t*=qh;var n=jh(e*=qh),i=n*jh(t),r=n*Yh(t),s=Yh(e),a=$c*s-Zc*r,o=Zc*i-Qc*s,l=Qc*r-$c*i,u=Xh(a,o,l),h=Zh(u),c=u&&-h/u;Hc.add(c*a),jc.add(c*o),Wc.add(c*l),Oc+=h,qc+=h*(Qc+(Qc=i)),Gc+=h*($c+($c=r)),Vc+=h*(Zc+(Zc=s)),AA(Qc,$c,Zc)}function xA(t){Uc=Oc=Fc=kc=zc=qc=Gc=Vc=0,Hc=new Th,jc=new Th,Wc=new Th,sc(t,hA);var e=+Hc,n=+jc,i=+Wc,r=Xh(e,n,i);return r<Bh&&(e=qc,n=Gc,i=Vc,Oc<Lh&&(e=Fc,n=kc,i=zc),(r=Xh(e,n,i))<Bh)?[NaN,NaN]:[Hh(n,e)*zh,Zh(i/r)*zh]}function bA(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function SA(t,e){return Gh(t)>Uh&&(t-=Math.round(t/kh)*kh),[t,e]}function MA(t,e,n){return(t%=kh)?e||n?bA(TA(t),EA(e,n)):TA(t):e||n?EA(e,n):SA}function wA(t){return function(e,n){return Gh(e+=t)>Uh&&(e-=Math.round(e/kh)*kh),[e,n]}}function TA(t){var e=wA(t);return e.invert=wA(-t),e}function EA(t,e){var n=jh(t),i=Yh(t),r=jh(e),s=Yh(e);function a(t,e){var a=jh(e),o=jh(t)*a,l=Yh(t)*a,u=Yh(e),h=u*n+o*i;return[Hh(l*r-h*s,o*n-u*i),Zh(h*r+l*s)]}return a.invert=function(t,e){var a=jh(e),o=jh(t)*a,l=Yh(t)*a,u=Yh(e),h=u*r-l*s;return[Hh(l*r+u*s,o*n+h*i),Zh(h*n-o*i)]},a}function CA(t,e){(e=Nc(e))[0]-=t,Bc(e);var n,i=(n=-e[1])>1?0:n<-1?Uh:Math.acos(n);return((-e[2]<0?-i:i)+kh-Lh)%kh}function RA(){var t,e=[];return{point:function(e,n,i){t.push([e,n,i])},lineStart:function(){e.push(t=[])},lineEnd:Jh,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function NA(t,e){return Gh(t[0]-e[0])<Lh&&Gh(t[1]-e[1])<Lh}function PA(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function DA(t,e,n,i,r){var s,a,o=[],l=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],a=t[e];if(NA(i,a)){if(!i[2]&&!a[2]){for(r.lineStart(),s=0;s<e;++s)r.point((i=t[s])[0],i[1]);return void r.lineEnd()}a[0]+=2e-6}o.push(n=new PA(i,t,null,!0)),l.push(n.o=new PA(i,null,n,!1)),o.push(n=new PA(a,t,null,!1)),l.push(n.o=new PA(a,null,n,!0))}})),o.length){for(l.sort(e),IA(o),IA(l),s=0,a=l.length;s<a;++s)l[s].e=n=!n;for(var u,h,c=o[0];;){for(var A=c,d=!0;A.v;)if((A=A.n)===c)return;u=A.z,r.lineStart();do{if(A.v=A.o.v=!0,A.e){if(d)for(s=0,a=u.length;s<a;++s)r.point((h=u[s])[0],h[1]);else i(A.x,A.n.x,1,r);A=A.n}else{if(d)for(u=A.p.z,s=u.length-1;s>=0;--s)r.point((h=u[s])[0],h[1]);else i(A.x,A.p.x,-1,r);A=A.p}u=(A=A.o).z,d=!d}while(!A.v);r.lineEnd()}}}function IA(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function LA(t){return Gh(t[0])<=Uh?t[0]:Qh(t[0])*((Gh(t[0])+Uh)%kh-Uh)}function BA(t,e){var n=LA(e),i=e[1],r=Yh(i),s=[Yh(n),-jh(n),0],a=0,o=0,l=new Th;1===r?i=Oh+Lh:-1===r&&(i=-Oh-Lh);for(var u=0,h=t.length;u<h;++u)if(A=(c=t[u]).length)for(var c,A,d=c[A-1],p=LA(d),f=d[1]/2+Fh,m=Yh(f),g=jh(f),y=0;y<A;++y,p=_,m=b,g=S,d=v){var v=c[y],_=LA(v),x=v[1]/2+Fh,b=Yh(x),S=jh(x),M=_-p,w=M>=0?1:-1,T=w*M,E=T>Uh,C=m*b;if(l.add(Hh(C*w*Yh(T),g*S+C*jh(T))),a+=E?M+w*kh:M,E^p>=n^_>=n){var R=Dc(Nc(d),Nc(v));Bc(R);var N=Dc(s,R);Bc(N);var P=(E^M>=0?-1:1)*Zh(N[2]);(i>P||i===P&&(R[0]||R[1]))&&(o+=E^M>=0?1:-1)}}return(a<-1e-6||a<Lh&&l<-1e-12)^1&o}function UA(t,e,n,i){return function(r){var s,a,o,l=e(r),u=RA(),h=e(u),c=!1,A={point:d,lineStart:f,lineEnd:m,polygonStart:function(){A.point=g,A.lineStart=y,A.lineEnd=v,a=[],s=[]},polygonEnd:function(){A.point=d,A.lineStart=f,A.lineEnd=m,a=Dh(a);var t=BA(s,i);a.length?(c||(r.polygonStart(),c=!0),DA(a,FA,t,n,r)):t&&(c||(r.polygonStart(),c=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),c&&(r.polygonEnd(),c=!1),a=s=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function d(e,n){t(e,n)&&r.point(e,n)}function p(t,e){l.point(t,e)}function f(){A.point=p,l.lineStart()}function m(){A.point=d,l.lineEnd()}function g(t,e){o.push([t,e]),h.point(t,e)}function y(){h.lineStart(),o=[]}function v(){g(o[0][0],o[0][1]),h.lineEnd();var t,e,n,i,l=h.clean(),A=u.result(),d=A.length;if(o.pop(),s.push(o),o=null,d)if(1&l){if((e=(n=A[0]).length-1)>0){for(c||(r.polygonStart(),c=!0),r.lineStart(),t=0;t<e;++t)r.point((i=n[t])[0],i[1]);r.lineEnd()}}else d>1&&2&l&&A.push(A.pop().concat(A.shift())),a.push(A.filter(OA))}return A}}function OA(t){return t.length>1}function FA(t,e){return((t=t.x)[0]<0?t[1]-Oh-Lh:Oh-t[1])-((e=e.x)[0]<0?e[1]-Oh-Lh:Oh-e[1])}SA.invert=SA;var kA=UA((function(){return!0}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(s,a){var o=s>0?Uh:-Uh,l=Gh(s-n);Gh(l-Uh)<Lh?(t.point(n,i=(i+a)/2>0?Oh:-Oh),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(o,i),t.point(s,i),e=0):r!==o&&l>=Uh&&(Gh(n-r)<Lh&&(n-=r*Lh),Gh(s-o)<Lh&&(s-=o*Lh),i=function(t,e,n,i){var r,s,a=Yh(t-n);return Gh(a)>Lh?Vh((Yh(e)*(s=jh(i))*Yh(n)-Yh(i)*(r=jh(e))*Yh(t))/(r*s*a)):(e+i)/2}(n,i,s,a),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(o,i),e=0),t.point(n=s,i=a),r=o},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;if(null==t)r=n*Oh,i.point(-Uh,r),i.point(0,r),i.point(Uh,r),i.point(Uh,0),i.point(Uh,-r),i.point(0,-r),i.point(-Uh,-r),i.point(-Uh,0),i.point(-Uh,r);else if(Gh(t[0]-e[0])>Lh){var s=t[0]<e[0]?Uh:-Uh;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(e[0],e[1])}),[-Uh,-Oh]);function zA(t){var e=jh(t),n=2*qh,i=e>0,r=Gh(e)>Lh;function s(t,n){return jh(t)*jh(n)>e}function a(t,n,i){var r=[1,0,0],s=Dc(Nc(t),Nc(n)),a=Pc(s,s),o=s[0],l=a-o*o;if(!l)return!i&&t;var u=e*a/l,h=-e*o/l,c=Dc(r,s),A=Lc(r,u);Ic(A,Lc(s,h));var d=c,p=Pc(A,d),f=Pc(d,d),m=p*p-f*(Pc(A,A)-1);if(!(m<0)){var g=$h(m),y=Lc(d,(-p-g)/f);if(Ic(y,A),y=Rc(y),!i)return y;var v,_=t[0],x=n[0],b=t[1],S=n[1];x<_&&(v=_,_=x,x=v);var M=x-_,w=Gh(M-Uh)<Lh;if(!w&&S<b&&(v=b,b=S,S=v),w||M<Lh?w?b+S>0^y[1]<(Gh(y[0]-_)<Lh?b:S):b<=y[1]&&y[1]<=S:M>Uh^(_<=y[0]&&y[0]<=x)){var T=Lc(d,(-p+g)/f);return Ic(T,A),[y,Rc(T)]}}}function o(e,n){var r=i?t:Uh-t,s=0;return e<-r?s|=1:e>r&&(s|=2),n<-r?s|=4:n>r&&(s|=8),s}return UA(s,(function(t){var e,n,l,u,h;return{lineStart:function(){u=l=!1,h=1},point:function(c,A){var d,p=[c,A],f=s(c,A),m=i?f?0:o(c,A):f?o(c+(c<0?Uh:-Uh),A):0;if(!e&&(u=l=f)&&t.lineStart(),f!==l&&(!(d=a(e,p))||NA(e,d)||NA(p,d))&&(p[2]=1),f!==l)h=0,f?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(r&&e&&i^f){var g;m&n||!(g=a(p,e,!0))||(h=0,i?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1],3)))}!f||e&&NA(e,p)||t.point(p[0],p[1]),e=p,l=f,n=m},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return h|(u&&l)<<1}}}),(function(e,i,r,s){!function(t,e,n,i,r,s){if(n){var a=jh(e),o=Yh(e),l=i*n;null==r?(r=e+i*kh,s=e-l/2):(r=CA(a,r),s=CA(a,s),(i>0?r<s:r>s)&&(r+=i*kh));for(var u,h=r;i>0?h>s:h<s;h-=l)u=Rc([a,-o*jh(h),-o*Yh(h)]),t.point(u[0],u[1])}}(s,t,n,r,e,i)}),i?[0,-t]:[-Uh,t-Uh])}var qA,GA,VA,HA,jA=1e9,WA=-jA;function XA(t,e,n,i){function r(r,s){return t<=r&&r<=n&&e<=s&&s<=i}function s(r,s,o,u){var h=0,c=0;if(null==r||(h=a(r,o))!==(c=a(s,o))||l(r,s)<0^o>0)do{u.point(0===h||3===h?t:n,h>1?i:e)}while((h=(h+o+4)%4)!==c);else u.point(s[0],s[1])}function a(i,r){return Gh(i[0]-t)<Lh?r>0?0:3:Gh(i[0]-n)<Lh?r>0?2:1:Gh(i[1]-e)<Lh?r>0?1:0:r>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var l,u,h,c,A,d,p,f,m,g,y,v=a,_=RA(),x={point:b,lineStart:function(){x.point=S,u&&u.push(h=[]);g=!0,m=!1,p=f=NaN},lineEnd:function(){l&&(S(c,A),d&&m&&_.rejoin(),l.push(_.result()));x.point=b,m&&v.lineEnd()},polygonStart:function(){v=_,l=[],u=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=u.length;n<r;++n)for(var s,a,o=u[n],l=1,h=o.length,c=o[0],A=c[0],d=c[1];l<h;++l)s=A,a=d,A=(c=o[l])[0],d=c[1],a<=i?d>i&&(A-s)*(i-a)>(d-a)*(t-s)&&++e:d<=i&&(A-s)*(i-a)<(d-a)*(t-s)&&--e;return e}(),n=y&&e,r=(l=Dh(l)).length;(n||r)&&(a.polygonStart(),n&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),r&&DA(l,o,e,s,a),a.polygonEnd());v=a,l=u=h=null}};function b(t,e){r(t,e)&&v.point(t,e)}function S(s,a){var o=r(s,a);if(u&&h.push([s,a]),g)c=s,A=a,d=o,g=!1,o&&(v.lineStart(),v.point(s,a));else if(o&&m)v.point(s,a);else{var l=[p=Math.max(WA,Math.min(jA,p)),f=Math.max(WA,Math.min(jA,f))],_=[s=Math.max(WA,Math.min(jA,s)),a=Math.max(WA,Math.min(jA,a))];!function(t,e,n,i,r,s){var a,o=t[0],l=t[1],u=0,h=1,c=e[0]-o,A=e[1]-l;if(a=n-o,c||!(a>0)){if(a/=c,c<0){if(a<u)return;a<h&&(h=a)}else if(c>0){if(a>h)return;a>u&&(u=a)}if(a=r-o,c||!(a<0)){if(a/=c,c<0){if(a>h)return;a>u&&(u=a)}else if(c>0){if(a<u)return;a<h&&(h=a)}if(a=i-l,A||!(a>0)){if(a/=A,A<0){if(a<u)return;a<h&&(h=a)}else if(A>0){if(a>h)return;a>u&&(u=a)}if(a=s-l,A||!(a<0)){if(a/=A,A<0){if(a>h)return;a>u&&(u=a)}else if(A>0){if(a<u)return;a<h&&(h=a)}return u>0&&(t[0]=o+u*c,t[1]=l+u*A),h<1&&(e[0]=o+h*c,e[1]=l+h*A),!0}}}}}(l,_,t,e,n,i)?o&&(v.lineStart(),v.point(s,a),y=!1):(m||(v.lineStart(),v.point(l[0],l[1])),v.point(_[0],_[1]),o||v.lineEnd(),y=!1)}p=s,f=a,m=o}return x}}var YA={sphere:Jh,point:Jh,lineStart:function(){YA.point=$A,YA.lineEnd=QA},lineEnd:Jh,polygonStart:Jh,polygonEnd:Jh};function QA(){YA.point=YA.lineEnd=Jh}function $A(t,e){GA=t*=qh,VA=Yh(e*=qh),HA=jh(e),YA.point=ZA}function ZA(t,e){t*=qh;var n=Yh(e*=qh),i=jh(e),r=Gh(t-GA),s=jh(r),a=i*Yh(r),o=HA*n-VA*i*s,l=VA*n+HA*i*s;qA.add(Hh($h(a*a+o*o),l)),GA=t,VA=n,HA=i}var KA=[null,null],JA={type:"LineString",coordinates:KA};function td(t,e){return KA[0]=t,KA[1]=e,function(t){return qA=new Th,sc(t,YA),+qA}(JA)}var ed={Feature:function(t,e){return id(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)if(id(n[i].geometry,e))return!0;return!1}},nd={Sphere:function(){return!0},Point:function(t,e){return rd(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(rd(n[i],e))return!0;return!1},LineString:function(t,e){return sd(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(sd(n[i],e))return!0;return!1},Polygon:function(t,e){return ad(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)if(ad(n[i],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)if(id(n[i],e))return!0;return!1}};function id(t,e){return!(!t||!nd.hasOwnProperty(t.type))&&nd[t.type](t,e)}function rd(t,e){return 0===td(t,e)}function sd(t,e){for(var n,i,r,s=0,a=t.length;s<a;s++){if(0===(i=td(t[s],e)))return!0;if(s>0&&(r=td(t[s],t[s-1]))>0&&n<=r&&i<=r&&(n+i-r)*(1-Math.pow((n-i)/r,2))<Bh*r)return!0;n=i}return!1}function ad(t,e){return!!BA(t.map(od),ld(e))}function od(t){return(t=t.map(ld)).pop(),t}function ld(t){return[t[0]*qh,t[1]*qh]}function ud(t,e,n){var i=Ih(t,e-Lh,n).concat(e);return function(t){return i.map((function(e){return[t,e]}))}}function hd(t,e,n){var i=Ih(t,e-Lh,n).concat(e);return function(t){return i.map((function(e){return[e,t]}))}}function cd(){return function(){var t,e,n,i,r,s,a,o,l,u,h,c,A=10,d=A,p=90,f=360,m=2.5;function g(){return{type:"MultiLineString",coordinates:y()}}function y(){return Ih(Wh(i/p)*p,n,p).map(h).concat(Ih(Wh(o/f)*f,a,f).map(c)).concat(Ih(Wh(e/A)*A,t,A).filter((function(t){return Gh(t%p)>Lh})).map(l)).concat(Ih(Wh(s/d)*d,r,d).filter((function(t){return Gh(t%f)>Lh})).map(u))}return g.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},g.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(c(a).slice(1),h(n).reverse().slice(1),c(o).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(i=+t[0][0],n=+t[1][0],o=+t[0][1],a=+t[1][1],i>n&&(t=i,i=n,n=t),o>a&&(t=o,o=a,a=t),g.precision(m)):[[i,o],[n,a]]},g.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],s=+n[0][1],r=+n[1][1],e>t&&(n=e,e=t,t=n),s>r&&(n=s,s=r,r=n),g.precision(m)):[[e,s],[t,r]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(p=+t[0],f=+t[1],g):[p,f]},g.stepMinor=function(t){return arguments.length?(A=+t[0],d=+t[1],g):[A,d]},g.precision=function(A){return arguments.length?(m=+A,l=ud(s,r,90),u=hd(e,t,m),h=ud(o,a,90),c=hd(i,n,m),g):m},g.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}function Ad(t,e){var n=t[0]*qh,i=t[1]*qh,r=e[0]*qh,s=e[1]*qh,a=jh(i),o=Yh(i),l=jh(s),u=Yh(s),h=a*jh(n),c=a*Yh(n),A=l*jh(r),d=l*Yh(r),p=2*Zh($h(Kh(s-i)+a*l*Kh(r-n))),f=Yh(p),m=p?function(t){var e=Yh(t*=p)/f,n=Yh(p-t)/f,i=n*h+e*A,r=n*c+e*d,s=n*o+e*u;return[Hh(r,i)*zh,Hh(s,$h(i*i+r*r))*zh]}:function(){return[n*zh,i*zh]};return m.distance=p,m}var dd=t=>t,pd=1/0,fd=pd,md=-pd,gd=md,yd={point:function(t,e){t<pd&&(pd=t);t>md&&(md=t);e<fd&&(fd=e);e>gd&&(gd=e)},lineStart:Jh,lineEnd:Jh,polygonStart:Jh,polygonEnd:Jh,result:function(){var t=[[pd,fd],[md,gd]];return md=gd=-(fd=pd=1/0),t}};function vd(t){return function(e){var n=new _d;for(var i in t)n[i]=t[i];return n.stream=e,n}}function _d(){}function xd(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),sc(n,t.stream(yd)),e(yd.result()),null!=i&&t.clipExtent(i),t}function bd(t,e,n){return xd(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],s=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),a=+e[0][0]+(i-s*(n[1][0]+n[0][0]))/2,o=+e[0][1]+(r-s*(n[1][1]+n[0][1]))/2;t.scale(150*s).translate([a,o])}),n)}_d.prototype={constructor:_d,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Sd=jh(30*qh);function Md(t,e){return+e?function(t,e){function n(i,r,s,a,o,l,u,h,c,A,d,p,f,m){var g=u-i,y=h-r,v=g*g+y*y;if(v>4*e&&f--){var _=a+A,x=o+d,b=l+p,S=$h(_*_+x*x+b*b),M=Zh(b/=S),w=Gh(Gh(b)-1)<Lh||Gh(s-c)<Lh?(s+c)/2:Hh(x,_),T=t(w,M),E=T[0],C=T[1],R=E-i,N=C-r,P=y*R-g*N;(P*P/v>e||Gh((g*R+y*N)/v-.5)>.3||a*A+o*d+l*p<Sd)&&(n(i,r,s,a,o,l,E,C,w,_/=S,x/=S,b,f,m),m.point(E,C),n(E,C,w,_,x,b,u,h,c,A,d,p,f,m))}}return function(e){var i,r,s,a,o,l,u,h,c,A,d,p,f={point:m,lineStart:g,lineEnd:v,polygonStart:function(){e.polygonStart(),f.lineStart=_},polygonEnd:function(){e.polygonEnd(),f.lineStart=g}};function m(n,i){n=t(n,i),e.point(n[0],n[1])}function g(){h=NaN,f.point=y,e.lineStart()}function y(i,r){var s=Nc([i,r]),a=t(i,r);n(h,c,u,A,d,p,h=a[0],c=a[1],u=i,A=s[0],d=s[1],p=s[2],16,e),e.point(h,c)}function v(){f.point=m,e.lineEnd()}function _(){g(),f.point=x,f.lineEnd=b}function x(t,e){y(i=t,e),r=h,s=c,a=A,o=d,l=p,f.point=y}function b(){n(h,c,u,A,d,p,r,s,i,a,o,l,16,e),f.lineEnd=v,v()}return f}}(t,e):function(t){return vd({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var wd=vd({point:function(t,e){this.stream.point(t*qh,e*qh)}});function Td(t,e,n,i,r,s){if(!s)return function(t,e,n,i,r){function s(s,a){return[e+t*(s*=i),n-t*(a*=r)]}return s.invert=function(s,a){return[(s-e)/t*i,(n-a)/t*r]},s}(t,e,n,i,r);var a=jh(s),o=Yh(s),l=a*t,u=o*t,h=a/t,c=o/t,A=(o*n-a*e)/t,d=(o*e+a*n)/t;function p(t,s){return[l*(t*=i)-u*(s*=r)+e,n-u*t-l*s]}return p.invert=function(t,e){return[i*(h*t-c*e+A),r*(d-c*t-h*e)]},p}function Ed(t){return function(t){var e,n,i,r,s,a,o,l,u,h,c=150,A=480,d=250,p=0,f=0,m=0,g=0,y=0,v=0,_=1,x=1,b=null,S=kA,M=null,w=dd,T=.5;function E(t){return l(t[0]*qh,t[1]*qh)}function C(t){return(t=l.invert(t[0],t[1]))&&[t[0]*zh,t[1]*zh]}function R(){var t=Td(c,0,0,_,x,v).apply(null,e(p,f)),i=Td(c,A-t[0],d-t[1],_,x,v);return n=MA(m,g,y),o=bA(e,i),l=bA(n,o),a=Md(o,T),N()}function N(){return u=h=null,E}return E.stream=function(t){return u&&h===t?u:u=wd(function(t){return vd({point:function(e,n){var i=t(e,n);return this.stream.point(i[0],i[1])}})}(n)(S(a(w(h=t)))))},E.preclip=function(t){return arguments.length?(S=t,b=void 0,N()):S},E.postclip=function(t){return arguments.length?(w=t,M=i=r=s=null,N()):w},E.clipAngle=function(t){return arguments.length?(S=+t?zA(b=t*qh):(b=null,kA),N()):b*zh},E.clipExtent=function(t){return arguments.length?(w=null==t?(M=i=r=s=null,dd):XA(M=+t[0][0],i=+t[0][1],r=+t[1][0],s=+t[1][1]),N()):null==M?null:[[M,i],[r,s]]},E.scale=function(t){return arguments.length?(c=+t,R()):c},E.translate=function(t){return arguments.length?(A=+t[0],d=+t[1],R()):[A,d]},E.center=function(t){return arguments.length?(p=t[0]%360*qh,f=t[1]%360*qh,R()):[p*zh,f*zh]},E.rotate=function(t){return arguments.length?(m=t[0]%360*qh,g=t[1]%360*qh,y=t.length>2?t[2]%360*qh:0,R()):[m*zh,g*zh,y*zh]},E.angle=function(t){return arguments.length?(v=t%360*qh,R()):v*zh},E.reflectX=function(t){return arguments.length?(_=t?-1:1,R()):_<0},E.reflectY=function(t){return arguments.length?(x=t?-1:1,R()):x<0},E.precision=function(t){return arguments.length?(a=Md(o,T=t*t),N()):$h(T)},E.fitExtent=function(t,e){return bd(E,t,e)},E.fitSize=function(t,e){return function(t,e,n){return bd(t,[[0,0],e],n)}(E,t,e)},E.fitWidth=function(t,e){return function(t,e,n){return xd(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),s=(i-r*(n[1][0]+n[0][0]))/2,a=-r*n[0][1];t.scale(150*r).translate([s,a])}),n)}(E,t,e)},E.fitHeight=function(t,e){return function(t,e,n){return xd(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),s=-r*n[0][0],a=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([s,a])}),n)}(E,t,e)},function(){return e=t.apply(this,arguments),E.invert=e.invert&&C,R()}}((function(){return t}))()}function Cd(t,e){var n=jh(e),i=1+jh(t)*n;return[n*Yh(t)/i,Yh(e)/i]}function Rd(){return Ed(Cd).scale(250).clipAngle(142)}function Nd(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Pd(t,e,n){return e=Dd(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Id()?Reflect.construct(e,[],Dd(t).constructor):e.apply(t,n))}function Dd(t){return Dd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dd(t)}function Id(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Id=function(){return!!t})()}function Ld(t,e){return Ld=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ld(t,e)}function Bd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||Ud(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ud(t,e){if(t){if("string"==typeof t)return Nd(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nd(t,e):void 0}}Cd.invert=function(t){return function(e,n){var i=$h(e*e+n*n),r=t(i),s=Yh(r),a=jh(r);return[Hh(e*s,i*a),Zh(i&&n*s/i)]}}((function(t){return 2*Vh(t)}));var Od=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(i){if(n){var r=180*td(i,n)/Math.PI;if(r>t)for(var s=Ad(n,i),a=1/Math.ceil(r/t),o=a;o<1;)e.push(s(o)),o+=a}e.push(n=i)})),e},Fd="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:Gi,Float32BufferAttribute:Li},kd=(new Fd.BufferGeometry).setAttribute?"setAttribute":"addAttribute",zd=function(t){function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Pd(this,e)).type="GeoJsonGeometry",n.parameters={geoJson:t,radius:i,resolution:r};var s=({Point:u,MultiPoint:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return u(t,e)})).forEach((function(t){var e=Bd(t,1)[0];qd(n,e)})),[n]},LineString:h,MultiLineString:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return h(t,e)})).forEach((function(t){var e=Bd(t,1)[0];qd(n,e)})),[n]},Polygon:c,MultiPolygon:function(t,e){var n={vertices:[],indices:[]},i={vertices:[],indices:[]};t.map((function(t){return c(t,e)})).forEach((function(t){var e=Bd(t,2),r=e[0],s=e[1];qd(n,r),s&&qd(i,s)}));var r=[n];return i.vertices.length&&r.push(i),r}}[t.type]||function(){return[]})(t.coordinates,i),a=[],o=[],l=0;function u(t,e){return[{vertices:Vd(t[1],t[0],e),indices:[]}]}function h(t,e){for(var n=vh([Od(t,r).map((function(t){var n=Bd(t,2),i=n[0];return Vd(n[1],i,e)}))]).vertices,i=Math.round(n.length/3),s=[],a=1;a<i;a++)s.push(a-1,a);return[{vertices:n,indices:s}]}function c(t,e){for(var n=vh(t.map((function(t){return Od(t,r).map((function(t){var n=Bd(t,2),i=n[0];return Vd(n[1],i,e)}))}))),i=n.vertices,s=n.holes,a=s[0]||1/0,o=i.slice(0,3*a),l=i.slice(3*a),u=new Set(s),h=Math.round(i.length/3),c=[],A=[],d=1;d<h;d++)u.has(d)||(d<a?c.push(d-1,d):A.push(d-1-a,d-a));var p=[{indices:c,vertices:o}];return s.length&&p.push({indices:A,vertices:l}),p}return s.forEach((function(t){var e=a.length;qd({indices:a,vertices:o},t),n.addGroup(e,a.length-e,l++)})),a.length&&n.setIndex(a),o.length&&n[kd]("position",new Fd.Float32BufferAttribute(o,3)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ld(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(Fd.BufferGeometry);function qd(t,e){var n=Math.round(t.vertices.length/3);Gd(t.vertices,e.vertices),Gd(t.indices,e.indices.map((function(t){return t+n})))}function Gd(t,e){var n,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ud(t))||e){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,o=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){o=!0,s=t},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw s}}}}(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;t.push(r)}}catch(t){i.e(t)}finally{i.f()}}function Vd(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=(90-t)*Math.PI/180,r=(90-e)*Math.PI/180;return[n*Math.sin(i)*Math.cos(r),n*Math.cos(i),n*Math.sin(i)*Math.sin(r)]}function Hd(t){let e,n,i,r=-1,s=0;for(let a=0;a<t.length;++a){const o=t[a];if(void 0===e&&(e=o.array.constructor),e!==o.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===i&&(i=o.normalized),i!==o.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===r&&(r=o.gpuType),r!==o.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;s+=o.count*n}const a=new e(s),o=new Pi(a,n,i);let l=0;for(let e=0;e<t.length;++e){const i=t[e];if(i.isInterleavedBufferAttribute){const t=l/n;for(let e=0,r=i.count;e<r;e++)for(let r=0;r<n;r++){const n=i.getComponent(e,r);o.setComponent(e+t,r,n)}}else a.set(i.array,l);l+=i.count*n}return void 0!==r&&(o.gpuType=r),o}function jd(t){const e=t.data.array.constructor,n=t.count,i=t.itemSize,r=t.normalized,s=new e(n*i);let a;a=t.isInstancedInterleavedBufferAttribute?new yo(s,i,r,t.meshPerAttribute):new Pi(s,i,r);for(let e=0;e<n;e++)a.setX(e,t.getX(e)),i>=2&&a.setY(e,t.getY(e)),i>=3&&a.setZ(e,t.getZ(e)),i>=4&&a.setW(e,t.getW(e));return a}var Wd=Object.freeze({__proto__:null,computeMikkTSpaceTangents:function(t,e,n=!0){if(!e||!e.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!t.hasAttribute("position")||!t.hasAttribute("normal")||!t.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function i(t){if(t.normalized||t.isInterleavedBufferAttribute){const e=new Float32Array(t.count*t.itemSize);for(let n=0,i=0;n<t.count;n++)e[i++]=t.getX(n),e[i++]=t.getY(n),t.itemSize>2&&(e[i++]=t.getZ(n));return e}return t.array instanceof Float32Array?t.array:new Float32Array(t.array)}const r=t.index?t.toNonIndexed():t,s=e.generateTangents(i(r.attributes.position),i(r.attributes.normal),i(r.attributes.uv));if(n)for(let t=3;t<s.length;t+=4)s[t]*=-1;return r.setAttribute("tangent",new Pi(s,4)),t!==r&&t.copy(r),t},computeMorphedAttributes:function(t){const e=new en,n=new en,i=new en,r=new en,s=new en,a=new en,o=new en,l=new en,u=new en;function h(t,h,c,A,d,p,f,m){e.fromBufferAttribute(h,d),n.fromBufferAttribute(h,p),i.fromBufferAttribute(h,f);const g=t.morphTargetInfluences;if(c&&g){o.set(0,0,0),l.set(0,0,0),u.set(0,0,0);for(let t=0,h=c.length;t<h;t++){const h=g[t],m=c[t];0!==h&&(r.fromBufferAttribute(m,d),s.fromBufferAttribute(m,p),a.fromBufferAttribute(m,f),A?(o.addScaledVector(r,h),l.addScaledVector(s,h),u.addScaledVector(a,h)):(o.addScaledVector(r.sub(e),h),l.addScaledVector(s.sub(n),h),u.addScaledVector(a.sub(i),h)))}e.add(o),n.add(l),i.add(u)}t.isSkinnedMesh&&(t.applyBoneTransform(d,e),t.applyBoneTransform(p,n),t.applyBoneTransform(f,i)),m[3*d+0]=e.x,m[3*d+1]=e.y,m[3*d+2]=e.z,m[3*p+0]=n.x,m[3*p+1]=n.y,m[3*p+2]=n.z,m[3*f+0]=i.x,m[3*f+1]=i.y,m[3*f+2]=i.z}const c=t.geometry,A=t.material;let d,p,f;const m=c.index,g=c.attributes.position,y=c.morphAttributes.position,v=c.morphTargetsRelative,_=c.attributes.normal,x=c.morphAttributes.position,b=c.groups,S=c.drawRange;let M,w,T,E,C,R,N;const P=new Float32Array(g.count*g.itemSize),D=new Float32Array(_.count*_.itemSize);if(null!==m)if(Array.isArray(A))for(M=0,T=b.length;M<T;M++)for(C=b[M],R=Math.max(C.start,S.start),N=Math.min(C.start+C.count,S.start+S.count),w=R,E=N;w<E;w+=3)d=m.getX(w),p=m.getX(w+1),f=m.getX(w+2),h(t,g,y,v,d,p,f,P),h(t,_,x,v,d,p,f,D);else for(R=Math.max(0,S.start),N=Math.min(m.count,S.start+S.count),M=R,T=N;M<T;M+=3)d=m.getX(M),p=m.getX(M+1),f=m.getX(M+2),h(t,g,y,v,d,p,f,P),h(t,_,x,v,d,p,f,D);else if(Array.isArray(A))for(M=0,T=b.length;M<T;M++)for(C=b[M],R=Math.max(C.start,S.start),N=Math.min(C.start+C.count,S.start+S.count),w=R,E=N;w<E;w+=3)d=w,p=w+1,f=w+2,h(t,g,y,v,d,p,f,P),h(t,_,x,v,d,p,f,D);else for(R=Math.max(0,S.start),N=Math.min(g.count,S.start+S.count),M=R,T=N;M<T;M+=3)d=M,p=M+1,f=M+2,h(t,g,y,v,d,p,f,P),h(t,_,x,v,d,p,f,D);return{positionAttribute:g,normalAttribute:_,morphedPositionAttribute:new Li(P,3),morphedNormalAttribute:new Li(D,3)}},deepCloneAttribute:function(t){return t.isInstancedInterleavedBufferAttribute||t.isInterleavedBufferAttribute?jd(t):t.isInstancedBufferAttribute?(new yo).copy(t):(new Pi).copy(t)},deinterleaveAttribute:jd,deinterleaveGeometry:function(t){const e=t.attributes,n=t.morphTargets,i=new Map;for(const t in e){const n=e[t];n.isInterleavedBufferAttribute&&(i.has(n)||i.set(n,jd(n)),e[t]=i.get(n))}for(const t in n){const e=n[t];e.isInterleavedBufferAttribute&&(i.has(e)||i.set(e,jd(e)),n[t]=i.get(e))}},estimateBytesUsed:function(t){let e=0;for(const n in t.attributes){const i=t.getAttribute(n);e+=i.count*i.itemSize*i.array.BYTES_PER_ELEMENT}const n=t.getIndex();return e+=n?n.count*n.itemSize*n.array.BYTES_PER_ELEMENT:0,e},interleaveAttributes:function(t){let e,n=0,i=0;for(let r=0,s=t.length;r<s;++r){const s=t[r];if(void 0===e&&(e=s.array.constructor),e!==s.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=s.array.length,i+=s.itemSize}const r=new fo(new e(n),i);let s=0;const a=[],o=["getX","getY","getZ","getW"],l=["setX","setY","setZ","setW"];for(let e=0,n=t.length;e<n;e++){const n=t[e],i=n.itemSize,u=n.count,h=new go(r,i,s,n.normalized);a.push(h),s+=i;for(let t=0;t<u;t++)for(let e=0;e<i;e++)h[l[e]](t,n[o[e]](t))}return a},mergeAttributes:Hd,mergeGeometries:function(t,e=!1){const n=null!==t[0].index,i=new Set(Object.keys(t[0].attributes)),r=new Set(Object.keys(t[0].morphAttributes)),s={},a={},o=t[0].morphTargetsRelative,l=new Gi;let u=0;for(let h=0;h<t.length;++h){const c=t[h];let A=0;if(n!==(null!==c.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const t in c.attributes){if(!i.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+t+'" attribute exists among all geometries, or in none of them.'),null;void 0===s[t]&&(s[t]=[]),s[t].push(c.attributes[t]),A++}if(A!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==c.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const t in c.morphAttributes){if(!r.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+".  .morphAttributes must be consistent throughout all geometries."),null;void 0===a[t]&&(a[t]=[]),a[t].push(c.morphAttributes[t])}if(e){let t;if(n)t=c.index.count;else{if(void 0===c.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;t=c.attributes.position.count}l.addGroup(u,t,h),u+=t}}if(n){let e=0;const n=[];for(let i=0;i<t.length;++i){const r=t[i].index;for(let t=0;t<r.count;++t)n.push(r.getX(t)+e);e+=t[i].attributes.position.count}l.setIndex(n)}for(const t in s){const e=Hd(s[t]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;l.setAttribute(t,e)}for(const t in a){const e=a[t][0].length;if(0===e)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[t]=[];for(let n=0;n<e;++n){const e=[];for(let i=0;i<a[t].length;++i)e.push(a[t][i][n]);const i=Hd(e);if(!i)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;l.morphAttributes[t].push(i)}}return l},mergeGroups:function(t){if(0===t.groups.length)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),t;let e=t.groups;if(e=e.sort(((t,e)=>t.materialIndex!==e.materialIndex?t.materialIndex-e.materialIndex:t.start-e.start)),null===t.getIndex()){const e=t.getAttribute("position"),n=[];for(let t=0;t<e.count;t+=3)n.push(t,t+1,t+2);t.setIndex(n)}const n=t.getIndex(),i=[];for(let t=0;t<e.length;t++){const r=e[t],s=r.start,a=s+r.count;for(let t=s;t<a;t++)i.push(n.getX(t))}t.dispose(),t.setIndex(i);let r=0;for(let t=0;t<e.length;t++){const n=e[t];n.start=r,r+=n.count}let s=e[0];t.groups=[s];for(let n=1;n<e.length;n++){const i=e[n];s.materialIndex===i.materialIndex?s.count+=i.count:(s=i,t.groups.push(s))}return t},mergeVertices:function(t,e=1e-4){e=Math.max(e,Number.EPSILON);const n={},i=t.getIndex(),r=t.getAttribute("position"),s=i?i.count:r.count;let a=0;const o=Object.keys(t.attributes),l={},u={},h=[],c=["getX","getY","getZ","getW"],A=["setX","setY","setZ","setW"];for(let e=0,n=o.length;e<n;e++){const n=o[e],i=t.attributes[n];l[n]=new i.constructor(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized);const r=t.morphAttributes[n];r&&(u[n]||(u[n]=[]),r.forEach(((t,e)=>{const i=new t.array.constructor(t.count*t.itemSize);u[n][e]=new t.constructor(i,t.itemSize,t.normalized)})))}const d=.5*e,p=Math.log10(1/e),f=Math.pow(10,p),m=d*f;for(let e=0;e<s;e++){const r=i?i.getX(e):e;let s="";for(let e=0,n=o.length;e<n;e++){const n=o[e],i=t.getAttribute(n),a=i.itemSize;for(let t=0;t<a;t++)s+=~~(i[c[t]](r)*f+m)+","}if(s in n)h.push(n[s]);else{for(let e=0,n=o.length;e<n;e++){const n=o[e],i=t.getAttribute(n),s=t.morphAttributes[n],h=i.itemSize,d=l[n],p=u[n];for(let t=0;t<h;t++){const e=c[t],n=A[t];if(d[n](a,i[e](r)),s)for(let t=0,i=s.length;t<i;t++)p[t][n](a,s[t][e](r))}}n[s]=a,h.push(a),a++}}const g=t.clone();for(const e in t.attributes){const t=l[e];if(g.setAttribute(e,new t.constructor(t.array.slice(0,a*t.itemSize),t.itemSize,t.normalized)),e in u)for(let t=0;t<u[e].length;t++){const n=u[e][t];g.morphAttributes[e][t]=new n.constructor(n.array.slice(0,a*n.itemSize),n.itemSize,n.normalized)}}return g.setIndex(h),g},toCreasedNormals:function(t,e=Math.PI/3){const n=Math.cos(e),i=100*(1+1e-10),r=[new en,new en,new en],s=new en,a=new en,o=new en,l=new en;function u(t){return`${~~(t.x*i)},${~~(t.y*i)},${~~(t.z*i)}`}const h=t.index?t.toNonIndexed():t,c=h.attributes.position,A={};for(let t=0,e=c.count/3;t<e;t++){const e=3*t,n=r[0].fromBufferAttribute(c,e+0),i=r[1].fromBufferAttribute(c,e+1),o=r[2].fromBufferAttribute(c,e+2);s.subVectors(o,i),a.subVectors(n,i);const l=(new en).crossVectors(s,a).normalize();for(let t=0;t<3;t++){const e=u(r[t]);e in A||(A[e]=[]),A[e].push(l)}}const d=new Float32Array(3*c.count),p=new Pi(d,3,!1);for(let t=0,e=c.count/3;t<e;t++){const e=3*t,i=r[0].fromBufferAttribute(c,e+0),h=r[1].fromBufferAttribute(c,e+1),d=r[2].fromBufferAttribute(c,e+2);s.subVectors(d,h),a.subVectors(i,h),o.crossVectors(s,a).normalize();for(let t=0;t<3;t++){const i=A[u(r[t])];l.set(0,0,0);for(let t=0,e=i.length;t<e;t++){const e=i[t];o.dot(e)>n&&l.add(e)}l.normalize(),p.setXYZ(e+t,l.x,l.y,l.z)}}return h.setAttribute("normal",p),h},toTrianglesDrawMode:function(t,e){if(0===e)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(2===e||1===e){let n=t.getIndex();if(null===n){const e=[],i=t.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<i.count;t++)e.push(t);t.setIndex(e),n=t.getIndex()}const i=n.count-2,r=[];if(2===e)for(let t=1;t<=i;t++)r.push(n.getX(0)),r.push(n.getX(t)),r.push(n.getX(t+1));else for(let t=0;t<i;t++)t%2==0?(r.push(n.getX(t)),r.push(n.getX(t+1)),r.push(n.getX(t+2))):(r.push(n.getX(t+2)),r.push(n.getX(t+1)),r.push(n.getX(t)));r.length/3!==i&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=t.clone();return s.setIndex(r),s.clearGroups(),s}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}}),Xd=function(t){return"function"==typeof t?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}};function Yd(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Qd(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function $d(){}var Zd=.7,Kd=1/Zd,Jd="\\s*([+-]?\\d+)\\s*",tp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ep="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",np=/^#([0-9a-f]{3,8})$/,ip=new RegExp(`^rgb\\(${Jd},${Jd},${Jd}\\)$`),rp=new RegExp(`^rgb\\(${ep},${ep},${ep}\\)$`),sp=new RegExp(`^rgba\\(${Jd},${Jd},${Jd},${tp}\\)$`),ap=new RegExp(`^rgba\\(${ep},${ep},${ep},${tp}\\)$`),op=new RegExp(`^hsl\\(${tp},${ep},${ep}\\)$`),lp=new RegExp(`^hsla\\(${tp},${ep},${ep},${tp}\\)$`),up={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};function hp(){return this.rgb().formatHex()}function cp(){return this.rgb().formatRgb()}function Ap(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=np.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?dp(e):3===n?new mp(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?pp(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?pp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ip.exec(t))?new mp(e[1],e[2],e[3],1):(e=rp.exec(t))?new mp(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=sp.exec(t))?pp(e[1],e[2],e[3],e[4]):(e=ap.exec(t))?pp(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=op.exec(t))?bp(e[1],e[2]/100,e[3]/100,1):(e=lp.exec(t))?bp(e[1],e[2]/100,e[3]/100,e[4]):up.hasOwnProperty(t)?dp(up[t]):"transparent"===t?new mp(NaN,NaN,NaN,0):null}function dp(t){return new mp(t>>16&255,t>>8&255,255&t,1)}function pp(t,e,n,i){return i<=0&&(t=e=n=NaN),new mp(t,e,n,i)}function fp(t,e,n,i){return 1===arguments.length?((r=t)instanceof $d||(r=Ap(r)),r?new mp((r=r.rgb()).r,r.g,r.b,r.opacity):new mp):new mp(t,e,n,null==i?1:i);var r}function mp(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function gp(){return`#${xp(this.r)}${xp(this.g)}${xp(this.b)}`}function yp(){const t=vp(this.opacity);return`${1===t?"rgb(":"rgba("}${_p(this.r)}, ${_p(this.g)}, ${_p(this.b)}${1===t?")":`, ${t})`}`}function vp(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function _p(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xp(t){return((t=_p(t))<16?"0":"")+t.toString(16)}function bp(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Mp(t,e,n,i)}function Sp(t){if(t instanceof Mp)return new Mp(t.h,t.s,t.l,t.opacity);if(t instanceof $d||(t=Ap(t)),!t)return new Mp;if(t instanceof Mp)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),a=NaN,o=s-r,l=(s+r)/2;return o?(a=e===s?(n-i)/o+6*(n<i):n===s?(i-e)/o+2:(e-n)/o+4,o/=l<.5?s+r:2-s-r,a*=60):o=l>0&&l<1?0:a,new Mp(a,o,l,t.opacity)}function Mp(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function wp(t){return(t=(t||0)%360)<0?t+360:t}function Tp(t){return Math.max(0,Math.min(1,t||0))}function Ep(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Cp(t){return Cp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cp(t)}Yd($d,Ap,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:hp,formatHex:hp,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Sp(this).formatHsl()},formatRgb:cp,toString:cp}),Yd(mp,fp,Qd($d,{brighter(t){return t=null==t?Kd:Math.pow(Kd,t),new mp(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Zd:Math.pow(Zd,t),new mp(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new mp(_p(this.r),_p(this.g),_p(this.b),vp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gp,formatHex:gp,formatHex8:function(){return`#${xp(this.r)}${xp(this.g)}${xp(this.b)}${xp(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:yp,toString:yp})),Yd(Mp,(function(t,e,n,i){return 1===arguments.length?Sp(t):new Mp(t,e,n,null==i?1:i)}),Qd($d,{brighter(t){return t=null==t?Kd:Math.pow(Kd,t),new Mp(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Zd:Math.pow(Zd,t),new Mp(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new mp(Ep(t>=240?t-240:t+120,r,i),Ep(t,r,i),Ep(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Mp(wp(this.h),Tp(this.s),Tp(this.l),vp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=vp(this.opacity);return`${1===t?"hsl(":"hsla("}${wp(this.h)}, ${100*Tp(this.s)}%, ${100*Tp(this.l)}%${1===t?")":`, ${t})`}`}}));var Rp=/^\s+/,Np=/\s+$/;function Pp(t,e){if(e=e||{},(t=t||"")instanceof Pp)return t;if(!(this instanceof Pp))return new Pp(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,i=null,r=null,s=null,a=!1,o=!1;"string"==typeof t&&(t=function(t){t=t.replace(Rp,"").replace(Np,"").toLowerCase();var e,n=!1;if(Yp[t])t=Yp[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=lf.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=lf.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=lf.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=lf.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=lf.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=lf.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=lf.hex8.exec(t))return{r:Jp(e[1]),g:Jp(e[2]),b:Jp(e[3]),a:rf(e[4]),format:n?"name":"hex8"};if(e=lf.hex6.exec(t))return{r:Jp(e[1]),g:Jp(e[2]),b:Jp(e[3]),format:n?"name":"hex"};if(e=lf.hex4.exec(t))return{r:Jp(e[1]+""+e[1]),g:Jp(e[2]+""+e[2]),b:Jp(e[3]+""+e[3]),a:rf(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=lf.hex3.exec(t))return{r:Jp(e[1]+""+e[1]),g:Jp(e[2]+""+e[2]),b:Jp(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==Cp(t)&&(uf(t.r)&&uf(t.g)&&uf(t.b)?(l=t.r,u=t.g,h=t.b,e={r:255*Zp(l,255),g:255*Zp(u,255),b:255*Zp(h,255)},a=!0,o="%"===String(t.r).substr(-1)?"prgb":"rgb"):uf(t.h)&&uf(t.s)&&uf(t.v)?(i=ef(t.s),r=ef(t.v),e=function(t,e,n){t=6*Zp(t,360),e=Zp(e,100),n=Zp(n,100);var i=Math.floor(t),r=t-i,s=n*(1-e),a=n*(1-r*e),o=n*(1-(1-r)*e),l=i%6,u=[n,a,s,s,o,n][l],h=[o,n,n,a,s,s][l],c=[s,s,o,n,n,a][l];return{r:255*u,g:255*h,b:255*c}}(t.h,i,r),a=!0,o="hsv"):uf(t.h)&&uf(t.s)&&uf(t.l)&&(i=ef(t.s),s=ef(t.l),e=function(t,e,n){var i,r,s;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=Zp(t,360),e=Zp(e,100),n=Zp(n,100),0===e)i=r=s=n;else{var o=n<.5?n*(1+e):n+e-n*e,l=2*n-o;i=a(l,o,t+1/3),r=a(l,o,t),s=a(l,o,t-1/3)}return{r:255*i,g:255*r,b:255*s}}(t.h,i,s),a=!0,o="hsl"),t.hasOwnProperty("a")&&(n=t.a));var l,u,h;return n=$p(n),{ok:a,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Dp(t,e,n){t=Zp(t,255),e=Zp(e,255),n=Zp(n,255);var i,r,s=Math.max(t,e,n),a=Math.min(t,e,n),o=(s+a)/2;if(s==a)i=r=0;else{var l=s-a;switch(r=o>.5?l/(2-s-a):l/(s+a),s){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4}i/=6}return{h:i,s:r,l:o}}function Ip(t,e,n){t=Zp(t,255),e=Zp(e,255),n=Zp(n,255);var i,r,s=Math.max(t,e,n),a=Math.min(t,e,n),o=s,l=s-a;if(r=0===s?0:l/s,s==a)i=0;else{switch(s){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4}i/=6}return{h:i,s:r,v:o}}function Lp(t,e,n,i){var r=[tf(Math.round(t).toString(16)),tf(Math.round(e).toString(16)),tf(Math.round(n).toString(16))];return i&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function Bp(t,e,n,i){return[tf(nf(i)),tf(Math.round(t).toString(16)),tf(Math.round(e).toString(16)),tf(Math.round(n).toString(16))].join("")}function Up(t,e){e=0===e?0:e||10;var n=Pp(t).toHsl();return n.s-=e/100,n.s=Kp(n.s),Pp(n)}function Op(t,e){e=0===e?0:e||10;var n=Pp(t).toHsl();return n.s+=e/100,n.s=Kp(n.s),Pp(n)}function Fp(t){return Pp(t).desaturate(100)}function kp(t,e){e=0===e?0:e||10;var n=Pp(t).toHsl();return n.l+=e/100,n.l=Kp(n.l),Pp(n)}function zp(t,e){e=0===e?0:e||10;var n=Pp(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),Pp(n)}function qp(t,e){e=0===e?0:e||10;var n=Pp(t).toHsl();return n.l-=e/100,n.l=Kp(n.l),Pp(n)}function Gp(t,e){var n=Pp(t).toHsl(),i=(n.h+e)%360;return n.h=i<0?360+i:i,Pp(n)}function Vp(t){var e=Pp(t).toHsl();return e.h=(e.h+180)%360,Pp(e)}function Hp(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Pp(t).toHsl(),i=[Pp(t)],r=360/e,s=1;s<e;s++)i.push(Pp({h:(n.h+s*r)%360,s:n.s,l:n.l}));return i}function jp(t){var e=Pp(t).toHsl(),n=e.h;return[Pp(t),Pp({h:(n+72)%360,s:e.s,l:e.l}),Pp({h:(n+216)%360,s:e.s,l:e.l})]}function Wp(t,e,n){e=e||6,n=n||30;var i=Pp(t).toHsl(),r=360/n,s=[Pp(t)];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(Pp(i));return s}function Xp(t,e){e=e||6;for(var n=Pp(t).toHsv(),i=n.h,r=n.s,s=n.v,a=[],o=1/e;e--;)a.push(Pp({h:i,s:r,v:s})),s=(s+o)%1;return a}Pp.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,i=this.toRgb();return t=i.r/255,e=i.g/255,n=i.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=$p(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Ip(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Ip(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+i+"%)":"hsva("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=Dp(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Dp(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),i=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+i+"%)":"hsla("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return Lp(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,i,r){var s=[tf(Math.round(t).toString(16)),tf(Math.round(e).toString(16)),tf(Math.round(n).toString(16)),tf(nf(i))];if(r&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1))return s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0);return s.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Zp(this._r,255))+"%",g:Math.round(100*Zp(this._g,255))+"%",b:Math.round(100*Zp(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Zp(this._r,255))+"%, "+Math.round(100*Zp(this._g,255))+"%, "+Math.round(100*Zp(this._b,255))+"%)":"rgba("+Math.round(100*Zp(this._r,255))+"%, "+Math.round(100*Zp(this._g,255))+"%, "+Math.round(100*Zp(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Qp[Lp(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+Bp(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var r=Pp(t);n="#"+Bp(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0;return e||!i||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Pp(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(kp,arguments)},brighten:function(){return this._applyModification(zp,arguments)},darken:function(){return this._applyModification(qp,arguments)},desaturate:function(){return this._applyModification(Up,arguments)},saturate:function(){return this._applyModification(Op,arguments)},greyscale:function(){return this._applyModification(Fp,arguments)},spin:function(){return this._applyModification(Gp,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(Wp,arguments)},complement:function(){return this._applyCombination(Vp,arguments)},monochromatic:function(){return this._applyCombination(Xp,arguments)},splitcomplement:function(){return this._applyCombination(jp,arguments)},triad:function(){return this._applyCombination(Hp,[3])},tetrad:function(){return this._applyCombination(Hp,[4])}},Pp.fromRatio=function(t,e){if("object"==Cp(t)){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:ef(t[i]));t=n}return Pp(t,e)},Pp.equals=function(t,e){return!(!t||!e)&&Pp(t).toRgbString()==Pp(e).toRgbString()},Pp.random=function(){return Pp.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Pp.mix=function(t,e,n){n=0===n?0:n||50;var i=Pp(t).toRgb(),r=Pp(e).toRgb(),s=n/100;return Pp({r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a})},
    33// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
    44// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
    5 Vf.readability=function(t,e){var n=Vf(t),r=Vf(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Vf.isReadable=function(t,e,n){var r,i,a=Vf.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},Vf.mostReadable=function(t,e,n){var r,i,a,o,s=null,A=0;i=(n=n||{}).includeFallbackColors,a=n.level,o=n.size;for(var l=0;l<e.length;l++)(r=Vf.readability(t,e[l]))>A&&(A=r,s=Vf(e[l]));return Vf.isReadable(t,s,{level:a,size:o})||!i?s:(n.includeFallbackColors=!1,Vf.mostReadable(t,["#fff","#000"],n))};var Ad=Vf.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ld=Vf.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Ad);function cd(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ud(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function hd(t){return Math.min(1,Math.max(0,t))}function fd(t){return parseInt(t,16)}function dd(t){return 1==t.length?"0"+t:""+t}function pd(t){return t<=1&&(t=100*t+"%"),t}function md(t){return Math.round(255*parseFloat(t)).toString(16)}function gd(t){return fd(t)/255}var vd,_d,yd,xd=(_d="[\\s|\\(]+("+(vd="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+vd+")[,|\\s]+("+vd+")\\s*\\)?",yd="[\\s|\\(]+("+vd+")[,|\\s]+("+vd+")[,|\\s]+("+vd+")[,|\\s]+("+vd+")\\s*\\)?",{CSS_UNIT:new RegExp(vd),rgb:new RegExp("rgb"+_d),rgba:new RegExp("rgba"+yd),hsl:new RegExp("hsl"+_d),hsla:new RegExp("hsla"+yd),hsv:new RegExp("hsv"+_d),hsva:new RegExp("hsva"+yd),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function bd(t){return!!xd.CSS_UNIT.exec(t)}function Md(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function wd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Sd(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ed(t){return function(t){if(Array.isArray(t))return Td(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Sd(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sd(t,e){if(t){if("string"==typeof t)return Td(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Td(t,e):void 0}}function Td(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Cd(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var Rd=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(e instanceof Array?e.length?e:[void 0]:[e]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),a=t.reduce((function(t,e){var r=t,a=e;return i.forEach((function(t,e){var o,s=t.keyAccessor;if(t.isProp){var A=a,l=A[s],c=Md(A,[s].map(Cd));o=l,a=c}else o=s(a,e);e+1<i.length?(r.hasOwnProperty(o)||(r[o]={}),r=r[o]):n?(r.hasOwnProperty(o)||(r[o]=[]),r[o].push(a)):r[o]=a})),t}),{});n instanceof Function&&function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(e).forEach((function(t){return e[t]=n(e[t])})):Object.values(e).forEach((function(e){return t(e,r+1)}))}(a);var o=a;return r&&(o=[],function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===i.length?o.push({keys:n,vals:e}):Object.entries(e).forEach((function(e){var r=wd(e,2),i=r[0],a=r[1];return t(a,[].concat(Ed(n),[i]))}))}(a),e instanceof Array&&0===e.length&&1===o.length&&(o[0].keys=[])),o};function Pd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ld(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dd(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Od(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||qd(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Id(t){return function(t){if(Array.isArray(t))return Ud(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||qd(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qd(t,e){if(t){if("string"==typeof t)return Ud(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ud(t,e):void 0}}function Ud(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Nd=["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"];function Bd(t,e,n){var r=n.objBindAttr,i=void 0===r?"__obj":r,a=n.dataBindAttr,o=void 0===a?"__data":a,s=n.idAccessor,A=n.purge,l=void 0!==A&&A,c=function(t){return t.hasOwnProperty(o)},u=e.filter((function(t){return!c(t)})),h=e.filter(c).map((function(t){return t[o]})),f=l?{enter:t,exit:h,update:[]}:function(t,e,n){var r={enter:[],update:[],exit:[]};if(n){var i=Rd(t,n,!1),a=Rd(e,n,!1),o=Object.assign({},i,a);Object.entries(o).forEach((function(t){var e=Od(t,2),n=e[0],o=e[1],s=i.hasOwnProperty(n)?a.hasOwnProperty(n)?"update":"exit":"enter";r[s].push("update"===s?[i[n],a[n]]:o)}))}else{var s=new Set(t),A=new Set(e);new Set([].concat(Id(s),Id(A))).forEach((function(t){var e=s.has(t)?A.has(t)?"update":"exit":"enter";r[e].push("update"===e?[t,t]:t)}))}return r}(h,t,s);return f.update=f.update.map((function(t){var e=Od(t,2),n=e[0],r=e[1];return n!==r&&(r[i]=n[i],r[i][o]=r),r})),f.exit=f.exit.concat(u.map((function(t){return Ld({},i,t)}))),f}function kd(t,e,n,r,i){var a=i.createObj,o=void 0===a?function(t){return{}}:a,s=i.updateObj,A=void 0===s?function(t,e){}:s,l=i.exitObj,c=void 0===l?function(t){}:l,u=i.objBindAttr,h=void 0===u?"__obj":u,f=i.dataBindAttr,d=void 0===f?"__data":f,p=Dd(i,Nd),m=Bd(t,e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pd(Object(n),!0).forEach((function(e){Ld(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({objBindAttr:h,dataBindAttr:d},p)),g=m.enter,v=m.update;m.exit.forEach((function(t){var e=t[h];delete t[h],c(e),r(e)}));var _=function(t){var e=[];return t.forEach((function(t){var n=o(t);n&&(n[d]=t,t[h]=n,e.push(n))})),e}(g);!function(t){t.forEach((function(t){var e=t[h];e&&(e[d]=t,A(e,t))}))}([].concat(Id(g),Id(v))),_.forEach(n)}var Fd={exports:{}};!function(t,e){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r=n(1),i=function(){function t(t,e,n){void 0===t&&(t=NaN),void 0===e&&(e=NaN),void 0===n&&(n=!1),this._minFPS=e,this._maxFPS=t,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new r.default,this._onPause=new r.default,this._onTick=new r.default,this._onTickOncePerFrame=new r.default,n||this.resume()}return t.prototype.updateOnce=function(t){t(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce())},t.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},t.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(t.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeScale",{get:function(){return this._timeScale},set:function(t){this._timeScale!==t&&(this._timeScale=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),t.prototype.animateOnce=function(){var t=this;this._animationFrameHandle=window.requestAnimationFrame((function(){return t.onFrame()}))},t.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},t.prototype.update=function(t,e){void 0===e&&(e=!0),this._currentTick++,this._currentTime+=t,this._tickDeltaTime=t,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),e&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.getTimer=function(){return Date.now()},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){!function(e,n){t.exports=n()}(0,(function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){var n=function(){function t(){this.functions=[]}return t.prototype.add=function(t){return-1===this.functions.indexOf(t)&&(this.functions.push(t),!0)},t.prototype.remove=function(t){var e=this.functions.indexOf(t);return e>-1&&(this.functions.splice(e,1),!0)},t.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},t.prototype.dispatch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.functions.concat().forEach((function(e){e.apply(void 0,t)}))},Object.defineProperty(t.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n}])}))}])}(Fd);var zd=el(Fd.exports);function Gd(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var Hd=t=>()=>t;function jd(t){return 1==(t=+t)?Vd:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Hd(isNaN(e)?n:e)}}function Vd(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Hd(isNaN(t)?e:t)}var Wd=function t(e){var n=jd(e);function r(t,e){var r=n((t=Rf(t)).r,(e=Rf(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=Vd(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function Xd(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;n<r;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}}function Qd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Yd(t,e){return(Qd(e)?Xd:Zd)(t,e)}function Zd(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),o=new Array(r);for(n=0;n<i;++n)a[n]=rp(t[n],e[n]);for(;n<r;++n)o[n]=e[n];return function(t){for(n=0;n<i;++n)o[n]=a[n](t);return o}}function Kd(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Jd(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function $d(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=rp(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var tp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ep=new RegExp(tp.source,"g");function np(t,e){var n,r,i,a=tp.lastIndex=ep.lastIndex=0,o=-1,s=[],A=[];for(t+="",e+="";(n=tp.exec(t))&&(r=ep.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,A.push({i:o,x:Jd(n,r)})),a=ep.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?A[0]?function(t){return function(e){return t(e)+""}}(A[0].x):function(t){return function(){return t}}(e):(e=A.length,function(t){for(var n,r=0;r<e;++r)s[(n=A[r]).i]=n.x(t);return s.join("")})}function rp(t,e){var n,r=typeof e;return null==e||"boolean"===r?Hd(e):("number"===r?Jd:"string"===r?(n=Sf(e))?(e=n,Wd):np:e instanceof Sf?Wd:e instanceof Date?Kd:Qd(e)?Xd:Array.isArray(e)?Zd:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?$d:Jd)(t,e)}function ip(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function ap(t){return+t}var op=[0,1];function sp(t){return t}function Ap(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function lp(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=Ap(i,r),a=n(o,a)):(r=Ap(r,i),a=n(a,o)),function(t){return a(r(t))}}function cp(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=Ap(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){var n=Il(t,e,1,r)-1;return a[n](i[n](e))}}function up(){var t,e,n,r,i,a,o=op,s=op,A=rp,l=sp;function c(){var t=Math.min(o.length,s.length);return l!==sp&&(l=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(o[0],o[t-1])),r=t>2?cp:lp,i=a=null,u}function u(e){return null==e||isNaN(e=+e)?n:(i||(i=r(o.map(t),s,A)))(t(l(e)))}return u.invert=function(n){return l(e((a||(a=r(s,o.map(t),Jd)))(n)))},u.domain=function(t){return arguments.length?(o=Array.from(t,ap),c()):o.slice()},u.range=function(t){return arguments.length?(s=Array.from(t),c()):s.slice()},u.rangeRound=function(t){return s=Array.from(t),A=ip,c()},u.clamp=function(t){return arguments.length?(l=!!t||sp,c()):l!==sp},u.interpolate=function(t){return arguments.length?(A=t,c()):A},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,r){return t=n,e=r,c()}}function hp(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function fp(t){return(t=hp(Math.abs(t)))?t[1]:NaN}var dp,pp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mp(t){if(!(e=pp.exec(t)))throw new Error("invalid format: "+t);var e;return new gp({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function gp(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function vp(t,e){var n=hp(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}mp.prototype=gp.prototype,gp.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var _p={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>vp(100*t,e),r:vp,s:function(t,e){var n=hp(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(dp=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+hp(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function yp(t){return t}var xp,bp,Mp,wp=Array.prototype.map,Ep=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Sp(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?yp:(e=wp.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],A=0;i>0&&s>0&&(A+s+1>r&&(s=Math.max(1,r-A)),a.push(t.substring(i-=s,i+s)),!((A+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?yp:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(wp.call(t.numerals,String)),A=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=mp(t)).fill,n=t.align,u=t.sign,h=t.symbol,f=t.zero,d=t.width,p=t.comma,m=t.precision,g=t.trim,v=t.type;"n"===v?(p=!0,v="g"):_p[v]||(void 0===m&&(m=12),g=!0,v="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===h?a:/[%p]/.test(v)?A:"",x=_p[v],b=/[defgprs%]/.test(v);function M(t){var i,a,A,h=_,M=y;if("c"===v)M=x(t)+M,t="";else{var w=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:x(Math.abs(t),m),g&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),w&&0==+t&&"+"!==u&&(w=!1),h=(w?"("===u?u:l:"-"===u||"("===u?"":u)+h,M=("s"===v?Ep[8+dp/3]:"")+M+(w&&"("===u?")":""),b)for(i=-1,a=t.length;++i<a;)if(48>(A=t.charCodeAt(i))||A>57){M=(46===A?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}p&&!f&&(t=r(t,1/0));var E=h.length+t.length+M.length,S=E<d?new Array(d-E+1).join(e):"";switch(p&&f&&(t=r(S+t,S.length?d-M.length:1/0),S=""),n){case"<":t=h+t+M+S;break;case"=":t=h+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+h+t+M+S.slice(E);break;default:t=S+h+t+M}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),M.toString=function(){return t+""},M}return{format:u,formatPrefix:function(t,e){var n=u(((t=mp(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(fp(e)/3))),i=Math.pow(10,-r),a=Ep[8+r/3];return function(t){return n(i*t)+a}}}}function Tp(t,e,n,r){var i,a=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?zl(e,t,n):zl(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}(t,e,n);switch((r=mp(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(fp(e)/3)))-fp(Math.abs(t)))}(a,o))||(r.precision=i),Mp(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,fp(e)-fp(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-fp(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return bp(r)}function Cp(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,a,o]=r?Fl(e,t,n):Fl(t,e,n);if(!(a>=i))return[];const s=a-i+1,A=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)A[t]=(a-t)/-o;else for(let t=0;t<s;++t)A[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)A[t]=(i+t)/-o;else for(let t=0;t<s;++t)A[t]=(i+t)*o;return A}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Tp(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,a=e(),o=0,s=a.length-1,A=a[o],l=a[s],c=10;for(l<A&&(i=A,A=l,l=i,i=o,o=s,s=i);c-- >0;){if((i=zl(A,l,n))===r)return a[o]=A,a[s]=l,e(a);if(i>0)A=Math.floor(A/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;A=Math.ceil(A*i)/i,l=Math.floor(l*i)/i}r=i}return t},t}function Rp(){var t=up()(sp,sp);return t.copy=function(){return e=t,Rp().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},Gd.apply(t,arguments),Cp(t)}xp=Sp({thousands:",",grouping:[3],currency:["$",""]}),bp=xp.format,Mp=xp.formatPrefix;const Pp=134217729,Lp=33306690738754706e-32;function Dp(t,e,n,r,i){let a,o,s,A,l=e[0],c=r[0],u=0,h=0;c>l==c>-l?(a=l,l=e[++u]):(a=c,c=r[++h]);let f=0;if(u<t&&h<n)for(c>l==c>-l?(o=l+a,s=a-(o-l),l=e[++u]):(o=c+a,s=a-(o-c),c=r[++h]),a=o,0!==s&&(i[f++]=s);u<t&&h<n;)c>l==c>-l?(o=a+l,A=o-a,s=a-(o-A)+(l-A),l=e[++u]):(o=a+c,A=o-a,s=a-(o-A)+(c-A),c=r[++h]),a=o,0!==s&&(i[f++]=s);for(;u<t;)o=a+l,A=o-a,s=a-(o-A)+(l-A),l=e[++u],a=o,0!==s&&(i[f++]=s);for(;h<n;)o=a+c,A=o-a,s=a-(o-A)+(c-A),c=r[++h],a=o,0!==s&&(i[f++]=s);return 0===a&&0!==f||(i[f++]=a),f}function Op(t){return new Float64Array(t)}const Ip=22204460492503146e-32,qp=11093356479670487e-47,Up=Op(4),Np=Op(8),Bp=Op(12),kp=Op(16),Fp=Op(4);function zp(t,e,n,r,i,a){const o=(e-a)*(n-i),s=(t-i)*(r-a),A=o-s,l=Math.abs(o+s);return Math.abs(A)>=33306690738754716e-32*l?A:-function(t,e,n,r,i,a,o){let s,A,l,c,u,h,f,d,p,m,g,v,_,y,x,b,M,w;const E=t-i,S=n-i,T=e-a,C=r-a;y=E*C,h=Pp*E,f=h-(h-E),d=E-f,h=Pp*C,p=h-(h-C),m=C-p,x=d*m-(y-f*p-d*p-f*m),b=T*S,h=Pp*T,f=h-(h-T),d=T-f,h=Pp*S,p=h-(h-S),m=S-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Up[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Up[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Up[2]=v-(w-u)+(g-u),Up[3]=w;let R=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,Up),P=Ip*o;if(R>=P||-R>=P)return R;if(u=t-E,s=t-(E+u)+(u-i),u=n-S,l=n-(S+u)+(u-i),u=e-T,A=e-(T+u)+(u-a),u=r-C,c=r-(C+u)+(u-a),0===s&&0===A&&0===l&&0===c)return R;if(P=qp*o+Lp*Math.abs(R),R+=E*c+C*s-(T*l+S*A),R>=P||-R>=P)return R;y=s*C,h=Pp*s,f=h-(h-s),d=s-f,h=Pp*C,p=h-(h-C),m=C-p,x=d*m-(y-f*p-d*p-f*m),b=A*S,h=Pp*A,f=h-(h-A),d=A-f,h=Pp*S,p=h-(h-S),m=S-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Fp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Fp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Fp[2]=v-(w-u)+(g-u),Fp[3]=w;const L=Dp(4,Up,4,Fp,Np);y=E*c,h=Pp*E,f=h-(h-E),d=E-f,h=Pp*c,p=h-(h-c),m=c-p,x=d*m-(y-f*p-d*p-f*m),b=T*l,h=Pp*T,f=h-(h-T),d=T-f,h=Pp*l,p=h-(h-l),m=l-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Fp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Fp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Fp[2]=v-(w-u)+(g-u),Fp[3]=w;const D=Dp(L,Np,4,Fp,Bp);y=s*c,h=Pp*s,f=h-(h-s),d=s-f,h=Pp*c,p=h-(h-c),m=c-p,x=d*m-(y-f*p-d*p-f*m),b=A*l,h=Pp*A,f=h-(h-A),d=A-f,h=Pp*l,p=h-(h-l),m=l-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Fp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Fp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Fp[2]=v-(w-u)+(g-u),Fp[3]=w;const O=Dp(D,Bp,4,Fp,kp);return kp[O-1]}(t,e,n,r,i,a,l)}const Gp=Math.pow(2,-52),Hp=new Uint32Array(512);class jp{static from(t,e=Zp,n=Kp){const r=t.length,i=new Float64Array(2*r);for(let a=0;a<r;a++){const r=t[a];i[2*a]=e(r),i[2*a+1]=n(r)}return new jp(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,a=t.length>>1;let o=1/0,s=1/0,A=-1/0,l=-1/0;for(let e=0;e<a;e++){const n=t[2*e],r=t[2*e+1];n<o&&(o=n),r<s&&(s=r),n>A&&(A=n),r>l&&(l=r),this._ids[e]=e}const c=(o+A)/2,u=(s+l)/2;let h,f,d;for(let e=0,n=1/0;e<a;e++){const r=Vp(c,u,t[2*e],t[2*e+1]);r<n&&(h=e,n=r)}const p=t[2*h],m=t[2*h+1];for(let e=0,n=1/0;e<a;e++){if(e===h)continue;const r=Vp(p,m,t[2*e],t[2*e+1]);r<n&&r>0&&(f=e,n=r)}let g=t[2*f],v=t[2*f+1],_=1/0;for(let e=0;e<a;e++){if(e===h||e===f)continue;const n=Xp(p,m,g,v,t[2*e],t[2*e+1]);n<_&&(d=e,_=n)}let y=t[2*d],x=t[2*d+1];if(_===1/0){for(let e=0;e<a;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];Qp(this._ids,this._dists,0,a-1);const e=new Uint32Array(a);let n=0;for(let t=0,r=-1/0;t<a;t++){const i=this._ids[t],a=this._dists[i];a>r&&(e[n++]=i,r=a)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(zp(p,m,g,v,y,x)<0){const t=f,e=g,n=v;f=d,g=y,v=x,d=t,y=e,x=n}const b=function(t,e,n,r,i,a){const o=n-t,s=r-e,A=i-t,l=a-e,c=o*o+s*s,u=A*A+l*l,h=.5/(o*l-s*A);return{x:t+(l*c-s*u)*h,y:e+(o*u-A*c)*h}}(p,m,g,v,y,x);this._cx=b.x,this._cy=b.y;for(let e=0;e<a;e++)this._dists[e]=Vp(t[2*e],t[2*e+1],b.x,b.y);Qp(this._ids,this._dists,0,a-1),this._hullStart=h;let M=3;n[h]=e[d]=f,n[f]=e[h]=d,n[d]=e[f]=h,r[h]=0,r[f]=1,r[d]=2,i.fill(-1),i[this._hashKey(p,m)]=h,i[this._hashKey(g,v)]=f,i[this._hashKey(y,x)]=d,this.trianglesLen=0,this._addTriangle(h,f,d,-1,-1,-1);for(let a,o,s=0;s<this._ids.length;s++){const A=this._ids[s],l=t[2*A],c=t[2*A+1];if(s>0&&Math.abs(l-a)<=Gp&&Math.abs(c-o)<=Gp)continue;if(a=l,o=c,A===h||A===f||A===d)continue;let u=0;for(let t=0,e=this._hashKey(l,c);t<this._hashSize&&(u=i[(e+t)%this._hashSize],-1===u||u===n[u]);t++);u=e[u];let p,m=u;for(;p=n[m],zp(l,c,t[2*m],t[2*m+1],t[2*p],t[2*p+1])>=0;)if(m=p,m===u){m=-1;break}if(-1===m)continue;let g=this._addTriangle(m,A,n[m],-1,-1,r[m]);r[A]=this._legalize(g+2),r[m]=g,M++;let v=n[m];for(;p=n[v],zp(l,c,t[2*v],t[2*v+1],t[2*p],t[2*p+1])<0;)g=this._addTriangle(v,A,p,r[A],-1,r[v]),r[A]=this._legalize(g+2),n[v]=v,M--,v=p;if(m===u)for(;p=e[m],zp(l,c,t[2*p],t[2*p+1],t[2*m],t[2*m+1])<0;)g=this._addTriangle(p,A,m,-1,r[m],r[p]),this._legalize(g+2),r[p]=g,n[m]=m,M--,m=p;this._hullStart=e[A]=m,n[m]=e[v]=A,n[A]=v,i[this._hashKey(l,c)]=A,i[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(M);for(let t=0,e=this._hullStart;t<M;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,a=0;for(;;){const o=n[t],s=t-t%3;if(a=s+(t+2)%3,-1===o){if(0===i)break;t=Hp[--i];continue}const A=o-o%3,l=s+(t+1)%3,c=A+(o+2)%3,u=e[a],h=e[t],f=e[l],d=e[c];if(Wp(r[2*u],r[2*u+1],r[2*h],r[2*h+1],r[2*f],r[2*f+1],r[2*d],r[2*d+1])){e[t]=d,e[o]=u;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(o,n[a]),this._link(a,c);const s=A+(o+1)%3;i<Hp.length&&(Hp[i++]=s)}else{if(0===i)break;t=Hp[--i]}}return a}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,a){const o=this.trianglesLen;return this._triangles[o]=t,this._triangles[o+1]=e,this._triangles[o+2]=n,this._link(o,r),this._link(o+1,i),this._link(o+2,a),this.trianglesLen+=3,o}}function Vp(t,e,n,r){const i=t-n,a=e-r;return i*i+a*a}function Wp(t,e,n,r,i,a,o,s){const A=t-o,l=e-s,c=n-o,u=r-s,h=i-o,f=a-s,d=c*c+u*u,p=h*h+f*f;return A*(u*p-d*f)-l*(c*p-d*h)+(A*A+l*l)*(c*f-u*h)<0}function Xp(t,e,n,r,i,a){const o=n-t,s=r-e,A=i-t,l=a-e,c=o*o+s*s,u=A*A+l*l,h=.5/(o*l-s*A),f=(l*c-s*u)*h,d=(o*u-A*c)*h;return f*f+d*d}function Qp(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],a=e[r];let o=i-1;for(;o>=n&&e[t[o]]>a;)t[o+1]=t[o--];t[o+1]=r}else{let i=n+1,a=r;Yp(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Yp(t,n,r),e[t[i]]>e[t[r]]&&Yp(t,i,r),e[t[n]]>e[t[i]]&&Yp(t,n,i);const o=t[i],s=e[o];for(;;){do{i++}while(e[t[i]]<s);do{a--}while(e[t[a]]>s);if(a<i)break;Yp(t,i,a)}t[n+1]=t[a],t[a]=o,r-i+1>=a-n?(Qp(t,e,i,r),Qp(t,e,n,a-1)):(Qp(t,e,n,a-1),Qp(t,e,i,r))}}function Yp(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Zp(t){return t[0]}function Kp(t){return t[1]}function Jp(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r,i=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(t),a="Feature"===(r=e).type?r.geometry:r,o=a.type,s=e.bbox,A=a.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,s))return!1;"Polygon"===o&&(A=[A]);for(var l=!1,c=0;c<A.length&&!l;c++)if($p(i,A[c][0],n.ignoreBoundary)){for(var u=!1,h=1;h<A[c].length&&!u;)$p(i,A[c][h],!n.ignoreBoundary)&&(u=!0),h++;u||(l=!0)}return l}function $p(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,a=e.length-1;i<e.length;a=i++){var o=e[i][0],s=e[i][1],A=e[a][0],l=e[a][1];if(t[1]*(o-A)+s*(A-t[0])+l*(t[0]-o)==0&&(o-t[0])*(A-t[0])<=0&&(s-t[1])*(l-t[1])<=0)return!n;s>t[1]!=l>t[1]&&t[0]<(A-o)*(t[1]-s)/(l-s)+o&&(r=!r)}return r}const tm=1e-6;class em{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>tm||Math.abs(this._y1-i)>tm)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class nm{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class rm{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this;let i,a;const o=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,A=0,l=0,c=n.length;A<c;A+=3,l+=2){const c=2*n[A],u=2*n[A+1],h=2*n[A+2],f=t[c],d=t[c+1],p=t[u],m=t[u+1],g=t[h],v=t[h+1],_=p-f,y=m-d,x=g-f,b=v-d,M=2*(_*b-y*x);if(Math.abs(M)<1e-9){if(void 0===i){i=a=0;for(const n of e)i+=t[2*n],a+=t[2*n+1];i/=e.length,a/=e.length}const n=1e9*Math.sign((i-f)*b-(a-d)*x);r=(f+g)/2-n*b,s=(d+v)/2+n*x}else{const t=1/M,e=_*_+y*y,n=x*x+b*b;r=f+(b*e-y*n)*t,s=d+(_*n-x*e)*t}o[l]=r,o[l+1]=s}let s,A,l,c=e[e.length-1],u=4*c,h=t[2*c],f=t[2*c+1];r.fill(0);for(let n=0;n<e.length;++n)c=e[n],s=u,A=h,l=f,u=4*c,h=t[2*c],f=t[2*c+1],r[s+2]=r[u]=l-f,r[s+3]=r[u+1]=h-A}render(t){const e=null==t?t=new em:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:a,vectors:o}=this;if(i.length<=1)return null;for(let e=0,r=n.length;e<r;++e){const r=n[e];if(r<e)continue;const i=2*Math.floor(e/3),o=2*Math.floor(r/3),s=a[i],A=a[i+1],l=a[o],c=a[o+1];this._renderSegment(s,A,l,c,t)}let s,A=i[i.length-1];for(let e=0;e<i.length;++e){s=A,A=i[e];const n=2*Math.floor(r[A]/3),l=a[n],c=a[n+1],u=4*s,h=this._project(l,c,o[u+2],o[u+3]);h&&this._renderSegment(l,c,h[0],h[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new em:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new em:void 0,r=this._clip(t);if(null===r||!r.length)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let t=2;t<i;t+=2)r[t]===r[t-2]&&r[t+1]===r[t-1]||e.lineTo(r[t],r[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new nm;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let a;const o=this._regioncode(t,e),s=this._regioncode(n,r);0===o&&0===s?(i.moveTo(t,e),i.lineTo(n,r)):(a=this._clipSegment(t,e,n,r,o,s))&&(i.moveTo(a[0],a[1]),i.lineTo(a[2],a[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let r=0,i=e.length;r<i;r+=2)for(let a=0,o=t.length;a<o;a+=2)if(e[r]===t[a]&&e[r+1]===t[a+1]&&e[(r+2)%i]===t[(a+o-2)%o]&&e[(r+3)%i]===t[(a+o-1)%o]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,a=n[t];if(-1===a)return null;const o=[];let s=a;do{const n=Math.floor(s/3);if(o.push(e[2*n],e[2*n+1]),s=s%3==2?s-2:s+1,i[s]!==t)break;s=r[s]}while(s!==a&&-1!==s);return o}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,r=4*t;return this._simplify(n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e))}_clipFinite(t,e){const n=e.length;let r,i,a,o,s=null,A=e[n-2],l=e[n-1],c=this._regioncode(A,l),u=0;for(let h=0;h<n;h+=2)if(r=A,i=l,A=e[h],l=e[h+1],a=c,c=this._regioncode(A,l),0===a&&0===c)o=u,u=0,s?s.push(A,l):s=[A,l];else{let e,n,h,f,d;if(0===a){if(null===(e=this._clipSegment(r,i,A,l,a,c)))continue;[n,h,f,d]=e}else{if(null===(e=this._clipSegment(A,l,r,i,c,a)))continue;[f,d,n,h]=e,o=u,u=this._edgecode(n,h),o&&u&&this._edge(t,o,u,s,s.length),s?s.push(n,h):s=[n,h]}o=u,u=this._edgecode(f,d),o&&u&&this._edge(t,o,u,s,s.length),s?s.push(f,d):s=[f,d]}if(s)o=u,u=this._edgecode(s[0],s[1]),o&&u&&this._edge(t,o,u,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}_clipSegment(t,e,n,r,i,a){const o=i<a;for(o&&([t,e,n,r,i,a]=[n,r,t,e,a,i]);;){if(0===i&&0===a)return o?[n,r,t,e]:[t,e,n,r];if(i&a)return null;let s,A,l=i||a;8&l?(s=t+(n-t)*(this.ymax-e)/(r-e),A=this.ymax):4&l?(s=t+(n-t)*(this.ymin-e)/(r-e),A=this.ymin):2&l?(A=e+(r-e)*(this.xmax-t)/(n-t),s=this.xmax):(A=e+(r-e)*(this.xmin-t)/(n-t),s=this.xmin),i?(t=s,e=A,i=this._regioncode(t,e)):(n=s,r=A,a=this._regioncode(n,r))}}_clipInfinite(t,e,n,r,i,a){let o,s=Array.from(e);if((o=this._project(s[0],s[1],n,r))&&s.unshift(o[0],o[1]),(o=this._project(s[s.length-2],s[s.length-1],i,a))&&s.push(o[0],o[1]),s=this._clipFinite(t,s))for(let e,n=0,r=s.length,i=this._edgecode(s[r-2],s[r-1]);n<r;n+=2)e=i,i=this._edgecode(s[n],s[n+1]),e&&i&&(n=this._edge(t,e,i,s,n),r=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,e,n,r,i){for(;e!==n;){let n,a;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,a=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,a=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,a=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,a=this.ymin}r[i]===n&&r[i+1]===a||!this.contains(t,n,a)||(r.splice(i,0,n,a),i+=2)}return i}_project(t,e,n,r){let i,a,o,s=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<s&&(o=this.ymin,a=t+(s=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<s&&(o=this.ymax,a=t+(s=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<s&&(a=this.xmax,o=e+(s=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<s&&(a=this.xmin,o=e+(s=i)*r)}return[a,o]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e<t.length;e+=2){const n=(e+2)%t.length,r=(e+4)%t.length;(t[e]===t[n]&&t[n]===t[r]||t[e+1]===t[n+1]&&t[n+1]===t[r+1])&&(t.splice(n,2),e-=2)}t.length||(t=null)}return t}}const im=2*Math.PI,am=Math.pow;function om(t){return t[0]}function sm(t){return t[1]}function Am(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class lm{static from(t,e=om,n=sm,r){return new lm("length"in t?function(t,e,n,r){const i=t.length,a=new Float64Array(2*i);for(let o=0;o<i;++o){const i=t[o];a[2*o]=e.call(r,i,o,t),a[2*o+1]=n.call(r,i,o,t)}return a}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const a of t)yield e.call(r,a,i,t),yield n.call(r,a,i,t),++i}(t,e,n,r)))}constructor(t){this._delaunator=new jp(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const r=2*e[t],i=2*e[t+1],a=2*e[t+2];if((n[a]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[a+1]-n[r+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t<n;++t){const n=Am(e[2*t],e[2*t+1],i);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new jp(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=i[t%3==2?t-2:t+1];-1!==n[t]&&-1!==a[e]||(a[e]=t)}for(let t=0,e=r.length;t<e;++t)o[r[t]]=t;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],a[r[0]]=1,2===r.length&&(a[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new rm(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:a,collinear:o}=this;if(o){const e=o.indexOf(t);return e>0&&(yield o[e-1]),void(e<o.length-1&&(yield o[e+1]))}const s=e[t];if(-1===s)return;let A=s,l=-1;do{if(yield l=a[A],A=A%3==2?A-2:A+1,a[A]!==t)return;if(A=i[A],-1===A){const e=n[(r[t]+1)%n.length];return void(e!==l&&(yield e))}}while(A!==s)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:a,halfedges:o,triangles:s,points:A}=this;if(-1===r[t]||!A.length)return(t+1)%(A.length>>1);let l=t,c=am(e-A[2*t],2)+am(n-A[2*t+1],2);const u=r[t];let h=u;do{let r=s[h];const u=am(e-A[2*r],2)+am(n-A[2*r+1],2);if(u<c&&(c=u,l=r),h=h%3==2?h-2:h+1,s[h]!==t)break;if(h=o[h],-1===h){if(h=i[(a[t]+1)%i.length],h!==r&&am(e-A[2*h],2)+am(n-A[2*h+1],2)<c)return h;break}}while(h!==u);return l}render(t){const e=null==t?t=new em:void 0,{points:n,halfedges:r,triangles:i}=this;for(let e=0,a=r.length;e<a;++e){const a=r[e];if(a<e)continue;const o=2*i[e],s=2*i[a];t.moveTo(n[o],n[o+1]),t.lineTo(n[s],n[s+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"==typeof t.moveTo||(e=t,t=null),e=null==e?2:+e;const n=null==t?t=new em:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],a=r[n+1];t.moveTo(i+e,a),t.arc(i,a,e,0,im)}return n&&n.value()}renderHull(t){const e=null==t?t=new em:void 0,{hull:n,points:r}=this,i=2*n[0],a=n.length;t.moveTo(r[i],r[i+1]);for(let e=1;e<a;++e){const i=2*n[e];t.lineTo(r[i],r[i+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new nm;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new em:void 0,{points:r,triangles:i}=this,a=2*i[t*=3],o=2*i[t+1],s=2*i[t+2];return e.moveTo(r[a],r[a+1]),e.lineTo(r[o],r[o+1]),e.lineTo(r[s],r[s+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new nm;return this.renderTriangle(t,e),e.value()}}const cm=Math.PI,um=cm/2,hm=180/cm,fm=cm/180,dm=Math.atan2,pm=Math.cos,mm=Math.max,gm=Math.min,vm=Math.sin,_m=Math.sign||function(t){return t>0?1:t<0?-1:0},ym=Math.sqrt;function xm(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bm(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Mm(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function wm(t){var e=ym(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);return[t[0]/e,t[1]/e,t[2]/e]}function Em(t){return[dm(t[1],t[0])*hm,(e=mm(-1,gm(1,t[2])),(e>1?um:e<-1?-um:Math.asin(e))*hm)];var e}function Sm(t){const e=t[0]*fm,n=t[1]*fm,r=pm(n);return[r*pm(e),r*vm(e),vm(n)]}function Tm(t){return xm((t=t.map((t=>Sm(t))))[0],bm(t[2],t[1]))}function Cm(t){const e=function(t){if(t.length<2)return{};let e=0;for(;isNaN(t[e][0]+t[e][1])&&e++<t.length;);const n=function(t){function e(e){return(e=t(e[0]*Kl,e[1]*Kl))[0]*=Zl,e[1]*=Zl,e}return t=Iu(t[0]*Kl,t[1]*Kl,t.length>2?t[2]*Kl:0),e.invert=function(e){return(e=t.invert(e[0]*Kl,e[1]*Kl))[0]*=Zl,e[1]*=Zl,e},e}(t[e]),r=Fh().translate([0,0]).scale(1).rotate(n.invert([180,0]));t=t.map(r);const i=[];let a=1;for(let e=0,n=t.length;e<n;e++){let n=t[e][0]**2+t[e][1]**2;!isFinite(n)||n>1e32?i.push(e):n>a&&(a=n)}const o=1e6*ym(a);i.forEach((e=>t[e]=[o,0])),t.push([0,o]),t.push([-o,0]),t.push([0,-o]);const s=lm.from(t);s.projection=r;const{triangles:A,halfedges:l,inedges:c}=s;for(let n=0,r=l.length;n<r;n++)if(l[n]<0){const t=n%3==2?n-2:n+1,r=n%3==0?n+2:n-1,i=l[t],a=l[r];l[i]=a,l[a]=i,l[t]=l[r]=-1,A[n]=A[t]=A[r]=e,c[A[i]]=i%3==0?i+2:i-1,c[A[a]]=a%3==0?a+2:a-1,n+=2-n%3}else A[n]>t.length-3-1&&(A[n]=e);return s}(t),n=function(t){const{triangles:e}=t;if(!e)return[];const n=[];for(let t=0,r=e.length/3;t<r;t++){const r=e[3*t],i=e[3*t+1],a=e[3*t+2];r!==i&&i!==a&&n.push([r,a,i])}return n}(e),r=function(t,e){const n=new Set;return 2===e.length?[[0,1]]:(t.forEach((t=>{if(t[0]!==t[1]&&!(Tm(t.map((t=>e[t])))<0))for(let e,r=0;r<3;r++)e=(r+1)%3,n.add(ql([t[r],t[e]]).join("-"))})),Array.from(n,(t=>t.split("-").map(Number))))}(n,t),i=function(t,e){const n=[];t.forEach((t=>{for(let e=0;e<3;e++){const r=t[e],i=t[(e+1)%3];n[r]=n[r]||[],n[r].push(i)}})),0===t.length&&(2===e?(n[0]=[1],n[1]=[0]):1===e&&(n[0]=[]));return n}(n,t.length),a=function(t,e){function n(t,e){let n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i}return function(r,i,a){void 0===a&&(a=0);let o,s,A=a;const l=Sm([r,i]);do{o=a,a=null,s=n(l,Sm(e[o])),t[o].forEach((t=>{let r=n(l,Sm(e[t]));if(r<s)return s=r,a=t,void(A=t)}))}while(null!==a);return A}}(i,t),o=function(t,e){return t.map((t=>{const n=t.map((t=>e[t])).map(Sm);return Em(wm(Mm(Mm(bm(n[1],n[0]),bm(n[2],n[1])),bm(n[0],n[2]))))}))}(n,t),{polygons:s,centers:A}=function(t,e,n){const r=[],i=t.slice();if(0===e.length){if(n.length<2)return{polygons:r,centers:i};if(2===n.length){const t=Sm(n[0]),e=Sm(n[1]),a=wm(Mm(t,e)),s=wm(bm(t,e)),A=bm(a,s),l=[a,bm(a,A),bm(bm(a,A),A),bm(bm(bm(a,A),A),A)].map(Em).map(o);return r.push(l),r.push(l.slice().reverse()),{polygons:r,centers:i}}}e.forEach(((t,e)=>{for(let n=0;n<3;n++){const i=t[n],a=t[(n+1)%3],o=t[(n+2)%3];r[i]=r[i]||[],r[i].push([a,o,e,[i,a,o]])}}));const a=r.map((t=>{const e=[t[0][2]];let r=t[0][1];for(let n=1;n<t.length;n++)for(let n=0;n<t.length;n++)if(t[n][0]==r){r=t[n][1],e.push(t[n][2]);break}if(e.length>2)return e;if(2==e.length){const r=Rm(n[t[0][3][0]],n[t[0][3][1]],i[e[0]]),a=Rm(n[t[0][3][2]],n[t[0][3][0]],i[e[0]]),s=o(r),A=o(a);return[e[0],A,e[1],s]}}));function o(t){let n=-1;return i.slice(e.length,1/0).forEach(((r,i)=>{r[0]===t[0]&&r[1]===t[1]&&(n=i+e.length)})),n<0&&(n=i.length,i.push(t)),n}return{polygons:a,centers:i}}(o,n,t),l=function(t){const e=[];return t.forEach((t=>{if(!t)return;let n=t[t.length-1];for(let r of t)r>n&&e.push([n,r]),n=r})),e}(s),c=function(t,e){const n=new Set,r=[];t.map((t=>{if(!(Tm(t.map((t=>e[t>e.length?0:t])))>1e-12))for(let e=0;e<3;e++){let r=[t[e],t[(e+1)%3]],i=`${r[0]}-${r[1]}`;n.has(i)?n.delete(i):n.add(`${r[1]}-${r[0]}`)}}));const i=new Map;let a;if(n.forEach((t=>{t=t.split("-").map(Number),i.set(t[0],t[1]),a=t[0]})),void 0===a)return r;let o=a;do{r.push(o);let t=i.get(o);i.set(o,-1),o=t}while(o>-1&&o!==a);return r}(n,t),u=function(t,e){return function(n){const r=new Map,i=new Map;return t.forEach(((t,e)=>{const a=t.join("-");r.set(a,n[e]),i.set(a,!0)})),e.forEach((t=>{let e=0,n=-1;for(let i=0;i<3;i++){let a=ql([t[i],t[(i+1)%3]]).join("-");r.get(a)>e&&(e=r.get(a),n=a)}i.set(n,!1)})),t.map((t=>i.get(t.join("-"))))}}(r,n);return{delaunay:e,edges:r,triangles:n,centers:A,neighbors:i,polygons:s,mesh:l,hull:c,urquhart:u,find:a}}function Rm(t,e,n){t=Sm(t),e=Sm(e),n=Sm(n);const r=_m(xm(bm(e,t),n));return Em(wm(Mm(t,e)).map((t=>r*t)))}function Pm(t,e,n){return e=Im(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lm()?Reflect.construct(e,n||[],Im(t).constructor):e.apply(t,n))}function Lm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lm=function(){return!!t})()}function Dm(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function Om(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dm(r.key),r)}}function Im(t){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Im(t)}function qm(t,e){return qm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qm(t,e)}function Um(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Bm(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nm(t){return function(t){if(Array.isArray(t))return km(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Bm(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bm(t,e){if(t){if("string"==typeof t)return km(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?km(t,e):void 0}}function km(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Fm(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).resolution,n=void 0===e?1/0:e,r=function(t,e){return t.map((function(t){var n,r=[];return t.forEach((function(t){if(n){var i=180*ch(t,n)/Math.PI;if(i>e)for(var a=bh(n,t),o=1/Math.ceil(i/e),s=o;s<1;)r.push(a(s)),s+=o}r.push(n=t)})),r}))}(t,n),i=Gl(r),a=function(t,e){var n={type:"Polygon",coordinates:t},r=_u(n),i=Um(r,2),a=Um(i[0],2),o=a[0],s=a[1],A=Um(i[1],2),l=A[0],c=A[1];if(Math.min(Math.abs(l-o),Math.abs(c-s))<e)return[];var u=o>l||c>=89||s<=-89;return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.minLng,r=e.maxLng,i=e.minLat,a=e.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,A=function(t){return t/s*360%360-180},l=function(t){return Math.acos(2*t/o-1)/Math.PI*180-90},c=function(t){return o*(Math.cos((t+90)*Math.PI/180)+1)/2},u=[void 0!==a?Math.ceil(c(a)):0,void 0!==i?Math.floor(c(i)):o-1],h=void 0===n&&void 0===r?function(){return!0}:void 0===n?function(t){return t<=r}:void 0===r?function(t){return t>=n}:r>=n?function(t){return t>=n&&t<=r}:function(t){return t>=n||t<=r},f=[],d=u[0];d<=u[1];d++){var p=A(d);h(p)&&f.push([p,l(d)])}return f}(e,{minLng:o,maxLng:l,minLat:s,maxLat:c}).filter((function(t){return zm(t,n,u)}))}(t,n),o=[].concat(Nm(i),Nm(a)),s={type:"Polygon",coordinates:t},A=Um(_u(s),2),l=Um(A[0],2),c=l[0],u=l[1],h=Um(A[1],2),f=h[0],d=h[1],p=c>f||d>=89||u<=-89,m=[];if(p){var g=function(t){const e=function(t){if(e.delaunay=null,e._data=t,"object"==typeof e._data&&"FeatureCollection"===e._data.type&&(e._data=e._data.features),"object"==typeof e._data){const t=e._data.map((t=>[e._vx(t),e._vy(t),t])).filter((t=>isFinite(t[0]+t[1])));e.points=t.map((t=>[t[0],t[1]])),e.valid=t.map((t=>t[2])),e.delaunay=Cm(e.points)}return e};return e._vx=function(t){return"object"==typeof t&&"type"in t?Lu(t)[0]:0 in t?t[0]:void 0},e._vy=function(t){return"object"==typeof t&&"type"in t?Lu(t)[1]:1 in t?t[1]:void 0},e.x=function(t){return t?(e._vx=t,e):e._vx},e.y=function(t){return t?(e._vy=t,e):e._vy},e.polygons=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n={type:"FeatureCollection",features:[]};return 0===e.valid.length||(e.delaunay.polygons.forEach(((t,r)=>n.features.push({type:"Feature",geometry:t?{type:"Polygon",coordinates:[[...t,t[0]].map((t=>e.delaunay.centers[t]))]}:null,properties:{site:e.valid[r],sitecoordinates:e.points[r],neighbours:e.delaunay.neighbors[r]}}))),1===e.valid.length&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:e.valid[0],sitecoordinates:e.points[0],neighbours:[]}})),n},e.triangles=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"FeatureCollection",features:e.delaunay.triangles.map(((t,n)=>((t=t.map((t=>e.points[t]))).center=e.delaunay.centers[n],t))).filter((t=>Tm(t)>0)).map((t=>({type:"Feature",properties:{circumcenter:t.center},geometry:{type:"Polygon",coordinates:[[...t,t[0]]]}})))}},e.links=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n=e.delaunay.edges.map((t=>ch(e.points[t[0]],e.points[t[1]]))),r=e.delaunay.urquhart(n);return{type:"FeatureCollection",features:e.delaunay.edges.map(((t,i)=>({type:"Feature",properties:{source:e.valid[t[0]],target:e.valid[t[1]],length:n[i],urquhart:!!r[i]},geometry:{type:"LineString",coordinates:[e.points[t[0]],e.points[t[1]]]}})))}},e.mesh=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"MultiLineString",coordinates:e.delaunay.edges.map((t=>[e.points[t[0]],e.points[t[1]]]))}},e.cellMesh=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const{centers:n,polygons:r}=e.delaunay,i=[];for(const t of r)if(t)for(let e=t.length,r=t[e-1],a=t[0],o=0;o<e;r=a,a=t[++o])a>r&&i.push([n[r],n[a]]);return{type:"MultiLineString",coordinates:i}},e._found=void 0,e.find=function(t,n,r){if(e._found=e.delaunay.find(t,n,e._found),!r||ch([t,n],e.points[e._found])<r)return e._found},e.hull=function(t){void 0!==t&&e(t);const n=e.delaunay.hull,r=e.points;return 0===n.length?null:{type:"Polygon",coordinates:[[...n.map((t=>r[t])),r[n[0]]]]}},t?e(t):e}(o).triangles(),v=new Map(o.map((function(t,e){var n=Um(t,2),r=n[0],i=n[1];return["".concat(r,"-").concat(i),e]})));g.features.forEach((function(t){var e,n=t.geometry.coordinates[0].slice(0,3).reverse(),r=[];if(n.forEach((function(t){var e=Um(t,2),n=e[0],i=e[1],a="".concat(n,"-").concat(i);v.has(a)&&r.push(v.get(a))})),3===r.length){if(r.some((function(t){return t<i.length})))if(!zm(t.properties.circumcenter,s,p))return;(e=m).push.apply(e,r)}}))}else if(a.length)for(var _=jp.from(o),y=function(t){var e,n=[2,1,0].map((function(e){return _.triangles[t+e]})),r=n.map((function(t){return o[t]}));if(n.some((function(t){return t<i.length}))){var a=[0,1].map((function(t){return function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}(r,(function(e){return e[t]}))}));if(!zm(a,s,p))return 1}(e=m).push.apply(e,Nm(n))},x=0,b=_.triangles.length;x<b;x+=3)y(x);else{var M=Rl.flatten(r),w=M.vertices,E=M.holes;m=Rl(w,void 0===E?[]:E,2)}var S=Rp(ql(o,(function(t){return t[0]})),[0,1]),T=Rp(ql(o,(function(t){return t[1]})),[0,1]),C=o.map((function(t){var e=Um(t,2),n=e[0],r=e[1];return[S(n),T(r)]}));return{contour:r,triangles:{points:o,indices:m,uvs:C}}}function zm(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(t,e){return(t&&uh.hasOwnProperty(t.type)?uh[t.type]:fh)(t,e)}(e,t):Jp(t,e)}var Gm=window.THREE?window.THREE:{BufferGeometry:Hn,Float32BufferAttribute:qn},Hm=(new Gm.BufferGeometry).setAttribute?"setAttribute":"addAttribute",jm=function(t){function e(t,n,r,i,a,o,s){var A;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=Pm(this,e)).type="ConicPolygonBufferGeometry",A.parameters={polygonGeoJson:t,startHeight:n,endHeight:r,closedBottom:i,closedTop:a,includeSides:o,curvatureResolution:s},n=n||0,r=r||1,i=void 0===i||i,a=void 0===a||a,o=void 0===o||o;var l=Fm(t,{resolution:s=s||5}),c=l.contour,u=l.triangles,h=Gl(u.uvs),f=[],d=[],p=[],m=0,g=function(t){var e=Math.round(f.length/3),n=p.length;f=f.concat(t.vertices),d=d.concat(t.uvs),p=p.concat(e?t.indices.map((function(t){return t+e})):t.indices),A.addGroup(n,p.length-n,m++)};function v(t,e){var n=t.map((function(t){return t.map((function(t){var n=Um(t,2),r=n[0];return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}(n[1],r,e)}))}));return Rl.flatten(n)}function _(t){return{indices:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?u.indices:u.indices.slice().reverse(),vertices:v([u.points],t).vertices,uvs:h}}return o&&g(function(){for(var t=v(c,n),e=t.vertices,i=t.holes,a=v(c,r).vertices,o=Gl([a,e]),s=Math.round(a.length/3),A=new Set(i),l=0,u=[],h=0;h<s;h++){var f=h+1;if(f===s)f=l;else if(A.has(f)){var d=f;f=l,l=d}u.push(h,h+s,f+s),u.push(f+s,f,h)}for(var p=[],m=1;m>=0;m--)for(var g=0;g<s;g+=1)p.push(g/(s-1),m);return{indices:u,vertices:o,uvs:p}}()),i&&g(_(n,!1)),a&&g(_(r,!0)),A.setIndex(p),A[Hm]("position",new Gm.Float32BufferAttribute(f,3)),A[Hm]("uv",new Gm.Float32BufferAttribute(d,2)),A.computeVertexNormals(),A}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qm(t,e)}(e,t),n=e,r&&Om(n.prototype,r),i&&Om(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(Gm.BufferGeometry);var Vm=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var i,a,o,s,A=!1;i="object"==typeof window,a="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,A=o&&!i&&!a,s=!i&&!A&&!a;var l,c,u,h,f,d="";A?(d=__dirname+"/",l=function(t,e){var n;return(n=rt(t))||(h||(h=require("fs")),f||(f=require("path")),t=f.normalize(t),n=h.readFileSync(t)),e?n:n.toString()},u=function(t){var e=l(t,!0);return e.buffer||(e=new Uint8Array(e)),_(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(l=function(t){var e=rt(t);return e?et(e):read(t)}),u=function(t){var e;return(e=rt(t))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(_("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(i||a)&&(a?d=self.location.href:"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),d=0!==d.indexOf("blob:")?d.substr(0,d.lastIndexOf("/")+1):"",l=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(e){var n=rt(t);if(n)return et(n);throw e}},a&&(u=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var n=rt(t);if(n)return n;throw e}}),c=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var i=rt(t);i?e(i.buffer):n()}},r.onerror=n,r.send(null)});var p=n.print||console.log.bind(console),m=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram;var g=0;var v=!1;function _(t,e){t||gt("Assertion failed: "+e)}function y(t){var e=n["_"+t];return _(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function x(t,e,n,r,i){var a={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,r){if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o);if(s<=127){if(n>=a)break;e[n++]=s}else if(s<=2047){if(n+1>=a)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=a)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=a)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}e[n]=0})(t,w,e,n)})(t,e=At(n),n)}return e},array:function(t){var e=At(t.length);return function(t,e){M.set(t,e)}(t,e),e}};var o=y(t),s=[],A=0;if(r)for(var l=0;l<r.length;l++){var c=a[n[l]];c?(0===A&&(A=ct()),s[l]=c(r[l])):s[l]=r[l]}var u=o.apply(null,s);return u=function(t){return"string"===e?P(t):"boolean"===e?Boolean(t):t}(u),0!==A&&lt(A),u}var b,M,w,E,S,T,C,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(t,e){return t?function(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.subarray&&R)return R.decode(t.subarray(e,i));for(var a="";e<i;){var o=t[e++];if(128&o){var s=63&t[e++];if(192!=(224&o)){var A=63&t[e++];if((o=224==(240&o)?(15&o)<<12|s<<6|A:(7&o)<<18|s<<12|A<<6|63&t[e++])<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&o)<<6|s)}else a+=String.fromCharCode(o)}return a}(w,t,e):""}function L(t,e){return t%e>0&&(t+=e-t%e),t}function D(t){b=t,n.HEAP8=M=new Int8Array(t),n.HEAP16=E=new Int16Array(t),n.HEAP32=S=new Int32Array(t),n.HEAPU8=w=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=T=new Float32Array(t),n.HEAPF64=C=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var O=n.TOTAL_MEMORY||33554432;function I(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}O=(b=n.buffer?n.buffer:new ArrayBuffer(O)).byteLength,D(b),S[6032]=5267040;var q=[],U=[],N=[],B=[];var k=Math.abs,F=Math.ceil,z=Math.floor,G=Math.min,H=0,j=null;n.preloadedImages={},n.preloadedAudios={};var V,W,X=null,Q="data:application/octet-stream;base64,";function Y(t){return String.prototype.startsWith?t.startsWith(Q):0===t.indexOf(Q)}X="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function Z(t){return t}function K(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function J(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function $(){return M.length}function tt(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(M),at(e),D(e),1}catch(t){}}function et(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];r>255&&(r&=255),e.push(String.fromCharCode(r))}return e.join("")}var nt="function"==typeof atob?atob:function(t){var e,n,r,i,a,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",A="",l=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(l++))<<2|(i=s.indexOf(t.charAt(l++)))>>4,n=(15&i)<<4|(a=s.indexOf(t.charAt(l++)))>>2,r=(3&a)<<6|(o=s.indexOf(t.charAt(l++))),A+=String.fromCharCode(e),64!==a&&(A+=String.fromCharCode(n)),64!==o&&(A+=String.fromCharCode(r))}while(l<t.length);return A};function rt(t){if(Y(t))return function(t){if("boolean"==typeof A&&A){var e;try{e=Buffer.from(t,"base64")}catch(n){e=new Buffer(t,"base64")}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var n=nt(t),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(Q.length))}var it=function(t,e,n){var r=new t.Int8Array(n),i=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var a=new t.Float64Array(n),o=0|e.o,s=0|e.p,A=t.Math.floor,l=t.Math.abs,c=t.Math.sqrt,u=t.Math.pow,h=t.Math.cos,f=t.Math.sin,d=t.Math.tan,p=t.Math.acos,m=t.Math.asin,g=t.Math.atan,v=t.Math.atan2,_=t.Math.ceil,y=t.Math.imul,x=t.Math.min,b=t.Math.max,M=t.Math.clz32,w=e.b,E=e.c,S=e.d,T=e.e,C=e.f,R=e.g,P=e.h,L=e.i,D=24160;function O(t,e,n,r){return 0|I(t|=0,e|=0,n|=0,r|=0,0)}function I(t,e,n,r,a){var o,s=0,A=0,l=0,c=0;if(o=D,D=D+16|0,A=o,!(0|q(t|=0,e|=0,n|=0,r|=0,a|=0)))return D=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|ee(15,A)))break;A=0|i[(l=A)>>2],l=0|i[l+4>>2]}else c=0|Ne(0|n,0|(s=((0|n)<0)<<31>>31),3,0),l=0|E(),s=0|De(0|n,0|s,1,0),s=0|De(0|(s=0|Ne(0|c,0|l,0|s,0|E())),0|E(),1,0),l=0|E(),i[A>>2]=s,i[A+4>>2]=l,A=s;if(Xe(0|r,0,A<<3),0|a){Xe(0|a,0,A<<2),s=0|U(t,e,n,r,a,A,l,0);break}(s=0|Le(A,4))?(c=0|U(t,e,n,r,s,A,l,0),Pe(s),s=c):s=13}else s=2}while(0);return D=o,0|(c=s)}function q(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0;if(s=D,D=D+16|0,m=s+8|0,i[(p=o=s)>>2]=t,i[p+4>>2]=e,(0|n)<0)return D=s,0|(m=2);if(i[(A=r)>>2]=t,i[A+4>>2]=e,(A=!!(0|a))&&(i[a>>2]=0),0|Nt(t,e))return D=s,0|(m=9);i[m>>2]=0;t:do{if((0|n)>=1)if(A)for(f=1,h=0,d=0,p=1,A=t;;){if(!(h|d)){if(0|(A=0|N(A,e,4,m,o)))break t;if(0|Nt(A=0|i[(e=o)>>2],e=0|i[e+4>>2])){A=9;break t}}if(0|(A=0|N(A,e,0|i[22384+(d<<2)>>2],m,o)))break t;if(A=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(f<<3)|0)>>2]=A,i[t+4>>2]=e,i[a+(f<<2)>>2]=p,l=(0|(t=h+1|0))==(0|p),u=6==(0|(c=d+1|0)),0|Nt(A,e)){A=9;break t}if((0|(p=p+(u&l&1)|0))>(0|n)){A=0;break}f=f+1|0,h=l?0:t,d=l?u?0:c:d}else for(f=1,h=0,d=0,p=1,A=t;;){if(!(h|d)){if(0|(A=0|N(A,e,4,m,o)))break t;if(0|Nt(A=0|i[(e=o)>>2],e=0|i[e+4>>2])){A=9;break t}}if(0|(A=0|N(A,e,0|i[22384+(d<<2)>>2],m,o)))break t;if(A=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(f<<3)|0)>>2]=A,i[t+4>>2]=e,l=(0|(t=h+1|0))==(0|p),u=6==(0|(c=d+1|0)),0|Nt(A,e)){A=9;break t}if((0|(p=p+(u&l&1)|0))>(0|n)){A=0;break}f=f+1|0,h=l?0:t,d=l?u?0:c:d}else A=0}while(0);return D=s,0|(m=A)}function U(t,e,n,r,a,o,s,A){n|=0,r|=0,a|=0,A|=0;var l,c,u,h=0,f=0,d=0,p=0,m=0,g=0,v=0;if(u=D,D=D+16|0,l=u+8|0,c=u,h=0|ke(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),d=0|E(),!(!(0|(v=0|i[(g=p=r+(h<<3)|0)>>2]))&!(0|(g=0|i[g+4>>2]))|(f=(0|v)==(0|t)&(0|g)==(0|e))))do{h=0|Be(0|(h=0|De(0|h,0|d,1,0)),0|E(),0|o,0|s),d=0|E(),f=(0|(g=0|i[(v=p=r+(h<<3)|0)>>2]))==(0|t)&(0|(v=0|i[v+4>>2]))==(0|e)}while(!(!(0|g)&!(0|v)|f));if(h=a+(h<<2)|0,f&&(0|i[h>>2])<=(0|A))return D=u,0|(v=0);if(i[(v=p)>>2]=t,i[v+4>>2]=e,i[h>>2]=A,(0|A)>=(0|n))return D=u,0|(v=0);switch(f=A+1|0,i[l>>2]=0,0|(h=0|N(t,e,2,l,c))){case 9:m=9;break;case 0:(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f))||(m=9)}t:do{if(9==(0|m)){switch(i[l>>2]=0,0|(h=0|N(t,e,3,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,1,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,5,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,4,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,6,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}return D=u,0|(v=0)}}while(0);return D=u,0|(v=h)}function N(t,e,n,r,a){t|=0,e|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,f=0,d=0;if((n|=0)>>>0>6)return 0|(a=1);if(h=(0|i[(r|=0)>>2])%6|0,i[r>>2]=h,(0|h)>0){A=0;do{n=0|dt(n),A=A+1|0}while((0|A)<(0|i[r>>2]))}if(h=0|ze(0|t,0|e,45),E(),(s=127&h)>>>0>121)return 0|(a=5);o=0|Bt(t,e),A=0|ze(0|t,0|e,52),E(),A&=15;t:do{if(A){for(;;){if(c=0|ze(0|t,0|e,0|(l=3*(15-A|0)|0)),E(),7==(0|(c&=7))){e=5;break}if(d=!(0|Ht(A)),A=A+-1|0,f=0|Ge(7,0,0|l),e&=~E(),t=0|Ge(0|i[(d?432:16)+(28*c|0)+(n<<2)>>2],0,0|l)|t&~f,e|=l=0|E(),!(n=0|i[(d?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break t}if(!A){u=8;break t}}return 0|e}u=8}while(0);8==(0|u)&&(t|=0|Ge(0|(d=0|i[848+(28*s|0)+(n<<2)>>2]),0,45),e=E()|-1040385&e,n=0|i[4272+(28*s|0)+(n<<2)>>2],127&~d||(d=0|Ge(0|i[848+(28*s|0)+20>>2],0,45),e=E()|-1040385&e,n=0|i[4272+(28*s|0)+20>>2],t=0|Ft(d|t,e),e=0|E(),i[r>>2]=1+(0|i[r>>2]))),c=0|ze(0|t,0|e,45),E(),c&=127;t:do{if(0|F(c)){e:do{if(1==(0|Bt(t,e))){if((0|s)!=(0|c)){if(0|j(c,0|i[7696+(28*s|0)>>2])){t=0|Gt(t,e),l=1,e=0|E();break}S(23313,22416,436,22424)}switch(0|o){case 3:t=0|Ft(t,e),e=0|E(),i[r>>2]=1+(0|i[r>>2]),l=0;break e;case 5:t=0|Gt(t,e),e=0|E(),i[r>>2]=5+(0|i[r>>2]),l=0;break e;case 0:return 0|(d=9);default:return 0|(d=1)}}else l=0}while(0);if((0|n)>0){A=0;do{t=0|kt(t,e),e=0|E(),A=A+1|0}while((0|A)!=(0|n))}if((0|s)!=(0|c)){if(!(0|z(c))){if(!!(0|l)|5!=(0|Bt(t,e)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&h){case 8:case 118:break t}3!=(0|Bt(t,e))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){A=0;do{t=0|Ft(t,e),e=0|E(),A=A+1|0}while((0|A)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,i[(d=a)>>2]=t,i[d+4>>2]=e,0|(d=0)}function B(t,e,n,r){n|=0,r|=0;var a,o,s,A=0,l=0;for(s=D,D=D+16|0,a=s,o=s+8|0,A=(A=!(0|Nt(t|=0,e|=0)))?1:2;;){if(i[o>>2]=0,!(0|N(t,e,A,o,a))&((0|i[(l=a)>>2])==(0|n)?(0|i[l+4>>2])==(0|r):0)){t=4;break}if((A=A+1|0)>>>0>=7){A=7,t=4;break}}return 4==(0|t)?(D=s,0|A):0}function k(t,e,n,r,o,s,A){e|=0,n|=0,r|=0,o|=0,s|=0,A|=0;var l,c,u,h,f,d,p,m,g,v,_=0,y=0,x=0,b=0,M=0,w=0,S=0,T=0,C=0,R=0,P=0,L=0,O=0,I=0,q=0,U=0,N=0,B=0,k=0;if(v=D,D=D+64|0,p=v+48|0,m=v+32|0,g=v+24|0,l=v+8|0,c=v,(0|(y=0|i[(t|=0)>>2]))<=0)return D=v,0|(q=0);for(u=t+4|0,h=p+8|0,f=m+8|0,d=l+8|0,_=0,O=0;;){L=(x=0|i[u>>2])+(O<<4)|0,i[p>>2]=i[L>>2],i[p+4>>2]=i[L+4>>2],i[p+8>>2]=i[L+8>>2],i[p+12>>2]=i[L+12>>2],(0|O)==(y+-1|0)?(i[m>>2]=i[x>>2],i[m+4>>2]=i[x+4>>2],i[m+8>>2]=i[x+8>>2],i[m+12>>2]=i[x+12>>2]):(L=x+(O+1<<4)|0,i[m>>2]=i[L>>2],i[m+4>>2]=i[L+4>>2],i[m+8>>2]=i[L+8>>2],i[m+12>>2]=i[L+12>>2]),y=0|Z(p,m,r,g);t:do{if(y)x=0,_=y;else if(y=0|i[(x=g)>>2],(0|(x=0|i[x+4>>2]))>0|!(0|x)&y>>>0>0){P=0,L=0;e:for(;;){if(k=+a[p>>3],B=+((R=0|Oe(0|y,0|x,0|P,0|L))>>>0)+4294967296*+(0|E()),U=+(y>>>0)+4294967296*+(0|x),N=+(P>>>0)+4294967296*+(0|L),a[l>>3]=k*B/U+ +a[m>>3]*N/U,a[d>>3]=+a[h>>3]*B/U+ +a[f>>3]*N/U,0|(y=0|jt(l,r,c))){_=y;break}w=0|ke(0|(C=0|i[(R=c)>>2]),0|(R=0|i[R+4>>2]),0|e,0|n),b=0|E(),x=0|i[(M=y=A+(w<<3)|0)>>2],M=0|i[M+4>>2];n:do{if(!(0|x)&!(0|M))I=y,q=16;else for(S=0,T=0;;){if((0|S)>(0|n)|(0|S)==(0|n)&T>>>0>e>>>0){_=1;break e}if((0|x)==(0|C)&(0|M)==(0|R))break n;if(w=0|Be(0|(y=0|De(0|w,0|b,1,0)),0|E(),0|e,0|n),b=0|E(),T=0|De(0|T,0|S,1,0),S=0|E(),!(0|(x=0|i[(M=y=A+(w<<3)|0)>>2]))&!(0|(M=0|i[M+4>>2]))){I=y,q=16;break}}}while(0);if(16!=(0|q)||(q=0,!(0|C)&!(0|R))||(i[(T=I)>>2]=C,i[T+4>>2]=R,T=s+(i[o>>2]<<3)|0,i[T>>2]=C,i[T+4>>2]=R,T=0|De(0|i[(T=o)>>2],0|i[T+4>>2],1,0),C=0|E(),i[(R=o)>>2]=T,i[R+4>>2]=C),P=0|De(0|P,0|L,1,0),L=0|E(),y=0|i[(x=g)>>2],!((0|(x=0|i[x+4>>2]))>(0|L)|(0|x)==(0|L)&y>>>0>P>>>0)){x=1;break t}}x=0}else x=1}while(0);if(O=O+1|0,!x){q=21;break}if((0|O)>=(0|(y=0|i[t>>2]))){_=0,q=21;break}}return 21==(0|q)?(D=v,0|_):0}function F(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|i[7696+(28*t|0)+16>>2])}function z(t){return 4==(0|(t|=0))|117==(0|t)}function G(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)>>2]}function H(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)+4>>2]}function j(t,e){return e|=0,(0|i[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|i[7696+(28*t|0)+24>>2])==(0|e))}function V(t,e){return 0|i[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function W(t,e){return e|=0,(0|i[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|i[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|i[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|i[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|i[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|i[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|i[848+(28*t|0)+24>>2])==(0|e)?6:7)}function X(t){return+a[(t|=0)+16>>3]<+a[t+24>>3]|0}function Q(t,e){t|=0;var n,r,i=0;return(i=+a[(e|=0)>>3])>=+a[t+8>>3]&&i<=+a[t>>3]?(n=+a[t+16>>3],i=+a[t+24>>3],e=(r=+a[e+8>>3])>=i,t=r<=n&1,n<i?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function Y(t,e,n){t|=0,e|=0,n|=0;var r,s,c,u,h,f,d,p=0,m=0,g=0,v=0,y=0,b=0,M=0;f=D,D=D+288|0,h=f+264|0,v=f+96|0,m=(p=g=f)+96|0;do{i[p>>2]=0,p=p+4|0}while((0|p)<(0|m));return 0|(e=0|Yt(e,g))?(D=f,0|(b=e)):(Xt(g=0|i[(m=g)>>2],m=0|i[m+4>>2],h),Qt(g,m,v),u=+te(h,v+8|0),a[h>>3]=+a[t>>3],a[(m=h+8|0)>>3]=+a[t+16>>3],a[v>>3]=+a[t+8>>3],a[(g=v+8|0)>>3]=+a[t+24>>3],s=+te(h,v),M=+a[m>>3]-+a[g>>3],c=+l(+M),d=+a[h>>3]-+a[v>>3],r=+l(+d),!(0==M|0==d)&&(M=+He(+c,+r),M=+_(+s*s/+je(+M/+je(+c,+r),3)/(u*(2.59807621135*u)*.8)),a[o>>3]=M,y=~~M>>>0,b=+l(M)>=1?M>0?~~+x(+A(M/4294967296),4294967295)>>>0:~~+_((M-+(~~M>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2])?(v=!(0|y)&!(0|b),i[(e=n)>>2]=v?1:y,i[e+4>>2]=v?0:b,e=0):e=1,D=f,0|(b=e))}function Z(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var s,c,u,h,f=0,d=0,p=0;h=D,D=D+288|0,c=h+264|0,u=h+96|0,s=(f=d=h)+96|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|s));return 0|(n=0|Yt(n,d))?(D=h,0|(r=n)):(Xt(f=0|i[(n=d)>>2],n=0|i[n+4>>2],c),Qt(f,n,u),p=+te(c,u+8|0),p=+_(+ +te(t,e)/(2*p)),a[o>>3]=p,n=~~p>>>0,f=+l(p)>=1?p>0?~~+x(+A(p/4294967296),4294967295)>>>0:~~+_((p-+(~~p>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2]?(d=!(0|n)&!(0|f),i[r>>2]=d?1:n,i[r+4>>2]=d?0:f,D=h,0|(r=0)):(D=h,0|(r=1)))}function K(t,e,n,r){e|=0,n|=0,r|=0,i[(t|=0)>>2]=e,i[t+4>>2]=n,i[t+8>>2]=r}function J(t,e){t|=0;var n,r,o,s,A=0,c=0,u=0,h=0,f=0,d=0,p=0;i[(s=(e|=0)+8|0)>>2]=0,r=+a[t>>3],h=+l(+r),o=+a[t+8>>3],h+=.5*(f=+l(+o)/.8660254037844386),h-=+(0|(A=~~h)),f-=+(0|(t=~~f));do{if(h<.5){if(h<.3333333333333333){if(i[e>>2]=A,f<.5*(h+1)){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(t=(1&!(f<(p=1-h)))+t|0,i[e+4>>2]=t,p<=f&f<2*h){A=A+1|0,i[e>>2]=A;break}i[e>>2]=A;break}if(!(h<.6666666666666666)){if(A=A+1|0,i[e>>2]=A,f<.5*h){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(f<1-h){if(i[e+4>>2]=t,2*h-1<f){i[e>>2]=A;break}}else t=t+1|0,i[e+4>>2]=t;A=A+1|0,i[e>>2]=A}while(0);do{if(r<0){if(1&t){A=~~(+(0|A)-(2*(+((d=0|Oe(0|A,((0|A)<0)<<31>>31,0|(d=(t+1|0)/2|0),((0|d)<0)<<31>>31))>>>0)+4294967296*+(0|E()))+1)),i[e>>2]=A;break}A=~~(+(0|A)-2*(+((d=0|Oe(0|A,((0|A)<0)<<31>>31,0|(d=(0|t)/2|0),((0|d)<0)<<31>>31))>>>0)+4294967296*+(0|E()))),i[e>>2]=A;break}}while(0);d=e+4|0,o<0&&(A=A-((1|t<<1)/2|0)|0,i[e>>2]=A,t=0-t|0,i[d>>2]=t),c=t-A|0,(0|A)<0?(u=0-A|0,i[d>>2]=c,i[s>>2]=u,i[e>>2]=0,t=c,A=0):u=0,(0|t)<0&&(A=A-t|0,i[e>>2]=A,u=u-t|0,i[s>>2]=u,i[d>>2]=0,t=0),n=A-u|0,c=t-u|0,(0|u)<0&&(i[e>>2]=n,i[d>>2]=c,i[s>>2]=0,t=c,A=n,u=0),(0|(c=(0|u)<(0|(c=(0|t)<(0|A)?t:A))?u:c))<=0||(i[e>>2]=A-c,i[d>>2]=t-c,i[s>>2]=u-c)}function $(t){var e,n=0,r=0,a=0,o=0,s=0;n=0|i[(t|=0)>>2],r=0|i[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,i[e>>2]=r,i[(s=t+8|0)>>2]=(0|i[s>>2])-n,i[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[t>>2]=n,o=(0|i[(s=t+8|0)>>2])-r|0,i[s>>2]=o,i[e>>2]=0,r=0):(s=o=t+8|0,o=0|i[o>>2]),(0|o)<0&&(n=n-o|0,i[t>>2]=n,r=r-o|0,i[e>>2]=r,i[s>>2]=0,o=0),(0|(a=(0|o)<(0|(a=(0|r)<(0|n)?r:n))?o:a))<=0||(i[t>>2]=n-a,i[e>>2]=r-a,i[s>>2]=o-a)}function tt(t,e){e|=0;var n,r;r=0|i[(t|=0)+8>>2],n=+((0|i[t+4>>2])-r|0),a[e>>3]=+((0|i[t>>2])-r|0)-.5*n,a[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[e>>2])+(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])+(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])+(0|i[t+8>>2])}function nt(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[t>>2])-(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])-(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])-(0|i[e+8>>2])}function rt(t,e){e|=0;var n,r=0;r=0|y(0|i[(t|=0)>>2],e),i[t>>2]=r,n=0|y(0|i[(r=t+4|0)>>2],e),i[r>>2]=n,e=0|y(0|i[(t=t+8|0)>>2],e),i[t>>2]=e}function it(t){var e,n,r=0,a=0,o=0,s=0,A=0;A=(0|(n=0|i[(t|=0)>>2]))<0,t=(t=(a=(0|(s=((e=(0|(o=(0|i[t+4>>2])-(A?n:0)|0))<0)?0-o|0:0)+((0|i[t+8>>2])-(A?n:0))|0))<0)?0:s)-((o=(0|(a=(0|t)<(0|(a=(0|(r=(e?0:o)-(a?s:0)|0))<(0|(s=(A?0:n)-(e?o:0)-(a?s:0)|0))?r:s))?t:a))>0)?a:0)|0,r=r-(o?a:0)|0;t:do{switch(s-(o?a:0)|0){case 0:switch(0|r){case 0:return 0|(A=0|t?1==(0|t)?1:7:0);case 1:return 0|(A=0|t?1==(0|t)?3:7:2);default:break t}case 1:switch(0|r){case 0:return 0|(A=0|t?1==(0|t)?5:7:4);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(A=7)}function at(t){var e,n=0,r=0,a=0,o=0,s=0,A=0;o=0|i[(e=(t|=0)+8|0)>>2],s=(0|i[t>>2])-o|0,o=(0|i[(A=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(A=1);if((2147483647-(s<<1)|0)<(0|s))return 0|(A=1)}else{if((-2147483648-s|0)>(0|s))return 0|(A=1);if((-2147483648-(s<<1)|0)>(0|s))return 0|(A=1)}if(n=3*s|0,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(A=1)}else if((-2147483648-o|0)>(0|o))return 0|(A=1);if(a=o<<1,(0|s)>-1){if((-2147483648|n)>=(0|o))return 0|(A=1)}else if((-2147483648^n)<(0|o))return 0|(A=1);if(r){if(!((2147483647-s|0)<(0|a))){r=a;break}return 0|(n=1)}if(!((-2147483648-s|0)>(0|a))){r=a;break}return 0|(n=1)}r=o<<1,n=3*s|0}while(0);a=0|Ce(+(n-o|0)/7),i[t>>2]=a,o=0|Ce(+(r+s|0)/7),i[A>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|a))?a:o,r=r?o:a;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;S(23313,22444,355,22455)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&S(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|r))break;S(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|r))break;S(23313,22444,355,22455)}}}while(0);return n=o-a|0,(0|a)<0?(r=0-a|0,i[A>>2]=n,i[e>>2]=r,i[t>>2]=0,a=0):(n=o,r=0),(0|n)<0&&(a=a-n|0,i[t>>2]=a,r=r-n|0,i[e>>2]=r,i[A>>2]=0,n=0),s=a-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[A>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=a,(0|(a=(0|r)<(0|(a=(0|n)<(0|o)?n:o))?r:a))<=0||(i[t>>2]=o-a,i[A>>2]=n-a,i[e>>2]=r-a),0|(A=0)}function ot(t){var e,n=0,r=0,a=0,o=0,s=0,A=0;o=0|i[(e=(t|=0)+8|0)>>2],s=(0|i[t>>2])-o|0,o=(0|i[(A=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(A=1)}else if((-2147483648-s|0)>(0|s))return 0|(A=1);if(n=s<<1,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(A=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(A=1)}else{if((-2147483648-o|0)>(0|o))return 0|(A=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(A=1)}if(a=3*o|0,r){if((2147483647-n|0)<(0|o))return 0|(A=1)}else if((-2147483648-n|0)>(0|o))return 0|(A=1);if((0|o)>-1){if((-2147483648|a)<(0|s)){r=a;break}return 0|(n=1)}if(!((-2147483648^a)<(0|s))){r=a;break}return 0|(n=1)}r=3*o|0,n=s<<1}while(0);a=0|Ce(+(n+o|0)/7),i[t>>2]=a,o=0|Ce(+(r-s|0)/7),i[A>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|a))?a:o,r=r?o:a;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;S(23313,22444,404,22469)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&S(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|r))break;S(23313,22444,404,22469)}else{if((-2147483648^n)>=(0|r))break;S(23313,22444,404,22469)}}}while(0);return n=o-a|0,(0|a)<0?(r=0-a|0,i[A>>2]=n,i[e>>2]=r,i[t>>2]=0,a=0):(n=o,r=0),(0|n)<0&&(a=a-n|0,i[t>>2]=a,r=r-n|0,i[e>>2]=r,i[A>>2]=0,n=0),s=a-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[A>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=a,(0|(a=(0|r)<(0|(a=(0|n)<(0|o)?n:o))?r:a))<=0||(i[t>>2]=o-a,i[A>>2]=n-a,i[e>>2]=r-a),0|(A=0)}function st(t){var e,n,r=0,a=0,o=0,s=0,A=0;a=0|i[(e=(t|=0)+8|0)>>2],o=0|Ce(+((3*(r=(0|i[t>>2])-a|0)|0)-(a=(0|i[(n=t+4|0)>>2])-a|0)|0)/7),i[t>>2]=o,r=0|Ce(+((a<<1)+r|0)/7),i[n>>2]=r,i[e>>2]=0,a=r-o|0,(0|o)<0?(A=0-o|0,i[n>>2]=a,i[e>>2]=A,i[t>>2]=0,r=a,o=0,a=A):a=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,a=a-r|0,i[e>>2]=a,i[n>>2]=0,r=0),A=o-a|0,s=r-a|0,(0|a)<0?(i[t>>2]=A,i[n>>2]=s,i[e>>2]=0,r=s,s=A,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|r)<(0|s)?r:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=a-o)}function At(t){var e,n,r=0,a=0,o=0,s=0,A=0;a=0|i[(e=(t|=0)+8|0)>>2],o=0|Ce(+(((r=(0|i[t>>2])-a|0)<<1)+(a=(0|i[(n=t+4|0)>>2])-a|0)|0)/7),i[t>>2]=o,r=0|Ce(+((3*a|0)-r|0)/7),i[n>>2]=r,i[e>>2]=0,a=r-o|0,(0|o)<0?(A=0-o|0,i[n>>2]=a,i[e>>2]=A,i[t>>2]=0,r=a,o=0,a=A):a=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,a=a-r|0,i[e>>2]=a,i[n>>2]=0,r=0),A=o-a|0,s=r-a|0,(0|a)<0?(i[t>>2]=A,i[n>>2]=s,i[e>>2]=0,r=s,s=A,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|r)<(0|s)?r:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=a-o)}function lt(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],A=o+(3*a|0)|0,i[t>>2]=A,o=s+(3*o|0)|0,i[n>>2]=o,a=(3*s|0)+a|0,i[r>>2]=a,s=o-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=s,i[r>>2]=a,i[t>>2]=0,o=s,s=0):s=A,(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function ct(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=(3*(a=0|i[(n=t+4|0)>>2])|0)+A|0,A=(o=0|i[(r=t+8|0)>>2])+(3*A|0)|0,i[t>>2]=A,i[n>>2]=s,a=(3*o|0)+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,A=0):o=s,(0|o)<0&&(A=A-o|0,i[t>>2]=A,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=A-a|0,s=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|s)<(0|A)?s:A))?a:o))<=0||(i[t>>2]=A-o,i[n>>2]=s-o,i[r>>2]=a-o)}function ut(t,e){t|=0;var n,r,a,o=0,s=0,A=0;((e|=0)+-1|0)>>>0>=6||(A=(0|i[15440+(12*e|0)>>2])+(0|i[t>>2])|0,i[t>>2]=A,a=t+4|0,s=(0|i[15440+(12*e|0)+4>>2])+(0|i[a>>2])|0,i[a>>2]=s,r=t+8|0,e=(0|i[15440+(12*e|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=e,o=s-A|0,(0|A)<0?(e=e-A|0,i[a>>2]=o,i[r>>2]=e,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,e=e-o|0,i[r>>2]=e,i[a>>2]=0,o=0),n=s-e|0,A=o-e|0,(0|e)<0?(i[t>>2]=n,i[a>>2]=A,i[r>>2]=0,s=n,e=0):A=o,(0|(o=(0|e)<(0|(o=(0|A)<(0|s)?A:s))?e:o))<=0||(i[t>>2]=s-o,i[a>>2]=A-o,i[r>>2]=e-o))}function ht(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=(a=0|i[(n=t+4|0)>>2])+A|0,A=(o=0|i[(r=t+8|0)>>2])+A|0,i[t>>2]=A,i[n>>2]=s,a=o+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function ft(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],s=0|i[(n=t+4|0)>>2],o=0|i[(r=t+8|0)>>2],A=s+a|0,i[t>>2]=A,s=o+s|0,i[n>>2]=s,a=o+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function dt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function pt(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function mt(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],A=o+(a<<1)|0,i[t>>2]=A,o=s+(o<<1)|0,i[n>>2]=o,a=(s<<1)+a|0,i[r>>2]=a,s=o-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=s,i[r>>2]=a,i[t>>2]=0,o=s,s=0):s=A,(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function gt(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=((a=0|i[(n=t+4|0)>>2])<<1)+A|0,A=(o=0|i[(r=t+8|0)>>2])+(A<<1)|0,i[t>>2]=A,i[n>>2]=s,a=(o<<1)+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,A=0):o=s,(0|o)<0&&(A=A-o|0,i[t>>2]=A,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=A-a|0,s=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|s)<(0|A)?s:A))?a:o))<=0||(i[t>>2]=A-o,i[n>>2]=s-o,i[r>>2]=a-o)}function vt(t,e){e|=0;var n,r,a,o=0,s=0,A=0;return a=(0|(r=(0|i[(t|=0)>>2])-(0|i[e>>2])|0))<0,n=(0|(s=(0|i[t+4>>2])-(0|i[e+4>>2])-(a?r:0)|0))<0,e=(e=(t=(0|(A=(a?0-r|0:0)+(0|i[t+8>>2])-(0|i[e+8>>2])+(n?0-s|0:0)|0))<0)?0:A)-((s=(0|(t=(0|e)<(0|(t=(0|(o=(n?0:s)-(t?A:0)|0))<(0|(A=(a?0:r)-(n?s:0)-(t?A:0)|0))?o:A))?e:t))>0)?t:0)|0,o=o-(s?t:0)|0,0|((0|(t=(0|(t=A-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(o=(0|o)>-1?o:0-o|0))>(0|(e=(0|e)>-1?e:0-e|0))?o:e))?t:e)}function _t(t,e){e|=0;var n;n=0|i[(t|=0)+8>>2],i[e>>2]=(0|i[t>>2])-n,i[e+4>>2]=(0|i[t+4>>2])-n}function yt(t,e){e|=0;var n,r,a,o=0,s=0,A=0;s=0|i[(t|=0)>>2],i[e>>2]=s,A=0|i[t+4>>2],i[(r=e+4|0)>>2]=A,i[(a=e+8|0)>>2]=0,t=(o=(0|A)<(0|s))?s:A,o=o?A:s;do{if((0|o)<0){if((0|t)>0){if((-2147483648|t)<(0|o)&-2147483648!=(0|o)&(2147483647-t|0)>=(0|o))break;return 0|(t=1)}if(-2147483648==(0|o)|(-2147483648-t|0)>(0|o))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|o))break;return 0|(t=1)}if(!((-2147483648^t)<(0|o)))break;return 0|(t=1)}}while(0);return t=A-s|0,(0|s)<0?(o=0-s|0,i[r>>2]=t,i[a>>2]=o,i[e>>2]=0,s=0):(t=A,o=0),(0|t)<0&&(s=s-t|0,i[e>>2]=s,o=o-t|0,i[a>>2]=o,i[r>>2]=0,t=0),n=s-o|0,A=t-o|0,(0|o)<0?(i[e>>2]=n,i[r>>2]=A,i[a>>2]=0,t=A,A=n,o=0):A=s,(0|(s=(0|o)<(0|(s=(0|t)<(0|A)?t:A))?o:s))<=0||(i[e>>2]=A-s,i[r>>2]=t-s,i[a>>2]=o-s),0|(e=0)}function xt(t){var e,n,r,a;n=(a=0|i[(e=(t|=0)+8|0)>>2])-(0|i[t>>2])|0,i[t>>2]=n,t=(0|i[(r=t+4|0)>>2])-a|0,i[r>>2]=t,i[e>>2]=0-(t+n)}function bt(t){var e,n,r=0,a=0,o=0,s=0,A=0;r=0-(a=0|i[(t|=0)>>2])|0,i[t>>2]=r,i[(e=t+8|0)>>2]=0,s=(o=0|i[(n=t+4|0)>>2])+a|0,(0|a)>0?(i[n>>2]=s,i[e>>2]=a,i[t>>2]=0,r=0,o=s):a=0,(0|o)<0?(A=r-o|0,i[t>>2]=A,a=a-o|0,i[e>>2]=a,i[n>>2]=0,s=A-a|0,r=0-a|0,(0|a)<0?(i[t>>2]=s,i[n>>2]=r,i[e>>2]=0,o=r,a=0):(o=0,s=A)):s=r,(0|(r=(0|a)<(0|(r=(0|o)<(0|s)?o:s))?a:r))<=0||(i[t>>2]=s-r,i[n>>2]=o-r,i[e>>2]=a-r)}function Mt(t,e,n){n|=0;var r,a,o=0,s=0;return a=D,D=D+16|0,r=a,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(o=0|ze(0|(t|=0),0|e,56),E(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,a=0,o=0;if(o=D,D=D+16|0,a=o,r=0|Nt(t,e),(n+-1|0)>>>0>5)return D=o,0|(a=-1);if(r=!!(0|r),1==(0|n)&r)return D=o,0|(a=-1);do{if(!(0|_e(t,e,a))){if(r){r=(5+(0|i[21936+(n<<2)>>2])-(0|i[a>>2])|0)%5|0;break}r=(6+(0|i[21968+(n<<2)>>2])-(0|i[a>>2])|0)%6|0;break}r=-1}while(0);return a=r,D=o,0|a}(t,s,7&o),-1==(0|o)?(i[n>>2]=0,D=a,0|(s=6)):(0|Wt(t,s,r)&&S(23313,22484,282,22499),e=0|ze(0|t,0|e,52),E(),e&=15,0|Nt(t,s)?Tt(r,e,o,2,n):Lt(r,e,o,2,n),D=a,0|(s=0))):(D=a,0|(s=6))}function wt(t,e,n,r){e|=0,r|=0;var o,s=0,A=0,l=0,c=0;if(o=D,D=D+16|0,function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0,s=0;s=D,D=D+32|0,o=s,function(t,e){t|=0,e|=0;var n=0,r=0,i=0;n=+a[t>>3],r=+h(+n),n=+f(+n),a[e+16>>3]=n,n=+a[t+8>>3],i=r*+h(+n),a[e>>3]=i,n=r*+f(+n),a[e+8>>3]=n}(t,o),i[e>>2]=0,a[n>>3]=5,r=+ve(16400,o),r<+a[n>>3]&&(i[e>>2]=0,a[n>>3]=r);r=+ve(16424,o),r<+a[n>>3]&&(i[e>>2]=1,a[n>>3]=r);r=+ve(16448,o),r<+a[n>>3]&&(i[e>>2]=2,a[n>>3]=r);r=+ve(16472,o),r<+a[n>>3]&&(i[e>>2]=3,a[n>>3]=r);r=+ve(16496,o),r<+a[n>>3]&&(i[e>>2]=4,a[n>>3]=r);r=+ve(16520,o),r<+a[n>>3]&&(i[e>>2]=5,a[n>>3]=r);r=+ve(16544,o),r<+a[n>>3]&&(i[e>>2]=6,a[n>>3]=r);r=+ve(16568,o),r<+a[n>>3]&&(i[e>>2]=7,a[n>>3]=r);r=+ve(16592,o),r<+a[n>>3]&&(i[e>>2]=8,a[n>>3]=r);r=+ve(16616,o),r<+a[n>>3]&&(i[e>>2]=9,a[n>>3]=r);r=+ve(16640,o),r<+a[n>>3]&&(i[e>>2]=10,a[n>>3]=r);r=+ve(16664,o),r<+a[n>>3]&&(i[e>>2]=11,a[n>>3]=r);r=+ve(16688,o),r<+a[n>>3]&&(i[e>>2]=12,a[n>>3]=r);r=+ve(16712,o),r<+a[n>>3]&&(i[e>>2]=13,a[n>>3]=r);r=+ve(16736,o),r<+a[n>>3]&&(i[e>>2]=14,a[n>>3]=r);r=+ve(16760,o),r<+a[n>>3]&&(i[e>>2]=15,a[n>>3]=r);r=+ve(16784,o),r<+a[n>>3]&&(i[e>>2]=16,a[n>>3]=r);r=+ve(16808,o),r<+a[n>>3]&&(i[e>>2]=17,a[n>>3]=r);r=+ve(16832,o),r<+a[n>>3]&&(i[e>>2]=18,a[n>>3]=r);if(r=+ve(16856,o),!(r<+a[n>>3]))return void(D=s);i[e>>2]=19,a[n>>3]=r,D=s}(t|=0,n|=0,c=o),(A=+p(+(1-.5*+a[c>>3])))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(D=o);if(c=0|i[n>>2],s=+Jt((s=+a[15920+(24*c|0)>>3])-+Jt(+function(t,e){t|=0,e|=0;var n=0,r=0,i=0,o=0,s=0;return o=+a[e>>3],r=+h(+o),i=+a[e+8>>3]-+a[t+8>>3],s=r*+f(+i),n=+a[t>>3],+ +v(+s,+(+f(+o)*+h(+n)-+h(+i)*(r*+f(+n))))}(15600+(c<<4)|0,t))),l=0|Ht(e)?+Jt(s+-.3334731722518321):s,s=+d(+A)/.381966011250105,(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}A=+h(+l)*s,a[r>>3]=A,l=+f(+l)*s,a[r+8>>3]=l,D=o}function Et(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s=0,A=0;if(s=+function(t){t|=0;var e=0,n=0;return n=+a[t>>3],e=+a[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),s<1e-16)return e=15600+(e<<4)|0,i[o>>2]=i[e>>2],i[o+4>>2]=i[e+4>>2],i[o+8>>2]=i[e+8>>2],void(i[o+12>>2]=i[e+12>>2]);if(A=+v(+ +a[t+8>>3],+ +a[t>>3]),(0|n)>0){t=0;do{s/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}r?(s/=3,n=!(0|Ht(n)),s=+g(.381966011250105*(n?s:s/2.6457513110645907))):(s=+g(.381966011250105*s),0|Ht(n)&&(A=+Jt(A+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,n=+n,r|=0;var o=0,s=0,A=0,c=0;if(n<1e-16)return i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],void(i[r+12>>2]=i[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(o=+l(+(s+-3.141592653589793))<1e-16,e=+a[t>>3],o){e-=n,a[r>>3]=e,o=r;break}if(A=+h(+n),n=+f(+n),e=A*+f(+e)+ +h(+s)*(n*+h(+e)),e=+m(+((e=e>1?1:e)<-1?-1:e)),a[r>>3]=e,+l(+(e+-1.5707963267948966))<1e-16)return a[r>>3]=1.5707963267948966,void(a[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return a[r>>3]=-1.5707963267948966,void(a[r+8>>3]=0);if(c=+h(+e),s=n*+f(+s)/c,n=+a[t>>3],e=(A-+f(+e)*+f(+n))/+h(+n)/c,A=s>1?1:s,e=e>1?1:e,(e=+a[t+8>>3]+ +v(+(A<-1?-1:A),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(a[r+8>>3]=e)}e=+a[t>>3]+n,a[r>>3]=e,o=r}while(0);if(+l(+(e+-1.5707963267948966))<1e-16)return a[o>>3]=1.5707963267948966,void(a[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return a[o>>3]=-1.5707963267948966,void(a[r+8>>3]=0);if(e=+a[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);a[r+8>>3]=e}(15600+(e<<4)|0,+Jt(+a[15920+(24*e|0)>>3]-A),s,o)}function St(t,e,n){e|=0,n|=0;var r,a;r=D,D=D+16|0,tt((t|=0)+4|0,a=r),Et(a,0|i[t>>2],e,0,n),D=r}function Tt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,A,l,c,u,h,f,d,p,m,g,v,_,y,x,b,M,w,E,T,C,R,P=0,L=0,O=0,I=0,q=0,U=0;if(R=D,D=D+272|0,I=R+240|0,E=R,T=R+224|0,C=R+208|0,g=R+176|0,v=R+160|0,_=R+192|0,y=R+144|0,x=R+128|0,b=R+112|0,M=R+96|0,w=R+80|0,i[(P=R+256|0)>>2]=e,i[I>>2]=i[t>>2],i[I+4>>2]=i[t+4>>2],i[I+8>>2]=i[t+8>>2],i[I+12>>2]=i[t+12>>2],Ct(I,P,E),i[o>>2]=0,(0|(I=r+n+(5==(0|r)&1)|0))<=(0|n))D=R;else{A=T+4|0,l=g+4|0,c=n+5|0,u=16880+((s=0|i[P>>2])<<2)|0,h=16960+(s<<2)|0,f=x+8|0,d=b+8|0,p=M+8|0,m=C+4|0,O=n;t:for(;;){L=E+((0|O)%5<<4)|0,i[C>>2]=i[L>>2],i[C+4>>2]=i[L+4>>2],i[C+8>>2]=i[L+8>>2],i[C+12>>2]=i[L+12>>2];do{}while(2==(0|Rt(C,s,0,1)));if((0|O)>(0|n)&!!(0|Ht(e))){if(i[g>>2]=i[C>>2],i[g+4>>2]=i[C+4>>2],i[g+8>>2]=i[C+8>>2],i[g+12>>2]=i[C+12>>2],tt(A,v),r=0|i[g>>2],P=0|i[17040+(80*r|0)+(i[T>>2]<<2)>>2],i[g>>2]=i[18640+(80*r|0)+(20*P|0)>>2],(0|(L=0|i[18640+(80*r|0)+(20*P|0)+16>>2]))>0){t=0;do{ht(l),t=t+1|0}while((0|t)<(0|L))}switch(L=18640+(80*r|0)+(20*P|0)+4|0,i[_>>2]=i[L>>2],i[_+4>>2]=i[L+4>>2],i[_+8>>2]=i[L+8>>2],rt(_,3*(0|i[u>>2])|0),et(l,_,l),$(l),tt(l,y),q=+(0|i[h>>2]),a[x>>3]=3*q,a[f>>3]=0,U=-1.5*q,a[b>>3]=U,a[d>>3]=2.598076211353316*q,a[M>>3]=U,a[p>>3]=-2.598076211353316*q,0|i[17040+(80*(0|i[g>>2])|0)+(i[C>>2]<<2)>>2]){case 1:t=b,r=x;break;case 3:t=M,r=b;break;case 2:t=x,r=M;break;default:t=12;break t}me(v,y,r,t,w),Et(w,0|i[g>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])}if((0|O)<(0|c)&&(tt(m,g),Et(g,0|i[C>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),i[T>>2]=i[C>>2],i[T+4>>2]=i[C+4>>2],i[T+8>>2]=i[C+8>>2],i[T+12>>2]=i[C+12>>2],(0|(O=O+1|0))>=(0|I)){t=3;break}}3!=(0|t)?12==(0|t)&&S(22522,22569,571,22579):D=R}}function Ct(t,e,n){t|=0,e|=0,n|=0;var r,a=0,o=0,s=0,A=0,l=0;r=D,D=D+128|0,o=r,A=20240,l=(s=a=r+64|0)+60|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));A=20304,l=(s=o)+60|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));a=(l=!(0|Ht(0|i[e>>2])))?a:o,mt(o=t+4|0),gt(o),0|Ht(0|i[e>>2])&&(ct(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],et(o,a,e=n+4|0),$(e),i[n+16>>2]=i[t>>2],et(o,a+12|0,e=n+20|0),$(e),i[n+32>>2]=i[t>>2],et(o,a+24|0,e=n+36|0),$(e),i[n+48>>2]=i[t>>2],et(o,a+36|0,e=n+52|0),$(e),i[n+64>>2]=i[t>>2],et(o,a+48|0,n=n+68|0),$(n),D=r}function Rt(t,e,n,r){n|=0,r|=0;var a,o,s,A,l,c,u=0,h=0,f=0,d=0,p=0;if(c=D,D=D+32|0,l=c+12|0,o=c,p=(t|=0)+4|0,d=0|i[16960+((e|=0)<<2)>>2],d=(A=!!(0|r))?3*d|0:d,u=0|i[p>>2],a=0|i[(s=t+8|0)>>2],A){if((0|(u=a+u+(r=0|i[(h=t+12|0)>>2])|0))==(0|d))return D=c,0|(p=1);f=h}else u=a+u+(r=0|i[(f=t+12|0)>>2])|0;if((0|u)<=(0|d))return D=c,0|(p=0);do{if((0|r)>0){if(r=0|i[t>>2],(0|a)>0){h=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(K(l,d,0,0),nt(p,l,o),ft(o),et(o,l,p),h=r,r=t):(h=r,r=t)}else h=18640+(80*(0|i[t>>2])|0)+20|0,r=t}while(0);if(i[r>>2]=i[h>>2],(0|i[(u=h+16|0)>>2])>0){r=0;do{ht(p),r=r+1|0}while((0|r)<(0|i[u>>2]))}return t=h+4|0,i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],e=0|i[16880+(e<<2)>>2],rt(l,A?3*e|0:e),et(p,l,p),$(p),r=A&&((0|i[s>>2])+(0|i[p>>2])+(0|i[f>>2])|0)==(0|d)?1:2,D=c,0|(p=r)}function Pt(t,e){t|=0,e|=0;var n=0;do{n=0|Rt(t,e,0,1)}while(2==(0|n));return 0|n}function Lt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,A,l,c,u,h,f,d,p,m,g,v,_,y,x,b,M,w,E=0,T=0,C=0,R=0,P=0;if(w=D,D=D+240|0,y=w+208|0,x=w,b=w+192|0,M=w+176|0,p=w+160|0,m=w+144|0,g=w+128|0,v=w+112|0,_=w+96|0,i[(E=w+224|0)>>2]=e,i[y>>2]=i[t>>2],i[y+4>>2]=i[t+4>>2],i[y+8>>2]=i[t+8>>2],i[y+12>>2]=i[t+12>>2],Dt(y,E,x),i[o>>2]=0,(0|(d=r+n+(6==(0|r)&1)|0))<=(0|n))D=w;else{A=n+6|0,l=16960+((s=0|i[E>>2])<<2)|0,c=m+8|0,u=g+8|0,h=v+8|0,f=b+4|0,T=0,C=n,r=-1;t:for(;;){if(t=x+((E=(0|C)%6|0)<<4)|0,i[b>>2]=i[t>>2],i[b+4>>2]=i[t+4>>2],i[b+8>>2]=i[t+8>>2],i[b+12>>2]=i[t+12>>2],t=T,T=0|Rt(b,s,0,1),(0|C)>(0|n)&!!(0|Ht(e))&&(1!=(0|t)&&(0|i[b>>2])!=(0|r))){switch(tt(x+((E+5|0)%6<<4)+4|0,M),tt(x+(E<<4)+4|0,p),R=+(0|i[l>>2]),a[m>>3]=3*R,a[c>>3]=0,P=-1.5*R,a[g>>3]=P,a[u>>3]=2.598076211353316*R,a[v>>3]=P,a[h>>3]=-2.598076211353316*R,E=0|i[y>>2],0|i[17040+(80*E|0)+(((0|r)==(0|E)?i[b>>2]:r)<<2)>>2]){case 1:t=g,r=m;break;case 3:t=v,r=g;break;case 2:t=m,r=v;break;default:t=8;break t}me(M,p,r,t,_),0|ge(M,_)||0|ge(p,_)||(Et(_,0|i[y>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2]))}if((0|C)<(0|A)&&(tt(f,M),Et(M,0|i[b>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),(0|(C=C+1|0))>=(0|d)){t=3;break}r=0|i[b>>2]}3!=(0|t)?8==(0|t)&&S(22606,22569,736,22651):D=w}}function Dt(t,e,n){t|=0,e|=0,n|=0;var r,a=0,o=0,s=0,A=0,l=0;r=D,D=D+160|0,o=r,A=20368,l=(s=a=r+80|0)+72|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));A=20448,l=(s=o)+72|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));a=(l=!(0|Ht(0|i[e>>2])))?a:o,mt(o=t+4|0),gt(o),0|Ht(0|i[e>>2])&&(ct(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],et(o,a,e=n+4|0),$(e),i[n+16>>2]=i[t>>2],et(o,a+12|0,e=n+20|0),$(e),i[n+32>>2]=i[t>>2],et(o,a+24|0,e=n+36|0),$(e),i[n+48>>2]=i[t>>2],et(o,a+36|0,e=n+52|0),$(e),i[n+64>>2]=i[t>>2],et(o,a+48|0,e=n+68|0),$(e),i[n+80>>2]=i[t>>2],et(o,a+60|0,n=n+84|0),$(n),D=r}function Ot(t,e){return e=0|ze(0|(t|=0),0|(e|=0),45),E(),127&e}function It(t,e){var n=0,r=0,i=0,a=0,o=0,s=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(o=0|ze(0|(t|=0),0|e,45),E(),(o&=127)>>>0>121)return 0|(e=0);n=0|ze(0|t,0|e,52),E(),n&=15;do{if(0|n){for(i=1,r=0;;){if(a=0|ze(0|t,0|e,3*(15-i|0)|0),E(),!!(0|(a&=7))&(1^r)){if(1==(0|a)&!!(0|F(o))){s=0,r=13;break}r=1}if(7==(0|a)){s=0,r=13;break}if(!(i>>>0<n>>>0)){r=9;break}i=i+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|ze(0|t,0|e,3*(14-n|0)|0),E(),!(!0&!(7&~s))){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function qt(t,e,n,r){n|=0,r|=0;var a=0,o=0;if(o=0|ze(0|(t|=0),0|(e|=0),52),E(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return i[r>>2]=t,i[r+4>>2]=e,0|(r=0);if(a=0|Ge(0|n,0,52),a|=t,t=E()|-15728641&e,(0|o)>(0|n))do{e=0|Ge(7,0,3*(14-n|0)|0),n=n+1|0,a|=e,t=E()|t}while((0|n)<(0|o));return i[r>>2]=a,i[r+4>>2]=t,0|(r=0)}function Ut(t,e,n,r){n|=0,r|=0;var a=0,o=0,s=0;if(o=0|ze(0|(t|=0),0|(e|=0),52),E(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);a=n-o|0,n=0|ze(0|t,0|e,45),E();t:do{if(0|F(127&n)){e:do{if(0|o){for(n=1;!((s=0|Ge(7,0,3*(15-n|0)|0))&t)&!(E()&e);){if(!(n>>>0<o>>>0))break e;n=n+1|0}n=0|ue(7,0,a,((0|a)<0)<<31>>31),a=0|E();break t}}while(0);n=0|De(0|(n=0|Ne(0|(n=0|ue(7,0,a,((0|a)<0)<<31>>31)),0|E(),5,0)),0|E(),-5,-1),n=0|De(0|(n=0|Ue(0|n,0|E(),6,0)),0|E(),1,0),a=0|E()}else n=0|ue(7,0,a,((0|a)<0)<<31>>31),a=0|E()}while(0);return i[(s=r)>>2]=n,i[s+4>>2]=a,0|(s=0)}function Nt(t,e){var n=0,r=0,i=0;if(i=0|ze(0|(t|=0),0|(e|=0),45),E(),!(0|F(127&i)))return 0|(i=0);i=0|ze(0|t,0|e,52),E(),i&=15;t:do{if(i)for(r=1;;){if(n=0|ze(0|t,0|e,3*(15-r|0)|0),E(),0|(n&=7))break t;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=1&!(0|n))}function Bt(t,e){var n=0,r=0,i=0;if(i=0|ze(0|(t|=0),0|(e|=0),52),E(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|ze(0|t,0|e,3*(15-r|0)|0),E(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function kt(t,e){var n=0,r=0,i=0,a=0,o=0,s=0,A=0;if(A=0|ze(0|(t|=0),0|(e|=0),52),E(),!(A&=15))return A=t,w(0|(s=e)),0|A;for(s=1,n=0;;){r=0|Ge(7,0,0|(a=3*(15-s|0)|0)),i=0|E(),o=0|ze(0|t,0|e,0|a),E(),t=(a=0|Ge(0|dt(7&o),0,0|a))|t&~r,e=(o=0|E())|e&~i;t:do{if(!n)if(!(a&r)&!(o&i))n=0;else if(r=0|ze(0|t,0|e,52),E(),r&=15){n=1;e:for(;;){switch(o=0|ze(0|t,0|e,3*(15-n|0)|0),E(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(i=0|ze(0|t,0|e,0|(o=3*(15-n|0)|0)),E(),a=0|Ge(7,0,0|o),e&=~E(),t=t&~a|(o=0|Ge(0|dt(7&i),0,0|o)),e|=E(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<A>>>0))break;s=s+1|0}return w(0|e),0|t}function Ft(t,e){var n=0,r=0,i=0,a=0,o=0;if(r=0|ze(0|(t|=0),0|(e|=0),52),E(),!(r&=15))return r=t,w(0|(n=e)),0|r;for(n=1;o=0|ze(0|t,0|e,0|(a=3*(15-n|0)|0)),E(),i=0|Ge(7,0,0|a),e&=~E(),t=(a=0|Ge(0|dt(7&o),0,0|a))|t&~i,e=E()|e,n>>>0<r>>>0;)n=n+1|0;return w(0|e),0|t}function zt(t,e){var n=0,r=0,i=0,a=0,o=0,s=0,A=0;if(A=0|ze(0|(t|=0),0|(e|=0),52),E(),!(A&=15))return A=t,w(0|(s=e)),0|A;for(s=1,n=0;;){r=0|Ge(7,0,0|(a=3*(15-s|0)|0)),i=0|E(),o=0|ze(0|t,0|e,0|a),E(),t=(a=0|Ge(0|pt(7&o),0,0|a))|t&~r,e=(o=0|E())|e&~i;t:do{if(!n)if(!(a&r)&!(o&i))n=0;else if(r=0|ze(0|t,0|e,52),E(),r&=15){n=1;e:for(;;){switch(o=0|ze(0|t,0|e,3*(15-n|0)|0),E(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(a=0|Ge(7,0,0|(i=3*(15-n|0)|0)),o=e&~E(),e=0|ze(0|t,0|e,0|i),E(),t=t&~a|(e=0|Ge(0|pt(7&e),0,0|i)),e=o|E(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<A>>>0))break;s=s+1|0}return w(0|e),0|t}function Gt(t,e){var n=0,r=0,i=0,a=0,o=0;if(r=0|ze(0|(t|=0),0|(e|=0),52),E(),!(r&=15))return r=t,w(0|(n=e)),0|r;for(n=1;a=0|Ge(7,0,0|(o=3*(15-n|0)|0)),i=e&~E(),e=0|ze(0|t,0|e,0|o),E(),t=(e=0|Ge(0|pt(7&e),0,0|o))|t&~a,e=E()|i,n>>>0<r>>>0;)n=n+1|0;return w(0|e),0|t}function Ht(t){return(0|(t|=0))%2|0}function jt(t,e,n){n|=0;var r,a=0;return r=D,D=D+16|0,a=r,(e|=0)>>>0>15?(D=r,0|(a=4)):2146435072&~i[(t|=0)+4>>2]&&2146435072&~i[t+8+4>>2]?(function(t,e,n){var r,i;r=D,D=D+16|0,wt(t|=0,e|=0,n|=0,i=r),J(i,n+4|0),D=r}(t,e,a),e=0|function(t,e){t|=0;var n,r=0,a=0,o=0,s=0,A=0,l=0,c=0,u=0;if(n=D,D=D+64|0,l=n+40|0,a=n+24|0,o=n+12|0,s=n,Ge(0|(e|=0),0,52),r=134225919|E(),!e)return(0|i[t+4>>2])>2||(0|i[t+8>>2])>2||(0|i[t+12>>2])>2?(l=0,w(0|(A=0)),D=n,0|l):(Ge(0|G(t),0,45),A=E()|r,l=-1,w(0|A),D=n,0|l);if(i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],i[l+12>>2]=i[t+12>>2],A=l+4|0,(0|e)>0)for(t=-1;i[a>>2]=i[A>>2],i[a+4>>2]=i[A+4>>2],i[a+8>>2]=i[A+8>>2],1&e?(st(A),i[o>>2]=i[A>>2],i[o+4>>2]=i[A+4>>2],i[o+8>>2]=i[A+8>>2],lt(o)):(At(A),i[o>>2]=i[A>>2],i[o+4>>2]=i[A+4>>2],i[o+8>>2]=i[A+8>>2],ct(o)),nt(a,o,s),$(s),c=0|Ge(7,0,0|(u=3*(15-e|0)|0)),r&=~E(),t=(u=0|Ge(0|it(s),0,0|u))|t&~c,r=E()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[A>>2])<=2&&(0|i[l+8>>2])<=2&&(0|i[l+12>>2])<=2){if(e=0|Ge(0|(a=0|G(l)),0,45),e|=t,t=E()|-1040385&r,s=0|H(l),!(0|F(a))){if((0|s)<=0)break;for(o=0;;){if(a=0|ze(0|e,0|t,52),E(),a&=15)for(r=1;l=0|ze(0|e,0|t,0|(u=3*(15-r|0)|0)),E(),c=0|Ge(7,0,0|u),t&=~E(),e=e&~c|(u=0|Ge(0|dt(7&l),0,0|u)),t|=E(),r>>>0<a>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|ze(0|e,0|t,52),E(),o&=15;e:do{if(o){r=1;n:for(;;){switch(u=0|ze(0|e,0|t,3*(15-r|0)|0),E(),7&u){case 1:break n;case 0:break;default:break e}if(!(r>>>0<o>>>0))break e;r=r+1|0}if(0|j(a,0|i[l>>2]))for(r=1;c=0|Ge(7,0,0|(l=3*(15-r|0)|0)),u=t&~E(),t=0|ze(0|e,0|t,0|l),E(),e=e&~c|(t=0|Ge(0|pt(7&t),0,0|l)),t=u|E(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;l=0|ze(0|e,0|t,0|(u=3*(15-r|0)|0)),E(),c=0|Ge(7,0,0|u),t&=~E(),e=e&~c|(u=0|Ge(0|dt(7&l),0,0|u)),t|=E(),r>>>0<o>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|kt(e,t),t=0|E(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return u=e,w(0|(c=t)),D=n,0|u}(a,e),a=0|E(),i[n>>2]=e,i[n+4>>2]=a,!(0|e)&!(0|a)&&S(23313,22674,786,22697),D=r,0|(a=0)):(D=r,0|(a=3))}function Vt(t,e,n){var r,a=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|ze(0|(t|=0),0|(e|=0),52),E(),o&=15,s=0|ze(0|t,0|e,45),E(),a=!(0|o),0|F(127&s)){if(a)return 0|(s=1);a=1}else{if(a)return 0|(s=0);a=0|i[r>>2]||0|i[n+8>>2]?1:1&!!(0|i[n+12>>2])}for(n=1;1&n?lt(r):ct(r),s=0|ze(0|t,0|e,3*(15-n|0)|0),E(),ut(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|a}function Wt(t,e,n){n|=0;var r,a,o=0,s=0,A=0,l=0,c=0,u=0;if(a=D,D=D+16|0,r=a,u=0|ze(0|(t|=0),0|(e|=0),45),E(),(u&=127)>>>0>121)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,D=a,0|(u=5);t:do{if(0|F(u)&&(A=0|ze(0|t,0|e,52),E(),0|(A&=15))){o=1;e:for(;;){switch(c=0|ze(0|t,0|e,3*(15-o|0)|0),E(),7&c){case 5:break e;case 0:break;default:o=e;break t}if(!(o>>>0<A>>>0)){o=e;break t}o=o+1|0}for(s=1,o=e;l=0|Ge(7,0,0|(e=3*(15-s|0)|0)),c=o&~E(),o=0|ze(0|t,0|o,0|e),E(),t=t&~l|(o=0|Ge(0|pt(7&o),0,0|e)),o=c|E(),s>>>0<A>>>0;)s=s+1|0}else o=e}while(0);if(c=7696+(28*u|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],!(0|Vt(t,o,n)))return D=a,0|(u=0);if(l=n+4|0,i[r>>2]=i[l>>2],i[r+4>>2]=i[l+4>>2],i[r+8>>2]=i[l+8>>2],A=0|ze(0|t,0|o,52),E(),c=15&A,1&A?(ct(l),A=c+1|0):A=c,0|F(u)){t:do{if(c)for(e=1;;){if(s=0|ze(0|t,0|o,3*(15-e|0)|0),E(),0|(s&=7)){o=s;break t}if(!(e>>>0<c>>>0)){o=0;break}e=e+1|0}else o=0}while(0);o=4==(0|o)&1}else o=0;if(0|Rt(n,A,o,0)){if(0|F(u))do{}while(0|Rt(n,A,0,0));(0|A)!=(0|c)&&At(l)}else(0|A)!=(0|c)&&(i[l>>2]=i[r>>2],i[l+4>>2]=i[r+4>>2],i[l+8>>2]=i[r+8>>2]);return D=a,0|(u=0)}function Xt(t,e,n){n|=0;var r,i,a=0;return i=D,D=D+16|0,0|(a=0|Wt(t|=0,e|=0,r=i))?(D=i,0|a):(a=0|ze(0|t,0|e,52),E(),St(r,15&a,n),D=i,0|(a=0))}function Qt(t,e,n){n|=0;var r,i=0,a=0,o=0;if(r=D,D=D+16|0,0|(i=0|Wt(t|=0,e|=0,o=r)))return D=r,0|(o=i);i=0|ze(0|t,0|e,45),E(),i=!(0|F(127&i)),a=0|ze(0|t,0|e,52),E(),a&=15;t:do{if(!i){if(0|a)for(i=1;;){if(!(!((0|Ge(7,0,3*(15-i|0)|0))&t)&!(E()&e)))break t;if(!(i>>>0<a>>>0))break;i=i+1|0}return Tt(o,a,0,5,n),D=r,0|0}}while(0);return Lt(o,a,0,6,n),D=r,0|0}function Yt(t,e){e|=0;var n=0,r=0,a=0,o=0,s=0,A=0,l=0;if((t|=0)>>>0>15)return 0|(A=4);if(Ge(0|t,0,52),A=134225919|E(),!t){n=0,r=0;do{0|F(r)&&(Ge(0|r,0,45),s=A|E(),i[(t=e+(n<<3)|0)>>2]=-1,i[t+4>>2]=s,n=n+1|0),r=r+1|0}while(122!=(0|r));return 0|(n=0)}n=0,s=0;do{if(0|F(s)){for(Ge(0|s,0,45),r=1,a=-1,o=A|E();a&=~(l=0|Ge(7,0,3*(15-r|0)|0)),o&=~E(),(0|r)!=(0|t);)r=r+1|0;i[(l=e+(n<<3)|0)>>2]=a,i[l+4>>2]=o,n=n+1|0}s=s+1|0}while(122!=(0|s));return 0|(n=0)}function Zt(t,e,n,r){t|=0,r|=0;var a=0,o=0;a=0|ze(0|(e|=0),0|(n|=0),52),E(),!(0|e)&!(0|n)|(0|r)>15|(0|(a&=15))>(0|r)?(r=-1,a=-1,e=0,n=0):(o=0|function(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,w(0|(n=e)),0|r):(n=0|Ge(-1,-1,3+(3*(r-n|0)|0)|0),r=0|Ge(0|~n,0|~E(),3*(15-r|0)|0),n=~E()&e,r=~r&t,w(0|n),0|r)}(e,n,a+1|0,r),n=-15728641&E(),e=0|Ge(0|r,0,52),r=(o=!(0|Nt(e|=o,n|=E())))?-1:r),i[(o=t)>>2]=e,i[o+4>>2]=n,i[t+8>>2]=a,i[t+12>>2]=r}function Kt(t){var e,n=0,r=0,a=0,o=0,s=0,A=0,l=0,c=0;if(!(!(0|(n=0|i[(r=t|=0)>>2]))&!(0|(r=0|i[r+4>>2]))||(a=0|ze(0|n,0|r,52),E(),n=0|De(0|(l=0|Ge(1,0,3*(15^(a&=15))|0)),0|E(),0|n,0|r),r=0|E(),i[(l=t)>>2]=n,i[l+4>>2]=r,(0|a)<(0|(A=0|i[(l=t+8|0)>>2]))))){for(e=t+12|0,s=a;;){if((0|s)==(0|A)){a=5;break}if(c=(0|s)==(0|i[e>>2]),a=0|ze(0|n,0|r,0|(o=3*(15-s|0)|0)),E(),c&1==(0|(a&=7))&!0){a=7;break}if(!(7==(0|a)&!0)){a=10;break}if(n=0|De(0|n,0|r,0|(c=0|Ge(1,0,0|o)),0|E()),r=0|E(),i[(c=t)>>2]=n,i[c+4>>2]=r,!((0|s)>(0|A))){a=10;break}s=s+-1|0}if(5==(0|a))return i[(c=t)>>2]=0,i[c+4>>2]=0,i[l>>2]=-1,void(i[e>>2]=-1);if(7==(0|a))return A=0|De(0|n,0|r,0|(A=0|Ge(1,0,0|o)),0|E()),l=0|E(),i[(c=t)>>2]=A,i[c+4>>2]=l,void(i[e>>2]=s+-1)}}function Jt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function $t(t,e){return e|=0,+l(+(+a[(t|=0)>>3]-+a[e>>3]))<17453292519943298e-27?0|(e=+l(+(+a[t+8>>3]-+a[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+f(.5*(r-n)))*i+(o=+f(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Ne(0|(n=0|ue(7,0,t,((0|t)<0)<<31>>31)),0|E(),120,0),t=0|E(),i[e>>2]=2|n,i[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var r,i,o,s,A=0,l=0,u=0,p=0,m=0,_=0;return _=+a[(e|=0)>>3],o=+a[t>>3],m=+f(.5*(_-o)),u=+a[e+8>>3],i=+a[t+8>>3],p=+f(.5*(u-i)),r=+h(+o),s=+h(+_),p=2*+v(+ +c(+(p=m*m+p*(s*r*p))),+ +c(+(1-p))),m=+a[n>>3],_=+f(.5*(m-_)),A=+a[n+8>>3],u=+f(.5*(A-u)),l=+h(+m),u=2*+v(+ +c(+(u=_*_+u*(s*l*u))),+ +c(+(1-u))),m=+f(.5*(o-m)),A=+f(.5*(i-A)),A=2*+v(+ +c(+(A=m*m+A*(r*l*A))),+ +c(+(1-A))),4*+g(+ +c(+ +d(.5*(l=.5*(p+u+A)))*+d(.5*(l-p))*+d(.5*(l-u))*+d(.5*(l-A))))}function re(t,e,n){n|=0;var r,o,s,A=0,l=0;if(s=D,D=D+192|0,o=s,0|(l=0|Xt(t|=0,e|=0,r=s+168|0)))return D=s,0|(n=l);if(0|Qt(t,e,o)&&S(23313,22742,386,22751),(0|(e=0|i[o>>2]))>0){if(A=+ne(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{A+=+ne(o+8+((l=t)<<4)|0,o+8+((0|(t=t+1|0))%(0|e)<<4)|0,r)}while((0|t)<(0|e))}}else A=0;return a[n>>3]=A,D=s,0|(n=0)}function ie(t){t|=0;var e,n,r=0;return(e=0|Le(1,12))||S(22832,22787,49,22845),0|(r=0|i[(n=t+4|0)>>2])?(i[(r=r+8|0)>>2]=e,i[n>>2]=e,0|e):(0|i[t>>2]&&S(22862,22787,61,22885),i[(r=t)>>2]=e,i[n>>2]=e,0|e)}function ae(t,e){t|=0,e|=0;var n,r;return(r=0|Re(24))||S(22899,22787,78,22913),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[r+16>>2]=0,0|(n=0|i[(e=t+4|0)>>2])?(i[n+16>>2]=r,i[e>>2]=r,0|r):(0|i[t>>2]&&S(22928,22787,82,22913),i[t>>2]=r,i[e>>2]=r,0|r)}function oe(t){var e=0,n=0,r=0,a=0;if(t|=0)for(r=1;;){if(0|(e=0|i[t>>2]))do{if(0|(n=0|i[e>>2]))do{a=n,n=0|i[n+16>>2],Pe(a)}while(0|n);a=e,e=0|i[e+8>>2],Pe(a)}while(0|e);if(e=t,t=0|i[t+8>>2],r||Pe(e),!t)break;r=0}}function se(t){var e,n,r=0,o=0,s=0,A=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,E=0,T=0,C=0,R=0,P=0,L=0,D=0,O=0,I=0,q=0,U=0;if(0|i[(A=(t|=0)+8|0)>>2])return 0|(U=1);if(!(s=0|i[t>>2]))return 0|(U=0);r=s,o=0;do{o=o+1|0,r=0|i[r+8>>2]}while(0|r);if(o>>>0<2)return 0|(U=0);(n=0|Re(o<<2))||S(22948,22787,317,22967),(e=0|Re(o<<5))||S(22989,22787,321,22967),i[t>>2]=0,i[(C=t+4|0)>>2]=0,i[A>>2]=0,o=0,I=0,T=0,m=0;t:for(;;){if(p=0|i[s>>2]){c=0,u=p;do{if(f=+a[u+8>>3],r=u,u=0|i[u+16>>2],h=+a[(A=(d=!(0|u))?p:u)+8>>3],+l(+(f-h))>3.141592653589793){U=14;break}c+=(h-f)*(+a[r>>3]+ +a[A>>3])}while(!d);if(14==(0|U)){U=0,c=0,r=p;do{E=+a[r+8>>3],D=0|i[(O=r+16|0)>>2],w=+a[(D=0|D?D:p)+8>>3],c+=(+a[r>>3]+ +a[D>>3])*((w<0?w+6.283185307179586:w)-(E<0?E+6.283185307179586:E)),r=0|i[(0|r?O:s)>>2]}while(0|r)}c>0?(i[n+(I<<2)>>2]=s,I=I+1|0,A=T,r=m):U=19}else U=19;if(19==(0|U)){U=0;do{if(!o){if(m){A=C,u=m+8|0,r=s,o=t;break}if(0|i[t>>2]){U=27;break t}A=C,u=t,r=s,o=t;break}if(0|i[(r=o+8|0)>>2]){U=21;break t}if(!(o=0|Le(1,12))){U=23;break t}i[r>>2]=o,A=o+4|0,u=o,r=m}while(0);if(i[u>>2]=s,i[A>>2]=s,u=e+(T<<5)|0,d=0|i[s>>2]){for(a[(p=e+(T<<5)+8|0)>>3]=17976931348623157e292,a[(m=e+(T<<5)+24|0)>>3]=17976931348623157e292,a[u>>3]=-17976931348623157e292,a[(g=e+(T<<5)+16|0)>>3]=-17976931348623157e292,b=17976931348623157e292,M=-17976931348623157e292,A=0,v=d,f=17976931348623157e292,y=17976931348623157e292,x=-17976931348623157e292,h=-17976931348623157e292;c=+a[v>>3],E=+a[v+8>>3],v=0|i[v+16>>2],w=+a[((_=!(0|v))?d:v)+8>>3],c<f&&(a[p>>3]=c,f=c),E<y&&(a[m>>3]=E,y=E),c>x?a[u>>3]=c:c=x,E>h&&(a[g>>3]=E,h=E),b=E>0&E<b?E:b,M=E<0&E>M?E:M,A|=+l(+(E-w))>3.141592653589793,!_;)x=c;A&&(a[g>>3]=M,a[m>>3]=b)}else i[u>>2]=0,i[u+4>>2]=0,i[u+8>>2]=0,i[u+12>>2]=0,i[u+16>>2]=0,i[u+20>>2]=0,i[u+24>>2]=0,i[u+28>>2]=0;A=T+1|0}if(s=0|i[(O=s+8|0)>>2],i[O>>2]=0,!s){U=45;break}T=A,m=r}if(21==(0|U))S(22765,22787,35,22799);else if(23==(0|U))S(22819,22787,37,22799);else if(27==(0|U))S(22862,22787,61,22885);else if(45==(0|U)){t:do{if((0|I)>0){for(O=!(0|A),L=A<<2,D=!(0|t),P=0,r=0;;){if(R=0|i[n+(P<<2)>>2],O)U=73;else{if(!(T=0|Re(L))){U=50;break}if(!(C=0|Re(L))){U=52;break}e:do{if(D)o=0;else{for(A=0,o=0,u=t;s=e+(A<<5)|0,0|Ae(0|i[u>>2],s,0|i[R>>2])?(i[T+(o<<2)>>2]=u,i[C+(o<<2)>>2]=s,_=o+1|0):_=o,u=0|i[u+8>>2];)A=A+1|0,o=_;if((0|_)>0)if(s=0|i[T>>2],1==(0|_))o=s;else for(g=0,v=-1,o=s,m=s;;){for(d=0|i[m>>2],s=0,u=0;p=(0|(A=0|i[i[T+(u<<2)>>2]>>2]))==(0|d)?s:s+(1&Ae(A,0|i[C+(u<<2)>>2],0|i[d>>2]))|0,(0|(u=u+1|0))!=(0|_);)s=p;if(o=(A=(0|p)>(0|v))?m:o,(0|(s=g+1|0))==(0|_))break e;g=s,v=A?p:v,m=0|i[T+(s<<2)>>2]}else o=0}}while(0);if(Pe(T),Pe(C),o){if(s=0|i[(A=o+4|0)>>2])o=s+8|0;else if(0|i[o>>2]){U=70;break}i[o>>2]=R,i[A>>2]=R}else U=73}if(73==(0|U)){if(U=0,0|(r=0|i[R>>2]))do{C=r,r=0|i[r+16>>2],Pe(C)}while(0|r);Pe(R),r=1}if((0|(P=P+1|0))>=(0|I)){q=r;break t}}50==(0|U)?S(23004,22787,249,23023):52==(0|U)?S(23042,22787,252,23023):70==(0|U)&&S(22862,22787,61,22885)}else q=0}while(0);return Pe(n),Pe(e),0|(U=q)}return 0}function Ae(t,e,n){t|=0;var r=0,o=0,s=0,A=0,l=0,c=0,u=0,h=0;if(!(0|Q(e|=0,n|=0)))return 0|(t=0);if(e=0|X(e),r=+a[n>>3],o=e&(o=+a[n+8>>3])<0?o+6.283185307179586:o,!(t=0|i[t>>2]))return 0|(t=0);if(e){e=0,u=o,n=t;t:for(;;){for(;A=+a[n>>3],o=+a[n+8>>3],h=0|i[(n=n+16|0)>>2],s=+a[(h=0|h?h:t)>>3],l=+a[h+8>>3],A>s?(c=A,A=l):(c=s,s=A,A=o,o=l),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(((c=(l=A<0?A+6.283185307179586:A)+(r-s)/(c-s)*((A=o<0?o+6.283185307179586:o)-l))<0?c+6.283185307179586:c)>(u=l==u|A==u?u+-2220446049250313e-31:u)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,u=o,n=t;t:for(;;){for(;A=+a[n>>3],o=+a[n+8>>3],h=0|i[(n=n+16|0)>>2],s=+a[(h=0|h?h:t)>>3],l=+a[h+8>>3],A>s?(c=A,A=l):(c=s,s=A,A=o,o=l),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(A+(r-s)/(c-s)*(o-A)>(u=A==u|o==u?u+-2220446049250313e-31:u)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function le(t,e,n,a,o){n|=0,a|=0,o|=0;var s,A,l,c,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;if(c=D,D=D+32|0,y=c+16|0,l=c,u=0|ze(0|(t|=0),0|(e|=0),52),E(),u&=15,g=0|ze(0|n,0|a,52),E(),(0|u)!=(15&g))return D=c,0|(y=12);if(p=0|ze(0|t,0|e,45),E(),p&=127,m=0|ze(0|n,0|a,45),E(),p>>>0>121|(m&=127)>>>0>121)return D=c,0|(y=5);if(g=(0|p)!=(0|m)){if(7==(0|(f=0|W(p,m))))return D=c,0|(y=1);7==(0|(d=0|W(m,p)))?S(23066,23090,161,23100):(v=f,h=d)}else v=0,h=0;s=0|F(p),A=0|F(m),i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0;do{if(v){if(f=(0|(m=0|i[4272+(28*p|0)+(v<<2)>>2]))>0,A)if(f){p=0,d=n,f=a;do{d=0|zt(d,f),f=0|E(),1==(0|(h=0|pt(h)))&&(h=0|pt(1)),p=p+1|0}while((0|p)!=(0|m));m=h,p=d,d=f}else m=h,p=n,d=a;else if(f){p=0,d=n,f=a;do{d=0|Gt(d,f),f=0|E(),h=0|pt(h),p=p+1|0}while((0|p)!=(0|m));m=h,p=d,d=f}else m=h,p=n,d=a;if(Vt(p,d,y),g||S(23115,23090,191,23100),(f=!!(0|s))&(h=!!(0|A))&&S(23142,23090,192,23100),f){if(7==(0|(h=0|Bt(t,e)))){u=5;break}if(0|r[21872+(7*h|0)+v|0]){u=1;break}p=d=0|i[21040+(28*h|0)+(v<<2)>>2]}else if(h){if(7==(0|(h=0|Bt(p,d)))){u=5;break}if(0|r[21872+(7*h|0)+m|0]){u=1;break}p=0,d=0|i[21040+(28*m|0)+(h<<2)>>2]}else p=0,d=0;if((p|d)<0)u=5;else{if((0|d)>0){f=y+4|0,h=0;do{ft(f),h=h+1|0}while((0|h)!=(0|d))}if(i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,ut(l,v),0|u)for(;0|Ht(u)?lt(l):ct(l),(0|u)>1;)u=u+-1|0;if((0|p)>0){u=0;do{ft(l),u=u+1|0}while((0|u)!=(0|p))}et(_=y+4|0,l,_),$(_),_=51}}else if(Vt(n,a,y),!!(0|s)&!!(0|A))if((0|m)!=(0|p)&&S(23173,23090,261,23100),7==(0|(h=0|Bt(t,e)))|7==(0|(u=0|Bt(n,a))))u=5;else if(0|r[21872+(7*h|0)+u|0])u=1;else if((0|(h=0|i[21040+(28*h|0)+(u<<2)>>2]))>0){f=y+4|0,u=0;do{ft(f),u=u+1|0}while((0|u)!=(0|h));_=51}else _=51;else _=51}while(0);return 51==(0|_)&&(u=y+4|0,i[o>>2]=i[u>>2],i[o+4>>2]=i[u+4>>2],i[o+8>>2]=i[u+8>>2],u=0),D=c,0|(y=u)}function ce(t,e,n,r){n|=0,r|=0;var a,o,s,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;if(s=D,D=D+48|0,a=s+36|0,c=s+24|0,u=s+12|0,h=s,A=0|ze(0|(t|=0),0|(e|=0),52),E(),A&=15,d=0|ze(0|t,0|e,45),E(),(d&=127)>>>0>121)return D=s,0|(r=5);if(o=0|F(d),Ge(0|A,0,52),g=134225919|E(),i[(l=r)>>2]=-1,i[l+4>>2]=g,!A)return 7==(0|(A=0|it(n)))||127==(0|(A=0|V(d,A)))?(D=s,0|(g=1)):(p=0|Ge(0|A,0,45),m=0|E(),m=-1040385&i[(d=r)+4>>2]|m,i[(g=r)>>2]=i[d>>2]|p,i[g+4>>2]=m,D=s,0|(g=0));for(i[a>>2]=i[n>>2],i[a+4>>2]=i[n+4>>2],i[a+8>>2]=i[n+8>>2],n=A;;){if(l=n,n=n+-1|0,i[c>>2]=i[a>>2],i[c+4>>2]=i[a+4>>2],i[c+8>>2]=i[a+8>>2],0|Ht(l)){if(0|(A=0|at(a))){n=13;break}i[u>>2]=i[a>>2],i[u+4>>2]=i[a+4>>2],i[u+8>>2]=i[a+8>>2],lt(u)}else{if(0|(A=0|ot(a))){n=13;break}i[u>>2]=i[a>>2],i[u+4>>2]=i[a+4>>2],i[u+8>>2]=i[a+8>>2],ct(u)}if(nt(c,u,h),$(h),_=0|i[(A=r)>>2],A=0|i[A+4>>2],v=0|Ge(7,0,0|(y=3*(15-l|0)|0)),A&=~E(),y=0|Ge(0|it(h),0,0|y),A=E()|A,i[(g=r)>>2]=y|_&~v,i[g+4>>2]=A,(0|l)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|i[a>>2])<=1&&(0|i[a+4>>2])<=1&&(0|i[a+8>>2])<=1){h=127==(0|(A=0|V(d,n=0|it(a))))?0:0|F(A);e:do{if(n){if(o){if(7==(0|(A=0|Bt(t,e)))){A=5;break t}if((0|(l=0|i[21248+(28*A|0)+(n<<2)>>2]))>0){A=n,n=0;do{A=0|dt(A),n=n+1|0}while((0|n)!=(0|l))}else A=n;if(1==(0|A)){A=9;break t}127==(0|(n=0|V(d,A)))&&S(23200,23090,411,23230),0|F(n)?S(23245,23090,412,23230):(m=n,p=l,f=A)}else m=A,p=0,f=n;if((0|(u=0|i[4272+(28*d|0)+(f<<2)>>2]))<=-1&&S(23276,23090,419,23230),!h){if((0|p)<0){A=5;break t}if(0|p){A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];do{n=0|Ft(n,l),l=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=l,A=A+1|0}while((0|A)<(0|p))}if((0|u)<=0){A=m,n=58;break}for(A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];;)if(n=0|Ft(n,l),l=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=l,(0|(A=A+1|0))==(0|u)){A=m,n=58;break e}}if(7==(0|(c=0|W(m,d)))&&S(23066,23090,428,23230),n=0|i[(A=r)>>2],A=0|i[A+4>>2],(0|u)>0){l=0;do{n=0|Ft(n,A),A=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=A,l=l+1|0}while((0|l)!=(0|u))}if(7==(0|(A=0|Bt(n,A)))&&S(23313,23090,440,23230),n=0|z(m),(0|(n=0|i[(n?21664:21456)+(28*c|0)+(A<<2)>>2]))<0&&S(23313,23090,454,23230),n){A=0,l=0|i[(c=r)>>2],c=0|i[c+4>>2];do{l=0|kt(l,c),c=0|E(),i[(y=r)>>2]=l,i[y+4>>2]=c,A=A+1|0}while((0|A)<(0|n));A=m,n=58}else A=m,n=58}else if(!!(0|o)&!!(0|h)){if(7==(0|(n=0|Bt(t,e)))|7==(0|(l=0|Bt(0|i[(l=r)>>2],0|i[l+4>>2])))){A=5;break t}if((0|(l=0|i[21248+(28*n|0)+(l<<2)>>2]))<0){A=5;break t}if(l){n=0,c=0|i[(u=r)>>2],u=0|i[u+4>>2];do{c=0|Ft(c,u),u=0|E(),i[(y=r)>>2]=c,i[y+4>>2]=u,n=n+1|0}while((0|n)<(0|l));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&h&&(n=59),59==(0|n)&&1==(0|Bt(0|i[(y=r)>>2],0|i[y+4>>2]))){A=9;break}v=0|i[(y=r)>>2],y=-1040385&i[y+4>>2],_=0|Ge(0|A,0,45),y|=E(),i[(A=r)>>2]=v|_,i[A+4>>2]=y,A=0}else A=1}while(0);return D=s,0|(y=A)}function ue(t,e,n,r){t|=0,e|=0;var i=0,a=0,o=0;if(!(0|(n|=0))&!(0|(r|=0)))return a=1,w(0|(i=0)),0|a;a=t,i=e,t=1,e=0;do{t=0|Ne(0|((o=!0&!(1&n))?1:a),0|(o?0:i),0|t,0|e),e=0|E(),n=0|Fe(0|n,0|r,1),r=0|E(),a=0|Ne(0|a,0|i,0|a,0|i),i=0|E()}while(!(!(0|n)&!(0|r)));return w(0|e),0|t}function he(t,e,n){t|=0;var r,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0;if(!(0|Q(e|=0,n|=0)))return 0|(d=0);if(e=0|X(e),o=+a[n>>3],s=e&(s=+a[n+8>>3])<0?s+6.283185307179586:s,(0|(d=0|i[t>>2]))<=0)return 0|(d=0);if(r=0|i[t+4>>2],e){e=0,f=s,n=-1,t=0;t:for(;;){for(h=t;l=+a[r+(h<<4)>>3],s=+a[r+(h<<4)+8>>3],A=+a[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],c=+a[r+(t<<4)+8>>3],l>A?(u=l,l=c):(u=A,A=l,l=s,s=c),(o=o==A|o==u?o+2220446049250313e-31:o)<A|o>u;){if((0|(n=h+1|0))>=(0|d)){n=22;break t}t=h,h=n,n=t}if(((u=(c=l<0?l+6.283185307179586:l)+(o-A)/(u-A)*((l=s<0?s+6.283185307179586:s)-c))<0?u+6.283185307179586:u)>(f=c==f|l==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(t=h+1|0))>=(0|d)){n=22;break}n=h}if(22==(0|n))return 0|e}else{e=0,f=s,n=-1,t=0;t:for(;;){for(h=t;l=+a[r+(h<<4)>>3],s=+a[r+(h<<4)+8>>3],A=+a[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],c=+a[r+(t<<4)+8>>3],l>A?(u=l,l=c):(u=A,A=l,l=s,s=c),(o=o==A|o==u?o+2220446049250313e-31:o)<A|o>u;){if((0|(n=h+1|0))>=(0|d)){n=22;break t}t=h,h=n,n=t}if(l+(o-A)/(u-A)*(s-l)>(f=l==f|s==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(t=h+1|0))>=(0|d)){n=22;break}n=h}if(22==(0|n))return 0|e}return 0}function fe(t,e){e|=0;var n,r,o,s,A,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0;if(!(r=0|i[(t|=0)>>2]))return i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,void(i[e+28>>2]=0);if(a[(o=e+8|0)>>3]=17976931348623157e292,a[(s=e+24|0)>>3]=17976931348623157e292,a[e>>3]=-17976931348623157e292,a[(A=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[t+4>>2],g=17976931348623157e292,v=-17976931348623157e292,_=0,t=-1,f=17976931348623157e292,d=17976931348623157e292,m=-17976931348623157e292,u=-17976931348623157e292,y=0;c=+a[n+(y<<4)>>3],p=+a[n+(y<<4)+8>>3],h=+a[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<f&&(a[o>>3]=c,f=c),p<d&&(a[s>>3]=p,d=p),c>m?a[e>>3]=c:c=m,p>u&&(a[A>>3]=p,u=p),g=p>0&p<g?p:g,v=p<0&p>v?p:v,_|=+l(+(p-h))>3.141592653589793,(0|(t=y+1|0))!=(0|r);)x=y,m=c,y=t,t=x;_&&(a[A>>3]=v,a[s>>3]=g)}}function de(t,e){e|=0;var n,r=0,o=0,s=0,A=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,E=0,S=0;if(v=0|i[(t|=0)>>2]){if(a[(_=e+8|0)>>3]=17976931348623157e292,a[(y=e+24|0)>>3]=17976931348623157e292,a[e>>3]=-17976931348623157e292,a[(x=e+16|0)>>3]=-17976931348623157e292,(0|v)>0){for(s=0|i[t+4>>2],m=17976931348623157e292,g=-17976931348623157e292,o=0,r=-1,h=17976931348623157e292,f=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292,b=0;A=+a[s+(b<<4)>>3],d=+a[s+(b<<4)+8>>3],u=+a[s+(((0|(E=r+2|0))==(0|v)?0:E)<<4)+8>>3],A<h&&(a[_>>3]=A,h=A),d<f&&(a[y>>3]=d,f=d),A>p?a[e>>3]=A:A=p,d>c&&(a[x>>3]=d,c=d),m=d>0&d<m?d:m,g=d<0&d>g?d:g,o|=+l(+(d-u))>3.141592653589793,(0|(r=b+1|0))!=(0|v);)E=b,p=A,b=r,r=E;o&&(a[x>>3]=g,a[y>>3]=m)}}else i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,i[e+28>>2]=0;if(!((0|(r=0|i[(E=t+8|0)>>2]))<=0)){n=t+12|0,w=0;do{if(s=0|i[n>>2],o=w,y=e+((w=w+1|0)<<5)|0,x=0|i[s+(o<<3)>>2]){if(a[(b=e+(w<<5)+8|0)>>3]=17976931348623157e292,a[(t=e+(w<<5)+24|0)>>3]=17976931348623157e292,a[y>>3]=-17976931348623157e292,a[(M=e+(w<<5)+16|0)>>3]=-17976931348623157e292,(0|x)>0){for(v=0|i[s+(o<<3)+4>>2],m=17976931348623157e292,g=-17976931348623157e292,s=0,o=-1,_=0,h=17976931348623157e292,f=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292;A=+a[v+(_<<4)>>3],p=+a[v+(_<<4)+8>>3],u=+a[v+(((0|(o=o+2|0))==(0|x)?0:o)<<4)+8>>3],A<h&&(a[b>>3]=A,h=A),p<f&&(a[t>>3]=p,f=p),A>d?a[y>>3]=A:A=d,p>c&&(a[M>>3]=p,c=p),m=p>0&p<m?p:m,g=p<0&p>g?p:g,s|=+l(+(p-u))>3.141592653589793,(0|(o=_+1|0))!=(0|x);)S=_,_=o,d=A,o=S;s&&(a[M>>3]=g,a[t>>3]=m)}}else i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0,i[y+16>>2]=0,i[y+20>>2]=0,i[y+24>>2]=0,i[y+28>>2]=0,r=0|i[E>>2]}while((0|w)<(0|r))}}function pe(t,e,n){var r=0,a=0,o=0;if(!(0|he(t|=0,e|=0,n|=0)))return 0|(a=0);if((0|i[(a=t+8|0)>>2])<=0)return 0|(a=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|he((0|i[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|i[a>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function me(t,e,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,s,A,l,c,u,h,f=0;l=+a[(t|=0)>>3],A=+a[e>>3]-l,s=+a[t+8>>3],o=+a[e+8>>3]-s,u=+a[n>>3],f=((f=+a[r>>3]-u)*(s-(h=+a[n+8>>3]))-(l-u)*(c=+a[r+8>>3]-h))/(A*c-o*f),a[i>>3]=l+A*f,a[i+8>>3]=s+o*f}function ge(t,e){return e|=0,+l(+(+a[(t|=0)>>3]-+a[e>>3]))<1.1920928955078125e-7?0|(e=+l(+(+a[t+8>>3]-+a[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function ve(t,e){e|=0;var n,r,i;return+((i=+a[(t|=0)>>3]-+a[e>>3])*i+(r=+a[t+8>>3]-+a[e+8>>3])*r+(n=+a[t+16>>3]-+a[e+16>>3])*n)}function _e(t,e,n){n|=0;var r,a,o,s,A=0,l=0,c=0;if(s=D,D=D+32|0,c=s,0|(A=0|Wt(t|=0,e|=0,a=s+16|0)))return D=s,0|(n=A);r=0|Ot(t,e),o=0|Bt(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,i[(e|=0)>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2]}(r,c),A=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|i[11120+(216*e|0)>>2])!=(0|t))if((0|i[11120+(216*e|0)+8>>2])!=(0|t))if((0|i[11120+(216*e|0)+16>>2])!=(0|t))if((0|i[11120+(216*e|0)+24>>2])!=(0|t))if((0|i[11120+(216*e|0)+32>>2])!=(0|t))if((0|i[11120+(216*e|0)+40>>2])!=(0|t))if((0|i[11120+(216*e|0)+48>>2])!=(0|t))if((0|i[11120+(216*e|0)+56>>2])!=(0|t))if((0|i[11120+(216*e|0)+64>>2])!=(0|t))if((0|i[11120+(216*e|0)+72>>2])!=(0|t))if((0|i[11120+(216*e|0)+80>>2])!=(0|t))if((0|i[11120+(216*e|0)+88>>2])!=(0|t))if((0|i[11120+(216*e|0)+96>>2])!=(0|t))if((0|i[11120+(216*e|0)+104>>2])!=(0|t))if((0|i[11120+(216*e|0)+112>>2])!=(0|t))if((0|i[11120+(216*e|0)+120>>2])!=(0|t))if((0|i[11120+(216*e|0)+128>>2])!=(0|t)){if((0|i[11120+(216*e|0)+136>>2])!=(0|t)){if((0|i[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|i[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|i[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|i[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|i[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|i[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|i[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|i[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|i[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return-1}t=2,n=1,r=2}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0}while(0);return 0|i[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|i[a>>2]);t:do{if(0|F(r)){switch(0|r){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:A=1;break t}if(l=0|i[22e3+(24*t|0)+8>>2],e=0|i[22e3+(24*t|0)+16>>2],(0|(t=0|i[a>>2]))!=(0|i[c>>2])&&(c=0|z(r))|(0|(t=0|i[a>>2]))==(0|e)&&(A=(A+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){A=(A+5|0)%6|0,l=22;break}5==(0|o)&(0|t)==(0|l)?(A=(A+1|0)%6|0,l=22):l=22}else l=22}while(0);return 22==(0|l)&&(i[n>>2]=A,A=0),D=s,0|(n=A)}function ye(t,e,n,r){n|=0,r|=0;var a,o,s,A,l,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;if(l=D,D=D+32|0,y=l+24|0,A=l+20|0,s=l+8|0,o=l+16|0,a=l,d=(d=!(0|Nt(t|=0,e|=0)))?6:5,m=0|ze(0|t,0|e,52),E(),d>>>0<=n>>>0)return D=l,0|(r=2);!(g=!(0|(m&=15)))&&!((v=0|Ge(7,0,3*(15^m)|0))&t)&!(E()&e)?c=n:u=4;t:do{if(4==(0|u)){if((0|((c=!!(0|Nt(t,e)))?4:5))<(0|n))return D=l,0|(r=1);if(0|_e(t,e,y))return D=l,0|(r=1);if(u=(0|i[y>>2])+n|0,7==(0|(v=0|i[(c=c?22288+((0|u)%5<<2)|0:22320+((0|u)%6<<2)|0)>>2])))return D=l,0|(r=1);i[A>>2]=0,c=0|N(t,e,v,A,s);do{if(!c){if(p=0|i[(f=s)>>2],u=(h=(f=0|i[f+4>>2])>>>0<e>>>0|(0|f)==(0|e)&p>>>0<t>>>0)?p:t,h=h?f:e,!g&&!(p&(g=0|Ge(7,0,3*(15^m)|0)))&!(f&E()))c=n;else{if(f=(n+-1+d|0)%(0|d)|0,c=0|Nt(t,e),(0|f)<0&&S(23313,23315,245,23324),(0|((d=!!(0|c))?4:5))<(0|f)&&S(23313,23315,245,23324),0|_e(t,e,y)&&S(23313,23315,245,23324),c=(0|i[y>>2])+f|0,7==(0|(f=0|i[(c=d?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2]))&&S(23313,23315,245,23324),i[o>>2]=0,0|(c=0|N(t,e,f,o,a)))break;d=0|i[(p=a)>>2],p=0|i[p+4>>2];do{if(p>>>0<h>>>0|(0|p)==(0|h)&d>>>0<u>>>0){if(u=0|Nt(d,p)?0|B(d,p,t,e):0|i[22384+(((0|i[o>>2])+(0|i[22352+(f<<2)>>2])|0)%6<<2)>>2],c=0|Nt(d,p),(u+-1|0)>>>0>5){c=-1,u=d,h=p;break}if(1==(0|u)&(c=!!(0|c))){c=-1,u=d,h=p;break}do{if(!(0|_e(d,p,y))){if(c){c=(5+(0|i[21936+(u<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(u<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);u=d,h=p}else c=n}while(0);p=0|i[(f=s)>>2],f=0|i[f+4>>2]}if((0|u)==(0|p)&(0|h)==(0|f)){if(t=(d=!!(0|Nt(p,f)))?0|B(p,f,t,e):0|i[22384+(((0|i[A>>2])+(0|i[22352+(v<<2)>>2])|0)%6<<2)>>2],c=0|Nt(p,f),(t+-1|0)>>>0<=5&&!(1==(0|t)&(_=!!(0|c))))do{if(!(0|_e(p,f,y))){if(_){c=(5+(0|i[21936+(t<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(t<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|d&5==(0|c)?0:c}e=h,t=u;break t}}while(0);return D=l,0|(r=c)}}while(0);return _=0|Ge(0|c,0,56),y=E()|-2130706433&e|536870912,i[r>>2]=_|t,i[r+4>>2]=y,D=l,0|(r=0)}function xe(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|Le(e,4),i[t>>2]=r,r||S(23337,23360,40,23374)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=n}function be(t){var e,n,r,o=0,s=0,A=0,c=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(s=0|i[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(A=0|i[t>>2],c=0|i[A+(o<<2)>>2])break;o=o+1|0}o=A+(~~(+l(+ +u(10,+ +(15-(0|i[n>>2])|0))*(+a[c>>3]+ +a[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|i[o>>2];e:do{if(0|s){if(A=c+32|0,(0|s)==(0|c))i[o>>2]=i[A>>2];else{if(!(o=0|i[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|i[(s=o+32|0)>>2]))break e;i[s>>2]=i[A>>2]}Pe(c),i[r>>2]=(0|i[r>>2])-1}}while(0)}Pe(0|i[t>>2])}function Me(t){var e,n=0,r=0;for(e=0|i[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|i[(0|i[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function we(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,n=(0|i[t>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|i[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|i[o+32>>2])){n=1,o=10;break}r=o,o=n}if(8==(0|o)){i[r+32>>2]=i[s>>2];break}if(10==(0|o))return 0|n}else i[n>>2]=i[s>>2]}while(0);return Pe(e),i[(s=t+8|0)>>2]=(0|i[s>>2])-1,0|(s=0)}function Ee(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,A=0;(r=0|Re(40))||S(23390,23360,98,23403),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[(s=r+16|0)>>2]=i[n>>2],i[s+4>>2]=i[n+4>>2],i[s+8>>2]=i[n+8>>2],i[s+12>>2]=i[n+12>>2],i[r+32>>2]=0,s=~~(+l(+ +u(10,+ +(15-(0|i[t+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,s=(0|i[t>>2])+(s<<2)|0,o=0|i[s>>2];do{if(o){for(;!(0|$t(o,e)&&0|$t(o+16|0,n));)if(s=0|i[o+32>>2],!(0|i[(o=0|s?s:o)+32>>2])){A=10;break}if(10==(0|A)){i[o+32>>2]=r;break}return Pe(r),0|(A=o)}i[s>>2]=r}while(0);return i[(A=t+8|0)>>2]=1+(0|i[A>>2]),0|(A=r)}function Se(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(o=0|i[(0|i[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|$t(t,e)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|$t(t,e)&&0|$t(t+16|0,n)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function Te(t,e){e|=0;var n=0;if(n=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(t=0|i[(0|i[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|$t(t,e)){e=5;break}if(!(t=0|i[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Ce(t){return 0|+function(t){return+ +Qe(+(t=+t))}(t=+t)}function Re(t){t|=0;var e,n=0,r=0,a=0,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0;e=D,D=D+16|0,d=e;do{if(t>>>0<245){if(t=(u=t>>>0<11?16:t+11&-8)>>>3,3&(r=(f=0|i[5857])>>>t))return a=0|i[(r=(t=23468+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|i[(o=a+8|0)>>2]))==(0|t)?i[5857]=f&~(1<<n):(i[s+12>>2]=t,i[r>>2]=s),b=n<<3,i[a+4>>2]=3|b,i[(b=a+b+4|0)>>2]=1|i[b>>2],D=e,0|(b=o);if(u>>>0>(h=0|i[5859])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|i[(t=(n=23468+((a=((r=(n>>>=l=n>>>12&16)>>>5&8)|l|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(a=(n>>>=t)>>>1&1))+(n>>>a)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(l=s+8|0)>>2]))==(0|n)?(t=f&~(1<<a),i[5857]=t):(i[r+12>>2]=n,i[t>>2]=r,t=f),A=(b=a<<3)-u|0,i[s+4>>2]=3|u,i[(o=s+u|0)+4>>2]=1|A,i[s+b>>2]=A,0|h&&(a=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=a,i[n+12>>2]=a,i[a+8>>2]=n,i[a+12>>2]=r),i[5859]=A,i[5862]=o,D=e,0|(b=l);if(s=0|i[5858]){for(r=(s&0-s)-1|0,r=c=0|i[23732+(((a=(r>>>=o=r>>>12&16)>>>5&8)|o|(A=(r>>>=a)>>>2&4)|(l=(r>>>=A)>>>1&2)|(c=(r>>>=l)>>>1&1))+(r>>>c)<<2)>>2],l=c,c=(-8&i[c+4>>2])-u|0;(t=0|i[r+16>>2])||(t=0|i[r+20>>2]);)r=t,l=(o=(A=(-8&i[t+4>>2])-u|0)>>>0<c>>>0)?t:l,c=o?A:c;if((A=l+u|0)>>>0>l>>>0){o=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(a=n+20|0)>>2])n=r,t=a;else{if(!(r=0|i[(a=n+16|0)>>2]))break;n=r,t=a}i[t>>2]=0,r=n}else r=0|i[l+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|o){if(n=0|i[l+28>>2],(0|l)==(0|i[(t=23732+(n<<2)|0)>>2])){if(i[t>>2]=r,!r){i[5858]=s&~(1<<n);break}}else if(i[((0|i[(b=o+16|0)>>2])==(0|l)?b:o+20)>>2]=r,!r)break;i[r+24>>2]=o,0|(n=0|i[l+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[l+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return c>>>0<16?(b=c+u|0,i[l+4>>2]=3|b,i[(b=l+b+4|0)>>2]=1|i[b>>2]):(i[l+4>>2]=3|u,i[A+4>>2]=1|c,i[A+c>>2]=c,0|h&&(a=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,(n=1<<n)&f?n=0|i[(t=r+8|0)>>2]:(i[5857]=n|f,n=r,t=r+8|0),i[t>>2]=a,i[n+12>>2]=a,i[a+8>>2]=n,i[a+12>>2]=r),i[5859]=c,i[5862]=A),D=e,0|(b=l+8|0)}f=u}else f=u}else f=u}else if(t>>>0<=4294967231)if(u=-8&(t=t+11|0),a=0|i[5858]){o=0-u|0,c=(t>>>=8)?u>>>0>16777215?31:u>>>((c=14-((l=((g=t<<(f=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|f|(c=((g<<=l)+245760|0)>>>16&2))+(g<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|i[23732+(c<<2)>>2];t:do{if(r)for(t=0,l=u<<(31==(0|c)?0:25-(c>>>1)),s=0;;){if((A=(-8&i[r+4>>2])-u|0)>>>0<o>>>0){if(!A){t=r,o=0,g=65;break t}t=r,o=A}if(s=!(0|(g=0|i[r+20>>2]))|(0|g)==(0|(r=0|i[r+16+(l>>>31<<2)>>2]))?s:g,!r){r=s,g=61;break}l<<=1}else r=0,t=0,g=61}while(0);if(61==(0|g)){if(!(0|r)&!(0|t)){if(!(t=((t=2<<c)|0-t)&a)){f=u;break}f=(t&0-t)-1|0,t=0,r=0|i[23732+(((s=(f>>>=A=f>>>12&16)>>>5&8)|A|(l=(f>>>=s)>>>2&4)|(c=(f>>>=l)>>>1&2)|(r=(f>>>=c)>>>1&1))+(f>>>r)<<2)>>2]}r?g=65:(l=t,A=o)}if(65==(0|g))for(s=r;;){if(o=(r=(f=(-8&i[s+4>>2])-u|0)>>>0<o>>>0)?f:o,t=r?s:t,(r=0|i[s+16>>2])||(r=0|i[s+20>>2]),!r){l=t,A=o;break}s=r}if(0|l&&A>>>0<((0|i[5859])-u|0)>>>0&&(h=l+u|0)>>>0>l>>>0){s=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|i[(o=n+16|0)>>2]))break;n=r,t=o}i[t>>2]=0}else b=0|i[l+8>>2],i[b+12>>2]=n,i[n+8>>2]=b}while(0);do{if(s){if(t=0|i[l+28>>2],(0|l)==(0|i[(r=23732+(t<<2)|0)>>2])){if(i[r>>2]=n,!n){a&=~(1<<t),i[5858]=a;break}}else if(i[((0|i[(b=s+16|0)>>2])==(0|l)?b:s+20)>>2]=n,!n)break;i[n+24>>2]=s,0|(t=0|i[l+16>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),(t=0|i[l+20>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);t:do{if(A>>>0<16)b=A+u|0,i[l+4>>2]=3|b,i[(b=l+b+4|0)>>2]=1|i[b>>2];else{if(i[l+4>>2]=3|u,i[h+4>>2]=1|A,i[h+A>>2]=A,n=A>>>3,A>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=h,i[n+12>>2]=h,i[h+8>>2]=n,i[h+12>>2]=r;break}if(n=23732+((r=(n=A>>>8)?A>>>0>16777215?31:A>>>((r=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(r=((b<<=y)+245760|0)>>>16&2))+(b<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[h+28>>2]=r,i[(t=h+16|0)+4>>2]=0,i[t>>2]=0,!(a&(t=1<<r))){i[5858]=a|t,i[n>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break}n=0|i[n>>2];e:do{if((-8&i[n+4>>2])!=(0|A)){for(a=A<<(31==(0|r)?0:25-(r>>>1));t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|A)){n=t;break e}a<<=1,n=t}i[r>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=h,i[x>>2]=h,i[h+8>>2]=b,i[h+12>>2]=n,i[h+24>>2]=0}}while(0);return D=e,0|(b=l+8|0)}f=u}else f=u;else f=-1}while(0);if((r=0|i[5859])>>>0>=f>>>0)return n=r-f|0,t=0|i[5862],n>>>0>15?(b=t+f|0,i[5862]=b,i[5859]=n,i[b+4>>2]=1|n,i[t+r>>2]=n,i[t+4>>2]=3|f):(i[5859]=0,i[5862]=0,i[t+4>>2]=3|r,i[(b=t+r+4|0)>>2]=1|i[b>>2]),D=e,0|(b=t+8|0);if((A=0|i[5860])>>>0>f>>>0)return y=A-f|0,i[5860]=y,x=(b=0|i[5863])+f|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|f,D=e,0|(b=b+8|0);if(0|i[5975]?t=0|i[5977]:(i[5977]=4096,i[5976]=4096,i[5978]=-1,i[5979]=-1,i[5980]=0,i[5968]=0,i[5975]=-16&d^1431655768,t=4096),l=f+48|0,(u=(s=t+(c=f+47|0)|0)&(o=0-t|0))>>>0<=f>>>0)return D=e,0|(b=0);if(0|(t=0|i[5967])&&(d=(h=0|i[5965])+u|0)>>>0<=h>>>0|d>>>0>t>>>0)return D=e,0|(b=0);t:do{if(4&i[5968])n=0,g=143;else{r=0|i[5863];e:do{if(r){for(a=23876;!((d=0|i[a>>2])>>>0<=r>>>0&&(d+(0|i[a+4>>2])|0)>>>0>r>>>0);){if(!(t=0|i[a+8>>2])){g=128;break e}a=t}if((n=s-A&o)>>>0<2147483647)if((0|(t=0|Ye(0|n)))==((0|i[a>>2])+(0|i[a+4>>2])|0)){if(-1!=(0|t)){A=n,s=t,g=145;break t}}else a=t,g=136;else n=0}else g=128}while(0);do{if(128==(0|g))if(-1!=(0|(r=0|Ye(0)))&&(n=r,m=(n=((m=(p=0|i[5976])+-1|0)&n?(m+n&0-p)-n|0:0)+u|0)+(p=0|i[5965])|0,n>>>0>f>>>0&n>>>0<2147483647)){if(0|(d=0|i[5967])&&m>>>0<=p>>>0|m>>>0>d>>>0){n=0;break}if((0|(t=0|Ye(0|n)))==(0|r)){A=n,s=r,g=145;break t}a=t,g=136}else n=0}while(0);do{if(136==(0|g)){if(r=0-n|0,!(l>>>0>n>>>0&n>>>0<2147483647&-1!=(0|a))){if(-1==(0|a)){n=0;break}A=n,s=a,g=145;break t}if((t=c-n+(t=0|i[5977])&0-t)>>>0>=2147483647){A=n,s=a,g=145;break t}if(-1==(0|Ye(0|t))){Ye(0|r),n=0;break}A=t+n|0,s=a,g=145;break t}}while(0);i[5968]=4|i[5968],g=143}}while(0);if(143==(0|g)&&u>>>0<2147483647&&!(-1==(0|(y=0|Ye(0|u)))|1^(_=(v=(m=0|Ye(0))-y|0)>>>0>(f+40|0)>>>0)|y>>>0<m>>>0&-1!=(0|y)&-1!=(0|m)^1)&&(A=_?v:n,s=y,g=145),145==(0|g)){n=(0|i[5965])+A|0,i[5965]=n,n>>>0>(0|i[5966])>>>0&&(i[5966]=n),c=0|i[5863];t:do{if(c){for(n=23876;;){if((0|s)==((t=0|i[n>>2])+(r=0|i[n+4>>2])|0)){g=154;break}if(!(a=0|i[n+8>>2]))break;n=a}if(!(154!=(0|g)||(x=n+4|0,8&i[n+12>>2]))&&s>>>0>c>>>0&t>>>0<=c>>>0){i[x>>2]=r+A,x=c+(y=7&(y=c+8|0)?0-y&7:0)|0,y=(b=(0|i[5860])+A|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[c+b+4>>2]=40,i[5864]=i[5979];break}for(s>>>0<(0|i[5861])>>>0&&(i[5861]=s),r=s+A|0,n=23876;;){if((0|i[n>>2])==(0|r)){g=162;break}if(!(t=0|i[n+8>>2]))break;n=t}if(162==(0|g)&&!(8&i[n+12>>2])){i[n>>2]=s,i[(h=n+4|0)>>2]=(0|i[h>>2])+A,u=(h=s+(7&(h=s+8|0)?0-h&7:0)|0)+f|0,l=(n=r+(7&(n=r+8|0)?0-n&7:0)|0)-h-f|0,i[h+4>>2]=3|f;e:do{if((0|c)==(0|n))b=(0|i[5860])+l|0,i[5860]=b,i[5863]=u,i[u+4>>2]=1|b;else{if((0|i[5862])==(0|n)){b=(0|i[5859])+l|0,i[5859]=b,i[5862]=u,i[u+4>>2]=1|b,i[u+b>>2]=b;break}if(1==(3&(t=0|i[n+4>>2]))){A=-8&t,a=t>>>3;n:do{if(t>>>0<256){if(t=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|t)){i[5857]=i[5857]&~(1<<a);break}i[t+12>>2]=r,i[r+8>>2]=t;break}s=0|i[n+24>>2],t=0|i[n+12>>2];do{if((0|t)==(0|n)){if(t=0|i[(a=(r=n+16|0)+4|0)>>2])r=a;else if(!(t=0|i[r>>2])){t=0;break}for(;;)if(a=0|i[(o=t+20|0)>>2])t=a,r=o;else{if(!(a=0|i[(o=t+16|0)>>2]))break;t=a,r=o}i[r>>2]=0}else b=0|i[n+8>>2],i[b+12>>2]=t,i[t+8>>2]=b}while(0);if(!s)break;a=23732+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[a>>2])==(0|n)){if(i[a>>2]=t,0|t)break;i[5858]=i[5858]&~(1<<r);break n}if(i[((0|i[(b=s+16|0)>>2])==(0|n)?b:s+20)>>2]=t,!t)break n}while(0);if(i[t+24>>2]=s,0|(a=0|i[(r=n+16|0)>>2])&&(i[t+16>>2]=a,i[a+24>>2]=t),!(r=0|i[r+4>>2]))break;i[t+20>>2]=r,i[r+24>>2]=t}while(0);n=n+A|0,o=A+l|0}else o=l;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[u+4>>2]=1|o,i[u+o>>2]=o,n=o>>>3,o>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=u,i[n+12>>2]=u,i[u+8>>2]=n,i[u+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){a=31;break}a=o>>>((a=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(a=((b<<=y)+245760|0)>>>16&2))+(b<<a>>>15)|0)+7|0)&1|a<<1}else a=0}while(0);if(n=23732+(a<<2)|0,i[u+28>>2]=a,i[(t=u+16|0)+4>>2]=0,i[t>>2]=0,!((t=0|i[5858])&(r=1<<a))){i[5858]=t|r,i[n>>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2])!=(0|o)){for(a=o<<(31==(0|a)?0:25-(a>>>1));t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|o)){n=t;break n}a<<=1,n=t}i[r>>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break e}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=u,i[x>>2]=u,i[u+8>>2]=b,i[u+12>>2]=n,i[u+24>>2]=0}}while(0);return D=e,0|(b=h+8|0)}for(n=23876;!((t=0|i[n>>2])>>>0<=c>>>0&&(b=t+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(t=(t=(o=b+-47|0)+(7&(t=o+8|0)?0-t&7:0)|0)>>>0<(o=c+16|0)>>>0?c:t)+8|0,x=s+(y=7&(y=s+8|0)?0-y&7:0)|0,y=(r=A+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[s+r+4>>2]=40,i[5864]=i[5979],i[(r=t+4|0)>>2]=27,i[n>>2]=i[5969],i[n+4>>2]=i[5970],i[n+8>>2]=i[5971],i[n+12>>2]=i[5972],i[5969]=s,i[5970]=A,i[5972]=0,i[5971]=n,n=t+24|0;do{x=n,i[(n=n+4|0)>>2]=7}while((x+8|0)>>>0<b>>>0);if((0|t)!=(0|c)){if(s=t-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|s,i[t>>2]=s,n=s>>>3,s>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=23732+((a=(n=s>>>8)?s>>>0>16777215?31:s>>>((a=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(a=((b<<=y)+245760|0)>>>16&2))+(b<<a>>>15)|0)+7|0)&1|a<<1:0)<<2)|0,i[c+28>>2]=a,i[c+20>>2]=0,i[o>>2]=0,!((n=0|i[5858])&(t=1<<a))){i[5858]=n|t,i[r>>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];e:do{if((-8&i[n+4>>2])!=(0|s)){for(a=s<<(31==(0|a)?0:25-(a>>>1));t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|s)){n=t;break e}a<<=1,n=t}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=c,i[x>>2]=c,i[c+8>>2]=b,i[c+12>>2]=n,i[c+24>>2]=0}}else!(0|(b=0|i[5861]))|s>>>0<b>>>0&&(i[5861]=s),i[5969]=s,i[5970]=A,i[5972]=0,i[5866]=i[5975],i[5865]=-1,i[5870]=23468,i[5869]=23468,i[5872]=23476,i[5871]=23476,i[5874]=23484,i[5873]=23484,i[5876]=23492,i[5875]=23492,i[5878]=23500,i[5877]=23500,i[5880]=23508,i[5879]=23508,i[5882]=23516,i[5881]=23516,i[5884]=23524,i[5883]=23524,i[5886]=23532,i[5885]=23532,i[5888]=23540,i[5887]=23540,i[5890]=23548,i[5889]=23548,i[5892]=23556,i[5891]=23556,i[5894]=23564,i[5893]=23564,i[5896]=23572,i[5895]=23572,i[5898]=23580,i[5897]=23580,i[5900]=23588,i[5899]=23588,i[5902]=23596,i[5901]=23596,i[5904]=23604,i[5903]=23604,i[5906]=23612,i[5905]=23612,i[5908]=23620,i[5907]=23620,i[5910]=23628,i[5909]=23628,i[5912]=23636,i[5911]=23636,i[5914]=23644,i[5913]=23644,i[5916]=23652,i[5915]=23652,i[5918]=23660,i[5917]=23660,i[5920]=23668,i[5919]=23668,i[5922]=23676,i[5921]=23676,i[5924]=23684,i[5923]=23684,i[5926]=23692,i[5925]=23692,i[5928]=23700,i[5927]=23700,i[5930]=23708,i[5929]=23708,i[5932]=23716,i[5931]=23716,x=s+(y=7&(y=s+8|0)?0-y&7:0)|0,y=(b=A+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[s+b+4>>2]=40,i[5864]=i[5979]}while(0);if((n=0|i[5860])>>>0>f>>>0)return y=n-f|0,i[5860]=y,x=(b=0|i[5863])+f|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|f,D=e,0|(b=b+8|0)}return i[(b=23424)>>2]=12,D=e,0|(b=0)}function Pe(t){var e=0,n=0,r=0,a=0,o=0,s=0,A=0,l=0;if(t|=0){n=t+-8|0,a=0|i[5861],l=n+(e=-8&(t=0|i[t+-4>>2]))|0;do{if(1&t)A=n,s=n;else{if(r=0|i[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<a>>>0)return;if((0|i[5862])==(0|s)){if(3&~(e=0|i[(t=l+4|0)>>2])){A=s,e=o;break}return i[5859]=o,i[t>>2]=-2&e,i[s+4>>2]=1|o,void(i[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|i[s+8>>2],(0|(e=0|i[s+12>>2]))==(0|t)){i[5857]=i[5857]&~(1<<n),A=s,e=o;break}i[t+12>>2]=e,i[e+8>>2]=t,A=s,e=o;break}a=0|i[s+24>>2],t=0|i[s+12>>2];do{if((0|t)==(0|s)){if(t=0|i[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){t=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0}else A=0|i[s+8>>2],i[A+12>>2]=t,i[t+8>>2]=A}while(0);if(a){if(e=0|i[s+28>>2],(0|i[(n=23732+(e<<2)|0)>>2])==(0|s)){if(i[n>>2]=t,!t){i[5858]=i[5858]&~(1<<e),A=s,e=o;break}}else if(i[((0|i[(A=a+16|0)>>2])==(0|s)?A:a+20)>>2]=t,!t){A=s,e=o;break}i[t+24>>2]=a,0|(n=0|i[(e=s+16|0)>>2])&&(i[t+16>>2]=n,i[n+24>>2]=t),(e=0|i[e+4>>2])?(i[t+20>>2]=e,i[e+24>>2]=t,A=s,e=o):(A=s,e=o)}else A=s,e=o}}while(0);if(!(s>>>0>=l>>>0)&&1&(r=0|i[(t=l+4|0)>>2])){if(2&r)i[t>>2]=-2&r,i[A+4>>2]=1|e,i[s+e>>2]=e,a=e;else{if((0|i[5863])==(0|l)){if(l=(0|i[5860])+e|0,i[5860]=l,i[5863]=A,i[A+4>>2]=1|l,(0|A)!=(0|i[5862]))return;return i[5862]=0,void(i[5859]=0)}if((0|i[5862])==(0|l))return l=(0|i[5859])+e|0,i[5859]=l,i[5862]=s,i[A+4>>2]=1|l,void(i[s+l>>2]=l);a=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|i[l+8>>2],(0|(t=0|i[l+12>>2]))==(0|e)){i[5857]=i[5857]&~(1<<n);break}i[e+12>>2]=t,i[t+8>>2]=e;break}o=0|i[l+24>>2],t=0|i[l+12>>2];do{if((0|t)==(0|l)){if(t=0|i[(n=(e=l+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){n=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0,n=t}else n=0|i[l+8>>2],i[n+12>>2]=t,i[t+8>>2]=n,n=t}while(0);if(0|o){if(t=0|i[l+28>>2],(0|i[(e=23732+(t<<2)|0)>>2])==(0|l)){if(i[e>>2]=n,!n){i[5858]=i[5858]&~(1<<t);break}}else if(i[((0|i[(r=o+16|0)>>2])==(0|l)?r:o+20)>>2]=n,!n)break;i[n+24>>2]=o,0|(e=0|i[(t=l+16|0)>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),0|(t=0|i[t+4>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);if(i[A+4>>2]=1|a,i[s+a>>2]=a,(0|A)==(0|i[5862]))return void(i[5859]=a)}if(t=a>>>3,a>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|i[5857])&(t=1<<t)?t=0|i[(e=n+8|0)>>2]:(i[5857]=e|t,t=n,e=n+8|0),i[e>>2]=A,i[t+12>>2]=A,i[A+8>>2]=t,void(i[A+12>>2]=n);t=23732+((r=(t=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((o=((l=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((l<<=o)+245760|0)>>>16&2))+(l<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[A+28>>2]=r,i[A+20>>2]=0,i[A+16>>2]=0,e=0|i[5858],n=1<<r;t:do{if(e&n){t=0|i[t>>2];e:do{if((-8&i[t+4>>2])!=(0|a)){for(r=a<<(31==(0|r)?0:25-(r>>>1));e=0|i[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|a)){t=e;break e}r<<=1,t=e}i[n>>2]=A,i[A+24>>2]=t,i[A+12>>2]=A,i[A+8>>2]=A;break t}}while(0);l=0|i[(s=t+8|0)>>2],i[l+12>>2]=A,i[s>>2]=A,i[A+8>>2]=l,i[A+12>>2]=t,i[A+24>>2]=0}else i[5858]=e|n,i[t>>2]=A,i[A+24>>2]=t,i[A+12>>2]=A,i[A+8>>2]=A}while(0);if(l=(0|i[5865])-1|0,i[5865]=l,!(0|l)){for(t=23884;t=0|i[t>>2];)t=t+8|0;i[5865]=-1}}}}function Le(t,e){e|=0;var n=0;return(t|=0)?(n=0|y(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|Re(n))&&3&i[t+-4>>2]?(Xe(0|t,0,0|n),0|t):0|t}function De(t,e,n,r){return 0|(w((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Oe(t,e,n,r){return 0|(w(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Ie(t){return 0|((t|=0)?31-(0|M(t^t-1)):32)}function qe(t,e,n,r,a){a|=0;var o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0;if(u=t|=0,s=n|=0,A=f=r|=0,!(c=l=e|=0))return o=!!(0|a),A?o?(i[a>>2]=0|t,i[a+4>>2]=0,a=0,0|(w(0|(f=0)),a)):(a=0,0|(w(0|(f=0)),a)):(o&&(i[a>>2]=(u>>>0)%(s>>>0),i[a+4>>2]=0),a=(u>>>0)/(s>>>0)>>>0,0|(w(0|(f=0)),a));o=!(0|A);do{if(s){if(!o){if((o=(0|M(0|A))-(0|M(0|c))|0)>>>0<=31){s=h=o+1|0,t=u>>>(h>>>0)&(e=o-31>>31)|c<<(A=31-o|0),e&=c>>>(h>>>0),o=0,A=u<<A;break}return a?(i[a>>2]=0|t,i[a+4>>2]=0|l,a=0,0|(w(0|(f=0)),a)):(a=0,0|(w(0|(f=0)),a))}if((o=s-1|0)&s){s=A=33+(0|M(0|s))-(0|M(0|c))|0,t=(h=32-A|0)-1>>31&c>>>((d=A-32|0)>>>0)|(c<<h|u>>>(A>>>0))&(e=d>>31),e&=c>>>(A>>>0),o=u<<(p=64-A|0)&(l=h>>31),A=(c<<p|u>>>(d>>>0))&l|u<<h&A-33>>31;break}return 0|a&&(i[a>>2]=o&u,i[a+4>>2]=0),1==(0|s)?(p=0|t,0|(w(0|(d=0|l)),p)):(d=c>>>((p=0|Ie(0|s))>>>0)|0,p=c<<32-p|u>>>(p>>>0),0|(w(0|d),p))}if(o)return 0|a&&(i[a>>2]=(c>>>0)%(s>>>0),i[a+4>>2]=0),p=(c>>>0)/(s>>>0)>>>0,0|(w(0|(d=0)),p);if(!u)return 0|a&&(i[a>>2]=0,i[a+4>>2]=(c>>>0)%(A>>>0)),p=(c>>>0)/(A>>>0)>>>0,0|(w(0|(d=0)),p);if(!((o=A-1|0)&A))return 0|a&&(i[a>>2]=0|t,i[a+4>>2]=o&c),d=0,p=c>>>((0|Ie(0|A))>>>0),0|(w(0|d),p);if((o=(0|M(0|A))-(0|M(0|c))|0)>>>0<=30){s=e=o+1|0,t=c<<(A=31-o|0)|u>>>(e>>>0),e=c>>>(e>>>0),o=0,A=u<<A;break}return a?(i[a>>2]=0|t,i[a+4>>2]=0|l,p=0,0|(w(0|(d=0)),p)):(p=0,0|(w(0|(d=0)),p))}while(0);if(s){c=0|De(0|(h=0|n),0|(u=0|f),-1,-1),n=0|E(),l=A,A=0;do{r=l,l=o>>>31|l<<1,o=A|o<<1,Oe(0|c,0|n,0|(r=t<<1|r>>>31),0|(f=t>>>31|e<<1)),A=1&(d=(p=0|E())>>31|((0|p)<0?-1:0)<<1),t=0|Oe(0|r,0|f,d&h,(((0|p)<0?-1:0)>>31|((0|p)<0?-1:0)<<1)&u),e=0|E(),s=s-1|0}while(0|s);c=l,l=0}else c=A,l=0,A=0;return s=0,0|a&&(i[a>>2]=t,i[a+4>>2]=e),p=o<<1&-2|A,0|(w(0|(d=(0|o)>>>31|(c|s)<<1|l)),p)}function Ue(t,e,n,r){n|=0;var i,a,o,s,A;return a=(r|=0)>>31|((0|r)<0?-1:0)<<1,i=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|Oe((A=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|A,0|s),t=a^A,e=i^s,0|Oe(qe(o,0|E(),0|Oe(a^n,i^r,0|a,0|i),0|E(),0)^t,E()^e,0|t,0|e)}function Ne(t,e,n,r){e|=0,r|=0;var i,a;return n=0|function(t,e){var n,r,i,a=0;return t=((n=0|y(a=65535&(e|=0),i=65535&(t|=0)))>>>16)+(0|y(a,r=t>>>16))|0,e=0|y(a=e>>>16,i),0|(w((t>>>16)+(0|y(a,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(i=t|=0,a=n|=0),t=0|E(),0|(w((0|y(e,a))+(0|y(r,i))+t|0),n)}function Be(t,e,n,r){n|=0;var a,o,s,A,l,c;return a=D,D=D+16|0,A=0|a,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,l=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,qe(t=0|Oe((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|s,0|o),e=0|E(),0|Oe(c^n,l^r,0|c,0|l),0|E(),A),r=0|Oe(i[A>>2]^s,i[A+4>>2]^o,0|s,0|o),n=0|E(),D=a,0|(w(0|n),r)}function ke(t,e,n,r){var a,o;return o=D,D=D+16|0,qe(t|=0,e|=0,n|=0,r|=0,a=0|o),D=o,0|(w(0|i[a+4>>2]),i[a>>2])}function Fe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(w(0|((0|e)<0?-1:0)),e>>n-32)}function ze(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(w(0),e>>>n-32|0)}function Ge(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(w(t<<n-32),0)}function He(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+b(+t,+e)}function je(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+x(+t,+e)}function Ve(t){return(t=+t)>=0?+A(t+.5):+_(t-.5)}function We(t,e,n){t|=0,e|=0;var a,o,s=0;if((0|(n|=0))>=8192)return R(0|t,0|e,0|n),0|t;if(o=0|t,a=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|o;r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(s=(n=-4&a)-64|0;(0|t)<=(0|s);)i[t>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2],i[t+16>>2]=i[e+16>>2],i[t+20>>2]=i[e+20>>2],i[t+24>>2]=i[e+24>>2],i[t+28>>2]=i[e+28>>2],i[t+32>>2]=i[e+32>>2],i[t+36>>2]=i[e+36>>2],i[t+40>>2]=i[e+40>>2],i[t+44>>2]=i[e+44>>2],i[t+48>>2]=i[e+48>>2],i[t+52>>2]=i[e+52>>2],i[t+56>>2]=i[e+56>>2],i[t+60>>2]=i[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}else for(n=a-4|0;(0|t)<(0|n);)r[t|0]=0|r[e|0],r[t+1|0]=0|r[e+1|0],r[t+2|0]=0|r[e+2|0],r[t+3|0]=0|r[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|a);)r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0;return 0|o}function Xe(t,e,n){e|=0;var a,o=0,s=0,A=0;if(a=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t|0]=e,t=t+1|0;for(A=e|e<<8|e<<16|e<<24,s=(o=-4&a)-64|0;(0|t)<=(0|s);)i[t>>2]=A,i[t+4>>2]=A,i[t+8>>2]=A,i[t+12>>2]=A,i[t+16>>2]=A,i[t+20>>2]=A,i[t+24>>2]=A,i[t+28>>2]=A,i[t+32>>2]=A,i[t+36>>2]=A,i[t+40>>2]=A,i[t+44>>2]=A,i[t+48>>2]=A,i[t+52>>2]=A,i[t+56>>2]=A,i[t+60>>2]=A,t=t+64|0;for(;(0|t)<(0|o);)i[t>>2]=A,t=t+4|0}for(;(0|t)<(0|a);)r[t|0]=e,t=t+1|0;return a-n|0}function Qe(t){return(t=+t)>=0?+A(t+.5):+_(t-.5)}function Ye(t){t|=0;var e,n,r;return r=0|C(),(0|t)>0&(0|(e=(n=0|i[s>>2])+t|0))<(0|n)|(0|e)<0?(L(0|e),T(12),-1):(0|e)>(0|r)&&!(0|P(0|e))?(T(12),-1):(i[s>>2]=e,0|n)}return{___divdi3:Ue,___muldi3:Ne,___remdi3:Be,___uremdi3:ke,_areNeighborCells:function(t,e,n,r,a){a|=0;var o,s,A,l=0,c=0,u=0,h=0;if(A=D,D=D+64|0,s=A,o=A+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(r|=0))))return D=A,0|(a=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return i[a>>2]=0,D=A,0|(a=0);if(c=0|ze(0|t,0|e,52),E(),c&=15,h=0|ze(0|n,0|r,52),E(),(0|c)!=(15&h))return D=A,0|(a=12);if(l=c+-1|0,c>>>0>1){qt(t,e,l,s),qt(n,r,l,o),u=0|i[(h=s)>>2],h=0|i[h+4>>2];t:do{if((0|u)==(0|i[o>>2])&&(0|h)==(0|i[o+4>>2])){l=0|ze(0|t,0|e,0|(c=3*(15^c)|0)),E(),l&=7,c=0|ze(0|n,0|r,0|c),E(),c&=7;do{if(!(0|l)|!(0|c))i[a>>2]=1,l=0;else if(7==(0|l))l=5;else{if(1==(0|l)|1==(0|c)&&0|Nt(u,h)){l=5;break}if((0|i[15536+(l<<2)>>2])!=(0|c)&&(0|i[15568+(l<<2)>>2])!=(0|c))break t;i[a>>2]=1,l=0}}while(0);return D=A,0|(a=l)}}while(0)}c=(l=s)+56|0;do{i[l>>2]=0,l=l+4|0}while((0|l)<(0|c));return O(t,e,1,s),l=(0|i[(e=s)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+8|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+16|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+24|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+32|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+40|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)?1:1&((0|i[(l=s+48|0)>>2])==(0|n)?(0|i[l+4>>2])==(0|r):0),i[a>>2]=l,D=A,0|(a=0)},_bitshift64Ashr:Fe,_bitshift64Lshr:ze,_bitshift64Shl:Ge,_calloc:Le,_cellAreaKm2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(a[n>>3]=6371.007180918475*+a[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(a[n>>3]=6371.007180918475*+a[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:re,_cellToBoundary:Qt,_cellToCenterChild:function(t,e,n,r){n|=0,r|=0;var a=0;return a=0|ze(0|(t|=0),0|(e|=0),52),E(),(0|n)<16&(0|(a&=15))<=(0|n)?((0|a)<(0|n)&&(a=0|Ge(-1,-1,3+(3*(n+-1-a|0)|0)|0),a=0|Ge(0|~a,0|~E(),3*(15-n|0)|0),e=~E()&e,t&=~a),a=0|Ge(0|n,0,52),n=-15728641&e|E(),i[r>>2]=t|a,i[r+4>>2]=n,0|(r=0)):0|(r=4)},_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0;if(a=D,D=D+16|0,v=a,_=0|ze(0|(t|=0),0|(e|=0),52),E(),_&=15,n>>>0>15)return D=a,0|(_=4);if((0|_)<(0|n))return D=a,0|(_=12);if((0|_)!=(0|n))if(s=0|Ge(0|n,0,52),s|=t,l=E()|-15728641&e,(0|_)>(0|n)){c=n;do{g=0|Ge(7,0,3*(14-c|0)|0),c=c+1|0,s|=g,l=E()|l}while((0|c)<(0|_));g=s}else g=s;else g=t,l=e;m=0|ze(0|g,0|l,45),E();t:do{if(0|F(127&m)){if(c=0|ze(0|g,0|l,52),E(),0|(c&=15))for(s=1;;){if(!(!((m=0|Ge(7,0,3*(15-s|0)|0))&g)&!(E()&l))){u=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0}if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(m=-15728641&e,p=_;;){if(d=p,(p=p+-1|0)>>>0>15|(0|_)<(0|p)){u=19;break}if((0|_)!=(0|p))if(s=0|Ge(0|p,0,52),s|=t,c=E()|m,(0|_)<(0|d))f=s;else{u=p;do{f=0|Ge(7,0,3*(14-u|0)|0),u=u+1|0,s|=f,c=E()|c}while((0|u)<(0|_));f=s}else f=t,c=e;if(h=0|ze(0|f,0|c,45),E(),0|F(127&h)){h=0|ze(0|f,0|c,52),E(),h&=15;e:do{if(h)for(u=1;;){if(s=0|ze(0|f,0|c,3*(15-u|0)|0),E(),0|(s&=7))break e;if(!(u>>>0<h>>>0)){s=0;break}u=u+1|0}else s=0}while(0);s=1&!(0|s)}else s=0;if(c=0|ze(0|t,0|e,3*(15-d|0)|0),E(),7==(0|(c&=7))){o=5,u=42;break}if(1==(0|c)&(s=!!(0|s))){o=5,u=42;break}if(0|(f=c+((!!(0|c)&s)<<31>>31)|0)&&(u=0|ue(7,0,u=_-d|0,((0|u)<0)<<31>>31),h=0|E(),s?(s=0|De(0|(s=0|Ne(0|u,0|h,5,0)),0|E(),-5,-1),s=0|De(0|(s=0|Ue(0|s,0|E(),6,0)),0|E(),1,0),c=0|E()):(s=u,c=h),d=0|De(0|s,0|c,0|(d=0|Ne(0|u,0|h,0|(d=f+-1|0),((0|d)<0)<<31>>31)),0|E()),h=0|De(0|d,0|(f=0|E()),0|i[(h=r)>>2],0|i[h+4>>2]),f=0|E(),i[(d=r)>>2]=h,i[d+4>>2]=f),(0|p)<=(0|n)){u=37;break}}if(19==(0|u))S(23313,22674,1099,22710);else{if(37==(0|u)){o=0|i[(A=r)+4>>2],A=0|i[A>>2];break}if(42==(0|u))return D=a,0|o}}else o=0,A=0}else u=33}while(0);t:do{if(33==(0|u)){if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(s=_;;){if(o=0|ze(0|t,0|e,3*(15-s|0)|0),E(),7==(0|(o&=7))){o=5;break}if(o=0|Ne(0|(A=0|ue(7,0,A=_-s|0,((0|A)<0)<<31>>31)),0|E(),0|o,0),A=0|E(),A=0|De(0|i[(m=r)>>2],0|i[m+4>>2],0|o,0|A),o=0|E(),i[(m=r)>>2]=A,i[m+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return D=a,0|o}o=0,A=0}}while(0);return 0|Ut(g,l,_,v)&&S(23313,22674,1063,22725),((0|o)>-1|-1==(0|o)&A>>>0>4294967295)&((0|(v=0|i[(_=v)+4>>2]))>(0|o)|((0|v)==(0|o)?(0|i[_>>2])>>>0>A>>>0:0))?(D=a,0|(_=0)):(S(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,r){r|=0;var a,o,s=0,A=0;if(o=D,D=D+16|0,Zt(a=o,t|=0,e|=0,n|=0),!(0|(t=0|i[(e=a)>>2]))&!(0|(e=0|i[e+4>>2])))return D=o,0;s=0,n=0;do{i[(A=r+(s<<3)|0)>>2]=t,i[A+4>>2]=e,s=0|De(0|s,0|n,1,0),n=0|E(),Kt(a),t=0|i[(A=a)>>2],e=0|i[A+4>>2]}while(!(!(0|t)&!(0|e)));return D=o,0},_cellToChildrenSize:Ut,_cellToLatLng:Xt,_cellToLocalIj:function(t,e,n,r,i,a){var o,s;return t|=0,e|=0,n|=0,r|=0,a|=0,s=D,D=D+16|0,o=s,(i|=0)?t=15:(t=0|le(t,e,n,r,o))||(_t(o,a),t=0),D=s,0|t},_cellToParent:qt,_cellToVertex:ye,_cellToVertexes:function(t,e,n){n|=0;var r,a=0,o=0;return o=!(0|Nt(t|=0,e|=0)),r=!(0|(a=0|ye(t,e,0,n))),o?r?0|(a=0|ye(t,e,1,n+8|0))||0|(a=0|ye(t,e,2,n+16|0))||0|(a=0|ye(t,e,3,n+24|0))||(a=0|ye(t,e,4,n+32|0))?0|(o=a):0|ye(t,e,5,n+40|0):0|(o=a):r?0|(a=0|ye(t,e,1,n+8|0))||0|(a=0|ye(t,e,2,n+16|0))||0|(a=0|ye(t,e,3,n+24|0))||0|(a=0|ye(t,e,4,n+32|0))?0|(o=a):(i[(o=n+40|0)>>2]=0,i[o+4>>2]=0,0|(o=0)):0|(o=a)},_cellsToDirectedEdge:function(t,e,n,r,a){return a|=0,7==(0|(n=0|B(t|=0,e|=0,n|=0,r|=0)))?0|(a=11):(r=0|Ge(0|n,0,56),e=-2130706433&e|E()|268435456,i[a>>2]=t|r,i[a+4>>2]=e,0|(a=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,a,o,s=0;if(o=D,D=D+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,a,o=0,s=0,A=0,l=0,c=0,u=0;if(a=D,D=D+176|0,r=a,(0|(e|=0))<1)return xe(n,0,0),D=a,0;for(c=0|ze(0|i[(c=t)>>2],0|i[c+4>>2],52),E(),xe(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Qt(0|i[(o=t+(c<<3)|0)>>2],0|i[o+4>>2],r)));){if((0|(o=0|i[r>>2]))>0){l=0;do{A=r+8+(l<<4)|0,(s=0|Se(n,o=r+8+((0|(l=l+1|0))%(0|o)<<4)|0,A))?we(n,s):Ee(n,A,o),o=0|i[r>>2]}while((0|l)<(0|o))}if((0|(c=c+1|0))>=(0|e)){o=0,u=13;break}}return 13==(0|u)?(D=a,0|o):(be(n),D=a,0|(u=o))}(t|=0,e|=0,a=o+16|0),0|t)return D=o,0|(n=t);if(i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,0|(t=0|Me(a)))do{e=0|ie(n);do{ae(e,t),s=t+16|0,i[r>>2]=i[s>>2],i[r+4>>2]=i[s+4>>2],i[r+8>>2]=i[s+8>>2],i[r+12>>2]=i[s+12>>2],we(a,t),t=0|Te(a,r)}while(0|t);t=0|Me(a)}while(0|t);return be(a),(t=0|se(n))?(oe(n),D=o,0|(s=t)):(D=o,0|(s=0))},_childPosToCell:function(t,e,n,r,a,o){t|=0,e|=0,o|=0;var s,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0;if(s=D,D=D+16|0,A=s,(a|=0)>>>0>15)return D=s,0|(o=4);if(l=0|ze(0|(n|=0),0|(r|=0),52),E(),(0|(l&=15))>(0|a))return D=s,0|(o=12);if(0|Ut(n,r,a,A)&&S(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(u=0|i[(h=A)+4>>2]))>(0|e)|((0|u)==(0|e)?(0|i[h>>2])>>>0>t>>>0:0))))return D=s,0|(o=2);h=a-l|0,a=0|Ge(0|a,0,52),c=E()|-15728641&r,i[(u=o)>>2]=a|n,i[u+4>>2]=c,u=0|ze(0|n,0|r,45),E();t:do{if(0|F(127&u)){if(0|l)for(A=1;;){if(!(!((u=0|Ge(7,0,3*(15-A|0)|0))&n)&!(E()&r)))break t;if(!(A>>>0<l>>>0))break;A=A+1|0}if((0|h)<1)return D=s,0|(o=0);for(u=15^l,r=-1,c=1,A=1;;){l=0|ue(7,0,l=h-c|0,((0|l)<0)<<31>>31),n=0|E();do{if(A){if(A=0|Ue(0|(A=0|De(0|(A=0|Ne(0|l,0|n,5,0)),0|E(),-5,-1)),0|E(),6,0),(0|e)>(0|(a=0|E()))|(0|e)==(0|a)&t>>>0>A>>>0){e=0|Oe(0|(e=0|De(0|t,0|e,-1,-1)),0|E(),0|A,0|a),A=0|E(),p=0|i[(f=o)>>2],f=0|i[f+4>>2],d=0|Ge(7,0,0|(m=3*(u+r|0)|0)),f&=~E(),m=0|Ge(0|(a=0|De(0|(r=0|Ue(0|e,0|A,0|l,0|n)),0|(t=0|E()),2,0)),0|E(),0|m),f=E()|f,i[(a=o)>>2]=m|p&~d,i[a+4>>2]=f,t=0|Oe(0|e,0|A,0|(t=0|Ne(0|r,0|t,0|l,0|n)),0|E()),A=0,e=0|E();break}d=0|i[(m=o)>>2],m=0|i[m+4>>2],p=0|Ge(7,0,3*(u+r|0)|0),m&=~E(),i[(A=o)>>2]=d&~p,i[A+4>>2]=m,A=1;break}a=0|i[(d=o)>>2],d=0|i[d+4>>2],f=0|Ge(7,0,0|(r=3*(u+r|0)|0)),d&=~E(),r=0|Ge(0|(m=0|Ue(0|t,0|e,0|l,0|n)),0|(A=0|E()),0|r),d=E()|d,i[(p=o)>>2]=r|a&~f,i[p+4>>2]=d,t=0|Oe(0|t,0|e,0|(A=0|Ne(0|m,0|A,0|l,0|n)),0|E()),A=0,e=0|E()}while(0);if(!((0|h)>(0|c))){e=0;break}r=~c,c=c+1|0}return D=s,0|e}}while(0);if((0|h)<1)return D=s,0|(m=0);for(a=15^l,A=1;;){if(p=0|ue(7,0,p=h-A|0,((0|p)<0)<<31>>31),m=0|E(),n=0|i[(c=o)>>2],c=0|i[c+4>>2],r=0|Ge(7,0,0|(l=3*(a-A|0)|0)),c&=~E(),l=0|Ge(0|(f=0|Ue(0|t,0|e,0|p,0|m)),0|(d=0|E()),0|l),c=E()|c,i[(u=o)>>2]=l|n&~r,i[u+4>>2]=c,t=0|Oe(0|t,0|e,0|(m=0|Ne(0|f,0|d,0|p,0|m)),0|E()),e=0|E(),(0|h)<=(0|A)){e=0;break}A=A+1|0}return D=s,0|e},_compactCells:function(t,e,n,r){e|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,T=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(w=0);if(s=0|i[(o=t|=0)>>2],!0&!(15728640&(o=0|i[o+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(w=0);if(i[(w=e)>>2]=s,i[w+4>>2]=o,1==(0|n)&!(0|r))return 0|(w=0);o=1;do{M=0|i[(b=t+(o<<3)|0)+4>>2],i[(w=e+(o<<3)|0)>>2]=i[b>>2],i[w+4>>2]=M,o=o+1|0}while(0<(0|r)|!(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(M=0|Re(a=n<<3)))return 0|(w=13);if(We(0|M,0|t,0|a),!(b=0|Le(n,8)))return Pe(M),0|(w=13);t:do{if(0|n){e:for(;;){y=0|ze(0|(_=0|i[(o=M)>>2]),0|(o=0|i[o+4>>2]),52),E(),x=(y&=15)+-1|0,v=(0|n)>0;n:do{if(!!(0|y)&v){if(p=((0|n)<0)<<31>>31,m=0|Ge(0|x,0,52),g=0|E(),x>>>0>15){if(!(!(0|_)&!(0|o))){w=17;break e}for(s=0;;){if((0|(s=s+1|0))>=(0|n))break n;if(!(!(0|(g=0|i[(r=M+(s<<3)|0)>>2]))&!(0|(r=0|i[r+4>>2])))){o=r,w=17;break e}}}for(s=0,t=_,r=o;;){if(!(!(0|t)&!(0|r))){if(!(!0&!(117440512&r))){w=22;break e}if(l=0|ze(0|t,0|r,52),E(),(0|(l&=15))<(0|x)){o=12,w=28;break e}if((0|l)!=(0|x)&&(t|=m,r=-15728641&r|g,l>>>0>=y>>>0)){A=x;do{d=0|Ge(7,0,3*(14-A|0)|0),A=A+1|0,t|=d,r=E()|r}while(A>>>0<l>>>0)}if(A=0|ke(0|t,0|r,0|n,0|p),E(),!(0|(c=0|i[(l=u=b+(A<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2])))A=u;else for(d=0;;){if((0|d)>(0|n)){w=32;break e}if((0|c)==(0|t)&(-117440513&l)==(0|r)){h=0|ze(0|c,0|l,56),E(),f=(h&=7)+1|0,T=0|ze(0|c,0|l,45),E();r:do{if(0|F(127&T)){if(c=0|ze(0|c,0|l,52),E(),!(c&=15)){l=6;break}for(l=1;;){if(!(!((T=0|Ge(7,0,3*(15-l|0)|0))&t)&!(E()&r))){l=7;break r}if(!(l>>>0<c>>>0)){l=6;break}l=l+1|0}}else l=7}while(0);if((h+2|0)>>>0>l>>>0){w=42;break e}T=0|Ge(0|f,0,56),r=E()|-117440513&r,i[(f=u)>>2]=0,i[f+4>>2]=0,t|=T}else A=(A+1|0)%(0|n)|0;if(!(0|(c=0|i[(l=u=b+(A<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2]))){A=u;break}d=d+1|0}i[(T=A)>>2]=t,i[T+4>>2]=r}if((0|(s=s+1|0))>=(0|n))break n;t=0|i[(r=M+(s<<3)|0)>>2],r=0|i[r+4>>2]}}}while(0);if((n+5|0)>>>0<11){w=85;break}if(!(g=0|Le((0|n)/6|0,8))){w=49;break}n:do{if(v){d=0,f=0;do{if(!(!(0|(s=0|i[(r=l=b+(d<<3)|0)>>2]))&!(0|(r=0|i[r+4>>2])))){c=0|ze(0|s,0|r,56),E(),t=(c&=7)+1|0,u=-117440513&r,T=0|ze(0|s,0|r,45),E();r:do{if(0|F(127&T)){if(h=0|ze(0|s,0|r,52),E(),0|(h&=15))for(A=1;;){if(!(!(s&(T=0|Ge(7,0,3*(15-A|0)|0)))&!(u&E())))break r;if(!(A>>>0<h>>>0))break;A=A+1|0}s|=r=0|Ge(0|t,0,56),r=E()|u,i[(t=l)>>2]=s,i[t+4>>2]=r,t=c+2|0}}while(0);7==(0|t)&&(i[(T=g+(f<<3)|0)>>2]=s,i[T+4>>2]=-117440513&r,f=f+1|0)}d=d+1|0}while((0|d)!=(0|n));if(v){if(d=((0|n)<0)<<31>>31,p=0|Ge(0|x,0,52),m=0|E(),x>>>0>15){if(!(!(0|_)&!(0|o))){o=4,w=84;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n)){s=0,o=f;break n}if(!(!(0|i[(T=M+(o<<3)|0)>>2])&!(0|i[T+4>>2]))){o=4,w=84;break e}}}for(h=0,s=0,u=_;;){do{if(!(!(0|u)&!(0|o))){if(l=0|ze(0|u,0|o,52),E(),(0|(l&=15))<(0|x)){o=12,w=84;break e}do{if((0|l)==(0|x))r=u,l=o;else{if(r=u|p,t=-15728641&o|m,l>>>0<y>>>0){l=t;break}A=x;do{T=0|Ge(7,0,3*(14-A|0)|0),A=A+1|0,r|=T,t=E()|t}while(A>>>0<l>>>0);l=t}}while(0);for(A=0|ke(0|r,0|l,0|n,0|d),E(),t=0;;){if((0|t)>(0|n)){w=77;break e}if((-117440513&(c=0|i[(T=b+(A<<3)|0)+4>>2]))==(0|l)&&(0|i[T>>2])==(0|r)){w=79;break}if((0|i[(T=b+((A=(A+1|0)%(0|n)|0)<<3)|0)>>2])==(0|r)&&(0|i[T+4>>2])==(0|l))break;t=t+1|0}if(79==(0|w)&&(w=0,!0&100663296==(117440512&c)))break;i[(T=e+(s<<3)|0)>>2]=u,i[T+4>>2]=o,s=s+1|0}}while(0);if((0|(o=h+1|0))>=(0|n)){o=f;break n}h=o,u=0|i[(T=M+(o<<3)|0)>>2],o=0|i[T+4>>2]}}else s=0,o=f}else s=0,o=0}while(0);if(Xe(0|b,0,0|a),We(0|M,0|g,o<<3),Pe(g),!o)break t;e=e+(s<<3)|0,n=o}if(17==(0|w))!0&!(117440512&o)?(o=4,w=28):w=22;else if(32==(0|w))S(23313,22674,362,22684);else{if(42==(0|w))return Pe(M),Pe(b),0|(T=10);if(49==(0|w))return Pe(M),Pe(b),0|(T=13);if(77==(0|w))S(23313,22674,462,22684);else{if(84==(0|w))return Pe(g),Pe(M),Pe(b),0|(T=o);if(85==(0|w)){We(0|e,0|M,n<<3);break}}}if(22==(0|w))return Pe(M),Pe(b),0|(T=5);if(28==(0|w))return Pe(M),Pe(b),0|(T=o)}}while(0);return Pe(M),Pe(b),0|(T=0)},_destroyLinkedMultiPolygon:oe,_directedEdgeToBoundary:Mt,_directedEdgeToCells:function(t,e,n){t|=0;var r,a,o,s=0;return r=D,D=D+16|0,s=r,!0&268435456==(2013265920&(e|=0))?(a=-2130706433&e|134217728,i[(o=n|=0)>>2]=t,i[o+4>>2]=a,i[s>>2]=0,e=0|ze(0|t,0|e,56),E(),s=0|N(t,a,7&e,s,n+8|0),D=r,0|s):(D=r,0|(s=6))},_edgeLengthKm:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,d=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return l=t,A=+a[n>>3],A*=6371.007180918475,a[n>>3]=A,D=r,0|l;if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return l=0,A=0,A*=6371.007180918475,a[n>>3]=A,D=r,0|l;e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{d=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+f(.5*(o-d)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+f(.5*(s-u)))*(+h(+d)*+h(+o)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return a[n>>3]=A,l=0,p=A,p*=6371.007180918475,a[n>>3]=p,D=r,0|l},_edgeLengthM:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,d=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return l=t,A=+a[n>>3],A*=6371.007180918475,A*=1e3,a[n>>3]=A,D=r,0|l;if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return l=0,A=0,A*=6371.007180918475,A*=1e3,a[n>>3]=A,D=r,0|l;e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{d=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+f(.5*(o-d)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+f(.5*(s-u)))*(+h(+d)*+h(+o)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return a[n>>3]=A,l=0,p=A,p*=6371.007180918475,p*=1e3,a[n>>3]=p,D=r,0|l},_edgeLengthRads:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,d=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return D=r,0|(l=t);if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return D=r,0|(l=0);e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{d=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+f(.5*(o-d)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+f(.5*(s-u)))*(+h(+o)*+h(+d)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)))}while((0|t)<(0|e));return a[n>>3]=A,D=r,0|(l=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),i=new Int32Array(t),a=new Float64Array(t),n=t,!0},_free:Pe,_getBaseCellNumber:Ot,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,a,o=0;return r=D,D=D+16|0,i[(o=r)>>2]=0,!0&268435456==(2013265920&e)?(a=0|ze(0|t,0|e,56),E(),o=0|N(t,-2130706433&e|134217728,7&a,o,n),D=r,0|o):(D=r,0|(o=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(i[n>>2]=t,i[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0;a=D,D=D+128|0,h=a+112|0,A=a+96|0,f=a,s=0|ze(0|(e|=0),0|(n|=0),52),E(),c=15&s,i[h>>2]=c,l=0|ze(0|e,0|n,45),E(),l&=127;t:do{if(0|F(l)){if(0|c)for(o=1;;){if(!(!((u=0|Ge(7,0,3*(15-o|0)|0))&e)&!(E()&n))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0}if(!(1&s))return u=0|Ge(c+1|0,0,52),f=E()|-15728641&n,f=0|t((u|e)&~(h=0|Ge(7,0,3*(14-c|0)|0)),f&~E(),r),D=a,0|f;s=1}else s=0}while(0);if(!(o=0|Wt(e,n,A))){s?(Ct(A,h,f),u=5):(Dt(A,h,f),u=6);t:do{if(0|F(l))if(c)for(o=1;;){if(!(!((l=0|Ge(7,0,3*(15-o|0)|0))&e)&!(E()&n))){e=2;break t}if(!(o>>>0<c>>>0)){e=5;break}o=o+1|0}else e=5;else e=2}while(0);Xe(0|r,-1,e<<2);t:do{if(s)for(A=0;;){if(Pt(l=f+(A<<4)|0,0|i[h>>2]),l=0|i[l>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|l))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(i[o>>2]=l,(A=A+1|0)>>>0>=u>>>0){o=0;break}}else for(A=0;;){if(Rt(l=f+(A<<4)|0,0|i[h>>2],0,1),l=0|i[l>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|l))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(i[o>>2]=l,(A=A+1|0)>>>0>=u>>>0){o=0;break}}}while(0)}return D=a,0|(f=o)},_getNumCells:ee,_getPentagons:Yt,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{Ge(0|e,0,45),r=134225919|E(),i[(n=t+(e<<3)|0)>>2]=-1,i[n+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|ze(0|(t|=0),0|(e|=0),52),E(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+f(.5*(r-n)))*i+(o=+f(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+f(.5*(r-n)))*i+(o=+f(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:I,_gridDistance:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s,A=0,l=0;return s=D,D=D+32|0,l=s,0|(o=0|le(t|=0,e|=0,t,e,A=s+12|0))?(D=s,0|(l=o)):0|(t=0|le(t,e,n,r,l))?(D=s,0|(l=t)):(A=0|vt(A,l),i[(l=a)>>2]=A,i[l+4>>2]=((0|A)<0)<<31>>31,D=s,0|(l=0))},_gridPathCells:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s=0,A=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,T=0,C=0;if(o=D,D=D+48|0,c=o+12|0,T=o,!(s=0|le(t|=0,e|=0,t,e,A=o+24|0))&&!(s=0|le(t,e,n,r,c))){w=((0|(M=0|vt(A,c)))<0)<<31>>31,i[A>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,0|le(t,e,t,e,A)&&S(23313,23090,691,23299),0|le(t,e,n,r,c)&&S(23313,23090,696,23299),xt(A),xt(c),M?(g=+(0|M),b=A,r=d=0|i[A>>2],s=p=0|i[(y=A+4|0)>>2],n=m=0|i[(x=A+8|0)>>2],v=+((0|i[c>>2])-d|0)/g,_=+((0|i[c+4>>2])-p|0)/g,g=+((0|i[c+8>>2])-m|0)/g):(y=s=A+4|0,x=n=A+8|0,b=A,r=0|i[A>>2],s=0|i[s>>2],n=0|i[n>>2],v=0,_=0,g=0),i[T>>2]=r,i[(m=T+4|0)>>2]=s,i[(p=T+8|0)>>2]=n;t:do{if((0|M)<0)s=0;else for(f=0,d=0,s=r;;){C=v*(h=+(d>>>0)+4294967296*+(0|f))+ +(0|s),u=_*h+ +(0|i[y>>2]),h=g*h+ +(0|i[x>>2]),n=~~+Ve(+C),A=~~+Ve(+u),s=~~+Ve(+h),C=+l(+(+(0|n)-C)),u=+l(+(+(0|A)-u)),h=+l(+(+(0|s)-h));do{if(!(C>u&C>h)){if(c=0-n|0,u>h){r=c-s|0;break}r=A,s=c-A|0;break}n=0-(A+s)|0,r=A}while(0);if(i[T>>2]=n,i[m>>2]=r,i[p>>2]=s,bt(T),0|(s=0|ce(t,e,T,a+(d<<3)|0)))break t;if(!((0|f)<(0|w)|(0|f)==(0|w)&d>>>0<M>>>0)){s=0;break t}s=0|De(0|d,0|f,1,0),f=c=0|E(),d=s,s=0|i[b>>2]}}while(0);return D=o,0|(T=s)}return D=o,0|(T=s)},_gridPathCellsSize:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s=0,A=0,l=0;return o=D,D=D+32|0,l=o,(s=0|le(t|=0,e|=0,t,e,A=o+12|0))||(s=0|le(t,e,n,r,l))?(D=o,0|(l=s)):(r=0|De(0|(r=0|vt(A,l)),((0|r)<0)<<31>>31,1,0),A=0|E(),i[(l=a)>>2]=r,i[l+4>>2]=A,D=o,0|(l=0))},_gridRingUnsafe:function(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var a,o,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0;if(o=D,D=D+16|0,p=o+8|0,i[(d=a=o)>>2]=t,i[d+4>>2]=e,!n)return i[(p=r)>>2]=t,i[p+4>>2]=e,D=o,0|(p=0);i[p>>2]=0;t:do{if(0|Nt(t,e))t=9;else{if(A=(0|n)>0){s=0,d=t;do{if(0|(t=0|N(d,e,4,p,a)))break t;if(s=s+1|0,0|Nt(d=0|i[(e=a)>>2],e=0|i[e+4>>2])){t=9;break t}}while((0|s)<(0|n));if(i[(f=r)>>2]=d,i[f+4>>2]=e,f=n+-1|0,A){h=0,t=1;do{if(s=22384+(h<<2)|0,5==(0|h))for(l=0|i[s>>2],A=0,s=t;;){if(0|(t=0|N(0|i[(t=a)>>2],0|i[t+4>>2],l,p,a)))break t;if((0|A)!=(0|f)){if(c=0|i[(u=a)>>2],u=0|i[u+4>>2],i[(t=r+(s<<3)|0)>>2]=c,i[t+4>>2]=u,0|Nt(c,u)){t=9;break t}t=s+1|0}else t=s;if((0|(A=A+1|0))>=(0|n))break;s=t}else for(l=a,u=0|i[s>>2],c=0,s=t,A=0|i[l>>2],l=0|i[l+4>>2];;){if(0|(t=0|N(A,l,u,p,a)))break t;if(A=0|i[(l=a)>>2],l=0|i[l+4>>2],i[(t=r+(s<<3)|0)>>2]=A,i[t+4>>2]=l,t=s+1|0,0|Nt(A,l)){t=9;break t}if((0|(c=c+1|0))>=(0|n))break;s=t}h=h+1|0}while(h>>>0<6);l=d,s=0|i[(t=a)>>2],A=e,t=0|i[t+4>>2]}else l=d,s=d,A=e,t=e}else i[(l=r)>>2]=t,i[l+4>>2]=e,l=t,s=t,A=e,t=e;t=(0|l)==(0|s)&(0|A)==(0|t)?0:9}}while(0);return D=o,0|(p=t)},_i64Add:De,_i64Subtract:Oe,_isPentagon:Nt,_isResClassIII:function(t,e){return e=0|ze(0|(t|=0),0|(e|=0),52),E(),1&e},_isValidCell:It,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|ze(0|(t|=0),0|(e|=0),56),E(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|Nt(t,n))?0|(n=0):0|(n=0|It(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,r,a=0,o=0;return r=D,D=D+16|0,n=r,!0&536870912==(2013265920&(e|=0))&&0|It(t,a=-2130706433&e|134217728)?(o=0|ze(0|t,0|e,56),E(),a=(o=!(0|ye(t,a,7&o,n)))&((0|i[(a=n)>>2])==(0|t)?(0|i[a+4>>2])==(0|e):0)&1,D=r,0|a):(D=r,0|(a=0))},_latLngToCell:jt,_llvm_maxnum_f64:He,_llvm_minnum_f64:je,_llvm_round_f64:Ve,_localIjToCell:function(t,e,n,r,i){var a,o;return t|=0,e|=0,n|=0,i|=0,o=D,D=D+16|0,a=o,(r|=0)?n=15:(n=0|yt(n,a))||(n=0|ce(t,e,a,i)),D=o,0|n},_malloc:Re,_maxFaceCount:function(t,e,n){n|=0;var r=0,a=0;if(a=0|ze(0|(t|=0),0|(e|=0),45),E(),!(0|F(127&a)))return a=2,i[n>>2]=a,0;if(a=0|ze(0|t,0|e,52),E(),!(a&=15))return a=5,i[n>>2]=a,0;for(r=1;;){if(!(!((0|Ge(7,0,3*(15-r|0)|0))&t)&!(E()&e))){r=2,t=6;break}if(!(r>>>0<a>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?(i[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,a=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(a=0|Ne(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|E(),n=0|De(0|t,0|n,1,0),n=0|De(0|(n=0|Ne(0|a,0|r,0|n,0|E())),0|E(),1,0),t=0|E(),i[e>>2]=n,i[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){e|=0,r|=0;var a,o=0,s=0,A=0,l=0,c=0;if(a=D,D=D+48|0,o=a+16|0,s=a+8|0,A=a,0|(n|=0))return D=a,0|(A=15);if(l=0|i[(c=t|=0)+4>>2],i[(n=s)>>2]=i[c>>2],i[n+4>>2]=l,fe(s,o),!(e=0|Y(o,e,A))){if(n=0|i[s>>2],(0|(s=0|i[t+8>>2]))>0){o=0|i[t+12>>2],e=0;do{n=(0|i[o+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|s))}o=0|i[(e=A)>>2],(0|(e=0|i[e+4>>2]))<(0|(s=((0|n)<0)<<31>>31))|(0|e)==(0|s)&o>>>0<n>>>0?(i[(e=A)>>2]=n,i[e+4>>2]=s,e=s):n=o,l=0|De(0|n,0|e,12,0),c=0|E(),i[(e=A)>>2]=l,i[e+4>>2]=c,i[(e=r)>>2]=l,i[e+4>>2]=c,e=0}return D=a,0|(c=e)},_memcpy:We,_memset:Xe,_originToDirectedEdges:function(t,e,n){n|=0;var r,a=0;return r=!(0|Nt(t|=0,e|=0)),e&=-2130706433,i[(a=n)>>2]=r?t:0,i[a+4>>2]=r?285212672|e:0,i[(a=n+8|0)>>2]=t,i[a+4>>2]=301989888|e,i[(a=n+16|0)>>2]=t,i[a+4>>2]=318767104|e,i[(a=n+24|0)>>2]=t,i[a+4>>2]=335544320|e,i[(a=n+32|0)>>2]=t,i[a+4>>2]=352321536|e,i[(n=n+40|0)>>2]=t,i[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){e|=0,r|=0;var a,o,s,A,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,S=0,T=0,C=0,R=0,P=0,L=0,O=0,I=0,N=0,B=0,F=0;if(A=D,D=D+112|0,a=A+80|0,f=A+72|0,o=A,s=A+56|0,0|(n|=0))return D=A,0|(F=15);if(!(F=0|Re(32+(i[(d=(t|=0)+8|0)>>2]<<5)|0)))return D=A,0|(F=13);if(de(t,F),B=0|i[(N=t)+4>>2],i[(n=f)>>2]=i[N>>2],i[n+4>>2]=B,fe(f,a),n=0|Y(a,e,o))N=0,B=0;else{if(n=0|i[f>>2],(0|(c=0|i[d>>2]))>0){u=0|i[t+12>>2],l=0;do{n=(0|i[u+(l<<3)>>2])+n|0,l=l+1|0}while((0|l)!=(0|c));l=n}else l=n;c=0|i[(n=o)>>2],(0|(n=0|i[n+4>>2]))<(0|(u=((0|l)<0)<<31>>31))|(0|n)==(0|u)&c>>>0<l>>>0?(i[(n=o)>>2]=l,i[n+4>>2]=u,n=u):l=c,N=0|De(0|l,0|n,12,0),B=0|E(),i[(n=o)>>2]=N,i[n+4>>2]=B,n=0}if(0|n)return Pe(F),D=A,0|(F=n);if(!(l=0|Le(N,8)))return Pe(F),D=A,0|(F=13);if(!(h=0|Le(N,8)))return Pe(F),Pe(l),D=A,0|(F=13);i[(O=a)>>2]=0,i[O+4>>2]=0,I=0|i[(O=t)+4>>2],i[(n=f)>>2]=i[O>>2],i[n+4>>2]=I,n=0|k(f,N,B,e,a,l,h);t:do{if(n)Pe(l),Pe(h),Pe(F);else{e:do{if((0|i[d>>2])>0){for(u=t+12|0,c=0;n=0|k((0|i[u>>2])+(c<<3)|0,N,B,e,a,l,h),c=c+1|0,!(0|n);)if((0|c)>=(0|i[d>>2]))break e;Pe(l),Pe(h),Pe(F);break t}}while(0);(0|B)>0|!(0|B)&N>>>0>0&&Xe(0|h,0,N<<3),O=0|i[(I=a)+4>>2];e:do{if((0|O)>0|!(0|O)&(0|i[I>>2])>>>0>0){R=l,P=h,L=l,O=h,I=l,n=l,S=l,T=h,C=h,l=h;n:for(;;){for(x=0,b=0,M=0,w=0,c=0,u=0;;){f=(h=o)+56|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|f));if(0|q(d=0|i[(e=R+(x<<3)|0)>>2],e=0|i[e+4>>2],1,o,0)){f=(h=o)+56|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|f));0|(h=0|Le(7,4))&&(U(d,e,1,o,h,7,0,0),Pe(h))}for(y=0;;){v=0|i[(_=o+(y<<3)|0)>>2],_=0|i[_+4>>2];r:do{if(!(0|v)&!(0|_))h=c,f=u;else{if(p=0|ke(0|v,0|_,0|N,0|B),d=0|E(),!(!(0|(f=0|i[(e=h=r+(p<<3)|0)>>2]))&!(0|(e=0|i[e+4>>2])))){m=0,g=0;do{if((0|m)>(0|B)|(0|m)==(0|B)&g>>>0>N>>>0)break n;if((0|f)==(0|v)&(0|e)==(0|_)){h=c,f=u;break r}p=0|Be(0|(h=0|De(0|p,0|d,1,0)),0|E(),0|N,0|B),d=0|E(),g=0|De(0|g,0|m,1,0),m=0|E(),f=0|i[(e=h=r+(p<<3)|0)>>2],e=0|i[e+4>>2]}while(!(!(0|f)&!(0|e)))}!(0|v)&!(0|_)?(h=c,f=u):(Xt(v,_,s),0|pe(t,F,s)&&(g=0|De(0|c,0|u,1,0),u=0|E(),i[(m=h)>>2]=v,i[m+4>>2]=_,i[(c=P+(c<<3)|0)>>2]=v,i[c+4>>2]=_,c=g),h=c,f=u)}}while(0);if((y=y+1|0)>>>0>=7)break;c=h,u=f}if(x=0|De(0|x,0|b,1,0),b=0|E(),M=0|De(0|M,0|w,1,0),w=0|E(),c=0|i[(u=a)>>2],!((0|w)<(0|(u=0|i[u+4>>2]))|(0|w)==(0|u)&M>>>0<c>>>0))break;c=h,u=f}if((0|u)>0|!(0|u)&c>>>0>0){c=0,u=0;do{i[(w=R+(c<<3)|0)>>2]=0,i[w+4>>2]=0,c=0|De(0|c,0|u,1,0),u=0|E(),M=0|i[(w=a)+4>>2]}while((0|u)<(0|M)|((0|u)==(0|M)?c>>>0<(0|i[w>>2])>>>0:0))}if(i[(w=a)>>2]=h,i[w+4>>2]=f,!((0|f)>0|!(0|f)&h>>>0>0))break e;y=l,x=C,b=I,M=T,w=P,l=S,C=n,T=L,S=y,n=x,I=O,O=b,L=M,P=R,R=w}Pe(L),Pe(O),Pe(F),n=1;break t}n=h}while(0);Pe(F),Pe(l),Pe(n),n=0}}while(0);return D=A,0|(F=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|i[(t|=0)>>2])>>>0)+4294967296*+(0|i[t+4>>2]))},_res0CellCount:function(){return 122},_round:Qe,_sbrk:Ye,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,r,a,o,s){t|=0,r|=0,a|=0,o|=0;var A,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0;if(A=D,D=D+16|0,m=A,!((0|(n|=0))>0|!(0|n)&(e|=0)>>>0>0))return D=A,0|(m=0);if((0|(s|=0))>=16)return D=A,0|(m=12);d=0,p=0,f=0,l=0;t:for(;;){if(h=0|ze(0|(c=0|i[(u=t+(d<<3)|0)>>2]),0|(u=0|i[u+4>>2]),52),E(),(15&h)>(0|s)){l=12,c=11;break}if(Zt(m,c,u,s),!(0|(u=0|i[(h=m)>>2]))&!(0|(h=0|i[h+4>>2])))c=f;else{c=f;do{if(!((0|l)<(0|o)|(0|l)==(0|o)&c>>>0<a>>>0)){c=10;break t}i[(f=r+(c<<3)|0)>>2]=u,i[f+4>>2]=h,c=0|De(0|c,0|l,1,0),l=0|E(),Kt(m),u=0|i[(f=m)>>2],h=0|i[f+4>>2]}while(!(!(0|u)&!(0|h)))}if(d=0|De(0|d,0|p,1,0),!((0|(p=0|E()))<(0|n)|(0|p)==(0|n)&d>>>0<e>>>0)){l=0,c=11;break}f=c}return 10==(0|c)?(D=A,0|(m=14)):11==(0|c)?(D=A,0|l):0},_uncompactCellsSize:function(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,f=0;s=D,D=D+16|0,o=s;t:do{if((0|n)>0|!(0|n)&e>>>0>0){for(h=0,l=0,A=0,f=0;;){if(!(!(0|(c=0|i[(u=t+(h<<3)|0)>>2]))&!(0|(u=0|i[u+4>>2]))||(u=!(0|Ut(c,u,r,o)),l=0|De(0|i[(c=o)>>2],0|i[c+4>>2],0|l,0|A),A=0|E(),u))){A=12;break}if(h=0|De(0|h,0|f,1,0),!((0|(f=0|E()))<(0|n)|(0|f)==(0|n)&h>>>0<e>>>0))break t}return D=s,0|A}l=0,A=0}while(0);return i[a>>2]=l,i[a+4>>2]=A,D=s,0|(a=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,a,o,s,A=0,l=0;return s=D,D=D+192|0,a=s,o=s+168|0,A=0|ze(0|(t|=0),0|(e|=0),56),E(),A&=7,0|(r=0|Wt(t,l=-2130706433&e|134217728,o))?(D=s,0|(l=r)):(e=0|ze(0|t,0|e,52),E(),e&=15,0|Nt(t,l)?Tt(o,e,A,1,a):Lt(o,e,A,1,a),l=a+8|0,i[n>>2]=i[l>>2],i[n+4>>2]=i[l+4>>2],i[n+8>>2]=i[l+8>>2],i[n+12>>2]=i[l+12>>2],D=s,0|(l=0))},establishStackSpace:function(t,e){D=t|=0},stackAlloc:function(t){var e;return e=D,D=(D=D+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){D=t|=0},stackSave:function(){return 0|D}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:gt,b:function(t){g=t},c:function(){return g},d:function(t,e,n,r){gt("Assertion failed: "+P(t)+", at: "+[e?P(e):"unknown filename",n,r?P(r):"unknown function"])},e:function(t){return n.___errno_location&&(S[n.___errno_location()>>2]=t),t},f:$,g:function(t,e,n){w.set(w.subarray(e,e+n),t)},h:function(t){var e=$(),n=16777216,r=2130706432;if(t>r)return!1;for(var i=Math.max(e,16777216);i<t;)i=i<=536870912?L(2*i,n):Math.min(L((3*i+2147483648)/4,n),r);return!!tt(i)},i:function(t){gt("OOM")},j:Z,k:K,l:tt,m:J,n:function(){var t=J();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),K(t)},o:24144,p:24128},b);n.___divdi3=it.___divdi3,n.___muldi3=it.___muldi3,n.___remdi3=it.___remdi3,n.___uremdi3=it.___uremdi3,n._areNeighborCells=it._areNeighborCells,n._bitshift64Ashr=it._bitshift64Ashr,n._bitshift64Lshr=it._bitshift64Lshr,n._bitshift64Shl=it._bitshift64Shl,n._calloc=it._calloc,n._cellAreaKm2=it._cellAreaKm2,n._cellAreaM2=it._cellAreaM2,n._cellAreaRads2=it._cellAreaRads2,n._cellToBoundary=it._cellToBoundary,n._cellToCenterChild=it._cellToCenterChild,n._cellToChildPos=it._cellToChildPos,n._cellToChildren=it._cellToChildren,n._cellToChildrenSize=it._cellToChildrenSize,n._cellToLatLng=it._cellToLatLng,n._cellToLocalIj=it._cellToLocalIj,n._cellToParent=it._cellToParent,n._cellToVertex=it._cellToVertex,n._cellToVertexes=it._cellToVertexes,n._cellsToDirectedEdge=it._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=it._cellsToLinkedMultiPolygon,n._childPosToCell=it._childPosToCell,n._compactCells=it._compactCells,n._destroyLinkedMultiPolygon=it._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=it._directedEdgeToBoundary,n._directedEdgeToCells=it._directedEdgeToCells,n._edgeLengthKm=it._edgeLengthKm,n._edgeLengthM=it._edgeLengthM,n._edgeLengthRads=it._edgeLengthRads;var at=n._emscripten_replace_memory=it._emscripten_replace_memory;n._free=it._free,n._getBaseCellNumber=it._getBaseCellNumber,n._getDirectedEdgeDestination=it._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=it._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=it._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=it._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=it._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=it._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=it._getIcosahedronFaces,n._getNumCells=it._getNumCells,n._getPentagons=it._getPentagons,n._getRes0Cells=it._getRes0Cells,n._getResolution=it._getResolution,n._greatCircleDistanceKm=it._greatCircleDistanceKm,n._greatCircleDistanceM=it._greatCircleDistanceM,n._greatCircleDistanceRads=it._greatCircleDistanceRads,n._gridDisk=it._gridDisk,n._gridDiskDistances=it._gridDiskDistances,n._gridDistance=it._gridDistance,n._gridPathCells=it._gridPathCells,n._gridPathCellsSize=it._gridPathCellsSize,n._gridRingUnsafe=it._gridRingUnsafe,n._i64Add=it._i64Add,n._i64Subtract=it._i64Subtract,n._isPentagon=it._isPentagon,n._isResClassIII=it._isResClassIII,n._isValidCell=it._isValidCell,n._isValidDirectedEdge=it._isValidDirectedEdge,n._isValidVertex=it._isValidVertex,n._latLngToCell=it._latLngToCell,n._llvm_maxnum_f64=it._llvm_maxnum_f64,n._llvm_minnum_f64=it._llvm_minnum_f64,n._llvm_round_f64=it._llvm_round_f64,n._localIjToCell=it._localIjToCell,n._malloc=it._malloc,n._maxFaceCount=it._maxFaceCount,n._maxGridDiskSize=it._maxGridDiskSize,n._maxPolygonToCellsSize=it._maxPolygonToCellsSize,n._memcpy=it._memcpy,n._memset=it._memset,n._originToDirectedEdges=it._originToDirectedEdges,n._pentagonCount=it._pentagonCount,n._polygonToCells=it._polygonToCells,n._readInt64AsDoubleFromPointer=it._readInt64AsDoubleFromPointer,n._res0CellCount=it._res0CellCount,n._round=it._round,n._sbrk=it._sbrk,n._sizeOfCellBoundary=it._sizeOfCellBoundary,n._sizeOfCoordIJ=it._sizeOfCoordIJ,n._sizeOfGeoLoop=it._sizeOfGeoLoop,n._sizeOfGeoPolygon=it._sizeOfGeoPolygon,n._sizeOfH3Index=it._sizeOfH3Index,n._sizeOfLatLng=it._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=it._sizeOfLinkedGeoPolygon,n._uncompactCells=it._uncompactCells,n._uncompactCellsSize=it._uncompactCellsSize,n._vertexToLatLng=it._vertexToLatLng,n.establishStackSpace=it.establishStackSpace;var ot,st,At=n.stackAlloc=it.stackAlloc,lt=n.stackRestore=it.stackRestore,ct=n.stackSave=it.stackSave;if(n.asm=it,n.cwrap=function(t,e,n,r){var i=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&i&&!r?y(t):function(){return x(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":M[t|0]=e;break;case"i16":E[t>>1]=e;break;case"i32":S[t>>2]=e;break;case"i64":W=[e>>>0,(V=e,+k(V)>=1?V>0?(0|G(+z(V/4294967296),4294967295))>>>0:~~+F((V-+(~~V>>>0))/4294967296)>>>0:0)],S[t>>2]=W[0],S[t+4>>2]=W[1];break;case"float":T[t>>2]=e;break;case"double":C[t>>3]=e;break;default:gt("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return M[t|0];case"i16":return E[t>>1];case"i32":case"i64":return S[t>>2];case"float":return T[t>>2];case"double":return C[t>>3];default:gt("invalid type for getValue: "+e)}return null},X)if(Y(X)||(ot=X,X=n.locateFile?n.locateFile(ot,d):d+ot),A||s){var ut=u(X);w.set(ut,8)}else{H++,n.monitorRunDependencies&&n.monitorRunDependencies(H);var ht=function(t){t.byteLength&&(t=new Uint8Array(t)),w.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(t){if(H--,n.monitorRunDependencies&&n.monitorRunDependencies(H),0==H&&j){var e=j;j=null,e()}}()},ft=function(){c(X,ht,(function(){throw"could not load memory initializer "+X}))},dt=rt(X);if(dt)ht(dt.buffer);else if(n.memoryInitializerRequest){var pt=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=rt(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+X),void ft();e=r.buffer}ht(e)};n.memoryInitializerRequest.response?setTimeout(pt,0):n.memoryInitializerRequest.addEventListener("load",pt)}else ft()}function mt(t){function e(){st||(st=!0,v||(I(U),I(N),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),B.unshift(t);var t;I(B)}()))}H>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),q.unshift(t);var t;I(q)}(),H>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function gt(t){throw n.onAbort&&n.onAbort(t),p(t+=""),m(t),v=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(j=function t(){st||mt(),st||(j=t)},n.run=mt,n.abort=gt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return mt(),t}("object"==typeof Vm?Vm:{}),Wm="number",Xm=[["sizeOfH3Index",Wm],["sizeOfLatLng",Wm],["sizeOfCellBoundary",Wm],["sizeOfGeoLoop",Wm],["sizeOfGeoPolygon",Wm],["sizeOfLinkedGeoPolygon",Wm],["sizeOfCoordIJ",Wm],["readInt64AsDoubleFromPointer",Wm],["isValidCell",Wm,[Wm,Wm]],["latLngToCell",Wm,[Wm,Wm,Wm,Wm]],["cellToLatLng",Wm,[Wm,Wm,Wm]],["cellToBoundary",Wm,[Wm,Wm,Wm]],["maxGridDiskSize",Wm,[Wm,Wm]],["gridDisk",Wm,[Wm,Wm,Wm,Wm]],["gridDiskDistances",Wm,[Wm,Wm,Wm,Wm,Wm]],["gridRingUnsafe",Wm,[Wm,Wm,Wm,Wm]],["maxPolygonToCellsSize",Wm,[Wm,Wm,Wm,Wm]],["polygonToCells",Wm,[Wm,Wm,Wm,Wm]],["cellsToLinkedMultiPolygon",Wm,[Wm,Wm,Wm]],["destroyLinkedMultiPolygon",null,[Wm]],["compactCells",Wm,[Wm,Wm,Wm,Wm]],["uncompactCells",Wm,[Wm,Wm,Wm,Wm,Wm,Wm]],["uncompactCellsSize",Wm,[Wm,Wm,Wm,Wm,Wm]],["isPentagon",Wm,[Wm,Wm]],["isResClassIII",Wm,[Wm,Wm]],["getBaseCellNumber",Wm,[Wm,Wm]],["getResolution",Wm,[Wm,Wm]],["maxFaceCount",Wm,[Wm,Wm,Wm]],["getIcosahedronFaces",Wm,[Wm,Wm,Wm]],["cellToParent",Wm,[Wm,Wm,Wm,Wm]],["cellToChildren",Wm,[Wm,Wm,Wm,Wm]],["cellToCenterChild",Wm,[Wm,Wm,Wm,Wm]],["cellToChildrenSize",Wm,[Wm,Wm,Wm,Wm]],["cellToChildPos",Wm,[Wm,Wm,Wm,Wm]],["childPosToCell",Wm,[Wm,Wm,Wm,Wm,Wm,Wm]],["areNeighborCells",Wm,[Wm,Wm,Wm,Wm,Wm]],["cellsToDirectedEdge",Wm,[Wm,Wm,Wm,Wm,Wm]],["getDirectedEdgeOrigin",Wm,[Wm,Wm,Wm]],["getDirectedEdgeDestination",Wm,[Wm,Wm,Wm]],["isValidDirectedEdge",Wm,[Wm,Wm]],["directedEdgeToCells",Wm,[Wm,Wm,Wm]],["originToDirectedEdges",Wm,[Wm,Wm,Wm]],["directedEdgeToBoundary",Wm,[Wm,Wm,Wm]],["gridDistance",Wm,[Wm,Wm,Wm,Wm,Wm]],["gridPathCells",Wm,[Wm,Wm,Wm,Wm,Wm]],["gridPathCellsSize",Wm,[Wm,Wm,Wm,Wm,Wm]],["cellToLocalIj",Wm,[Wm,Wm,Wm,Wm,Wm,Wm]],["localIjToCell",Wm,[Wm,Wm,Wm,Wm,Wm]],["getHexagonAreaAvgM2",Wm,[Wm,Wm]],["getHexagonAreaAvgKm2",Wm,[Wm,Wm]],["getHexagonEdgeLengthAvgM",Wm,[Wm,Wm]],["getHexagonEdgeLengthAvgKm",Wm,[Wm,Wm]],["greatCircleDistanceM",Wm,[Wm,Wm]],["greatCircleDistanceKm",Wm,[Wm,Wm]],["greatCircleDistanceRads",Wm,[Wm,Wm]],["cellAreaM2",Wm,[Wm,Wm,Wm]],["cellAreaKm2",Wm,[Wm,Wm,Wm]],["cellAreaRads2",Wm,[Wm,Wm,Wm]],["edgeLengthM",Wm,[Wm,Wm,Wm]],["edgeLengthKm",Wm,[Wm,Wm,Wm]],["edgeLengthRads",Wm,[Wm,Wm,Wm]],["getNumCells",Wm,[Wm,Wm]],["getRes0Cells",Wm,[Wm]],["res0CellCount",Wm],["getPentagons",Wm,[Wm,Wm]],["pentagonCount",Wm],["cellToVertex",Wm,[Wm,Wm,Wm,Wm]],["cellToVertexes",Wm,[Wm,Wm,Wm]],["vertexToLatLng",Wm,[Wm,Wm,Wm]],["isValidVertex",Wm,[Wm,Wm]]],Qm=4,Ym={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range"};
     5Pp.readability=function(t,e){var n=Pp(t),i=Pp(e);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},Pp.isReadable=function(t,e,n){var i,r,s=Pp.readability(t,e);switch(r=!1,(i=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+i.size){case"AAsmall":case"AAAlarge":r=s>=4.5;break;case"AAlarge":r=s>=3;break;case"AAAsmall":r=s>=7}return r},Pp.mostReadable=function(t,e,n){var i,r,s,a,o=null,l=0;r=(n=n||{}).includeFallbackColors,s=n.level,a=n.size;for(var u=0;u<e.length;u++)(i=Pp.readability(t,e[u]))>l&&(l=i,o=Pp(e[u]));return Pp.isReadable(t,o,{level:s,size:a})||!r?o:(n.includeFallbackColors=!1,Pp.mostReadable(t,["#fff","#000"],n))};var Yp=Pp.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Qp=Pp.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Yp);function $p(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Zp(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Kp(t){return Math.min(1,Math.max(0,t))}function Jp(t){return parseInt(t,16)}function tf(t){return 1==t.length?"0"+t:""+t}function ef(t){return t<=1&&(t=100*t+"%"),t}function nf(t){return Math.round(255*parseFloat(t)).toString(16)}function rf(t){return Jp(t)/255}var sf,af,of,lf=(af="[\\s|\\(]+("+(sf="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+sf+")[,|\\s]+("+sf+")\\s*\\)?",of="[\\s|\\(]+("+sf+")[,|\\s]+("+sf+")[,|\\s]+("+sf+")[,|\\s]+("+sf+")\\s*\\)?",{CSS_UNIT:new RegExp(sf),rgb:new RegExp("rgb"+af),rgba:new RegExp("rgba"+of),hsl:new RegExp("hsl"+af),hsla:new RegExp("hsla"+of),hsv:new RegExp("hsv"+af),hsva:new RegExp("hsva"+of),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function uf(t){return!!lf.CSS_UNIT.exec(t)}function hf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function cf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||pf(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Af(t){return function(t){if(Array.isArray(t))return hf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pf(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function df(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}function pf(t,e){if(t){if("string"==typeof t)return hf(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hf(t,e):void 0}}var ff=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=(e instanceof Array?e.length?e:[void 0]:[e]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),s=t.reduce((function(t,e){var i=t,s=e;return r.forEach((function(t,e){var a,o=t.keyAccessor;if(t.isProp){var l=s,u=l[o],h=function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(l,[o].map(df));a=u,s=h}else a=o(s,e);e+1<r.length?(i.hasOwnProperty(a)||(i[a]={}),i=i[a]):n?(i.hasOwnProperty(a)||(i[a]=[]),i[a].push(s)):i[a]=s})),t}),{});n instanceof Function&&function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;i===r.length?Object.keys(e).forEach((function(t){return e[t]=n(e[t])})):Object.values(e).forEach((function(e){return t(e,i+1)}))}(s);var a=s;return i&&(a=[],function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===r.length?a.push({keys:n,vals:e}):Object.entries(e).forEach((function(e){var i=cf(e,2),r=i[0],s=i[1];return t(s,[].concat(Af(n),[r]))}))}(s),e instanceof Array&&0===e.length&&1===a.length&&(a[0].keys=[])),a};function mf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function gf(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yf(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n,i,r={},s=Object.keys(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)>=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function vf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||xf(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _f(t){return function(t){if(Array.isArray(t))return bf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||xf(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xf(t,e){if(t){if("string"==typeof t)return bf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bf(t,e):void 0}}function bf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var Sf=["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"];function Mf(t,e,n){var i=n.objBindAttr,r=void 0===i?"__obj":i,s=n.dataBindAttr,a=void 0===s?"__data":s,o=n.idAccessor,l=n.purge,u=void 0!==l&&l,h=function(t){return t.hasOwnProperty(a)},c=e.filter((function(t){return!h(t)})),A=e.filter(h).map((function(t){return t[a]})),d=u?{enter:t,exit:A,update:[]}:function(t,e,n){var i={enter:[],update:[],exit:[]};if(n){var r=ff(t,n,!1),s=ff(e,n,!1),a=Object.assign({},r,s);Object.entries(a).forEach((function(t){var e=vf(t,2),n=e[0],a=e[1],o=r.hasOwnProperty(n)?s.hasOwnProperty(n)?"update":"exit":"enter";i[o].push("update"===o?[r[n],s[n]]:a)}))}else{var o=new Set(t),l=new Set(e);new Set([].concat(_f(o),_f(l))).forEach((function(t){var e=o.has(t)?l.has(t)?"update":"exit":"enter";i[e].push("update"===e?[t,t]:t)}))}return i}(A,t,o);return d.update=d.update.map((function(t){var e=vf(t,2),n=e[0],i=e[1];return n!==i&&(i[r]=n[r],i[r][a]=i),i})),d.exit=d.exit.concat(c.map((function(t){return gf({},r,t)}))),d}function wf(t,e,n,i,r){var s=r.createObj,a=void 0===s?function(t){return{}}:s,o=r.updateObj,l=void 0===o?function(t,e){}:o,u=r.exitObj,h=void 0===u?function(t){}:u,c=r.objBindAttr,A=void 0===c?"__obj":c,d=r.dataBindAttr,p=void 0===d?"__data":d,f=yf(r,Sf),m=Mf(t,e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mf(Object(n),!0).forEach((function(e){gf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({objBindAttr:A,dataBindAttr:p},f)),g=m.enter,y=m.update;m.exit.forEach((function(t){var e=t[A];delete t[A],h(e),i(e)}));var v=function(t){var e=[];return t.forEach((function(t){var n=a(t);n&&(n[p]=t,t[A]=n,e.push(n))})),e}(g);!function(t){t.forEach((function(t){var e=t[A];e&&(e[p]=t,l(e,t))}))}([].concat(_f(g),_f(y))),v.forEach(n)}function Tf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ef,Cf={exports:{}};var Rf=(Ef||(Ef=1,function(t){t.exports=function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var i=n(1),r=function(){function t(t,e,n){void 0===t&&(t=NaN),void 0===e&&(e=NaN),void 0===n&&(n=!1),this._minFPS=e,this._maxFPS=t,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new i.default,this._onPause=new i.default,this._onTick=new i.default,this._onTickOncePerFrame=new i.default,n||this.resume()}return t.prototype.updateOnce=function(t){t(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce())},t.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},t.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(t.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeScale",{get:function(){return this._timeScale},set:function(t){this._timeScale!==t&&(this._timeScale=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),t.prototype.animateOnce=function(){var t=this;this._animationFrameHandle=window.requestAnimationFrame((function(){return t.onFrame()}))},t.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},t.prototype.update=function(t,e){void 0===e&&(e=!0),this._currentTick++,this._currentTime+=t,this._tickDeltaTime=t,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),e&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.getTimer=function(){return Date.now()},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=r},function(t,e,n){!function(e,n){t.exports=n()}(0,(function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){var n=function(){function t(){this.functions=[]}return t.prototype.add=function(t){return-1===this.functions.indexOf(t)&&(this.functions.push(t),!0)},t.prototype.remove=function(t){var e=this.functions.indexOf(t);return e>-1&&(this.functions.splice(e,1),!0)},t.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},t.prototype.dispatch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.functions.concat().forEach((function(e){e.apply(void 0,t)}))},Object.defineProperty(t.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n}])}))}])}(Cf)),Cf.exports),Nf=Tf(Rf);function Pf(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var Df=t=>()=>t;function If(t){return 1==(t=+t)?Lf:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Df(isNaN(e)?n:e)}}function Lf(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Df(isNaN(t)?e:t)}var Bf=function t(e){var n=If(e);function i(t,e){var i=n((t=fp(t)).r,(e=fp(e)).r),r=n(t.g,e.g),s=n(t.b,e.b),a=Lf(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=s(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function Uf(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(s){for(n=0;n<i;++n)r[n]=t[n]*(1-s)+e[n]*s;return r}}function Of(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ff(t,e){return(Of(e)?Uf:kf)(t,e)}function kf(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,s=new Array(r),a=new Array(i);for(n=0;n<r;++n)s[n]=Wf(t[n],e[n]);for(;n<i;++n)a[n]=e[n];return function(t){for(n=0;n<r;++n)a[n]=s[n](t);return a}}function zf(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function qf(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Gf(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Wf(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Vf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hf=new RegExp(Vf.source,"g");function jf(t,e){var n,i,r,s=Vf.lastIndex=Hf.lastIndex=0,a=-1,o=[],l=[];for(t+="",e+="";(n=Vf.exec(t))&&(i=Hf.exec(e));)(r=i.index)>s&&(r=e.slice(s,r),o[a]?o[a]+=r:o[++a]=r),(n=n[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:qf(n,i)})),s=Hf.lastIndex;return s<e.length&&(r=e.slice(s),o[a]?o[a]+=r:o[++a]=r),o.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)o[(n=l[i]).i]=n.x(t);return o.join("")})}function Wf(t,e){var n,i=typeof e;return null==e||"boolean"===i?Df(e):("number"===i?qf:"string"===i?(n=Ap(e))?(e=n,Bf):jf:e instanceof Ap?Bf:e instanceof Date?zf:Of(e)?Uf:Array.isArray(e)?kf:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Gf:qf)(t,e)}function Xf(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Yf(t){return+t}var Qf=[0,1];function $f(t){return t}function Zf(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Kf(t,e,n){var i=t[0],r=t[1],s=e[0],a=e[1];return r<i?(i=Zf(r,i),s=n(a,s)):(i=Zf(i,r),s=n(s,a)),function(t){return s(i(t))}}function Jf(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),s=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=Zf(t[a],t[a+1]),s[a]=n(e[a],e[a+1]);return function(e){var n=Mh(t,e,1,i)-1;return s[n](r[n](e))}}function tm(){var t,e,n,i,r,s,a=Qf,o=Qf,l=Wf,u=$f;function h(){var t=Math.min(a.length,o.length);return u!==$f&&(u=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),i=t>2?Jf:Kf,r=s=null,c}function c(e){return null==e||isNaN(e=+e)?n:(r||(r=i(a.map(t),o,l)))(t(u(e)))}return c.invert=function(n){return u(e((s||(s=i(o,a.map(t),qf)))(n)))},c.domain=function(t){return arguments.length?(a=Array.from(t,Yf),h()):a.slice()},c.range=function(t){return arguments.length?(o=Array.from(t),h()):o.slice()},c.rangeRound=function(t){return o=Array.from(t),l=Xf,h()},c.clamp=function(t){return arguments.length?(u=!!t||$f,h()):u!==$f},c.interpolate=function(t){return arguments.length?(l=t,h()):l},c.unknown=function(t){return arguments.length?(n=t,c):n},function(n,i){return t=n,e=i,h()}}function em(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function nm(t){return(t=em(Math.abs(t)))?t[1]:NaN}var im,rm=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sm(t){if(!(e=rm.exec(t)))throw new Error("invalid format: "+t);var e;return new am({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function am(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function om(t,e){var n=em(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}sm.prototype=am.prototype,am.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var lm={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>om(100*t,e),r:om,s:function(t,e){var n=em(t,e);if(!n)return t+"";var i=n[0],r=n[1],s=r-(im=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+em(t,Math.max(0,e+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function um(t){return t}var hm,cm,Am,dm=Array.prototype.map,pm=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fm(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?um:(e=dm.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,s=[],a=0,o=e[0],l=0;r>0&&o>0&&(l+o+1>i&&(o=Math.max(1,i-l)),s.push(t.substring(r-=o,r+o)),!((l+=o+1)>i));)o=e[a=(a+1)%e.length];return s.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",s=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?um:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(dm.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"−":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=sm(t)).fill,n=t.align,c=t.sign,A=t.symbol,d=t.zero,p=t.width,f=t.comma,m=t.precision,g=t.trim,y=t.type;"n"===y?(f=!0,y="g"):lm[y]||(void 0===m&&(m=12),g=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var v="$"===A?r:"#"===A&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",_="$"===A?s:/[%p]/.test(y)?l:"",x=lm[y],b=/[defgprs%]/.test(y);function S(t){var r,s,l,A=v,S=_;if("c"===y)S=x(t)+S,t="";else{var M=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:x(Math.abs(t),m),g&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),M&&0==+t&&"+"!==c&&(M=!1),A=(M?"("===c?c:u:"-"===c||"("===c?"":c)+A,S=("s"===y?pm[8+im/3]:"")+S+(M&&"("===c?")":""),b)for(r=-1,s=t.length;++r<s;)if(48>(l=t.charCodeAt(r))||l>57){S=(46===l?a+t.slice(r+1):t.slice(r))+S,t=t.slice(0,r);break}}f&&!d&&(t=i(t,1/0));var w=A.length+t.length+S.length,T=w<p?new Array(p-w+1).join(e):"";switch(f&&d&&(t=i(T+t,T.length?p-S.length:1/0),T=""),n){case"<":t=A+t+S+T;break;case"=":t=A+T+t+S;break;case"^":t=T.slice(0,w=T.length>>1)+A+t+S+T.slice(w);break;default:t=T+A+t+S}return o(t)}return m=void 0===m?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),S.toString=function(){return t+""},S}return{format:c,formatPrefix:function(t,e){var n=c(((t=sm(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(nm(e)/3))),r=Math.pow(10,-i),s=pm[8+i/3];return function(t){return n(r*t)+s}}}}function mm(t,e,n,i){var r,s=function(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?Ph(e,t,n):Ph(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}(t,e,n);switch((i=sm(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(nm(e)/3)))-nm(Math.abs(t)))}(s,a))||(i.precision=r),Am(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,nm(e)-nm(t))+1}(s,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-nm(Math.abs(t)))}(s))||(i.precision=r-2*("%"===i.type))}return cm(i)}function gm(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const i=e<t,[r,s,a]=i?Nh(e,t,n):Nh(t,e,n);if(!(s>=r))return[];const o=s-r+1,l=new Array(o);if(i)if(a<0)for(let t=0;t<o;++t)l[t]=(s-t)/-a;else for(let t=0;t<o;++t)l[t]=(s-t)*a;else if(a<0)for(let t=0;t<o;++t)l[t]=(r+t)/-a;else for(let t=0;t<o;++t)l[t]=(r+t)*a;return l}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return mm(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,s=e(),a=0,o=s.length-1,l=s[a],u=s[o],h=10;for(u<l&&(r=l,l=u,u=r,r=a,a=o,o=r);h-- >0;){if((r=Ph(l,u,n))===i)return s[a]=l,s[o]=u,e(s);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}i=r}return t},t}function ym(){var t=tm()($f,$f);return t.copy=function(){return e=t,ym().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},Pf.apply(t,arguments),gm(t)}hm=fm({thousands:",",grouping:[3],currency:["$",""]}),cm=hm.format,Am=hm.formatPrefix;const vm=134217729;function _m(t,e,n,i,r){let s,a,o,l,u=e[0],h=i[0],c=0,A=0;h>u==h>-u?(s=u,u=e[++c]):(s=h,h=i[++A]);let d=0;if(c<t&&A<n)for(h>u==h>-u?(a=u+s,o=s-(a-u),u=e[++c]):(a=h+s,o=s-(a-h),h=i[++A]),s=a,0!==o&&(r[d++]=o);c<t&&A<n;)h>u==h>-u?(a=s+u,l=a-s,o=s-(a-l)+(u-l),u=e[++c]):(a=s+h,l=a-s,o=s-(a-l)+(h-l),h=i[++A]),s=a,0!==o&&(r[d++]=o);for(;c<t;)a=s+u,l=a-s,o=s-(a-l)+(u-l),u=e[++c],s=a,0!==o&&(r[d++]=o);for(;A<n;)a=s+h,l=a-s,o=s-(a-l)+(h-l),h=i[++A],s=a,0!==o&&(r[d++]=o);return 0===s&&0!==d||(r[d++]=s),d}function xm(t){return new Float64Array(t)}const bm=xm(4),Sm=xm(8),Mm=xm(12),wm=xm(16),Tm=xm(4);function Em(t,e,n,i,r,s){const a=(e-s)*(n-r),o=(t-r)*(i-s),l=a-o,u=Math.abs(a+o);return Math.abs(l)>=33306690738754716e-32*u?l:-function(t,e,n,i,r,s,a){let o,l,u,h,c,A,d,p,f,m,g,y,v,_,x,b,S,M;const w=t-r,T=n-r,E=e-s,C=i-s;_=w*C,A=vm*w,d=A-(A-w),p=w-d,A=vm*C,f=A-(A-C),m=C-f,x=p*m-(_-d*f-p*f-d*m),b=E*T,A=vm*E,d=A-(A-E),p=E-d,A=vm*T,f=A-(A-T),m=T-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,c=x-g,bm[0]=x-(g+c)+(c-S),y=_+g,c=y-_,v=_-(y-c)+(g-c),g=v-b,c=v-g,bm[1]=v-(g+c)+(c-b),M=y+g,c=M-y,bm[2]=y-(M-c)+(g-c),bm[3]=M;let R=function(t,e){let n=e[0];for(let i=1;i<t;i++)n+=e[i];return n}(4,bm),N=22204460492503146e-32*a;if(R>=N||-R>=N)return R;if(c=t-w,o=t-(w+c)+(c-r),c=n-T,u=n-(T+c)+(c-r),c=e-E,l=e-(E+c)+(c-s),c=i-C,h=i-(C+c)+(c-s),0===o&&0===l&&0===u&&0===h)return R;if(N=11093356479670487e-47*a+33306690738754706e-32*Math.abs(R),R+=w*h+C*o-(E*u+T*l),R>=N||-R>=N)return R;_=o*C,A=vm*o,d=A-(A-o),p=o-d,A=vm*C,f=A-(A-C),m=C-f,x=p*m-(_-d*f-p*f-d*m),b=l*T,A=vm*l,d=A-(A-l),p=l-d,A=vm*T,f=A-(A-T),m=T-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,c=x-g,Tm[0]=x-(g+c)+(c-S),y=_+g,c=y-_,v=_-(y-c)+(g-c),g=v-b,c=v-g,Tm[1]=v-(g+c)+(c-b),M=y+g,c=M-y,Tm[2]=y-(M-c)+(g-c),Tm[3]=M;const P=_m(4,bm,4,Tm,Sm);_=w*h,A=vm*w,d=A-(A-w),p=w-d,A=vm*h,f=A-(A-h),m=h-f,x=p*m-(_-d*f-p*f-d*m),b=E*u,A=vm*E,d=A-(A-E),p=E-d,A=vm*u,f=A-(A-u),m=u-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,c=x-g,Tm[0]=x-(g+c)+(c-S),y=_+g,c=y-_,v=_-(y-c)+(g-c),g=v-b,c=v-g,Tm[1]=v-(g+c)+(c-b),M=y+g,c=M-y,Tm[2]=y-(M-c)+(g-c),Tm[3]=M;const D=_m(P,Sm,4,Tm,Mm);_=o*h,A=vm*o,d=A-(A-o),p=o-d,A=vm*h,f=A-(A-h),m=h-f,x=p*m-(_-d*f-p*f-d*m),b=l*u,A=vm*l,d=A-(A-l),p=l-d,A=vm*u,f=A-(A-u),m=u-f,S=p*m-(b-d*f-p*f-d*m),g=x-S,c=x-g,Tm[0]=x-(g+c)+(c-S),y=_+g,c=y-_,v=_-(y-c)+(g-c),g=v-b,c=v-g,Tm[1]=v-(g+c)+(c-b),M=y+g,c=M-y,Tm[2]=y-(M-c)+(g-c),Tm[3]=M;const I=_m(D,Mm,4,Tm,wm);return wm[I-1]}(t,e,n,i,r,s,u)}const Cm=Math.pow(2,-52),Rm=new Uint32Array(512);class Nm{static from(t,e=Um,n=Om){const i=t.length,r=new Float64Array(2*i);for(let s=0;s<i;s++){const i=t[s];r[2*s]=e(i),r[2*s+1]=n(i)}return new Nm(r)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this,s=t.length>>1;let a=1/0,o=1/0,l=-1/0,u=-1/0;for(let e=0;e<s;e++){const n=t[2*e],i=t[2*e+1];n<a&&(a=n),i<o&&(o=i),n>l&&(l=n),i>u&&(u=i),this._ids[e]=e}const h=(a+l)/2,c=(o+u)/2;let A,d,p;for(let e=0,n=1/0;e<s;e++){const i=Pm(h,c,t[2*e],t[2*e+1]);i<n&&(A=e,n=i)}const f=t[2*A],m=t[2*A+1];for(let e=0,n=1/0;e<s;e++){if(e===A)continue;const i=Pm(f,m,t[2*e],t[2*e+1]);i<n&&i>0&&(d=e,n=i)}let g=t[2*d],y=t[2*d+1],v=1/0;for(let e=0;e<s;e++){if(e===A||e===d)continue;const n=Im(f,m,g,y,t[2*e],t[2*e+1]);n<v&&(p=e,v=n)}let _=t[2*p],x=t[2*p+1];if(v===1/0){for(let e=0;e<s;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];Lm(this._ids,this._dists,0,s-1);const e=new Uint32Array(s);let n=0;for(let t=0,i=-1/0;t<s;t++){const r=this._ids[t],s=this._dists[r];s>i&&(e[n++]=r,i=s)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Em(f,m,g,y,_,x)<0){const t=d,e=g,n=y;d=p,g=_,y=x,p=t,_=e,x=n}const b=function(t,e,n,i,r,s){const a=n-t,o=i-e,l=r-t,u=s-e,h=a*a+o*o,c=l*l+u*u,A=.5/(a*u-o*l);return{x:t+(u*h-o*c)*A,y:e+(a*c-l*h)*A}}(f,m,g,y,_,x);this._cx=b.x,this._cy=b.y;for(let e=0;e<s;e++)this._dists[e]=Pm(t[2*e],t[2*e+1],b.x,b.y);Lm(this._ids,this._dists,0,s-1),this._hullStart=A;let S=3;n[A]=e[p]=d,n[d]=e[A]=p,n[p]=e[d]=A,i[A]=0,i[d]=1,i[p]=2,r.fill(-1),r[this._hashKey(f,m)]=A,r[this._hashKey(g,y)]=d,r[this._hashKey(_,x)]=p,this.trianglesLen=0,this._addTriangle(A,d,p,-1,-1,-1);for(let s,a,o=0;o<this._ids.length;o++){const l=this._ids[o],u=t[2*l],h=t[2*l+1];if(o>0&&Math.abs(u-s)<=Cm&&Math.abs(h-a)<=Cm)continue;if(s=u,a=h,l===A||l===d||l===p)continue;let c=0;for(let t=0,e=this._hashKey(u,h);t<this._hashSize&&(c=r[(e+t)%this._hashSize],-1===c||c===n[c]);t++);c=e[c];let f,m=c;for(;f=n[m],Em(u,h,t[2*m],t[2*m+1],t[2*f],t[2*f+1])>=0;)if(m=f,m===c){m=-1;break}if(-1===m)continue;let g=this._addTriangle(m,l,n[m],-1,-1,i[m]);i[l]=this._legalize(g+2),i[m]=g,S++;let y=n[m];for(;f=n[y],Em(u,h,t[2*y],t[2*y+1],t[2*f],t[2*f+1])<0;)g=this._addTriangle(y,l,f,i[l],-1,i[y]),i[l]=this._legalize(g+2),n[y]=y,S--,y=f;if(m===c)for(;f=e[m],Em(u,h,t[2*f],t[2*f+1],t[2*m],t[2*m+1])<0;)g=this._addTriangle(f,l,m,-1,i[m],i[f]),this._legalize(g+2),i[f]=g,n[m]=m,S--,m=f;this._hullStart=e[l]=m,n[m]=e[y]=l,n[l]=y,r[this._hashKey(u,h)]=l,r[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(S);for(let t=0,e=this._hullStart;t<S;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:i}=this;let r=0,s=0;for(;;){const a=n[t],o=t-t%3;if(s=o+(t+2)%3,-1===a){if(0===r)break;t=Rm[--r];continue}const l=a-a%3,u=o+(t+1)%3,h=l+(a+2)%3,c=e[s],A=e[t],d=e[u],p=e[h];if(Dm(i[2*c],i[2*c+1],i[2*A],i[2*A+1],i[2*d],i[2*d+1],i[2*p],i[2*p+1])){e[t]=p,e[a]=c;const i=n[h];if(-1===i){let e=this._hullStart;do{if(this._hullTri[e]===h){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,i),this._link(a,n[s]),this._link(s,h);const o=l+(a+1)%3;r<Rm.length&&(Rm[r++]=o)}else{if(0===r)break;t=Rm[--r]}}return s}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,i,r,s){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,i),this._link(a+1,r),this._link(a+2,s),this.trianglesLen+=3,a}}function Pm(t,e,n,i){const r=t-n,s=e-i;return r*r+s*s}function Dm(t,e,n,i,r,s,a,o){const l=t-a,u=e-o,h=n-a,c=i-o,A=r-a,d=s-o,p=h*h+c*c,f=A*A+d*d;return l*(c*f-p*d)-u*(h*f-p*A)+(l*l+u*u)*(h*d-c*A)<0}function Im(t,e,n,i,r,s){const a=n-t,o=i-e,l=r-t,u=s-e,h=a*a+o*o,c=l*l+u*u,A=.5/(a*u-o*l),d=(u*h-o*c)*A,p=(a*c-l*h)*A;return d*d+p*p}function Lm(t,e,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=t[r],s=e[i];let a=r-1;for(;a>=n&&e[t[a]]>s;)t[a+1]=t[a--];t[a+1]=i}else{let r=n+1,s=i;Bm(t,n+i>>1,r),e[t[n]]>e[t[i]]&&Bm(t,n,i),e[t[r]]>e[t[i]]&&Bm(t,r,i),e[t[n]]>e[t[r]]&&Bm(t,n,r);const a=t[r],o=e[a];for(;;){do{r++}while(e[t[r]]<o);do{s--}while(e[t[s]]>o);if(s<r)break;Bm(t,r,s)}t[n+1]=t[s],t[s]=a,i-r+1>=s-n?(Lm(t,e,r,i),Lm(t,e,n,s-1)):(Lm(t,e,n,s-1),Lm(t,e,r,i))}}function Bm(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Um(t){return t[0]}function Om(t){return t[1]}function Fm(t,e){for(var n=0,i=0,r=0,s=0,a=0,o=0,l=0,u=0,h=null,c=null,A=t[0],d=t[1],p=e.length;n<p;n++){i=0;var f=e[n].length-1,m=e[n];if((h=m[0])[0]!==m[f][0]&&h[1]!==m[f][1])throw new Error("First and last coordinates in a ring must be the same");for(a=h[0]-A,o=h[1]-d;i<f;i++)if(u=(c=m[i+1])[1]-d,o<0&&u<0||o>0&&u>0)o=u,a=(h=c)[0]-A;else{if(l=c[0]-t[0],u>0&&o<=0){if((s=a*u-l*o)>0)r+=1;else if(0===s)return 0}else if(o>0&&u<=0){if((s=a*u-l*o)<0)r+=1;else if(0===s)return 0}else if(0===u&&o<0){if(0===(s=a*u-l*o))return 0}else if(0===o&&u<0){if(0===(s=a*u-l*o))return 0}else if(0===o&&0===u){if(l<=0&&a>=0)return 0;if(a<=0&&l>=0)return 0}h=c,o=u,a=l}}return r%2!=0}var km=function(t,e,n={}){if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");const i=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return[...t.geometry.coordinates];if("Point"===t.type)return[...t.coordinates]}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return[...t];throw new Error("coord must be GeoJSON Point or an Array of numbers")}(t),r="Feature"===(s=e).type?s.geometry:s;var s;const a=r.type,o=e.bbox;let l=r.coordinates;if(o&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,o))return!1;"Polygon"===a&&(l=[l]);let u=!1;for(var h=0;h<l.length;++h){const t=Fm(i,l[h]);if(0===t)return!n.ignoreBoundary;t&&(u=!0)}return u};const zm=1e-6;class qm{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const i=(t=+t)+(n=+n),r=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>zm||Math.abs(this._y1-r)>zm)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(t,e,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class Gm{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class Vm{constructor(t,[e,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(e=+e)&&(r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=i,this.xmin=e,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this;let r,s;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let i,o,l=0,u=0,h=n.length;l<h;l+=3,u+=2){const h=2*n[l],c=2*n[l+1],A=2*n[l+2],d=t[h],p=t[h+1],f=t[c],m=t[c+1],g=t[A],y=t[A+1],v=f-d,_=m-p,x=g-d,b=y-p,S=2*(v*b-_*x);if(Math.abs(S)<1e-9){if(void 0===r){r=s=0;for(const n of e)r+=t[2*n],s+=t[2*n+1];r/=e.length,s/=e.length}const n=1e9*Math.sign((r-d)*b-(s-p)*x);i=(d+g)/2-n*b,o=(p+y)/2+n*x}else{const t=1/S,e=v*v+_*_,n=x*x+b*b;i=d+(b*e-_*n)*t,o=p+(v*n-x*e)*t}a[u]=i,a[u+1]=o}let o,l,u,h=e[e.length-1],c=4*h,A=t[2*h],d=t[2*h+1];i.fill(0);for(let n=0;n<e.length;++n)h=e[n],o=c,l=A,u=d,c=4*h,A=t[2*h],d=t[2*h+1],i[o+2]=i[c]=u-d,i[o+3]=i[c+1]=A-l}render(t){const e=null==t?t=new qm:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:s,vectors:a}=this;if(r.length<=1)return null;for(let e=0,i=n.length;e<i;++e){const i=n[e];if(i<e)continue;const r=2*Math.floor(e/3),a=2*Math.floor(i/3),o=s[r],l=s[r+1],u=s[a],h=s[a+1];this._renderSegment(o,l,u,h,t)}let o,l=r[r.length-1];for(let e=0;e<r.length;++e){o=l,l=r[e];const n=2*Math.floor(i[l]/3),u=s[n],h=s[n+1],c=4*o,A=this._project(u,h,a[c+2],a[c+3]);A&&this._renderSegment(u,h,A[0],A[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new qm:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new qm:void 0,i=this._clip(t);if(null===i||!i.length)return;e.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let t=2;t<r;t+=2)i[t]===i[t-2]&&i[t+1]===i[t-1]||e.lineTo(i[t],i[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new Gm;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,i,r){let s;const a=this._regioncode(t,e),o=this._regioncode(n,i);0===a&&0===o?(r.moveTo(t,e),r.lineTo(n,i)):(s=this._clipSegment(t,e,n,i,a,o))&&(r.moveTo(s[0],s[1]),r.lineTo(s[2],s[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let i=0,r=e.length;i<r;i+=2)for(let s=0,a=t.length;s<a;s+=2)if(e[i]===t[s]&&e[i+1]===t[s+1]&&e[(i+2)%r]===t[(s+a-2)%a]&&e[(i+3)%r]===t[(s+a-1)%a]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,s=n[t];if(-1===s)return null;const a=[];let o=s;do{const n=Math.floor(o/3);if(a.push(e[2*n],e[2*n+1]),o=o%3==2?o-2:o+1,r[o]!==t)break;o=i[o]}while(o!==s&&-1!==o);return a}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,i=4*t;return this._simplify(n[i]||n[i+1]?this._clipInfinite(t,e,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(t,e))}_clipFinite(t,e){const n=e.length;let i,r,s,a,o=null,l=e[n-2],u=e[n-1],h=this._regioncode(l,u),c=0;for(let A=0;A<n;A+=2)if(i=l,r=u,l=e[A],u=e[A+1],s=h,h=this._regioncode(l,u),0===s&&0===h)a=c,c=0,o?o.push(l,u):o=[l,u];else{let e,n,A,d,p;if(0===s){if(null===(e=this._clipSegment(i,r,l,u,s,h)))continue;[n,A,d,p]=e}else{if(null===(e=this._clipSegment(l,u,i,r,h,s)))continue;[d,p,n,A]=e,a=c,c=this._edgecode(n,A),a&&c&&this._edge(t,a,c,o,o.length),o?o.push(n,A):o=[n,A]}a=c,c=this._edgecode(d,p),a&&c&&this._edge(t,a,c,o,o.length),o?o.push(d,p):o=[d,p]}if(o)a=c,c=this._edgecode(o[0],o[1]),a&&c&&this._edge(t,a,c,o,o.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return o}_clipSegment(t,e,n,i,r,s){const a=r<s;for(a&&([t,e,n,i,r,s]=[n,i,t,e,s,r]);;){if(0===r&&0===s)return a?[n,i,t,e]:[t,e,n,i];if(r&s)return null;let o,l,u=r||s;8&u?(o=t+(n-t)*(this.ymax-e)/(i-e),l=this.ymax):4&u?(o=t+(n-t)*(this.ymin-e)/(i-e),l=this.ymin):2&u?(l=e+(i-e)*(this.xmax-t)/(n-t),o=this.xmax):(l=e+(i-e)*(this.xmin-t)/(n-t),o=this.xmin),r?(t=o,e=l,r=this._regioncode(t,e)):(n=o,i=l,s=this._regioncode(n,i))}}_clipInfinite(t,e,n,i,r,s){let a,o=Array.from(e);if((a=this._project(o[0],o[1],n,i))&&o.unshift(a[0],a[1]),(a=this._project(o[o.length-2],o[o.length-1],r,s))&&o.push(a[0],a[1]),o=this._clipFinite(t,o))for(let e,n=0,i=o.length,r=this._edgecode(o[i-2],o[i-1]);n<i;n+=2)e=r,r=this._edgecode(o[n],o[n+1]),e&&r&&(n=this._edge(t,e,r,o,n),i=o.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(o=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return o}_edge(t,e,n,i,r){for(;e!==n;){let n,s;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,s=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,s=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,s=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,s=this.ymin}i[r]===n&&i[r+1]===s||!this.contains(t,n,s)||(i.splice(r,0,n,s),r+=2)}return r}_project(t,e,n,i){let r,s,a,o=1/0;if(i<0){if(e<=this.ymin)return null;(r=(this.ymin-e)/i)<o&&(a=this.ymin,s=t+(o=r)*n)}else if(i>0){if(e>=this.ymax)return null;(r=(this.ymax-e)/i)<o&&(a=this.ymax,s=t+(o=r)*n)}if(n>0){if(t>=this.xmax)return null;(r=(this.xmax-t)/n)<o&&(s=this.xmax,a=e+(o=r)*i)}else if(n<0){if(t<=this.xmin)return null;(r=(this.xmin-t)/n)<o&&(s=this.xmin,a=e+(o=r)*i)}return[s,a]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e<t.length;e+=2){const n=(e+2)%t.length,i=(e+4)%t.length;(t[e]===t[n]&&t[n]===t[i]||t[e+1]===t[n+1]&&t[n+1]===t[i+1])&&(t.splice(n,2),e-=2)}t.length||(t=null)}return t}}const Hm=2*Math.PI,jm=Math.pow;function Wm(t){return t[0]}function Xm(t){return t[1]}function Ym(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class Qm{static from(t,e=Wm,n=Xm,i){return new Qm("length"in t?function(t,e,n,i){const r=t.length,s=new Float64Array(2*r);for(let a=0;a<r;++a){const r=t[a];s[2*a]=e.call(i,r,a,t),s[2*a+1]=n.call(i,r,a,t)}return s}(t,e,n,i):Float64Array.from(function*(t,e,n,i){let r=0;for(const s of t)yield e.call(i,s,r,t),yield n.call(i,s,r,t),++r}(t,e,n,i)))}constructor(t){this._delaunator=new Nm(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const i=2*e[t],r=2*e[t+1],s=2*e[t+2];if((n[s]-n[i])*(n[r+1]-n[i+1])-(n[r]-n[i])*(n[s+1]-n[i+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let t=0,n=e.length/2;t<n;++t){const n=Ym(e[2*t],e[2*t+1],r);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new Nm(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=r[t%3==2?t-2:t+1];-1!==n[t]&&-1!==s[e]||(s[e]=t)}for(let t=0,e=i.length;t<e;++t)a[i[t]]=t;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,2===i.length&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Vm(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:s,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e<a.length-1&&(yield a[e+1]))}const o=e[t];if(-1===o)return;let l=o,u=-1;do{if(yield u=s[l],l=l%3==2?l-2:l+1,s[l]!==t)return;if(l=r[l],-1===l){const e=n[(i[t]+1)%n.length];return void(e!==u&&(yield e))}}while(l!==o)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const i=n;let r;for(;(r=this._step(n,t,e))>=0&&r!==n&&r!==i;)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:s,halfedges:a,triangles:o,points:l}=this;if(-1===i[t]||!l.length)return(t+1)%(l.length>>1);let u=t,h=jm(e-l[2*t],2)+jm(n-l[2*t+1],2);const c=i[t];let A=c;do{let i=o[A];const c=jm(e-l[2*i],2)+jm(n-l[2*i+1],2);if(c<h&&(h=c,u=i),A=A%3==2?A-2:A+1,o[A]!==t)break;if(A=a[A],-1===A){if(A=r[(s[t]+1)%r.length],A!==i&&jm(e-l[2*A],2)+jm(n-l[2*A+1],2)<h)return A;break}}while(A!==c);return u}render(t){const e=null==t?t=new qm:void 0,{points:n,halfedges:i,triangles:r}=this;for(let e=0,s=i.length;e<s;++e){const s=i[e];if(s<e)continue;const a=2*r[e],o=2*r[s];t.moveTo(n[a],n[a+1]),t.lineTo(n[o],n[o+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"==typeof t.moveTo||(e=t,t=null),e=null==e?2:+e;const n=null==t?t=new qm:void 0,{points:i}=this;for(let n=0,r=i.length;n<r;n+=2){const r=i[n],s=i[n+1];t.moveTo(r+e,s),t.arc(r,s,e,0,Hm)}return n&&n.value()}renderHull(t){const e=null==t?t=new qm:void 0,{hull:n,points:i}=this,r=2*n[0],s=n.length;t.moveTo(i[r],i[r+1]);for(let e=1;e<s;++e){const r=2*n[e];t.lineTo(i[r],i[r+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new Gm;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new qm:void 0,{points:i,triangles:r}=this,s=2*r[t*=3],a=2*r[t+1],o=2*r[t+2];return e.moveTo(i[s],i[s+1]),e.lineTo(i[a],i[a+1]),e.lineTo(i[o],i[o+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new Gm;return this.renderTriangle(t,e),e.value()}}const $m=Math.PI,Zm=$m/2,Km=180/$m,Jm=$m/180,tg=Math.atan2,eg=Math.cos,ng=Math.max,ig=Math.min,rg=Math.sin,sg=Math.sign||function(t){return t>0?1:t<0?-1:0},ag=Math.sqrt;function og(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function lg(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ug(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function hg(t){var e=ag(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);return[t[0]/e,t[1]/e,t[2]/e]}function cg(t){return[tg(t[1],t[0])*Km,(e=ng(-1,ig(1,t[2])),(e>1?Zm:e<-1?-Zm:Math.asin(e))*Km)];var e}function Ag(t){const e=t[0]*Jm,n=t[1]*Jm,i=eg(n);return[i*eg(e),i*rg(e),rg(n)]}function dg(t){return og((t=t.map((t=>Ag(t))))[0],lg(t[2],t[1]))}function pg(t){const e=function(t){if(t.length<2)return{};let e=0;for(;isNaN(t[e][0]+t[e][1])&&e++<t.length;);const n=function(t){function e(e){return(e=t(e[0]*qh,e[1]*qh))[0]*=zh,e[1]*=zh,e}return t=MA(t[0]*qh,t[1]*qh,t.length>2?t[2]*qh:0),e.invert=function(e){return(e=t.invert(e[0]*qh,e[1]*qh))[0]*=zh,e[1]*=zh,e},e}(t[e]),i=Rd().translate([0,0]).scale(1).rotate(n.invert([180,0]));t=t.map(i);const r=[];let s=1;for(let e=0,n=t.length;e<n;e++){let n=t[e][0]**2+t[e][1]**2;!isFinite(n)||n>1e32?r.push(e):n>s&&(s=n)}const a=1e6*ag(s);r.forEach((e=>t[e]=[a,0])),t.push([0,a]),t.push([-a,0]),t.push([0,-a]);const o=Qm.from(t);o.projection=i;const{triangles:l,halfedges:u,inedges:h}=o;for(let n=0,i=u.length;n<i;n++)if(u[n]<0){const t=n%3==2?n-2:n+1,i=n%3==0?n+2:n-1,r=u[t],s=u[i];u[r]=s,u[s]=r,u[t]=u[i]=-1,l[n]=l[t]=l[i]=e,h[l[r]]=r%3==0?r+2:r-1,h[l[s]]=s%3==0?s+2:s-1,n+=2-n%3}else l[n]>t.length-3-1&&(l[n]=e);return o}(t),n=function(t){const{triangles:e}=t;if(!e)return[];const n=[];for(let t=0,i=e.length/3;t<i;t++){const i=e[3*t],r=e[3*t+1],s=e[3*t+2];i!==r&&r!==s&&n.push([i,s,r])}return n}(e),i=function(t,e){const n=new Set;return 2===e.length?[[0,1]]:(t.forEach((t=>{if(t[0]!==t[1]&&!(dg(t.map((t=>e[t])))<0))for(let e,i=0;i<3;i++)e=(i+1)%3,n.add(wh([t[i],t[e]]).join("-"))})),Array.from(n,(t=>t.split("-").map(Number))))}(n,t),r=function(t,e){const n=[];t.forEach((t=>{for(let e=0;e<3;e++){const i=t[e],r=t[(e+1)%3];n[i]=n[i]||[],n[i].push(r)}})),0===t.length&&(2===e?(n[0]=[1],n[1]=[0]):1===e&&(n[0]=[]));return n}(n,t.length),s=function(t,e){function n(t,e){let n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return n*n+i*i+r*r}return function(i,r,s){void 0===s&&(s=0);let a,o,l=s;const u=Ag([i,r]);do{a=s,s=null,o=n(u,Ag(e[a])),t[a].forEach((t=>{let i=n(u,Ag(e[t]));if(i<o)return o=i,s=t,void(l=t)}))}while(null!==s);return l}}(r,t),a=function(t,e){return t.map((t=>{const n=t.map((t=>e[t])).map(Ag);return cg(hg(ug(ug(lg(n[1],n[0]),lg(n[2],n[1])),lg(n[0],n[2]))))}))}(n,t),{polygons:o,centers:l}=function(t,e,n){const i=[],r=t.slice();if(0===e.length){if(n.length<2)return{polygons:i,centers:r};if(2===n.length){const t=Ag(n[0]),e=Ag(n[1]),s=hg(ug(t,e)),o=hg(lg(t,e)),l=lg(s,o),u=[s,lg(s,l),lg(lg(s,l),l),lg(lg(lg(s,l),l),l)].map(cg).map(a);return i.push(u),i.push(u.slice().reverse()),{polygons:i,centers:r}}}e.forEach(((t,e)=>{for(let n=0;n<3;n++){const r=t[n],s=t[(n+1)%3],a=t[(n+2)%3];i[r]=i[r]||[],i[r].push([s,a,e,[r,s,a]])}}));const s=i.map((t=>{const e=[t[0][2]];let i=t[0][1];for(let n=1;n<t.length;n++)for(let n=0;n<t.length;n++)if(t[n][0]==i){i=t[n][1],e.push(t[n][2]);break}if(e.length>2)return e;if(2==e.length){const i=fg(n[t[0][3][0]],n[t[0][3][1]],r[e[0]]),s=fg(n[t[0][3][2]],n[t[0][3][0]],r[e[0]]),o=a(i),l=a(s);return[e[0],l,e[1],o]}}));function a(t){let n=-1;return r.slice(e.length,1/0).forEach(((i,r)=>{i[0]===t[0]&&i[1]===t[1]&&(n=r+e.length)})),n<0&&(n=r.length,r.push(t)),n}return{polygons:s,centers:r}}(a,n,t),u=function(t){const e=[];return t.forEach((t=>{if(!t)return;let n=t[t.length-1];for(let i of t)i>n&&e.push([n,i]),n=i})),e}(o),h=function(t,e){const n=new Set,i=[];t.map((t=>{if(!(dg(t.map((t=>e[t>e.length?0:t])))>1e-12))for(let e=0;e<3;e++){let i=[t[e],t[(e+1)%3]],r=`${i[0]}-${i[1]}`;n.has(r)?n.delete(r):n.add(`${i[1]}-${i[0]}`)}}));const r=new Map;let s;if(n.forEach((t=>{t=t.split("-").map(Number),r.set(t[0],t[1]),s=t[0]})),void 0===s)return i;let a=s;do{i.push(a);let t=r.get(a);r.set(a,-1),a=t}while(a>-1&&a!==s);return i}(n,t),c=function(t,e){return function(n){const i=new Map,r=new Map;return t.forEach(((t,e)=>{const s=t.join("-");i.set(s,n[e]),r.set(s,!0)})),e.forEach((t=>{let e=0,n=-1;for(let r=0;r<3;r++){let s=wh([t[r],t[(r+1)%3]]).join("-");i.get(s)>e&&(e=i.get(s),n=s)}r.set(n,!1)})),t.map((t=>r.get(t.join("-"))))}}(i,n);return{delaunay:e,edges:i,triangles:n,centers:l,neighbors:r,polygons:o,mesh:u,hull:h,urquhart:c,find:s}}function fg(t,e,n){t=Ag(t),e=Ag(e),n=Ag(n);const i=sg(og(lg(e,t),n));return cg(hg(ug(t,e)).map((t=>i*t)))}function mg(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function gg(t,e,n){return e=yg(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,vg()?Reflect.construct(e,[],yg(t).constructor):e.apply(t,n))}function yg(t){return yg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yg(t)}function vg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(vg=function(){return!!t})()}function _g(t,e){return _g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_g(t,e)}function xg(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||Sg(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bg(t){return function(t){if(Array.isArray(t))return mg(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Sg(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sg(t,e){if(t){if("string"==typeof t)return mg(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mg(t,e):void 0}}function Mg(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).resolution,n=void 0===e?1/0:e,i=function(t,e){return t.map((function(t){var n,i=[];return t.forEach((function(t){if(n){var r=180*td(t,n)/Math.PI;if(r>e)for(var s=Ad(n,t),a=1/Math.ceil(r/e),o=a;o<1;)i.push(s(o)),o+=a}i.push(n=t)})),i}))}(t,n),r=Dh(i),s=function(t,e){var n={type:"Polygon",coordinates:t},i=uA(n),r=xg(i,2),s=xg(r[0],2),a=s[0],o=s[1],l=xg(r[1],2),u=l[0],h=l[1];if(Math.min(Math.abs(u-a),Math.abs(h-o))<e)return[];var c=a>u||h>=89||o<=-89;return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.minLng,i=e.maxLng,r=e.minLat,s=e.maxLat,a=Math.round(Math.pow(360/t,2)/Math.PI),o=(1+Math.sqrt(5))/2,l=function(t){return t/o*360%360-180},u=function(t){return Math.acos(2*t/a-1)/Math.PI*180-90},h=function(t){return a*(Math.cos((t+90)*Math.PI/180)+1)/2},c=[void 0!==s?Math.ceil(h(s)):0,void 0!==r?Math.floor(h(r)):a-1],A=void 0===n&&void 0===i?function(){return!0}:void 0===n?function(t){return t<=i}:void 0===i?function(t){return t>=n}:i>=n?function(t){return t>=n&&t<=i}:function(t){return t>=n||t<=i},d=[],p=c[0];p<=c[1];p++){var f=l(p);A(f)&&d.push([f,u(p)])}return d}(e,{minLng:a,maxLng:u,minLat:o,maxLat:h}).filter((function(t){return wg(t,n,c)}))}(t,n),a=[].concat(bg(r),bg(s)),o={type:"Polygon",coordinates:t},l=xg(uA(o),2),u=xg(l[0],2),h=u[0],c=u[1],A=xg(l[1],2),d=A[0],p=A[1],f=h>d||p>=89||c<=-89,m=[];if(f){var g=function(t){const e=function(t){if(e.delaunay=null,e._data=t,"object"==typeof e._data&&"FeatureCollection"===e._data.type&&(e._data=e._data.features),"object"==typeof e._data){const t=e._data.map((t=>[e._vx(t),e._vy(t),t])).filter((t=>isFinite(t[0]+t[1])));e.points=t.map((t=>[t[0],t[1]])),e.valid=t.map((t=>t[2])),e.delaunay=pg(e.points)}return e};return e._vx=function(t){return"object"==typeof t&&"type"in t?xA(t)[0]:0 in t?t[0]:void 0},e._vy=function(t){return"object"==typeof t&&"type"in t?xA(t)[1]:1 in t?t[1]:void 0},e.x=function(t){return t?(e._vx=t,e):e._vx},e.y=function(t){return t?(e._vy=t,e):e._vy},e.polygons=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n={type:"FeatureCollection",features:[]};return 0===e.valid.length||(e.delaunay.polygons.forEach(((t,i)=>n.features.push({type:"Feature",geometry:t?{type:"Polygon",coordinates:[[...t,t[0]].map((t=>e.delaunay.centers[t]))]}:null,properties:{site:e.valid[i],sitecoordinates:e.points[i],neighbours:e.delaunay.neighbors[i]}}))),1===e.valid.length&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:e.valid[0],sitecoordinates:e.points[0],neighbours:[]}})),n},e.triangles=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"FeatureCollection",features:e.delaunay.triangles.map(((t,n)=>((t=t.map((t=>e.points[t]))).center=e.delaunay.centers[n],t))).filter((t=>dg(t)>0)).map((t=>({type:"Feature",properties:{circumcenter:t.center},geometry:{type:"Polygon",coordinates:[[...t,t[0]]]}})))}},e.links=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n=e.delaunay.edges.map((t=>td(e.points[t[0]],e.points[t[1]]))),i=e.delaunay.urquhart(n);return{type:"FeatureCollection",features:e.delaunay.edges.map(((t,r)=>({type:"Feature",properties:{source:e.valid[t[0]],target:e.valid[t[1]],length:n[r],urquhart:!!i[r]},geometry:{type:"LineString",coordinates:[e.points[t[0]],e.points[t[1]]]}})))}},e.mesh=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"MultiLineString",coordinates:e.delaunay.edges.map((t=>[e.points[t[0]],e.points[t[1]]]))}},e.cellMesh=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const{centers:n,polygons:i}=e.delaunay,r=[];for(const t of i)if(t)for(let e=t.length,i=t[e-1],s=t[0],a=0;a<e;i=s,s=t[++a])s>i&&r.push([n[i],n[s]]);return{type:"MultiLineString",coordinates:r}},e._found=void 0,e.find=function(t,n,i){if(e._found=e.delaunay.find(t,n,e._found),!i||td([t,n],e.points[e._found])<i)return e._found},e.hull=function(t){void 0!==t&&e(t);const n=e.delaunay.hull,i=e.points;return 0===n.length?null:{type:"Polygon",coordinates:[[...n.map((t=>i[t])),i[n[0]]]]}},t?e(t):e}(a).triangles(),y=new Map(a.map((function(t,e){var n=xg(t,2),i=n[0],r=n[1];return["".concat(i,"-").concat(r),e]})));g.features.forEach((function(t){var e,n=t.geometry.coordinates[0].slice(0,3).reverse(),i=[];if(n.forEach((function(t){var e=xg(t,2),n=e[0],r=e[1],s="".concat(n,"-").concat(r);y.has(s)&&i.push(y.get(s))})),3===i.length){if(i.some((function(t){return t<r.length})))if(!wg(t.properties.circumcenter,o,f))return;(e=m).push.apply(e,i)}}))}else if(s.length)for(var v=Nm.from(a),_=function(t){var e,n=[2,1,0].map((function(e){return v.triangles[t+e]})),i=n.map((function(t){return a[t]}));if(n.some((function(t){return t<r.length}))){var s=[0,1].map((function(t){return function(t,e){let n=0,i=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,i+=e);else{let r=-1;for(let s of t)null!=(s=e(s,++r,t))&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}(i,(function(e){return e[t]}))}));if(!wg(s,o,f))return 1}(e=m).push.apply(e,bg(n))},x=0,b=v.triangles.length;x<b;x+=3)_(x);else{var S=vh(i),M=S.vertices,w=S.holes;m=Yu(M,void 0===w?[]:w,2)}var T=ym(wh(a,(function(t){return t[0]})),[0,1]),E=ym(wh(a,(function(t){return t[1]})),[0,1]),C=a.map((function(t){var e=xg(t,2),n=e[0],i=e[1];return[T(n),E(i)]}));return{contour:i,triangles:{points:a,indices:m,uvs:C}}}function wg(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(t,e){return(t&&ed.hasOwnProperty(t.type)?ed[t.type]:id)(t,e)}(e,t):km(t,e)}var Tg=window.THREE?window.THREE:{BufferGeometry:Gi,Float32BufferAttribute:Li},Eg=(new Tg.BufferGeometry).setAttribute?"setAttribute":"addAttribute",Cg=function(t){function e(t,n,i,r,s,a,o){var l;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(l=gg(this,e)).type="ConicPolygonBufferGeometry",l.parameters={polygonGeoJson:t,startHeight:n,endHeight:i,closedBottom:r,closedTop:s,includeSides:a,curvatureResolution:o},n=n||0,i=i||1,r=void 0===r||r,s=void 0===s||s,a=void 0===a||a;var u=Mg(t,{resolution:o=o||5}),h=u.contour,c=u.triangles,A=Dh(c.uvs),d=[],p=[],f=[],m=0,g=function(t){var e=Math.round(d.length/3),n=f.length;d=d.concat(t.vertices),p=p.concat(t.uvs),f=f.concat(e?t.indices.map((function(t){return t+e})):t.indices),l.addGroup(n,f.length-n,m++)};function y(t,e){var n=t.map((function(t){return t.map((function(t){var n=xg(t,2),i=n[0];return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=(90-t)*Math.PI/180,r=(90-e)*Math.PI/180;return[n*Math.sin(i)*Math.cos(r),n*Math.cos(i),n*Math.sin(i)*Math.sin(r)]}(n[1],i,e)}))}));return vh(n)}function v(t){return{indices:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?c.indices:c.indices.slice().reverse(),vertices:y([c.points],t).vertices,uvs:A}}return a&&g(function(){for(var t=y(h,n),e=t.vertices,r=t.holes,s=y(h,i).vertices,a=Dh([s,e]),o=Math.round(s.length/3),l=new Set(r),u=0,c=[],A=0;A<o;A++){var d=A+1;if(d===o)d=u;else if(l.has(d)){var p=d;d=u,u=p}c.push(A,A+o,d+o),c.push(d+o,d,A)}for(var f=[],m=1;m>=0;m--)for(var g=0;g<o;g+=1)f.push(g/(o-1),m);return{indices:c,vertices:a,uvs:f}}()),r&&g(v(n,!1)),s&&g(v(i,!0)),l.setIndex(f),l[Eg]("position",new Tg.Float32BufferAttribute(d,3)),l[Eg]("uv",new Tg.Float32BufferAttribute(p,2)),l.computeVertexNormals(),l}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_g(t,e)}(e,t),n=e,Object.defineProperty(n,"prototype",{writable:!1}),n;var n}(Tg.BufferGeometry);var Rg=function(t){var e,n=void 0!==(t=t||{})?t:{},i={};for(e in n)n.hasOwnProperty(e)&&(i[e]=n[e]);var r,s,a,o,l;r="object"==typeof window,s="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,a=o&&!r&&!s,l=!r&&!a&&!s;var u,h,c,A,d,p="";a?(p=__dirname+"/",u=function(t,e){var n;return(n=it(t))||(A||(A=require("fs")),d||(d=require("path")),t=d.normalize(t),n=A.readFileSync(t)),e?n:n.toString()},c=function(t){var e=u(t,!0);return e.buffer||(e=new Uint8Array(e)),v(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return"[Emscripten Module object]"}):l?("undefined"!=typeof read&&(u=function(t){var e=it(t);return e?et(e):read(t)}),c=function(t){var e;return(e=it(t))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(v("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(r||s)&&(s?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",u=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(e){var n=it(t);if(n)return et(n);throw e}},s&&(c=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var n=it(t);if(n)return n;throw e}}),h=function(t,e,n){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){if(200==i.status||0==i.status&&i.response)e(i.response);else{var r=it(t);r?e(r.buffer):n()}},i.onerror=n,i.send(null)});var f=n.print||console.log.bind(console),m=n.printErr||console.warn.bind(console);for(e in i)i.hasOwnProperty(e)&&(n[e]=i[e]);i=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram;var g=0;var y=!1;function v(t,e){t||gt("Assertion failed: "+e)}function _(t){var e=n["_"+t];return v(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function x(t,e,n,i,r){var s={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,i){if(!(i>0))return 0;for(var r=n,s=n+i-1,a=0;a<t.length;++a){var o=t.charCodeAt(a);if(o>=55296&&o<=57343)o=65536+((1023&o)<<10)|1023&t.charCodeAt(++a);if(o<=127){if(n>=s)break;e[n++]=o}else if(o<=2047){if(n+1>=s)break;e[n++]=192|o>>6,e[n++]=128|63&o}else if(o<=65535){if(n+2>=s)break;e[n++]=224|o>>12,e[n++]=128|o>>6&63,e[n++]=128|63&o}else{if(n+3>=s)break;e[n++]=240|o>>18,e[n++]=128|o>>12&63,e[n++]=128|o>>6&63,e[n++]=128|63&o}}e[n]=0})(t,M,e,n)})(t,e=lt(n),n)}return e},array:function(t){var e=lt(t.length);return function(t,e){S.set(t,e)}(t,e),e}};var a=_(t),o=[],l=0;if(i)for(var u=0;u<i.length;u++){var h=s[n[u]];h?(0===l&&(l=ht()),o[u]=h(i[u])):o[u]=i[u]}var c=a.apply(null,o);return c=function(t){return"string"===e?N(t):"boolean"===e?Boolean(t):t}(c),0!==l&&ut(l),c}var b,S,M,w,T,E,C,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function N(t,e){return t?function(t,e,n){for(var i=e+n,r=e;t[r]&&!(r>=i);)++r;if(r-e>16&&t.subarray&&R)return R.decode(t.subarray(e,r));for(var s="";e<r;){var a=t[e++];if(128&a){var o=63&t[e++];if(192!=(224&a)){var l=63&t[e++];if((a=224==(240&a)?(15&a)<<12|o<<6|l:(7&a)<<18|o<<12|l<<6|63&t[e++])<65536)s+=String.fromCharCode(a);else{var u=a-65536;s+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else s+=String.fromCharCode((31&a)<<6|o)}else s+=String.fromCharCode(a)}return s}(M,t,e):""}function P(t,e){return t%e>0&&(t+=e-t%e),t}function D(t){b=t,n.HEAP8=S=new Int8Array(t),n.HEAP16=w=new Int16Array(t),n.HEAP32=T=new Int32Array(t),n.HEAPU8=M=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=E=new Float32Array(t),n.HEAPF64=C=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var I=n.TOTAL_MEMORY||33554432;function L(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var i=e.func;"number"==typeof i?void 0===e.arg?n.dynCall_v(i):n.dynCall_vi(i,e.arg):i(void 0===e.arg?null:e.arg)}else e()}}I=(b=n.buffer?n.buffer:new ArrayBuffer(I)).byteLength,D(b),T[6032]=5267040;var B=[],U=[],O=[],F=[];var k=Math.abs,z=Math.ceil,q=Math.floor,G=Math.min,V=0,H=null;n.preloadedImages={},n.preloadedAudios={};var j,W,X=null,Y="data:application/octet-stream;base64,";function Q(t){return String.prototype.startsWith?t.startsWith(Y):0===t.indexOf(Y)}X="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function $(t){return t}function Z(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function K(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function J(){return S.length}function tt(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(S),st(e),D(e),1}catch(t){}}function et(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];i>255&&(i&=255),e.push(String.fromCharCode(i))}return e.join("")}var nt="function"==typeof atob?atob:function(t){var e,n,i,r,s,a,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=o.indexOf(t.charAt(u++))<<2|(r=o.indexOf(t.charAt(u++)))>>4,n=(15&r)<<4|(s=o.indexOf(t.charAt(u++)))>>2,i=(3&s)<<6|(a=o.indexOf(t.charAt(u++))),l+=String.fromCharCode(e),64!==s&&(l+=String.fromCharCode(n)),64!==a&&(l+=String.fromCharCode(i))}while(u<t.length);return l};function it(t){if(Q(t))return function(t){if("boolean"==typeof a&&a){var e;try{e=Buffer.from(t,"base64")}catch(n){e=new Buffer(t,"base64")}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var n=nt(t),i=new Uint8Array(n.length),r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(Y.length))}var rt=function(t,e,n){var i=new t.Int8Array(n),r=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var s=new t.Float64Array(n),a=0|e.o,o=0|e.p,l=t.Math.floor,u=t.Math.abs,h=t.Math.sqrt,c=t.Math.pow,A=t.Math.cos,d=t.Math.sin,p=t.Math.tan,f=t.Math.acos,m=t.Math.asin,g=t.Math.atan,y=t.Math.atan2,v=t.Math.ceil,_=t.Math.imul,x=t.Math.min,b=t.Math.max,S=t.Math.clz32,M=e.b,w=e.c,T=e.d,E=e.e,C=e.f,R=e.g,N=e.h,P=e.i,D=24160;function I(t,e,n,i){return 0|L(t|=0,e|=0,n|=0,i|=0,0)}function L(t,e,n,i,s){var a,o=0,l=0,u=0,h=0;if(a=D,D=D+16|0,l=a,!(0|B(t|=0,e|=0,n|=0,i|=0,s|=0)))return D=a,0|(i=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(o=0|ee(15,l)))break;l=0|r[(u=l)>>2],u=0|r[u+4>>2]}else h=0|Oe(0|n,0|(o=((0|n)<0)<<31>>31),3,0),u=0|w(),o=0|De(0|n,0|o,1,0),o=0|De(0|(o=0|Oe(0|h,0|u,0|o,0|w())),0|w(),1,0),u=0|w(),r[l>>2]=o,r[l+4>>2]=u,l=o;if(Xe(0|i,0,l<<3),0|s){Xe(0|s,0,l<<2),o=0|U(t,e,n,i,s,l,u,0);break}(o=0|Pe(l,4))?(h=0|U(t,e,n,i,o,l,u,0),Ne(o),o=h):o=13}else o=2}while(0);return D=a,0|(h=o)}function B(t,e,n,i,s){t|=0,e|=0,n|=0,i|=0,s|=0;var a,o,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0;if(o=D,D=D+16|0,m=o+8|0,r[(f=a=o)>>2]=t,r[f+4>>2]=e,(0|n)<0)return D=o,0|(m=2);if(r[(l=i)>>2]=t,r[l+4>>2]=e,(l=!!(0|s))&&(r[s>>2]=0),0|Ot(t,e))return D=o,0|(m=9);r[m>>2]=0;t:do{if((0|n)>=1)if(l)for(d=1,A=0,p=0,f=1,l=t;;){if(!(A|p)){if(0|(l=0|O(l,e,4,m,a)))break t;if(0|Ot(l=0|r[(e=a)>>2],e=0|r[e+4>>2])){l=9;break t}}if(0|(l=0|O(l,e,0|r[22384+(p<<2)>>2],m,a)))break t;if(l=0|r[(e=a)>>2],e=0|r[e+4>>2],r[(t=i+(d<<3)|0)>>2]=l,r[t+4>>2]=e,r[s+(d<<2)>>2]=f,u=(0|(t=A+1|0))==(0|f),c=6==(0|(h=p+1|0)),0|Ot(l,e)){l=9;break t}if((0|(f=f+(c&u&1)|0))>(0|n)){l=0;break}d=d+1|0,A=u?0:t,p=u?c?0:h:p}else for(d=1,A=0,p=0,f=1,l=t;;){if(!(A|p)){if(0|(l=0|O(l,e,4,m,a)))break t;if(0|Ot(l=0|r[(e=a)>>2],e=0|r[e+4>>2])){l=9;break t}}if(0|(l=0|O(l,e,0|r[22384+(p<<2)>>2],m,a)))break t;if(l=0|r[(e=a)>>2],e=0|r[e+4>>2],r[(t=i+(d<<3)|0)>>2]=l,r[t+4>>2]=e,u=(0|(t=A+1|0))==(0|f),c=6==(0|(h=p+1|0)),0|Ot(l,e)){l=9;break t}if((0|(f=f+(c&u&1)|0))>(0|n)){l=0;break}d=d+1|0,A=u?0:t,p=u?c?0:h:p}else l=0}while(0);return D=o,0|(m=l)}function U(t,e,n,i,s,a,o,l){n|=0,i|=0,s|=0,l|=0;var u,h,c,A=0,d=0,p=0,f=0,m=0,g=0,y=0;if(c=D,D=D+16|0,u=c+8|0,h=c,A=0|ke(0|(t|=0),0|(e|=0),0|(a|=0),0|(o|=0)),p=0|w(),!(!(0|(y=0|r[(g=f=i+(A<<3)|0)>>2]))&!(0|(g=0|r[g+4>>2]))|(d=(0|y)==(0|t)&(0|g)==(0|e))))do{A=0|Fe(0|(A=0|De(0|A,0|p,1,0)),0|w(),0|a,0|o),p=0|w(),d=(0|(g=0|r[(y=f=i+(A<<3)|0)>>2]))==(0|t)&(0|(y=0|r[y+4>>2]))==(0|e)}while(!(!(0|g)&!(0|y)|d));if(A=s+(A<<2)|0,d&&(0|r[A>>2])<=(0|l))return D=c,0|(y=0);if(r[(y=f)>>2]=t,r[y+4>>2]=e,r[A>>2]=l,(0|l)>=(0|n))return D=c,0|(y=0);switch(d=l+1|0,r[u>>2]=0,0|(A=0|O(t,e,2,u,h))){case 9:m=9;break;case 0:(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d))||(m=9)}t:do{if(9==(0|m)){switch(r[u>>2]=0,0|(A=0|O(t,e,3,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}switch(r[u>>2]=0,0|(A=0|O(t,e,1,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}switch(r[u>>2]=0,0|(A=0|O(t,e,5,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}switch(r[u>>2]=0,0|(A=0|O(t,e,4,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}switch(r[u>>2]=0,0|(A=0|O(t,e,6,u,h))){case 9:break;case 0:if(0|(A=0|U(0|r[(A=h)>>2],0|r[A+4>>2],n,i,s,a,o,d)))break t;break;default:break t}return D=c,0|(y=0)}}while(0);return D=c,0|(y=A)}function O(t,e,n,i,s){t|=0,e|=0,s|=0;var a,o,l=0,u=0,h=0,c=0,A=0,d=0,p=0;if((n|=0)>>>0>6)return 0|(s=1);if(A=(0|r[(i|=0)>>2])%6|0,r[i>>2]=A,(0|A)>0){l=0;do{n=0|pt(n),l=l+1|0}while((0|l)<(0|r[i>>2]))}if(A=0|qe(0|t,0|e,45),w(),(o=127&A)>>>0>121)return 0|(s=5);a=0|Ft(t,e),l=0|qe(0|t,0|e,52),w(),l&=15;t:do{if(l){for(;;){if(h=0|qe(0|t,0|e,0|(u=3*(15-l|0)|0)),w(),7==(0|(h&=7))){e=5;break}if(p=!(0|Vt(l)),l=l+-1|0,d=0|Ge(7,0,0|u),e&=~w(),t=0|Ge(0|r[(p?432:16)+(28*h|0)+(n<<2)>>2],0,0|u)|t&~d,e|=u=0|w(),!(n=0|r[(p?640:224)+(28*h|0)+(n<<2)>>2])){n=0;break t}if(!l){c=8;break t}}return 0|e}c=8}while(0);8==(0|c)&&(t|=0|Ge(0|(p=0|r[848+(28*o|0)+(n<<2)>>2]),0,45),e=w()|-1040385&e,n=0|r[4272+(28*o|0)+(n<<2)>>2],127&~p||(p=0|Ge(0|r[848+(28*o|0)+20>>2],0,45),e=w()|-1040385&e,n=0|r[4272+(28*o|0)+20>>2],t=0|zt(p|t,e),e=0|w(),r[i>>2]=1+(0|r[i>>2]))),h=0|qe(0|t,0|e,45),w(),h&=127;t:do{if(0|z(h)){e:do{if(1==(0|Ft(t,e))){if((0|o)!=(0|h)){if(0|H(h,0|r[7696+(28*o|0)>>2])){t=0|Gt(t,e),u=1,e=0|w();break}T(23313,22416,436,22424)}switch(0|a){case 3:t=0|zt(t,e),e=0|w(),r[i>>2]=1+(0|r[i>>2]),u=0;break e;case 5:t=0|Gt(t,e),e=0|w(),r[i>>2]=5+(0|r[i>>2]),u=0;break e;case 0:return 0|(p=9);default:return 0|(p=1)}}else u=0}while(0);if((0|n)>0){l=0;do{t=0|kt(t,e),e=0|w(),l=l+1|0}while((0|l)!=(0|n))}if((0|o)!=(0|h)){if(!(0|q(h))){if(!!(0|u)|5!=(0|Ft(t,e)))break;r[i>>2]=1+(0|r[i>>2]);break}switch(127&A){case 8:case 118:break t}3!=(0|Ft(t,e))&&(r[i>>2]=1+(0|r[i>>2]))}}else if((0|n)>0){l=0;do{t=0|zt(t,e),e=0|w(),l=l+1|0}while((0|l)!=(0|n))}}while(0);return r[i>>2]=((0|r[i>>2])+n|0)%6|0,r[(p=s)>>2]=t,r[p+4>>2]=e,0|(p=0)}function F(t,e,n,i){n|=0,i|=0;var s,a,o,l=0,u=0;for(o=D,D=D+16|0,s=o,a=o+8|0,l=(l=!(0|Ot(t|=0,e|=0)))?1:2;;){if(r[a>>2]=0,!(0|O(t,e,l,a,s))&((0|r[(u=s)>>2])==(0|n)?(0|r[u+4>>2])==(0|i):0)){t=4;break}if((l=l+1|0)>>>0>=7){l=7,t=4;break}}return 4==(0|t)?(D=o,0|l):0}function k(t,e,n,i,a,o,l){e|=0,n|=0,i|=0,a|=0,o|=0,l|=0;var u,h,c,A,d,p,f,m,g,y,v=0,_=0,x=0,b=0,S=0,M=0,T=0,E=0,C=0,R=0,N=0,P=0,I=0,L=0,B=0,U=0,O=0,F=0,k=0;if(y=D,D=D+64|0,f=y+48|0,m=y+32|0,g=y+24|0,u=y+8|0,h=y,(0|(_=0|r[(t|=0)>>2]))<=0)return D=y,0|(B=0);for(c=t+4|0,A=f+8|0,d=m+8|0,p=u+8|0,v=0,I=0;;){P=(x=0|r[c>>2])+(I<<4)|0,r[f>>2]=r[P>>2],r[f+4>>2]=r[P+4>>2],r[f+8>>2]=r[P+8>>2],r[f+12>>2]=r[P+12>>2],(0|I)==(_+-1|0)?(r[m>>2]=r[x>>2],r[m+4>>2]=r[x+4>>2],r[m+8>>2]=r[x+8>>2],r[m+12>>2]=r[x+12>>2]):(P=x+(I+1<<4)|0,r[m>>2]=r[P>>2],r[m+4>>2]=r[P+4>>2],r[m+8>>2]=r[P+8>>2],r[m+12>>2]=r[P+12>>2]),_=0|$(f,m,i,g);t:do{if(_)x=0,v=_;else if(_=0|r[(x=g)>>2],(0|(x=0|r[x+4>>2]))>0|!(0|x)&_>>>0>0){N=0,P=0;e:for(;;){if(k=+s[f>>3],F=+((R=0|Ie(0|_,0|x,0|N,0|P))>>>0)+4294967296*+(0|w()),U=+(_>>>0)+4294967296*+(0|x),O=+(N>>>0)+4294967296*+(0|P),s[u>>3]=k*F/U+ +s[m>>3]*O/U,s[p>>3]=+s[A>>3]*F/U+ +s[d>>3]*O/U,0|(_=0|Ht(u,i,h))){v=_;break}M=0|ke(0|(C=0|r[(R=h)>>2]),0|(R=0|r[R+4>>2]),0|e,0|n),b=0|w(),x=0|r[(S=_=l+(M<<3)|0)>>2],S=0|r[S+4>>2];n:do{if(!(0|x)&!(0|S))L=_,B=16;else for(T=0,E=0;;){if((0|T)>(0|n)|(0|T)==(0|n)&E>>>0>e>>>0){v=1;break e}if((0|x)==(0|C)&(0|S)==(0|R))break n;if(M=0|Fe(0|(_=0|De(0|M,0|b,1,0)),0|w(),0|e,0|n),b=0|w(),E=0|De(0|E,0|T,1,0),T=0|w(),!(0|(x=0|r[(S=_=l+(M<<3)|0)>>2]))&!(0|(S=0|r[S+4>>2]))){L=_,B=16;break}}}while(0);if(16!=(0|B)||(B=0,!(0|C)&!(0|R))||(r[(E=L)>>2]=C,r[E+4>>2]=R,E=o+(r[a>>2]<<3)|0,r[E>>2]=C,r[E+4>>2]=R,E=0|De(0|r[(E=a)>>2],0|r[E+4>>2],1,0),C=0|w(),r[(R=a)>>2]=E,r[R+4>>2]=C),N=0|De(0|N,0|P,1,0),P=0|w(),_=0|r[(x=g)>>2],!((0|(x=0|r[x+4>>2]))>(0|P)|(0|x)==(0|P)&_>>>0>N>>>0)){x=1;break t}}x=0}else x=1}while(0);if(I=I+1|0,!x){B=21;break}if((0|I)>=(0|(_=0|r[t>>2]))){v=0,B=21;break}}return 21==(0|B)?(D=y,0|v):0}function z(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|r[7696+(28*t|0)+16>>2])}function q(t){return 4==(0|(t|=0))|117==(0|t)}function G(t){return 0|r[11120+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)>>2]}function V(t){return 0|r[11120+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)+4>>2]}function H(t,e){return e|=0,(0|r[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|r[7696+(28*t|0)+24>>2])==(0|e))}function j(t,e){return 0|r[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function W(t,e){return e|=0,(0|r[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|r[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|r[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|r[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|r[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|r[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|r[848+(28*t|0)+24>>2])==(0|e)?6:7)}function X(t){return+s[(t|=0)+16>>3]<+s[t+24>>3]|0}function Y(t,e){t|=0;var n,i,r=0;return(r=+s[(e|=0)>>3])>=+s[t+8>>3]&&r<=+s[t>>3]?(n=+s[t+16>>3],r=+s[t+24>>3],e=(i=+s[e+8>>3])>=r,t=i<=n&1,n<r?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function Q(t,e,n){t|=0,e|=0,n|=0;var i,o,h,c,A,d,p,f=0,m=0,g=0,y=0,_=0,b=0,S=0;d=D,D=D+288|0,A=d+264|0,y=d+96|0,m=(f=g=d)+96|0;do{r[f>>2]=0,f=f+4|0}while((0|f)<(0|m));return 0|(e=0|Qt(e,g))?(D=d,0|(b=e)):(Xt(g=0|r[(m=g)>>2],m=0|r[m+4>>2],A),Yt(g,m,y),c=+te(A,y+8|0),s[A>>3]=+s[t>>3],s[(m=A+8|0)>>3]=+s[t+16>>3],s[y>>3]=+s[t+8>>3],s[(g=y+8|0)>>3]=+s[t+24>>3],o=+te(A,y),S=+s[m>>3]-+s[g>>3],h=+u(+S),p=+s[A>>3]-+s[y>>3],i=+u(+p),!(0==S|0==p)&&(S=+Ve(+h,+i),S=+v(+o*o/+He(+S/+He(+h,+i),3)/(c*(2.59807621135*c)*.8)),s[a>>3]=S,_=~~S>>>0,b=+u(S)>=1?S>0?~~+x(+l(S/4294967296),4294967295)>>>0:~~+v((S-+(~~S>>>0))/4294967296)>>>0:0,2146435072&~r[a+4>>2])?(y=!(0|_)&!(0|b),r[(e=n)>>2]=y?1:_,r[e+4>>2]=y?0:b,e=0):e=1,D=d,0|(b=e))}function $(t,e,n,i){t|=0,e|=0,n|=0,i|=0;var o,h,c,A,d=0,p=0,f=0;A=D,D=D+288|0,h=A+264|0,c=A+96|0,o=(d=p=A)+96|0;do{r[d>>2]=0,d=d+4|0}while((0|d)<(0|o));return 0|(n=0|Qt(n,p))?(D=A,0|(i=n)):(Xt(d=0|r[(n=p)>>2],n=0|r[n+4>>2],h),Yt(d,n,c),f=+te(h,c+8|0),f=+v(+ +te(t,e)/(2*f)),s[a>>3]=f,n=~~f>>>0,d=+u(f)>=1?f>0?~~+x(+l(f/4294967296),4294967295)>>>0:~~+v((f-+(~~f>>>0))/4294967296)>>>0:0,2146435072&~r[a+4>>2]?(p=!(0|n)&!(0|d),r[i>>2]=p?1:n,r[i+4>>2]=p?0:d,D=A,0|(i=0)):(D=A,0|(i=1)))}function Z(t,e,n,i){e|=0,n|=0,i|=0,r[(t|=0)>>2]=e,r[t+4>>2]=n,r[t+8>>2]=i}function K(t,e){t|=0;var n,i,a,o,l=0,h=0,c=0,A=0,d=0,p=0,f=0;r[(o=(e|=0)+8|0)>>2]=0,i=+s[t>>3],A=+u(+i),a=+s[t+8>>3],A+=.5*(d=+u(+a)/.8660254037844386),A-=+(0|(l=~~A)),d-=+(0|(t=~~d));do{if(A<.5){if(A<.3333333333333333){if(r[e>>2]=l,d<.5*(A+1)){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(t=(1&!(d<(f=1-A)))+t|0,r[e+4>>2]=t,f<=d&d<2*A){l=l+1|0,r[e>>2]=l;break}r[e>>2]=l;break}if(!(A<.6666666666666666)){if(l=l+1|0,r[e>>2]=l,d<.5*A){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(d<1-A){if(r[e+4>>2]=t,2*A-1<d){r[e>>2]=l;break}}else t=t+1|0,r[e+4>>2]=t;l=l+1|0,r[e>>2]=l}while(0);do{if(i<0){if(1&t){l=~~(+(0|l)-(2*(+((p=0|Ie(0|l,((0|l)<0)<<31>>31,0|(p=(t+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|w()))+1)),r[e>>2]=l;break}l=~~(+(0|l)-2*(+((p=0|Ie(0|l,((0|l)<0)<<31>>31,0|(p=(0|t)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|w()))),r[e>>2]=l;break}}while(0);p=e+4|0,a<0&&(l=l-((1|t<<1)/2|0)|0,r[e>>2]=l,t=0-t|0,r[p>>2]=t),h=t-l|0,(0|l)<0?(c=0-l|0,r[p>>2]=h,r[o>>2]=c,r[e>>2]=0,t=h,l=0):c=0,(0|t)<0&&(l=l-t|0,r[e>>2]=l,c=c-t|0,r[o>>2]=c,r[p>>2]=0,t=0),n=l-c|0,h=t-c|0,(0|c)<0&&(r[e>>2]=n,r[p>>2]=h,r[o>>2]=0,t=h,l=n,c=0),(0|(h=(0|c)<(0|(h=(0|t)<(0|l)?t:l))?c:h))<=0||(r[e>>2]=l-h,r[p>>2]=t-h,r[o>>2]=c-h)}function J(t){var e,n=0,i=0,s=0,a=0,o=0;n=0|r[(t|=0)>>2],i=0|r[(e=t+4|0)>>2],(0|n)<0&&(i=i-n|0,r[e>>2]=i,r[(o=t+8|0)>>2]=(0|r[o>>2])-n,r[t>>2]=0,n=0),(0|i)<0?(n=n-i|0,r[t>>2]=n,a=(0|r[(o=t+8|0)>>2])-i|0,r[o>>2]=a,r[e>>2]=0,i=0):(o=a=t+8|0,a=0|r[a>>2]),(0|a)<0&&(n=n-a|0,r[t>>2]=n,i=i-a|0,r[e>>2]=i,r[o>>2]=0,a=0),(0|(s=(0|a)<(0|(s=(0|i)<(0|n)?i:n))?a:s))<=0||(r[t>>2]=n-s,r[e>>2]=i-s,r[o>>2]=a-s)}function tt(t,e){e|=0;var n,i;i=0|r[(t|=0)+8>>2],n=+((0|r[t+4>>2])-i|0),s[e>>3]=+((0|r[t>>2])-i|0)-.5*n,s[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=0,r[(n|=0)>>2]=(0|r[e>>2])+(0|r[t>>2]),r[n+4>>2]=(0|r[e+4>>2])+(0|r[t+4>>2]),r[n+8>>2]=(0|r[e+8>>2])+(0|r[t+8>>2])}function nt(t,e,n){t|=0,e|=0,r[(n|=0)>>2]=(0|r[t>>2])-(0|r[e>>2]),r[n+4>>2]=(0|r[t+4>>2])-(0|r[e+4>>2]),r[n+8>>2]=(0|r[t+8>>2])-(0|r[e+8>>2])}function it(t,e){e|=0;var n,i=0;i=0|_(0|r[(t|=0)>>2],e),r[t>>2]=i,n=0|_(0|r[(i=t+4|0)>>2],e),r[i>>2]=n,e=0|_(0|r[(t=t+8|0)>>2],e),r[t>>2]=e}function rt(t){var e,n,i=0,s=0,a=0,o=0,l=0;l=(0|(n=0|r[(t|=0)>>2]))<0,t=(t=(s=(0|(o=((e=(0|(a=(0|r[t+4>>2])-(l?n:0)|0))<0)?0-a|0:0)+((0|r[t+8>>2])-(l?n:0))|0))<0)?0:o)-((a=(0|(s=(0|t)<(0|(s=(0|(i=(e?0:a)-(s?o:0)|0))<(0|(o=(l?0:n)-(e?a:0)-(s?o:0)|0))?i:o))?t:s))>0)?s:0)|0,i=i-(a?s:0)|0;t:do{switch(o-(a?s:0)|0){case 0:switch(0|i){case 0:return 0|(l=0|t?1==(0|t)?1:7:0);case 1:return 0|(l=0|t?1==(0|t)?3:7:2);default:break t}case 1:switch(0|i){case 0:return 0|(l=0|t?1==(0|t)?5:7:4);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(l=7)}function st(t){var e,n=0,i=0,s=0,a=0,o=0,l=0;a=0|r[(e=(t|=0)+8|0)>>2],o=(0|r[t>>2])-a|0,a=(0|r[(l=t+4|0)>>2])-a|0;do{if(o>>>0>715827881|a>>>0>715827881){if(i=(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(l=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(l=1)}else{if((-2147483648-o|0)>(0|o))return 0|(l=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(l=1)}if(n=3*o|0,(0|a)>0){if((2147483647-a|0)<(0|a))return 0|(l=1)}else if((-2147483648-a|0)>(0|a))return 0|(l=1);if(s=a<<1,(0|o)>-1){if((-2147483648|n)>=(0|a))return 0|(l=1)}else if((-2147483648^n)<(0|a))return 0|(l=1);if(i){if(!((2147483647-o|0)<(0|s))){i=s;break}return 0|(n=1)}if(!((-2147483648-o|0)>(0|s))){i=s;break}return 0|(n=1)}i=a<<1,n=3*o|0}while(0);s=0|Ce(+(n-a|0)/7),r[t>>2]=s,a=0|Ce(+(i+o|0)/7),r[l>>2]=a,r[e>>2]=0,n=(i=(0|a)<(0|s))?s:a,i=i?a:s;do{if((0|i)<0){if((0|n)>0){if((-2147483648|n)<(0|i)&-2147483648!=(0|i)&(2147483647-n|0)>=(0|i))break;T(23313,22444,355,22455)}if(-2147483648==(0|i)|(-2147483648-n|0)>(0|i)&&T(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|i))break;T(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|i))break;T(23313,22444,355,22455)}}}while(0);return n=a-s|0,(0|s)<0?(i=0-s|0,r[l>>2]=n,r[e>>2]=i,r[t>>2]=0,s=0):(n=a,i=0),(0|n)<0&&(s=s-n|0,r[t>>2]=s,i=i-n|0,r[e>>2]=i,r[l>>2]=0,n=0),o=s-i|0,a=n-i|0,(0|i)<0?(r[t>>2]=o,r[l>>2]=a,r[e>>2]=0,n=a,a=o,i=0):a=s,(0|(s=(0|i)<(0|(s=(0|n)<(0|a)?n:a))?i:s))<=0||(r[t>>2]=a-s,r[l>>2]=n-s,r[e>>2]=i-s),0|(l=0)}function at(t){var e,n=0,i=0,s=0,a=0,o=0,l=0;a=0|r[(e=(t|=0)+8|0)>>2],o=(0|r[t>>2])-a|0,a=(0|r[(l=t+4|0)>>2])-a|0;do{if(o>>>0>715827881|a>>>0>715827881){if(i=(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(l=1)}else if((-2147483648-o|0)>(0|o))return 0|(l=1);if(n=o<<1,(0|a)>0){if((2147483647-a|0)<(0|a))return 0|(l=1);if((2147483647-(a<<1)|0)<(0|a))return 0|(l=1)}else{if((-2147483648-a|0)>(0|a))return 0|(l=1);if((-2147483648-(a<<1)|0)>(0|a))return 0|(l=1)}if(s=3*a|0,i){if((2147483647-n|0)<(0|a))return 0|(l=1)}else if((-2147483648-n|0)>(0|a))return 0|(l=1);if((0|a)>-1){if((-2147483648|s)<(0|o)){i=s;break}return 0|(n=1)}if(!((-2147483648^s)<(0|o))){i=s;break}return 0|(n=1)}i=3*a|0,n=o<<1}while(0);s=0|Ce(+(n+a|0)/7),r[t>>2]=s,a=0|Ce(+(i-o|0)/7),r[l>>2]=a,r[e>>2]=0,n=(i=(0|a)<(0|s))?s:a,i=i?a:s;do{if((0|i)<0){if((0|n)>0){if((-2147483648|n)<(0|i)&-2147483648!=(0|i)&(2147483647-n|0)>=(0|i))break;T(23313,22444,404,22469)}if(-2147483648==(0|i)|(-2147483648-n|0)>(0|i)&&T(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|i))break;T(23313,22444,404,22469)}else{if((-2147483648^n)>=(0|i))break;T(23313,22444,404,22469)}}}while(0);return n=a-s|0,(0|s)<0?(i=0-s|0,r[l>>2]=n,r[e>>2]=i,r[t>>2]=0,s=0):(n=a,i=0),(0|n)<0&&(s=s-n|0,r[t>>2]=s,i=i-n|0,r[e>>2]=i,r[l>>2]=0,n=0),o=s-i|0,a=n-i|0,(0|i)<0?(r[t>>2]=o,r[l>>2]=a,r[e>>2]=0,n=a,a=o,i=0):a=s,(0|(s=(0|i)<(0|(s=(0|n)<(0|a)?n:a))?i:s))<=0||(r[t>>2]=a-s,r[l>>2]=n-s,r[e>>2]=i-s),0|(l=0)}function ot(t){var e,n,i=0,s=0,a=0,o=0,l=0;s=0|r[(e=(t|=0)+8|0)>>2],a=0|Ce(+((3*(i=(0|r[t>>2])-s|0)|0)-(s=(0|r[(n=t+4|0)>>2])-s|0)|0)/7),r[t>>2]=a,i=0|Ce(+((s<<1)+i|0)/7),r[n>>2]=i,r[e>>2]=0,s=i-a|0,(0|a)<0?(l=0-a|0,r[n>>2]=s,r[e>>2]=l,r[t>>2]=0,i=s,a=0,s=l):s=0,(0|i)<0&&(a=a-i|0,r[t>>2]=a,s=s-i|0,r[e>>2]=s,r[n>>2]=0,i=0),l=a-s|0,o=i-s|0,(0|s)<0?(r[t>>2]=l,r[n>>2]=o,r[e>>2]=0,i=o,o=l,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|i)<(0|o)?i:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=i-a,r[e>>2]=s-a)}function lt(t){var e,n,i=0,s=0,a=0,o=0,l=0;s=0|r[(e=(t|=0)+8|0)>>2],a=0|Ce(+(((i=(0|r[t>>2])-s|0)<<1)+(s=(0|r[(n=t+4|0)>>2])-s|0)|0)/7),r[t>>2]=a,i=0|Ce(+((3*s|0)-i|0)/7),r[n>>2]=i,r[e>>2]=0,s=i-a|0,(0|a)<0?(l=0-a|0,r[n>>2]=s,r[e>>2]=l,r[t>>2]=0,i=s,a=0,s=l):s=0,(0|i)<0&&(a=a-i|0,r[t>>2]=a,s=s-i|0,r[e>>2]=s,r[n>>2]=0,i=0),l=a-s|0,o=i-s|0,(0|s)<0?(r[t>>2]=l,r[n>>2]=o,r[e>>2]=0,i=o,o=l,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|i)<(0|o)?i:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=i-a,r[e>>2]=s-a)}function ut(t){var e,n,i,s=0,a=0,o=0,l=0;s=0|r[(t|=0)>>2],a=0|r[(n=t+4|0)>>2],o=0|r[(i=t+8|0)>>2],l=a+(3*s|0)|0,r[t>>2]=l,a=o+(3*a|0)|0,r[n>>2]=a,s=(3*o|0)+s|0,r[i>>2]=s,o=a-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=o,r[i>>2]=s,r[t>>2]=0,a=o,o=0):o=l,(0|a)<0&&(o=o-a|0,r[t>>2]=o,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=o-s|0,l=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,o=e,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=l-a,r[i>>2]=s-a)}function ht(t){var e,n,i,s=0,a=0,o=0,l=0;l=0|r[(t|=0)>>2],o=(3*(s=0|r[(n=t+4|0)>>2])|0)+l|0,l=(a=0|r[(i=t+8|0)>>2])+(3*l|0)|0,r[t>>2]=l,r[n>>2]=o,s=(3*a|0)+s|0,r[i>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=a,r[i>>2]=s,r[t>>2]=0,l=0):a=o,(0|a)<0&&(l=l-a|0,r[t>>2]=l,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=l-s|0,o=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=o,r[i>>2]=0,l=e,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|o)<(0|l)?o:l))?s:a))<=0||(r[t>>2]=l-a,r[n>>2]=o-a,r[i>>2]=s-a)}function ct(t,e){t|=0;var n,i,s,a=0,o=0,l=0;((e|=0)+-1|0)>>>0>=6||(l=(0|r[15440+(12*e|0)>>2])+(0|r[t>>2])|0,r[t>>2]=l,s=t+4|0,o=(0|r[15440+(12*e|0)+4>>2])+(0|r[s>>2])|0,r[s>>2]=o,i=t+8|0,e=(0|r[15440+(12*e|0)+8>>2])+(0|r[i>>2])|0,r[i>>2]=e,a=o-l|0,(0|l)<0?(e=e-l|0,r[s>>2]=a,r[i>>2]=e,r[t>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,r[t>>2]=o,e=e-a|0,r[i>>2]=e,r[s>>2]=0,a=0),n=o-e|0,l=a-e|0,(0|e)<0?(r[t>>2]=n,r[s>>2]=l,r[i>>2]=0,o=n,e=0):l=a,(0|(a=(0|e)<(0|(a=(0|l)<(0|o)?l:o))?e:a))<=0||(r[t>>2]=o-a,r[s>>2]=l-a,r[i>>2]=e-a))}function At(t){var e,n,i,s=0,a=0,o=0,l=0;l=0|r[(t|=0)>>2],o=(s=0|r[(n=t+4|0)>>2])+l|0,l=(a=0|r[(i=t+8|0)>>2])+l|0,r[t>>2]=l,r[n>>2]=o,s=a+s|0,r[i>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=a,r[i>>2]=s,r[t>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,r[t>>2]=o,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=o-s|0,l=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,o=e,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=l-a,r[i>>2]=s-a)}function dt(t){var e,n,i,s=0,a=0,o=0,l=0;s=0|r[(t|=0)>>2],o=0|r[(n=t+4|0)>>2],a=0|r[(i=t+8|0)>>2],l=o+s|0,r[t>>2]=l,o=a+o|0,r[n>>2]=o,s=a+s|0,r[i>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=a,r[i>>2]=s,r[t>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,r[t>>2]=o,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=o-s|0,l=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,o=e,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=l-a,r[i>>2]=s-a)}function pt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function ft(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function mt(t){var e,n,i,s=0,a=0,o=0,l=0;s=0|r[(t|=0)>>2],a=0|r[(n=t+4|0)>>2],o=0|r[(i=t+8|0)>>2],l=a+(s<<1)|0,r[t>>2]=l,a=o+(a<<1)|0,r[n>>2]=a,s=(o<<1)+s|0,r[i>>2]=s,o=a-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=o,r[i>>2]=s,r[t>>2]=0,a=o,o=0):o=l,(0|a)<0&&(o=o-a|0,r[t>>2]=o,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=o-s|0,l=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=l,r[i>>2]=0,o=e,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(r[t>>2]=o-a,r[n>>2]=l-a,r[i>>2]=s-a)}function gt(t){var e,n,i,s=0,a=0,o=0,l=0;l=0|r[(t|=0)>>2],o=((s=0|r[(n=t+4|0)>>2])<<1)+l|0,l=(a=0|r[(i=t+8|0)>>2])+(l<<1)|0,r[t>>2]=l,r[n>>2]=o,s=(a<<1)+s|0,r[i>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,r[n>>2]=a,r[i>>2]=s,r[t>>2]=0,l=0):a=o,(0|a)<0&&(l=l-a|0,r[t>>2]=l,s=s-a|0,r[i>>2]=s,r[n>>2]=0,a=0),e=l-s|0,o=a-s|0,(0|s)<0?(r[t>>2]=e,r[n>>2]=o,r[i>>2]=0,l=e,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|o)<(0|l)?o:l))?s:a))<=0||(r[t>>2]=l-a,r[n>>2]=o-a,r[i>>2]=s-a)}function yt(t,e){e|=0;var n,i,s,a=0,o=0,l=0;return s=(0|(i=(0|r[(t|=0)>>2])-(0|r[e>>2])|0))<0,n=(0|(o=(0|r[t+4>>2])-(0|r[e+4>>2])-(s?i:0)|0))<0,e=(e=(t=(0|(l=(s?0-i|0:0)+(0|r[t+8>>2])-(0|r[e+8>>2])+(n?0-o|0:0)|0))<0)?0:l)-((o=(0|(t=(0|e)<(0|(t=(0|(a=(n?0:o)-(t?l:0)|0))<(0|(l=(s?0:i)-(n?o:0)-(t?l:0)|0))?a:l))?e:t))>0)?t:0)|0,a=a-(o?t:0)|0,0|((0|(t=(0|(t=l-(o?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(a=(0|a)>-1?a:0-a|0))>(0|(e=(0|e)>-1?e:0-e|0))?a:e))?t:e)}function vt(t,e){e|=0;var n;n=0|r[(t|=0)+8>>2],r[e>>2]=(0|r[t>>2])-n,r[e+4>>2]=(0|r[t+4>>2])-n}function _t(t,e){e|=0;var n,i,s,a=0,o=0,l=0;o=0|r[(t|=0)>>2],r[e>>2]=o,l=0|r[t+4>>2],r[(i=e+4|0)>>2]=l,r[(s=e+8|0)>>2]=0,t=(a=(0|l)<(0|o))?o:l,a=a?l:o;do{if((0|a)<0){if((0|t)>0){if((-2147483648|t)<(0|a)&-2147483648!=(0|a)&(2147483647-t|0)>=(0|a))break;return 0|(t=1)}if(-2147483648==(0|a)|(-2147483648-t|0)>(0|a))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|a))break;return 0|(t=1)}if(!((-2147483648^t)<(0|a)))break;return 0|(t=1)}}while(0);return t=l-o|0,(0|o)<0?(a=0-o|0,r[i>>2]=t,r[s>>2]=a,r[e>>2]=0,o=0):(t=l,a=0),(0|t)<0&&(o=o-t|0,r[e>>2]=o,a=a-t|0,r[s>>2]=a,r[i>>2]=0,t=0),n=o-a|0,l=t-a|0,(0|a)<0?(r[e>>2]=n,r[i>>2]=l,r[s>>2]=0,t=l,l=n,a=0):l=o,(0|(o=(0|a)<(0|(o=(0|t)<(0|l)?t:l))?a:o))<=0||(r[e>>2]=l-o,r[i>>2]=t-o,r[s>>2]=a-o),0|(e=0)}function xt(t){var e,n,i,s;n=(s=0|r[(e=(t|=0)+8|0)>>2])-(0|r[t>>2])|0,r[t>>2]=n,t=(0|r[(i=t+4|0)>>2])-s|0,r[i>>2]=t,r[e>>2]=0-(t+n)}function bt(t){var e,n,i=0,s=0,a=0,o=0,l=0;i=0-(s=0|r[(t|=0)>>2])|0,r[t>>2]=i,r[(e=t+8|0)>>2]=0,o=(a=0|r[(n=t+4|0)>>2])+s|0,(0|s)>0?(r[n>>2]=o,r[e>>2]=s,r[t>>2]=0,i=0,a=o):s=0,(0|a)<0?(l=i-a|0,r[t>>2]=l,s=s-a|0,r[e>>2]=s,r[n>>2]=0,o=l-s|0,i=0-s|0,(0|s)<0?(r[t>>2]=o,r[n>>2]=i,r[e>>2]=0,a=i,s=0):(a=0,o=l)):o=i,(0|(i=(0|s)<(0|(i=(0|a)<(0|o)?a:o))?s:i))<=0||(r[t>>2]=o-i,r[n>>2]=a-i,r[e>>2]=s-i)}function St(t,e,n){n|=0;var i,s,a=0,o=0;return s=D,D=D+16|0,i=s,o=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(a=0|qe(0|(t|=0),0|e,56),w(),a=0|function(t,e,n){t|=0,e|=0,n|=0;var i=0,s=0,a=0;if(a=D,D=D+16|0,s=a,i=0|Ot(t,e),(n+-1|0)>>>0>5)return D=a,0|(s=-1);if(i=!!(0|i),1==(0|n)&i)return D=a,0|(s=-1);do{if(!(0|ve(t,e,s))){if(i){i=(5+(0|r[21936+(n<<2)>>2])-(0|r[s>>2])|0)%5|0;break}i=(6+(0|r[21968+(n<<2)>>2])-(0|r[s>>2])|0)%6|0;break}i=-1}while(0);return s=i,D=a,0|s}(t,o,7&a),-1==(0|a)?(r[n>>2]=0,D=s,0|(o=6)):(0|Wt(t,o,i)&&T(23313,22484,282,22499),e=0|qe(0|t,0|e,52),w(),e&=15,0|Ot(t,o)?Et(i,e,a,2,n):Pt(i,e,a,2,n),D=s,0|(o=0))):(D=s,0|(o=6))}function Mt(t,e,n,i){e|=0,i|=0;var a,o=0,l=0,u=0,h=0;if(a=D,D=D+16|0,function(t,e,n){t|=0,e|=0,n|=0;var i=0,a=0,o=0;o=D,D=D+32|0,a=o,function(t,e){t|=0,e|=0;var n=0,i=0,r=0;n=+s[t>>3],i=+A(+n),n=+d(+n),s[e+16>>3]=n,n=+s[t+8>>3],r=i*+A(+n),s[e>>3]=r,n=i*+d(+n),s[e+8>>3]=n}(t,a),r[e>>2]=0,s[n>>3]=5,i=+ye(16400,a),i<+s[n>>3]&&(r[e>>2]=0,s[n>>3]=i);i=+ye(16424,a),i<+s[n>>3]&&(r[e>>2]=1,s[n>>3]=i);i=+ye(16448,a),i<+s[n>>3]&&(r[e>>2]=2,s[n>>3]=i);i=+ye(16472,a),i<+s[n>>3]&&(r[e>>2]=3,s[n>>3]=i);i=+ye(16496,a),i<+s[n>>3]&&(r[e>>2]=4,s[n>>3]=i);i=+ye(16520,a),i<+s[n>>3]&&(r[e>>2]=5,s[n>>3]=i);i=+ye(16544,a),i<+s[n>>3]&&(r[e>>2]=6,s[n>>3]=i);i=+ye(16568,a),i<+s[n>>3]&&(r[e>>2]=7,s[n>>3]=i);i=+ye(16592,a),i<+s[n>>3]&&(r[e>>2]=8,s[n>>3]=i);i=+ye(16616,a),i<+s[n>>3]&&(r[e>>2]=9,s[n>>3]=i);i=+ye(16640,a),i<+s[n>>3]&&(r[e>>2]=10,s[n>>3]=i);i=+ye(16664,a),i<+s[n>>3]&&(r[e>>2]=11,s[n>>3]=i);i=+ye(16688,a),i<+s[n>>3]&&(r[e>>2]=12,s[n>>3]=i);i=+ye(16712,a),i<+s[n>>3]&&(r[e>>2]=13,s[n>>3]=i);i=+ye(16736,a),i<+s[n>>3]&&(r[e>>2]=14,s[n>>3]=i);i=+ye(16760,a),i<+s[n>>3]&&(r[e>>2]=15,s[n>>3]=i);i=+ye(16784,a),i<+s[n>>3]&&(r[e>>2]=16,s[n>>3]=i);i=+ye(16808,a),i<+s[n>>3]&&(r[e>>2]=17,s[n>>3]=i);i=+ye(16832,a),i<+s[n>>3]&&(r[e>>2]=18,s[n>>3]=i);if(i=+ye(16856,a),!(i<+s[n>>3]))return void(D=o);r[e>>2]=19,s[n>>3]=i,D=o}(t|=0,n|=0,h=a),(l=+f(+(1-.5*+s[h>>3])))<1e-16)return r[i>>2]=0,r[i+4>>2]=0,r[i+8>>2]=0,r[i+12>>2]=0,void(D=a);if(h=0|r[n>>2],o=+Kt((o=+s[15920+(24*h|0)>>3])-+Kt(+function(t,e){t|=0,e|=0;var n=0,i=0,r=0,a=0,o=0;return a=+s[e>>3],i=+A(+a),r=+s[e+8>>3]-+s[t+8>>3],o=i*+d(+r),n=+s[t>>3],+ +y(+o,+(+d(+a)*+A(+n)-+A(+r)*(i*+d(+n))))}(15600+(h<<4)|0,t))),u=0|Vt(e)?+Kt(o+-.3334731722518321):o,o=+p(+l)/.381966011250105,(0|e)>0){t=0;do{o*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}l=+A(+u)*o,s[i>>3]=l,u=+d(+u)*o,s[i+8>>3]=u,D=a}function wt(t,e,n,i,a){e|=0,n|=0,i|=0,a|=0;var o=0,l=0;if(o=+function(t){t|=0;var e=0,n=0;return n=+s[t>>3],e=+s[t+8>>3],+ +h(+(n*n+e*e))}(t|=0),o<1e-16)return e=15600+(e<<4)|0,r[a>>2]=r[e>>2],r[a+4>>2]=r[e+4>>2],r[a+8>>2]=r[e+8>>2],void(r[a+12>>2]=r[e+12>>2]);if(l=+y(+ +s[t+8>>3],+ +s[t>>3]),(0|n)>0){t=0;do{o/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}i?(o/=3,n=!(0|Vt(n)),o=+g(.381966011250105*(n?o:o/2.6457513110645907))):(o=+g(.381966011250105*o),0|Vt(n)&&(l=+Kt(l+.3334731722518321))),function(t,e,n,i){t|=0,e=+e,n=+n,i|=0;var a=0,o=0,l=0,h=0;if(n<1e-16)return r[i>>2]=r[t>>2],r[i+4>>2]=r[t+4>>2],r[i+8>>2]=r[t+8>>2],void(r[i+12>>2]=r[t+12>>2]);o=e<0?e+6.283185307179586:e,o=e>=6.283185307179586?o+-6.283185307179586:o;do{if(!(o<1e-16)){if(a=+u(+(o+-3.141592653589793))<1e-16,e=+s[t>>3],a){e-=n,s[i>>3]=e,a=i;break}if(l=+A(+n),n=+d(+n),e=l*+d(+e)+ +A(+o)*(n*+A(+e)),e=+m(+((e=e>1?1:e)<-1?-1:e)),s[i>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return s[i>>3]=1.5707963267948966,void(s[i+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return s[i>>3]=-1.5707963267948966,void(s[i+8>>3]=0);if(h=+A(+e),o=n*+d(+o)/h,n=+s[t>>3],e=(l-+d(+e)*+d(+n))/+A(+n)/h,l=o>1?1:o,e=e>1?1:e,(e=+s[t+8>>3]+ +y(+(l<-1?-1:l),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(s[i+8>>3]=e)}e=+s[t>>3]+n,s[i>>3]=e,a=i}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return s[a>>3]=1.5707963267948966,void(s[i+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return s[a>>3]=-1.5707963267948966,void(s[i+8>>3]=0);if(e=+s[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);s[i+8>>3]=e}(15600+(e<<4)|0,+Kt(+s[15920+(24*e|0)>>3]-l),o,a)}function Tt(t,e,n){e|=0,n|=0;var i,s;i=D,D=D+16|0,tt((t|=0)+4|0,s=i),wt(s,0|r[t>>2],e,0,n),D=i}function Et(t,e,n,i,a){t|=0,e|=0,n|=0,i|=0,a|=0;var o,l,u,h,c,A,d,p,f,m,g,y,v,_,x,b,S,M,w,E,C,R,N=0,P=0,I=0,L=0,B=0,U=0;if(R=D,D=D+272|0,L=R+240|0,w=R,E=R+224|0,C=R+208|0,g=R+176|0,y=R+160|0,v=R+192|0,_=R+144|0,x=R+128|0,b=R+112|0,S=R+96|0,M=R+80|0,r[(N=R+256|0)>>2]=e,r[L>>2]=r[t>>2],r[L+4>>2]=r[t+4>>2],r[L+8>>2]=r[t+8>>2],r[L+12>>2]=r[t+12>>2],Ct(L,N,w),r[a>>2]=0,(0|(L=i+n+(5==(0|i)&1)|0))<=(0|n))D=R;else{l=E+4|0,u=g+4|0,h=n+5|0,c=16880+((o=0|r[N>>2])<<2)|0,A=16960+(o<<2)|0,d=x+8|0,p=b+8|0,f=S+8|0,m=C+4|0,I=n;t:for(;;){P=w+((0|I)%5<<4)|0,r[C>>2]=r[P>>2],r[C+4>>2]=r[P+4>>2],r[C+8>>2]=r[P+8>>2],r[C+12>>2]=r[P+12>>2];do{}while(2==(0|Rt(C,o,0,1)));if((0|I)>(0|n)&!!(0|Vt(e))){if(r[g>>2]=r[C>>2],r[g+4>>2]=r[C+4>>2],r[g+8>>2]=r[C+8>>2],r[g+12>>2]=r[C+12>>2],tt(l,y),i=0|r[g>>2],N=0|r[17040+(80*i|0)+(r[E>>2]<<2)>>2],r[g>>2]=r[18640+(80*i|0)+(20*N|0)>>2],(0|(P=0|r[18640+(80*i|0)+(20*N|0)+16>>2]))>0){t=0;do{At(u),t=t+1|0}while((0|t)<(0|P))}switch(P=18640+(80*i|0)+(20*N|0)+4|0,r[v>>2]=r[P>>2],r[v+4>>2]=r[P+4>>2],r[v+8>>2]=r[P+8>>2],it(v,3*(0|r[c>>2])|0),et(u,v,u),J(u),tt(u,_),B=+(0|r[A>>2]),s[x>>3]=3*B,s[d>>3]=0,U=-1.5*B,s[b>>3]=U,s[p>>3]=2.598076211353316*B,s[S>>3]=U,s[f>>3]=-2.598076211353316*B,0|r[17040+(80*(0|r[g>>2])|0)+(r[C>>2]<<2)>>2]){case 1:t=b,i=x;break;case 3:t=S,i=b;break;case 2:t=x,i=S;break;default:t=12;break t}me(y,_,i,t,M),wt(M,0|r[g>>2],o,1,a+8+(r[a>>2]<<4)|0),r[a>>2]=1+(0|r[a>>2])}if((0|I)<(0|h)&&(tt(m,g),wt(g,0|r[C>>2],o,1,a+8+(r[a>>2]<<4)|0),r[a>>2]=1+(0|r[a>>2])),r[E>>2]=r[C>>2],r[E+4>>2]=r[C+4>>2],r[E+8>>2]=r[C+8>>2],r[E+12>>2]=r[C+12>>2],(0|(I=I+1|0))>=(0|L)){t=3;break}}3!=(0|t)?12==(0|t)&&T(22522,22569,571,22579):D=R}}function Ct(t,e,n){t|=0,e|=0,n|=0;var i,s=0,a=0,o=0,l=0,u=0;i=D,D=D+128|0,a=i,l=20240,u=(o=s=i+64|0)+60|0;do{r[o>>2]=r[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));l=20304,u=(o=a)+60|0;do{r[o>>2]=r[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));s=(u=!(0|Vt(0|r[e>>2])))?s:a,mt(a=t+4|0),gt(a),0|Vt(0|r[e>>2])&&(ht(a),r[e>>2]=1+(0|r[e>>2])),r[n>>2]=r[t>>2],et(a,s,e=n+4|0),J(e),r[n+16>>2]=r[t>>2],et(a,s+12|0,e=n+20|0),J(e),r[n+32>>2]=r[t>>2],et(a,s+24|0,e=n+36|0),J(e),r[n+48>>2]=r[t>>2],et(a,s+36|0,e=n+52|0),J(e),r[n+64>>2]=r[t>>2],et(a,s+48|0,n=n+68|0),J(n),D=i}function Rt(t,e,n,i){n|=0,i|=0;var s,a,o,l,u,h,c=0,A=0,d=0,p=0,f=0;if(h=D,D=D+32|0,u=h+12|0,a=h,f=(t|=0)+4|0,p=0|r[16960+((e|=0)<<2)>>2],p=(l=!!(0|i))?3*p|0:p,c=0|r[f>>2],s=0|r[(o=t+8|0)>>2],l){if((0|(c=s+c+(i=0|r[(A=t+12|0)>>2])|0))==(0|p))return D=h,0|(f=1);d=A}else c=s+c+(i=0|r[(d=t+12|0)>>2])|0;if((0|c)<=(0|p))return D=h,0|(f=0);do{if((0|i)>0){if(i=0|r[t>>2],(0|s)>0){A=18640+(80*i|0)+60|0,i=t;break}i=18640+(80*i|0)+40|0,n?(Z(u,p,0,0),nt(f,u,a),dt(a),et(a,u,f),A=i,i=t):(A=i,i=t)}else A=18640+(80*(0|r[t>>2])|0)+20|0,i=t}while(0);if(r[i>>2]=r[A>>2],(0|r[(c=A+16|0)>>2])>0){i=0;do{At(f),i=i+1|0}while((0|i)<(0|r[c>>2]))}return t=A+4|0,r[u>>2]=r[t>>2],r[u+4>>2]=r[t+4>>2],r[u+8>>2]=r[t+8>>2],e=0|r[16880+(e<<2)>>2],it(u,l?3*e|0:e),et(f,u,f),J(f),i=l&&((0|r[o>>2])+(0|r[f>>2])+(0|r[d>>2])|0)==(0|p)?1:2,D=h,0|(f=i)}function Nt(t,e){t|=0,e|=0;var n=0;do{n=0|Rt(t,e,0,1)}while(2==(0|n));return 0|n}function Pt(t,e,n,i,a){t|=0,e|=0,n|=0,i|=0,a|=0;var o,l,u,h,c,A,d,p,f,m,g,y,v,_,x,b,S,M,w=0,E=0,C=0,R=0,N=0;if(M=D,D=D+240|0,_=M+208|0,x=M,b=M+192|0,S=M+176|0,f=M+160|0,m=M+144|0,g=M+128|0,y=M+112|0,v=M+96|0,r[(w=M+224|0)>>2]=e,r[_>>2]=r[t>>2],r[_+4>>2]=r[t+4>>2],r[_+8>>2]=r[t+8>>2],r[_+12>>2]=r[t+12>>2],Dt(_,w,x),r[a>>2]=0,(0|(p=i+n+(6==(0|i)&1)|0))<=(0|n))D=M;else{l=n+6|0,u=16960+((o=0|r[w>>2])<<2)|0,h=m+8|0,c=g+8|0,A=y+8|0,d=b+4|0,E=0,C=n,i=-1;t:for(;;){if(t=x+((w=(0|C)%6|0)<<4)|0,r[b>>2]=r[t>>2],r[b+4>>2]=r[t+4>>2],r[b+8>>2]=r[t+8>>2],r[b+12>>2]=r[t+12>>2],t=E,E=0|Rt(b,o,0,1),(0|C)>(0|n)&!!(0|Vt(e))&&(1!=(0|t)&&(0|r[b>>2])!=(0|i))){switch(tt(x+((w+5|0)%6<<4)+4|0,S),tt(x+(w<<4)+4|0,f),R=+(0|r[u>>2]),s[m>>3]=3*R,s[h>>3]=0,N=-1.5*R,s[g>>3]=N,s[c>>3]=2.598076211353316*R,s[y>>3]=N,s[A>>3]=-2.598076211353316*R,w=0|r[_>>2],0|r[17040+(80*w|0)+(((0|i)==(0|w)?r[b>>2]:i)<<2)>>2]){case 1:t=g,i=m;break;case 3:t=y,i=g;break;case 2:t=m,i=y;break;default:t=8;break t}me(S,f,i,t,v),0|ge(S,v)||0|ge(f,v)||(wt(v,0|r[_>>2],o,1,a+8+(r[a>>2]<<4)|0),r[a>>2]=1+(0|r[a>>2]))}if((0|C)<(0|l)&&(tt(d,S),wt(S,0|r[b>>2],o,1,a+8+(r[a>>2]<<4)|0),r[a>>2]=1+(0|r[a>>2])),(0|(C=C+1|0))>=(0|p)){t=3;break}i=0|r[b>>2]}3!=(0|t)?8==(0|t)&&T(22606,22569,736,22651):D=M}}function Dt(t,e,n){t|=0,e|=0,n|=0;var i,s=0,a=0,o=0,l=0,u=0;i=D,D=D+160|0,a=i,l=20368,u=(o=s=i+80|0)+72|0;do{r[o>>2]=r[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));l=20448,u=(o=a)+72|0;do{r[o>>2]=r[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));s=(u=!(0|Vt(0|r[e>>2])))?s:a,mt(a=t+4|0),gt(a),0|Vt(0|r[e>>2])&&(ht(a),r[e>>2]=1+(0|r[e>>2])),r[n>>2]=r[t>>2],et(a,s,e=n+4|0),J(e),r[n+16>>2]=r[t>>2],et(a,s+12|0,e=n+20|0),J(e),r[n+32>>2]=r[t>>2],et(a,s+24|0,e=n+36|0),J(e),r[n+48>>2]=r[t>>2],et(a,s+36|0,e=n+52|0),J(e),r[n+64>>2]=r[t>>2],et(a,s+48|0,e=n+68|0),J(e),r[n+80>>2]=r[t>>2],et(a,s+60|0,n=n+84|0),J(n),D=i}function It(t,e){return e=0|qe(0|(t|=0),0|(e|=0),45),w(),127&e}function Lt(t,e){var n=0,i=0,r=0,s=0,a=0,o=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(a=0|qe(0|(t|=0),0|e,45),w(),(a&=127)>>>0>121)return 0|(e=0);n=0|qe(0|t,0|e,52),w(),n&=15;do{if(0|n){for(r=1,i=0;;){if(s=0|qe(0|t,0|e,3*(15-r|0)|0),w(),!!(0|(s&=7))&(1^i)){if(1==(0|s)&!!(0|z(a))){o=0,i=13;break}i=1}if(7==(0|s)){o=0,i=13;break}if(!(r>>>0<n>>>0)){i=9;break}r=r+1|0}if(9==(0|i)){if(15!=(0|n))break;return 0|(o=1)}if(13==(0|i))return 0|o}}while(0);for(;;){if(o=0|qe(0|t,0|e,3*(14-n|0)|0),w(),!(!0&!(7&~o))){o=0,i=13;break}if(!(n>>>0<14)){o=1,i=13;break}n=n+1|0}return 13==(0|i)?0|o:0}function Bt(t,e,n,i){n|=0,i|=0;var s=0,a=0;if(a=0|qe(0|(t|=0),0|(e|=0),52),w(),n>>>0>15)return 0|(i=4);if((0|(a&=15))<(0|n))return 0|(i=12);if((0|a)==(0|n))return r[i>>2]=t,r[i+4>>2]=e,0|(i=0);if(s=0|Ge(0|n,0,52),s|=t,t=w()|-15728641&e,(0|a)>(0|n))do{e=0|Ge(7,0,3*(14-n|0)|0),n=n+1|0,s|=e,t=w()|t}while((0|n)<(0|a));return r[i>>2]=s,r[i+4>>2]=t,0|(i=0)}function Ut(t,e,n,i){n|=0,i|=0;var s=0,a=0,o=0;if(a=0|qe(0|(t|=0),0|(e|=0),52),w(),!((0|n)<16&(0|(a&=15))<=(0|n)))return 0|(i=4);s=n-a|0,n=0|qe(0|t,0|e,45),w();t:do{if(0|z(127&n)){e:do{if(0|a){for(n=1;!((o=0|Ge(7,0,3*(15-n|0)|0))&t)&!(w()&e);){if(!(n>>>0<a>>>0))break e;n=n+1|0}n=0|ce(7,0,s,((0|s)<0)<<31>>31),s=0|w();break t}}while(0);n=0|De(0|(n=0|Oe(0|(n=0|ce(7,0,s,((0|s)<0)<<31>>31)),0|w(),5,0)),0|w(),-5,-1),n=0|De(0|(n=0|Ue(0|n,0|w(),6,0)),0|w(),1,0),s=0|w()}else n=0|ce(7,0,s,((0|s)<0)<<31>>31),s=0|w()}while(0);return r[(o=i)>>2]=n,r[o+4>>2]=s,0|(o=0)}function Ot(t,e){var n=0,i=0,r=0;if(r=0|qe(0|(t|=0),0|(e|=0),45),w(),!(0|z(127&r)))return 0|(r=0);r=0|qe(0|t,0|e,52),w(),r&=15;t:do{if(r)for(i=1;;){if(n=0|qe(0|t,0|e,3*(15-i|0)|0),w(),0|(n&=7))break t;if(!(i>>>0<r>>>0)){n=0;break}i=i+1|0}else n=0}while(0);return 0|(r=1&!(0|n))}function Ft(t,e){var n=0,i=0,r=0;if(r=0|qe(0|(t|=0),0|(e|=0),52),w(),!(r&=15))return 0|(r=0);for(i=1;;){if(n=0|qe(0|t,0|e,3*(15-i|0)|0),w(),0|(n&=7)){i=5;break}if(!(i>>>0<r>>>0)){n=0,i=5;break}i=i+1|0}return 5==(0|i)?0|n:0}function kt(t,e){var n=0,i=0,r=0,s=0,a=0,o=0,l=0;if(l=0|qe(0|(t|=0),0|(e|=0),52),w(),!(l&=15))return l=t,M(0|(o=e)),0|l;for(o=1,n=0;;){i=0|Ge(7,0,0|(s=3*(15-o|0)|0)),r=0|w(),a=0|qe(0|t,0|e,0|s),w(),t=(s=0|Ge(0|pt(7&a),0,0|s))|t&~i,e=(a=0|w())|e&~r;t:do{if(!n)if(!(s&i)&!(a&r))n=0;else if(i=0|qe(0|t,0|e,52),w(),i&=15){n=1;e:for(;;){switch(a=0|qe(0|t,0|e,3*(15-n|0)|0),w(),7&a){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<i>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(r=0|qe(0|t,0|e,0|(a=3*(15-n|0)|0)),w(),s=0|Ge(7,0,0|a),e&=~w(),t=t&~s|(a=0|Ge(0|pt(7&r),0,0|a)),e|=w(),!(n>>>0<i>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(o>>>0<l>>>0))break;o=o+1|0}return M(0|e),0|t}function zt(t,e){var n=0,i=0,r=0,s=0,a=0;if(i=0|qe(0|(t|=0),0|(e|=0),52),w(),!(i&=15))return i=t,M(0|(n=e)),0|i;for(n=1;a=0|qe(0|t,0|e,0|(s=3*(15-n|0)|0)),w(),r=0|Ge(7,0,0|s),e&=~w(),t=(s=0|Ge(0|pt(7&a),0,0|s))|t&~r,e=w()|e,n>>>0<i>>>0;)n=n+1|0;return M(0|e),0|t}function qt(t,e){var n=0,i=0,r=0,s=0,a=0,o=0,l=0;if(l=0|qe(0|(t|=0),0|(e|=0),52),w(),!(l&=15))return l=t,M(0|(o=e)),0|l;for(o=1,n=0;;){i=0|Ge(7,0,0|(s=3*(15-o|0)|0)),r=0|w(),a=0|qe(0|t,0|e,0|s),w(),t=(s=0|Ge(0|ft(7&a),0,0|s))|t&~i,e=(a=0|w())|e&~r;t:do{if(!n)if(!(s&i)&!(a&r))n=0;else if(i=0|qe(0|t,0|e,52),w(),i&=15){n=1;e:for(;;){switch(a=0|qe(0|t,0|e,3*(15-n|0)|0),w(),7&a){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<i>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(s=0|Ge(7,0,0|(r=3*(15-n|0)|0)),a=e&~w(),e=0|qe(0|t,0|e,0|r),w(),t=t&~s|(e=0|Ge(0|ft(7&e),0,0|r)),e=a|w(),!(n>>>0<i>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(o>>>0<l>>>0))break;o=o+1|0}return M(0|e),0|t}function Gt(t,e){var n=0,i=0,r=0,s=0,a=0;if(i=0|qe(0|(t|=0),0|(e|=0),52),w(),!(i&=15))return i=t,M(0|(n=e)),0|i;for(n=1;s=0|Ge(7,0,0|(a=3*(15-n|0)|0)),r=e&~w(),e=0|qe(0|t,0|e,0|a),w(),t=(e=0|Ge(0|ft(7&e),0,0|a))|t&~s,e=w()|r,n>>>0<i>>>0;)n=n+1|0;return M(0|e),0|t}function Vt(t){return(0|(t|=0))%2|0}function Ht(t,e,n){n|=0;var i,s=0;return i=D,D=D+16|0,s=i,(e|=0)>>>0>15?(D=i,0|(s=4)):2146435072&~r[(t|=0)+4>>2]&&2146435072&~r[t+8+4>>2]?(function(t,e,n){var i,r;i=D,D=D+16|0,Mt(t|=0,e|=0,n|=0,r=i),K(r,n+4|0),D=i}(t,e,s),e=0|function(t,e){t|=0;var n,i=0,s=0,a=0,o=0,l=0,u=0,h=0,c=0;if(n=D,D=D+64|0,u=n+40|0,s=n+24|0,a=n+12|0,o=n,Ge(0|(e|=0),0,52),i=134225919|w(),!e)return(0|r[t+4>>2])>2||(0|r[t+8>>2])>2||(0|r[t+12>>2])>2?(u=0,M(0|(l=0)),D=n,0|u):(Ge(0|G(t),0,45),l=w()|i,u=-1,M(0|l),D=n,0|u);if(r[u>>2]=r[t>>2],r[u+4>>2]=r[t+4>>2],r[u+8>>2]=r[t+8>>2],r[u+12>>2]=r[t+12>>2],l=u+4|0,(0|e)>0)for(t=-1;r[s>>2]=r[l>>2],r[s+4>>2]=r[l+4>>2],r[s+8>>2]=r[l+8>>2],1&e?(ot(l),r[a>>2]=r[l>>2],r[a+4>>2]=r[l+4>>2],r[a+8>>2]=r[l+8>>2],ut(a)):(lt(l),r[a>>2]=r[l>>2],r[a+4>>2]=r[l+4>>2],r[a+8>>2]=r[l+8>>2],ht(a)),nt(s,a,o),J(o),h=0|Ge(7,0,0|(c=3*(15-e|0)|0)),i&=~w(),t=(c=0|Ge(0|rt(o),0,0|c))|t&~h,i=w()|i,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|r[l>>2])<=2&&(0|r[u+8>>2])<=2&&(0|r[u+12>>2])<=2){if(e=0|Ge(0|(s=0|G(u)),0,45),e|=t,t=w()|-1040385&i,o=0|V(u),!(0|z(s))){if((0|o)<=0)break;for(a=0;;){if(s=0|qe(0|e,0|t,52),w(),s&=15)for(i=1;u=0|qe(0|e,0|t,0|(c=3*(15-i|0)|0)),w(),h=0|Ge(7,0,0|c),t&=~w(),e=e&~h|(c=0|Ge(0|pt(7&u),0,0|c)),t|=w(),i>>>0<s>>>0;)i=i+1|0;if((0|(a=a+1|0))==(0|o))break t}}a=0|qe(0|e,0|t,52),w(),a&=15;e:do{if(a){i=1;n:for(;;){switch(c=0|qe(0|e,0|t,3*(15-i|0)|0),w(),7&c){case 1:break n;case 0:break;default:break e}if(!(i>>>0<a>>>0))break e;i=i+1|0}if(0|H(s,0|r[u>>2]))for(i=1;h=0|Ge(7,0,0|(u=3*(15-i|0)|0)),c=t&~w(),t=0|qe(0|e,0|t,0|u),w(),e=e&~h|(t=0|Ge(0|ft(7&t),0,0|u)),t=c|w(),i>>>0<a>>>0;)i=i+1|0;else for(i=1;u=0|qe(0|e,0|t,0|(c=3*(15-i|0)|0)),w(),h=0|Ge(7,0,0|c),t&=~w(),e=e&~h|(c=0|Ge(0|pt(7&u),0,0|c)),t|=w(),i>>>0<a>>>0;)i=i+1|0}}while(0);if((0|o)>0){i=0;do{e=0|kt(e,t),t=0|w(),i=i+1|0}while((0|i)!=(0|o))}}else e=0,t=0}while(0);return c=e,M(0|(h=t)),D=n,0|c}(s,e),s=0|w(),r[n>>2]=e,r[n+4>>2]=s,!(0|e)&!(0|s)&&T(23313,22674,786,22697),D=i,0|(s=0)):(D=i,0|(s=3))}function jt(t,e,n){var i,s=0,a=0,o=0;if(i=(n|=0)+4|0,a=0|qe(0|(t|=0),0|(e|=0),52),w(),a&=15,o=0|qe(0|t,0|e,45),w(),s=!(0|a),0|z(127&o)){if(s)return 0|(o=1);s=1}else{if(s)return 0|(o=0);s=0|r[i>>2]||0|r[n+8>>2]?1:1&!!(0|r[n+12>>2])}for(n=1;1&n?ut(i):ht(i),o=0|qe(0|t,0|e,3*(15-n|0)|0),w(),ct(i,7&o),n>>>0<a>>>0;)n=n+1|0;return 0|s}function Wt(t,e,n){n|=0;var i,s,a=0,o=0,l=0,u=0,h=0,c=0;if(s=D,D=D+16|0,i=s,c=0|qe(0|(t|=0),0|(e|=0),45),w(),(c&=127)>>>0>121)return r[n>>2]=0,r[n+4>>2]=0,r[n+8>>2]=0,r[n+12>>2]=0,D=s,0|(c=5);t:do{if(0|z(c)&&(l=0|qe(0|t,0|e,52),w(),0|(l&=15))){a=1;e:for(;;){switch(h=0|qe(0|t,0|e,3*(15-a|0)|0),w(),7&h){case 5:break e;case 0:break;default:a=e;break t}if(!(a>>>0<l>>>0)){a=e;break t}a=a+1|0}for(o=1,a=e;u=0|Ge(7,0,0|(e=3*(15-o|0)|0)),h=a&~w(),a=0|qe(0|t,0|a,0|e),w(),t=t&~u|(a=0|Ge(0|ft(7&a),0,0|e)),a=h|w(),o>>>0<l>>>0;)o=o+1|0}else a=e}while(0);if(h=7696+(28*c|0)|0,r[n>>2]=r[h>>2],r[n+4>>2]=r[h+4>>2],r[n+8>>2]=r[h+8>>2],r[n+12>>2]=r[h+12>>2],!(0|jt(t,a,n)))return D=s,0|(c=0);if(u=n+4|0,r[i>>2]=r[u>>2],r[i+4>>2]=r[u+4>>2],r[i+8>>2]=r[u+8>>2],l=0|qe(0|t,0|a,52),w(),h=15&l,1&l?(ht(u),l=h+1|0):l=h,0|z(c)){t:do{if(h)for(e=1;;){if(o=0|qe(0|t,0|a,3*(15-e|0)|0),w(),0|(o&=7)){a=o;break t}if(!(e>>>0<h>>>0)){a=0;break}e=e+1|0}else a=0}while(0);a=4==(0|a)&1}else a=0;if(0|Rt(n,l,a,0)){if(0|z(c))do{}while(0|Rt(n,l,0,0));(0|l)!=(0|h)&&lt(u)}else(0|l)!=(0|h)&&(r[u>>2]=r[i>>2],r[u+4>>2]=r[i+4>>2],r[u+8>>2]=r[i+8>>2]);return D=s,0|(c=0)}function Xt(t,e,n){n|=0;var i,r,s=0;return r=D,D=D+16|0,0|(s=0|Wt(t|=0,e|=0,i=r))?(D=r,0|s):(s=0|qe(0|t,0|e,52),w(),Tt(i,15&s,n),D=r,0|(s=0))}function Yt(t,e,n){n|=0;var i,r=0,s=0,a=0;if(i=D,D=D+16|0,0|(r=0|Wt(t|=0,e|=0,a=i)))return D=i,0|(a=r);r=0|qe(0|t,0|e,45),w(),r=!(0|z(127&r)),s=0|qe(0|t,0|e,52),w(),s&=15;t:do{if(!r){if(0|s)for(r=1;;){if(!(!((0|Ge(7,0,3*(15-r|0)|0))&t)&!(w()&e)))break t;if(!(r>>>0<s>>>0))break;r=r+1|0}return Et(a,s,0,5,n),D=i,0|0}}while(0);return Pt(a,s,0,6,n),D=i,0|0}function Qt(t,e){e|=0;var n=0,i=0,s=0,a=0,o=0,l=0,u=0;if((t|=0)>>>0>15)return 0|(l=4);if(Ge(0|t,0,52),l=134225919|w(),!t){n=0,i=0;do{0|z(i)&&(Ge(0|i,0,45),o=l|w(),r[(t=e+(n<<3)|0)>>2]=-1,r[t+4>>2]=o,n=n+1|0),i=i+1|0}while(122!=(0|i));return 0|(n=0)}n=0,o=0;do{if(0|z(o)){for(Ge(0|o,0,45),i=1,s=-1,a=l|w();s&=~(u=0|Ge(7,0,3*(15-i|0)|0)),a&=~w(),(0|i)!=(0|t);)i=i+1|0;r[(u=e+(n<<3)|0)>>2]=s,r[u+4>>2]=a,n=n+1|0}o=o+1|0}while(122!=(0|o));return 0|(n=0)}function $t(t,e,n,i){t|=0,i|=0;var s=0,a=0;s=0|qe(0|(e|=0),0|(n|=0),52),w(),!(0|e)&!(0|n)|(0|i)>15|(0|(s&=15))>(0|i)?(i=-1,s=-1,e=0,n=0):(a=0|function(t,e,n,i){return t|=0,e|=0,(0|(i|=0))<(0|(n|=0))?(i=t,M(0|(n=e)),0|i):(n=0|Ge(-1,-1,3+(3*(i-n|0)|0)|0),i=0|Ge(0|~n,0|~w(),3*(15-i|0)|0),n=~w()&e,i=~i&t,M(0|n),0|i)}(e,n,s+1|0,i),n=-15728641&w(),e=0|Ge(0|i,0,52),i=(a=!(0|Ot(e|=a,n|=w())))?-1:i),r[(a=t)>>2]=e,r[a+4>>2]=n,r[t+8>>2]=s,r[t+12>>2]=i}function Zt(t){var e,n=0,i=0,s=0,a=0,o=0,l=0,u=0,h=0;if(!(!(0|(n=0|r[(i=t|=0)>>2]))&!(0|(i=0|r[i+4>>2]))||(s=0|qe(0|n,0|i,52),w(),n=0|De(0|(u=0|Ge(1,0,3*(15^(s&=15))|0)),0|w(),0|n,0|i),i=0|w(),r[(u=t)>>2]=n,r[u+4>>2]=i,(0|s)<(0|(l=0|r[(u=t+8|0)>>2]))))){for(e=t+12|0,o=s;;){if((0|o)==(0|l)){s=5;break}if(h=(0|o)==(0|r[e>>2]),s=0|qe(0|n,0|i,0|(a=3*(15-o|0)|0)),w(),h&1==(0|(s&=7))&!0){s=7;break}if(!(7==(0|s)&!0)){s=10;break}if(n=0|De(0|n,0|i,0|(h=0|Ge(1,0,0|a)),0|w()),i=0|w(),r[(h=t)>>2]=n,r[h+4>>2]=i,!((0|o)>(0|l))){s=10;break}o=o+-1|0}if(5==(0|s))return r[(h=t)>>2]=0,r[h+4>>2]=0,r[u>>2]=-1,void(r[e>>2]=-1);if(7==(0|s))return l=0|De(0|n,0|i,0|(l=0|Ge(1,0,0|a)),0|w()),u=0|w(),r[(h=t)>>2]=l,r[h+4>>2]=u,void(r[e>>2]=o+-1)}}function Kt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function Jt(t,e){return e|=0,+u(+(+s[(t|=0)>>3]-+s[e>>3]))<17453292519943298e-27?0|(e=+u(+(+s[t+8>>3]-+s[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,i,r,a=0;return i=+s[(e|=0)>>3],n=+s[t>>3],a=(r=+d(.5*(i-n)))*r+(a=+d(.5*(+s[e+8>>3]-+s[t+8>>3])))*(+A(+i)*+A(+n)*a),2*+y(+ +h(+a),+ +h(+(1-a)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Oe(0|(n=0|ce(7,0,t,((0|t)<0)<<31>>31)),0|w(),120,0),t=0|w(),r[e>>2]=2|n,r[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var i,r,a,o,l=0,u=0,c=0,f=0,m=0,v=0;return v=+s[(e|=0)>>3],a=+s[t>>3],m=+d(.5*(v-a)),c=+s[e+8>>3],r=+s[t+8>>3],f=+d(.5*(c-r)),i=+A(+a),o=+A(+v),f=2*+y(+ +h(+(f=m*m+f*(o*i*f))),+ +h(+(1-f))),m=+s[n>>3],v=+d(.5*(m-v)),l=+s[n+8>>3],c=+d(.5*(l-c)),u=+A(+m),c=2*+y(+ +h(+(c=v*v+c*(o*u*c))),+ +h(+(1-c))),m=+d(.5*(a-m)),l=+d(.5*(r-l)),l=2*+y(+ +h(+(l=m*m+l*(i*u*l))),+ +h(+(1-l))),4*+g(+ +h(+ +p(.5*(u=.5*(f+c+l)))*+p(.5*(u-f))*+p(.5*(u-c))*+p(.5*(u-l))))}function ie(t,e,n){n|=0;var i,a,o,l=0,u=0;if(o=D,D=D+192|0,a=o,0|(u=0|Xt(t|=0,e|=0,i=o+168|0)))return D=o,0|(n=u);if(0|Yt(t,e,a)&&T(23313,22742,386,22751),(0|(e=0|r[a>>2]))>0){if(l=+ne(a+8|0,a+8+((1!=(0|e)&1)<<4)|0,i)+0,1!=(0|e)){t=1;do{l+=+ne(a+8+((u=t)<<4)|0,a+8+((0|(t=t+1|0))%(0|e)<<4)|0,i)}while((0|t)<(0|e))}}else l=0;return s[n>>3]=l,D=o,0|(n=0)}function re(t){t|=0;var e,n,i=0;return(e=0|Pe(1,12))||T(22832,22787,49,22845),0|(i=0|r[(n=t+4|0)>>2])?(r[(i=i+8|0)>>2]=e,r[n>>2]=e,0|e):(0|r[t>>2]&&T(22862,22787,61,22885),r[(i=t)>>2]=e,r[n>>2]=e,0|e)}function se(t,e){t|=0,e|=0;var n,i;return(i=0|Re(24))||T(22899,22787,78,22913),r[i>>2]=r[e>>2],r[i+4>>2]=r[e+4>>2],r[i+8>>2]=r[e+8>>2],r[i+12>>2]=r[e+12>>2],r[i+16>>2]=0,0|(n=0|r[(e=t+4|0)>>2])?(r[n+16>>2]=i,r[e>>2]=i,0|i):(0|r[t>>2]&&T(22928,22787,82,22913),r[t>>2]=i,r[e>>2]=i,0|i)}function ae(t){var e=0,n=0,i=0,s=0;if(t|=0)for(i=1;;){if(0|(e=0|r[t>>2]))do{if(0|(n=0|r[e>>2]))do{s=n,n=0|r[n+16>>2],Ne(s)}while(0|n);s=e,e=0|r[e+8>>2],Ne(s)}while(0|e);if(e=t,t=0|r[t+8>>2],i||Ne(e),!t)break;i=0}}function oe(t){var e,n,i=0,a=0,o=0,l=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,w=0,E=0,C=0,R=0,N=0,P=0,D=0,I=0,L=0,B=0,U=0;if(0|r[(l=(t|=0)+8|0)>>2])return 0|(U=1);if(!(o=0|r[t>>2]))return 0|(U=0);i=o,a=0;do{a=a+1|0,i=0|r[i+8>>2]}while(0|i);if(a>>>0<2)return 0|(U=0);(n=0|Re(a<<2))||T(22948,22787,317,22967),(e=0|Re(a<<5))||T(22989,22787,321,22967),r[t>>2]=0,r[(C=t+4|0)>>2]=0,r[l>>2]=0,a=0,L=0,E=0,m=0;t:for(;;){if(f=0|r[o>>2]){h=0,c=f;do{if(d=+s[c+8>>3],i=c,c=0|r[c+16>>2],A=+s[(l=(p=!(0|c))?f:c)+8>>3],+u(+(d-A))>3.141592653589793){U=14;break}h+=(A-d)*(+s[i>>3]+ +s[l>>3])}while(!p);if(14==(0|U)){U=0,h=0,i=f;do{w=+s[i+8>>3],D=0|r[(I=i+16|0)>>2],M=+s[(D=0|D?D:f)+8>>3],h+=(+s[i>>3]+ +s[D>>3])*((M<0?M+6.283185307179586:M)-(w<0?w+6.283185307179586:w)),i=0|r[(0|i?I:o)>>2]}while(0|i)}h>0?(r[n+(L<<2)>>2]=o,L=L+1|0,l=E,i=m):U=19}else U=19;if(19==(0|U)){U=0;do{if(!a){if(m){l=C,c=m+8|0,i=o,a=t;break}if(0|r[t>>2]){U=27;break t}l=C,c=t,i=o,a=t;break}if(0|r[(i=a+8|0)>>2]){U=21;break t}if(!(a=0|Pe(1,12))){U=23;break t}r[i>>2]=a,l=a+4|0,c=a,i=m}while(0);if(r[c>>2]=o,r[l>>2]=o,c=e+(E<<5)|0,p=0|r[o>>2]){for(s[(f=e+(E<<5)+8|0)>>3]=17976931348623157e292,s[(m=e+(E<<5)+24|0)>>3]=17976931348623157e292,s[c>>3]=-17976931348623157e292,s[(g=e+(E<<5)+16|0)>>3]=-17976931348623157e292,b=17976931348623157e292,S=-17976931348623157e292,l=0,y=p,d=17976931348623157e292,_=17976931348623157e292,x=-17976931348623157e292,A=-17976931348623157e292;h=+s[y>>3],w=+s[y+8>>3],y=0|r[y+16>>2],M=+s[((v=!(0|y))?p:y)+8>>3],h<d&&(s[f>>3]=h,d=h),w<_&&(s[m>>3]=w,_=w),h>x?s[c>>3]=h:h=x,w>A&&(s[g>>3]=w,A=w),b=w>0&w<b?w:b,S=w<0&w>S?w:S,l|=+u(+(w-M))>3.141592653589793,!v;)x=h;l&&(s[g>>3]=S,s[m>>3]=b)}else r[c>>2]=0,r[c+4>>2]=0,r[c+8>>2]=0,r[c+12>>2]=0,r[c+16>>2]=0,r[c+20>>2]=0,r[c+24>>2]=0,r[c+28>>2]=0;l=E+1|0}if(o=0|r[(I=o+8|0)>>2],r[I>>2]=0,!o){U=45;break}E=l,m=i}if(21==(0|U))T(22765,22787,35,22799);else if(23==(0|U))T(22819,22787,37,22799);else if(27==(0|U))T(22862,22787,61,22885);else if(45==(0|U)){t:do{if((0|L)>0){for(I=!(0|l),P=l<<2,D=!(0|t),N=0,i=0;;){if(R=0|r[n+(N<<2)>>2],I)U=73;else{if(!(E=0|Re(P))){U=50;break}if(!(C=0|Re(P))){U=52;break}e:do{if(D)a=0;else{for(l=0,a=0,c=t;o=e+(l<<5)|0,0|le(0|r[c>>2],o,0|r[R>>2])?(r[E+(a<<2)>>2]=c,r[C+(a<<2)>>2]=o,v=a+1|0):v=a,c=0|r[c+8>>2];)l=l+1|0,a=v;if((0|v)>0)if(o=0|r[E>>2],1==(0|v))a=o;else for(g=0,y=-1,a=o,m=o;;){for(p=0|r[m>>2],o=0,c=0;f=(0|(l=0|r[r[E+(c<<2)>>2]>>2]))==(0|p)?o:o+(1&le(l,0|r[C+(c<<2)>>2],0|r[p>>2]))|0,(0|(c=c+1|0))!=(0|v);)o=f;if(a=(l=(0|f)>(0|y))?m:a,(0|(o=g+1|0))==(0|v))break e;g=o,y=l?f:y,m=0|r[E+(o<<2)>>2]}else a=0}}while(0);if(Ne(E),Ne(C),a){if(o=0|r[(l=a+4|0)>>2])a=o+8|0;else if(0|r[a>>2]){U=70;break}r[a>>2]=R,r[l>>2]=R}else U=73}if(73==(0|U)){if(U=0,0|(i=0|r[R>>2]))do{C=i,i=0|r[i+16>>2],Ne(C)}while(0|i);Ne(R),i=1}if((0|(N=N+1|0))>=(0|L)){B=i;break t}}50==(0|U)?T(23004,22787,249,23023):52==(0|U)?T(23042,22787,252,23023):70==(0|U)&&T(22862,22787,61,22885)}else B=0}while(0);return Ne(n),Ne(e),0|(U=B)}return 0}function le(t,e,n){t|=0;var i=0,a=0,o=0,l=0,u=0,h=0,c=0,A=0;if(!(0|Y(e|=0,n|=0)))return 0|(t=0);if(e=0|X(e),i=+s[n>>3],a=e&(a=+s[n+8>>3])<0?a+6.283185307179586:a,!(t=0|r[t>>2]))return 0|(t=0);if(e){e=0,c=a,n=t;t:for(;;){for(;l=+s[n>>3],a=+s[n+8>>3],A=0|r[(n=n+16|0)>>2],o=+s[(A=0|A?A:t)>>3],u=+s[A+8>>3],l>o?(h=l,l=u):(h=o,o=l,l=a,a=u),(i=i==o|i==h?i+2220446049250313e-31:i)<o|i>h;)if(!(n=0|r[n>>2])){n=22;break t}if(((h=(u=l<0?l+6.283185307179586:l)+(i-o)/(h-o)*((l=a<0?a+6.283185307179586:a)-u))<0?h+6.283185307179586:h)>(c=u==c|l==c?c+-2220446049250313e-31:c)&&(e^=1),!(n=0|r[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,c=a,n=t;t:for(;;){for(;l=+s[n>>3],a=+s[n+8>>3],A=0|r[(n=n+16|0)>>2],o=+s[(A=0|A?A:t)>>3],u=+s[A+8>>3],l>o?(h=l,l=u):(h=o,o=l,l=a,a=u),(i=i==o|i==h?i+2220446049250313e-31:i)<o|i>h;)if(!(n=0|r[n>>2])){n=22;break t}if(l+(i-o)/(h-o)*(a-l)>(c=l==c|a==c?c+-2220446049250313e-31:c)&&(e^=1),!(n=0|r[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function ue(t,e,n,s,a){n|=0,s|=0,a|=0;var o,l,u,h,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0;if(h=D,D=D+32|0,_=h+16|0,u=h,c=0|qe(0|(t|=0),0|(e|=0),52),w(),c&=15,g=0|qe(0|n,0|s,52),w(),(0|c)!=(15&g))return D=h,0|(_=12);if(f=0|qe(0|t,0|e,45),w(),f&=127,m=0|qe(0|n,0|s,45),w(),f>>>0>121|(m&=127)>>>0>121)return D=h,0|(_=5);if(g=(0|f)!=(0|m)){if(7==(0|(d=0|W(f,m))))return D=h,0|(_=1);7==(0|(p=0|W(m,f)))?T(23066,23090,161,23100):(y=d,A=p)}else y=0,A=0;o=0|z(f),l=0|z(m),r[_>>2]=0,r[_+4>>2]=0,r[_+8>>2]=0,r[_+12>>2]=0;do{if(y){if(d=(0|(m=0|r[4272+(28*f|0)+(y<<2)>>2]))>0,l)if(d){f=0,p=n,d=s;do{p=0|qt(p,d),d=0|w(),1==(0|(A=0|ft(A)))&&(A=0|ft(1)),f=f+1|0}while((0|f)!=(0|m));m=A,f=p,p=d}else m=A,f=n,p=s;else if(d){f=0,p=n,d=s;do{p=0|Gt(p,d),d=0|w(),A=0|ft(A),f=f+1|0}while((0|f)!=(0|m));m=A,f=p,p=d}else m=A,f=n,p=s;if(jt(f,p,_),g||T(23115,23090,191,23100),(d=!!(0|o))&(A=!!(0|l))&&T(23142,23090,192,23100),d){if(7==(0|(A=0|Ft(t,e)))){c=5;break}if(0|i[21872+(7*A|0)+y|0]){c=1;break}f=p=0|r[21040+(28*A|0)+(y<<2)>>2]}else if(A){if(7==(0|(A=0|Ft(f,p)))){c=5;break}if(0|i[21872+(7*A|0)+m|0]){c=1;break}f=0,p=0|r[21040+(28*m|0)+(A<<2)>>2]}else f=0,p=0;if((f|p)<0)c=5;else{if((0|p)>0){d=_+4|0,A=0;do{dt(d),A=A+1|0}while((0|A)!=(0|p))}if(r[u>>2]=0,r[u+4>>2]=0,r[u+8>>2]=0,ct(u,y),0|c)for(;0|Vt(c)?ut(u):ht(u),(0|c)>1;)c=c+-1|0;if((0|f)>0){c=0;do{dt(u),c=c+1|0}while((0|c)!=(0|f))}et(v=_+4|0,u,v),J(v),v=51}}else if(jt(n,s,_),!!(0|o)&!!(0|l))if((0|m)!=(0|f)&&T(23173,23090,261,23100),7==(0|(A=0|Ft(t,e)))|7==(0|(c=0|Ft(n,s))))c=5;else if(0|i[21872+(7*A|0)+c|0])c=1;else if((0|(A=0|r[21040+(28*A|0)+(c<<2)>>2]))>0){d=_+4|0,c=0;do{dt(d),c=c+1|0}while((0|c)!=(0|A));v=51}else v=51;else v=51}while(0);return 51==(0|v)&&(c=_+4|0,r[a>>2]=r[c>>2],r[a+4>>2]=r[c+4>>2],r[a+8>>2]=r[c+8>>2],c=0),D=h,0|(_=c)}function he(t,e,n,i){n|=0,i|=0;var s,a,o,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0;if(o=D,D=D+48|0,s=o+36|0,h=o+24|0,c=o+12|0,A=o,l=0|qe(0|(t|=0),0|(e|=0),52),w(),l&=15,p=0|qe(0|t,0|e,45),w(),(p&=127)>>>0>121)return D=o,0|(i=5);if(a=0|z(p),Ge(0|l,0,52),g=134225919|w(),r[(u=i)>>2]=-1,r[u+4>>2]=g,!l)return 7==(0|(l=0|rt(n)))||127==(0|(l=0|j(p,l)))?(D=o,0|(g=1)):(f=0|Ge(0|l,0,45),m=0|w(),m=-1040385&r[(p=i)+4>>2]|m,r[(g=i)>>2]=r[p>>2]|f,r[g+4>>2]=m,D=o,0|(g=0));for(r[s>>2]=r[n>>2],r[s+4>>2]=r[n+4>>2],r[s+8>>2]=r[n+8>>2],n=l;;){if(u=n,n=n+-1|0,r[h>>2]=r[s>>2],r[h+4>>2]=r[s+4>>2],r[h+8>>2]=r[s+8>>2],0|Vt(u)){if(0|(l=0|st(s))){n=13;break}r[c>>2]=r[s>>2],r[c+4>>2]=r[s+4>>2],r[c+8>>2]=r[s+8>>2],ut(c)}else{if(0|(l=0|at(s))){n=13;break}r[c>>2]=r[s>>2],r[c+4>>2]=r[s+4>>2],r[c+8>>2]=r[s+8>>2],ht(c)}if(nt(h,c,A),J(A),v=0|r[(l=i)>>2],l=0|r[l+4>>2],y=0|Ge(7,0,0|(_=3*(15-u|0)|0)),l&=~w(),_=0|Ge(0|rt(A),0,0|_),l=w()|l,r[(g=i)>>2]=_|v&~y,r[g+4>>2]=l,(0|u)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|r[s>>2])<=1&&(0|r[s+4>>2])<=1&&(0|r[s+8>>2])<=1){A=127==(0|(l=0|j(p,n=0|rt(s))))?0:0|z(l);e:do{if(n){if(a){if(7==(0|(l=0|Ft(t,e)))){l=5;break t}if((0|(u=0|r[21248+(28*l|0)+(n<<2)>>2]))>0){l=n,n=0;do{l=0|pt(l),n=n+1|0}while((0|n)!=(0|u))}else l=n;if(1==(0|l)){l=9;break t}127==(0|(n=0|j(p,l)))&&T(23200,23090,411,23230),0|z(n)?T(23245,23090,412,23230):(m=n,f=u,d=l)}else m=l,f=0,d=n;if((0|(c=0|r[4272+(28*p|0)+(d<<2)>>2]))<=-1&&T(23276,23090,419,23230),!A){if((0|f)<0){l=5;break t}if(0|f){l=0,n=0|r[(u=i)>>2],u=0|r[u+4>>2];do{n=0|zt(n,u),u=0|w(),r[(_=i)>>2]=n,r[_+4>>2]=u,l=l+1|0}while((0|l)<(0|f))}if((0|c)<=0){l=m,n=58;break}for(l=0,n=0|r[(u=i)>>2],u=0|r[u+4>>2];;)if(n=0|zt(n,u),u=0|w(),r[(_=i)>>2]=n,r[_+4>>2]=u,(0|(l=l+1|0))==(0|c)){l=m,n=58;break e}}if(7==(0|(h=0|W(m,p)))&&T(23066,23090,428,23230),n=0|r[(l=i)>>2],l=0|r[l+4>>2],(0|c)>0){u=0;do{n=0|zt(n,l),l=0|w(),r[(_=i)>>2]=n,r[_+4>>2]=l,u=u+1|0}while((0|u)!=(0|c))}if(7==(0|(l=0|Ft(n,l)))&&T(23313,23090,440,23230),n=0|q(m),(0|(n=0|r[(n?21664:21456)+(28*h|0)+(l<<2)>>2]))<0&&T(23313,23090,454,23230),n){l=0,u=0|r[(h=i)>>2],h=0|r[h+4>>2];do{u=0|kt(u,h),h=0|w(),r[(_=i)>>2]=u,r[_+4>>2]=h,l=l+1|0}while((0|l)<(0|n));l=m,n=58}else l=m,n=58}else if(!!(0|a)&!!(0|A)){if(7==(0|(n=0|Ft(t,e)))|7==(0|(u=0|Ft(0|r[(u=i)>>2],0|r[u+4>>2])))){l=5;break t}if((0|(u=0|r[21248+(28*n|0)+(u<<2)>>2]))<0){l=5;break t}if(u){n=0,h=0|r[(c=i)>>2],c=0|r[c+4>>2];do{h=0|zt(h,c),c=0|w(),r[(_=i)>>2]=h,r[_+4>>2]=c,n=n+1|0}while((0|n)<(0|u));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&A&&(n=59),59==(0|n)&&1==(0|Ft(0|r[(_=i)>>2],0|r[_+4>>2]))){l=9;break}y=0|r[(_=i)>>2],_=-1040385&r[_+4>>2],v=0|Ge(0|l,0,45),_|=w(),r[(l=i)>>2]=y|v,r[l+4>>2]=_,l=0}else l=1}while(0);return D=o,0|(_=l)}function ce(t,e,n,i){t|=0,e|=0;var r=0,s=0,a=0;if(!(0|(n|=0))&!(0|(i|=0)))return s=1,M(0|(r=0)),0|s;s=t,r=e,t=1,e=0;do{t=0|Oe(0|((a=!0&!(1&n))?1:s),0|(a?0:r),0|t,0|e),e=0|w(),n=0|ze(0|n,0|i,1),i=0|w(),s=0|Oe(0|s,0|r,0|s,0|r),r=0|w()}while(!(!(0|n)&!(0|i)));return M(0|e),0|t}function Ae(t,e,n){t|=0;var i,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0;if(!(0|Y(e|=0,n|=0)))return 0|(p=0);if(e=0|X(e),a=+s[n>>3],o=e&(o=+s[n+8>>3])<0?o+6.283185307179586:o,(0|(p=0|r[t>>2]))<=0)return 0|(p=0);if(i=0|r[t+4>>2],e){e=0,d=o,n=-1,t=0;t:for(;;){for(A=t;u=+s[i+(A<<4)>>3],o=+s[i+(A<<4)+8>>3],l=+s[i+((t=(n+2|0)%(0|p)|0)<<4)>>3],h=+s[i+(t<<4)+8>>3],u>l?(c=u,u=h):(c=l,l=u,u=o,o=h),(a=a==l|a==c?a+2220446049250313e-31:a)<l|a>c;){if((0|(n=A+1|0))>=(0|p)){n=22;break t}t=A,A=n,n=t}if(((c=(h=u<0?u+6.283185307179586:u)+(a-l)/(c-l)*((u=o<0?o+6.283185307179586:o)-h))<0?c+6.283185307179586:c)>(d=h==d|u==d?d+-2220446049250313e-31:d)&&(e^=1),(0|(t=A+1|0))>=(0|p)){n=22;break}n=A}if(22==(0|n))return 0|e}else{e=0,d=o,n=-1,t=0;t:for(;;){for(A=t;u=+s[i+(A<<4)>>3],o=+s[i+(A<<4)+8>>3],l=+s[i+((t=(n+2|0)%(0|p)|0)<<4)>>3],h=+s[i+(t<<4)+8>>3],u>l?(c=u,u=h):(c=l,l=u,u=o,o=h),(a=a==l|a==c?a+2220446049250313e-31:a)<l|a>c;){if((0|(n=A+1|0))>=(0|p)){n=22;break t}t=A,A=n,n=t}if(u+(a-l)/(c-l)*(o-u)>(d=u==d|o==d?d+-2220446049250313e-31:d)&&(e^=1),(0|(t=A+1|0))>=(0|p)){n=22;break}n=A}if(22==(0|n))return 0|e}return 0}function de(t,e){e|=0;var n,i,a,o,l,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0;if(!(i=0|r[(t|=0)>>2]))return r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,void(r[e+28>>2]=0);if(s[(a=e+8|0)>>3]=17976931348623157e292,s[(o=e+24|0)>>3]=17976931348623157e292,s[e>>3]=-17976931348623157e292,s[(l=e+16|0)>>3]=-17976931348623157e292,!((0|i)<=0)){for(n=0|r[t+4>>2],g=17976931348623157e292,y=-17976931348623157e292,v=0,t=-1,d=17976931348623157e292,p=17976931348623157e292,m=-17976931348623157e292,c=-17976931348623157e292,_=0;h=+s[n+(_<<4)>>3],f=+s[n+(_<<4)+8>>3],A=+s[n+(((0|(t=t+2|0))==(0|i)?0:t)<<4)+8>>3],h<d&&(s[a>>3]=h,d=h),f<p&&(s[o>>3]=f,p=f),h>m?s[e>>3]=h:h=m,f>c&&(s[l>>3]=f,c=f),g=f>0&f<g?f:g,y=f<0&f>y?f:y,v|=+u(+(f-A))>3.141592653589793,(0|(t=_+1|0))!=(0|i);)x=_,m=h,_=t,t=x;v&&(s[l>>3]=y,s[o>>3]=g)}}function pe(t,e){e|=0;var n,i=0,a=0,o=0,l=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,w=0,T=0;if(y=0|r[(t|=0)>>2]){if(s[(v=e+8|0)>>3]=17976931348623157e292,s[(_=e+24|0)>>3]=17976931348623157e292,s[e>>3]=-17976931348623157e292,s[(x=e+16|0)>>3]=-17976931348623157e292,(0|y)>0){for(o=0|r[t+4>>2],m=17976931348623157e292,g=-17976931348623157e292,a=0,i=-1,A=17976931348623157e292,d=17976931348623157e292,f=-17976931348623157e292,h=-17976931348623157e292,b=0;l=+s[o+(b<<4)>>3],p=+s[o+(b<<4)+8>>3],c=+s[o+(((0|(w=i+2|0))==(0|y)?0:w)<<4)+8>>3],l<A&&(s[v>>3]=l,A=l),p<d&&(s[_>>3]=p,d=p),l>f?s[e>>3]=l:l=f,p>h&&(s[x>>3]=p,h=p),m=p>0&p<m?p:m,g=p<0&p>g?p:g,a|=+u(+(p-c))>3.141592653589793,(0|(i=b+1|0))!=(0|y);)w=b,f=l,b=i,i=w;a&&(s[x>>3]=g,s[_>>3]=m)}}else r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,r[e+28>>2]=0;if(!((0|(i=0|r[(w=t+8|0)>>2]))<=0)){n=t+12|0,M=0;do{if(o=0|r[n>>2],a=M,_=e+((M=M+1|0)<<5)|0,x=0|r[o+(a<<3)>>2]){if(s[(b=e+(M<<5)+8|0)>>3]=17976931348623157e292,s[(t=e+(M<<5)+24|0)>>3]=17976931348623157e292,s[_>>3]=-17976931348623157e292,s[(S=e+(M<<5)+16|0)>>3]=-17976931348623157e292,(0|x)>0){for(y=0|r[o+(a<<3)+4>>2],m=17976931348623157e292,g=-17976931348623157e292,o=0,a=-1,v=0,A=17976931348623157e292,d=17976931348623157e292,p=-17976931348623157e292,h=-17976931348623157e292;l=+s[y+(v<<4)>>3],f=+s[y+(v<<4)+8>>3],c=+s[y+(((0|(a=a+2|0))==(0|x)?0:a)<<4)+8>>3],l<A&&(s[b>>3]=l,A=l),f<d&&(s[t>>3]=f,d=f),l>p?s[_>>3]=l:l=p,f>h&&(s[S>>3]=f,h=f),m=f>0&f<m?f:m,g=f<0&f>g?f:g,o|=+u(+(f-c))>3.141592653589793,(0|(a=v+1|0))!=(0|x);)T=v,v=a,p=l,a=T;o&&(s[S>>3]=g,s[t>>3]=m)}}else r[_>>2]=0,r[_+4>>2]=0,r[_+8>>2]=0,r[_+12>>2]=0,r[_+16>>2]=0,r[_+20>>2]=0,r[_+24>>2]=0,r[_+28>>2]=0,i=0|r[w>>2]}while((0|M)<(0|i))}}function fe(t,e,n){var i=0,s=0,a=0;if(!(0|Ae(t|=0,e|=0,n|=0)))return 0|(s=0);if((0|r[(s=t+8|0)>>2])<=0)return 0|(s=1);for(i=t+12|0,t=0;;){if(a=t,t=t+1|0,0|Ae((0|r[i>>2])+(a<<3)|0,e+(t<<5)|0,n)){t=0,i=6;break}if((0|t)>=(0|r[s>>2])){t=1,i=6;break}}return 6==(0|i)?0|t:0}function me(t,e,n,i,r){e|=0,n|=0,i|=0,r|=0;var a,o,l,u,h,c,A,d=0;u=+s[(t|=0)>>3],l=+s[e>>3]-u,o=+s[t+8>>3],a=+s[e+8>>3]-o,c=+s[n>>3],d=((d=+s[i>>3]-c)*(o-(A=+s[n+8>>3]))-(u-c)*(h=+s[i+8>>3]-A))/(l*h-a*d),s[r>>3]=u+l*d,s[r+8>>3]=o+a*d}function ge(t,e){return e|=0,+u(+(+s[(t|=0)>>3]-+s[e>>3]))<1.1920928955078125e-7?0|(e=+u(+(+s[t+8>>3]-+s[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function ye(t,e){e|=0;var n,i,r;return+((r=+s[(t|=0)>>3]-+s[e>>3])*r+(i=+s[t+8>>3]-+s[e+8>>3])*i+(n=+s[t+16>>3]-+s[e+16>>3])*n)}function ve(t,e,n){n|=0;var i,s,a,o,l=0,u=0,h=0;if(o=D,D=D+32|0,h=o,0|(l=0|Wt(t|=0,e|=0,s=o+16|0)))return D=o,0|(n=l);i=0|It(t,e),a=0|Ft(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,r[(e|=0)>>2]=r[t>>2],r[e+4>>2]=r[t+4>>2],r[e+8>>2]=r[t+8>>2],r[e+12>>2]=r[t+12>>2]}(i,h),l=0|function(t,e){t|=0;var n=0,i=0;if((e|=0)>>>0>20)return-1;do{if((0|r[11120+(216*e|0)>>2])!=(0|t))if((0|r[11120+(216*e|0)+8>>2])!=(0|t))if((0|r[11120+(216*e|0)+16>>2])!=(0|t))if((0|r[11120+(216*e|0)+24>>2])!=(0|t))if((0|r[11120+(216*e|0)+32>>2])!=(0|t))if((0|r[11120+(216*e|0)+40>>2])!=(0|t))if((0|r[11120+(216*e|0)+48>>2])!=(0|t))if((0|r[11120+(216*e|0)+56>>2])!=(0|t))if((0|r[11120+(216*e|0)+64>>2])!=(0|t))if((0|r[11120+(216*e|0)+72>>2])!=(0|t))if((0|r[11120+(216*e|0)+80>>2])!=(0|t))if((0|r[11120+(216*e|0)+88>>2])!=(0|t))if((0|r[11120+(216*e|0)+96>>2])!=(0|t))if((0|r[11120+(216*e|0)+104>>2])!=(0|t))if((0|r[11120+(216*e|0)+112>>2])!=(0|t))if((0|r[11120+(216*e|0)+120>>2])!=(0|t))if((0|r[11120+(216*e|0)+128>>2])!=(0|t)){if((0|r[11120+(216*e|0)+136>>2])!=(0|t)){if((0|r[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,i=0;break}if((0|r[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,i=1;break}if((0|r[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,i=2;break}if((0|r[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,i=0;break}if((0|r[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,i=1;break}if((0|r[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,i=2;break}if((0|r[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,i=0;break}if((0|r[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,i=1;break}if((0|r[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,i=2;break}return-1}t=2,n=1,i=2}else t=2,n=1,i=1;else t=2,n=1,i=0;else t=1,n=1,i=2;else t=1,n=1,i=1;else t=1,n=1,i=0;else t=0,n=1,i=2;else t=0,n=1,i=1;else t=0,n=1,i=0;else t=2,n=0,i=2;else t=2,n=0,i=1;else t=2,n=0,i=0;else t=1,n=0,i=2;else t=1,n=0,i=1;else t=1,n=0,i=0;else t=0,n=0,i=2;else t=0,n=0,i=1;else t=0,n=0,i=0}while(0);return 0|r[11120+(216*e|0)+(72*n|0)+(24*t|0)+(i<<3)+4>>2]}(i,0|r[s>>2]);t:do{if(0|z(i)){switch(0|i){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:l=1;break t}if(u=0|r[22e3+(24*t|0)+8>>2],e=0|r[22e3+(24*t|0)+16>>2],(0|(t=0|r[s>>2]))!=(0|r[h>>2])&&(h=0|q(i))|(0|(t=0|r[s>>2]))==(0|e)&&(l=(l+1|0)%6|0),3==(0|a)&(0|t)==(0|e)){l=(l+5|0)%6|0,u=22;break}5==(0|a)&(0|t)==(0|u)?(l=(l+1|0)%6|0,u=22):u=22}else u=22}while(0);return 22==(0|u)&&(r[n>>2]=l,l=0),D=o,0|(n=l)}function _e(t,e,n,i){n|=0,i|=0;var s,a,o,l,u,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0;if(u=D,D=D+32|0,_=u+24|0,l=u+20|0,o=u+8|0,a=u+16|0,s=u,p=(p=!(0|Ot(t|=0,e|=0)))?6:5,m=0|qe(0|t,0|e,52),w(),p>>>0<=n>>>0)return D=u,0|(i=2);!(g=!(0|(m&=15)))&&!((y=0|Ge(7,0,3*(15^m)|0))&t)&!(w()&e)?h=n:c=4;t:do{if(4==(0|c)){if((0|((h=!!(0|Ot(t,e)))?4:5))<(0|n))return D=u,0|(i=1);if(0|ve(t,e,_))return D=u,0|(i=1);if(c=(0|r[_>>2])+n|0,7==(0|(y=0|r[(h=h?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2])))return D=u,0|(i=1);r[l>>2]=0,h=0|O(t,e,y,l,o);do{if(!h){if(f=0|r[(d=o)>>2],c=(A=(d=0|r[d+4>>2])>>>0<e>>>0|(0|d)==(0|e)&f>>>0<t>>>0)?f:t,A=A?d:e,!g&&!(f&(g=0|Ge(7,0,3*(15^m)|0)))&!(d&w()))h=n;else{if(d=(n+-1+p|0)%(0|p)|0,h=0|Ot(t,e),(0|d)<0&&T(23313,23315,245,23324),(0|((p=!!(0|h))?4:5))<(0|d)&&T(23313,23315,245,23324),0|ve(t,e,_)&&T(23313,23315,245,23324),h=(0|r[_>>2])+d|0,7==(0|(d=0|r[(h=p?22288+((0|h)%5<<2)|0:22320+((0|h)%6<<2)|0)>>2]))&&T(23313,23315,245,23324),r[a>>2]=0,0|(h=0|O(t,e,d,a,s)))break;p=0|r[(f=s)>>2],f=0|r[f+4>>2];do{if(f>>>0<A>>>0|(0|f)==(0|A)&p>>>0<c>>>0){if(c=0|Ot(p,f)?0|F(p,f,t,e):0|r[22384+(((0|r[a>>2])+(0|r[22352+(d<<2)>>2])|0)%6<<2)>>2],h=0|Ot(p,f),(c+-1|0)>>>0>5){h=-1,c=p,A=f;break}if(1==(0|c)&(h=!!(0|h))){h=-1,c=p,A=f;break}do{if(!(0|ve(p,f,_))){if(h){h=(5+(0|r[21936+(c<<2)>>2])-(0|r[_>>2])|0)%5|0;break}h=(6+(0|r[21968+(c<<2)>>2])-(0|r[_>>2])|0)%6|0;break}h=-1}while(0);c=p,A=f}else h=n}while(0);f=0|r[(d=o)>>2],d=0|r[d+4>>2]}if((0|c)==(0|f)&(0|A)==(0|d)){if(t=(p=!!(0|Ot(f,d)))?0|F(f,d,t,e):0|r[22384+(((0|r[l>>2])+(0|r[22352+(y<<2)>>2])|0)%6<<2)>>2],h=0|Ot(f,d),(t+-1|0)>>>0<=5&&!(1==(0|t)&(v=!!(0|h))))do{if(!(0|ve(f,d,_))){if(v){h=(5+(0|r[21936+(t<<2)>>2])-(0|r[_>>2])|0)%5|0;break}h=(6+(0|r[21968+(t<<2)>>2])-(0|r[_>>2])|0)%6|0;break}h=-1}while(0);else h=-1;h=6==(0|(h=h+1|0))|p&5==(0|h)?0:h}e=A,t=c;break t}}while(0);return D=u,0|(i=h)}}while(0);return v=0|Ge(0|h,0,56),_=w()|-2130706433&e|536870912,r[i>>2]=v|t,r[i+4>>2]=_,D=u,0|(i=0)}function xe(t,e,n){t|=0,n|=0;var i=0;(0|(e|=0))>0?(i=0|Pe(e,4),r[t>>2]=i,i||T(23337,23360,40,23374)):r[t>>2]=0,r[t+4>>2]=e,r[t+8>>2]=0,r[t+12>>2]=n}function be(t){var e,n,i,a=0,o=0,l=0,h=0;e=(t|=0)+4|0,n=t+12|0,i=t+8|0;t:for(;;){for(o=0|r[e>>2],a=0;;){if((0|a)>=(0|o))break t;if(l=0|r[t>>2],h=0|r[l+(a<<2)>>2])break;a=a+1|0}a=l+(~~(+u(+ +c(10,+ +(15-(0|r[n>>2])|0))*(+s[h>>3]+ +s[h+8>>3]))%+(0|o))>>>0<<2)|0,o=0|r[a>>2];e:do{if(0|o){if(l=h+32|0,(0|o)==(0|h))r[a>>2]=r[l>>2];else{if(!(a=0|r[(o=o+32|0)>>2]))break;for(;(0|a)!=(0|h);)if(!(a=0|r[(o=a+32|0)>>2]))break e;r[o>>2]=r[l>>2]}Ne(h),r[i>>2]=(0|r[i>>2])-1}}while(0)}Ne(0|r[t>>2])}function Se(t){var e,n=0,i=0;for(e=0|r[(t|=0)+4>>2],i=0;;){if((0|i)>=(0|e)){n=0,i=4;break}if(n=0|r[(0|r[t>>2])+(i<<2)>>2]){i=4;break}i=i+1|0}return 4==(0|i)?0|n:0}function Me(t,e){e|=0;var n=0,i=0,a=0,o=0;if(n=~~(+u(+ +c(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+s[e>>3]+ +s[e+8>>3]))%+(0|r[t+4>>2]))>>>0,n=(0|r[t>>2])+(n<<2)|0,!(i=0|r[n>>2]))return 0|(o=1);o=e+32|0;do{if((0|i)!=(0|e)){if(!(n=0|r[i+32>>2]))return 0|(o=1);for(a=n;;){if((0|a)==(0|e)){a=8;break}if(!(n=0|r[a+32>>2])){n=1,a=10;break}i=a,a=n}if(8==(0|a)){r[i+32>>2]=r[o>>2];break}if(10==(0|a))return 0|n}else r[n>>2]=r[o>>2]}while(0);return Ne(e),r[(o=t+8|0)>>2]=(0|r[o>>2])-1,0|(o=0)}function we(t,e,n){t|=0,e|=0,n|=0;var i,a=0,o=0,l=0;(i=0|Re(40))||T(23390,23360,98,23403),r[i>>2]=r[e>>2],r[i+4>>2]=r[e+4>>2],r[i+8>>2]=r[e+8>>2],r[i+12>>2]=r[e+12>>2],r[(o=i+16|0)>>2]=r[n>>2],r[o+4>>2]=r[n+4>>2],r[o+8>>2]=r[n+8>>2],r[o+12>>2]=r[n+12>>2],r[i+32>>2]=0,o=~~(+u(+ +c(10,+ +(15-(0|r[t+12>>2])|0))*(+s[e>>3]+ +s[e+8>>3]))%+(0|r[t+4>>2]))>>>0,o=(0|r[t>>2])+(o<<2)|0,a=0|r[o>>2];do{if(a){for(;!(0|Jt(a,e)&&0|Jt(a+16|0,n));)if(o=0|r[a+32>>2],!(0|r[(a=0|o?o:a)+32>>2])){l=10;break}if(10==(0|l)){r[a+32>>2]=i;break}return Ne(i),0|(l=a)}r[o>>2]=i}while(0);return r[(l=t+8|0)>>2]=1+(0|r[l>>2]),0|(l=i)}function Te(t,e,n){e|=0,n|=0;var i=0,a=0;if(a=~~(+u(+ +c(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+s[e>>3]+ +s[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(a=0|r[(0|r[t>>2])+(a<<2)>>2]))return 0|(n=0);if(!n){for(t=a;;){if(0|Jt(t,e)){i=10;break}if(!(t=0|r[t+32>>2])){t=0,i=10;break}}if(10==(0|i))return 0|t}for(t=a;;){if(0|Jt(t,e)&&0|Jt(t+16|0,n)){i=10;break}if(!(t=0|r[t+32>>2])){t=0,i=10;break}}return 10==(0|i)?0|t:0}function Ee(t,e){e|=0;var n=0;if(n=~~(+u(+ +c(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+s[e>>3]+ +s[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(t=0|r[(0|r[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Jt(t,e)){e=5;break}if(!(t=0|r[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Ce(t){return 0|+function(t){return+ +Ye(+(t=+t))}(t=+t)}function Re(t){t|=0;var e,n=0,i=0,s=0,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0;e=D,D=D+16|0,p=e;do{if(t>>>0<245){if(t=(c=t>>>0<11?16:t+11&-8)>>>3,3&(i=(d=0|r[5857])>>>t))return s=0|r[(i=(t=23468+((n=(1&i^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(o=0|r[(a=s+8|0)>>2]))==(0|t)?r[5857]=d&~(1<<n):(r[o+12>>2]=t,r[i>>2]=o),b=n<<3,r[s+4>>2]=3|b,r[(b=s+b+4|0)>>2]=1|r[b>>2],D=e,0|(b=a);if(c>>>0>(A=0|r[5859])>>>0){if(0|i)return n=((n=i<<t&((n=2<<t)|0-n))&0-n)-1|0,o=0|r[(t=(n=23468+((s=((i=(n>>>=u=n>>>12&16)>>>5&8)|u|(o=(n>>>=i)>>>2&4)|(t=(n>>>=o)>>>1&2)|(s=(n>>>=t)>>>1&1))+(n>>>s)|0)<<1<<2)|0)+8|0)>>2],(0|(i=0|r[(u=o+8|0)>>2]))==(0|n)?(t=d&~(1<<s),r[5857]=t):(r[i+12>>2]=n,r[t>>2]=i,t=d),l=(b=s<<3)-c|0,r[o+4>>2]=3|c,r[(a=o+c|0)+4>>2]=1|l,r[o+b>>2]=l,0|A&&(s=0|r[5862],i=23468+((n=A>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=s,r[n+12>>2]=s,r[s+8>>2]=n,r[s+12>>2]=i),r[5859]=l,r[5862]=a,D=e,0|(b=u);if(o=0|r[5858]){for(i=(o&0-o)-1|0,i=h=0|r[23732+(((s=(i>>>=a=i>>>12&16)>>>5&8)|a|(l=(i>>>=s)>>>2&4)|(u=(i>>>=l)>>>1&2)|(h=(i>>>=u)>>>1&1))+(i>>>h)<<2)>>2],u=h,h=(-8&r[h+4>>2])-c|0;(t=0|r[i+16>>2])||(t=0|r[i+20>>2]);)i=t,u=(a=(l=(-8&r[t+4>>2])-c|0)>>>0<h>>>0)?t:u,h=a?l:h;if((l=u+c|0)>>>0>u>>>0){a=0|r[u+24>>2],n=0|r[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|r[(t=u+20|0)>>2])&&!(n=0|r[(t=u+16|0)>>2])){i=0;break}for(;;)if(i=0|r[(s=n+20|0)>>2])n=i,t=s;else{if(!(i=0|r[(s=n+16|0)>>2]))break;n=i,t=s}r[t>>2]=0,i=n}else i=0|r[u+8>>2],r[i+12>>2]=n,r[n+8>>2]=i,i=n}while(0);do{if(0|a){if(n=0|r[u+28>>2],(0|u)==(0|r[(t=23732+(n<<2)|0)>>2])){if(r[t>>2]=i,!i){r[5858]=o&~(1<<n);break}}else if(r[((0|r[(b=a+16|0)>>2])==(0|u)?b:a+20)>>2]=i,!i)break;r[i+24>>2]=a,0|(n=0|r[u+16>>2])&&(r[i+16>>2]=n,r[n+24>>2]=i),0|(n=0|r[u+20>>2])&&(r[i+20>>2]=n,r[n+24>>2]=i)}}while(0);return h>>>0<16?(b=h+c|0,r[u+4>>2]=3|b,r[(b=u+b+4|0)>>2]=1|r[b>>2]):(r[u+4>>2]=3|c,r[l+4>>2]=1|h,r[l+h>>2]=h,0|A&&(s=0|r[5862],i=23468+((n=A>>>3)<<1<<2)|0,(n=1<<n)&d?n=0|r[(t=i+8|0)>>2]:(r[5857]=n|d,n=i,t=i+8|0),r[t>>2]=s,r[n+12>>2]=s,r[s+8>>2]=n,r[s+12>>2]=i),r[5859]=h,r[5862]=l),D=e,0|(b=u+8|0)}d=c}else d=c}else d=c}else if(t>>>0<=4294967231)if(c=-8&(t=t+11|0),s=0|r[5858]){a=0-c|0,h=(t>>>=8)?c>>>0>16777215?31:c>>>((h=14-((u=((g=t<<(d=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|d|(h=((g<<=u)+245760|0)>>>16&2))+(g<<h>>>15)|0)+7|0)&1|h<<1:0,i=0|r[23732+(h<<2)>>2];t:do{if(i)for(t=0,u=c<<(31==(0|h)?0:25-(h>>>1)),o=0;;){if((l=(-8&r[i+4>>2])-c|0)>>>0<a>>>0){if(!l){t=i,a=0,g=65;break t}t=i,a=l}if(o=!(0|(g=0|r[i+20>>2]))|(0|g)==(0|(i=0|r[i+16+(u>>>31<<2)>>2]))?o:g,!i){i=o,g=61;break}u<<=1}else i=0,t=0,g=61}while(0);if(61==(0|g)){if(!(0|i)&!(0|t)){if(!(t=((t=2<<h)|0-t)&s)){d=c;break}d=(t&0-t)-1|0,t=0,i=0|r[23732+(((o=(d>>>=l=d>>>12&16)>>>5&8)|l|(u=(d>>>=o)>>>2&4)|(h=(d>>>=u)>>>1&2)|(i=(d>>>=h)>>>1&1))+(d>>>i)<<2)>>2]}i?g=65:(u=t,l=a)}if(65==(0|g))for(o=i;;){if(a=(i=(d=(-8&r[o+4>>2])-c|0)>>>0<a>>>0)?d:a,t=i?o:t,(i=0|r[o+16>>2])||(i=0|r[o+20>>2]),!i){u=t,l=a;break}o=i}if(0|u&&l>>>0<((0|r[5859])-c|0)>>>0&&(A=u+c|0)>>>0>u>>>0){o=0|r[u+24>>2],n=0|r[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|r[(t=u+20|0)>>2])&&!(n=0|r[(t=u+16|0)>>2])){n=0;break}for(;;)if(i=0|r[(a=n+20|0)>>2])n=i,t=a;else{if(!(i=0|r[(a=n+16|0)>>2]))break;n=i,t=a}r[t>>2]=0}else b=0|r[u+8>>2],r[b+12>>2]=n,r[n+8>>2]=b}while(0);do{if(o){if(t=0|r[u+28>>2],(0|u)==(0|r[(i=23732+(t<<2)|0)>>2])){if(r[i>>2]=n,!n){s&=~(1<<t),r[5858]=s;break}}else if(r[((0|r[(b=o+16|0)>>2])==(0|u)?b:o+20)>>2]=n,!n)break;r[n+24>>2]=o,0|(t=0|r[u+16>>2])&&(r[n+16>>2]=t,r[t+24>>2]=n),(t=0|r[u+20>>2])&&(r[n+20>>2]=t,r[t+24>>2]=n)}}while(0);t:do{if(l>>>0<16)b=l+c|0,r[u+4>>2]=3|b,r[(b=u+b+4|0)>>2]=1|r[b>>2];else{if(r[u+4>>2]=3|c,r[A+4>>2]=1|l,r[A+l>>2]=l,n=l>>>3,l>>>0<256){i=23468+(n<<1<<2)|0,(t=0|r[5857])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=A,r[n+12>>2]=A,r[A+8>>2]=n,r[A+12>>2]=i;break}if(n=23732+((i=(n=l>>>8)?l>>>0>16777215?31:l>>>((i=14-((_=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(i=((b<<=_)+245760|0)>>>16&2))+(b<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,r[A+28>>2]=i,r[(t=A+16|0)+4>>2]=0,r[t>>2]=0,!(s&(t=1<<i))){r[5858]=s|t,r[n>>2]=A,r[A+24>>2]=n,r[A+12>>2]=A,r[A+8>>2]=A;break}n=0|r[n>>2];e:do{if((-8&r[n+4>>2])!=(0|l)){for(s=l<<(31==(0|i)?0:25-(i>>>1));t=0|r[(i=n+16+(s>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|l)){n=t;break e}s<<=1,n=t}r[i>>2]=A,r[A+24>>2]=n,r[A+12>>2]=A,r[A+8>>2]=A;break t}}while(0);b=0|r[(x=n+8|0)>>2],r[b+12>>2]=A,r[x>>2]=A,r[A+8>>2]=b,r[A+12>>2]=n,r[A+24>>2]=0}}while(0);return D=e,0|(b=u+8|0)}d=c}else d=c;else d=-1}while(0);if((i=0|r[5859])>>>0>=d>>>0)return n=i-d|0,t=0|r[5862],n>>>0>15?(b=t+d|0,r[5862]=b,r[5859]=n,r[b+4>>2]=1|n,r[t+i>>2]=n,r[t+4>>2]=3|d):(r[5859]=0,r[5862]=0,r[t+4>>2]=3|i,r[(b=t+i+4|0)>>2]=1|r[b>>2]),D=e,0|(b=t+8|0);if((l=0|r[5860])>>>0>d>>>0)return _=l-d|0,r[5860]=_,x=(b=0|r[5863])+d|0,r[5863]=x,r[x+4>>2]=1|_,r[b+4>>2]=3|d,D=e,0|(b=b+8|0);if(0|r[5975]?t=0|r[5977]:(r[5977]=4096,r[5976]=4096,r[5978]=-1,r[5979]=-1,r[5980]=0,r[5968]=0,r[5975]=-16&p^1431655768,t=4096),u=d+48|0,(c=(o=t+(h=d+47|0)|0)&(a=0-t|0))>>>0<=d>>>0)return D=e,0|(b=0);if(0|(t=0|r[5967])&&(p=(A=0|r[5965])+c|0)>>>0<=A>>>0|p>>>0>t>>>0)return D=e,0|(b=0);t:do{if(4&r[5968])n=0,g=143;else{i=0|r[5863];e:do{if(i){for(s=23876;!((p=0|r[s>>2])>>>0<=i>>>0&&(p+(0|r[s+4>>2])|0)>>>0>i>>>0);){if(!(t=0|r[s+8>>2])){g=128;break e}s=t}if((n=o-l&a)>>>0<2147483647)if((0|(t=0|Qe(0|n)))==((0|r[s>>2])+(0|r[s+4>>2])|0)){if(-1!=(0|t)){l=n,o=t,g=145;break t}}else s=t,g=136;else n=0}else g=128}while(0);do{if(128==(0|g))if(-1!=(0|(i=0|Qe(0)))&&(n=i,m=(n=((m=(f=0|r[5976])+-1|0)&n?(m+n&0-f)-n|0:0)+c|0)+(f=0|r[5965])|0,n>>>0>d>>>0&n>>>0<2147483647)){if(0|(p=0|r[5967])&&m>>>0<=f>>>0|m>>>0>p>>>0){n=0;break}if((0|(t=0|Qe(0|n)))==(0|i)){l=n,o=i,g=145;break t}s=t,g=136}else n=0}while(0);do{if(136==(0|g)){if(i=0-n|0,!(u>>>0>n>>>0&n>>>0<2147483647&-1!=(0|s))){if(-1==(0|s)){n=0;break}l=n,o=s,g=145;break t}if((t=h-n+(t=0|r[5977])&0-t)>>>0>=2147483647){l=n,o=s,g=145;break t}if(-1==(0|Qe(0|t))){Qe(0|i),n=0;break}l=t+n|0,o=s,g=145;break t}}while(0);r[5968]=4|r[5968],g=143}}while(0);if(143==(0|g)&&c>>>0<2147483647&&!(-1==(0|(_=0|Qe(0|c)))|1^(v=(y=(m=0|Qe(0))-_|0)>>>0>(d+40|0)>>>0)|_>>>0<m>>>0&-1!=(0|_)&-1!=(0|m)^1)&&(l=v?y:n,o=_,g=145),145==(0|g)){n=(0|r[5965])+l|0,r[5965]=n,n>>>0>(0|r[5966])>>>0&&(r[5966]=n),h=0|r[5863];t:do{if(h){for(n=23876;;){if((0|o)==((t=0|r[n>>2])+(i=0|r[n+4>>2])|0)){g=154;break}if(!(s=0|r[n+8>>2]))break;n=s}if(!(154!=(0|g)||(x=n+4|0,8&r[n+12>>2]))&&o>>>0>h>>>0&t>>>0<=h>>>0){r[x>>2]=i+l,x=h+(_=7&(_=h+8|0)?0-_&7:0)|0,_=(b=(0|r[5860])+l|0)-_|0,r[5863]=x,r[5860]=_,r[x+4>>2]=1|_,r[h+b+4>>2]=40,r[5864]=r[5979];break}for(o>>>0<(0|r[5861])>>>0&&(r[5861]=o),i=o+l|0,n=23876;;){if((0|r[n>>2])==(0|i)){g=162;break}if(!(t=0|r[n+8>>2]))break;n=t}if(162==(0|g)&&!(8&r[n+12>>2])){r[n>>2]=o,r[(A=n+4|0)>>2]=(0|r[A>>2])+l,c=(A=o+(7&(A=o+8|0)?0-A&7:0)|0)+d|0,u=(n=i+(7&(n=i+8|0)?0-n&7:0)|0)-A-d|0,r[A+4>>2]=3|d;e:do{if((0|h)==(0|n))b=(0|r[5860])+u|0,r[5860]=b,r[5863]=c,r[c+4>>2]=1|b;else{if((0|r[5862])==(0|n)){b=(0|r[5859])+u|0,r[5859]=b,r[5862]=c,r[c+4>>2]=1|b,r[c+b>>2]=b;break}if(1==(3&(t=0|r[n+4>>2]))){l=-8&t,s=t>>>3;n:do{if(t>>>0<256){if(t=0|r[n+8>>2],(0|(i=0|r[n+12>>2]))==(0|t)){r[5857]=r[5857]&~(1<<s);break}r[t+12>>2]=i,r[i+8>>2]=t;break}o=0|r[n+24>>2],t=0|r[n+12>>2];do{if((0|t)==(0|n)){if(t=0|r[(s=(i=n+16|0)+4|0)>>2])i=s;else if(!(t=0|r[i>>2])){t=0;break}for(;;)if(s=0|r[(a=t+20|0)>>2])t=s,i=a;else{if(!(s=0|r[(a=t+16|0)>>2]))break;t=s,i=a}r[i>>2]=0}else b=0|r[n+8>>2],r[b+12>>2]=t,r[t+8>>2]=b}while(0);if(!o)break;s=23732+((i=0|r[n+28>>2])<<2)|0;do{if((0|r[s>>2])==(0|n)){if(r[s>>2]=t,0|t)break;r[5858]=r[5858]&~(1<<i);break n}if(r[((0|r[(b=o+16|0)>>2])==(0|n)?b:o+20)>>2]=t,!t)break n}while(0);if(r[t+24>>2]=o,0|(s=0|r[(i=n+16|0)>>2])&&(r[t+16>>2]=s,r[s+24>>2]=t),!(i=0|r[i+4>>2]))break;r[t+20>>2]=i,r[i+24>>2]=t}while(0);n=n+l|0,a=l+u|0}else a=u;if(r[(n=n+4|0)>>2]=-2&r[n>>2],r[c+4>>2]=1|a,r[c+a>>2]=a,n=a>>>3,a>>>0<256){i=23468+(n<<1<<2)|0,(t=0|r[5857])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=c,r[n+12>>2]=c,r[c+8>>2]=n,r[c+12>>2]=i;break}n=a>>>8;do{if(n){if(a>>>0>16777215){s=31;break}s=a>>>((s=14-((_=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(s=((b<<=_)+245760|0)>>>16&2))+(b<<s>>>15)|0)+7|0)&1|s<<1}else s=0}while(0);if(n=23732+(s<<2)|0,r[c+28>>2]=s,r[(t=c+16|0)+4>>2]=0,r[t>>2]=0,!((t=0|r[5858])&(i=1<<s))){r[5858]=t|i,r[n>>2]=c,r[c+24>>2]=n,r[c+12>>2]=c,r[c+8>>2]=c;break}n=0|r[n>>2];n:do{if((-8&r[n+4>>2])!=(0|a)){for(s=a<<(31==(0|s)?0:25-(s>>>1));t=0|r[(i=n+16+(s>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|a)){n=t;break n}s<<=1,n=t}r[i>>2]=c,r[c+24>>2]=n,r[c+12>>2]=c,r[c+8>>2]=c;break e}}while(0);b=0|r[(x=n+8|0)>>2],r[b+12>>2]=c,r[x>>2]=c,r[c+8>>2]=b,r[c+12>>2]=n,r[c+24>>2]=0}}while(0);return D=e,0|(b=A+8|0)}for(n=23876;!((t=0|r[n>>2])>>>0<=h>>>0&&(b=t+(0|r[n+4>>2])|0)>>>0>h>>>0);)n=0|r[n+8>>2];n=(t=(t=(a=b+-47|0)+(7&(t=a+8|0)?0-t&7:0)|0)>>>0<(a=h+16|0)>>>0?h:t)+8|0,x=o+(_=7&(_=o+8|0)?0-_&7:0)|0,_=(i=l+-40|0)-_|0,r[5863]=x,r[5860]=_,r[x+4>>2]=1|_,r[o+i+4>>2]=40,r[5864]=r[5979],r[(i=t+4|0)>>2]=27,r[n>>2]=r[5969],r[n+4>>2]=r[5970],r[n+8>>2]=r[5971],r[n+12>>2]=r[5972],r[5969]=o,r[5970]=l,r[5972]=0,r[5971]=n,n=t+24|0;do{x=n,r[(n=n+4|0)>>2]=7}while((x+8|0)>>>0<b>>>0);if((0|t)!=(0|h)){if(o=t-h|0,r[i>>2]=-2&r[i>>2],r[h+4>>2]=1|o,r[t>>2]=o,n=o>>>3,o>>>0<256){i=23468+(n<<1<<2)|0,(t=0|r[5857])&(n=1<<n)?n=0|r[(t=i+8|0)>>2]:(r[5857]=t|n,n=i,t=i+8|0),r[t>>2]=h,r[n+12>>2]=h,r[h+8>>2]=n,r[h+12>>2]=i;break}if(i=23732+((s=(n=o>>>8)?o>>>0>16777215?31:o>>>((s=14-((_=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(s=((b<<=_)+245760|0)>>>16&2))+(b<<s>>>15)|0)+7|0)&1|s<<1:0)<<2)|0,r[h+28>>2]=s,r[h+20>>2]=0,r[a>>2]=0,!((n=0|r[5858])&(t=1<<s))){r[5858]=n|t,r[i>>2]=h,r[h+24>>2]=i,r[h+12>>2]=h,r[h+8>>2]=h;break}n=0|r[i>>2];e:do{if((-8&r[n+4>>2])!=(0|o)){for(s=o<<(31==(0|s)?0:25-(s>>>1));t=0|r[(i=n+16+(s>>>31<<2)|0)>>2];){if((-8&r[t+4>>2])==(0|o)){n=t;break e}s<<=1,n=t}r[i>>2]=h,r[h+24>>2]=n,r[h+12>>2]=h,r[h+8>>2]=h;break t}}while(0);b=0|r[(x=n+8|0)>>2],r[b+12>>2]=h,r[x>>2]=h,r[h+8>>2]=b,r[h+12>>2]=n,r[h+24>>2]=0}}else!(0|(b=0|r[5861]))|o>>>0<b>>>0&&(r[5861]=o),r[5969]=o,r[5970]=l,r[5972]=0,r[5866]=r[5975],r[5865]=-1,r[5870]=23468,r[5869]=23468,r[5872]=23476,r[5871]=23476,r[5874]=23484,r[5873]=23484,r[5876]=23492,r[5875]=23492,r[5878]=23500,r[5877]=23500,r[5880]=23508,r[5879]=23508,r[5882]=23516,r[5881]=23516,r[5884]=23524,r[5883]=23524,r[5886]=23532,r[5885]=23532,r[5888]=23540,r[5887]=23540,r[5890]=23548,r[5889]=23548,r[5892]=23556,r[5891]=23556,r[5894]=23564,r[5893]=23564,r[5896]=23572,r[5895]=23572,r[5898]=23580,r[5897]=23580,r[5900]=23588,r[5899]=23588,r[5902]=23596,r[5901]=23596,r[5904]=23604,r[5903]=23604,r[5906]=23612,r[5905]=23612,r[5908]=23620,r[5907]=23620,r[5910]=23628,r[5909]=23628,r[5912]=23636,r[5911]=23636,r[5914]=23644,r[5913]=23644,r[5916]=23652,r[5915]=23652,r[5918]=23660,r[5917]=23660,r[5920]=23668,r[5919]=23668,r[5922]=23676,r[5921]=23676,r[5924]=23684,r[5923]=23684,r[5926]=23692,r[5925]=23692,r[5928]=23700,r[5927]=23700,r[5930]=23708,r[5929]=23708,r[5932]=23716,r[5931]=23716,x=o+(_=7&(_=o+8|0)?0-_&7:0)|0,_=(b=l+-40|0)-_|0,r[5863]=x,r[5860]=_,r[x+4>>2]=1|_,r[o+b+4>>2]=40,r[5864]=r[5979]}while(0);if((n=0|r[5860])>>>0>d>>>0)return _=n-d|0,r[5860]=_,x=(b=0|r[5863])+d|0,r[5863]=x,r[x+4>>2]=1|_,r[b+4>>2]=3|d,D=e,0|(b=b+8|0)}return r[(b=23424)>>2]=12,D=e,0|(b=0)}function Ne(t){var e=0,n=0,i=0,s=0,a=0,o=0,l=0,u=0;if(t|=0){n=t+-8|0,s=0|r[5861],u=n+(e=-8&(t=0|r[t+-4>>2]))|0;do{if(1&t)l=n,o=n;else{if(i=0|r[n>>2],!(3&t))return;if(a=i+e|0,(o=n+(0-i)|0)>>>0<s>>>0)return;if((0|r[5862])==(0|o)){if(3&~(e=0|r[(t=u+4|0)>>2])){l=o,e=a;break}return r[5859]=a,r[t>>2]=-2&e,r[o+4>>2]=1|a,void(r[o+a>>2]=a)}if(n=i>>>3,i>>>0<256){if(t=0|r[o+8>>2],(0|(e=0|r[o+12>>2]))==(0|t)){r[5857]=r[5857]&~(1<<n),l=o,e=a;break}r[t+12>>2]=e,r[e+8>>2]=t,l=o,e=a;break}s=0|r[o+24>>2],t=0|r[o+12>>2];do{if((0|t)==(0|o)){if(t=0|r[(n=(e=o+16|0)+4|0)>>2])e=n;else if(!(t=0|r[e>>2])){t=0;break}for(;;)if(n=0|r[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|r[(i=t+16|0)>>2]))break;t=n,e=i}r[e>>2]=0}else l=0|r[o+8>>2],r[l+12>>2]=t,r[t+8>>2]=l}while(0);if(s){if(e=0|r[o+28>>2],(0|r[(n=23732+(e<<2)|0)>>2])==(0|o)){if(r[n>>2]=t,!t){r[5858]=r[5858]&~(1<<e),l=o,e=a;break}}else if(r[((0|r[(l=s+16|0)>>2])==(0|o)?l:s+20)>>2]=t,!t){l=o,e=a;break}r[t+24>>2]=s,0|(n=0|r[(e=o+16|0)>>2])&&(r[t+16>>2]=n,r[n+24>>2]=t),(e=0|r[e+4>>2])?(r[t+20>>2]=e,r[e+24>>2]=t,l=o,e=a):(l=o,e=a)}else l=o,e=a}}while(0);if(!(o>>>0>=u>>>0)&&1&(i=0|r[(t=u+4|0)>>2])){if(2&i)r[t>>2]=-2&i,r[l+4>>2]=1|e,r[o+e>>2]=e,s=e;else{if((0|r[5863])==(0|u)){if(u=(0|r[5860])+e|0,r[5860]=u,r[5863]=l,r[l+4>>2]=1|u,(0|l)!=(0|r[5862]))return;return r[5862]=0,void(r[5859]=0)}if((0|r[5862])==(0|u))return u=(0|r[5859])+e|0,r[5859]=u,r[5862]=o,r[l+4>>2]=1|u,void(r[o+u>>2]=u);s=(-8&i)+e|0,n=i>>>3;do{if(i>>>0<256){if(e=0|r[u+8>>2],(0|(t=0|r[u+12>>2]))==(0|e)){r[5857]=r[5857]&~(1<<n);break}r[e+12>>2]=t,r[t+8>>2]=e;break}a=0|r[u+24>>2],t=0|r[u+12>>2];do{if((0|t)==(0|u)){if(t=0|r[(n=(e=u+16|0)+4|0)>>2])e=n;else if(!(t=0|r[e>>2])){n=0;break}for(;;)if(n=0|r[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|r[(i=t+16|0)>>2]))break;t=n,e=i}r[e>>2]=0,n=t}else n=0|r[u+8>>2],r[n+12>>2]=t,r[t+8>>2]=n,n=t}while(0);if(0|a){if(t=0|r[u+28>>2],(0|r[(e=23732+(t<<2)|0)>>2])==(0|u)){if(r[e>>2]=n,!n){r[5858]=r[5858]&~(1<<t);break}}else if(r[((0|r[(i=a+16|0)>>2])==(0|u)?i:a+20)>>2]=n,!n)break;r[n+24>>2]=a,0|(e=0|r[(t=u+16|0)>>2])&&(r[n+16>>2]=e,r[e+24>>2]=n),0|(t=0|r[t+4>>2])&&(r[n+20>>2]=t,r[t+24>>2]=n)}}while(0);if(r[l+4>>2]=1|s,r[o+s>>2]=s,(0|l)==(0|r[5862]))return void(r[5859]=s)}if(t=s>>>3,s>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|r[5857])&(t=1<<t)?t=0|r[(e=n+8|0)>>2]:(r[5857]=e|t,t=n,e=n+8|0),r[e>>2]=l,r[t+12>>2]=l,r[l+8>>2]=t,void(r[l+12>>2]=n);t=23732+((i=(t=s>>>8)?s>>>0>16777215?31:s>>>((i=14-((a=((u=t<<(o=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|o|(i=((u<<=a)+245760|0)>>>16&2))+(u<<i>>>15)|0)+7|0)&1|i<<1:0)<<2)|0,r[l+28>>2]=i,r[l+20>>2]=0,r[l+16>>2]=0,e=0|r[5858],n=1<<i;t:do{if(e&n){t=0|r[t>>2];e:do{if((-8&r[t+4>>2])!=(0|s)){for(i=s<<(31==(0|i)?0:25-(i>>>1));e=0|r[(n=t+16+(i>>>31<<2)|0)>>2];){if((-8&r[e+4>>2])==(0|s)){t=e;break e}i<<=1,t=e}r[n>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l;break t}}while(0);u=0|r[(o=t+8|0)>>2],r[u+12>>2]=l,r[o>>2]=l,r[l+8>>2]=u,r[l+12>>2]=t,r[l+24>>2]=0}else r[5858]=e|n,r[t>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l}while(0);if(u=(0|r[5865])-1|0,r[5865]=u,!(0|u)){for(t=23884;t=0|r[t>>2];)t=t+8|0;r[5865]=-1}}}}function Pe(t,e){e|=0;var n=0;return(t|=0)?(n=0|_(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|Re(n))&&3&r[t+-4>>2]?(Xe(0|t,0,0|n),0|t):0|t}function De(t,e,n,i){return 0|(M((e|=0)+(i|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Ie(t,e,n,i){return 0|(M(0|(i=(e|=0)-(i|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Le(t){return 0|((t|=0)?31-(0|S(t^t-1)):32)}function Be(t,e,n,i,s){s|=0;var a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0;if(c=t|=0,o=n|=0,l=d=i|=0,!(h=u=e|=0))return a=!!(0|s),l?a?(r[s>>2]=0|t,r[s+4>>2]=0,s=0,0|(M(0|(d=0)),s)):(s=0,0|(M(0|(d=0)),s)):(a&&(r[s>>2]=(c>>>0)%(o>>>0),r[s+4>>2]=0),s=(c>>>0)/(o>>>0)>>>0,0|(M(0|(d=0)),s));a=!(0|l);do{if(o){if(!a){if((a=(0|S(0|l))-(0|S(0|h))|0)>>>0<=31){o=A=a+1|0,t=c>>>(A>>>0)&(e=a-31>>31)|h<<(l=31-a|0),e&=h>>>(A>>>0),a=0,l=c<<l;break}return s?(r[s>>2]=0|t,r[s+4>>2]=0|u,s=0,0|(M(0|(d=0)),s)):(s=0,0|(M(0|(d=0)),s))}if((a=o-1|0)&o){o=l=33+(0|S(0|o))-(0|S(0|h))|0,t=(A=32-l|0)-1>>31&h>>>((p=l-32|0)>>>0)|(h<<A|c>>>(l>>>0))&(e=p>>31),e&=h>>>(l>>>0),a=c<<(f=64-l|0)&(u=A>>31),l=(h<<f|c>>>(p>>>0))&u|c<<A&l-33>>31;break}return 0|s&&(r[s>>2]=a&c,r[s+4>>2]=0),1==(0|o)?(f=0|t,0|(M(0|(p=0|u)),f)):(p=h>>>((f=0|Le(0|o))>>>0)|0,f=h<<32-f|c>>>(f>>>0),0|(M(0|p),f))}if(a)return 0|s&&(r[s>>2]=(h>>>0)%(o>>>0),r[s+4>>2]=0),f=(h>>>0)/(o>>>0)>>>0,0|(M(0|(p=0)),f);if(!c)return 0|s&&(r[s>>2]=0,r[s+4>>2]=(h>>>0)%(l>>>0)),f=(h>>>0)/(l>>>0)>>>0,0|(M(0|(p=0)),f);if(!((a=l-1|0)&l))return 0|s&&(r[s>>2]=0|t,r[s+4>>2]=a&h),p=0,f=h>>>((0|Le(0|l))>>>0),0|(M(0|p),f);if((a=(0|S(0|l))-(0|S(0|h))|0)>>>0<=30){o=e=a+1|0,t=h<<(l=31-a|0)|c>>>(e>>>0),e=h>>>(e>>>0),a=0,l=c<<l;break}return s?(r[s>>2]=0|t,r[s+4>>2]=0|u,f=0,0|(M(0|(p=0)),f)):(f=0,0|(M(0|(p=0)),f))}while(0);if(o){h=0|De(0|(A=0|n),0|(c=0|d),-1,-1),n=0|w(),u=l,l=0;do{i=u,u=a>>>31|u<<1,a=l|a<<1,Ie(0|h,0|n,0|(i=t<<1|i>>>31),0|(d=t>>>31|e<<1)),l=1&(p=(f=0|w())>>31|((0|f)<0?-1:0)<<1),t=0|Ie(0|i,0|d,p&A,(((0|f)<0?-1:0)>>31|((0|f)<0?-1:0)<<1)&c),e=0|w(),o=o-1|0}while(0|o);h=u,u=0}else h=l,u=0,l=0;return o=0,0|s&&(r[s>>2]=t,r[s+4>>2]=e),f=a<<1&-2|l,0|(M(0|(p=(0|a)>>>31|(h|o)<<1|u)),f)}function Ue(t,e,n,i){n|=0;var r,s,a,o,l;return s=(i|=0)>>31|((0|i)<0?-1:0)<<1,r=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,a=0|Ie((l=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|l,0|o),t=s^l,e=r^o,0|Ie(Be(a,0|w(),0|Ie(s^n,r^i,0|s,0|r),0|w(),0)^t,w()^e,0|t,0|e)}function Oe(t,e,n,i){e|=0,i|=0;var r,s;return n=0|function(t,e){var n,i,r,s=0;return t=((n=0|_(s=65535&(e|=0),r=65535&(t|=0)))>>>16)+(0|_(s,i=t>>>16))|0,e=0|_(s=e>>>16,r),0|(M((t>>>16)+(0|_(s,i))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(r=t|=0,s=n|=0),t=0|w(),0|(M((0|_(e,s))+(0|_(i,r))+t|0),n)}function Fe(t,e,n,i){n|=0;var s,a,o,l,u,h;return s=D,D=D+16|0,l=0|s,h=(i|=0)>>31|((0|i)<0?-1:0)<<1,u=((0|i)<0?-1:0)>>31|((0|i)<0?-1:0)<<1,Be(t=0|Ie((o=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(a=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|o,0|a),e=0|w(),0|Ie(h^n,u^i,0|h,0|u),0|w(),l),i=0|Ie(r[l>>2]^o,r[l+4>>2]^a,0|o,0|a),n=0|w(),D=s,0|(M(0|n),i)}function ke(t,e,n,i){var s,a;return a=D,D=D+16|0,Be(t|=0,e|=0,n|=0,i|=0,s=0|a),D=a,0|(M(0|r[s+4>>2]),r[s>>2])}function ze(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(M(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(M(0|((0|e)<0?-1:0)),e>>n-32)}function qe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(M(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(M(0),e>>>n-32|0)}function Ge(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(M(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(M(t<<n-32),0)}function Ve(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+b(+t,+e)}function He(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+x(+t,+e)}function je(t){return(t=+t)>=0?+l(t+.5):+v(t-.5)}function We(t,e,n){t|=0,e|=0;var s,a,o=0;if((0|(n|=0))>=8192)return R(0|t,0|e,0|n),0|t;if(a=0|t,s=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|a;i[t|0]=0|i[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(o=(n=-4&s)-64|0;(0|t)<=(0|o);)r[t>>2]=r[e>>2],r[t+4>>2]=r[e+4>>2],r[t+8>>2]=r[e+8>>2],r[t+12>>2]=r[e+12>>2],r[t+16>>2]=r[e+16>>2],r[t+20>>2]=r[e+20>>2],r[t+24>>2]=r[e+24>>2],r[t+28>>2]=r[e+28>>2],r[t+32>>2]=r[e+32>>2],r[t+36>>2]=r[e+36>>2],r[t+40>>2]=r[e+40>>2],r[t+44>>2]=r[e+44>>2],r[t+48>>2]=r[e+48>>2],r[t+52>>2]=r[e+52>>2],r[t+56>>2]=r[e+56>>2],r[t+60>>2]=r[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)r[t>>2]=r[e>>2],t=t+4|0,e=e+4|0}else for(n=s-4|0;(0|t)<(0|n);)i[t|0]=0|i[e|0],i[t+1|0]=0|i[e+1|0],i[t+2|0]=0|i[e+2|0],i[t+3|0]=0|i[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|s);)i[t|0]=0|i[e|0],t=t+1|0,e=e+1|0;return 0|a}function Xe(t,e,n){e|=0;var s,a=0,o=0,l=0;if(s=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)i[t|0]=e,t=t+1|0;for(l=e|e<<8|e<<16|e<<24,o=(a=-4&s)-64|0;(0|t)<=(0|o);)r[t>>2]=l,r[t+4>>2]=l,r[t+8>>2]=l,r[t+12>>2]=l,r[t+16>>2]=l,r[t+20>>2]=l,r[t+24>>2]=l,r[t+28>>2]=l,r[t+32>>2]=l,r[t+36>>2]=l,r[t+40>>2]=l,r[t+44>>2]=l,r[t+48>>2]=l,r[t+52>>2]=l,r[t+56>>2]=l,r[t+60>>2]=l,t=t+64|0;for(;(0|t)<(0|a);)r[t>>2]=l,t=t+4|0}for(;(0|t)<(0|s);)i[t|0]=e,t=t+1|0;return s-n|0}function Ye(t){return(t=+t)>=0?+l(t+.5):+v(t-.5)}function Qe(t){t|=0;var e,n,i;return i=0|C(),(0|t)>0&(0|(e=(n=0|r[o>>2])+t|0))<(0|n)|(0|e)<0?(P(0|e),E(12),-1):(0|e)>(0|i)&&!(0|N(0|e))?(E(12),-1):(r[o>>2]=e,0|n)}return{___divdi3:Ue,___muldi3:Oe,___remdi3:Fe,___uremdi3:ke,_areNeighborCells:function(t,e,n,i,s){s|=0;var a,o,l,u=0,h=0,c=0,A=0;if(l=D,D=D+64|0,o=l,a=l+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(i|=0))))return D=l,0|(s=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|i))return r[s>>2]=0,D=l,0|(s=0);if(h=0|qe(0|t,0|e,52),w(),h&=15,A=0|qe(0|n,0|i,52),w(),(0|h)!=(15&A))return D=l,0|(s=12);if(u=h+-1|0,h>>>0>1){Bt(t,e,u,o),Bt(n,i,u,a),c=0|r[(A=o)>>2],A=0|r[A+4>>2];t:do{if((0|c)==(0|r[a>>2])&&(0|A)==(0|r[a+4>>2])){u=0|qe(0|t,0|e,0|(h=3*(15^h)|0)),w(),u&=7,h=0|qe(0|n,0|i,0|h),w(),h&=7;do{if(!(0|u)|!(0|h))r[s>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|h)&&0|Ot(c,A)){u=5;break}if((0|r[15536+(u<<2)>>2])!=(0|h)&&(0|r[15568+(u<<2)>>2])!=(0|h))break t;r[s>>2]=1,u=0}}while(0);return D=l,0|(s=u)}}while(0)}h=(u=o)+56|0;do{r[u>>2]=0,u=u+4|0}while((0|u)<(0|h));return I(t,e,1,o),u=(0|r[(e=o)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+8|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+16|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+24|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+32|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)||(0|r[(e=o+40|0)>>2])==(0|n)&&(0|r[e+4>>2])==(0|i)?1:1&((0|r[(u=o+48|0)>>2])==(0|n)?(0|r[u+4>>2])==(0|i):0),r[s>>2]=u,D=l,0|(s=0)},_bitshift64Ashr:ze,_bitshift64Lshr:qe,_bitshift64Shl:Ge,_calloc:Pe,_cellAreaKm2:function(t,e,n){return 0|(t=0|ie(t|=0,e|=0,n|=0))||(s[n>>3]=6371.007180918475*+s[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|ie(t|=0,e|=0,n|=0))||(s[n>>3]=6371.007180918475*+s[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:ie,_cellToBoundary:Yt,_cellToCenterChild:function(t,e,n,i){n|=0,i|=0;var s=0;return s=0|qe(0|(t|=0),0|(e|=0),52),w(),(0|n)<16&(0|(s&=15))<=(0|n)?((0|s)<(0|n)&&(s=0|Ge(-1,-1,3+(3*(n+-1-s|0)|0)|0),s=0|Ge(0|~s,0|~w(),3*(15-n|0)|0),e=~w()&e,t&=~s),s=0|Ge(0|n,0,52),n=-15728641&e|w(),r[i>>2]=t|s,r[i+4>>2]=n,0|(i=0)):0|(i=4)},_cellToChildPos:function(t,e,n,i){n|=0,i|=0;var s,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0;if(s=D,D=D+16|0,y=s,v=0|qe(0|(t|=0),0|(e|=0),52),w(),v&=15,n>>>0>15)return D=s,0|(v=4);if((0|v)<(0|n))return D=s,0|(v=12);if((0|v)!=(0|n))if(o=0|Ge(0|n,0,52),o|=t,u=w()|-15728641&e,(0|v)>(0|n)){h=n;do{g=0|Ge(7,0,3*(14-h|0)|0),h=h+1|0,o|=g,u=w()|u}while((0|h)<(0|v));g=o}else g=o;else g=t,u=e;m=0|qe(0|g,0|u,45),w();t:do{if(0|z(127&m)){if(h=0|qe(0|g,0|u,52),w(),0|(h&=15))for(o=1;;){if(!(!((m=0|Ge(7,0,3*(15-o|0)|0))&g)&!(w()&u))){c=33;break t}if(!(o>>>0<h>>>0))break;o=o+1|0}if(r[(m=i)>>2]=0,r[m+4>>2]=0,(0|v)>(0|n)){for(m=-15728641&e,f=v;;){if(p=f,(f=f+-1|0)>>>0>15|(0|v)<(0|f)){c=19;break}if((0|v)!=(0|f))if(o=0|Ge(0|f,0,52),o|=t,h=w()|m,(0|v)<(0|p))d=o;else{c=f;do{d=0|Ge(7,0,3*(14-c|0)|0),c=c+1|0,o|=d,h=w()|h}while((0|c)<(0|v));d=o}else d=t,h=e;if(A=0|qe(0|d,0|h,45),w(),0|z(127&A)){A=0|qe(0|d,0|h,52),w(),A&=15;e:do{if(A)for(c=1;;){if(o=0|qe(0|d,0|h,3*(15-c|0)|0),w(),0|(o&=7))break e;if(!(c>>>0<A>>>0)){o=0;break}c=c+1|0}else o=0}while(0);o=1&!(0|o)}else o=0;if(h=0|qe(0|t,0|e,3*(15-p|0)|0),w(),7==(0|(h&=7))){a=5,c=42;break}if(1==(0|h)&(o=!!(0|o))){a=5,c=42;break}if(0|(d=h+((!!(0|h)&o)<<31>>31)|0)&&(c=0|ce(7,0,c=v-p|0,((0|c)<0)<<31>>31),A=0|w(),o?(o=0|De(0|(o=0|Oe(0|c,0|A,5,0)),0|w(),-5,-1),o=0|De(0|(o=0|Ue(0|o,0|w(),6,0)),0|w(),1,0),h=0|w()):(o=c,h=A),p=0|De(0|o,0|h,0|(p=0|Oe(0|c,0|A,0|(p=d+-1|0),((0|p)<0)<<31>>31)),0|w()),A=0|De(0|p,0|(d=0|w()),0|r[(A=i)>>2],0|r[A+4>>2]),d=0|w(),r[(p=i)>>2]=A,r[p+4>>2]=d),(0|f)<=(0|n)){c=37;break}}if(19==(0|c))T(23313,22674,1099,22710);else{if(37==(0|c)){a=0|r[(l=i)+4>>2],l=0|r[l>>2];break}if(42==(0|c))return D=s,0|a}}else a=0,l=0}else c=33}while(0);t:do{if(33==(0|c)){if(r[(m=i)>>2]=0,r[m+4>>2]=0,(0|v)>(0|n)){for(o=v;;){if(a=0|qe(0|t,0|e,3*(15-o|0)|0),w(),7==(0|(a&=7))){a=5;break}if(a=0|Oe(0|(l=0|ce(7,0,l=v-o|0,((0|l)<0)<<31>>31)),0|w(),0|a,0),l=0|w(),l=0|De(0|r[(m=i)>>2],0|r[m+4>>2],0|a,0|l),a=0|w(),r[(m=i)>>2]=l,r[m+4>>2]=a,(0|(o=o+-1|0))<=(0|n))break t}return D=s,0|a}a=0,l=0}}while(0);return 0|Ut(g,u,v,y)&&T(23313,22674,1063,22725),((0|a)>-1|-1==(0|a)&l>>>0>4294967295)&((0|(y=0|r[(v=y)+4>>2]))>(0|a)|((0|y)==(0|a)?(0|r[v>>2])>>>0>l>>>0:0))?(D=s,0|(v=0)):(T(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,i){i|=0;var s,a,o=0,l=0;if(a=D,D=D+16|0,$t(s=a,t|=0,e|=0,n|=0),!(0|(t=0|r[(e=s)>>2]))&!(0|(e=0|r[e+4>>2])))return D=a,0;o=0,n=0;do{r[(l=i+(o<<3)|0)>>2]=t,r[l+4>>2]=e,o=0|De(0|o,0|n,1,0),n=0|w(),Zt(s),t=0|r[(l=s)>>2],e=0|r[l+4>>2]}while(!(!(0|t)&!(0|e)));return D=a,0},_cellToChildrenSize:Ut,_cellToLatLng:Xt,_cellToLocalIj:function(t,e,n,i,r,s){var a,o;return t|=0,e|=0,n|=0,i|=0,s|=0,o=D,D=D+16|0,a=o,(r|=0)?t=15:(t=0|ue(t,e,n,i,a))||(vt(a,s),t=0),D=o,0|t},_cellToParent:Bt,_cellToVertex:_e,_cellToVertexes:function(t,e,n){n|=0;var i,s=0,a=0;return a=!(0|Ot(t|=0,e|=0)),i=!(0|(s=0|_e(t,e,0,n))),a?i?0|(s=0|_e(t,e,1,n+8|0))||0|(s=0|_e(t,e,2,n+16|0))||0|(s=0|_e(t,e,3,n+24|0))||(s=0|_e(t,e,4,n+32|0))?0|(a=s):0|_e(t,e,5,n+40|0):0|(a=s):i?0|(s=0|_e(t,e,1,n+8|0))||0|(s=0|_e(t,e,2,n+16|0))||0|(s=0|_e(t,e,3,n+24|0))||0|(s=0|_e(t,e,4,n+32|0))?0|(a=s):(r[(a=n+40|0)>>2]=0,r[a+4>>2]=0,0|(a=0)):0|(a=s)},_cellsToDirectedEdge:function(t,e,n,i,s){return s|=0,7==(0|(n=0|F(t|=0,e|=0,n|=0,i|=0)))?0|(s=11):(i=0|Ge(0|n,0,56),e=-2130706433&e|w()|268435456,r[s>>2]=t|i,r[s+4>>2]=e,0|(s=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var i,s,a,o=0;if(a=D,D=D+32|0,i=a,t=0|function(t,e,n){t|=0,n|=0;var i,s,a=0,o=0,l=0,u=0,h=0,c=0;if(s=D,D=D+176|0,i=s,(0|(e|=0))<1)return xe(n,0,0),D=s,0;for(h=0|qe(0|r[(h=t)>>2],0|r[h+4>>2],52),w(),xe(n,(0|e)>6?e:6,15&h),h=0;!(0|(a=0|Yt(0|r[(a=t+(h<<3)|0)>>2],0|r[a+4>>2],i)));){if((0|(a=0|r[i>>2]))>0){u=0;do{l=i+8+(u<<4)|0,(o=0|Te(n,a=i+8+((0|(u=u+1|0))%(0|a)<<4)|0,l))?Me(n,o):we(n,l,a),a=0|r[i>>2]}while((0|u)<(0|a))}if((0|(h=h+1|0))>=(0|e)){a=0,c=13;break}}return 13==(0|c)?(D=s,0|a):(be(n),D=s,0|(c=a))}(t|=0,e|=0,s=a+16|0),0|t)return D=a,0|(n=t);if(r[n>>2]=0,r[n+4>>2]=0,r[n+8>>2]=0,0|(t=0|Se(s)))do{e=0|re(n);do{se(e,t),o=t+16|0,r[i>>2]=r[o>>2],r[i+4>>2]=r[o+4>>2],r[i+8>>2]=r[o+8>>2],r[i+12>>2]=r[o+12>>2],Me(s,t),t=0|Ee(s,i)}while(0|t);t=0|Se(s)}while(0|t);return be(s),(t=0|oe(n))?(ae(n),D=a,0|(o=t)):(D=a,0|(o=0))},_childPosToCell:function(t,e,n,i,s,a){t|=0,e|=0,a|=0;var o,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0;if(o=D,D=D+16|0,l=o,(s|=0)>>>0>15)return D=o,0|(a=4);if(u=0|qe(0|(n|=0),0|(i|=0),52),w(),(0|(u&=15))>(0|s))return D=o,0|(a=12);if(0|Ut(n,i,s,l)&&T(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(c=0|r[(A=l)+4>>2]))>(0|e)|((0|c)==(0|e)?(0|r[A>>2])>>>0>t>>>0:0))))return D=o,0|(a=2);A=s-u|0,s=0|Ge(0|s,0,52),h=w()|-15728641&i,r[(c=a)>>2]=s|n,r[c+4>>2]=h,c=0|qe(0|n,0|i,45),w();t:do{if(0|z(127&c)){if(0|u)for(l=1;;){if(!(!((c=0|Ge(7,0,3*(15-l|0)|0))&n)&!(w()&i)))break t;if(!(l>>>0<u>>>0))break;l=l+1|0}if((0|A)<1)return D=o,0|(a=0);for(c=15^u,i=-1,h=1,l=1;;){u=0|ce(7,0,u=A-h|0,((0|u)<0)<<31>>31),n=0|w();do{if(l){if(l=0|Ue(0|(l=0|De(0|(l=0|Oe(0|u,0|n,5,0)),0|w(),-5,-1)),0|w(),6,0),(0|e)>(0|(s=0|w()))|(0|e)==(0|s)&t>>>0>l>>>0){e=0|Ie(0|(e=0|De(0|t,0|e,-1,-1)),0|w(),0|l,0|s),l=0|w(),f=0|r[(d=a)>>2],d=0|r[d+4>>2],p=0|Ge(7,0,0|(m=3*(c+i|0)|0)),d&=~w(),m=0|Ge(0|(s=0|De(0|(i=0|Ue(0|e,0|l,0|u,0|n)),0|(t=0|w()),2,0)),0|w(),0|m),d=w()|d,r[(s=a)>>2]=m|f&~p,r[s+4>>2]=d,t=0|Ie(0|e,0|l,0|(t=0|Oe(0|i,0|t,0|u,0|n)),0|w()),l=0,e=0|w();break}p=0|r[(m=a)>>2],m=0|r[m+4>>2],f=0|Ge(7,0,3*(c+i|0)|0),m&=~w(),r[(l=a)>>2]=p&~f,r[l+4>>2]=m,l=1;break}s=0|r[(p=a)>>2],p=0|r[p+4>>2],d=0|Ge(7,0,0|(i=3*(c+i|0)|0)),p&=~w(),i=0|Ge(0|(m=0|Ue(0|t,0|e,0|u,0|n)),0|(l=0|w()),0|i),p=w()|p,r[(f=a)>>2]=i|s&~d,r[f+4>>2]=p,t=0|Ie(0|t,0|e,0|(l=0|Oe(0|m,0|l,0|u,0|n)),0|w()),l=0,e=0|w()}while(0);if(!((0|A)>(0|h))){e=0;break}i=~h,h=h+1|0}return D=o,0|e}}while(0);if((0|A)<1)return D=o,0|(m=0);for(s=15^u,l=1;;){if(f=0|ce(7,0,f=A-l|0,((0|f)<0)<<31>>31),m=0|w(),n=0|r[(h=a)>>2],h=0|r[h+4>>2],i=0|Ge(7,0,0|(u=3*(s-l|0)|0)),h&=~w(),u=0|Ge(0|(d=0|Ue(0|t,0|e,0|f,0|m)),0|(p=0|w()),0|u),h=w()|h,r[(c=a)>>2]=u|n&~i,r[c+4>>2]=h,t=0|Ie(0|t,0|e,0|(m=0|Oe(0|d,0|p,0|f,0|m)),0|w()),e=0|w(),(0|A)<=(0|l)){e=0;break}l=l+1|0}return D=o,0|e},_compactCells:function(t,e,n,i){e|=0;var s,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,E=0;if(!(0|(n|=0))&!(0|(i|=0)))return 0|(M=0);if(o=0|r[(a=t|=0)>>2],!0&!(15728640&(a=0|r[a+4>>2]))){if(!((0|i)>0|!(0|i)&n>>>0>0))return 0|(M=0);if(r[(M=e)>>2]=o,r[M+4>>2]=a,1==(0|n)&!(0|i))return 0|(M=0);a=1;do{S=0|r[(b=t+(a<<3)|0)+4>>2],r[(M=e+(a<<3)|0)>>2]=r[b>>2],r[M+4>>2]=S,a=a+1|0}while(0<(0|i)|!(0|i)&a>>>0<n>>>0);return 0|(a=0)}if(!(S=0|Re(s=n<<3)))return 0|(M=13);if(We(0|S,0|t,0|s),!(b=0|Pe(n,8)))return Ne(S),0|(M=13);t:do{if(0|n){e:for(;;){_=0|qe(0|(v=0|r[(a=S)>>2]),0|(a=0|r[a+4>>2]),52),w(),x=(_&=15)+-1|0,y=(0|n)>0;n:do{if(!!(0|_)&y){if(f=((0|n)<0)<<31>>31,m=0|Ge(0|x,0,52),g=0|w(),x>>>0>15){if(!(!(0|v)&!(0|a))){M=17;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n))break n;if(!(!(0|(g=0|r[(i=S+(o<<3)|0)>>2]))&!(0|(i=0|r[i+4>>2])))){a=i,M=17;break e}}}for(o=0,t=v,i=a;;){if(!(!(0|t)&!(0|i))){if(!(!0&!(117440512&i))){M=22;break e}if(u=0|qe(0|t,0|i,52),w(),(0|(u&=15))<(0|x)){a=12,M=28;break e}if((0|u)!=(0|x)&&(t|=m,i=-15728641&i|g,u>>>0>=_>>>0)){l=x;do{p=0|Ge(7,0,3*(14-l|0)|0),l=l+1|0,t|=p,i=w()|i}while(l>>>0<u>>>0)}if(l=0|ke(0|t,0|i,0|n,0|f),w(),!(0|(h=0|r[(u=c=b+(l<<3)|0)>>2]))&!(0|(u=0|r[u+4>>2])))l=c;else for(p=0;;){if((0|p)>(0|n)){M=32;break e}if((0|h)==(0|t)&(-117440513&u)==(0|i)){A=0|qe(0|h,0|u,56),w(),d=(A&=7)+1|0,E=0|qe(0|h,0|u,45),w();i:do{if(0|z(127&E)){if(h=0|qe(0|h,0|u,52),w(),!(h&=15)){u=6;break}for(u=1;;){if(!(!((E=0|Ge(7,0,3*(15-u|0)|0))&t)&!(w()&i))){u=7;break i}if(!(u>>>0<h>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((A+2|0)>>>0>u>>>0){M=42;break e}E=0|Ge(0|d,0,56),i=w()|-117440513&i,r[(d=c)>>2]=0,r[d+4>>2]=0,t|=E}else l=(l+1|0)%(0|n)|0;if(!(0|(h=0|r[(u=c=b+(l<<3)|0)>>2]))&!(0|(u=0|r[u+4>>2]))){l=c;break}p=p+1|0}r[(E=l)>>2]=t,r[E+4>>2]=i}if((0|(o=o+1|0))>=(0|n))break n;t=0|r[(i=S+(o<<3)|0)>>2],i=0|r[i+4>>2]}}}while(0);if((n+5|0)>>>0<11){M=85;break}if(!(g=0|Pe((0|n)/6|0,8))){M=49;break}n:do{if(y){p=0,d=0;do{if(!(!(0|(o=0|r[(i=u=b+(p<<3)|0)>>2]))&!(0|(i=0|r[i+4>>2])))){h=0|qe(0|o,0|i,56),w(),t=(h&=7)+1|0,c=-117440513&i,E=0|qe(0|o,0|i,45),w();i:do{if(0|z(127&E)){if(A=0|qe(0|o,0|i,52),w(),0|(A&=15))for(l=1;;){if(!(!(o&(E=0|Ge(7,0,3*(15-l|0)|0)))&!(c&w())))break i;if(!(l>>>0<A>>>0))break;l=l+1|0}o|=i=0|Ge(0|t,0,56),i=w()|c,r[(t=u)>>2]=o,r[t+4>>2]=i,t=h+2|0}}while(0);7==(0|t)&&(r[(E=g+(d<<3)|0)>>2]=o,r[E+4>>2]=-117440513&i,d=d+1|0)}p=p+1|0}while((0|p)!=(0|n));if(y){if(p=((0|n)<0)<<31>>31,f=0|Ge(0|x,0,52),m=0|w(),x>>>0>15){if(!(!(0|v)&!(0|a))){a=4,M=84;break e}for(a=0;;){if((0|(a=a+1|0))>=(0|n)){o=0,a=d;break n}if(!(!(0|r[(E=S+(a<<3)|0)>>2])&!(0|r[E+4>>2]))){a=4,M=84;break e}}}for(A=0,o=0,c=v;;){do{if(!(!(0|c)&!(0|a))){if(u=0|qe(0|c,0|a,52),w(),(0|(u&=15))<(0|x)){a=12,M=84;break e}do{if((0|u)==(0|x))i=c,u=a;else{if(i=c|f,t=-15728641&a|m,u>>>0<_>>>0){u=t;break}l=x;do{E=0|Ge(7,0,3*(14-l|0)|0),l=l+1|0,i|=E,t=w()|t}while(l>>>0<u>>>0);u=t}}while(0);for(l=0|ke(0|i,0|u,0|n,0|p),w(),t=0;;){if((0|t)>(0|n)){M=77;break e}if((-117440513&(h=0|r[(E=b+(l<<3)|0)+4>>2]))==(0|u)&&(0|r[E>>2])==(0|i)){M=79;break}if((0|r[(E=b+((l=(l+1|0)%(0|n)|0)<<3)|0)>>2])==(0|i)&&(0|r[E+4>>2])==(0|u))break;t=t+1|0}if(79==(0|M)&&(M=0,!0&100663296==(117440512&h)))break;r[(E=e+(o<<3)|0)>>2]=c,r[E+4>>2]=a,o=o+1|0}}while(0);if((0|(a=A+1|0))>=(0|n)){a=d;break n}A=a,c=0|r[(E=S+(a<<3)|0)>>2],a=0|r[E+4>>2]}}else o=0,a=d}else o=0,a=0}while(0);if(Xe(0|b,0,0|s),We(0|S,0|g,a<<3),Ne(g),!a)break t;e=e+(o<<3)|0,n=a}if(17==(0|M))!0&!(117440512&a)?(a=4,M=28):M=22;else if(32==(0|M))T(23313,22674,362,22684);else{if(42==(0|M))return Ne(S),Ne(b),0|(E=10);if(49==(0|M))return Ne(S),Ne(b),0|(E=13);if(77==(0|M))T(23313,22674,462,22684);else{if(84==(0|M))return Ne(g),Ne(S),Ne(b),0|(E=a);if(85==(0|M)){We(0|e,0|S,n<<3);break}}}if(22==(0|M))return Ne(S),Ne(b),0|(E=5);if(28==(0|M))return Ne(S),Ne(b),0|(E=a)}}while(0);return Ne(S),Ne(b),0|(E=0)},_destroyLinkedMultiPolygon:ae,_directedEdgeToBoundary:St,_directedEdgeToCells:function(t,e,n){t|=0;var i,s,a,o=0;return i=D,D=D+16|0,o=i,!0&268435456==(2013265920&(e|=0))?(s=-2130706433&e|134217728,r[(a=n|=0)>>2]=t,r[a+4>>2]=s,r[o>>2]=0,e=0|qe(0|t,0|e,56),w(),o=0|O(t,s,7&e,o,n+8|0),D=i,0|o):(D=i,0|(o=6))},_edgeLengthKm:function(t,e,n){n|=0;var i,a=0,o=0,l=0,u=0,c=0,p=0,f=0;if(i=D,D=D+176|0,0|(t=0|St(t|=0,e|=0,u=i)))return u=t,l=+s[n>>3],l*=6371.007180918475,s[n>>3]=l,D=i,0|u;if(s[n>>3]=0,(0|(t=0|r[u>>2]))<=1)return u=0,l=0,l*=6371.007180918475,s[n>>3]=l,D=i,0|u;e=t+-1|0,t=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((t=t+1|0)<<4)>>3],f=+d(.5*(a-p)),c=o,o=+s[u+8+(t<<4)+8>>3],c=f*f+(c=+d(.5*(o-c)))*(+A(+p)*+A(+a)*c),l+=2*+y(+ +h(+c),+ +h(+(1-c)))}while((0|t)!=(0|e));return s[n>>3]=l,u=0,f=l,f*=6371.007180918475,s[n>>3]=f,D=i,0|u},_edgeLengthM:function(t,e,n){n|=0;var i,a=0,o=0,l=0,u=0,c=0,p=0,f=0;if(i=D,D=D+176|0,0|(t=0|St(t|=0,e|=0,u=i)))return u=t,l=+s[n>>3],l*=6371.007180918475,l*=1e3,s[n>>3]=l,D=i,0|u;if(s[n>>3]=0,(0|(t=0|r[u>>2]))<=1)return u=0,l=0,l*=6371.007180918475,l*=1e3,s[n>>3]=l,D=i,0|u;e=t+-1|0,t=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((t=t+1|0)<<4)>>3],f=+d(.5*(a-p)),c=o,o=+s[u+8+(t<<4)+8>>3],c=f*f+(c=+d(.5*(o-c)))*(+A(+p)*+A(+a)*c),l+=2*+y(+ +h(+c),+ +h(+(1-c)))}while((0|t)!=(0|e));return s[n>>3]=l,u=0,f=l,f*=6371.007180918475,f*=1e3,s[n>>3]=f,D=i,0|u},_edgeLengthRads:function(t,e,n){n|=0;var i,a=0,o=0,l=0,u=0,c=0,p=0,f=0;if(i=D,D=D+176|0,0|(t=0|St(t|=0,e|=0,u=i)))return D=i,0|(u=t);if(s[n>>3]=0,(0|(t=0|r[u>>2]))<=1)return D=i,0|(u=0);e=t+-1|0,t=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((t=t+1|0)<<4)>>3],f=+d(.5*(a-p)),c=o,o=+s[u+8+(t<<4)+8>>3],c=f*f+(c=+d(.5*(o-c)))*(+A(+a)*+A(+p)*c),l+=2*+y(+ +h(+c),+ +h(+(1-c)))}while((0|t)<(0|e));return s[n>>3]=l,D=i,0|(u=0)},_emscripten_replace_memory:function(t){return i=new Int8Array(t),r=new Int32Array(t),s=new Float64Array(t),n=t,!0},_free:Ne,_getBaseCellNumber:It,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var i,s,a=0;return i=D,D=D+16|0,r[(a=i)>>2]=0,!0&268435456==(2013265920&e)?(s=0|qe(0|t,0|e,56),w(),a=0|O(t,-2130706433&e|134217728,7&s,a,n),D=i,0|a):(D=i,0|(a=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(r[n>>2]=t,r[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(s[e>>3]=+s[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(s[e>>3]=+s[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(s[e>>3]=+s[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(s[e>>3]=+s[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,i){i|=0;var s,a=0,o=0,l=0,u=0,h=0,c=0,A=0,d=0;s=D,D=D+128|0,A=s+112|0,l=s+96|0,d=s,o=0|qe(0|(e|=0),0|(n|=0),52),w(),h=15&o,r[A>>2]=h,u=0|qe(0|e,0|n,45),w(),u&=127;t:do{if(0|z(u)){if(0|h)for(a=1;;){if(!(!((c=0|Ge(7,0,3*(15-a|0)|0))&e)&!(w()&n))){o=0;break t}if(!(a>>>0<h>>>0))break;a=a+1|0}if(!(1&o))return c=0|Ge(h+1|0,0,52),d=w()|-15728641&n,d=0|t((c|e)&~(A=0|Ge(7,0,3*(14-h|0)|0)),d&~w(),i),D=s,0|d;o=1}else o=0}while(0);if(!(a=0|Wt(e,n,l))){o?(Ct(l,A,d),c=5):(Dt(l,A,d),c=6);t:do{if(0|z(u))if(h)for(a=1;;){if(!(!((u=0|Ge(7,0,3*(15-a|0)|0))&e)&!(w()&n))){e=2;break t}if(!(a>>>0<h>>>0)){e=5;break}a=a+1|0}else e=5;else e=2}while(0);Xe(0|i,-1,e<<2);t:do{if(o)for(l=0;;){if(Nt(u=d+(l<<4)|0,0|r[A>>2]),u=0|r[u>>2],-1==(0|(h=0|r[i>>2]))|(0|h)==(0|u))a=i;else{o=0;do{if((o=o+1|0)>>>0>=e>>>0){a=1;break t}h=0|r[(a=i+(o<<2)|0)>>2]}while(!(-1==(0|h)|(0|h)==(0|u)))}if(r[a>>2]=u,(l=l+1|0)>>>0>=c>>>0){a=0;break}}else for(l=0;;){if(Rt(u=d+(l<<4)|0,0|r[A>>2],0,1),u=0|r[u>>2],-1==(0|(h=0|r[i>>2]))|(0|h)==(0|u))a=i;else{o=0;do{if((o=o+1|0)>>>0>=e>>>0){a=1;break t}h=0|r[(a=i+(o<<2)|0)>>2]}while(!(-1==(0|h)|(0|h)==(0|u)))}if(r[a>>2]=u,(l=l+1|0)>>>0>=c>>>0){a=0;break}}}while(0)}return D=s,0|(d=a)},_getNumCells:ee,_getPentagons:Qt,_getRes0Cells:function(t){t|=0;var e=0,n=0,i=0;e=0;do{Ge(0|e,0,45),i=134225919|w(),r[(n=t+(e<<3)|0)>>2]=-1,r[n+4>>2]=i,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|qe(0|(t|=0),0|(e|=0),52),w(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,i,r,a=0;return i=+s[(e|=0)>>3],n=+s[t>>3],a=(r=+d(.5*(i-n)))*r+(a=+d(.5*(+s[e+8>>3]-+s[t+8>>3])))*(+A(+i)*+A(+n)*a),2*+y(+ +h(+a),+ +h(+(1-a)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,i,r,a=0;return i=+s[(e|=0)>>3],n=+s[t>>3],a=(r=+d(.5*(i-n)))*r+(a=+d(.5*(+s[e+8>>3]-+s[t+8>>3])))*(+A(+i)*+A(+n)*a),2*+y(+ +h(+a),+ +h(+(1-a)))},_gridDisk:I,_gridDiskDistances:L,_gridDistance:function(t,e,n,i,s){n|=0,i|=0,s|=0;var a,o,l=0,u=0;return o=D,D=D+32|0,u=o,0|(a=0|ue(t|=0,e|=0,t,e,l=o+12|0))?(D=o,0|(u=a)):0|(t=0|ue(t,e,n,i,u))?(D=o,0|(u=t)):(l=0|yt(l,u),r[(u=s)>>2]=l,r[u+4>>2]=((0|l)<0)<<31>>31,D=o,0|(u=0))},_gridPathCells:function(t,e,n,i,s){n|=0,i|=0,s|=0;var a,o=0,l=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,E=0,C=0;if(a=D,D=D+48|0,h=a+12|0,E=a,!(o=0|ue(t|=0,e|=0,t,e,l=a+24|0))&&!(o=0|ue(t,e,n,i,h))){M=((0|(S=0|yt(l,h)))<0)<<31>>31,r[l>>2]=0,r[l+4>>2]=0,r[l+8>>2]=0,r[h>>2]=0,r[h+4>>2]=0,r[h+8>>2]=0,0|ue(t,e,t,e,l)&&T(23313,23090,691,23299),0|ue(t,e,n,i,h)&&T(23313,23090,696,23299),xt(l),xt(h),S?(g=+(0|S),b=l,i=p=0|r[l>>2],o=f=0|r[(_=l+4|0)>>2],n=m=0|r[(x=l+8|0)>>2],y=+((0|r[h>>2])-p|0)/g,v=+((0|r[h+4>>2])-f|0)/g,g=+((0|r[h+8>>2])-m|0)/g):(_=o=l+4|0,x=n=l+8|0,b=l,i=0|r[l>>2],o=0|r[o>>2],n=0|r[n>>2],y=0,v=0,g=0),r[E>>2]=i,r[(m=E+4|0)>>2]=o,r[(f=E+8|0)>>2]=n;t:do{if((0|S)<0)o=0;else for(d=0,p=0,o=i;;){C=y*(A=+(p>>>0)+4294967296*+(0|d))+ +(0|o),c=v*A+ +(0|r[_>>2]),A=g*A+ +(0|r[x>>2]),n=~~+je(+C),l=~~+je(+c),o=~~+je(+A),C=+u(+(+(0|n)-C)),c=+u(+(+(0|l)-c)),A=+u(+(+(0|o)-A));do{if(!(C>c&C>A)){if(h=0-n|0,c>A){i=h-o|0;break}i=l,o=h-l|0;break}n=0-(l+o)|0,i=l}while(0);if(r[E>>2]=n,r[m>>2]=i,r[f>>2]=o,bt(E),0|(o=0|he(t,e,E,s+(p<<3)|0)))break t;if(!((0|d)<(0|M)|(0|d)==(0|M)&p>>>0<S>>>0)){o=0;break t}o=0|De(0|p,0|d,1,0),d=h=0|w(),p=o,o=0|r[b>>2]}}while(0);return D=a,0|(E=o)}return D=a,0|(E=o)},_gridPathCellsSize:function(t,e,n,i,s){n|=0,i|=0,s|=0;var a,o=0,l=0,u=0;return a=D,D=D+32|0,u=a,(o=0|ue(t|=0,e|=0,t,e,l=a+12|0))||(o=0|ue(t,e,n,i,u))?(D=a,0|(u=o)):(i=0|De(0|(i=0|yt(l,u)),((0|i)<0)<<31>>31,1,0),l=0|w(),r[(u=s)>>2]=i,r[u+4>>2]=l,D=a,0|(u=0))},_gridRingUnsafe:function(t,e,n,i){t|=0,e|=0,n|=0,i|=0;var s,a,o=0,l=0,u=0,h=0,c=0,A=0,d=0,p=0,f=0;if(a=D,D=D+16|0,f=a+8|0,r[(p=s=a)>>2]=t,r[p+4>>2]=e,!n)return r[(f=i)>>2]=t,r[f+4>>2]=e,D=a,0|(f=0);r[f>>2]=0;t:do{if(0|Ot(t,e))t=9;else{if(l=(0|n)>0){o=0,p=t;do{if(0|(t=0|O(p,e,4,f,s)))break t;if(o=o+1|0,0|Ot(p=0|r[(e=s)>>2],e=0|r[e+4>>2])){t=9;break t}}while((0|o)<(0|n));if(r[(d=i)>>2]=p,r[d+4>>2]=e,d=n+-1|0,l){A=0,t=1;do{if(o=22384+(A<<2)|0,5==(0|A))for(u=0|r[o>>2],l=0,o=t;;){if(0|(t=0|O(0|r[(t=s)>>2],0|r[t+4>>2],u,f,s)))break t;if((0|l)!=(0|d)){if(h=0|r[(c=s)>>2],c=0|r[c+4>>2],r[(t=i+(o<<3)|0)>>2]=h,r[t+4>>2]=c,0|Ot(h,c)){t=9;break t}t=o+1|0}else t=o;if((0|(l=l+1|0))>=(0|n))break;o=t}else for(u=s,c=0|r[o>>2],h=0,o=t,l=0|r[u>>2],u=0|r[u+4>>2];;){if(0|(t=0|O(l,u,c,f,s)))break t;if(l=0|r[(u=s)>>2],u=0|r[u+4>>2],r[(t=i+(o<<3)|0)>>2]=l,r[t+4>>2]=u,t=o+1|0,0|Ot(l,u)){t=9;break t}if((0|(h=h+1|0))>=(0|n))break;o=t}A=A+1|0}while(A>>>0<6);u=p,o=0|r[(t=s)>>2],l=e,t=0|r[t+4>>2]}else u=p,o=p,l=e,t=e}else r[(u=i)>>2]=t,r[u+4>>2]=e,u=t,o=t,l=e,t=e;t=(0|u)==(0|o)&(0|l)==(0|t)?0:9}}while(0);return D=a,0|(f=t)},_i64Add:De,_i64Subtract:Ie,_isPentagon:Ot,_isResClassIII:function(t,e){return e=0|qe(0|(t|=0),0|(e|=0),52),w(),1&e},_isValidCell:Lt,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|qe(0|(t|=0),0|(e|=0),56),w(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|Ot(t,n))?0|(n=0):0|(n=0|Lt(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,i,s=0,a=0;return i=D,D=D+16|0,n=i,!0&536870912==(2013265920&(e|=0))&&0|Lt(t,s=-2130706433&e|134217728)?(a=0|qe(0|t,0|e,56),w(),s=(a=!(0|_e(t,s,7&a,n)))&((0|r[(s=n)>>2])==(0|t)?(0|r[s+4>>2])==(0|e):0)&1,D=i,0|s):(D=i,0|(s=0))},_latLngToCell:Ht,_llvm_maxnum_f64:Ve,_llvm_minnum_f64:He,_llvm_round_f64:je,_localIjToCell:function(t,e,n,i,r){var s,a;return t|=0,e|=0,n|=0,r|=0,a=D,D=D+16|0,s=a,(i|=0)?n=15:(n=0|_t(n,s))||(n=0|he(t,e,s,r)),D=a,0|n},_malloc:Re,_maxFaceCount:function(t,e,n){n|=0;var i=0,s=0;if(s=0|qe(0|(t|=0),0|(e|=0),45),w(),!(0|z(127&s)))return s=2,r[n>>2]=s,0;if(s=0|qe(0|t,0|e,52),w(),!(s&=15))return s=5,r[n>>2]=s,0;for(i=1;;){if(!(!((0|Ge(7,0,3*(15-i|0)|0))&t)&!(w()&e))){i=2,t=6;break}if(!(i>>>0<s>>>0)){i=5,t=6;break}i=i+1|0}return 6==(0|t)?(r[n>>2]=i,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,i=0,s=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(s=0|Oe(0|t,0|(n=((0|t)<0)<<31>>31),3,0),i=0|w(),n=0|De(0|t,0|n,1,0),n=0|De(0|(n=0|Oe(0|s,0|i,0|n,0|w())),0|w(),1,0),t=0|w(),r[e>>2]=n,r[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,i){e|=0,i|=0;var s,a=0,o=0,l=0,u=0,h=0;if(s=D,D=D+48|0,a=s+16|0,o=s+8|0,l=s,0|(n|=0))return D=s,0|(l=15);if(u=0|r[(h=t|=0)+4>>2],r[(n=o)>>2]=r[h>>2],r[n+4>>2]=u,de(o,a),!(e=0|Q(a,e,l))){if(n=0|r[o>>2],(0|(o=0|r[t+8>>2]))>0){a=0|r[t+12>>2],e=0;do{n=(0|r[a+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|o))}a=0|r[(e=l)>>2],(0|(e=0|r[e+4>>2]))<(0|(o=((0|n)<0)<<31>>31))|(0|e)==(0|o)&a>>>0<n>>>0?(r[(e=l)>>2]=n,r[e+4>>2]=o,e=o):n=a,u=0|De(0|n,0|e,12,0),h=0|w(),r[(e=l)>>2]=u,r[e+4>>2]=h,r[(e=i)>>2]=u,r[e+4>>2]=h,e=0}return D=s,0|(h=e)},_memcpy:We,_memset:Xe,_originToDirectedEdges:function(t,e,n){n|=0;var i,s=0;return i=!(0|Ot(t|=0,e|=0)),e&=-2130706433,r[(s=n)>>2]=i?t:0,r[s+4>>2]=i?285212672|e:0,r[(s=n+8|0)>>2]=t,r[s+4>>2]=301989888|e,r[(s=n+16|0)>>2]=t,r[s+4>>2]=318767104|e,r[(s=n+24|0)>>2]=t,r[s+4>>2]=335544320|e,r[(s=n+32|0)>>2]=t,r[s+4>>2]=352321536|e,r[(n=n+40|0)>>2]=t,r[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,i){e|=0,i|=0;var s,a,o,l,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,_=0,x=0,b=0,S=0,M=0,T=0,E=0,C=0,R=0,N=0,P=0,I=0,L=0,O=0,F=0,z=0;if(l=D,D=D+112|0,s=l+80|0,d=l+72|0,a=l,o=l+56|0,0|(n|=0))return D=l,0|(z=15);if(!(z=0|Re(32+(r[(p=(t|=0)+8|0)>>2]<<5)|0)))return D=l,0|(z=13);if(pe(t,z),F=0|r[(O=t)+4>>2],r[(n=d)>>2]=r[O>>2],r[n+4>>2]=F,de(d,s),n=0|Q(s,e,a))O=0,F=0;else{if(n=0|r[d>>2],(0|(h=0|r[p>>2]))>0){c=0|r[t+12>>2],u=0;do{n=(0|r[c+(u<<3)>>2])+n|0,u=u+1|0}while((0|u)!=(0|h));u=n}else u=n;h=0|r[(n=a)>>2],(0|(n=0|r[n+4>>2]))<(0|(c=((0|u)<0)<<31>>31))|(0|n)==(0|c)&h>>>0<u>>>0?(r[(n=a)>>2]=u,r[n+4>>2]=c,n=c):u=h,O=0|De(0|u,0|n,12,0),F=0|w(),r[(n=a)>>2]=O,r[n+4>>2]=F,n=0}if(0|n)return Ne(z),D=l,0|(z=n);if(!(u=0|Pe(O,8)))return Ne(z),D=l,0|(z=13);if(!(A=0|Pe(O,8)))return Ne(z),Ne(u),D=l,0|(z=13);r[(I=s)>>2]=0,r[I+4>>2]=0,L=0|r[(I=t)+4>>2],r[(n=d)>>2]=r[I>>2],r[n+4>>2]=L,n=0|k(d,O,F,e,s,u,A);t:do{if(n)Ne(u),Ne(A),Ne(z);else{e:do{if((0|r[p>>2])>0){for(c=t+12|0,h=0;n=0|k((0|r[c>>2])+(h<<3)|0,O,F,e,s,u,A),h=h+1|0,!(0|n);)if((0|h)>=(0|r[p>>2]))break e;Ne(u),Ne(A),Ne(z);break t}}while(0);(0|F)>0|!(0|F)&O>>>0>0&&Xe(0|A,0,O<<3),I=0|r[(L=s)+4>>2];e:do{if((0|I)>0|!(0|I)&(0|r[L>>2])>>>0>0){R=u,N=A,P=u,I=A,L=u,n=u,T=u,E=A,C=A,u=A;n:for(;;){for(x=0,b=0,S=0,M=0,h=0,c=0;;){d=(A=a)+56|0;do{r[A>>2]=0,A=A+4|0}while((0|A)<(0|d));if(0|B(p=0|r[(e=R+(x<<3)|0)>>2],e=0|r[e+4>>2],1,a,0)){d=(A=a)+56|0;do{r[A>>2]=0,A=A+4|0}while((0|A)<(0|d));0|(A=0|Pe(7,4))&&(U(p,e,1,a,A,7,0,0),Ne(A))}for(_=0;;){y=0|r[(v=a+(_<<3)|0)>>2],v=0|r[v+4>>2];i:do{if(!(0|y)&!(0|v))A=h,d=c;else{if(f=0|ke(0|y,0|v,0|O,0|F),p=0|w(),!(!(0|(d=0|r[(e=A=i+(f<<3)|0)>>2]))&!(0|(e=0|r[e+4>>2])))){m=0,g=0;do{if((0|m)>(0|F)|(0|m)==(0|F)&g>>>0>O>>>0)break n;if((0|d)==(0|y)&(0|e)==(0|v)){A=h,d=c;break i}f=0|Fe(0|(A=0|De(0|f,0|p,1,0)),0|w(),0|O,0|F),p=0|w(),g=0|De(0|g,0|m,1,0),m=0|w(),d=0|r[(e=A=i+(f<<3)|0)>>2],e=0|r[e+4>>2]}while(!(!(0|d)&!(0|e)))}!(0|y)&!(0|v)?(A=h,d=c):(Xt(y,v,o),0|fe(t,z,o)&&(g=0|De(0|h,0|c,1,0),c=0|w(),r[(m=A)>>2]=y,r[m+4>>2]=v,r[(h=N+(h<<3)|0)>>2]=y,r[h+4>>2]=v,h=g),A=h,d=c)}}while(0);if((_=_+1|0)>>>0>=7)break;h=A,c=d}if(x=0|De(0|x,0|b,1,0),b=0|w(),S=0|De(0|S,0|M,1,0),M=0|w(),h=0|r[(c=s)>>2],!((0|M)<(0|(c=0|r[c+4>>2]))|(0|M)==(0|c)&S>>>0<h>>>0))break;h=A,c=d}if((0|c)>0|!(0|c)&h>>>0>0){h=0,c=0;do{r[(M=R+(h<<3)|0)>>2]=0,r[M+4>>2]=0,h=0|De(0|h,0|c,1,0),c=0|w(),S=0|r[(M=s)+4>>2]}while((0|c)<(0|S)|((0|c)==(0|S)?h>>>0<(0|r[M>>2])>>>0:0))}if(r[(M=s)>>2]=A,r[M+4>>2]=d,!((0|d)>0|!(0|d)&A>>>0>0))break e;_=u,x=C,b=L,S=E,M=N,u=T,C=n,E=P,T=_,n=x,L=I,I=b,P=S,N=R,R=M}Ne(P),Ne(I),Ne(z),n=1;break t}n=A}while(0);Ne(z),Ne(u),Ne(n),n=0}}while(0);return D=l,0|(z=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|r[(t|=0)>>2])>>>0)+4294967296*+(0|r[t+4>>2]))},_res0CellCount:function(){return 122},_round:Ye,_sbrk:Qe,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,i,s,a,o){t|=0,i|=0,s|=0,a|=0;var l,u=0,h=0,c=0,A=0,d=0,p=0,f=0,m=0;if(l=D,D=D+16|0,m=l,!((0|(n|=0))>0|!(0|n)&(e|=0)>>>0>0))return D=l,0|(m=0);if((0|(o|=0))>=16)return D=l,0|(m=12);p=0,f=0,d=0,u=0;t:for(;;){if(A=0|qe(0|(h=0|r[(c=t+(p<<3)|0)>>2]),0|(c=0|r[c+4>>2]),52),w(),(15&A)>(0|o)){u=12,h=11;break}if($t(m,h,c,o),!(0|(c=0|r[(A=m)>>2]))&!(0|(A=0|r[A+4>>2])))h=d;else{h=d;do{if(!((0|u)<(0|a)|(0|u)==(0|a)&h>>>0<s>>>0)){h=10;break t}r[(d=i+(h<<3)|0)>>2]=c,r[d+4>>2]=A,h=0|De(0|h,0|u,1,0),u=0|w(),Zt(m),c=0|r[(d=m)>>2],A=0|r[d+4>>2]}while(!(!(0|c)&!(0|A)))}if(p=0|De(0|p,0|f,1,0),!((0|(f=0|w()))<(0|n)|(0|f)==(0|n)&p>>>0<e>>>0)){u=0,h=11;break}d=h}return 10==(0|h)?(D=l,0|(m=14)):11==(0|h)?(D=l,0|u):0},_uncompactCellsSize:function(t,e,n,i,s){t|=0,e|=0,n|=0,i|=0,s|=0;var a,o,l=0,u=0,h=0,c=0,A=0,d=0;o=D,D=D+16|0,a=o;t:do{if((0|n)>0|!(0|n)&e>>>0>0){for(A=0,u=0,l=0,d=0;;){if(!(!(0|(h=0|r[(c=t+(A<<3)|0)>>2]))&!(0|(c=0|r[c+4>>2]))||(c=!(0|Ut(h,c,i,a)),u=0|De(0|r[(h=a)>>2],0|r[h+4>>2],0|u,0|l),l=0|w(),c))){l=12;break}if(A=0|De(0|A,0|d,1,0),!((0|(d=0|w()))<(0|n)|(0|d)==(0|n)&A>>>0<e>>>0))break t}return D=o,0|l}u=0,l=0}while(0);return r[s>>2]=u,r[s+4>>2]=l,D=o,0|(s=0)},_vertexToLatLng:function(t,e,n){n|=0;var i,s,a,o,l=0,u=0;return o=D,D=D+192|0,s=o,a=o+168|0,l=0|qe(0|(t|=0),0|(e|=0),56),w(),l&=7,0|(i=0|Wt(t,u=-2130706433&e|134217728,a))?(D=o,0|(u=i)):(e=0|qe(0|t,0|e,52),w(),e&=15,0|Ot(t,u)?Et(a,e,l,1,s):Pt(a,e,l,1,s),u=s+8|0,r[n>>2]=r[u>>2],r[n+4>>2]=r[u+4>>2],r[n+8>>2]=r[u+8>>2],r[n+12>>2]=r[u+12>>2],D=o,0|(u=0))},establishStackSpace:function(t,e){D=t|=0},stackAlloc:function(t){var e;return e=D,D=(D=D+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){D=t|=0},stackSave:function(){return 0|D}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:gt,b:function(t){g=t},c:function(){return g},d:function(t,e,n,i){gt("Assertion failed: "+N(t)+", at: "+[e?N(e):"unknown filename",n,i?N(i):"unknown function"])},e:function(t){return n.___errno_location&&(T[n.___errno_location()>>2]=t),t},f:J,g:function(t,e,n){M.set(M.subarray(e,e+n),t)},h:function(t){var e=J(),n=16777216,i=2130706432;if(t>i)return!1;for(var r=Math.max(e,16777216);r<t;)r=r<=536870912?P(2*r,n):Math.min(P((3*r+2147483648)/4,n),i);return!!tt(r)},i:function(t){gt("OOM")},j:$,k:Z,l:tt,m:K,n:function(){var t=K();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),Z(t)},o:24144,p:24128},b);n.___divdi3=rt.___divdi3,n.___muldi3=rt.___muldi3,n.___remdi3=rt.___remdi3,n.___uremdi3=rt.___uremdi3,n._areNeighborCells=rt._areNeighborCells,n._bitshift64Ashr=rt._bitshift64Ashr,n._bitshift64Lshr=rt._bitshift64Lshr,n._bitshift64Shl=rt._bitshift64Shl,n._calloc=rt._calloc,n._cellAreaKm2=rt._cellAreaKm2,n._cellAreaM2=rt._cellAreaM2,n._cellAreaRads2=rt._cellAreaRads2,n._cellToBoundary=rt._cellToBoundary,n._cellToCenterChild=rt._cellToCenterChild,n._cellToChildPos=rt._cellToChildPos,n._cellToChildren=rt._cellToChildren,n._cellToChildrenSize=rt._cellToChildrenSize,n._cellToLatLng=rt._cellToLatLng,n._cellToLocalIj=rt._cellToLocalIj,n._cellToParent=rt._cellToParent,n._cellToVertex=rt._cellToVertex,n._cellToVertexes=rt._cellToVertexes,n._cellsToDirectedEdge=rt._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=rt._cellsToLinkedMultiPolygon,n._childPosToCell=rt._childPosToCell,n._compactCells=rt._compactCells,n._destroyLinkedMultiPolygon=rt._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=rt._directedEdgeToBoundary,n._directedEdgeToCells=rt._directedEdgeToCells,n._edgeLengthKm=rt._edgeLengthKm,n._edgeLengthM=rt._edgeLengthM,n._edgeLengthRads=rt._edgeLengthRads;var st=n._emscripten_replace_memory=rt._emscripten_replace_memory;n._free=rt._free,n._getBaseCellNumber=rt._getBaseCellNumber,n._getDirectedEdgeDestination=rt._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=rt._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=rt._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=rt._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=rt._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=rt._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=rt._getIcosahedronFaces,n._getNumCells=rt._getNumCells,n._getPentagons=rt._getPentagons,n._getRes0Cells=rt._getRes0Cells,n._getResolution=rt._getResolution,n._greatCircleDistanceKm=rt._greatCircleDistanceKm,n._greatCircleDistanceM=rt._greatCircleDistanceM,n._greatCircleDistanceRads=rt._greatCircleDistanceRads,n._gridDisk=rt._gridDisk,n._gridDiskDistances=rt._gridDiskDistances,n._gridDistance=rt._gridDistance,n._gridPathCells=rt._gridPathCells,n._gridPathCellsSize=rt._gridPathCellsSize,n._gridRingUnsafe=rt._gridRingUnsafe,n._i64Add=rt._i64Add,n._i64Subtract=rt._i64Subtract,n._isPentagon=rt._isPentagon,n._isResClassIII=rt._isResClassIII,n._isValidCell=rt._isValidCell,n._isValidDirectedEdge=rt._isValidDirectedEdge,n._isValidVertex=rt._isValidVertex,n._latLngToCell=rt._latLngToCell,n._llvm_maxnum_f64=rt._llvm_maxnum_f64,n._llvm_minnum_f64=rt._llvm_minnum_f64,n._llvm_round_f64=rt._llvm_round_f64,n._localIjToCell=rt._localIjToCell,n._malloc=rt._malloc,n._maxFaceCount=rt._maxFaceCount,n._maxGridDiskSize=rt._maxGridDiskSize,n._maxPolygonToCellsSize=rt._maxPolygonToCellsSize,n._memcpy=rt._memcpy,n._memset=rt._memset,n._originToDirectedEdges=rt._originToDirectedEdges,n._pentagonCount=rt._pentagonCount,n._polygonToCells=rt._polygonToCells,n._readInt64AsDoubleFromPointer=rt._readInt64AsDoubleFromPointer,n._res0CellCount=rt._res0CellCount,n._round=rt._round,n._sbrk=rt._sbrk,n._sizeOfCellBoundary=rt._sizeOfCellBoundary,n._sizeOfCoordIJ=rt._sizeOfCoordIJ,n._sizeOfGeoLoop=rt._sizeOfGeoLoop,n._sizeOfGeoPolygon=rt._sizeOfGeoPolygon,n._sizeOfH3Index=rt._sizeOfH3Index,n._sizeOfLatLng=rt._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=rt._sizeOfLinkedGeoPolygon,n._uncompactCells=rt._uncompactCells,n._uncompactCellsSize=rt._uncompactCellsSize,n._vertexToLatLng=rt._vertexToLatLng,n.establishStackSpace=rt.establishStackSpace;var at,ot,lt=n.stackAlloc=rt.stackAlloc,ut=n.stackRestore=rt.stackRestore,ht=n.stackSave=rt.stackSave;if(n.asm=rt,n.cwrap=function(t,e,n,i){var r=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&r&&!i?_(t):function(){return x(t,e,n,arguments)}},n.setValue=function(t,e,n,i){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":S[t|0]=e;break;case"i16":w[t>>1]=e;break;case"i32":T[t>>2]=e;break;case"i64":W=[e>>>0,(j=e,+k(j)>=1?j>0?(0|G(+q(j/4294967296),4294967295))>>>0:~~+z((j-+(~~j>>>0))/4294967296)>>>0:0)],T[t>>2]=W[0],T[t+4>>2]=W[1];break;case"float":E[t>>2]=e;break;case"double":C[t>>3]=e;break;default:gt("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return S[t|0];case"i16":return w[t>>1];case"i32":case"i64":return T[t>>2];case"float":return E[t>>2];case"double":return C[t>>3];default:gt("invalid type for getValue: "+e)}return null},X)if(Q(X)||(at=X,X=n.locateFile?n.locateFile(at,p):p+at),a||l){var ct=c(X);M.set(ct,8)}else{V++,n.monitorRunDependencies&&n.monitorRunDependencies(V);var At=function(t){t.byteLength&&(t=new Uint8Array(t)),M.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(){if(V--,n.monitorRunDependencies&&n.monitorRunDependencies(V),0==V&&H){var t=H;H=null,t()}}()},dt=function(){h(X,At,(function(){throw"could not load memory initializer "+X}))},pt=it(X);if(pt)At(pt.buffer);else if(n.memoryInitializerRequest){var ft=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var i=it(n.memoryInitializerRequestURL);if(!i)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+X),void dt();e=i.buffer}At(e)};n.memoryInitializerRequest.response?setTimeout(ft,0):n.memoryInitializerRequest.addEventListener("load",ft)}else dt()}function mt(t){function e(){ot||(ot=!0,y||(L(U),L(O),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),F.unshift(t);var t;L(F)}()))}V>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),B.unshift(t);var t;L(B)}(),V>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function gt(t){throw n.onAbort&&n.onAbort(t),f(t+=""),m(t),y=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(H=function t(){ot||mt(),ot||(H=t)},n.run=mt,n.abort=gt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return mt(),t}("object"==typeof Rg?Rg:{}),Ng="number",Pg={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range",4:"Resolution argument was outside of acceptable range",5:"Cell argument was not valid",6:"Directed edge argument was not valid",7:"Undirected edge argument was not valid",8:"Vertex argument was not valid",9:"Pentagon distortion was encountered",10:"Duplicate input",11:"Cell arguments were not neighbors",12:"Cell arguments had incompatible resolutions",13:"Memory allocation failed",14:"Bounds of provided memory were insufficient",15:"Mode or flags argument was not valid"},Dg={1e3:"Unknown unit",1001:"Array length out of bounds",1002:"Got unexpected null value for H3 index"};
    66/*
    77   * Copyright 2018-2019, 2022 Uber Technologies, Inc.
     
    1818   * See the License for the specific language governing permissions and
    1919   * limitations under the License.
    20    */Ym[Qm]="Resolution argument was outside of acceptable range",Ym[5]="Cell argument was not valid",Ym[6]="Directed edge argument was not valid",Ym[7]="Undirected edge argument was not valid",Ym[8]="Vertex argument was not valid",Ym[9]="Pentagon distortion was encountered",Ym[10]="Duplicate input",Ym[11]="Cell arguments were not neighbors",Ym[12]="Cell arguments had incompatible resolutions",Ym[13]="Memory allocation failed",Ym[14]="Bounds of provided memory were insufficient",Ym[15]="Mode or flags argument was not valid";var Zm=1001,Km=1002,Jm={1e3:"Unknown unit"};Jm[Zm]="Array length out of bounds",Jm[Km]="Got unexpected null value for H3 index";var $m="Unknown error";function tg(t,e,n){var r=n&&"value"in n,i=new Error((t[e]||$m)+" (code: "+e+(r?", value: "+n.value:"")+")");return i.code=e,i}function eg(t,e){return tg(Ym,t,2===arguments.length?{value:e}:{})}function ng(t,e){return tg(Jm,t,2===arguments.length?{value:e}:{})}function rg(t){if(0!==t)throw eg(t)}
     20   */function Ig(t,e,n){var i=n&&"value"in n,r=new Error((t[e]||"Unknown error")+" (code: "+e+(i?", value: "+n.value:"")+")");return r.code=e,r}function Lg(t,e){return Ig(Pg,t,2===arguments.length?{value:e}:{})}function Bg(t,e){return Ig(Dg,t,2===arguments.length?{value:e}:{})}function Ug(t){if(0!==t)throw Lg(t)}
    2121/*
    2222   * Copyright 2018-2019, 2022 Uber Technologies, Inc.
     
    3333   * See the License for the specific language governing permissions and
    3434   * limitations under the License.
    35    */var ig={};Xm.forEach((function(t){ig[t[0]]=Vm.cwrap.apply(Vm,t)}));var ag=16,og=4,sg=8,Ag=ig.sizeOfH3Index(),lg=ig.sizeOfLatLng(),cg=ig.sizeOfCellBoundary(),ug=ig.sizeOfGeoPolygon(),hg=ig.sizeOfGeoLoop();ig.sizeOfLinkedGeoPolygon(),ig.sizeOfCoordIJ();var fg=Math.pow(2,32)-1;var dg=/[^0-9a-fA-F]/;function pg(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||dg.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),ag);return[parseInt(t.substring(t.length-8),ag),e]}function mg(t){if(t>=0)return t.toString(ag);var e=gg(8,(t&=2147483647).toString(ag));return e=(parseInt(e[0],ag)+8).toString(ag)+e.substring(1)}function gg(t,e){for(var n=t-e.length,r="",i=0;i<n;i++)r+="0";return r+=e}function vg(t,e,n){for(var r=t.length,i=Vm._calloc(r,lg),a=n?1:0,o=n?0:1,s=0;s<2*r;s+=2)Vm.HEAPF64.set([t[s/2][a],t[s/2][o]].map(Tg),i/sg+s);return Vm.HEAPU32.set([r,i],e/og),e}function _g(t,e){void 0===e&&(e=0);var n=Vm.getValue(t+Ag*e,"i32"),r=Vm.getValue(t+Ag*e+og,"i32");return r?function(t,e){return mg(e)+gg(8,mg(t))}(n,r):null}function yg(t){return 180*Vm.getValue(t,"double")/Math.PI}function xg(t){return[yg(t),yg(t+sg)]}function bg(t){return[yg(t+sg),yg(t)]}function Mg(t,e,n){var r=Vm._malloc(lg);Vm.HEAPF64.set([t,e].map(Tg),r/sg);var i=Vm._malloc(Ag);try{return rg(ig.latLngToCell(r,n,i)),function(t){if(!t)throw ng(Km);return t}(_g(i))}finally{Vm._free(i),Vm._free(r)}}function wg(t){var e=Vm._malloc(lg),n=pg(t),r=n[0],i=n[1];try{return rg(ig.cellToLatLng(r,i,e)),xg(e)}finally{Vm._free(e)}}function Eg(t,e){var n=Vm._malloc(cg),r=pg(t),i=r[0],a=r[1];try{return rg(ig.cellToBoundary(i,a,n)),function(t,e,n){for(var r=Vm.getValue(t,"i32"),i=t+sg,a=[],o=e?bg:xg,s=0;s<2*r;s+=2)a.push(o(i+sg*s));return n&&a.push(a[0]),a}(n,e,e)}finally{Vm._free(n)}}function Sg(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw eg(Qm,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var r,i=function(t,e){var n,r=t.length-1,i=Vm._calloc(ug),a=0+hg,o=a+og;if(vg(t[0],i+0,e),r>0){n=Vm._calloc(r,hg);for(var s=0;s<r;s++)vg(t[s+1],n+hg*s,e)}return Vm.setValue(i+a,r,"i32"),Vm.setValue(i+o,n,"i32"),i}("number"==typeof t[0][0]?[t]:t,n),a=Vm._malloc(8);try{rg(ig.maxPolygonToCellsSize(i,e,0,a));var o=function(t){if(t>fg)throw ng(Zm,t);return t}((r=a,ig.readInt64AsDoubleFromPointer(r))),s=Vm._calloc(o,Ag);try{return rg(ig.polygonToCells(i,e,0,s)),function(t,e){for(var n=[],r=0;r<e;r++){var i=_g(t,r);null!==i&&n.push(i)}return n}(s,o)}finally{Vm._free(s)}}finally{Vm._free(a),function(t){var e=0+hg,n=e+og,r=og;Vm._free(Vm.getValue(t+0+r,"i8*"));var i=Vm.getValue(t+e,"i32");if(i>0){for(var a=Vm.getValue(t+n,"i32"),o=0;o<i;o++)Vm._free(Vm.getValue(a+hg*o+r,"i8*"));Vm._free(a)}Vm._free(t)}(i)}}function Tg(t){return t*Math.PI/180}var Cg=Rg;function Rg(t,e,n,r){this.x="number"==typeof t?t:0,this.y="number"==typeof e?e:0,this.z="number"==typeof n?n:0,this.half="number"==typeof r?r:0}Rg.prototype.contains=function(t,e,n){var r=this.half;return this.x-r<=t&&t<this.x+r&&this.y-r<=e&&e<this.y+r&&this.z-r<=n&&n<this.z+r};var Pg=Cg,Lg=Dg;function Dg(t){this.bounds=t,this.q0=null,this.q1=null,this.q2=null,this.q3=null,this.q4=null,this.q5=null,this.q6=null,this.q7=null,this.items=null}Dg.prototype.subdivide=function(){var t=this.bounds,e=t.half/2;this.q0=new Dg(new Pg(t.x-e,t.y-e,t.z-e,e)),this.q1=new Dg(new Pg(t.x+e,t.y-e,t.z-e,e)),this.q2=new Dg(new Pg(t.x-e,t.y+e,t.z-e,e)),this.q3=new Dg(new Pg(t.x+e,t.y+e,t.z-e,e)),this.q4=new Dg(new Pg(t.x-e,t.y-e,t.z+e,e)),this.q5=new Dg(new Pg(t.x+e,t.y-e,t.z+e,e)),this.q6=new Dg(new Pg(t.x-e,t.y+e,t.z+e,e)),this.q7=new Dg(new Pg(t.x+e,t.y+e,t.z+e,e))},Dg.prototype.insert=function(t,e,n){if(null===this.q0){if(null===this.items?this.items=[t]:this.items.push(t),this.items.length>=4&&n<16){this.subdivide();for(var r=0;r<this.items.length;++r)this.insert(this.items[r],e,n+1);this.items=null}}else{var i=e[t],a=e[t+1],o=e[t+2],s=this.bounds,A=0;i>s.x&&(A+=1),a>s.y&&(A+=2),o>s.z&&(A+=4);var l=function(t,e){if(0===e)return t.q0;if(1===e)return t.q1;if(2===e)return t.q2;if(3===e)return t.q3;if(4===e)return t.q4;if(5===e)return t.q5;if(6===e)return t.q6;if(7===e)return t.q7}(this,A);l.insert(t,e,n+1)}},Dg.prototype.query=function(t,e,n,r){if(n(this.bounds)){var i=this.items,a="function"==typeof r;if(i)for(var o=0;o<i.length;++o){var s=i[o];a?r(e[s],e[s+1],e[s+2])&&t.push(s):t.push(s)}this.q0&&(this.q0.query(t,e,n,r),this.q1.query(t,e,n,r),this.q2.query(t,e,n,r),this.q3.query(t,e,n,r),this.q4.query(t,e,n,r),this.q5.query(t,e,n,r),this.q6.query(t,e,n,r),this.q7.query(t,e,n,r))}};var Og=function(t,e,n,r){var i=0,a=0,o=(r=r||{}).step||1,s=r.maxTimeMS||8,A=r.probeElements||5e3;setTimeout((function r(){var l=Math.min(t.length,i+A),c=i,u=new Date;for(c=i;c<l;c+=o)e(t[c],c,t);c<t.length?(a+=new Date-u,i=c,A=Math.round(i*s/a),setTimeout(r,0)):n(t)}),0)};var Ig=Cg,qg=Lg,Ug=new Ig,Ng=Og,Bg=function(t){var e,n,r=[],i={initAsync:function(t,r){o(t);var a=s(t);function A(e,n){a.insert(n,t,0)}function l(){n=t,e=a,"function"==typeof r&&r(i)}Ng(t,A,l,{step:3})},init:function(t){o(t),n=t,e=s(t);for(var r=0;r<t.length;r+=3)e.insert(r,n,0)},bounds:function(){return e?e.bounds:Ug},intersectRay:function(t,i,a,o){if(!e)return r;void 0===a&&(a=0);void 0===o&&(o=Number.POSITIVE_INFINITY);a*=a,o*=o;var s=[];return e.query(s,n,A,l),s.sort(c);function A(e){var n,r=e.half,a=(e.x-r-t.x)/i.x,s=(e.x+r-t.x)/i.x,A=(e.y+r-t.y)/i.y,l=(e.y-r-t.y)/i.y,c=(e.z-r-t.z)/i.z,u=(e.z+r-t.z)/i.z,h=Math.min(Math.min(Math.max(a,s),Math.max(A,l)),Math.max(c,u));return!(h<0)&&((n=Math.max(Math.max(Math.min(a,s),Math.min(A,l)),Math.min(c,u)))<=h&&n<=o)}function l(e,n,r){var i=(e-t.x)*(e-t.x)+(n-t.y)*(n-t.y)+(r-t.z)*(r-t.z);return a<=i&&i<=o}function c(e,n){var r=t[e],i=t[e+1],a=t[e+2],o=(r-t.x)*(r-t.x)+(i-t.y)*(i-t.y)+(a-t.z)*(a-t.z),s=t[n],A=t[n+1],l=t[n+2];return o-((s-t.x)*(s-t.x)+(A-t.y)*(A-t.y)+(l-t.z)*(l-t.z))}},intersectSphere:function(t,i,o,s){if(!e)return r;var A=[],l=s*s;return e.query(A,n,c,u),A;function c(e){var n=l,r=e.half;return t<e.x-r?n-=a(t-(e.x-r)):t>e.x+r&&(n-=a(t-(e.x+r))),i<e.y-r?n-=a(i-(e.y-r)):i>e.y+r&&(n-=a(i-(e.y+r))),o<e.z-r?n-=a(o-(e.z-r)):o>e.z+r&&(n-=a(o-(e.z+r))),n>0}function u(e,n,r){return a(e-t)+a(n-i)+a(r-o)<l}},getRoot:function(){return e}};return i;function a(t){return t*t}function o(t){if(!t)throw new Error("Points array is required for quadtree to work");if("number"!=typeof t.length)throw new Error("Points should be array-like object");if(t.length%3!=0)throw new Error("Points array should consist of series of x,y,z coordinates and be multiple of 3")}function s(t){if(0===t.length){var e=new Ig;return new qg(e)}for(var n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,A=0;A<t.length;A+=3){var l=t[A],c=t[A+1],u=t[A+2];l<n&&(n=l),l>a&&(a=l),c<r&&(r=c),c>o&&(o=c),u<i&&(i=u),u>s&&(s=u)}var h=Math.max(Math.max(a-n,o-r),s-i),f=(h+=2)/2,d=new Ig((n-=1)+f,(r-=1)+f,(i-=1)+f,f);return new qg(d)}};var kg=el(Bg);const Fg=window.THREE?window.THREE:{Box3:Ae,BufferGeometry:Hn,Float32BufferAttribute:qn,InstancedBufferGeometry:class extends Hn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}},InstancedInterleavedBuffer:Ks,InterleavedBufferAttribute:Mo,Sphere:Se,Vector3:ae,WireframeGeometry:class extends Hn{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],n=new Set,r=new ae,i=new ae;if(null!==t.index){const a=t.attributes.position,o=t.index;let s=t.groups;0===s.length&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let t=0,A=s.length;t<A;++t){const A=s[t],l=A.start;for(let t=l,s=l+A.count;t<s;t+=3)for(let s=0;s<3;s++){const A=o.getX(t+s),l=o.getX(t+(s+1)%3);r.fromBufferAttribute(a,A),i.fromBufferAttribute(a,l),!0===qs(r,i,n)&&(e.push(r.x,r.y,r.z),e.push(i.x,i.y,i.z))}}}else{const a=t.attributes.position;for(let t=0,o=a.count/3;t<o;t++)for(let o=0;o<3;o++){const s=3*t+o,A=3*t+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,A),!0===qs(r,i,n)&&(e.push(r.x,r.y,r.z),e.push(i.x,i.y,i.z))}}this.setAttribute("position",new qn(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}};var zg=(new Fg.BufferGeometry).setAttribute?"setAttribute":"addAttribute";const Gg=new Fg.Box3,Hg=new Fg.Vector3;class jg extends Fg.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this[zg]("position",new Fg.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this[zg]("uv",new Fg.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Fg.InstancedInterleavedBuffer(e,6,1);return this[zg]("instanceStart",new Fg.InterleavedBufferAttribute(n,3,0)),this[zg]("instanceEnd",new Fg.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Fg.InstancedInterleavedBuffer(e,6,1);return this[zg]("instanceColorStart",new Fg.InterleavedBufferAttribute(n,3,0)),this[zg]("instanceColorEnd",new Fg.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Fg.WireframeGeometry(t.geometry)),this}fromLineSegments(t){const e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Fg.Box3);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),Gg.setFromBufferAttribute(e),this.boundingBox.union(Gg))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Fg.Sphere),null===this.boundingBox&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=t.count;i<a;i++)Hg.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(Hg)),Hg.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(Hg));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}jg.prototype.isLineSegmentsGeometry=!0;const Vg=window.THREE?window.THREE:{ShaderLib:Ur,ShaderMaterial:dr,UniformsLib:qr,UniformsUtils:fr,Vector2:Lt};Vg.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Vg.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1}},Vg.ShaderLib.line={uniforms:Vg.UniformsUtils.merge([Vg.UniformsLib.common,Vg.UniformsLib.fog,Vg.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\tworldStart = start.xyz;\n\t\t\tworldEnd = end.xyz;\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 offset;\n\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t}\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// extend the line bounds to encompass  endcaps\n\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t#endif\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t// set the world position\n\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segements overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class Wg extends Vg.ShaderMaterial{constructor(t){super({type:"LineMaterial",uniforms:Vg.UniformsUtils.clone(Vg.ShaderLib.line.uniforms),vertexShader:Vg.ShaderLib.line.vertexShader,fragmentShader:Vg.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){!0===t?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(t){Boolean(t)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===t?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("ALPHA_TO_COVERAGE"in this.defines)},set:function(t){Boolean(t)!==Boolean("ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===t?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(t)}}Wg.prototype.isLineMaterial=!0;const Xg=window.THREE?window.THREE:{Box3:Ae,BufferGeometry:Hn,InstancedInterleavedBuffer:Ks,InterleavedBufferAttribute:Mo,Line3:class{constructor(t=new ae,e=new ae){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){nA.subVectors(t,this.start),rA.subVectors(this.end,this.start);const n=rA.dot(rA);let r=rA.dot(nA)/n;return e&&(r=Mt(r,0,1)),r}closestPointToPoint(t,e,n){const r=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},MathUtils:Pt,Matrix4:qe,Mesh:sr,Sphere:Se,Vector3:ae,Vector4:$t};var Qg=(new Xg.BufferGeometry).setAttribute?"setAttribute":"addAttribute";const Yg=new Xg.Vector3,Zg=new Xg.Vector3,Kg=new Xg.Vector4,Jg=new Xg.Vector4,$g=new Xg.Vector4,tv=new Xg.Vector3,ev=new Xg.Matrix4,nv=new Xg.Line3,rv=new Xg.Vector3,iv=new Xg.Box3,av=new Xg.Sphere,ov=new Xg.Vector4;class sv extends Xg.Mesh{constructor(t=new jg,e=new Wg({color:16777215*Math.random()})){super(t,e),this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,r=new Float32Array(2*e.count);for(let t=0,i=0,a=e.count;t<a;t++,i+=2)Yg.fromBufferAttribute(e,t),Zg.fromBufferAttribute(n,t),r[i]=0===i?0:r[i-1],r[i+1]=r[i]+Yg.distanceTo(Zg);const i=new Xg.InstancedInterleavedBuffer(r,2,1);return t[Qg]("instanceDistanceStart",new Xg.InterleavedBufferAttribute(i,1,0)),t[Qg]("instanceDistanceEnd",new Xg.InterleavedBufferAttribute(i,1,1)),this}raycast(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');const n=void 0!==t.params.Line2&&t.params.Line2.threshold||0,r=t.ray,i=t.camera,a=i.projectionMatrix,o=this.matrixWorld,s=this.geometry,A=this.material,l=A.resolution,c=A.linewidth+n,u=s.attributes.instanceStart,h=s.attributes.instanceEnd,f=-i.near,d=2*Math.max(c/l.width,c/l.height);null===s.boundingSphere&&s.computeBoundingSphere(),av.copy(s.boundingSphere).applyMatrix4(o);const p=Math.max(i.near,av.distanceToPoint(r.origin));ov.set(0,0,-p,1).applyMatrix4(i.projectionMatrix),ov.multiplyScalar(1/ov.w),ov.applyMatrix4(i.projectionMatrixInverse);const m=.5*Math.abs(d/ov.w);if(av.radius+=m,!1===t.ray.intersectsSphere(av))return;null===s.boundingBox&&s.computeBoundingBox(),iv.copy(s.boundingBox).applyMatrix4(o);const g=Math.max(i.near,iv.distanceToPoint(r.origin));ov.set(0,0,-g,1).applyMatrix4(i.projectionMatrix),ov.multiplyScalar(1/ov.w),ov.applyMatrix4(i.projectionMatrixInverse);const v=.5*Math.abs(d/ov.w);if(iv.max.x+=v,iv.max.y+=v,iv.max.z+=v,iv.min.x-=v,iv.min.y-=v,iv.min.z-=v,!1!==t.ray.intersectsBox(iv)){r.at(1,$g),$g.w=1,$g.applyMatrix4(i.matrixWorldInverse),$g.applyMatrix4(a),$g.multiplyScalar(1/$g.w),$g.x*=l.x/2,$g.y*=l.y/2,$g.z=0,tv.copy($g),ev.multiplyMatrices(i.matrixWorldInverse,o);for(let t=0,n=u.count;t<n;t++){if(Kg.fromBufferAttribute(u,t),Jg.fromBufferAttribute(h,t),Kg.w=1,Jg.w=1,Kg.applyMatrix4(ev),Jg.applyMatrix4(ev),Kg.z>f&&Jg.z>f)continue;if(Kg.z>f){const t=Kg.z-Jg.z,e=(Kg.z-f)/t;Kg.lerp(Jg,e)}else if(Jg.z>f){const t=Jg.z-Kg.z,e=(Jg.z-f)/t;Jg.lerp(Kg,e)}Kg.applyMatrix4(a),Jg.applyMatrix4(a),Kg.multiplyScalar(1/Kg.w),Jg.multiplyScalar(1/Jg.w),Kg.x*=l.x/2,Kg.y*=l.y/2,Jg.x*=l.x/2,Jg.y*=l.y/2,nv.start.copy(Kg),nv.start.z=0,nv.end.copy(Jg),nv.end.z=0;const n=nv.closestPointToPointParameter(tv,!0);nv.at(n,rv);const i=Xg.MathUtils.lerp(Kg.z,Jg.z,n),s=i>=-1&&i<=1,A=tv.distanceTo(rv)<.5*c;if(s&&A){nv.start.fromBufferAttribute(u,t),nv.end.fromBufferAttribute(h,t),nv.start.applyMatrix4(o),nv.end.applyMatrix4(o);const n=new Xg.Vector3,i=new Xg.Vector3;r.distanceSqToSegment(nv.start,nv.end,i,n),e.push({point:i,pointOnLine:n,distance:r.origin.distanceTo(i),object:this,face:null,faceIndex:t,uv:null,uv2:null})}}}}}sv.prototype.LineSegments2=!0;class Av extends jg{constructor(){super(),this.type="LineGeometry"}setPositions(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return super.setPositions(n),this}setColors(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return super.setColors(n),this}fromLine(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}}Av.prototype.isLineGeometry=!0;class lv extends sv{constructor(t=new Av,e=new Wg({color:16777215*Math.random()})){super(t,e),this.type="Line2"}}lv.prototype.isLine2=!0;class cv extends Ls{constructor(t,e={}){const n=e.font;if(void 0===n)super();else{const r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),super(r,e)}this.type="TextGeometry"}}function uv(t,e,n,r,i){const a=i.glyphs[t]||i.glyphs["?"];if(!a)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".");const o=new iA;let s,A,l,c,u,h,f,d;if(a.o){const t=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let i=0,a=t.length;i<a;){switch(t[i++]){case"m":s=t[i++]*e+n,A=t[i++]*e+r,o.moveTo(s,A);break;case"l":s=t[i++]*e+n,A=t[i++]*e+r,o.lineTo(s,A);break;case"q":l=t[i++]*e+n,c=t[i++]*e+r,u=t[i++]*e+n,h=t[i++]*e+r,o.quadraticCurveTo(u,h,l,c);break;case"b":l=t[i++]*e+n,c=t[i++]*e+r,u=t[i++]*e+n,h=t[i++]*e+r,f=t[i++]*e+n,d=t[i++]*e+r,o.bezierCurveTo(u,h,f,d,l,c)}}}return{offsetX:a.ha*e,path:o}}function hv(t,e,n){return e=bv(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ev(t)}(t,fv()?Reflect.construct(e,n||[],bv(t).constructor):e.apply(t,n))}function fv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(fv=function(){return!!t})()}function dv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dv(Object(n),!0).forEach((function(e){yv(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function mv(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function gv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mv(r.key),r)}}function _v(t,e,n){return e&&vv(t.prototype,e),n&&vv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function yv(t,e,n){return(e=mv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xv(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mv(t,e)}function bv(t){return bv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bv(t)}function Mv(t,e){return Mv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mv(t,e)}function wv(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Ev(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sv(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Cv(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tv(t){return function(t){if(Array.isArray(t))return Rv(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cv(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cv(t,e){if(t){if("string"==typeof t)return Rv(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rv(t,e):void 0}}function Rv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Pv(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Dv(t,e,"get"))}function Lv(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}(t,Dv(t,e,"set"),n),n}function Dv(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Ov(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Iv(t,e,n){Ov(t,e),e.set(t,n)}var qv=function t(e){e instanceof Array?e.forEach(t):(e.map&&e.map.dispose(),e.dispose())},Uv=function t(e){e.geometry&&e.geometry.dispose(),e.material&&qv(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(t)},Nv=function(t){if(t&&t.children)for(;t.children.length;){var e=t.children[0];t.remove(e),Uv(e)}};function Bv(t,e){var n=new e;return{linkProp:function(e){return{default:n[e](),onChange:function(n,r){r[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var r=n[t],i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=r[e].apply(r,a);return s===r?this:s}}}}var kv=100;function Fv(){return kv}function zv(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180,a=kv*(1+n);return{x:a*Math.sin(r)*Math.cos(i),y:a*Math.cos(r),z:a*Math.sin(r)*Math.sin(i)}}function Gv(t){var e=t.x,n=t.y,r=t.z,i=Math.sqrt(e*e+n*n+r*r),a=Math.acos(n/i),o=Math.atan2(r,e);return{lat:90-180*a/Math.PI,lng:90-180*o/Math.PI-(o<-Math.PI/2?360:0),altitude:i/kv-1}}function Hv(t){return t*Math.PI/180}var jv=window.THREE?window.THREE:{BackSide:g,BufferAttribute:Dn,Color:En,Mesh:sr,ShaderMaterial:dr},Vv="\nuniform vec3 color;\nuniform float coefficient;\nuniform float power;\nvarying vec3 vVertexNormal;\nvarying vec3 vVertexWorldPosition;\nvoid main() {\n  vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;\n  vec3 viewCameraToVertex\t= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;\n  viewCameraToVertex = normalize(viewCameraToVertex);\n  float intensity\t= pow(\n    coefficient + dot(vVertexNormal, viewCameraToVertex),\n    power\n  );\n  gl_FragColor = vec4(color, intensity);\n}",Wv="\nvarying vec3 vVertexWorldPosition;\nvarying vec3 vVertexNormal;\nvoid main() {\n  vVertexNormal\t= normalize(normalMatrix * normal);\n  vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n  gl_Position\t= projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",Xv={backside:!0,coefficient:.5,color:"gold",size:2,power:1};function Qv(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xv,n=e.backside,r=e.coefficient,i=e.color,a=e.size,o=e.power,s=function(t,e){for(var n=t.clone(),r=new Float32Array(3*t.attributes.position.count),i=0,a=r.length;i<a;i++){var o=t.attributes.normal.array[i],s=t.attributes.position.array[i];r[i]=s+o*e}return n.setAttribute("position",new jv.BufferAttribute(r,3)),n}(t,a),A=function(t,e,n){return new jv.ShaderMaterial({depthWrite:!1,fragmentShader:Vv,transparent:!0,uniforms:{coefficient:{value:t},color:{value:new jv.Color(e)},power:{value:n}},vertexShader:Wv})}(r,i,o);return n&&(A.side=jv.BackSide),new jv.Mesh(s,A)}var Yv=window.THREE?window.THREE:{Color:En,LineBasicMaterial:Eo,LineSegments:Io,Mesh:sr,MeshPhongMaterial:class extends Cn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new En(16777215),this.specular=new En(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new En(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ve,this.combine=_,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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},SphereGeometry:Os,SRGBColorSpace:rt,TextureLoader:Gs},Zv=jA({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(t,e){e.globeObj.visible=!!t},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(t,e){e.graticulesObj.visible=!!t},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(t,e){e.atmosphereObj&&(e.atmosphereObj.visible=!!t)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(t,e){return void 0!==e?(t.globeObj.material=e||t.defaultGlobeMaterial,this):t.globeObj.material},_destructor:function(t){Nv(t.globeObj),Nv(t.graticulesObj)}},stateInit:function(){var t=new Yv.SphereGeometry(kv,75,75),e=new Yv.MeshPhongMaterial({color:0}),n=new Yv.Mesh(t,e);return n.rotation.y=-Math.PI/2,n.__globeObjType="globe",{globeObj:n,graticulesObj:new Yv.LineSegments(new $h(xh(),kv,2),new Yv.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1})),defaultGlobeMaterial:e}},init:function(t,e){Nv(t),e.scene=t,e.scene.add(e.globeObj),e.scene.add(e.graticulesObj),e.ready=!1},update:function(t,e){var n=t.globeObj.material;if(e.hasOwnProperty("globeImageUrl")&&(t.globeImageUrl?(new Yv.TextureLoader).load(t.globeImageUrl,(function(e){e.colorSpace=Yv.SRGBColorSpace,n.map=e,n.color=null,n.needsUpdate=!0,!t.ready&&(t.ready=!0)&&setTimeout(t.onReady)})):!n.color&&(n.color=new Yv.Color(0))),e.hasOwnProperty("bumpImageUrl")&&(t.bumpImageUrl?t.bumpImageUrl&&(new Yv.TextureLoader).load(t.bumpImageUrl,(function(t){n.bumpMap=t,n.needsUpdate=!0})):(n.bumpMap=null,n.needsUpdate=!0)),(e.hasOwnProperty("atmosphereColor")||e.hasOwnProperty("atmosphereAltitude"))&&(t.atmosphereObj&&(t.scene.remove(t.atmosphereObj),Nv(t.atmosphereObj)),t.atmosphereColor&&t.atmosphereAltitude)){var r=t.atmosphereObj=Qv(t.globeObj.geometry,{backside:!0,color:t.atmosphereColor,size:kv*t.atmosphereAltitude,power:3.5,coefficient:.1});r.visible=!!t.showAtmosphere,r.__globeObjType="atmosphere",t.scene.add(r)}t.ready||t.globeImageUrl||(t.ready=!0,t.onReady())}}),Kv=function(t){return isNaN(t)?parseInt(Vf(t).toHex(),16):t},Jv=function(t){return t&&isNaN(t)?Sf(t).opacity:1},$v=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=1,a=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(t.trim().toLowerCase());if(a){var o=Sv(a.slice(1),4),s=o[0],A=o[1],l=o[2],c=o[3];e=new En("rgb(".concat(+s,",").concat(+A,",").concat(+l,")")),i=Math.min(+c,1)}else e=new En(t);r&&e.convertLinearToSRGB();var u=e.toArray();return n?[].concat(Tv(u),[i]):u};var t_=window.THREE?window.THREE:{Float32BufferAttribute:qn};function e_(t,e){var n=new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:t_.Float32BufferAttribute)(t.length*e,e);return 1===e?t.forEach((function(t,e){return n.setX(e,t)})):t.forEach((function(t,r){return n.set(t,r*e)})),n}function n_(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).removeDelay,i=void 0===r?0:r;return kd(t,e.children,(function(t){return e.add(t)}),(function(t){var n=function(){e.remove(t),Nv(t),t&&t.hasOwnProperty("__data")&&delete t.__data.__currentTargetD};i?setTimeout(n,i):n()}),pv({objBindAttr:"__threeObj"},n))}var r_=window.THREE?window.THREE:{BufferGeometry:Hn,Color:En,CylinderGeometry:es,Matrix4:qe,Mesh:sr,MeshLambertMaterial:Us,Object3D:ln,Vector3:ae},i_=Object.assign({},of),a_=i_.BufferGeometryUtils||i_,o_=jA({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return"#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.pointLat),n=sf(t.pointLng),r=sf(t.pointAltitude),i=sf(t.pointRadius),a=sf(t.pointColor),o=new r_.CylinderGeometry(1,1,1,t.pointResolution);o.applyMatrix4((new r_.Matrix4).makeRotationX(Math.PI/2)),o.applyMatrix4((new r_.Matrix4).makeTranslation(0,0,-.5));var s=2*Math.PI*kv/360,A={},l=t.pointsMerge?new r_.Object3D:t.scene;if(n_(t.pointsData,l,{createObj:function(){var t=new r_.Mesh(o);return t.__globeObjType="point",t},updateObj:function(o,l){var c=function(e){var n=o.__currentTargetD=e,r=n.r,i=n.alt,a=n.lat,A=n.lng;Object.assign(o.position,zv(a,A));var l=t.pointsMerge?new r_.Vector3(0,0,0):t.scene.localToWorld(new r_.Vector3(0,0,0));o.lookAt(l),o.scale.x=o.scale.y=Math.min(30,r)*s,o.scale.z=Math.max(i*kv,.1)},u={alt:+r(l),r:+i(l),lat:+e(l),lng:+n(l)},h=o.__currentTargetD||Object.assign({},u,{alt:-.001});Object.keys(u).some((function(t){return h[t]!==u[t]}))&&(t.pointsMerge||!t.pointsTransitionDuration||t.pointsTransitionDuration<0?c(u):new JA(h).to(u,t.pointsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(c).start());if(!t.pointsMerge){var f=a(l),d=f?Jv(f):0,p=!!d;o.visible=p,p&&(A.hasOwnProperty(f)||(A[f]=new r_.MeshLambertMaterial({color:Kv(f),transparent:d<1,opacity:d})),o.material=A[f])}}}),t.pointsMerge){var c=t.pointsData.length?(a_.mergeGeometries||a_.mergeBufferGeometries)(t.pointsData.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.clone();e.updateMatrix(),n.applyMatrix4(e.matrix);var r=$v(a(t));return n.setAttribute("color",e_(Tv(new Array(n.getAttribute("position").count)).map((function(){return r})),4)),n}))):new r_.BufferGeometry,u=new r_.Mesh(c,new r_.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));u.__globeObjType="points",u.__data=t.pointsData,Nv(t.scene),t.scene.add(u)}}}),s_=["stroke"],A_=window.THREE?window.THREE:{BufferGeometry:Hn,CubicBezierCurve3:Wo,Curve:qo,Group:co,Line:Lo,Mesh:sr,NormalBlending:1,QuadraticBezierCurve3:Yo,ShaderMaterial:dr,TubeGeometry:Is,Vector3:ae},l_=zd.default||zd,c_={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n    uniform float dashTranslate; \n\n    attribute vec4 vertexColor;\n    varying vec4 vColor;\n    \n    attribute float vertexRelDistance;\n    varying float vRelDistance;\n\n    void main() {\n      // pass through colors and distances\n      vColor = vertexColor;\n      vRelDistance = vertexRelDistance + dashTranslate;\n      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n    }\n  ",fragmentShader:"\n    uniform float dashOffset; \n    uniform float dashSize;\n    uniform float gapSize; \n    \n    varying vec4 vColor;\n    varying float vRelDistance;\n    \n    void main() {\n      // ignore pixels in the gap\n      if (vRelDistance < dashOffset) discard;\n      if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n    \n      // set px color: [r, g, b, a], interpolated between vertices \n      gl_FragColor = vColor; \n    }\n  "},u_=jA({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:function(){return"#ffffaa"}},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e){Nv(t),e.scene=t,e.ticker=new l_,e.ticker.onTick.add((function(t,n){e.arcsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],r=e.__dashAnimateStep*n,i=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=i+r}))}))},update:function(t){var e=sf(t.arcStartLat),n=sf(t.arcStartLng),r=sf(t.arcEndLat),i=sf(t.arcEndLng),a=sf(t.arcAltitude),o=sf(t.arcAltitudeAutoScale),s=sf(t.arcStroke),A=sf(t.arcColor),l=sf(t.arcDashLength),c=sf(t.arcDashGap),u=sf(t.arcDashInitialGap),h=sf(t.arcDashAnimateTime),f=new A_.ShaderMaterial(pv(pv({},c_),{},{transparent:!0,blending:A_.NormalBlending}));n_(t.arcsData,t.scene,{createObj:function(){var t=new A_.Group;return t.__globeObjType="arc",t},updateObj:function(d,p){var m=s(p),g=null!=m;if(!d.children.length||g!==("Mesh"===d.children[0].type)){Nv(d);var v=g?new A_.Mesh:new A_.Line(new A_.BufferGeometry);v.material=f.clone(),d.add(v)}var _=d.children[0];Object.assign(_.material.uniforms,{dashSize:{value:l(p)},gapSize:{value:c(p)},dashOffset:{value:u(p)}});var y=h(p);_.__dashAnimateStep=y>0?1e3/y:0;var x=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e+1;if(t instanceof Array||t instanceof Function){var a=t instanceof Array?Rp().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return $v(a(t),!0,!0)}}else{var o=$v(t,!0,!0);n=function(){return o}}for(var s=[],A=0,l=i;A<l;A++)for(var c=n(A/(l-1)),u=0;u<r;u++)s.push(c);return e_(s,4)}(A(p),t.arcCurveResolution,g?t.arcCircularResolution+1:1),b=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,a=t+1;i<a;i++)for(var o=i/(a-1),s=0;s<e;s++)r.push(o);return n&&r.reverse(),e_(r,1)}(t.arcCurveResolution,g?t.arcCircularResolution+1:1,!0);_.geometry.setAttribute("vertexColor",x),_.geometry.setAttribute("vertexRelDistance",b);var M=function(e){var n=p.__currentTargetD=e,r=n.stroke,i=function(t){var e=t.alt,n=t.altAutoScale,r=t.startLat,i=t.startLng,a=t.endLat,o=t.endLng,s=function(t){var e=Sv(t,3),n=e[0],r=zv(e[1],n,e[2]),i=r.x,a=r.y,o=r.z;return new A_.Vector3(i,a,o)},A=[i,r],l=[o,a],c=e;if(null==c&&(c=ch(A,l)/2*n),c){var u=bh(A,l),h=Sv([.25,.75].map((function(t){return[].concat(Tv(u(t)),[1.5*c])})),2),f=h[0],d=h[1],p=function(t,e,n){if(fv())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Mv(i,n.prototype),i}(A_.CubicBezierCurve3,Tv([A,f,d,l].map(s)));return p}var m=.001;return g.apply(void 0,Tv([[].concat(A,[m]),[].concat(l,[m])].map(s)));function g(t,e){var n=t.angleTo(e),r=0===n?function(){return t.clone()}:function(r){return(new A_.Vector3).addVectors(t.clone().multiplyScalar(Math.sin((1-r)*n)),e.clone().multiplyScalar(Math.sin(r*n))).divideScalar(Math.sin(n))},i=new A_.Curve;return i.getPoint=r,i}}(wv(n,s_));g?(_.geometry&&_.geometry.dispose(),_.geometry=new A_.TubeGeometry(i,t.arcCurveResolution,r/2,t.arcCircularResolution),_.geometry.setAttribute("vertexColor",x),_.geometry.setAttribute("vertexRelDistance",b)):_.geometry.setFromPoints(i.getPoints(t.arcCurveResolution))},w={stroke:m,alt:a(p),altAutoScale:+o(p),startLat:+e(p),startLng:+n(p),endLat:+r(p),endLng:+i(p)},E=p.__currentTargetD||Object.assign({},w,{altAutoScale:-.001});Object.keys(w).some((function(t){return E[t]!==w[t]}))&&(!t.arcsTransitionDuration||t.arcsTransitionDuration<0?M(w):new JA(E).to(w,t.arcsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(M).start())}})}}),h_=window.THREE?window.THREE:{BufferGeometry:Hn,Color:En,DoubleSide:2,Mesh:sr,MeshLambertMaterial:Us,Object3D:ln},f_=Object.assign({},of),d_=f_.BufferGeometryUtils||f_,p_=jA({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1},hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return"#ffffaa"}},hexSideColor:{default:function(){return"#ffffaa"}},hexAltitude:{default:function(t){return.01*t.sumWeight}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.hexBinPointLat),n=sf(t.hexBinPointLng),r=sf(t.hexBinPointWeight),i=sf(t.hexAltitude),a=sf(t.hexTopColor),o=sf(t.hexSideColor),s=sf(t.hexMargin),A=Rd(t.hexBinPointsData.map((function(r){return pv(pv({},r),{},{h3Idx:Mg(e(r),n(r),t.hexBinResolution)})})),"h3Idx"),l=Object.entries(A).map((function(t){var e=Sv(t,2),n=e[0],i=e[1];return{h3Idx:n,points:i,sumWeight:i.reduce((function(t,e){return t+ +r(e)}),0)}})),c={};if(n_(l,t.hexBinMerge?new h_.Object3D:t.scene,{createObj:function(t){var e=new h_.Mesh;e.__hexCenter=wg(t.h3Idx),e.__hexGeoJson=Eg(t.h3Idx,!0).reverse();var n=e.__hexCenter[1];return e.__hexGeoJson.forEach((function(t){var e=t[0];Math.abs(n-e)>170&&(t[0]+=n>e?360:-360)})),e.__globeObjType="hexbin",e},updateObj:function(e,n){var r=Math.max(0,Math.min(1,+s(n))),A=Sv(e.__hexCenter,2),l=A[0],u=A[1],h=0===r?e.__hexGeoJson:e.__hexGeoJson.map((function(t){var e=Sv(t,2),n=e[0],i=e[1];return[[n,u],[i,l]].map((function(t){var e=Sv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],r)}))})),f=t.hexTopCurvatureResolution;e.geometry&&e.geometry.dispose(),e.geometry=new jm([h],0,kv,!1,!0,!0,f);var d={alt:+i(n)},p=function(t){var n=(e.__currentTargetD=t).alt;e.scale.x=e.scale.y=e.scale.z=1+n},m=e.__currentTargetD||Object.assign({},d,{alt:-.001});Object.keys(d).some((function(t){return m[t]!==d[t]}))&&(t.hexBinMerge||!t.hexTransitionDuration||t.hexTransitionDuration<0?p(d):new JA(m).to(d,t.hexTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(p).start());if(!t.hexBinMerge){var g=o(n),v=a(n);[g,v].forEach((function(t){if(!c.hasOwnProperty(t)){var e=Jv(t);c[t]=new h_.MeshLambertMaterial({color:Kv(t),transparent:e<1,opacity:e,side:h_.DoubleSide})}})),e.material=[g,v].map((function(t){return c[t]}))}},idAccessor:function(t){return t.h3Idx}}),t.hexBinMerge){var u=l.length?(d_.mergeGeometries||d_.mergeBufferGeometries)(l.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.toNonIndexed();e.updateMatrix(),n.applyMatrix4(e.matrix);var r=$v(a(t)),i=$v(o(t)),s=n.getAttribute("position").count,A=n.groups[0].count;return n.setAttribute("color",e_(Tv(new Array(s)).map((function(t,e){return e>=A?r:i})),4)),n}))):new h_.BufferGeometry,h=new h_.Mesh(u,new h_.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:h_.DoubleSide}));h.__globeObjType="hexBinPoints",h.__data=l,Nv(t.scene),t.scene.add(h)}}}),m_=function(t){return t*t};var g_=Math.sqrt(2*Math.PI);var v_=function(t){var e=Sv(t,2),n=e[0],r=e[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=a.lngAccessor,s=void 0===o?function(t){return t[0]}:o,A=a.latAccessor,l=void 0===A?function(t){return t[1]}:A,c=a.weightAccessor,u=void 0===c?function(){return 1}:c,h=a.bandwidth,f=[n,r],d=h*Math.PI/180;return function(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}(i.map((function(t){var e=u(t);if(!e)return 0;var n,r,i=function(t,e){var n=Math.sqrt,r=Math.cos,i=function(t){return t*Math.PI/180},a=function(t){return m_(Math.sin(t/2))},o=i(t[1]),s=i(e[1]),A=i(t[0]),l=i(e[0]);return 2*Math.asin(n(a(s-o)+r(o)*r(s)*a(l-A)))}(f,[s(t),l(t)]);return n=i,r=d,Math.exp(-m_(n/r)/2)/(r*g_)*e})))},__=window.THREE?window.THREE:{Mesh:sr,MeshLambertMaterial:Us,SphereGeometry:Os},y_=new WeakSet,x_=new WeakMap,b_=new WeakMap,M_=new WeakMap,w_=function(){function t(e,n){var r,i;gv(this,t),Ov(r=this,i=y_),i.add(r),Iv(this,x_,{writable:!0,value:void 0}),Iv(this,b_,{writable:!0,value:void 0}),Iv(this,M_,{writable:!0,value:void 0}),Lv(this,x_,e),Lv(this,b_,kg()),Pv(this,b_).init(e.map((function(t){return[t.x,t.y,t.z]})).flat()),Lv(this,M_,function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,y_,E_).call(this,zv(0,0),zv(0,Math.min(180,n))))}return _v(t,[{key:"getNearPoints",value:function(t,e,n){var r=this;return Pv(this,b_).intersectSphere(t,e,n,Pv(this,M_)).map((function(t){return Pv(r,x_)[t/3]}))}}]),t}();function E_(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)+Math.pow(t.z-e.z,2))}var S_=function(t){var e=Sf(function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}(t));return e.opacity=Math.cbrt(t),e.formatRgb()},T_=jA({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(t){return t}},heatmapPointLat:{default:function(t){return t[0]}},heatmapPointLng:{default:function(t){return t[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:4},heatmapColorFn:{default:function(){return S_}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.heatmapPoints),n=sf(t.heatmapPointLat),r=sf(t.heatmapPointLng),i=sf(t.heatmapPointWeight),a=sf(t.heatmapBandwidth),o=sf(t.heatmapColorFn),s=sf(t.heatmapColorSaturation),A=sf(t.heatmapBaseAltitude),l=sf(t.heatmapTopAltitude);n_(t.heatmapsData,t.scene,{createObj:function(t){var e=new __.Mesh(new __.SphereGeometry(kv),new __.MeshLambertMaterial({vertexColors:!0,transparent:!0}));return e.__globeObjType="heatmap",e},updateObj:function(c,u){var h=a(u),f=o(u),d=s(u),p=A(u),m=l(u),g=e(u).map((function(t){var e=n(t),a=r(t),o=zv(e,a);return{x:o.x,y:o.y,z:o.z,lat:e,lng:a,weight:i(t)}})),v=Math.max(.1,h/3.5),_=Math.ceil(360/(v||-1));c.geometry.parameters.widthSegments!==_&&(c.geometry.dispose(),c.geometry=new __.SphereGeometry(kv,_,_/2));var y=function(t){for(var e=t.itemSize,n=[],r=0;r<t.count;r++)n.push(t.array.slice(r*e,(r+1)*e));return n}(c.geometry.getAttribute("position")),x=y.map((function(t){var e=Sv(t,3),n=Gv({x:e[0],y:e[1],z:e[2]});return[n.lng,n.lat]})),b=new w_(g,3.5*h),M=x.map((function(t,e){var n=Sv(y[e],3),r=n[0],i=n[1],a=n[2];return v_(t,b.getNearPoints(r,i,a),{latAccessor:function(t){return t.lat},lngAccessor:function(t){return t.lng},weightAccessor:function(t){return t.weight},bandwidth:h})})),w=function(t){var e=c.__currentTargetD=t,n=e.kdeVals,r=e.topAlt,i=e.saturation,a=function(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}(n.map(Math.abs))||1e-15;c.geometry.setAttribute("color",e_(n.map((function(t){return $v(f(t/a*i))})),4));var o=Rp([0,a],[p,r||p]);c.geometry.setAttribute("position",e_(n.map((function(t,e){var n=Sv(x[e],2),r=n[0],i=zv(n[1],r,o(Math.abs(t)));return[i.x,i.y,i.z]})),3))},E={kdeVals:M,topAlt:m,saturation:d},S=c.__currentTargetD||Object.assign({},E,{kdeVals:M.map((function(){return 0})),topAlt:m?p:m,saturation:.5});S.kdeVals.length!==M.length&&(S.kdeVals=M.slice()),Object.keys(E).some((function(t){return S[t]!==E[t]}))&&(!t.heatmapsTransitionDuration||t.heatmapsTransitionDuration<0?w(E):new JA(S).to(E,t.heatmapsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(w).start())}})}}),C_=window.THREE?window.THREE:{DoubleSide:2,Group:co,LineBasicMaterial:Eo,LineSegments:Io,Mesh:sr,MeshBasicMaterial:Rn},R_=jA({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return"#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return"#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.polygonGeoJsonGeometry),n=sf(t.polygonAltitude),r=sf(t.polygonCapCurvatureResolution),i=sf(t.polygonCapColor),a=sf(t.polygonCapMaterial),o=sf(t.polygonSideColor),s=sf(t.polygonSideMaterial),A=sf(t.polygonStrokeColor),l=[];t.polygonsData.forEach((function(t){var c={data:t,capColor:i(t),capMaterial:a(t),sideColor:o(t),sideMaterial:s(t),strokeColor:A(t),altitude:+n(t),capCurvatureResolution:+r(t)},u=e(t),h=t.__id||"".concat(Math.round(1e9*Math.random()));t.__id=h,"Polygon"===u.type?l.push(pv({id:"".concat(h,"_0"),coords:u.coordinates},c)):"MultiPolygon"===u.type?l.push.apply(l,Tv(u.coordinates.map((function(t,e){return pv({id:"".concat(h,"_").concat(e),coords:t},c)})))):console.warn("Unsupported GeoJson geometry type: ".concat(u.type,". Skipping geometry..."))})),n_(l,t.scene,{idAccessor:function(t){return t.id},createObj:function(){var t=new C_.Group;return t.__defaultSideMaterial=new C_.MeshBasicMaterial({side:C_.DoubleSide,depthWrite:!0}),t.__defaultCapMaterial=new C_.MeshBasicMaterial({side:C_.DoubleSide,depthWrite:!0}),t.add(new C_.Mesh(void 0,[t.__defaultSideMaterial,t.__defaultCapMaterial])),t.add(new C_.LineSegments(void 0,new C_.LineBasicMaterial)),t.__globeObjType="polygon",t},updateObj:function(e,n){var r=n.coords,i=n.capColor,a=n.capMaterial,o=n.sideColor,s=n.sideMaterial,A=n.strokeColor,l=n.altitude,c=n.capCurvatureResolution,u=Sv(e.children,2),h=u[0],f=u[1],d=!!A;if(f.visible=d,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return function(t,e){return t===e}};return Object.entries(e).every((function(e){var r=Sv(e,2),i=r[0],a=r[1];return t.hasOwnProperty(i)&&n(i)(t[i],a)}))}(h.geometry.parameters||{},{polygonGeoJson:r,curvatureResolution:c})||(h.geometry&&h.geometry.dispose(),h.geometry=new jm(r,0,kv,!1,!0,!0,c)),!d||f.geometry.parameters&&f.geometry.parameters.geoJson.coordinates===r&&f.geometry.parameters.resolution===c||(f.geometry&&f.geometry.dispose(),f.geometry=new $h({type:"Polygon",coordinates:r},kv,c)),h.material[0]=s||e.__defaultSideMaterial,h.material[1]=a||e.__defaultCapMaterial,[!s&&o,!a&&i].forEach((function(t,e){if(t){var n=h.material[e],r=Jv(t);n.color.set(Kv(t)),n.transparent=r<1,n.opacity=r}})),d){var p=f.material,m=Jv(A);p.color.set(Kv(A)),p.transparent=m<1,p.opacity=m}var g={alt:l},v=function(t){var n=(e.__currentTargetD=t).alt;h.scale.x=h.scale.y=h.scale.z=1+n,d&&(f.scale.x=f.scale.y=f.scale.z=1+n+1e-4)},_=e.__currentTargetD||Object.assign({},g,{alt:-.001});Object.keys(g).some((function(t){return _[t]!==g[t]}))&&(!t.polygonsTransitionDuration||t.polygonsTransitionDuration<0||_.alt===g.alt?v(g):new JA(_).to(g,t.polygonsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(v).start())}})}});var P_=window.THREE?window.THREE:{BufferGeometry:Hn,CircleGeometry:ts,DoubleSide:2,Mesh:sr,MeshLambertMaterial:Us,Vector3:ae},L_=Object.assign({},of),D_=L_.BufferGeometryUtils||L_,O_=jA({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.hexPolygonGeoJsonGeometry),n=sf(t.hexPolygonColor),r=sf(t.hexPolygonAltitude),i=sf(t.hexPolygonResolution),a=sf(t.hexPolygonMargin),o=sf(t.hexPolygonUseDots),s=sf(t.hexPolygonCurvatureResolution),A=sf(t.hexPolygonDotResolution);n_(t.hexPolygonsData,t.scene,{createObj:function(t){var e=new P_.Mesh(void 0,new P_.MeshLambertMaterial({side:P_.DoubleSide}));return e.__globeObjType="hexPolygon",e},updateObj:function(l,c){var u=e(c),h=i(c),f=r(c),d=Math.max(0,Math.min(1,+a(c))),p=o(c),m=s(c),g=A(c),v=n(c),_=Jv(v);l.material.color.set(Kv(v)),l.material.transparent=_<1,l.material.opacity=_;var y={alt:f,margin:d,curvatureResolution:m},x={geoJson:u,h3Res:h},b=l.__currentTargetD||Object.assign({},y,{alt:-.001}),M=l.__currentMemD||x;if(Object.keys(y).some((function(t){return b[t]!==y[t]}))||Object.keys(x).some((function(t){return M[t]!==x[t]}))){l.__currentMemD=x;var w=[];"Polygon"===u.type?Sg(u.coordinates,h,!0).forEach((function(t){return w.push(t)})):"MultiPolygon"===u.type?u.coordinates.forEach((function(t){return Sg(t,h,!0).forEach((function(t){return w.push(t)}))})):console.warn("Unsupported GeoJson geometry type: ".concat(u.type,". Skipping geometry..."));var E=w.map((function(t){var e=wg(t),n=Eg(t,!0).reverse(),r=e[1];return n.forEach((function(t){var e=t[0];Math.abs(r-e)>170&&(t[0]+=r>e?360:-360)})),{h3Idx:t,hexCenter:e,hexGeoJson:n}})),S=function(t){var e=l.__currentTargetD=t,n=e.alt,r=e.margin,i=e.curvatureResolution;l.geometry&&l.geometry.dispose(),l.geometry=E.length?(D_.mergeGeometries||D_.mergeBufferGeometries)(E.map((function(t){var e=Sv(t.hexCenter,2),a=e[0],o=e[1];if(p){var s=zv(a,o,n),A=zv(t.hexGeoJson[0][1],t.hexGeoJson[0][0],n),l=.85*(1-r)*new P_.Vector3(s.x,s.y,s.z).distanceTo(new P_.Vector3(A.x,A.y,A.z)),c=new ts(l,g);return c.rotateX(Hv(-a)),c.rotateY(Hv(o)),c.translate(s.x,s.y,s.z),c}var u=0===r?t.hexGeoJson:t.hexGeoJson.map((function(t){var e=Sv(t,2),n=e[0],i=e[1];return[[n,o],[i,a]].map((function(t){var e=Sv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],r)}))}));return new jm([u],kv,kv*(1+n),!1,!0,!1,i)}))):new P_.BufferGeometry};!t.hexPolygonsTransitionDuration||t.hexPolygonsTransitionDuration<0?S(y):new JA(b).to(y,t.hexPolygonsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(S).start()}}})}}),I_=window.THREE?window.THREE:{Vector3:ae};function q_(t,e){var n=Math.max(t.length,e.length),r=Yd.apply(void 0,Tv([t,e].map((function(t){return t.map((function(t){return[t.x,t.y,t.z]}))})).map((function(t){return function(t,e){var n=t[t.length-1];return[].concat(Tv(t),Tv(Tv(new Array(e-t.length)).map((function(){return n}))))}(t,n)}))));return function(n){return 0===n?t:1===n?e:r(n).map((function(t){var e=Sv(t,3),n=e[0],r=e[1],i=e[2];return new I_.Vector3(n,r,i)}))}}var U_=window.THREE?window.THREE:{BufferGeometry:Hn,Color:En,Group:co,Line:Lo,NormalBlending:1,ShaderMaterial:dr,Vector3:ae},N_=zd.default||zd,B_={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n    uniform float dashTranslate;\n\n    attribute vec4 vertexColor;\n    varying vec4 vColor;\n\n    attribute float vertexRelDistance;\n    varying float vRelDistance;\n\n    void main() {\n      // pass through colors and distances\n      vColor = vertexColor;\n      vRelDistance = vertexRelDistance + dashTranslate;\n      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n    }\n  ",fragmentShader:"\n    uniform float dashOffset;\n    uniform float dashSize;\n    uniform float gapSize;\n\n    varying vec4 vColor;\n    varying float vRelDistance;\n\n    void main() {\n      // ignore pixels in the gap\n      if (vRelDistance < dashOffset) discard;\n      if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n\n      // set px color: [r, g, b, a], interpolated between vertices\n      gl_FragColor = vColor;\n    }\n  "},k_=jA({props:{pathsData:{default:[]},pathPoints:{default:function(t){return t}},pathPointLat:{default:function(t){return t[0]}},pathPointLng:{default:function(t){return t[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return"#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e){Nv(t),e.scene=t,e.ticker=new N_,e.ticker.onTick.add((function(t,n){e.pathsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],r=e.__dashAnimateStep*n;if("Line"===e.type){var i=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=i+r}else if("Line2"===e.type){for(var a=e.material.dashOffset-r,o=e.material.dashSize+e.material.gapSize;a<=-o;)a+=o;e.material.dashOffset=a}}))}))},update:function(t){var e=sf(t.pathPoints),n=sf(t.pathPointLat),r=sf(t.pathPointLng),i=sf(t.pathPointAlt),a=sf(t.pathStroke),o=sf(t.pathColor),s=sf(t.pathDashLength),A=sf(t.pathDashGap),l=sf(t.pathDashInitialGap),c=sf(t.pathDashAnimateTime),u=new U_.ShaderMaterial(pv(pv({},B_),{},{transparent:!0,blending:U_.NormalBlending}));function h(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=e+1;if(t instanceof Array||t instanceof Function){var o=t instanceof Array?Rp().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return $v(o(t),i,!0)}}else{var s=$v(t,i,!0);n=function(){return s}}for(var A=[],l=0,c=a;l<c;l++)for(var u=n(l/(c-1)),h=0;h<r;h++)A.push(u);return e_(A,i?4:3)}n_(t.pathsData,t.scene,{createObj:function(){var t=new U_.Group;return t.__globeObjType="path",t},updateObj:function(f,d){var p=a(d),m=null!=p;if(!f.children.length||m===("Line"===f.children[0].type)){Nv(f);var g=m?new lv(new Av,new Wg):new U_.Line(new U_.BufferGeometry,u.clone());f.add(g)}var v,_,y=f.children[0],x=function(t,e,n,r,i){var a=function(t,e,n){for(var r=[],i=1;i<=n;i++)r.push(t+(e-t)*i/(n+1));return r},o=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){for(;Math.abs(n[1]-r[1])>180;)n[1]+=360*(n[1]<r[1]?1:-1);var i=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2));if(i>t)for(var o=Math.floor(i/t),s=a(n[0],r[0],o),A=a(n[1],r[1],o),l=a(n[2],r[2],o),c=0,u=s.length;c<u;c++)e.push([s[c],A[c],l[c]])}e.push(n=r)})),e},s=function(t){var e=Sv(t,3),n=zv(e[0],e[1],e[2]),r=n.x,i=n.y,a=n.z;return new U_.Vector3(r,i,a)};return o(t.map((function(t){return[e(t),n(t),r(t)]})),i).map(s)}(e(d),n,r,i,t.pathResolution),b=c(d);if(y.__dashAnimateStep=b>0?1e3/b:0,m){y.material.resolution=t.rendererSize;var M=s(d),w=A(d),E=l(d);y.material.dashed=w>0,y.material.dashed?y.material.defines.USE_DASH="":delete y.material.defines.USE_DASH,y.material.dashed&&(y.material.dashScale=1/(_=0,x.forEach((function(t){v&&(_+=v.distanceTo(t)),v=t})),_),y.material.dashSize=M,y.material.gapSize=w,y.material.dashOffset=-E);var S=o(d);if(S instanceof Array){var T=h(o(d),x.length-1,1,!1);y.geometry.setColors(T.array),y.material.vertexColors=!0}else{var C=S,R=Jv(C);y.material.color=new U_.Color(Kv(C)),y.material.transparent=R<1,y.material.opacity=R,y.material.vertexColors=!1}y.material.needsUpdate=!0}else{Object.assign(y.material.uniforms,{dashSize:{value:s(d)},gapSize:{value:A(d)},dashOffset:{value:l(d)}});var P=h(o(d),x.length),L=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,a=t+1;i<a;i++)for(var o=i/(a-1),s=0;s<e;s++)r.push(o);return n&&r.reverse(),e_(r,1)}(x.length,1,!0);y.geometry.setAttribute("vertexColor",P),y.geometry.setAttribute("vertexRelDistance",L)}var D=q_(d.__currentTargetD&&d.__currentTargetD.points||[x[0]],x),O=function(t){var e,n=d.__currentTargetD=t,r=n.stroke,i=n.interpolK,a=d.__currentTargetD.points=D(i);m?(y.geometry.setPositions((e=[]).concat.apply(e,Tv(a.map((function(t){return[t.x,t.y,t.z]}))))),y.material.linewidth=r,y.material.dashed&&y.computeLineDistances()):(y.geometry.setFromPoints(a),y.geometry.computeBoundingSphere())},I={stroke:p,interpolK:1},q=Object.assign({},d.__currentTargetD||I,{interpolK:0});Object.keys(I).some((function(t){return q[t]!==I[t]}))&&(!t.pathTransitionDuration||t.pathTransitionDuration<0?O(I):new JA(q).to(I,t.pathTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(O).start())}})}}),F_=window.THREE?window.THREE:{Euler:Ve,Mesh:sr,MeshLambertMaterial:Us,SphereGeometry:Os},z_=jA({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new F_.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.tileLat),n=sf(t.tileLng),r=sf(t.tileAltitude),i=sf(t.tileWidth),a=sf(t.tileHeight),o=sf(t.tileUseGlobeProjection),s=sf(t.tileMaterial),A=sf(t.tileCurvatureResolution);n_(t.tilesData,t.scene,{createObj:function(){var t=new F_.Mesh;return t.__globeObjType="tile",t},updateObj:function(l,c){l.material=s(c);var u=o(c),h=A(c),f=function(t){var e=l.__currentTargetD=t,n=e.lat,r=e.lng,i=e.alt,a=e.width,o=e.height,s=G_(r),A=G_(-n);l.geometry&&l.geometry.dispose(),l.geometry=new F_.SphereGeometry(kv*(1+i),Math.ceil(a/(h||-1)),Math.ceil(o/(h||-1)),G_(90-a/2)+(u?s:0),G_(a),G_(90-o/2)+(u?A:0),G_(o)),u||l.setRotationFromEuler(new F_.Euler(A,s,0,"YXZ"))},d={lat:+e(c),lng:+n(c),alt:+r(c),width:+i(c),height:+a(c)},p=l.__currentTargetD||Object.assign({},d,{width:0,height:0});Object.keys(d).some((function(t){return p[t]!==d[t]}))&&(!t.tilesTransitionDuration||t.tilesTransitionDuration<0?f(d):new JA(p).to(d,t.tilesTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(f).start())}})}}),G_=function(t){return t*Math.PI/180},H_={glyphs:{0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Π":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"ΐ":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"–":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Κ":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"ƒ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"ό":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"ώ":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Ι":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Ύ":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"’":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Ν":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"ς":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Ά":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Δ":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"ρ":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Η":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"Α":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Μ":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Ό":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ή":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"­":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Ξ":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Ί":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Β":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"υ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"χ":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Ζ":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"‹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"έ":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"ω":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"ϋ":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"ύ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Θ":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 280 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Ε":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"σ":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Ο":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Γ":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Έ":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ώ":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"›":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"τ":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Λ":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Υ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"φ":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"ϊ":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"π":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"ψ":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},cssFontWeight:"normal",ascender:1189,underlinePosition:-100,cssFontStyle:"normal",boundingBox:{yMin:-334,xMin:-111,yMax:1189,xMax:1672},resolution:1e3,original_font_information:{postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50},j_=pv(pv({},window.THREE?window.THREE:{CircleGeometry:ts,DoubleSide:2,Group:co,Mesh:sr,MeshLambertMaterial:Us,TextGeometry:cv,Vector3:ae}),{},{Font:class{constructor(t){this.isFont=!0,this.type="Font",this.data=t}generateShapes(t,e=100){const n=[],r=function(t,e,n){const r=Array.from(t),i=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[];let s=0,A=0;for(let t=0;t<r.length;t++){const e=r[t];if("\n"===e)s=0,A-=a;else{const t=uv(e,i,s,A,n);s+=t.offsetX,o.push(t.path)}}return o}(t,e,this.data);for(let t=0,e=r.length;t<e;t++)n.push(...r[t].toShapes());return n}},TextGeometry:cv}),V_=jA({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:0},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:H_,onChange:function(t,e){e.font=new j_.Font(t)}},labelColor:{default:function(){return"lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return"bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.labelLat),n=sf(t.labelLng),r=sf(t.labelAltitude),i=sf(t.labelText),a=sf(t.labelSize),o=sf(t.labelRotation),s=sf(t.labelColor),A=sf(t.labelIncludeDot),l=sf(t.labelDotRadius),c=sf(t.labelDotOrientation),u=new Set(["right","top","bottom"]),h=2*Math.PI*kv/360,f=new j_.CircleGeometry(1,16);n_(t.labelsData,t.scene,{createObj:function(){var t=new j_.MeshLambertMaterial;t.side=2;var e=new j_.Group;return e.add(new j_.Mesh(f,t)),e.add(new j_.Mesh(void 0,t)),e.__globeObjType="label",e},updateObj:function(f,d){var p=Sv(f.children,2),m=p[0],g=p[1],v=s(d),_=Jv(v);g.material.color.set(Kv(v)),g.material.transparent=_<1,g.material.opacity=_;var y=A(d),x=c(d);!y||!u.has(x)&&(x="bottom");var b=y?+l(d)*h:1e-12;m.scale.x=m.scale.y=b;var M=+a(d)*h;if(g.geometry&&g.geometry.dispose(),g.geometry=new j_.TextGeometry(i(d),{font:t.font,size:M,height:0,curveSegments:t.labelResolution}),"right"!==x&&g.geometry.center(),y){var w=b+M/2;"right"===x&&(g.position.x=w),g.position.y={right:-M/2,top:w+M/2,bottom:-w-M/2}[x]}var E=function(e){var n=f.__currentTargetD=e,r=n.lat,i=n.lng,a=n.alt,o=n.rot,s=n.scale;Object.assign(f.position,zv(r,i,a)),f.lookAt(t.scene.localToWorld(new j_.Vector3(0,0,0))),f.rotateY(Math.PI),f.rotateZ(-o*Math.PI/180),f.scale.x=f.scale.y=f.scale.z=s},S={lat:+e(d),lng:+n(d),alt:+r(d),rot:+o(d),scale:1},T=f.__currentTargetD||Object.assign({},S,{scale:1e-12});Object.keys(S).some((function(t){return T[t]!==S[t]}))&&(!t.labelsTransitionDuration||t.labelsTransitionDuration<0?E(S):new JA(T).to(S,t.labelsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(E).start())}})}}),W_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;gv(this,e),(t=hv(this,e)).type="CircleLineGeometry",t.parameters={radius:n,segmentCount:r};for(var i=[],a=0;a<=r;a++){var o=(a/r-.25)*Math.PI*2;i.push({x:Math.cos(o)*n,y:Math.sin(o)*n,z:0})}return t.setFromPoints(i),t}return xv(e,t),_v(e)}((window.THREE?window.THREE:{BufferGeometry:Hn}).BufferGeometry),X_=window.THREE?window.THREE:{Color:En,Group:co,Line:Lo,LineBasicMaterial:Eo,Vector3:ae},Q_=zd.default||zd,Y_=jA({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return"#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e){Nv(t),e.scene=t,e.ticker=new Q_,e.ticker.onTick.add((function(t){if(e.ringsData.length){var n=sf(e.ringColor),r=sf(e.ringAltitude),i=sf(e.ringMaxRadius),a=sf(e.ringPropagationSpeed),o=sf(e.ringRepeatPeriod);e.ringsData.filter((function(t){return t.__threeObj})).forEach((function(s){var A,l,c,u=s.__threeObj;if((u.__nextRingTime||0)<=t){var h=o(s)/1e3;u.__nextRingTime=t+(h<=0?1/0:h);var f,d=new X_.Line(new W_(1,e.ringResolution),new X_.LineBasicMaterial),p=n(s),m=p instanceof Array||p instanceof Function;m?p instanceof Array?(f=Rp().domain(p.map((function(t,e){return e/(p.length-1)}))).range(p),d.material.transparent=p.some((function(t){return Jv(t)<1}))):(f=p,d.material.transparent=!0):(d.material.color=new X_.Color(Kv(p)),A=d.material,l=Jv(p),A.opacity=l,A.transparent=l<1,A.depthWrite=void 0===c?l>=1:c);var g=kv*(1+r(s)),v=i(s),_=v*Math.PI/180,y=a(s),x=y<=0,b=function(t){var e=t.t,n=(x?1-e:e)*_;if(d.scale.x=d.scale.y=g*Math.sin(n),d.position.z=g*(1-Math.cos(n)),m){var r=f(e);d.material.color=new X_.Color(Kv(r)),d.material.transparent&&(d.material.opacity=Jv(r))}};if(0===y)b({t:0}),u.add(d);else{var M=1e3*Math.abs(v/y);new JA({t:0}).to({t:1},M).onUpdate(b).onStart((function(){return u.add(d)})).onComplete((function(){u.remove(d),Uv(d)})).start()}}}))}}))},update:function(t){var e=sf(t.ringLat),n=sf(t.ringLng),r=sf(t.ringAltitude),i=t.scene.localToWorld(new X_.Vector3(0,0,0));n_(t.ringsData,t.scene,{createObj:function(){var t=new X_.Group;return t.__globeObjType="ring",t},updateObj:function(t,a){var o=e(a),s=n(a),A=r(a);Object.assign(t.position,zv(o,s,A)),t.lookAt(i)}},{removeDelay:3e4})}}),Z_=pv(pv({},window.THREE?window.THREE:{}),{},{CSS2DObject:class extends ln{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Lt(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)}))}))}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this.center=t.center,this}}}),K_=jA({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility()},triggerUpdate:!1}},methods:{updateObjVisibility:function(t,e){(e?[e]:t.htmlElementsData.map((function(t){return t.__threeObj})).filter((function(t){return t}))).forEach((function(e){return e.visible=!t.isBehindGlobe||!t.isBehindGlobe(e.position)}))}},init:function(t,e){Nv(t),e.scene=t},update:function(t,e){var n=this,r=sf(t.htmlLat),i=sf(t.htmlLng),a=sf(t.htmlAltitude),o=sf(t.htmlElement);n_(t.htmlElementsData,t.scene,{purge:e.hasOwnProperty("htmlElement"),createObj:function(t){var e=o(t),n=new Z_.CSS2DObject(e);return n.__globeObjType="html",n},updateObj:function(e,o){var s=function(t){var r=e.__currentTargetD=t,i=r.alt,a=r.lat,o=r.lng;Object.assign(e.position,zv(a,o,i)),n.updateObjVisibility(e)},A={lat:+r(o),lng:+i(o),alt:+a(o)};!t.htmlTransitionDuration||t.htmlTransitionDuration<0||!e.__currentTargetD?s(A):new JA(e.__currentTargetD).to(A,t.htmlTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(s).start()}})}}),J_=window.THREE?window.THREE:{Euler:Ve,Group:co,Mesh:sr,MeshLambertMaterial:Us,SphereGeometry:Os},$_=jA({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{},objectThreeObject:{default:new J_.Mesh(new J_.SphereGeometry(1,16,8),new J_.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(t,e){Nv(t),e.scene=t},update:function(t,e){var n=sf(t.objectLat),r=sf(t.objectLng),i=sf(t.objectAltitude),a=sf(t.objectFacesSurface),o=sf(t.objectRotation),s=sf(t.objectThreeObject);n_(t.objectsData,t.scene,{purge:e.hasOwnProperty("objectThreeObject"),createObj:function(e){var n=s(e);t.objectThreeObject===n&&(n=n.clone());var r=new J_.Group;return r.add(n),r.__globeObjType="object",r},updateObj:function(t,e){var s=+n(e),A=+r(e),l=+i(e);Object.assign(t.position,zv(s,A,l)),a(e)?t.setRotationFromEuler(new Ve(Hv(-s),Hv(A),0,"YXZ")):t.rotation.set(0,0,0);var c=t.children[0],u=o(e);u&&c.setRotationFromEuler(new Ve(Hv(u.x||0),Hv(u.y||0),Hv(u.z||0)))}})}}),ty=jA({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t,e){t.customThreeObjectUpdate||Nv(t.scene);var n=sf(t.customThreeObject),r=sf(t.customThreeObjectUpdate);n_(t.customLayerData,t.scene,{purge:e.hasOwnProperty("customThreeObject"),createObj:function(e){var r=n(e,kv);return r&&(t.customThreeObject===r&&(r=r.clone()),r.__globeObjType="custom"),r},updateObj:function(t,e){return r(t,e,kv)}})}}),ey=window.THREE?window.THREE:{Group:co,Vector2:Lt,Vector3:ae},ny=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","labelsLayer","ringsLayer","htmlElementsLayer","objectsLayer","customLayer"],ry=Bv("globeLayer",Zv),iy=Object.assign.apply(Object,Tv(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map((function(t){return yv({},t,ry.linkProp(t))})))),ay=Object.assign.apply(Object,Tv(["globeMaterial"].map((function(t){return yv({},t,ry.linkMethod(t))})))),oy=Bv("pointsLayer",o_),sy=Object.assign.apply(Object,Tv(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map((function(t){return yv({},t,oy.linkProp(t))})))),Ay=Bv("arcsLayer",u_),ly=Object.assign.apply(Object,Tv(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map((function(t){return yv({},t,Ay.linkProp(t))})))),cy=Bv("hexBinLayer",p_),uy=Object.assign.apply(Object,Tv(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map((function(t){return yv({},t,cy.linkProp(t))})))),hy=Bv("heatmapsLayer",T_),fy=Object.assign.apply(Object,Tv(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map((function(t){return yv({},t,hy.linkProp(t))})))),dy=Bv("hexedPolygonsLayer",O_),py=Object.assign.apply(Object,Tv(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map((function(t){return yv({},t,dy.linkProp(t))})))),my=Bv("polygonsLayer",R_),gy=Object.assign.apply(Object,Tv(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map((function(t){return yv({},t,my.linkProp(t))})))),vy=Bv("pathsLayer",k_),_y=Object.assign.apply(Object,Tv(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map((function(t){return yv({},t,vy.linkProp(t))})))),yy=Bv("tilesLayer",z_),xy=Object.assign.apply(Object,Tv(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map((function(t){return yv({},t,yy.linkProp(t))})))),by=Bv("labelsLayer",V_),My=Object.assign.apply(Object,Tv(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map((function(t){return yv({},t,by.linkProp(t))})))),wy=Bv("ringsLayer",Y_),Ey=Object.assign.apply(Object,Tv(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map((function(t){return yv({},t,wy.linkProp(t))})))),Sy=Bv("htmlElementsLayer",K_),Ty=Object.assign.apply(Object,Tv(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration"].map((function(t){return yv({},t,Sy.linkProp(t))})))),Cy=Bv("objectsLayer",$_),Ry=Object.assign.apply(Object,Tv(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject"].map((function(t){return yv({},t,Cy.linkProp(t))})))),Py=Bv("customLayer",ty),Ly=Object.assign.apply(Object,Tv(["customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return yv({},t,Py.linkProp(t))})))),Dy=jA({props:pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new ey.Vector2(window.innerWidth,window.innerHeight),onChange:function(t,e){e.pathsLayer.rendererSize(t)},triggerUpdate:!1}},iy),sy),ly),uy),fy),gy),py),_y),xy),My),Ey),Ty),Ry),Ly),methods:pv({getGlobeRadius:Fv,getCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return zv.apply(void 0,n)},toGeoCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Gv.apply(void 0,n)},setPointOfView:function(t,e,n){var r=void 0;if(e){var i,a,o,s=Fv(),A=n?e.clone().sub(n):e;r=function(t){void 0===i&&(i=A.length()),void 0===a&&(a=Math.sqrt(Math.pow(i,2)-Math.pow(s,2))),void 0===o&&(o=Math.acos(a/i));var e=A.distanceTo(t);if(e<a)return!1;var n=t.length();return Math.acos((Math.pow(i,2)+Math.pow(e,2)-Math.pow(n,2))/(2*i*e))<o}}t.layersThatNeedBehindGlobeChecker.forEach((function(t){return t.isBehindGlobe(r)}))},pauseAnimation:function(t){return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),t.pausableLayers.forEach((function(t){var e;return null===(e=t.pauseAnimation)||void 0===e?void 0:e.call(t)})),this},resumeAnimation:function(t){return null===t.animationFrameRequestId&&this._animationCycle(),t.pausableLayers.forEach((function(t){var e;return null===(e=t.resumeAnimation)||void 0===e?void 0:e.call(t)})),this},_animationCycle:function(t){t.animationFrameRequestId=requestAnimationFrame(this._animationCycle),tl()},_destructor:function(t){this.pauseAnimation(),t.destructableLayers.forEach((function(t){return t._destructor()}))}},ay),stateInit:function(){var t={globeLayer:Zv(),pointsLayer:o_(),arcsLayer:u_(),hexBinLayer:p_(),heatmapsLayer:T_(),polygonsLayer:R_(),hexedPolygonsLayer:O_(),pathsLayer:k_(),tilesLayer:z_(),labelsLayer:V_(),ringsLayer:Y_(),htmlElementsLayer:K_(),objectsLayer:$_(),customLayer:ty()};return pv(pv({},t),{},{layersThatNeedBehindGlobeChecker:Object.values(t).filter((function(t){return t.hasOwnProperty("isBehindGlobe")})),destructableLayers:Object.values(t).filter((function(t){return t.hasOwnProperty("_destructor")})),pausableLayers:Object.values(t).filter((function(t){return t.hasOwnProperty("pauseAnimation")}))})},init:function(t,e,n){var r=n.animateIn,i=void 0===r||r,a=n.waitForGlobeReady,o=void 0===a||a;Nv(t),e.scene=t,e.scene.visible=!1,ny.forEach((function(t){var n=new ey.Group;e.scene.add(n),e[t](n)}));var s=function(){if(i){e.scene.scale.set(1e-6,1e-6,1e-6),new JA({k:1e-6}).to({k:1},600).easing(WA.Quadratic.Out).onUpdate((function(t){var n=t.k;return e.scene.scale.set(n,n,n)})).start();var t=new ey.Vector3(0,1,0);new JA({rot:2*Math.PI}).to({rot:0},1200).easing(WA.Quintic.Out).onUpdate((function(n){var r=n.rot;return e.scene.setRotationFromAxisAngle(t,r)})).start()}e.scene.visible=!0,e.onGlobeReady&&e.onGlobeReady()};o?e.globeLayer.onReady(s):s(),this._animationCycle()},update:function(t){}});var Oy=function(t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(n){function r(){var n;gv(this,r);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return(n=hv(this,r,[].concat(a))).__kapsuleInstance=t.apply(void 0,a).apply(void 0,[].concat(Tv(e?[Ev(n)]:[]),a)),n}return xv(r,n),_v(r)}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object);return Object.keys(t()).forEach((function(t){return n.prototype[t]=function(){var e,n=(e=this.__kapsuleInstance)[t].apply(e,arguments);return n===this.__kapsuleInstance?this:n}})),n}(Dy,(window.THREE?window.THREE:{Group:co}).Group,!0);const Iy={type:"change"},qy={type:"start"},Uy={type:"end"};class Ny extends gt{constructor(t,e){super();const n=this,r=-1,i=0,a=1,o=2,s=3,l=4;this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:A.ROTATE,MIDDLE:A.DOLLY,RIGHT:A.PAN},this.target=new ae;const c=1e-6,u=new ae;let h=1,f=r,d=r,p=0,m=0,g=0;const v=new ae,_=new Lt,y=new Lt,x=new ae,b=new Lt,M=new Lt,w=new Lt,E=new Lt,S=[],T={};this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom,this.handleResize=function(){const t=n.domElement.getBoundingClientRect(),e=n.domElement.ownerDocument.documentElement;n.screen.left=t.left+window.pageXOffset-e.clientLeft,n.screen.top=t.top+window.pageYOffset-e.clientTop,n.screen.width=t.width,n.screen.height=t.height};const C=function(){const t=new Lt;return function(e,r){return t.set((e-n.screen.left)/n.screen.width,(r-n.screen.top)/n.screen.height),t}}(),R=function(){const t=new Lt;return function(e,r){return t.set((e-.5*n.screen.width-n.screen.left)/(.5*n.screen.width),(n.screen.height+2*(n.screen.top-r))/n.screen.width),t}}();function P(t){!1!==n.enabled&&(0===S.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",L),n.domElement.addEventListener("pointerup",D)),function(t){S.push(t)}(t),"touch"===t.pointerType?function(t){if(1===(k(t),S.length))f=s,y.copy(R(S[0].pageX,S[0].pageY)),_.copy(y);else{f=l;const t=S[0].pageX-S[1].pageX,e=S[0].pageY-S[1].pageY;m=p=Math.sqrt(t*t+e*e);const n=(S[0].pageX+S[1].pageX)/2,r=(S[0].pageY+S[1].pageY)/2;w.copy(C(n,r)),E.copy(w)}n.dispatchEvent(qy)}(t):function(t){if(f===r)switch(t.button){case n.mouseButtons.LEFT:f=i;break;case n.mouseButtons.MIDDLE:f=a;break;case n.mouseButtons.RIGHT:f=o}const e=d!==r?d:f;e!==i||n.noRotate?e!==a||n.noZoom?e!==o||n.noPan||(w.copy(C(t.pageX,t.pageY)),E.copy(w)):(b.copy(C(t.pageX,t.pageY)),M.copy(b)):(y.copy(R(t.pageX,t.pageY)),_.copy(y));n.dispatchEvent(qy)}(t))}function L(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){if(1===(k(t),S.length))_.copy(y),y.copy(R(t.pageX,t.pageY));else{const e=function(t){const e=t.pointerId===S[0].pointerId?S[1]:S[0];return T[e.pointerId]}(t),n=t.pageX-e.x,r=t.pageY-e.y;m=Math.sqrt(n*n+r*r);const i=(t.pageX+e.x)/2,a=(t.pageY+e.y)/2;E.copy(C(i,a))}}(t):function(t){const e=d!==r?d:f;e!==i||n.noRotate?e!==a||n.noZoom?e!==o||n.noPan||E.copy(C(t.pageX,t.pageY)):M.copy(C(t.pageX,t.pageY)):(_.copy(y),y.copy(R(t.pageX,t.pageY)))}(t))}function D(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(S.length){case 0:f=r;break;case 1:f=s,y.copy(R(t.pageX,t.pageY)),_.copy(y);break;case 2:f=l;for(let e=0;e<S.length;e++)if(S[e].pointerId!==t.pointerId){const t=T[S[e].pointerId];y.copy(R(t.x,t.y)),_.copy(y);break}}n.dispatchEvent(Uy)}(t):(f=r,n.dispatchEvent(Uy)),B(t),0===S.length&&(n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",L),n.domElement.removeEventListener("pointerup",D)))}function O(t){B(t)}function I(t){!1!==n.enabled&&(window.removeEventListener("keydown",I),d===r&&(t.code!==n.keys[i]||n.noRotate?t.code!==n.keys[a]||n.noZoom?t.code!==n.keys[o]||n.noPan||(d=o):d=a:d=i))}function q(){!1!==n.enabled&&(d=r,window.addEventListener("keydown",I))}function U(t){if(!1!==n.enabled&&!0!==n.noZoom){switch(t.preventDefault(),t.deltaMode){case 2:b.y-=.025*t.deltaY;break;case 1:b.y-=.01*t.deltaY;break;default:b.y-=25e-5*t.deltaY}n.dispatchEvent(qy),n.dispatchEvent(Uy)}}function N(t){!1!==n.enabled&&t.preventDefault()}function B(t){delete T[t.pointerId];for(let e=0;e<S.length;e++)if(S[e].pointerId==t.pointerId)return void S.splice(e,1)}function k(t){let e=T[t.pointerId];void 0===e&&(e=new Lt,T[t.pointerId]=e),e.set(t.pageX,t.pageY)}this.rotateCamera=function(){const t=new ae,e=new ie,r=new ae,i=new ae,a=new ae,o=new ae;return function(){o.set(y.x-_.x,y.y-_.y,0);let s=o.length();s?(v.copy(n.object.position).sub(n.target),r.copy(v).normalize(),i.copy(n.object.up).normalize(),a.crossVectors(i,r).normalize(),i.setLength(y.y-_.y),a.setLength(y.x-_.x),o.copy(i.add(a)),t.crossVectors(o,v).normalize(),s*=n.rotateSpeed,e.setFromAxisAngle(t,s),v.applyQuaternion(e),n.object.up.applyQuaternion(e),x.copy(t),g=s):!n.staticMoving&&g&&(g*=Math.sqrt(1-n.dynamicDampingFactor),v.copy(n.object.position).sub(n.target),e.setFromAxisAngle(x,g),v.applyQuaternion(e),n.object.up.applyQuaternion(e)),_.copy(y)}}(),this.zoomCamera=function(){let t;f===l?(t=p/m,p=m,n.object.isPerspectiveCamera?v.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom=Pt.clamp(n.object.zoom/t,n.minZoom,n.maxZoom),h!==n.object.zoom&&n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(M.y-b.y)*n.zoomSpeed,1!==t&&t>0&&(n.object.isPerspectiveCamera?v.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom=Pt.clamp(n.object.zoom/t,n.minZoom,n.maxZoom),h!==n.object.zoom&&n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),n.staticMoving?b.copy(M):b.y+=(M.y-b.y)*this.dynamicDampingFactor)},this.panCamera=function(){const t=new Lt,e=new ae,r=new ae;return function(){if(t.copy(E).sub(w),t.lengthSq()){if(n.object.isOrthographicCamera){const e=(n.object.right-n.object.left)/n.object.zoom/n.domElement.clientWidth,r=(n.object.top-n.object.bottom)/n.object.zoom/n.domElement.clientWidth;t.x*=e,t.y*=r}t.multiplyScalar(v.length()*n.panSpeed),r.copy(v).cross(n.object.up).setLength(t.x),r.add(e.copy(n.object.up).setLength(t.y)),n.object.position.add(r),n.target.add(r),n.staticMoving?w.copy(E):w.add(t.subVectors(E,w).multiplyScalar(n.dynamicDampingFactor))}}}(),this.checkDistances=function(){n.noZoom&&n.noPan||(v.lengthSq()>n.maxDistance*n.maxDistance&&(n.object.position.addVectors(n.target,v.setLength(n.maxDistance)),b.copy(M)),v.lengthSq()<n.minDistance*n.minDistance&&(n.object.position.addVectors(n.target,v.setLength(n.minDistance)),b.copy(M)))},this.update=function(){v.subVectors(n.object.position,n.target),n.noRotate||n.rotateCamera(),n.noZoom||n.zoomCamera(),n.noPan||n.panCamera(),n.object.position.addVectors(n.target,v),n.object.isPerspectiveCamera?(n.checkDistances(),n.object.lookAt(n.target),u.distanceToSquared(n.object.position)>c&&(n.dispatchEvent(Iy),u.copy(n.object.position))):n.object.isOrthographicCamera?(n.object.lookAt(n.target),(u.distanceToSquared(n.object.position)>c||h!==n.object.zoom)&&(n.dispatchEvent(Iy),u.copy(n.object.position),h=n.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")},this.reset=function(){f=r,d=r,n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.up.copy(n.up0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),v.subVectors(n.object.position,n.target),n.object.lookAt(n.target),n.dispatchEvent(Iy),u.copy(n.object.position),h=n.object.zoom},this.dispose=function(){n.domElement.removeEventListener("contextmenu",N),n.domElement.removeEventListener("pointerdown",P),n.domElement.removeEventListener("pointercancel",O),n.domElement.removeEventListener("wheel",U),n.domElement.removeEventListener("pointermove",L),n.domElement.removeEventListener("pointerup",D),window.removeEventListener("keydown",I),window.removeEventListener("keyup",q)},this.domElement.addEventListener("contextmenu",N),this.domElement.addEventListener("pointerdown",P),this.domElement.addEventListener("pointercancel",O),this.domElement.addEventListener("wheel",U,{passive:!1}),window.addEventListener("keydown",I),window.addEventListener("keyup",q),this.handleResize(),this.update()}}const By={type:"change"},ky={type:"start"},Fy={type:"end"},zy=new Ie,Gy=new Tr,Hy=Math.cos(70*Pt.DEG2RAD);class jy extends gt{constructor(t,e){super(),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new ae,this.cursor=new ae,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:A.ROTATE,MIDDLE:A.DOLLY,RIGHT:A.PAN},this.touches={ONE:l,TWO:u},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(t){t.addEventListener("keydown",tt),this._domElementKeyEvents=t},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",tt),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(By),n.update(),i=r.NONE},this.update=function(){const e=new ae,A=(new ie).setFromUnitVectors(t.up,new ae(0,1,0)),l=A.clone().invert(),c=new ae,u=new ie,h=new ae,p=2*Math.PI;return function(m=null){const g=n.object.position;e.copy(g).sub(n.target),e.applyQuaternion(A),o.setFromVector3(e),n.autoRotate&&i===r.NONE&&L(function(t){return null!==t?2*Math.PI/60*n.autoRotateSpeed*t:2*Math.PI/60/60*n.autoRotateSpeed}(m)),n.enableDamping?(o.theta+=s.theta*n.dampingFactor,o.phi+=s.phi*n.dampingFactor):(o.theta+=s.theta,o.phi+=s.phi);let v=n.minAzimuthAngle,_=n.maxAzimuthAngle;isFinite(v)&&isFinite(_)&&(v<-Math.PI?v+=p:v>Math.PI&&(v-=p),_<-Math.PI?_+=p:_>Math.PI&&(_-=p),o.theta=v<=_?Math.max(v,Math.min(_,o.theta)):o.theta>(v+_)/2?Math.max(v,o.theta):Math.min(_,o.theta)),o.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,o.phi)),o.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let y=!1;if(n.zoomToCursor&&S||n.object.isOrthographicCamera)o.radius=k(o.radius);else{const t=o.radius;o.radius=k(o.radius*f),y=t!=o.radius}if(e.setFromSpherical(o),e.applyQuaternion(l),g.copy(n.target).add(e),n.object.lookAt(n.target),!0===n.enableDamping?(s.theta*=1-n.dampingFactor,s.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(s.set(0,0,0),d.set(0,0,0)),n.zoomToCursor&&S){let r=null;if(n.object.isPerspectiveCamera){const t=e.length();r=k(t*f);const i=t-r;n.object.position.addScaledVector(w,i),n.object.updateMatrixWorld(),y=!!i}else if(n.object.isOrthographicCamera){const t=new ae(E.x,E.y,0);t.unproject(n.object);const i=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/f)),n.object.updateProjectionMatrix(),y=i!==n.object.zoom;const a=new ae(E.x,E.y,0);a.unproject(n.object),n.object.position.sub(a).add(t),n.object.updateMatrixWorld(),r=e.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==r&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(zy.origin.copy(n.object.position),zy.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(zy.direction))<Hy?t.lookAt(n.target):(Gy.setFromNormalAndCoplanarPoint(n.object.up,n.target),zy.intersectPlane(Gy,n.target))))}else if(n.object.isOrthographicCamera){const t=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/f)),t!==n.object.zoom&&(n.object.updateProjectionMatrix(),y=!0)}return f=1,S=!1,!!(y||c.distanceToSquared(n.object.position)>a||8*(1-u.dot(n.object.quaternion))>a||h.distanceToSquared(n.target)>a)&&(n.dispatchEvent(By),c.copy(n.object.position),u.copy(n.object.quaternion),h.copy(n.target),!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",nt),n.domElement.removeEventListener("pointerdown",Q),n.domElement.removeEventListener("pointercancel",Z),n.domElement.removeEventListener("wheel",K),n.domElement.removeEventListener("pointermove",Y),n.domElement.removeEventListener("pointerup",Z);n.domElement.getRootNode().removeEventListener("keydown",J,{capture:!0}),null!==n._domElementKeyEvents&&(n._domElementKeyEvents.removeEventListener("keydown",tt),n._domElementKeyEvents=null)};const n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=r.NONE;const a=1e-6,o=new eA,s=new eA;let f=1;const d=new ae,p=new Lt,m=new Lt,g=new Lt,v=new Lt,_=new Lt,y=new Lt,x=new Lt,b=new Lt,M=new Lt,w=new ae,E=new Lt;let S=!1;const T=[],C={};let R=!1;function P(t){const e=Math.abs(.01*t);return Math.pow(.95,n.zoomSpeed*e)}function L(t){s.theta-=t}function D(t){s.phi-=t}const O=function(){const t=new ae;return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),d.add(t)}}(),I=function(){const t=new ae;return function(e,r){!0===n.screenSpacePanning?t.setFromMatrixColumn(r,1):(t.setFromMatrixColumn(r,0),t.crossVectors(n.object.up,t)),t.multiplyScalar(e),d.add(t)}}(),q=function(){const t=new ae;return function(e,r){const i=n.domElement;if(n.object.isPerspectiveCamera){const a=n.object.position;t.copy(a).sub(n.target);let o=t.length();o*=Math.tan(n.object.fov/2*Math.PI/180),O(2*e*o/i.clientHeight,n.object.matrix),I(2*r*o/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(O(e*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),I(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function U(t){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?f/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function N(t){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?f*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function B(t,e){if(!n.zoomToCursor)return;S=!0;const r=n.domElement.getBoundingClientRect(),i=t-r.left,a=e-r.top,o=r.width,s=r.height;E.x=i/o*2-1,E.y=-a/s*2+1,w.set(E.x,E.y,1).unproject(n.object).sub(n.object.position).normalize()}function k(t){return Math.max(n.minDistance,Math.min(n.maxDistance,t))}function F(t){p.set(t.clientX,t.clientY)}function z(t){v.set(t.clientX,t.clientY)}function G(t){if(1===T.length)p.set(t.pageX,t.pageY);else{const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);p.set(n,r)}}function H(t){if(1===T.length)v.set(t.pageX,t.pageY);else{const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);v.set(n,r)}}function j(t){const e=it(t),n=t.pageX-e.x,r=t.pageY-e.y,i=Math.sqrt(n*n+r*r);x.set(0,i)}function V(t){if(1==T.length)m.set(t.pageX,t.pageY);else{const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);m.set(n,r)}g.subVectors(m,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*g.x/e.clientHeight),D(2*Math.PI*g.y/e.clientHeight),p.copy(m)}function W(t){if(1===T.length)_.set(t.pageX,t.pageY);else{const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);_.set(n,r)}y.subVectors(_,v).multiplyScalar(n.panSpeed),q(y.x,y.y),v.copy(_)}function X(t){const e=it(t),r=t.pageX-e.x,i=t.pageY-e.y,a=Math.sqrt(r*r+i*i);b.set(0,a),M.set(0,Math.pow(b.y/x.y,n.zoomSpeed)),U(M.y),x.copy(b);B(.5*(t.pageX+e.x),.5*(t.pageY+e.y))}function Q(t){!1!==n.enabled&&(0===T.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",Y),n.domElement.addEventListener("pointerup",Z)),function(t){for(let e=0;e<T.length;e++)if(T[e]==t.pointerId)return!0;return!1}(t)||(function(t){T.push(t.pointerId)}(t),"touch"===t.pointerType?et(t):function(t){let e;switch(t.button){case 0:e=n.mouseButtons.LEFT;break;case 1:e=n.mouseButtons.MIDDLE;break;case 2:e=n.mouseButtons.RIGHT;break;default:e=-1}switch(e){case A.DOLLY:if(!1===n.enableZoom)return;!function(t){B(t.clientX,t.clientX),x.set(t.clientX,t.clientY)}(t),i=r.DOLLY;break;case A.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enablePan)return;z(t),i=r.PAN}else{if(!1===n.enableRotate)return;F(t),i=r.ROTATE}break;case A.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enableRotate)return;F(t),i=r.ROTATE}else{if(!1===n.enablePan)return;z(t),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(ky)}(t)))}function Y(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(rt(t),i){case r.TOUCH_ROTATE:if(!1===n.enableRotate)return;V(t),n.update();break;case r.TOUCH_PAN:if(!1===n.enablePan)return;W(t),n.update();break;case r.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){n.enableZoom&&X(t),n.enablePan&&W(t)}(t),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(t){n.enableZoom&&X(t),n.enableRotate&&V(t)}(t),n.update();break;default:i=r.NONE}}(t):function(t){switch(i){case r.ROTATE:if(!1===n.enableRotate)return;!function(t){m.set(t.clientX,t.clientY),g.subVectors(m,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*g.x/e.clientHeight),D(2*Math.PI*g.y/e.clientHeight),p.copy(m),n.update()}(t);break;case r.DOLLY:if(!1===n.enableZoom)return;!function(t){b.set(t.clientX,t.clientY),M.subVectors(b,x),M.y>0?U(P(M.y)):M.y<0&&N(P(M.y)),x.copy(b),n.update()}(t);break;case r.PAN:if(!1===n.enablePan)return;!function(t){_.set(t.clientX,t.clientY),y.subVectors(_,v).multiplyScalar(n.panSpeed),q(y.x,y.y),v.copy(_),n.update()}(t)}}(t))}function Z(t){switch(function(t){delete C[t.pointerId];for(let e=0;e<T.length;e++)if(T[e]==t.pointerId)return void T.splice(e,1)}(t),T.length){case 0:n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",Y),n.domElement.removeEventListener("pointerup",Z),n.dispatchEvent(Fy),i=r.NONE;break;case 1:const e=T[0],a=C[e];et({pointerId:e,pageX:a.x,pageY:a.y})}}function K(t){!1!==n.enabled&&!1!==n.enableZoom&&i===r.NONE&&(t.preventDefault(),n.dispatchEvent(ky),function(t){B(t.clientX,t.clientY),t.deltaY<0?N(P(t.deltaY)):t.deltaY>0&&U(P(t.deltaY)),n.update()}(function(t){const e=t.deltaMode,n={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}t.ctrlKey&&!R&&(n.deltaY*=10);return n}(t)),n.dispatchEvent(Fy))}function J(t){if("Control"===t.key){R=!0;n.domElement.getRootNode().addEventListener("keyup",$,{passive:!0,capture:!0})}}function $(t){if("Control"===t.key){R=!1;n.domElement.getRootNode().removeEventListener("keyup",$,{passive:!0,capture:!0})}}function tt(t){!1!==n.enabled&&!1!==n.enablePan&&function(t){let e=!1;switch(t.code){case n.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?D(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(0,n.keyPanSpeed),e=!0;break;case n.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?D(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(0,-n.keyPanSpeed),e=!0;break;case n.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?L(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(n.keyPanSpeed,0),e=!0;break;case n.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?L(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(-n.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),n.update())}(t)}function et(t){switch(rt(t),T.length){case 1:switch(n.touches.ONE){case l:if(!1===n.enableRotate)return;G(t),i=r.TOUCH_ROTATE;break;case c:if(!1===n.enablePan)return;H(t),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case u:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){n.enableZoom&&j(t),n.enablePan&&H(t)}(t),i=r.TOUCH_DOLLY_PAN;break;case h:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(t){n.enableZoom&&j(t),n.enableRotate&&G(t)}(t),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(ky)}function nt(t){!1!==n.enabled&&t.preventDefault()}function rt(t){let e=C[t.pointerId];void 0===e&&(e=new Lt,C[t.pointerId]=e),e.set(t.pageX,t.pageY)}function it(t){const e=t.pointerId===T[0]?T[1]:T[0];return C[e]}n.domElement.addEventListener("contextmenu",nt),n.domElement.addEventListener("pointerdown",Q),n.domElement.addEventListener("pointercancel",Z),n.domElement.addEventListener("wheel",K,{passive:!1});n.domElement.getRootNode().addEventListener("keydown",J,{passive:!0,capture:!0}),this.update()}}const Vy={type:"change"};class Wy extends gt{constructor(t,e){super(),this.object=t,this.domElement=e,this.enabled=!0,this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1;const n=this,r=1e-6,i=new ie,a=new ae;this.tmpQuaternion=new ie,this.status=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new ae(0,0,0),this.rotationVector=new ae(0,0,0),this.keydown=function(t){if(!t.altKey&&!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(t){if(!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()}},this.pointerdown=function(t){if(!1!==this.enabled)if(this.dragToLook)this.status++;else{switch(t.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.pointermove=function(t){if(!1!==this.enabled&&(!this.dragToLook||this.status>0)){const e=this.getContainerDimensions(),n=e.size[0]/2,r=e.size[1]/2;this.moveState.yawLeft=-(t.pageX-e.offset[0]-n)/n,this.moveState.pitchDown=(t.pageY-e.offset[1]-r)/r,this.updateRotationVector()}},this.pointerup=function(t){if(!1!==this.enabled){if(this.dragToLook)this.status--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(t.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()}},this.pointercancel=function(){!1!==this.enabled&&(this.dragToLook?(this.status=0,this.moveState.yawLeft=this.moveState.pitchDown=0):(this.moveState.forward=0,this.moveState.back=0,this.updateMovementVector()),this.updateRotationVector())},this.contextMenu=function(t){!1!==this.enabled&&t.preventDefault()},this.update=function(t){if(!1===this.enabled)return;const e=t*n.movementSpeed,o=t*n.rollSpeed;n.object.translateX(n.moveVector.x*e),n.object.translateY(n.moveVector.y*e),n.object.translateZ(n.moveVector.z*e),n.tmpQuaternion.set(n.rotationVector.x*o,n.rotationVector.y*o,n.rotationVector.z*o,1).normalize(),n.object.quaternion.multiply(n.tmpQuaternion),(a.distanceToSquared(n.object.position)>r||8*(1-i.dot(n.object.quaternion))>r)&&(n.dispatchEvent(Vy),i.copy(n.object.quaternion),a.copy(n.object.position))},this.updateMovementVector=function(){const t=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-t+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",o),this.domElement.removeEventListener("pointerdown",A),this.domElement.removeEventListener("pointermove",s),this.domElement.removeEventListener("pointerup",l),this.domElement.removeEventListener("pointercancel",c),window.removeEventListener("keydown",u),window.removeEventListener("keyup",h)};const o=this.contextMenu.bind(this),s=this.pointermove.bind(this),A=this.pointerdown.bind(this),l=this.pointerup.bind(this),c=this.pointercancel.bind(this),u=this.keydown.bind(this),h=this.keyup.bind(this);this.domElement.addEventListener("contextmenu",o),this.domElement.addEventListener("pointerdown",A),this.domElement.addEventListener("pointermove",s),this.domElement.addEventListener("pointerup",l),this.domElement.addEventListener("pointercancel",c),window.addEventListener("keydown",u),window.addEventListener("keyup",h),this.updateMovementVector(),this.updateRotationVector()}}const Xy={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class Qy{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const Yy=new Wr(-1,1,1,-1,0,1);const Zy=new class extends Hn{constructor(){super(),this.setAttribute("position",new qn([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new qn([0,2,0,0,2,0],2))}};class Ky{constructor(t){this._mesh=new sr(Zy,t)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,Yy)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}}class Jy extends Qy{constructor(t,e){super(),this.textureID=void 0!==e?e:"tDiffuse",t instanceof dr?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=fr.clone(t.uniforms),this.material=new dr({name:void 0!==t.name?t.name:"unspecified",defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new Ky(this.material)}render(t,e,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class $y extends Qy{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(t,e,n){const r=t.getContext(),i=t.state;let a,o;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(a=0,o=1):(a=1,o=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,a,4294967295),i.buffers.stencil.setClear(o),i.buffers.stencil.setLocked(!0),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.color.setMask(!0),i.buffers.depth.setMask(!0),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class tx extends Qy{constructor(){super(),this.needsSwap=!1}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}}class ex{constructor(t,e){if(this.renderer=t,this._pixelRatio=t.getPixelRatio(),void 0===e){const n=t.getSize(new Lt);this._width=n.width,this._height=n.height,(e=new ee(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:W})).texture.name="EffectComposer.rt1"}else this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Jy(Xy),this.copyPass.material.blending=0,this.clock=new Ys}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();let n=!1;for(let e=0,r=this.passes.length;e<r;e++){const r=this.passes[e];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),r.render(this.renderer,this.writeBuffer,this.readBuffer,t,n),r.needsSwap){if(n){const e=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(e.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),n.setFunc(e.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==$y&&(r instanceof $y?n=!0:r instanceof tx&&(n=!1))}}this.renderer.setRenderTarget(e)}reset(t){if(void 0===t){const e=this.renderer.getSize(new Lt);this._pixelRatio=this.renderer.getPixelRatio(),this._width=e.width,this._height=e.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(n,r)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class nx extends Qy{constructor(t,e,n=null,r=null,i=null){super(),this.scene=t,this.camera=e,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=i,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new En}render(t,e,n){const r=t.autoClear;let i,a;t.autoClear=!1,null!==this.overrideMaterial&&(a=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(t.getClearColor(this._oldClearColor),t.setClearColor(this.clearColor)),null!==this.clearAlpha&&(i=t.getClearAlpha(),t.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),null!==this.clearColor&&t.setClearColor(this._oldClearColor),null!==this.clearAlpha&&t.setClearAlpha(i),null!==this.overrideMaterial&&(this.scene.overrideMaterial=a),t.autoClear=r}}function rx(){return rx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},rx.apply(this,arguments)}function ix(t,e){return ix=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ix(t,e)}function ax(t){return ax=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ax(t)}function ox(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ox=function(){return!!t})()}function sx(t){var e="function"==typeof Map?new Map:void 0;return sx=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(ox())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&ix(i,n.prototype),i}(t,arguments,ax(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ix(n,t)},sx(t)}var Ax={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function lx(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=e[0],a=[];for(r=1;r<e.length;r+=1)a.push(e[r]);return a.forEach((function(t){i=i.replace(/%[a-z]/,t)})),i}var cx=function(t){var e,n;function r(e){var n;if("production"===process.env.NODE_ENV)n=t.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+e+" for more information.")||this;else{for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];n=t.call(this,lx.apply(void 0,[Ax[e]].concat(i)))||this}return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,ix(e,n),r}(sx(Error));function ux(t){return Math.round(255*t)}function hx(t,e,n){return ux(t)+","+ux(e)+","+ux(n)}function fx(t,e,n,r){if(void 0===r&&(r=hx),0===e)return r(n,n,n);var i=(t%360+360)%360/60,a=(1-Math.abs(2*n-1))*e,o=a*(1-Math.abs(i%2-1)),s=0,A=0,l=0;i>=0&&i<1?(s=a,A=o):i>=1&&i<2?(s=o,A=a):i>=2&&i<3?(A=a,l=o):i>=3&&i<4?(A=o,l=a):i>=4&&i<5?(s=o,l=a):i>=5&&i<6&&(s=a,l=o);var c=n-a/2;return r(s+c,A+c,l+c)}var dx={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var px=/^#[a-fA-F0-9]{6}$/,mx=/^#[a-fA-F0-9]{8}$/,gx=/^#[a-fA-F0-9]{3}$/,vx=/^#[a-fA-F0-9]{4}$/,_x=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,yx=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,xx=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,bx=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function Mx(t){if("string"!=typeof t)throw new cx(3);var e=function(t){if("string"!=typeof t)return t;var e=t.toLowerCase();return dx[e]?"#"+dx[e]:t}(t);if(e.match(px))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(mx)){var n=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:n}}if(e.match(gx))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(vx)){var r=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:r}}var i=_x.exec(e);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var a=yx.exec(e.substring(0,50));if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])>1?parseFloat(""+a[4])/100:parseFloat(""+a[4])};var o=xx.exec(e);if(o){var s="rgb("+fx(parseInt(""+o[1],10),parseInt(""+o[2],10)/100,parseInt(""+o[3],10)/100)+")",A=_x.exec(s);if(!A)throw new cx(4,e,s);return{red:parseInt(""+A[1],10),green:parseInt(""+A[2],10),blue:parseInt(""+A[3],10)}}var l=bx.exec(e.substring(0,50));if(l){var c="rgb("+fx(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",u=_x.exec(c);if(!u)throw new cx(4,e,c);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new cx(5)}function wx(t){return function(t){var e,n=t.red/255,r=t.green/255,i=t.blue/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)return void 0!==t.alpha?{hue:0,saturation:0,lightness:s,alpha:t.alpha}:{hue:0,saturation:0,lightness:s};var A=a-o,l=s>.5?A/(2-a-o):A/(a+o);switch(a){case n:e=(r-i)/A+(r<i?6:0);break;case r:e=(i-n)/A+2;break;default:e=(n-r)/A+4}return e*=60,void 0!==t.alpha?{hue:e,saturation:l,lightness:s,alpha:t.alpha}:{hue:e,saturation:l,lightness:s}}(Mx(t))}var Ex=function(t){return 7===t.length&&t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?"#"+t[1]+t[3]+t[5]:t};function Sx(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function Tx(t){return Sx(Math.round(255*t))}function Cx(t,e,n){return Ex("#"+Tx(t)+Tx(e)+Tx(n))}function Rx(t,e,n){return fx(t,e,n,Cx)}function Px(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ex("#"+Sx(t)+Sx(e)+Sx(n));if("object"==typeof t&&void 0===e&&void 0===n)return Ex("#"+Sx(t.red)+Sx(t.green)+Sx(t.blue));throw new cx(6)}function Lx(t,e,n,r){if("string"==typeof t&&"number"==typeof e){var i=Mx(t);return"rgba("+i.red+","+i.green+","+i.blue+","+e+")"}if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof r)return r>=1?Px(t,e,n):"rgba("+t+","+e+","+n+","+r+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===r)return t.alpha>=1?Px(t.red,t.green,t.blue):"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")";throw new cx(7)}var Dx=function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&("number"!=typeof t.alpha||void 0===t.alpha)},Ox=function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&"number"==typeof t.alpha},Ix=function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&("number"!=typeof t.alpha||void 0===t.alpha)},qx=function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&"number"==typeof t.alpha};function Ux(t){if("object"!=typeof t)throw new cx(8);if(Ox(t))return Lx(t);if(Dx(t))return Px(t);if(qx(t))return function(t,e,n,r){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof r)return r>=1?Rx(t,e,n):"rgba("+fx(t,e,n)+","+r+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===r)return t.alpha>=1?Rx(t.hue,t.saturation,t.lightness):"rgba("+fx(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new cx(2)}(t);if(Ix(t))return function(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Rx(t,e,n);if("object"==typeof t&&void 0===e&&void 0===n)return Rx(t.hue,t.saturation,t.lightness);throw new cx(1)}(t);throw new cx(8)}function Nx(t,e,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=e?t.apply(this,r):Nx(t,e,r)}}function Bx(t){return Nx(t,t.length,[])}function kx(t,e,n){return Math.max(t,Math.min(e,n))}Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{hue:n.hue+parseFloat(t)}))})),Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{lightness:kx(0,1,n.lightness-parseFloat(t))}))})),Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{saturation:kx(0,1,n.saturation-parseFloat(t))}))})),Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{lightness:kx(0,1,n.lightness+parseFloat(t))}))}));var Fx=Bx((function(t,e,n){if("transparent"===e)return n;if("transparent"===n)return e;if(0===t)return n;var r=Mx(e),i=rx({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),a=Mx(n),o=rx({},a,{alpha:"number"==typeof a.alpha?a.alpha:1}),s=i.alpha-o.alpha,A=2*parseFloat(t)-1,l=((A*s==-1?A:A+s)/(1+A*s)+1)/2,c=1-l;return Lx({red:Math.floor(i.red*l+o.red*c),green:Math.floor(i.green*l+o.green*c),blue:Math.floor(i.blue*l+o.blue*c),alpha:i.alpha*parseFloat(t)+o.alpha*(1-parseFloat(t))})})),zx=Fx;var Gx=Bx((function(t,e){if("transparent"===e)return e;var n=Mx(e);return Lx(rx({},n,{alpha:kx(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(t))/100)}))})),Hx=Gx;Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{saturation:kx(0,1,n.saturation+parseFloat(t))}))})),Bx((function(t,e){return"transparent"===e?e:Ux(rx({},wx(e),{hue:parseFloat(t)}))})),Bx((function(t,e){return"transparent"===e?e:Ux(rx({},wx(e),{lightness:parseFloat(t)}))})),Bx((function(t,e){return"transparent"===e?e:Ux(rx({},wx(e),{saturation:parseFloat(t)}))})),Bx((function(t,e){return"transparent"===e?e:zx(parseFloat(t),"rgb(0, 0, 0)",e)})),Bx((function(t,e){return"transparent"===e?e:zx(parseFloat(t),"rgb(255, 255, 255)",e)})),Bx((function(t,e){if("transparent"===e)return e;var n=Mx(e);return Lx(rx({},n,{alpha:kx(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(t)).toFixed(2)/100)}))}));function jx(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function Vx(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Xx(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wx(t){return function(t){if(Array.isArray(t))return Qx(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Xx(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xx(t,e){if(t){if("string"==typeof t)return Qx(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qx(t,e):void 0}}function Qx(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".scene-nav-info {\n  bottom: 5px;\n  width: 100%;\n  text-align: center;\n  color: slategrey;\n  opacity: 0.7;\n  font-size: 10px;\n}\n\n.scene-tooltip {\n  top: 0;\n  color: lavender;\n  font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n  position: absolute;\n  font-family: sans-serif;\n  pointer-events: none;\n  user-select: none;\n}\n\n.scene-container canvas:focus {\n  outline: none;\n}");var Yx=window.THREE?window.THREE:{WebGLRenderer:yo,Scene:class extends ln{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 Ve,this.environmentRotation=new Ve,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),e.object.environmentRotation=this.environmentRotation.toArray(),e}},PerspectiveCamera:_r,Raycaster:class{constructor(t,e,n=0,r=1/0){this.ray=new Ie(t,e),this.near=n,this.far=r,this.camera=null,this.layers=new We,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return Js.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Js),this}intersectObject(t,e=!0,n=[]){return tA(t,this,n,e),n.sort($s),n}intersectObjects(t,e=!0,n=[]){for(let r=0,i=t.length;r<i;r++)tA(t[r],this,n,e);return n.sort($s),n}},SRGBColorSpace:rt,TextureLoader:Gs,Vector2:Lt,Vector3:ae,Box3:Ae,Color:En,Mesh:sr,SphereGeometry:Os,MeshBasicMaterial:Rn,BackSide:g,EventDispatcher:gt,MOUSE:A,Quaternion:ie,Spherical:eA,Clock:Ys},Zx=jA({props:{width:{default:window.innerWidth,onChange:function(t,e,n){isNaN(t)&&(e.width=n)}},height:{default:window.innerHeight,onChange:function(t,e,n){isNaN(t)&&(e.height=n)}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(t,e){e.hoverObj=null,e.toolTipElem&&(e.toolTipElem.innerHTML="")},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(t){if(t.initialised){if(t.controls.update&&t.controls.update(t.clock.getDelta()),t.postProcessingComposer?t.postProcessingComposer.render():t.renderer.render(t.scene,t.camera),t.extraRenderers.forEach((function(e){return e.render(t.scene,t.camera)})),t.enablePointerInteraction){var e=null;if(t.hoverDuringDrag||!t.isPointerDragging){var n=this.intersectingObjects(t.pointerPos.x,t.pointerPos.y).filter((function(e){return t.hoverFilter(e.object)})).sort((function(e,n){return t.hoverOrderComparator(e.object,n.object)})),r=n.length?n[0]:null;e=r?r.object:null,t.intersectionPoint=r?r.point:null}e!==t.hoverObj&&(t.onHover(e,t.hoverObj),t.toolTipElem.innerHTML=e&&sf(t.tooltipContent)(e)||"",t.hoverObj=e)}tl()}return this},getPointerPos:function(t){var e=t.pointerPos;return{x:e.x,y:e.y}},cameraPosition:function(t,e,n,r){var i=t.camera;if(e&&t.initialised){var a=e,o=n||{x:0,y:0,z:0};if(r){var s=Object.assign({},i.position),A=u();new JA(s).to(a,r).easing(WA.Quadratic.Out).onUpdate(l).start(),new JA(A).to(o,r/3).easing(WA.Quadratic.Out).onUpdate(c).start()}else l(a),c(o);return this}return Object.assign({},i.position,{lookAt:u()});function l(t){var e=t.x,n=t.y,r=t.z;void 0!==e&&(i.position.x=e),void 0!==n&&(i.position.y=n),void 0!==r&&(i.position.z=r)}function c(e){var n=new Yx.Vector3(e.x,e.y,e.z);t.controls.target?t.controls.target=n:i.lookAt(n)}function u(){return Object.assign(new Yx.Vector3(0,0,-1e3).applyQuaternion(i.quaternion).add(i.position))}},zoomToFit:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,i=new Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];return this.fitToBbox(this.getBbox.apply(this,i),e,n)},fitToBbox:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t.camera;if(e){var a=new Yx.Vector3(0,0,0),o=2*Math.max.apply(Math,Wx(Object.entries(e).map((function(t){var e=Vx(t,2),n=e[0],r=e[1];return Math.max.apply(Math,Wx(r.map((function(t){return Math.abs(a[n]-t)}))))})))),s=(1-2*r/t.height)*i.fov,A=o/Math.atan(s*Math.PI/180),l=A/i.aspect,c=Math.max(A,l);if(c>0){var u=a.clone().sub(i.position).normalize().multiplyScalar(-c);this.cameraPosition(u,a,n)}}return this},getBbox:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=new Yx.Box3(new Yx.Vector3(0,0,0),new Yx.Vector3(0,0,0)),r=t.objects.filter(e);return r.length?(r.forEach((function(t){return n.expandByObject(t)})),Object.assign.apply(Object,Wx(["x","y","z"].map((function(t){return e={},r=t,i=[n.min[t],n.max[t]],(r=jx(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e;var e,r,i}))))):null},getScreenCoords:function(t,e,n,r){var i=new Yx.Vector3(e,n,r);return i.project(this.camera()),{x:(i.x+1)*t.width/2,y:-(i.y-1)*t.height/2}},getSceneCoords:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=new Yx.Vector2(e/t.width*2-1,-n/t.height*2+1),a=new Yx.Raycaster;return a.setFromCamera(i,t.camera),Object.assign({},a.ray.at(r,new Yx.Vector3))},intersectingObjects:function(t,e,n){var r=new Yx.Vector2(e/t.width*2-1,-n/t.height*2+1),i=new Yx.Raycaster;return i.params.Line.threshold=t.lineHoverPrecision,i.setFromCamera(r,t.camera),i.intersectObjects(t.objects,!0)},renderer:function(t){return t.renderer},scene:function(t){return t.scene},camera:function(t){return t.camera},postProcessingComposer:function(t){return t.postProcessingComposer},controls:function(t){return t.controls},tbControls:function(t){return t.controls}},stateInit:function(){return{scene:new Yx.Scene,camera:new Yx.PerspectiveCamera,clock:new Yx.Clock}},init:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.controlType,i=void 0===r?"trackball":r,a=n.rendererConfig,o=void 0===a?{}:a,s=n.extraRenderers,A=void 0===s?[]:s,l=n.waitForLoadComplete,c=void 0===l||l;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.className="scene-container",e.container.style.position="relative",e.container.appendChild(e.navInfo=document.createElement("div")),e.navInfo.className="scene-nav-info",e.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[i]||"",e.navInfo.style.display=e.showNavInfo?null:"none",e.toolTipElem=document.createElement("div"),e.toolTipElem.classList.add("scene-tooltip"),e.container.appendChild(e.toolTipElem),e.pointerPos=new Yx.Vector2,e.pointerPos.x=-2,e.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(t){return e.container.addEventListener(t,(function(n){if("pointerdown"===t&&(e.isPointerPressed=!0),!e.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||e.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(t){return Math.abs(t)>1})))&&(e.isPointerDragging=!0),e.enablePointerInteraction){var r=(i=e.container,a=i.getBoundingClientRect(),o=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop,{top:a.top+s,left:a.left+o});e.pointerPos.x=n.pageX-r.left,e.pointerPos.y=n.pageY-r.top,e.toolTipElem.style.top="".concat(e.pointerPos.y,"px"),e.toolTipElem.style.left="".concat(e.pointerPos.x,"px"),e.toolTipElem.style.transform="translate(-".concat(e.pointerPos.x/e.width*100,"%, ").concat(e.height-e.pointerPos.y<100?"calc(-100% - 8px)":"21px",")")}var i,a,o,s}),{passive:!0})})),e.container.addEventListener("pointerup",(function(t){e.isPointerPressed=!1,e.isPointerDragging&&(e.isPointerDragging=!1,!e.clickAfterDrag)||requestAnimationFrame((function(){0===t.button&&e.onClick(e.hoverObj||null,t,e.intersectionPoint),2===t.button&&e.onRightClick&&e.onRightClick(e.hoverObj||null,t,e.intersectionPoint)}))}),{passive:!0,capture:!0}),e.container.addEventListener("contextmenu",(function(t){e.onRightClick&&t.preventDefault()})),e.renderer=new Yx.WebGLRenderer(Object.assign({antialias:!0,alpha:!0},o)),e.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),e.container.appendChild(e.renderer.domElement),e.extraRenderers=A,e.extraRenderers.forEach((function(t){t.domElement.style.position="absolute",t.domElement.style.top="0px",t.domElement.style.pointerEvents="none",e.container.appendChild(t.domElement)})),e.postProcessingComposer=new ex(e.renderer),e.postProcessingComposer.addPass(new nx(e.scene,e.camera)),e.controls=new{trackball:Ny,orbit:jy,fly:Wy}[i](e.camera,e.renderer.domElement),"fly"===i&&(e.controls.movementSpeed=300,e.controls.rollSpeed=Math.PI/6,e.controls.dragToLook=!0),"trackball"!==i&&"orbit"!==i||(e.controls.minDistance=.1,e.controls.maxDistance=e.skyRadius,e.controls.addEventListener("start",(function(){e.controlsEngaged=!0})),e.controls.addEventListener("change",(function(){e.controlsEngaged&&(e.controlsDragging=!0)})),e.controls.addEventListener("end",(function(){e.controlsEngaged=!1,e.controlsDragging=!1}))),[e.renderer,e.postProcessingComposer].concat(Wx(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix(),e.camera.position.z=1e3,e.scene.add(e.skysphere=new Yx.Mesh),e.skysphere.visible=!1,e.loadComplete=e.scene.visible=!c,window.scene=e.scene},update:function(t,e){if(t.width&&t.height&&(e.hasOwnProperty("width")||e.hasOwnProperty("height"))&&(t.container.style.width="".concat(t.width,"px"),t.container.style.height="".concat(t.height,"px"),[t.renderer,t.postProcessingComposer].concat(Wx(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix()),e.hasOwnProperty("skyRadius")&&t.skyRadius&&(t.controls.hasOwnProperty("maxDistance")&&e.skyRadius&&(t.controls.maxDistance=Math.min(t.controls.maxDistance,t.skyRadius)),t.camera.far=2.5*t.skyRadius,t.camera.updateProjectionMatrix(),t.skysphere.geometry=new Yx.SphereGeometry(t.skyRadius)),e.hasOwnProperty("backgroundColor")){var n=Mx(t.backgroundColor).alpha;void 0===n&&(n=1),t.renderer.setClearColor(new Yx.Color(Hx(1,t.backgroundColor)),n)}function r(){t.loadComplete=t.scene.visible=!0}e.hasOwnProperty("backgroundImageUrl")&&(t.backgroundImageUrl?(new Yx.TextureLoader).load(t.backgroundImageUrl,(function(e){e.colorSpace=Yx.SRGBColorSpace,t.skysphere.material=new Yx.MeshBasicMaterial({map:e,side:Yx.BackSide}),t.skysphere.visible=!0,t.onBackgroundImageLoaded&&setTimeout(t.onBackgroundImageLoaded),!t.loadComplete&&r()})):(t.skysphere.visible=!1,t.skysphere.material.map=null,!t.loadComplete&&r())),e.hasOwnProperty("showNavInfo")&&(t.navInfo.style.display=t.showNavInfo?null:"none"),e.hasOwnProperty("lights")&&((e.lights||[]).forEach((function(e){return t.scene.remove(e)})),t.lights.forEach((function(e){return t.scene.add(e)}))),e.hasOwnProperty("objects")&&((e.objects||[]).forEach((function(e){return t.scene.remove(e)})),t.objects.forEach((function(e){return t.scene.add(e)})))}});function Kx(t,e){var n=new e;return n._destructor&&n._destructor(),{linkProp:function(e){return{default:n[e](),onChange:function(n,r){r[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var r=n[t],i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=r[e].apply(r,a);return s===r?this:s}}}}var Jx=["rendererConfig","waitForGlobeReady"],$x=e(e({},window.THREE?window.THREE:{AmbientLight:class extends Hs{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}},DirectionalLight:class extends Hs{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ln.DEFAULT_UP),this.updateMatrix(),this.target=new ln,this.shadow=new Qs}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}},Vector2:Lt,REVISION:s}),{},{CSS2DRenderer:class{constructor(t={}){const e=this;let n,r,i,a;const o={objects:new WeakMap},s=void 0!==t.element?t.element:document.createElement("div");function A(t,n,r){if(t.isCSS2DObject){aA.setFromMatrixPosition(t.matrixWorld),aA.applyMatrix4(sA);const A=!0===t.visible&&aA.z>=-1&&aA.z<=1&&!0===t.layers.test(r.layers);if(t.element.style.display=!0===A?"":"none",!0===A){t.onBeforeRender(e,n,r);const o=t.element;o.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(aA.x*i+i)+"px,"+(-aA.y*a+a)+"px)",o.parentNode!==s&&s.appendChild(o),t.onAfterRender(e,n,r)}const c={distanceToCameraSquared:l(r,t)};o.objects.set(t,c)}for(let e=0,i=t.children.length;e<i;e++)A(t.children[e],n,r)}function l(t,e){return AA.setFromMatrixPosition(t.matrixWorld),lA.setFromMatrixPosition(e.matrixWorld),AA.distanceToSquared(lA)}s.style.overflow="hidden",this.domElement=s,this.getSize=function(){return{width:n,height:r}},this.render=function(t,e){!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),oA.copy(e.matrixWorldInverse),sA.multiplyMatrices(e.projectionMatrix,oA),A(t,t,e),function(t){const e=function(t){const e=[];return t.traverse((function(t){t.isCSS2DObject&&e.push(t)})),e}(t).sort((function(t,e){if(t.renderOrder!==e.renderOrder)return e.renderOrder-t.renderOrder;return o.objects.get(t).distanceToCameraSquared-o.objects.get(e).distanceToCameraSquared})),n=e.length;for(let t=0,r=e.length;t<r;t++)e[t].element.style.zIndex=n-t}(t)},this.setSize=function(t,e){n=t,r=e,i=n/2,a=r/2,s.style.width=t+"px",s.style.height=e+"px"}}}}),tb=Kx("globe",Oy),eb=Object.assign.apply(Object,a(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return r({},t,tb.linkProp(t))})))),nb=Object.assign.apply(Object,a(["globeMaterial","getGlobeRadius","getCoords","toGeoCoords"].map((function(t){return r({},t,tb.linkMethod(t))})))),rb=Kx("renderObjs",Zx),ib=Object.assign.apply(Object,a(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map((function(t){return r({},t,rb.linkProp(t))})))),ab=Object.assign.apply(Object,a(["lights","postProcessingComposer"].map((function(t){return r({},t,rb.linkMethod(t))})))),ob=jA({props:e(e({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return!0},triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.hoverFilter((function(e){return t(e,e.__data)}))}},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.lineHoverPrecision(t)}}},eb),ib),methods:e(e({pauseAnimation:function(t){var e;return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),null===(e=t.globe)||void 0===e||e.pauseAnimation(),this},resumeAnimation:function(t){var e;return null===t.animationFrameRequestId&&this._animationCycle(),null===(e=t.globe)||void 0===e||e.resumeAnimation(),this},_animationCycle:function(t){t.renderObjs.tick(),t.animationFrameRequestId=requestAnimationFrame(this._animationCycle)},pointOfView:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.globe.toGeoCoords(t.renderObjs.cameraPosition());if(void 0===e.lat&&void 0===e.lng&&void 0===e.altitude)return r;var i=Object.assign({},r,e);if(["lat","lng","altitude"].forEach((function(t){return i[t]=+i[t]})),n){for(;r.lng-i.lng>180;)r.lng-=360;for(;r.lng-i.lng<-180;)r.lng+=360;new JA(r).to(i,n).easing(WA.Cubic.InOut).onUpdate(a).start()}else a(i);return this;function a(e){var n=e.lat,r=e.lng,i=e.altitude;t.renderObjs.cameraPosition(t.globe.getCoords(n,r,i))}},getScreenCoords:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=(e=t.globe).getCoords.apply(e,r);return t.renderObjs.getScreenCoords(a.x,a.y,a.z)},toGlobeCoords:function(t,e,n){var r=t.renderObjs.intersectingObjects(e,n).find((function(t){return"globe"===t.object.__globeObjType}));if(!r)return null;var i=t.globe.toGeoCoords(r.point);return{lat:i.lat,lng:i.lng}},scene:function(t){return t.renderObjs.scene()},camera:function(t){return t.renderObjs.camera()},renderer:function(t){return t.renderObjs.renderer()},controls:function(t){return t.renderObjs.controls()},_destructor:function(t){t.globe._destructor(),this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([])}},nb),ab),stateInit:function(t){var n=t.rendererConfig,r=t.waitForGlobeReady,a=void 0===r||r,o=i(t,Jx),s=new Oy(e({waitForGlobeReady:a},o));return{globe:s,renderObjs:Zx({controlType:"orbit",rendererConfig:n,waitForLoadComplete:a,extraRenderers:[new $x.CSS2DRenderer]}).skyRadius(500*s.getGlobeRadius()).showNavInfo(!1).objects([s]).lights([new $x.AmbientLight(13421772,Math.PI),new $x.DirectionalLight(16777215,.6*Math.PI)])}},init:function(t,e){var n=this;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.style.position="relative";var r=document.createElement("div");e.container.appendChild(r),e.renderObjs(r),e.globe.rendererSize(e.renderObjs.renderer().getSize(new $x.Vector2)),this.pointOfView({altitude:2.5});var i=e.globe.getGlobeRadius(),a=e.renderObjs.controls();a.minDistance=1.01*i,a.maxDistance=100*i,a.enablePan=!1,a.enableDamping=!0,a.dampingFactor=.1,a.rotateSpeed=.3,a.zoomSpeed=.3,a.addEventListener("change",(function(){var t=n.pointOfView();a.rotateSpeed=.2*t.altitude,a.zoomSpeed=.1*(t.altitude+1),e.globe.setPointOfView(e.renderObjs.camera().position),e.onZoom&&e.onZoom(t)}));var o=function(t){for(var e=t;e&&!e.hasOwnProperty("__globeObjType");)e=e.parent;return e},s={point:function(t){return t},arc:function(t){return t},polygon:function(t){return t.data},path:function(t){return t},heatmap:function(t){return t},hexbin:function(t){return t},hexPolygon:function(t){return t},tile:function(t){return t},label:function(t){return t},object:function(t){return t},custom:function(t){return t}};$x.REVISION<155&&(e.renderObjs.renderer().useLegacyLights=!1),e.renderObjs.hoverOrderComparator((function(t,e){var n=o(t),r=o(e),i=function(t){return!t};return i(n)-i(r)})).tooltipContent((function(t){var n={point:e.pointLabel,arc:e.arcLabel,polygon:e.polygonLabel,path:e.pathLabel,hexbin:e.hexLabel,hexPolygon:e.hexPolygonLabel,tile:e.tileLabel,label:e.labelLabel,object:e.objectLabel,custom:e.customLayerLabel},r=o(t),i=r&&r.__globeObjType;return r&&i&&n.hasOwnProperty(i)&&s.hasOwnProperty(i)&&sf(n[i])(s[i](r.__data))||""})).onHover((function(t){var n={point:e.onPointHover,arc:e.onArcHover,polygon:e.onPolygonHover,path:e.onPathHover,heatmap:e.onHeatmapHover,hexbin:e.onHexHover,hexPolygon:e.onHexPolygonHover,tile:e.onTileHover,label:e.onLabelHover,object:e.onObjectHover,custom:e.onCustomLayerHover},r={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},i=o(t);if(i&&!n.hasOwnProperty(i.__globeObjType)&&(i=null),i!==e.hoverObj){var a=e.hoverObj?e.hoverObj.__globeObjType:null,A=e.hoverObj?s[a](e.hoverObj.__data):null,l=i?i.__globeObjType:null,c=i?s[l](i.__data):null;a&&a!==l&&n[a]&&n[a](null,A),l&&n[l]&&n[l](c,a===l?A:null),e.renderObjs.renderer().domElement.classList[l&&r[l]?"add":"remove"]("clickable"),e.hoverObj=i}})).onClick((function(t,r,i){if(t){var a={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},A=o(t),l=A.__globeObjType;if(A&&a.hasOwnProperty(l)&&a[l]){var c=[r];if("globe"===l){var u=n.toGeoCoords(i),h=u.lat,f=u.lng;c.unshift({lat:h,lng:f})}else c.push(n.toGeoCoords(i));s.hasOwnProperty(l)&&c.unshift(s[l](A.__data)),a[l].apply(a,c)}}})).onRightClick((function(t,r,i){if(t){var a={globe:e.onGlobeRightClick,point:e.onPointRightClick,arc:e.onArcRightClick,polygon:e.onPolygonRightClick,path:e.onPathRightClick,heatmap:e.onHeatmapRightClick,hexbin:e.onHexRightClick,hexPolygon:e.onHexPolygonRightClick,tile:e.onTileRightClick,label:e.onLabelRightClick,object:e.onObjectRightClick,custom:e.onCustomLayerRightClick},A=o(t),l=A.__globeObjType;if(A&&a.hasOwnProperty(l)&&a[l]){var c=[r];if("globe"===l){var u=n.toGeoCoords(i),h=u.lat,f=u.lng;c.unshift({lat:h,lng:f})}else c.push(n.toGeoCoords(i));s.hasOwnProperty(l)&&c.unshift(s[l](A.__data)),a[l].apply(a,c)}}})),this._animationCycle()}});return ob}));
     35   */var Og={};[["sizeOfH3Index",Ng],["sizeOfLatLng",Ng],["sizeOfCellBoundary",Ng],["sizeOfGeoLoop",Ng],["sizeOfGeoPolygon",Ng],["sizeOfLinkedGeoPolygon",Ng],["sizeOfCoordIJ",Ng],["readInt64AsDoubleFromPointer",Ng],["isValidCell",Ng,[Ng,Ng]],["latLngToCell",Ng,[Ng,Ng,Ng,Ng]],["cellToLatLng",Ng,[Ng,Ng,Ng]],["cellToBoundary",Ng,[Ng,Ng,Ng]],["maxGridDiskSize",Ng,[Ng,Ng]],["gridDisk",Ng,[Ng,Ng,Ng,Ng]],["gridDiskDistances",Ng,[Ng,Ng,Ng,Ng,Ng]],["gridRingUnsafe",Ng,[Ng,Ng,Ng,Ng]],["maxPolygonToCellsSize",Ng,[Ng,Ng,Ng,Ng]],["polygonToCells",Ng,[Ng,Ng,Ng,Ng]],["cellsToLinkedMultiPolygon",Ng,[Ng,Ng,Ng]],["destroyLinkedMultiPolygon",null,[Ng]],["compactCells",Ng,[Ng,Ng,Ng,Ng]],["uncompactCells",Ng,[Ng,Ng,Ng,Ng,Ng,Ng]],["uncompactCellsSize",Ng,[Ng,Ng,Ng,Ng,Ng]],["isPentagon",Ng,[Ng,Ng]],["isResClassIII",Ng,[Ng,Ng]],["getBaseCellNumber",Ng,[Ng,Ng]],["getResolution",Ng,[Ng,Ng]],["maxFaceCount",Ng,[Ng,Ng,Ng]],["getIcosahedronFaces",Ng,[Ng,Ng,Ng]],["cellToParent",Ng,[Ng,Ng,Ng,Ng]],["cellToChildren",Ng,[Ng,Ng,Ng,Ng]],["cellToCenterChild",Ng,[Ng,Ng,Ng,Ng]],["cellToChildrenSize",Ng,[Ng,Ng,Ng,Ng]],["cellToChildPos",Ng,[Ng,Ng,Ng,Ng]],["childPosToCell",Ng,[Ng,Ng,Ng,Ng,Ng,Ng]],["areNeighborCells",Ng,[Ng,Ng,Ng,Ng,Ng]],["cellsToDirectedEdge",Ng,[Ng,Ng,Ng,Ng,Ng]],["getDirectedEdgeOrigin",Ng,[Ng,Ng,Ng]],["getDirectedEdgeDestination",Ng,[Ng,Ng,Ng]],["isValidDirectedEdge",Ng,[Ng,Ng]],["directedEdgeToCells",Ng,[Ng,Ng,Ng]],["originToDirectedEdges",Ng,[Ng,Ng,Ng]],["directedEdgeToBoundary",Ng,[Ng,Ng,Ng]],["gridDistance",Ng,[Ng,Ng,Ng,Ng,Ng]],["gridPathCells",Ng,[Ng,Ng,Ng,Ng,Ng]],["gridPathCellsSize",Ng,[Ng,Ng,Ng,Ng,Ng]],["cellToLocalIj",Ng,[Ng,Ng,Ng,Ng,Ng,Ng]],["localIjToCell",Ng,[Ng,Ng,Ng,Ng,Ng]],["getHexagonAreaAvgM2",Ng,[Ng,Ng]],["getHexagonAreaAvgKm2",Ng,[Ng,Ng]],["getHexagonEdgeLengthAvgM",Ng,[Ng,Ng]],["getHexagonEdgeLengthAvgKm",Ng,[Ng,Ng]],["greatCircleDistanceM",Ng,[Ng,Ng]],["greatCircleDistanceKm",Ng,[Ng,Ng]],["greatCircleDistanceRads",Ng,[Ng,Ng]],["cellAreaM2",Ng,[Ng,Ng,Ng]],["cellAreaKm2",Ng,[Ng,Ng,Ng]],["cellAreaRads2",Ng,[Ng,Ng,Ng]],["edgeLengthM",Ng,[Ng,Ng,Ng]],["edgeLengthKm",Ng,[Ng,Ng,Ng]],["edgeLengthRads",Ng,[Ng,Ng,Ng]],["getNumCells",Ng,[Ng,Ng]],["getRes0Cells",Ng,[Ng]],["res0CellCount",Ng],["getPentagons",Ng,[Ng,Ng]],["pentagonCount",Ng],["cellToVertex",Ng,[Ng,Ng,Ng,Ng]],["cellToVertexes",Ng,[Ng,Ng,Ng]],["vertexToLatLng",Ng,[Ng,Ng,Ng]],["isValidVertex",Ng,[Ng,Ng]]].forEach((function(t){Og[t[0]]=Rg.cwrap.apply(Rg,t)}));var Fg=16,kg=Og.sizeOfH3Index(),zg=Og.sizeOfLatLng(),qg=Og.sizeOfCellBoundary(),Gg=Og.sizeOfGeoPolygon(),Vg=Og.sizeOfGeoLoop();Og.sizeOfLinkedGeoPolygon(),Og.sizeOfCoordIJ();var Hg=Math.pow(2,32)-1;var jg,Wg,Xg,Yg,Qg,$g,Zg,Kg,Jg=/[^0-9a-fA-F]/;function ty(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||Jg.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),Fg);return[parseInt(t.substring(t.length-8),Fg),e]}function ey(t){if(t>=0)return t.toString(Fg);var e=ny(8,(t&=2147483647).toString(Fg));return e=(parseInt(e[0],Fg)+8).toString(Fg)+e.substring(1)}function ny(t,e){for(var n=t-e.length,i="",r=0;r<n;r++)i+="0";return i+=e}function iy(t,e,n){for(var i=t.length,r=Rg._calloc(i,zg),s=n?1:0,a=n?0:1,o=0;o<2*i;o+=2)Rg.HEAPF64.set([t[o/2][s],t[o/2][a]].map(cy),r/8+o);return Rg.HEAPU32.set([i,r],e/4),e}function ry(t,e){void 0===e&&(e=0);var n=Rg.getValue(t+kg*e,"i32"),i=Rg.getValue(t+kg*e+4,"i32");return i?function(t,e){return ey(e)+ny(8,ey(t))}(n,i):null}function sy(t){return 180*Rg.getValue(t,"double")/Math.PI}function ay(t){return[sy(t+8),sy(t)]}function oy(t,e,n){var i=Rg._malloc(zg);Rg.HEAPF64.set([t,e].map(cy),i/8);var r=Rg._malloc(kg);try{return Ug(Og.latLngToCell(i,n,r)),function(t){if(!t)throw Bg(1002);return t}(ry(r))}finally{Rg._free(r),Rg._free(i)}}function ly(t){var e,n=Rg._malloc(zg),i=ty(t),r=i[0],s=i[1];try{return Ug(Og.cellToLatLng(r,s,n)),[sy(e=n),sy(e+8)]}finally{Rg._free(n)}}function uy(t,e){var n=Rg._malloc(qg),i=ty(t),r=i[0],s=i[1];try{return Ug(Og.cellToBoundary(r,s,n)),function(t){for(var e=Rg.getValue(t,"i32"),n=t+8,i=[],r=ay,s=0;s<2*e;s+=2)i.push(r(n+8*s));return i.push(i[0]),i}(n)}finally{Rg._free(n)}}function hy(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw Lg(4,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var i,r=function(t,e){var n,i=t.length-1,r=Rg._calloc(Gg),s=0+Vg,a=s+4;if(iy(t[0],r+0,e),i>0){n=Rg._calloc(i,Vg);for(var o=0;o<i;o++)iy(t[o+1],n+Vg*o,e)}return Rg.setValue(r+s,i,"i32"),Rg.setValue(r+a,n,"i32"),r}("number"==typeof t[0][0]?[t]:t,n),s=Rg._malloc(8);try{Ug(Og.maxPolygonToCellsSize(r,e,0,s));var a=function(t){if(t>Hg)throw Bg(1001,t);return t}((i=s,Og.readInt64AsDoubleFromPointer(i))),o=Rg._calloc(a,kg);try{return Ug(Og.polygonToCells(r,e,0,o)),function(t,e){for(var n=[],i=0;i<e;i++){var r=ry(t,i);null!==r&&n.push(r)}return n}(o,a)}finally{Rg._free(o)}}finally{Rg._free(s),function(t){var e=0+Vg,n=e+4;Rg._free(Rg.getValue(t+0+4,"i8*"));var i=Rg.getValue(t+e,"i32");if(i>0){for(var r=Rg.getValue(t+n,"i32"),s=0;s<i;s++)Rg._free(Rg.getValue(r+Vg*s+4,"i8*"));Rg._free(r)}Rg._free(t)}(r)}}function cy(t){return t*Math.PI/180}function Ay(){if(Wg)return jg;function t(t,e,n,i){this.x="number"==typeof t?t:0,this.y="number"==typeof e?e:0,this.z="number"==typeof n?n:0,this.half="number"==typeof i?i:0}return Wg=1,jg=t,t.prototype.contains=function(t,e,n){var i=this.half;return this.x-i<=t&&t<this.x+i&&this.y-i<=e&&e<this.y+i&&this.z-i<=n&&n<this.z+i},jg}var dy=function(){if(Kg)return Zg;Kg=1;var t=Ay(),e=function(){if(Yg)return Xg;Yg=1;var t=Ay();function e(t){this.bounds=t,this.q0=null,this.q1=null,this.q2=null,this.q3=null,this.q4=null,this.q5=null,this.q6=null,this.q7=null,this.items=null}return Xg=e,e.prototype.subdivide=function(){var n=this.bounds,i=n.half/2;this.q0=new e(new t(n.x-i,n.y-i,n.z-i,i)),this.q1=new e(new t(n.x+i,n.y-i,n.z-i,i)),this.q2=new e(new t(n.x-i,n.y+i,n.z-i,i)),this.q3=new e(new t(n.x+i,n.y+i,n.z-i,i)),this.q4=new e(new t(n.x-i,n.y-i,n.z+i,i)),this.q5=new e(new t(n.x+i,n.y-i,n.z+i,i)),this.q6=new e(new t(n.x-i,n.y+i,n.z+i,i)),this.q7=new e(new t(n.x+i,n.y+i,n.z+i,i))},e.prototype.insert=function(t,e,n){if(null===this.q0){if(null===this.items?this.items=[t]:this.items.push(t),this.items.length>=4&&n<16){this.subdivide();for(var i=0;i<this.items.length;++i)this.insert(this.items[i],e,n+1);this.items=null}}else{var r=e[t],s=e[t+1],a=e[t+2],o=this.bounds,l=0;r>o.x&&(l+=1),s>o.y&&(l+=2),a>o.z&&(l+=4);var u=function(t,e){return 0===e?t.q0:1===e?t.q1:2===e?t.q2:3===e?t.q3:4===e?t.q4:5===e?t.q5:6===e?t.q6:7===e?t.q7:void 0}(this,l);u.insert(t,e,n+1)}},e.prototype.query=function(t,e,n,i){if(n(this.bounds)){var r=this.items,s="function"==typeof i;if(r)for(var a=0;a<r.length;++a){var o=r[a];s?i(e[o],e[o+1],e[o+2])&&t.push(o):t.push(o)}this.q0&&(this.q0.query(t,e,n,i),this.q1.query(t,e,n,i),this.q2.query(t,e,n,i),this.q3.query(t,e,n,i),this.q4.query(t,e,n,i),this.q5.query(t,e,n,i),this.q6.query(t,e,n,i),this.q7.query(t,e,n,i))}},Xg}(),n=new t,i=($g||($g=1,Qg=function(t,e,n,i){var r=0,s=0,a=(i=i||{}).step||1,o=i.maxTimeMS||8,l=i.probeElements||5e3;setTimeout((function i(){var u=Math.min(t.length,r+l),h=r,c=new Date;for(h=r;h<u;h+=a)e(t[h],h,t);h<t.length?(s+=new Date-c,r=h,l=Math.round(r*o/s),setTimeout(i,0)):n(t)}),0)}),Qg);return Zg=function(r){var s,a,o=[],l={initAsync:function(t,e){h(t);var n=c(t);function r(e,i){n.insert(i,t,0)}function o(){a=t,s=n,"function"==typeof e&&e(l)}i(t,r,o,{step:3})},init:function(t){h(t),a=t,s=c(t);for(var e=0;e<t.length;e+=3)s.insert(e,a,0)},bounds:function(){return s?s.bounds:n},intersectRay:function(t,e,n,i){if(!s)return o;void 0===n&&(n=0);void 0===i&&(i=Number.POSITIVE_INFINITY);n*=n,i*=i;var r=[];return s.query(r,a,l,u),r.sort(h);function l(n){var r,s=n.half,a=(n.x-s-t.x)/e.x,o=(n.x+s-t.x)/e.x,l=(n.y+s-t.y)/e.y,u=(n.y-s-t.y)/e.y,h=(n.z-s-t.z)/e.z,c=(n.z+s-t.z)/e.z,A=Math.min(Math.min(Math.max(a,o),Math.max(l,u)),Math.max(h,c));return!(A<0)&&((r=Math.max(Math.max(Math.min(a,o),Math.min(l,u)),Math.min(h,c)))<=A&&r<=i)}function u(e,r,s){var a=(e-t.x)*(e-t.x)+(r-t.y)*(r-t.y)+(s-t.z)*(s-t.z);return n<=a&&a<=i}function h(e,n){var i=t[e],r=t[e+1],s=t[e+2],a=(i-t.x)*(i-t.x)+(r-t.y)*(r-t.y)+(s-t.z)*(s-t.z),o=t[n],l=t[n+1],u=t[n+2];return a-((o-t.x)*(o-t.x)+(l-t.y)*(l-t.y)+(u-t.z)*(u-t.z))}},intersectSphere:function(t,e,n,i){if(!s)return o;var r=[],l=i*i;return s.query(r,a,h,c),r;function h(i){var r=l,s=i.half;return t<i.x-s?r-=u(t-(i.x-s)):t>i.x+s&&(r-=u(t-(i.x+s))),e<i.y-s?r-=u(e-(i.y-s)):e>i.y+s&&(r-=u(e-(i.y+s))),n<i.z-s?r-=u(n-(i.z-s)):n>i.z+s&&(r-=u(n-(i.z+s))),r>0}function c(i,r,s){return u(i-t)+u(r-e)+u(s-n)<l}},getRoot:function(){return s}};return l;function u(t){return t*t}function h(t){if(!t)throw new Error("Points array is required for quadtree to work");if("number"!=typeof t.length)throw new Error("Points should be array-like object");if(t.length%3!=0)throw new Error("Points array should consist of series of x,y,z coordinates and be multiple of 3")}function c(n){if(0===n.length){var i=new t;return new e(i)}for(var r=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY,h=0;h<n.length;h+=3){var c=n[h],A=n[h+1],d=n[h+2];c<r&&(r=c),c>o&&(o=c),A<s&&(s=A),A>l&&(l=A),d<a&&(a=d),d>u&&(u=d)}var p=Math.max(Math.max(o-r,l-s),u-a),f=(p+=2)/2,m=new t((r-=1)+f,(s-=1)+f,(a-=1)+f,f);return new e(m)}},Zg}(),py=Tf(dy);const fy=new sn,my=new en;class gy extends Xl{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new Li([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new Li([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new $l(e,6,1);return this.setAttribute("instanceStart",new go(n,3,0)),this.setAttribute("instanceEnd",new go(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new $l(e,6,1);return this.setAttribute("instanceColorStart",new go(n,3,0)),this.setAttribute("instanceColorEnd",new go(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Dl(t.geometry)),this}fromLineSegments(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new sn);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),fy.setFromBufferAttribute(e),this.boundingBox.union(fy))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Sn),null===this.boundingBox&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let r=0,s=t.count;r<s;r++)my.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(my)),my.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(my));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}Cr.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Ee(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Rr.line={uniforms:ar.merge([Cr.common,Cr.fog,Cr.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tworldStart = start.xyz;\n\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t#else\n\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );\n\t\t\t\tvec3 worldUp = normalize( cross( worldDir, tmpFwd ) );\n\t\t\t\tvec3 worldFwd = cross( worldDir, worldUp );\n\t\t\t\tworldPos = position.y < 0.5 ? start: end;\n\n\t\t\t\t// height offset\n\t\t\t\tfloat hw = linewidth * 0.5;\n\t\t\t\tworldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// cap extension\n\t\t\t\t\tworldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;\n\n\t\t\t\t\t// add width to the box\n\t\t\t\t\tworldPos.xyz += worldFwd * hw;\n\n\t\t\t\t\t// endcaps\n\t\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\t\tworldPos.xyz -= worldFwd * 2.0 * hw;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segments overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <colorspace_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class yy extends or{constructor(t){super({type:"LineMaterial",uniforms:ar.clone(Rr.line.uniforms),vertexShader:Rr.line.vertexShader,fragmentShader:Rr.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){!0===t?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){!0===t!==this.dashed&&(this.needsUpdate=!0),!0===t?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(!0===t!==this.alphaToCoverage&&(this.needsUpdate=!0),!0===t?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const vy=new Qe,_y=new en,xy=new en,by=new Qe,Sy=new Qe,My=new Qe,wy=new en,Ty=new Dn,Ey=new class{constructor(t=new en,e=new en){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){eu.subVectors(t,this.start),nu.subVectors(this.end,this.start);const n=nu.dot(nu);let i=nu.dot(eu)/n;return e&&(i=xe(i,0,1)),i}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},Cy=new en,Ry=new sn,Ny=new Sn,Py=new Qe;let Dy,Iy;function Ly(t,e,n){return Py.set(0,0,-e,1).applyMatrix4(t.projectionMatrix),Py.multiplyScalar(1/Py.w),Py.x=Iy/n.width,Py.y=Iy/n.height,Py.applyMatrix4(t.projectionMatrixInverse),Py.multiplyScalar(1/Py.w),Math.abs(Math.max(Py.x,Py.y))}class By extends tr{constructor(t=new gy,e=new yy({color:16777215*Math.random()})){super(t,e),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.count);for(let t=0,r=0,s=e.count;t<s;t++,r+=2)_y.fromBufferAttribute(e,t),xy.fromBufferAttribute(n,t),i[r]=0===r?0:i[r-1],i[r+1]=i[r]+_y.distanceTo(xy);const r=new $l(i,2,1);return t.setAttribute("instanceDistanceStart",new go(r,1,0)),t.setAttribute("instanceDistanceEnd",new go(r,1,1)),this}raycast(t,e){const n=this.material.worldUnits,i=t.camera;null!==i||n||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const r=void 0!==t.params.Line2&&t.params.Line2.threshold||0;Dy=t.ray;const s=this.matrixWorld,a=this.geometry,o=this.material;let l,u;if(Iy=o.linewidth+r,null===a.boundingSphere&&a.computeBoundingSphere(),Ny.copy(a.boundingSphere).applyMatrix4(s),n)l=.5*Iy;else{l=Ly(i,Math.max(i.near,Ny.distanceToPoint(Dy.origin)),o.resolution)}if(Ny.radius+=l,!1!==Dy.intersectsSphere(Ny)){if(null===a.boundingBox&&a.computeBoundingBox(),Ry.copy(a.boundingBox).applyMatrix4(s),n)u=.5*Iy;else{u=Ly(i,Math.max(i.near,Ry.distanceToPoint(Dy.origin)),o.resolution)}Ry.expandByScalar(u),!1!==Dy.intersectsBox(Ry)&&(n?function(t,e){const n=t.matrixWorld,i=t.geometry,r=i.attributes.instanceStart,s=i.attributes.instanceEnd;for(let a=0,o=Math.min(i.instanceCount,r.count);a<o;a++){Ey.start.fromBufferAttribute(r,a),Ey.end.fromBufferAttribute(s,a),Ey.applyMatrix4(n);const i=new en,o=new en;Dy.distanceSqToSegment(Ey.start,Ey.end,o,i),o.distanceTo(i)<.5*Iy&&e.push({point:o,pointOnLine:i,distance:Dy.origin.distanceTo(o),object:t,face:null,faceIndex:a,uv:null,uv1:null})}}(this,e):function(t,e,n){const i=e.projectionMatrix,r=t.material.resolution,s=t.matrixWorld,a=t.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,u=Math.min(a.instanceCount,o.count),h=-e.near;Dy.at(1,My),My.w=1,My.applyMatrix4(e.matrixWorldInverse),My.applyMatrix4(i),My.multiplyScalar(1/My.w),My.x*=r.x/2,My.y*=r.y/2,My.z=0,wy.copy(My),Ty.multiplyMatrices(e.matrixWorldInverse,s);for(let e=0,a=u;e<a;e++){if(by.fromBufferAttribute(o,e),Sy.fromBufferAttribute(l,e),by.w=1,Sy.w=1,by.applyMatrix4(Ty),Sy.applyMatrix4(Ty),by.z>h&&Sy.z>h)continue;if(by.z>h){const t=by.z-Sy.z,e=(by.z-h)/t;by.lerp(Sy,e)}else if(Sy.z>h){const t=Sy.z-by.z,e=(Sy.z-h)/t;Sy.lerp(by,e)}by.applyMatrix4(i),Sy.applyMatrix4(i),by.multiplyScalar(1/by.w),Sy.multiplyScalar(1/Sy.w),by.x*=r.x/2,by.y*=r.y/2,Sy.x*=r.x/2,Sy.y*=r.y/2,Ey.start.copy(by),Ey.start.z=0,Ey.end.copy(Sy),Ey.end.z=0;const a=Ey.closestPointToPointParameter(wy,!0);Ey.at(a,Cy);const u=Te.lerp(by.z,Sy.z,a),c=u>=-1&&u<=1,A=wy.distanceTo(Cy)<.5*Iy;if(c&&A){Ey.start.fromBufferAttribute(o,e),Ey.end.fromBufferAttribute(l,e),Ey.start.applyMatrix4(s),Ey.end.applyMatrix4(s);const i=new en,r=new en;Dy.distanceSqToSegment(Ey.start,Ey.end,r,i),n.push({point:r,pointOnLine:i,distance:Dy.origin.distanceTo(r),object:t,face:null,faceIndex:e,uv:null,uv1:null})}}}(this,i,e))}}onBeforeRender(t){const e=this.material.uniforms;e&&e.resolution&&(t.getViewport(vy),this.material.uniforms.resolution.value.set(vy.z,vy.w))}}class Uy extends gy{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setPositions(n),this}setColors(t){const e=t.length-3,n=new Float32Array(2*e);for(let i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return super.setColors(n),this}fromLine(t){const e=t.geometry;return this.setPositions(e.attributes.position.array),this}}class Oy extends By{constructor(t=new Uy,e=new yy({color:16777215*Math.random()})){super(t,e),this.isLine2=!0,this.type="Line2"}}class Fy extends Cl{constructor(t,e={}){const n=e.font;if(void 0===n)super();else{const i=n.generateShapes(t,e.size);void 0===e.depth&&void 0!==e.height&&console.warn("THREE.TextGeometry: .height is now depreciated. Please use .depth instead"),e.depth=void 0!==e.depth?e.depth:void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),super(i,e)}this.type="TextGeometry"}}function ky(t,e,n,i,r){const s=r.glyphs[t]||r.glyphs["?"];if(!s)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");const a=new iu;let o,l,u,h,c,A,d,p;if(s.o){const t=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let r=0,s=t.length;r<s;){switch(t[r++]){case"m":o=t[r++]*e+n,l=t[r++]*e+i,a.moveTo(o,l);break;case"l":o=t[r++]*e+n,l=t[r++]*e+i,a.lineTo(o,l);break;case"q":u=t[r++]*e+n,h=t[r++]*e+i,c=t[r++]*e+n,A=t[r++]*e+i,a.quadraticCurveTo(c,A,u,h);break;case"b":u=t[r++]*e+n,h=t[r++]*e+i,c=t[r++]*e+n,A=t[r++]*e+i,d=t[r++]*e+n,p=t[r++]*e+i,a.bezierCurveTo(c,A,d,p,u,h)}}}return{offsetX:s.ha*e,path:a}}function zy(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function qy(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function Gy(t,e,n){return e=Zy(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Jy()?Reflect.construct(e,n||[],Zy(t).constructor):e.apply(t,n))}function Vy(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jy(t,e){return t.get(qy(t,e))}function Wy(t,e,n){Vy(t,e),e.set(t,n)}function Xy(t,e,n){return t.set(qy(t,e),n),n}function Yy(t,e,n){if(Jy())return Reflect.construct.apply(null,arguments);var i=[null];return i.push.apply(i,e),new(t.bind.apply(t,i))}function Qy(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,sv(i.key),i)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function $y(t,e,n){return(e=sv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zy(t){return Zy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zy(t)}function Ky(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nv(t,e)}function Jy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Jy=function(){return!!t})()}function tv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function ev(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tv(Object(n),!0).forEach((function(e){$y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function nv(t,e){return nv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nv(t,e)}function iv(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||av(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rv(t){return function(t){if(Array.isArray(t))return zy(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||av(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sv(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function av(t,e){if(t){if("string"==typeof t)return zy(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zy(t,e):void 0}}var ov=function(t){t instanceof Array?t.forEach(ov):(t.map&&t.map.dispose(),t.dispose())},lv=function(t){t.geometry&&t.geometry.dispose(),t.material&&ov(t.material),t.texture&&t.texture.dispose(),t.children&&t.children.forEach(lv)},uv=function(t){if(t&&t.children)for(;t.children.length;){var e=t.children[0];t.remove(e),lv(e)}};function hv(t,e){var n=new e;return{linkProp:function(e){return{default:n[e](),onChange:function(n,i){i[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var i=n[t],r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];var o=i[e].apply(i,s);return o===i?this:o}}}}var cv=100;function Av(){return cv}function dv(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=(90-t)*Math.PI/180,r=(90-e)*Math.PI/180,s=cv*(1+n);return{x:s*Math.sin(i)*Math.cos(r),y:s*Math.cos(i),z:s*Math.sin(i)*Math.sin(r)}}function pv(t){var e=t.x,n=t.y,i=t.z,r=Math.sqrt(e*e+n*n+i*i),s=Math.acos(n/r),a=Math.atan2(i,e);return{lat:90-180*s/Math.PI,lng:90-180*a/Math.PI-(a<-Math.PI/2?360:0),altitude:r/cv-1}}function fv(t){return t*Math.PI/180}var mv=window.THREE?window.THREE:{BackSide:1,BufferAttribute:Pi,Color:Mi,Mesh:tr,ShaderMaterial:or},gv={backside:!0,coefficient:.5,color:"gold",size:2,power:1};function yv(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gv,n=e.backside,i=e.coefficient,r=e.color,s=e.size,a=e.power,o=function(t,e){for(var n=t.clone(),i=new Float32Array(3*t.attributes.position.count),r=0,s=i.length;r<s;r++){var a=t.attributes.normal.array[r],o=t.attributes.position.array[r];i[r]=o+a*e}return n.setAttribute("position",new mv.BufferAttribute(i,3)),n}(t,s),l=function(t,e,n){return new mv.ShaderMaterial({depthWrite:!1,fragmentShader:"\nuniform vec3 color;\nuniform float coefficient;\nuniform float power;\nvarying vec3 vVertexNormal;\nvarying vec3 vVertexWorldPosition;\nvoid main() {\n  vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;\n  vec3 viewCameraToVertex\t= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;\n  viewCameraToVertex = normalize(viewCameraToVertex);\n  float intensity\t= pow(\n    coefficient + dot(vVertexNormal, viewCameraToVertex),\n    power\n  );\n  gl_FragColor = vec4(color, intensity);\n}",transparent:!0,uniforms:{coefficient:{value:t},color:{value:new mv.Color(e)},power:{value:n}},vertexShader:"\nvarying vec3 vVertexWorldPosition;\nvarying vec3 vVertexNormal;\nvoid main() {\n  vVertexNormal\t= normalize(normalMatrix * normal);\n  vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n  gl_Position\t= projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"})}(i,r,a);return n&&(l.side=mv.BackSide),new mv.Mesh(o,l)}var vv=window.THREE?window.THREE:{Color:Mi,LineBasicMaterial:vo,LineSegments:Po,Mesh:tr,MeshPhongMaterial:class extends Ei{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Mi(16777215),this.specular=new Mi(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Mi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ee(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Gn,this.combine=0,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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},SphereGeometry:Nl,SRGBColorSpace:Yt,TextureLoader:zl},_v=Fu({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(t,e){e.globeObj.visible=!!t},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(t,e){e.graticulesObj.visible=!!t},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(t,e){e.atmosphereObj&&(e.atmosphereObj.visible=!!t)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(t,e){return void 0!==e?(t.globeObj.material=e||t.defaultGlobeMaterial,this):t.globeObj.material},_destructor:function(t){uv(t.globeObj),uv(t.graticulesObj)}},stateInit:function(){var t=new vv.SphereGeometry(cv,75,75),e=new vv.MeshPhongMaterial({color:0}),n=new vv.Mesh(t,e);return n.rotation.y=-Math.PI/2,n.__globeObjType="globe",{globeObj:n,graticulesObj:new vv.LineSegments(new zd(cd(),cv,2),new vv.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1})),defaultGlobeMaterial:e}},init:function(t,e){uv(t),e.scene=t,e.scene.add(e.globeObj),e.scene.add(e.graticulesObj),e.ready=!1},update:function(t,e){var n=t.globeObj.material;if(e.hasOwnProperty("globeImageUrl")&&(t.globeImageUrl?(new vv.TextureLoader).load(t.globeImageUrl,(function(e){e.colorSpace=vv.SRGBColorSpace,n.map=e,n.color=null,n.needsUpdate=!0,!t.ready&&(t.ready=!0)&&setTimeout(t.onReady)})):!n.color&&(n.color=new vv.Color(0))),e.hasOwnProperty("bumpImageUrl")&&(t.bumpImageUrl?t.bumpImageUrl&&(new vv.TextureLoader).load(t.bumpImageUrl,(function(t){n.bumpMap=t,n.needsUpdate=!0})):(n.bumpMap=null,n.needsUpdate=!0)),(e.hasOwnProperty("atmosphereColor")||e.hasOwnProperty("atmosphereAltitude"))&&(t.atmosphereObj&&(t.scene.remove(t.atmosphereObj),uv(t.atmosphereObj)),t.atmosphereColor&&t.atmosphereAltitude)){var i=t.atmosphereObj=yv(t.globeObj.geometry,{backside:!0,color:t.atmosphereColor,size:cv*t.atmosphereAltitude,power:3.5,coefficient:.1});i.visible=!!t.showAtmosphere,i.__globeObjType="atmosphere",t.scene.add(i)}t.ready||t.globeImageUrl||(t.ready=!0,t.onReady())}}),xv=function(t){return isNaN(t)?parseInt(Pp(t).toHex(),16):t},bv=function(t){return t&&isNaN(t)?Ap(t).opacity:1},Sv=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=1,s=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(t.trim().toLowerCase());if(s){var a=iv(s.slice(1),4),o=a[0],l=a[1],u=a[2],h=a[3];e=new Mi("rgb(".concat(+o,",").concat(+l,",").concat(+u,")")),r=Math.min(+h,1)}else e=new Mi(t);i&&e.convertLinearToSRGB();var c=e.toArray();return n?[].concat(rv(c),[r]):c};var Mv=window.THREE?window.THREE:{Float32BufferAttribute:Li};function wv(t,e){var n=new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mv.Float32BufferAttribute)(t.length*e,e);return 1===e?t.forEach((function(t,e){return n.setX(e,t)})):t.forEach((function(t,i){return n.set(t,i*e)})),n}function Tv(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).removeDelay,r=void 0===i?0:i;return wf(t,e.children,(function(t){return e.add(t)}),(function(t){var n=function(){e.remove(t),uv(t),t&&t.hasOwnProperty("__data")&&delete t.__data.__currentTargetD};r?setTimeout(n,r):n()}),ev({objBindAttr:"__threeObj"},n))}var Ev=window.THREE?window.THREE:{BufferGeometry:Gi,Color:Mi,CylinderGeometry:Ko,Matrix4:Dn,Mesh:tr,MeshLambertMaterial:Ll,Object3D:si,Vector3:en},Cv=Object.assign({},Wd),Rv=Cv.BufferGeometryUtils||Cv,Nv=Fu({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return"#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.pointLat),n=Xd(t.pointLng),i=Xd(t.pointAltitude),r=Xd(t.pointRadius),s=Xd(t.pointColor),a=new Ev.CylinderGeometry(1,1,1,t.pointResolution);a.applyMatrix4((new Ev.Matrix4).makeRotationX(Math.PI/2)),a.applyMatrix4((new Ev.Matrix4).makeTranslation(0,0,-.5));var o=2*Math.PI*cv/360,l={},u=t.pointsMerge?new Ev.Object3D:t.scene;if(Tv(t.pointsData,u,{createObj:function(){var t=new Ev.Mesh(a);return t.__globeObjType="point",t},updateObj:function(a,u){var h=function(e){var n=a.__currentTargetD=e,i=n.r,r=n.alt,s=n.lat,l=n.lng;Object.assign(a.position,dv(s,l));var u=t.pointsMerge?new Ev.Vector3(0,0,0):t.scene.localToWorld(new Ev.Vector3(0,0,0));a.lookAt(u),a.scale.x=a.scale.y=Math.min(30,i)*o,a.scale.z=Math.max(r*cv,.1)},c={alt:+i(u),r:+r(u),lat:+e(u),lng:+n(u)},A=a.__currentTargetD||Object.assign({},c,{alt:-.001});Object.keys(c).some((function(t){return A[t]!==c[t]}))&&(t.pointsMerge||!t.pointsTransitionDuration||t.pointsTransitionDuration<0?h(c):t.tweenGroup.add(new Wu(A).to(c,t.pointsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(h).start()));if(!t.pointsMerge){var d=s(u),p=d?bv(d):0,f=!!p;a.visible=f,f&&(l.hasOwnProperty(d)||(l[d]=new Ev.MeshLambertMaterial({color:xv(d),transparent:p<1,opacity:p})),a.material=l[d])}}}),t.pointsMerge){var h=t.pointsData.length?(Rv.mergeGeometries||Rv.mergeBufferGeometries)(t.pointsData.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.clone();e.updateMatrix(),n.applyMatrix4(e.matrix);var i=Sv(s(t));return n.setAttribute("color",wv(rv(new Array(n.getAttribute("position").count)).map((function(){return i})),4)),n}))):new Ev.BufferGeometry,c=new Ev.Mesh(h,new Ev.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));c.__globeObjType="points",c.__data=t.pointsData,uv(t.scene),t.scene.add(c)}}}),Pv=["stroke"],Dv=window.THREE?window.THREE:{BufferGeometry:Gi,CubicBezierCurve3:Vo,Curve:Do,Group:so,Line:Eo,Mesh:tr,NormalBlending:1,QuadraticBezierCurve3:Wo,ShaderMaterial:or,TubeGeometry:Pl,Vector3:en},Iv=Nf.default||Nf,Lv={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n    uniform float dashTranslate; \n\n    attribute vec4 vertexColor;\n    varying vec4 vColor;\n    \n    attribute float vertexRelDistance;\n    varying float vRelDistance;\n\n    void main() {\n      // pass through colors and distances\n      vColor = vertexColor;\n      vRelDistance = vertexRelDistance + dashTranslate;\n      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n    }\n  ",fragmentShader:"\n    uniform float dashOffset; \n    uniform float dashSize;\n    uniform float gapSize; \n    \n    varying vec4 vColor;\n    varying float vRelDistance;\n    \n    void main() {\n      // ignore pixels in the gap\n      if (vRelDistance < dashOffset) discard;\n      if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n    \n      // set px color: [r, g, b, a], interpolated between vertices \n      gl_FragColor = vColor; \n    }\n  "},Bv=Fu({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:function(){return"#ffffaa"}},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i,e.ticker=new Iv,e.ticker.onTick.add((function(t,n){e.arcsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],i=e.__dashAnimateStep*n,r=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=r+i}))}))},update:function(t){var e=Xd(t.arcStartLat),n=Xd(t.arcStartLng),i=Xd(t.arcEndLat),r=Xd(t.arcEndLng),s=Xd(t.arcAltitude),a=Xd(t.arcAltitudeAutoScale),o=Xd(t.arcStroke),l=Xd(t.arcColor),u=Xd(t.arcDashLength),h=Xd(t.arcDashGap),c=Xd(t.arcDashInitialGap),A=Xd(t.arcDashAnimateTime),d=new Dv.ShaderMaterial(ev(ev({},Lv),{},{transparent:!0,blending:Dv.NormalBlending}));Tv(t.arcsData,t.scene,{createObj:function(){var t=new Dv.Group;return t.__globeObjType="arc",t},updateObj:function(p,f){var m=o(f),g=null!=m;if(!p.children.length||g!==("Mesh"===p.children[0].type)){uv(p);var y=g?new Dv.Mesh:new Dv.Line(new Dv.BufferGeometry);y.material=d.clone(),p.add(y)}var v=p.children[0];Object.assign(v.material.uniforms,{dashSize:{value:u(f)},gapSize:{value:h(f)},dashOffset:{value:c(f)}});var _=A(f);v.__dashAnimateStep=_>0?1e3/_:0;var x=function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e+1;if(t instanceof Array||t instanceof Function){var s=t instanceof Array?ym().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return Sv(s(t),!0,!0)}}else{var a=Sv(t,!0,!0);n=function(){return a}}for(var o=[],l=0,u=r;l<u;l++)for(var h=n(l/(u-1)),c=0;c<i;c++)o.push(h);return wv(o,4)}(l(f),t.arcCurveResolution,g?t.arcCircularResolution+1:1),b=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[],r=0,s=t+1;r<s;r++)for(var a=r/(s-1),o=0;o<e;o++)i.push(a);return n&&i.reverse(),wv(i,1)}(t.arcCurveResolution,g?t.arcCircularResolution+1:1,!0);v.geometry.setAttribute("vertexColor",x),v.geometry.setAttribute("vertexRelDistance",b);var S=function(e){var n=f.__currentTargetD=e,i=n.stroke,r=function(t){var e=t.alt,n=t.altAutoScale,i=t.startLat,r=t.startLng,s=t.endLat,a=t.endLng,o=function(t){var e=iv(t,3),n=e[0],i=dv(e[1],n,e[2]),r=i.x,s=i.y,a=i.z;return new Dv.Vector3(r,s,a)},l=[r,i],u=[a,s],h=e;if(null==h&&(h=td(l,u)/2*n),h){var c=Ad(l,u),A=iv([.25,.75].map((function(t){return[].concat(rv(c(t)),[1.5*h])})),2),d=A[0],p=A[1];return Yy(Dv.CubicBezierCurve3,rv([l,d,p,u].map(o)))}var f=.001;return m.apply(void 0,rv([[].concat(l,[f]),[].concat(u,[f])].map(o)));function m(t,e){var n=t.angleTo(e),i=0===n?function(){return t.clone()}:function(i){return(new Dv.Vector3).addVectors(t.clone().multiplyScalar(Math.sin((1-i)*n)),e.clone().multiplyScalar(Math.sin(i*n))).divideScalar(Math.sin(n))},r=new Dv.Curve;return r.getPoint=i,r}}(function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(n,Pv));g?(v.geometry&&v.geometry.dispose(),v.geometry=new Dv.TubeGeometry(r,t.arcCurveResolution,i/2,t.arcCircularResolution),v.geometry.setAttribute("vertexColor",x),v.geometry.setAttribute("vertexRelDistance",b)):v.geometry.setFromPoints(r.getPoints(t.arcCurveResolution))},M={stroke:m,alt:s(f),altAutoScale:+a(f),startLat:+e(f),startLng:+n(f),endLat:+i(f),endLng:+r(f)},w=f.__currentTargetD||Object.assign({},M,{altAutoScale:-.001});Object.keys(M).some((function(t){return w[t]!==M[t]}))&&(!t.arcsTransitionDuration||t.arcsTransitionDuration<0?S(M):t.tweenGroup.add(new Wu(w).to(M,t.arcsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(S).start()))}})}}),Uv=window.THREE?window.THREE:{BufferGeometry:Gi,Color:Mi,DoubleSide:2,Mesh:tr,MeshLambertMaterial:Ll,Object3D:si},Ov=Object.assign({},Wd),Fv=Ov.BufferGeometryUtils||Ov,kv=Fu({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1},hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return"#ffffaa"}},hexSideColor:{default:function(){return"#ffffaa"}},hexAltitude:{default:function(t){return.01*t.sumWeight}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.hexBinPointLat),n=Xd(t.hexBinPointLng),i=Xd(t.hexBinPointWeight),r=Xd(t.hexAltitude),s=Xd(t.hexTopColor),a=Xd(t.hexSideColor),o=Xd(t.hexMargin),l=ff(t.hexBinPointsData.map((function(i){return ev(ev({},i),{},{h3Idx:oy(e(i),n(i),t.hexBinResolution)})})),"h3Idx"),u=Object.entries(l).map((function(t){var e=iv(t,2),n=e[0],r=e[1];return{h3Idx:n,points:r,sumWeight:r.reduce((function(t,e){return t+ +i(e)}),0)}})),h={};if(Tv(u,t.hexBinMerge?new Uv.Object3D:t.scene,{createObj:function(t){var e=new Uv.Mesh;e.__hexCenter=ly(t.h3Idx),e.__hexGeoJson=uy(t.h3Idx).reverse();var n=e.__hexCenter[1];return e.__hexGeoJson.forEach((function(t){var e=t[0];Math.abs(n-e)>170&&(t[0]+=n>e?360:-360)})),e.__globeObjType="hexbin",e},updateObj:function(e,n){var i=Math.max(0,Math.min(1,+o(n))),l=iv(e.__hexCenter,2),u=l[0],c=l[1],A=0===i?e.__hexGeoJson:e.__hexGeoJson.map((function(t){var e=iv(t,2),n=e[0],r=e[1];return[[n,c],[r,u]].map((function(t){var e=iv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],i)}))})),d=t.hexTopCurvatureResolution;e.geometry&&e.geometry.dispose(),e.geometry=new Cg([A],0,cv,!1,!0,!0,d);var p={alt:+r(n)},f=function(t){var n=(e.__currentTargetD=t).alt;e.scale.x=e.scale.y=e.scale.z=1+n},m=e.__currentTargetD||Object.assign({},p,{alt:-.001});Object.keys(p).some((function(t){return m[t]!==p[t]}))&&(t.hexBinMerge||!t.hexTransitionDuration||t.hexTransitionDuration<0?f(p):t.tweenGroup.add(new Wu(m).to(p,t.hexTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(f).start()));if(!t.hexBinMerge){var g=a(n),y=s(n);[g,y].forEach((function(t){if(!h.hasOwnProperty(t)){var e=bv(t);h[t]=new Uv.MeshLambertMaterial({color:xv(t),transparent:e<1,opacity:e,side:Uv.DoubleSide})}})),e.material=[g,y].map((function(t){return h[t]}))}},idAccessor:function(t){return t.h3Idx}}),t.hexBinMerge){var c=u.length?(Fv.mergeGeometries||Fv.mergeBufferGeometries)(u.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.toNonIndexed();e.updateMatrix(),n.applyMatrix4(e.matrix);var i=Sv(s(t)),r=Sv(a(t)),o=n.getAttribute("position").count,l=n.groups[0].count;return n.setAttribute("color",wv(rv(new Array(o)).map((function(t,e){return e>=l?i:r})),4)),n}))):new Uv.BufferGeometry,A=new Uv.Mesh(c,new Uv.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:Uv.DoubleSide}));A.__globeObjType="hexBinPoints",A.__data=u,uv(t.scene),t.scene.add(A)}}}),zv=function(t){return t*t};var qv=Math.sqrt(2*Math.PI);var Gv=function(t){var e=iv(t,2),n=e[0],i=e[1],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=s.lngAccessor,o=void 0===a?function(t){return t[0]}:a,l=s.latAccessor,u=void 0===l?function(t){return t[1]}:l,h=s.weightAccessor,c=void 0===h?function(){return 1}:h,A=s.bandwidth,d=[n,i],p=A*Math.PI/180;return function(t){let e=0;for(let n of t)(n=+n)&&(e+=n);return e}(r.map((function(t){var e=c(t);if(!e)return 0;var n,i,r=function(t,e){var n=Math.sqrt,i=Math.cos,r=function(t){return t*Math.PI/180},s=function(t){return zv(Math.sin(t/2))},a=r(t[1]),o=r(e[1]),l=r(t[0]),u=r(e[0]);return 2*Math.asin(n(s(o-a)+i(a)*i(o)*s(u-l)))}(d,[o(t),u(t)]);return n=r,i=p,Math.exp(-zv(n/i)/2)/(i*qv)*e})))},Vv=window.THREE?window.THREE:{Mesh:tr,MeshLambertMaterial:Ll,SphereGeometry:Nl},Hv=new WeakSet,jv=new WeakMap,Wv=new WeakMap,Xv=new WeakMap,Yv=function(){return Qy((function t(e,n){Hy(this,t),function(t,e){Vy(t,e),e.add(t)}(this,Hv),Wy(this,jv,void 0),Wy(this,Wv,void 0),Wy(this,Xv,void 0),Xy(jv,this,e),Xy(Wv,this,py()),jy(Wv,this).init(e.map((function(t){return[t.x,t.y,t.z]})).flat()),Xy(Xv,this,qy(Hv,this,Qv).call(this,dv(0,0),dv(0,Math.min(180,n))))}),[{key:"getNearPoints",value:function(t,e,n){var i=this;return jy(Wv,this).intersectSphere(t,e,n,jy(Xv,this)).map((function(t){return jy(jv,i)[t/3]}))}}])}();function Qv(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)+Math.pow(t.z-e.z,2))}var $v=function(t){var e=Ap(function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}(t));return e.opacity=Math.cbrt(t),e.formatRgb()},Zv=Fu({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(t){return t}},heatmapPointLat:{default:function(t){return t[0]}},heatmapPointLng:{default:function(t){return t[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:4},heatmapColorFn:{default:function(){return $v}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.heatmapPoints),n=Xd(t.heatmapPointLat),i=Xd(t.heatmapPointLng),r=Xd(t.heatmapPointWeight),s=Xd(t.heatmapBandwidth),a=Xd(t.heatmapColorFn),o=Xd(t.heatmapColorSaturation),l=Xd(t.heatmapBaseAltitude),u=Xd(t.heatmapTopAltitude);Tv(t.heatmapsData,t.scene,{createObj:function(t){var e=new Vv.Mesh(new Vv.SphereGeometry(cv),new Vv.MeshLambertMaterial({vertexColors:!0,transparent:!0}));return e.__globeObjType="heatmap",e},updateObj:function(h,c){var A=s(c),d=a(c),p=o(c),f=l(c),m=u(c),g=e(c).map((function(t){var e=n(t),s=i(t),a=dv(e,s);return{x:a.x,y:a.y,z:a.z,lat:e,lng:s,weight:r(t)}})),y=Math.max(.1,A/3.5),v=Math.ceil(360/(y||-1));h.geometry.parameters.widthSegments!==v&&(h.geometry.dispose(),h.geometry=new Vv.SphereGeometry(cv,v,v/2));var _=function(t){for(var e=t.itemSize,n=[],i=0;i<t.count;i++)n.push(t.array.slice(i*e,(i+1)*e));return n}(h.geometry.getAttribute("position")),x=_.map((function(t){var e=iv(t,3),n=pv({x:e[0],y:e[1],z:e[2]});return[n.lng,n.lat]})),b=new Yv(g,3.5*A),S=x.map((function(t,e){var n=iv(_[e],3),i=n[0],r=n[1],s=n[2];return Gv(t,b.getNearPoints(i,r,s),{latAccessor:function(t){return t.lat},lngAccessor:function(t){return t.lng},weightAccessor:function(t){return t.weight},bandwidth:A})})),M=function(t){var e=h.__currentTargetD=t,n=e.kdeVals,i=e.topAlt,r=e.saturation,s=function(t){let e;for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);return e}(n.map(Math.abs))||1e-15;h.geometry.setAttribute("color",wv(n.map((function(t){return Sv(d(t/s*r))})),4));var a=ym([0,s],[f,i||f]);h.geometry.setAttribute("position",wv(n.map((function(t,e){var n=iv(x[e],2),i=n[0],r=dv(n[1],i,a(Math.abs(t)));return[r.x,r.y,r.z]})),3))},w={kdeVals:S,topAlt:m,saturation:p},T=h.__currentTargetD||Object.assign({},w,{kdeVals:S.map((function(){return 0})),topAlt:m?f:m,saturation:.5});T.kdeVals.length!==S.length&&(T.kdeVals=S.slice()),Object.keys(w).some((function(t){return T[t]!==w[t]}))&&(!t.heatmapsTransitionDuration||t.heatmapsTransitionDuration<0?M(w):t.tweenGroup.add(new Wu(T).to(w,t.heatmapsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(M).start()))}})}}),Kv=window.THREE?window.THREE:{DoubleSide:2,Group:so,LineBasicMaterial:vo,LineSegments:Po,Mesh:tr,MeshBasicMaterial:Ci},Jv=Fu({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return"#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return"#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.polygonGeoJsonGeometry),n=Xd(t.polygonAltitude),i=Xd(t.polygonCapCurvatureResolution),r=Xd(t.polygonCapColor),s=Xd(t.polygonCapMaterial),a=Xd(t.polygonSideColor),o=Xd(t.polygonSideMaterial),l=Xd(t.polygonStrokeColor),u=[];t.polygonsData.forEach((function(t){var h={data:t,capColor:r(t),capMaterial:s(t),sideColor:a(t),sideMaterial:o(t),strokeColor:l(t),altitude:+n(t),capCurvatureResolution:+i(t)},c=e(t),A=t.__id||"".concat(Math.round(1e9*Math.random()));t.__id=A,"Polygon"===c.type?u.push(ev({id:"".concat(A,"_0"),coords:c.coordinates},h)):"MultiPolygon"===c.type?u.push.apply(u,rv(c.coordinates.map((function(t,e){return ev({id:"".concat(A,"_").concat(e),coords:t},h)})))):console.warn("Unsupported GeoJson geometry type: ".concat(c.type,". Skipping geometry..."))})),Tv(u,t.scene,{idAccessor:function(t){return t.id},createObj:function(){var t=new Kv.Group;return t.__defaultSideMaterial=new Kv.MeshBasicMaterial({side:Kv.DoubleSide,depthWrite:!0}),t.__defaultCapMaterial=new Kv.MeshBasicMaterial({side:Kv.DoubleSide,depthWrite:!0}),t.add(new Kv.Mesh(void 0,[t.__defaultSideMaterial,t.__defaultCapMaterial])),t.add(new Kv.LineSegments(void 0,new Kv.LineBasicMaterial)),t.__globeObjType="polygon",t},updateObj:function(e,n){var i=n.coords,r=n.capColor,s=n.capMaterial,a=n.sideColor,o=n.sideMaterial,l=n.strokeColor,u=n.altitude,h=n.capCurvatureResolution,c=iv(e.children,2),A=c[0],d=c[1],p=!!l;if(d.visible=p,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return function(t,e){return t===e}};return Object.entries(e).every((function(e){var i=iv(e,2),r=i[0],s=i[1];return t.hasOwnProperty(r)&&n(r)(t[r],s)}))}(A.geometry.parameters||{},{polygonGeoJson:i,curvatureResolution:h})||(A.geometry&&A.geometry.dispose(),A.geometry=new Cg(i,0,cv,!1,!0,!0,h)),!p||d.geometry.parameters&&d.geometry.parameters.geoJson.coordinates===i&&d.geometry.parameters.resolution===h||(d.geometry&&d.geometry.dispose(),d.geometry=new zd({type:"Polygon",coordinates:i},cv,h)),A.material[0]=o||e.__defaultSideMaterial,A.material[1]=s||e.__defaultCapMaterial,[!o&&a,!s&&r].forEach((function(t,e){if(t){var n=A.material[e],i=bv(t);n.color.set(xv(t)),n.transparent=i<1,n.opacity=i}})),p){var f=d.material,m=bv(l);f.color.set(xv(l)),f.transparent=m<1,f.opacity=m}var g={alt:u},y=function(t){var n=(e.__currentTargetD=t).alt;A.scale.x=A.scale.y=A.scale.z=1+n,p&&(d.scale.x=d.scale.y=d.scale.z=1+n+1e-4)},v=e.__currentTargetD||Object.assign({},g,{alt:-.001});Object.keys(g).some((function(t){return v[t]!==g[t]}))&&(!t.polygonsTransitionDuration||t.polygonsTransitionDuration<0||v.alt===g.alt?y(g):t.tweenGroup.add(new Wu(v).to(g,t.polygonsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(y).start()))}})}});var t_=window.THREE?window.THREE:{BufferGeometry:Gi,CircleGeometry:Zo,DoubleSide:2,Mesh:tr,MeshLambertMaterial:Ll,Vector3:en},e_=Object.assign({},Wd),n_=e_.BufferGeometryUtils||e_,i_=Fu({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.hexPolygonGeoJsonGeometry),n=Xd(t.hexPolygonColor),i=Xd(t.hexPolygonAltitude),r=Xd(t.hexPolygonResolution),s=Xd(t.hexPolygonMargin),a=Xd(t.hexPolygonUseDots),o=Xd(t.hexPolygonCurvatureResolution),l=Xd(t.hexPolygonDotResolution);Tv(t.hexPolygonsData,t.scene,{createObj:function(t){var e=new t_.Mesh(void 0,new t_.MeshLambertMaterial({side:t_.DoubleSide}));return e.__globeObjType="hexPolygon",e},updateObj:function(u,h){var c=e(h),A=r(h),d=i(h),p=Math.max(0,Math.min(1,+s(h))),f=a(h),m=o(h),g=l(h),y=n(h),v=bv(y);u.material.color.set(xv(y)),u.material.transparent=v<1,u.material.opacity=v;var _={alt:d,margin:p,curvatureResolution:m},x={geoJson:c,h3Res:A},b=u.__currentTargetD||Object.assign({},_,{alt:-.001}),S=u.__currentMemD||x;if(Object.keys(_).some((function(t){return b[t]!==_[t]}))||Object.keys(x).some((function(t){return S[t]!==x[t]}))){u.__currentMemD=x;var M=[];"Polygon"===c.type?hy(c.coordinates,A,!0).forEach((function(t){return M.push(t)})):"MultiPolygon"===c.type?c.coordinates.forEach((function(t){return hy(t,A,!0).forEach((function(t){return M.push(t)}))})):console.warn("Unsupported GeoJson geometry type: ".concat(c.type,". Skipping geometry..."));var w=M.map((function(t){var e=ly(t),n=uy(t).reverse(),i=e[1];return n.forEach((function(t){var e=t[0];Math.abs(i-e)>170&&(t[0]+=i>e?360:-360)})),{h3Idx:t,hexCenter:e,hexGeoJson:n}})),T=function(t){var e=u.__currentTargetD=t,n=e.alt,i=e.margin,r=e.curvatureResolution;u.geometry&&u.geometry.dispose(),u.geometry=w.length?(n_.mergeGeometries||n_.mergeBufferGeometries)(w.map((function(t){var e=iv(t.hexCenter,2),s=e[0],a=e[1];if(f){var o=dv(s,a,n),l=dv(t.hexGeoJson[0][1],t.hexGeoJson[0][0],n),u=.85*(1-i)*new t_.Vector3(o.x,o.y,o.z).distanceTo(new t_.Vector3(l.x,l.y,l.z)),h=new Zo(u,g);return h.rotateX(fv(-s)),h.rotateY(fv(a)),h.translate(o.x,o.y,o.z),h}var c=0===i?t.hexGeoJson:t.hexGeoJson.map((function(t){var e=iv(t,2),n=e[0],r=e[1];return[[n,a],[r,s]].map((function(t){var e=iv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],i)}))}));return new Cg([c],cv,cv*(1+n),!1,!0,!1,r)}))):new t_.BufferGeometry};!t.hexPolygonsTransitionDuration||t.hexPolygonsTransitionDuration<0?T(_):t.tweenGroup.add(new Wu(b).to(_,t.hexPolygonsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(T).start())}}})}}),r_=window.THREE?window.THREE:{Vector3:en};function s_(t,e){var n=Math.max(t.length,e.length),i=Ff.apply(void 0,rv([t,e].map((function(t){return t.map((function(t){return[t.x,t.y,t.z]}))})).map((function(t){return function(t,e){var n=t[t.length-1];return[].concat(rv(t),rv(rv(new Array(e-t.length)).map((function(){return n}))))}(t,n)}))));return function(n){return 0===n?t:1===n?e:i(n).map((function(t){var e=iv(t,3),n=e[0],i=e[1],r=e[2];return new r_.Vector3(n,i,r)}))}}var a_=window.THREE?window.THREE:{BufferGeometry:Gi,Color:Mi,Group:so,Line:Eo,NormalBlending:1,ShaderMaterial:or,Vector3:en},o_=Nf.default||Nf,l_={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n    uniform float dashTranslate;\n\n    attribute vec4 vertexColor;\n    varying vec4 vColor;\n\n    attribute float vertexRelDistance;\n    varying float vRelDistance;\n\n    void main() {\n      // pass through colors and distances\n      vColor = vertexColor;\n      vRelDistance = vertexRelDistance + dashTranslate;\n      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n    }\n  ",fragmentShader:"\n    uniform float dashOffset;\n    uniform float dashSize;\n    uniform float gapSize;\n\n    varying vec4 vColor;\n    varying float vRelDistance;\n\n    void main() {\n      // ignore pixels in the gap\n      if (vRelDistance < dashOffset) discard;\n      if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n\n      // set px color: [r, g, b, a], interpolated between vertices\n      gl_FragColor = vColor;\n    }\n  "},u_=Fu({props:{pathsData:{default:[]},pathPoints:{default:function(t){return t}},pathPointLat:{default:function(t){return t[0]}},pathPointLng:{default:function(t){return t[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return"#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i,e.ticker=new o_,e.ticker.onTick.add((function(t,n){e.pathsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],i=e.__dashAnimateStep*n;if("Line"===e.type){var r=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=r+i}else if("Line2"===e.type){for(var s=e.material.dashOffset-i,a=e.material.dashSize+e.material.gapSize;s<=-a;)s+=a;e.material.dashOffset=s}}))}))},update:function(t){var e=Xd(t.pathPoints),n=Xd(t.pathPointLat),i=Xd(t.pathPointLng),r=Xd(t.pathPointAlt),s=Xd(t.pathStroke),a=Xd(t.pathColor),o=Xd(t.pathDashLength),l=Xd(t.pathDashGap),u=Xd(t.pathDashInitialGap),h=Xd(t.pathDashAnimateTime),c=new a_.ShaderMaterial(ev(ev({},l_),{},{transparent:!0,blending:a_.NormalBlending}));function A(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=e+1;if(t instanceof Array||t instanceof Function){var a=t instanceof Array?ym().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return Sv(a(t),r,!0)}}else{var o=Sv(t,r,!0);n=function(){return o}}for(var l=[],u=0,h=s;u<h;u++)for(var c=n(u/(h-1)),A=0;A<i;A++)l.push(c);return wv(l,r?4:3)}Tv(t.pathsData,t.scene,{createObj:function(){var t=new a_.Group;return t.__globeObjType="path",t},updateObj:function(d,p){var f=s(p),m=null!=f;if(!d.children.length||m===("Line"===d.children[0].type)){uv(d);var g=m?new Oy(new Uy,new yy):new a_.Line(new a_.BufferGeometry,c.clone());d.add(g)}var y,v,_=d.children[0],x=function(t,e,n,i,r){var s=function(t,e,n){for(var i=[],r=1;r<=n;r++)i.push(t+(e-t)*r/(n+1));return i},a=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(i){if(n){for(;Math.abs(n[1]-i[1])>180;)n[1]+=360*(n[1]<i[1]?1:-1);var r=Math.sqrt(Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2));if(r>t)for(var a=Math.floor(r/t),o=s(n[0],i[0],a),l=s(n[1],i[1],a),u=s(n[2],i[2],a),h=0,c=o.length;h<c;h++)e.push([o[h],l[h],u[h]])}e.push(n=i)})),e},o=function(t){var e=iv(t,3),n=dv(e[0],e[1],e[2]),i=n.x,r=n.y,s=n.z;return new a_.Vector3(i,r,s)};return a(t.map((function(t){return[e(t),n(t),i(t)]})),r).map(o)}(e(p),n,i,r,t.pathResolution),b=h(p);if(_.__dashAnimateStep=b>0?1e3/b:0,m){_.material.resolution=t.rendererSize;var S=o(p),M=l(p),w=u(p);_.material.dashed=M>0,_.material.dashed?_.material.defines.USE_DASH="":delete _.material.defines.USE_DASH,_.material.dashed&&(_.material.dashScale=1/(v=0,x.forEach((function(t){y&&(v+=y.distanceTo(t)),y=t})),v),_.material.dashSize=S,_.material.gapSize=M,_.material.dashOffset=-w);var T=a(p);if(T instanceof Array){var E=A(a(p),x.length-1,1,!1);_.geometry.setColors(E.array),_.material.vertexColors=!0}else{var C=T,R=bv(C);_.material.color=new a_.Color(xv(C)),_.material.transparent=R<1,_.material.opacity=R,_.material.vertexColors=!1}_.material.needsUpdate=!0}else{Object.assign(_.material.uniforms,{dashSize:{value:o(p)},gapSize:{value:l(p)},dashOffset:{value:u(p)}});var N=A(a(p),x.length),P=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[],r=0,s=t+1;r<s;r++)for(var a=r/(s-1),o=0;o<e;o++)i.push(a);return n&&i.reverse(),wv(i,1)}(x.length,1,!0);_.geometry.setAttribute("vertexColor",N),_.geometry.setAttribute("vertexRelDistance",P)}var D=s_(p.__currentTargetD&&p.__currentTargetD.points||[x[0]],x),I=function(t){var e,n=p.__currentTargetD=t,i=n.stroke,r=n.interpolK,s=p.__currentTargetD.points=D(r);m?(_.geometry.setPositions((e=[]).concat.apply(e,rv(s.map((function(t){return[t.x,t.y,t.z]}))))),_.material.linewidth=i,_.material.dashed&&_.computeLineDistances()):(_.geometry.setFromPoints(s),_.geometry.computeBoundingSphere())},L={stroke:f,interpolK:1},B=Object.assign({},p.__currentTargetD||L,{interpolK:0});Object.keys(L).some((function(t){return B[t]!==L[t]}))&&(!t.pathTransitionDuration||t.pathTransitionDuration<0?I(L):t.tweenGroup.add(new Wu(B).to(L,t.pathTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(I).start()))}})}}),h_=window.THREE?window.THREE:{Euler:Gn,Mesh:tr,MeshLambertMaterial:Ll,SphereGeometry:Nl},c_=Fu({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new h_.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.tileLat),n=Xd(t.tileLng),i=Xd(t.tileAltitude),r=Xd(t.tileWidth),s=Xd(t.tileHeight),a=Xd(t.tileUseGlobeProjection),o=Xd(t.tileMaterial),l=Xd(t.tileCurvatureResolution);Tv(t.tilesData,t.scene,{createObj:function(){var t=new h_.Mesh;return t.__globeObjType="tile",t},updateObj:function(u,h){u.material=o(h);var c=a(h),A=l(h),d=function(t){var e=u.__currentTargetD=t,n=e.lat,i=e.lng,r=e.alt,s=e.width,a=e.height,o=A_(i),l=A_(-n);u.geometry&&u.geometry.dispose(),u.geometry=new h_.SphereGeometry(cv*(1+r),Math.ceil(s/(A||-1)),Math.ceil(a/(A||-1)),A_(90-s/2)+(c?o:0),A_(s),A_(90-a/2)+(c?l:0),A_(a)),c||u.setRotationFromEuler(new h_.Euler(l,o,0,"YXZ"))},p={lat:+e(h),lng:+n(h),alt:+i(h),width:+r(h),height:+s(h)},f=u.__currentTargetD||Object.assign({},p,{width:0,height:0});Object.keys(p).some((function(t){return f[t]!==p[t]}))&&(!t.tilesTransitionDuration||t.tilesTransitionDuration<0?d(p):t.tweenGroup.add(new Wu(f).to(p,t.tilesTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(d).start()))}})}}),A_=function(t){return t*Math.PI/180},d_={glyphs:{0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Π":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"ΐ":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"–":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Κ":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"ƒ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"ό":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"ώ":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Ι":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Ύ":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"’":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Ν":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"ς":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Ά":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Δ":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"ρ":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Η":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"Α":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Μ":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Ό":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ή":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"­":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Ξ":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Ί":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Β":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"υ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"χ":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Ζ":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"‹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"έ":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"ω":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"ϋ":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"ύ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Θ":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 280 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Ε":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"σ":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Ο":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Γ":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Έ":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ώ":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"›":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"τ":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Λ":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Υ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"φ":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"ϊ":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"π":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"ψ":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},cssFontWeight:"normal",ascender:1189,underlinePosition:-100,cssFontStyle:"normal",boundingBox:{yMin:-334,xMin:-111,yMax:1189,xMax:1672},resolution:1e3,original_font_information:{postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50},p_=ev(ev({},window.THREE?window.THREE:{BoxGeometry:nr,CircleGeometry:Zo,DoubleSide:2,Group:so,Mesh:tr,MeshLambertMaterial:Ll,TextGeometry:Fy,Vector3:en}),{},{Font:class{constructor(t){this.isFont=!0,this.type="Font",this.data=t}generateShapes(t,e=100){const n=[],i=function(t,e,n){const i=Array.from(t),r=e/n.resolution,s=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,a=[];let o=0,l=0;for(let t=0;t<i.length;t++){const e=i[t];if("\n"===e)o=0,l-=s;else{const t=ky(e,r,o,l,n);o+=t.offsetX,a.push(t.path)}}return a}(t,e,this.data);for(let t=0,e=i.length;t<e;t++)n.push(...i[t].toShapes());return n}},TextGeometry:Fy}),f_=Fu({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:0},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:d_,onChange:function(t,e){e.font=new p_.Font(t)}},labelColor:{default:function(){return"lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return"bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t){var e=Xd(t.labelLat),n=Xd(t.labelLng),i=Xd(t.labelAltitude),r=Xd(t.labelText),s=Xd(t.labelSize),a=Xd(t.labelRotation),o=Xd(t.labelColor),l=Xd(t.labelIncludeDot),u=Xd(t.labelDotRadius),h=Xd(t.labelDotOrientation),c=new Set(["right","top","bottom"]),A=2*Math.PI*cv/360,d=new p_.CircleGeometry(1,16);Tv(t.labelsData,t.scene,{createObj:function(){var t=new p_.MeshLambertMaterial;t.side=2;var e=new p_.Group;e.add(new p_.Mesh(d,t));var n=new p_.Mesh(void 0,t);e.add(n);var i=new p_.Mesh;return i.visible=!1,n.add(i),e.__globeObjType="label",e},updateObj:function(d,p){var f=iv(d.children,2),m=f[0],g=f[1],y=iv(g.children,1)[0],v=o(p),_=bv(v);g.material.color.set(xv(v)),g.material.transparent=_<1,g.material.opacity=_;var x=l(p),b=h(p);!x||!c.has(b)&&(b="bottom");var S=x?+u(p)*A:1e-12;m.scale.x=m.scale.y=S;var M=+s(p)*A;if(g.geometry&&g.geometry.dispose(),g.geometry=new p_.TextGeometry(r(p),{font:t.font,size:M,depth:0,height:0,curveSegments:t.labelResolution}),y.geometry&&y.geometry.dispose(),g.geometry.computeBoundingBox(),y.geometry=Yy(p_.BoxGeometry,rv((new p_.Vector3).subVectors(g.geometry.boundingBox.max,g.geometry.boundingBox.min).toArray())),"right"!==b&&g.geometry.center(),x){var w=S+M/2;"right"===b&&(g.position.x=w),g.position.y={right:-M/2,top:w+M/2,bottom:-w-M/2}[b]}var T=function(e){var n=d.__currentTargetD=e,i=n.lat,r=n.lng,s=n.alt,a=n.rot,o=n.scale;Object.assign(d.position,dv(i,r,s)),d.lookAt(t.scene.localToWorld(new p_.Vector3(0,0,0))),d.rotateY(Math.PI),d.rotateZ(-a*Math.PI/180),d.scale.x=d.scale.y=d.scale.z=o},E={lat:+e(p),lng:+n(p),alt:+i(p),rot:+a(p),scale:1},C=d.__currentTargetD||Object.assign({},E,{scale:1e-12});Object.keys(E).some((function(t){return C[t]!==E[t]}))&&(!t.labelsTransitionDuration||t.labelsTransitionDuration<0?T(E):t.tweenGroup.add(new Wu(C).to(E,t.labelsTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(T).start()))}})}}),m_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;Hy(this,e),(t=Gy(this,e)).type="CircleLineGeometry",t.parameters={radius:n,segmentCount:i};for(var r=[],s=0;s<=i;s++){var a=(s/i-.25)*Math.PI*2;r.push({x:Math.cos(a)*n,y:Math.sin(a)*n,z:0})}return t.setFromPoints(r),t}return Ky(e,t),Qy(e)}((window.THREE?window.THREE:{BufferGeometry:Gi}).BufferGeometry),g_=window.THREE?window.THREE:{Color:Mi,Group:so,Line:Eo,LineBasicMaterial:vo,Vector3:en},y_=Nf.default||Nf,v_=Fu({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return"#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i,e.ticker=new y_,e.ticker.onTick.add((function(t){if(e.ringsData.length){var n=Xd(e.ringColor),i=Xd(e.ringAltitude),r=Xd(e.ringMaxRadius),s=Xd(e.ringPropagationSpeed),a=Xd(e.ringRepeatPeriod);e.ringsData.filter((function(t){return t.__threeObj})).forEach((function(o){var l,u,h=o.__threeObj;if((h.__nextRingTime||0)<=t){var c=a(o)/1e3;h.__nextRingTime=t+(c<=0?1/0:c);var A,d=new g_.Line(new m_(1,e.ringResolution),new g_.LineBasicMaterial),p=n(o),f=p instanceof Array||p instanceof Function;f?p instanceof Array?(A=ym().domain(p.map((function(t,e){return e/(p.length-1)}))).range(p),d.material.transparent=p.some((function(t){return bv(t)<1}))):(A=p,d.material.transparent=!0):(d.material.color=new g_.Color(xv(p)),l=d.material,u=bv(p),l.opacity=u,l.transparent=u<1,l.depthWrite=u>=1);var m=cv*(1+i(o)),g=r(o),y=g*Math.PI/180,v=s(o),_=v<=0,x=function(t){var e=t.t,n=(_?1-e:e)*y;if(d.scale.x=d.scale.y=m*Math.sin(n),d.position.z=m*(1-Math.cos(n)),f){var i=A(e);d.material.color=new g_.Color(xv(i)),d.material.transparent&&(d.material.opacity=bv(i))}};if(0===v)x({t:0}),h.add(d);else{var b=1e3*Math.abs(g/v);e.tweenGroup.add(new Wu({t:0}).to({t:1},b).onUpdate(x).onStart((function(){return h.add(d)})).onComplete((function(){h.remove(d),lv(d)})).start())}}}))}}))},update:function(t){var e=Xd(t.ringLat),n=Xd(t.ringLng),i=Xd(t.ringAltitude),r=t.scene.localToWorld(new g_.Vector3(0,0,0));Tv(t.ringsData,t.scene,{createObj:function(){var t=new g_.Group;return t.__globeObjType="ring",t},updateObj:function(t,s){var a=e(s),o=n(s),l=i(s);Object.assign(t.position,dv(a,o,l)),t.lookAt(r)}},{removeDelay:3e4})}}),__=ev(ev({},window.THREE?window.THREE:{}),{},{CSS2DObject:class extends si{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Ee(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)}))}))}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this.center=t.center,this}}}),x_=Fu({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility()},triggerUpdate:!1}},methods:{updateObjVisibility:function(t,e){(e?[e]:t.htmlElementsData.map((function(t){return t.__threeObj})).filter((function(t){return t}))).forEach((function(e){return e.visible=!t.isBehindGlobe||!t.isBehindGlobe(e.position)}))}},init:function(t,e,n){var i=n.tweenGroup;uv(t),e.scene=t,e.tweenGroup=i},update:function(t,e){var n=this,i=Xd(t.htmlLat),r=Xd(t.htmlLng),s=Xd(t.htmlAltitude),a=Xd(t.htmlElement);Tv(t.htmlElementsData,t.scene,{purge:e.hasOwnProperty("htmlElement"),createObj:function(t){var e=a(t),n=new __.CSS2DObject(e);return n.__globeObjType="html",n},updateObj:function(e,a){var o=function(t){var i=e.__currentTargetD=t,r=i.alt,s=i.lat,a=i.lng;Object.assign(e.position,dv(s,a,r)),n.updateObjVisibility(e)},l={lat:+i(a),lng:+r(a),alt:+s(a)};!t.htmlTransitionDuration||t.htmlTransitionDuration<0||!e.__currentTargetD?o(l):t.tweenGroup.add(new Wu(e.__currentTargetD).to(l,t.htmlTransitionDuration).easing(zu.Quadratic.InOut).onUpdate(o).start())}})}}),b_=window.THREE?window.THREE:{Euler:Gn,Group:so,Mesh:tr,MeshLambertMaterial:Ll,SphereGeometry:Nl},S_=Fu({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{},objectThreeObject:{default:new b_.Mesh(new b_.SphereGeometry(1,16,8),new b_.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(t,e){uv(t),e.scene=t},update:function(t,e){var n=Xd(t.objectLat),i=Xd(t.objectLng),r=Xd(t.objectAltitude),s=Xd(t.objectFacesSurface),a=Xd(t.objectRotation),o=Xd(t.objectThreeObject);Tv(t.objectsData,t.scene,{purge:e.hasOwnProperty("objectThreeObject"),createObj:function(e){var n=o(e);t.objectThreeObject===n&&(n=n.clone());var i=new b_.Group;return i.add(n),i.__globeObjType="object",i},updateObj:function(t,e){var o=+n(e),l=+i(e),u=+r(e);Object.assign(t.position,dv(o,l,u)),s(e)?t.setRotationFromEuler(new Gn(fv(-o),fv(l),0,"YXZ")):t.rotation.set(0,0,0);var h=t.children[0],c=a(e);c&&h.setRotationFromEuler(new Gn(fv(c.x||0),fv(c.y||0),fv(c.z||0)))}})}}),M_=Fu({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(t,e){uv(t),e.scene=t},update:function(t,e){t.customThreeObjectUpdate||uv(t.scene);var n=Xd(t.customThreeObject),i=Xd(t.customThreeObjectUpdate);Tv(t.customLayerData,t.scene,{purge:e.hasOwnProperty("customThreeObject"),createObj:function(e){var i=n(e,cv);return i&&(t.customThreeObject===i&&(i=i.clone()),i.__globeObjType="custom"),i},updateObj:function(t,e){return i(t,e,cv)}})}}),w_=window.THREE?window.THREE:{Group:so,Vector2:Ee,Vector3:en},T_=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","labelsLayer","ringsLayer","htmlElementsLayer","objectsLayer","customLayer"],E_=hv("globeLayer",_v),C_=Object.assign.apply(Object,rv(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map((function(t){return $y({},t,E_.linkProp(t))})))),R_=Object.assign.apply(Object,rv(["globeMaterial"].map((function(t){return $y({},t,E_.linkMethod(t))})))),N_=hv("pointsLayer",Nv),P_=Object.assign.apply(Object,rv(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map((function(t){return $y({},t,N_.linkProp(t))})))),D_=hv("arcsLayer",Bv),I_=Object.assign.apply(Object,rv(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map((function(t){return $y({},t,D_.linkProp(t))})))),L_=hv("hexBinLayer",kv),B_=Object.assign.apply(Object,rv(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map((function(t){return $y({},t,L_.linkProp(t))})))),U_=hv("heatmapsLayer",Zv),O_=Object.assign.apply(Object,rv(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map((function(t){return $y({},t,U_.linkProp(t))})))),F_=hv("hexedPolygonsLayer",i_),k_=Object.assign.apply(Object,rv(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map((function(t){return $y({},t,F_.linkProp(t))})))),z_=hv("polygonsLayer",Jv),q_=Object.assign.apply(Object,rv(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map((function(t){return $y({},t,z_.linkProp(t))})))),G_=hv("pathsLayer",u_),V_=Object.assign.apply(Object,rv(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map((function(t){return $y({},t,G_.linkProp(t))})))),H_=hv("tilesLayer",c_),j_=Object.assign.apply(Object,rv(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map((function(t){return $y({},t,H_.linkProp(t))})))),W_=hv("labelsLayer",f_),X_=Object.assign.apply(Object,rv(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map((function(t){return $y({},t,W_.linkProp(t))})))),Y_=hv("ringsLayer",v_),Q_=Object.assign.apply(Object,rv(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map((function(t){return $y({},t,Y_.linkProp(t))})))),$_=hv("htmlElementsLayer",x_),Z_=Object.assign.apply(Object,rv(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration"].map((function(t){return $y({},t,$_.linkProp(t))})))),K_=hv("objectsLayer",S_),J_=Object.assign.apply(Object,rv(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject"].map((function(t){return $y({},t,K_.linkProp(t))})))),tx=hv("customLayer",M_),ex=Object.assign.apply(Object,rv(["customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return $y({},t,tx.linkProp(t))})))),nx=Fu({props:ev(ev(ev(ev(ev(ev(ev(ev(ev(ev(ev(ev(ev(ev({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new w_.Vector2(window.innerWidth,window.innerHeight),onChange:function(t,e){e.pathsLayer.rendererSize(t)},triggerUpdate:!1}},C_),P_),I_),B_),O_),q_),k_),V_),j_),X_),Q_),Z_),J_),ex),methods:ev({getGlobeRadius:Av,getCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return dv.apply(void 0,n)},toGeoCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return pv.apply(void 0,n)},setPointOfView:function(t,e,n){var i=void 0;if(e){var r,s,a,o=Av(),l=n?e.clone().sub(n):e;i=function(t){void 0===r&&(r=l.length()),void 0===s&&(s=Math.sqrt(Math.pow(r,2)-Math.pow(o,2))),void 0===a&&(a=Math.acos(s/r));var e=l.distanceTo(t);if(e<s)return!1;var n=t.length();return Math.acos((Math.pow(r,2)+Math.pow(e,2)-Math.pow(n,2))/(2*r*e))<a}}t.layersThatNeedBehindGlobeChecker.forEach((function(t){return t.isBehindGlobe(i)}))},pauseAnimation:function(t){return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),t.pausableLayers.forEach((function(t){var e;return null===(e=t.pauseAnimation)||void 0===e?void 0:e.call(t)})),this},resumeAnimation:function(t){return null===t.animationFrameRequestId&&this._animationCycle(),t.pausableLayers.forEach((function(t){var e;return null===(e=t.resumeAnimation)||void 0===e?void 0:e.call(t)})),this},_animationCycle:function(t){t.animationFrameRequestId=requestAnimationFrame(this._animationCycle),t.tweenGroup.update()},_destructor:function(t){this.pauseAnimation(),t.destructableLayers.forEach((function(t){return t._destructor()}))}},R_),stateInit:function(){var t=new Gu,e={tweenGroup:t},n={globeLayer:_v(e),pointsLayer:Nv(e),arcsLayer:Bv(e),hexBinLayer:kv(e),heatmapsLayer:Zv(e),polygonsLayer:Jv(e),hexedPolygonsLayer:i_(e),pathsLayer:u_(e),tilesLayer:c_(e),labelsLayer:f_(e),ringsLayer:v_(e),htmlElementsLayer:x_(e),objectsLayer:S_(e),customLayer:M_(e)};return ev(ev({tweenGroup:t},n),{},{layersThatNeedBehindGlobeChecker:Object.values(n).filter((function(t){return t.hasOwnProperty("isBehindGlobe")})),destructableLayers:Object.values(n).filter((function(t){return t.hasOwnProperty("_destructor")})),pausableLayers:Object.values(n).filter((function(t){return t.hasOwnProperty("pauseAnimation")}))})},init:function(t,e,n){var i=n.animateIn,r=void 0===i||i,s=n.waitForGlobeReady,a=void 0===s||s;uv(t),e.scene=t,e.scene.visible=!1,T_.forEach((function(t){var n=new w_.Group;e.scene.add(n),e[t](n)}));var o=function(){if(r){e.scene.scale.set(1e-6,1e-6,1e-6),e.tweenGroup.add(new Wu({k:1e-6}).to({k:1},600).easing(zu.Quadratic.Out).onUpdate((function(t){var n=t.k;return e.scene.scale.set(n,n,n)})).start());var t=new w_.Vector3(0,1,0);e.tweenGroup.add(new Wu({rot:2*Math.PI}).to({rot:0},1200).easing(zu.Quintic.Out).onUpdate((function(n){var i=n.rot;return e.scene.setRotationFromAxisAngle(t,i)})).start())}e.scene.visible=!0,e.onGlobeReady&&e.onGlobeReady()};a?e.globeLayer.onReady(o):o(),this._animationCycle()},update:function(t){}});var ix=function(t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(n){function i(){var n;Hy(this,i);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return(n=Gy(this,i,[].concat(s))).__kapsuleInstance=t.apply(void 0,s).apply(void 0,[].concat(rv(e?[n]:[]),s)),n}return Ky(i,n),Qy(i)}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object);return Object.keys(t()).forEach((function(t){return n.prototype[t]=function(){var e,n=(e=this.__kapsuleInstance)[t].apply(e,arguments);return n===this.__kapsuleInstance?this:n}})),n}(nx,(window.THREE?window.THREE:{Group:so}).Group,!0);const rx="169",sx=100,ax=101,ox=102,lx=200,ux=201,hx=202,cx=203,Ax=204,dx=205,px=206,fx=207,mx=208,gx=209,yx=210,vx=301,_x=302,xx=303,bx=304,Sx=1e3,Mx=1001,wx=1002,Tx=1003,Ex=1004,Cx=1005,Rx=1006,Nx=1007,Px=1008,Dx=1009,Ix=1010,Lx=1011,Bx=1012,Ux=1013,Ox=1014,Fx=1015,kx=1016,zx=1020,qx=1022,Gx=1023,Vx=1026,Hx=1027,jx=1028,Wx=1029,Xx=1030,Yx=1031,Qx=1033,$x=33776,Zx=33777,Kx=33778,Jx=33779,tb=37492,eb=37496,nb=37808,ib=37809,rb=37810,sb=37811,ab=37812,ob=37813,lb=37814,ub=37815,hb=37816,cb=37817,Ab=37818,db=37819,pb=37820,fb=37821,mb=36492,gb="",yb="srgb",vb="srgb-linear",_b="display-p3",xb="display-p3-linear",bb="linear",Sb="srgb",Mb="rec709",wb=7680,Tb=512,Eb=513,Cb=514,Rb=515,Nb=516,Pb=517,Db=518,Ib=519,Lb=35044,Bb=35048,Ub=2e3,Ob=2001;class Fb{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e<i;e++)n[e].call(this,t);t.target=null}}}const kb=["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 zb=1234567;const qb=Math.PI/180,Gb=180/Math.PI;function Vb(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(kb[255&t]+kb[t>>8&255]+kb[t>>16&255]+kb[t>>24&255]+"-"+kb[255&e]+kb[e>>8&255]+"-"+kb[e>>16&15|64]+kb[e>>24&255]+"-"+kb[63&n|128]+kb[n>>8&255]+"-"+kb[n>>16&255]+kb[n>>24&255]+kb[255&i]+kb[i>>8&255]+kb[i>>16&255]+kb[i>>24&255]).toLowerCase()}function Hb(t,e,n){return Math.max(e,Math.min(n,t))}function jb(t,e){return(t%e+e)%e}function Wb(t,e,n){return(1-n)*t+n*e}function Xb(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Yb(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Qb={DEG2RAD:qb,RAD2DEG:Gb,generateUUID:Vb,clamp:Hb,euclideanModulo:jb,mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Wb,damp:function(t,e,n,i){return Wb(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(jb(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(zb=t);let e=zb+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*qb},radToDeg:function(t){return t*Gb},isPowerOfTwo:function(t){return!(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),u=s((e+i)/2),h=a((e+i)/2),c=s((e-i)/2),A=a((e-i)/2),d=s((i-e)/2),p=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*c,l*A,o*u);break;case"YZY":t.set(l*A,o*h,l*c,o*u);break;case"ZXZ":t.set(l*c,l*A,o*h,o*u);break;case"XZX":t.set(o*h,l*p,l*d,o*u);break;case"YXY":t.set(l*d,o*h,l*p,o*u);break;case"ZYZ":t.set(l*p,l*d,o*h,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}},normalize:Yb,denormalize:Xb};class $b{constructor(t=0,e=0){$b.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Hb(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Zb{constructor(t,e,n,i,r,s,a,o,l){Zb.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l)}set(t,e,n,i,r,s,a,o,l){const u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=r,u[5]=o,u[6]=n,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],u=n[4],h=n[7],c=n[2],A=n[5],d=n[8],p=i[0],f=i[3],m=i[6],g=i[1],y=i[4],v=i[7],_=i[2],x=i[5],b=i[8];return r[0]=s*p+a*g+o*_,r[3]=s*f+a*y+o*x,r[6]=s*m+a*v+o*b,r[1]=l*p+u*g+h*_,r[4]=l*f+u*y+h*x,r[7]=l*m+u*v+h*b,r[2]=c*p+A*g+d*_,r[5]=c*f+A*y+d*x,r[8]=c*m+A*v+d*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8];return e*s*u-e*a*l-n*r*u+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],h=u*s-a*l,c=a*o-u*r,A=l*r-s*o,d=e*h+n*c+i*A;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;return t[0]=h*p,t[1]=(i*l-u*n)*p,t[2]=(a*n-i*s)*p,t[3]=c*p,t[4]=(u*e-i*o)*p,t[5]=(i*r-a*e)*p,t[6]=A*p,t[7]=(n*o-l*e)*p,t[8]=(s*e-n*r)*p,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Kb.makeScale(t,e)),this}rotate(t){return this.premultiply(Kb.makeRotation(-t)),this}translate(t,e){return this.premultiply(Kb.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const Kb=new Zb;function Jb(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const tS={};const eS=(new Zb).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),nS=(new Zb).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),iS={[vb]:{transfer:bb,primaries:Mb,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t,fromReference:t=>t},[yb]:{transfer:Sb,primaries:Mb,luminanceCoefficients:[.2126,.7152,.0722],toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[xb]:{transfer:bb,primaries:"p3",luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.applyMatrix3(nS),fromReference:t=>t.applyMatrix3(eS)},[_b]:{transfer:Sb,primaries:"p3",luminanceCoefficients:[.2289,.6917,.0793],toReference:t=>t.convertSRGBToLinear().applyMatrix3(nS),fromReference:t=>t.applyMatrix3(eS).convertLinearToSRGB()}},rS=new Set([vb,xb]),sS={enabled:!0,_workingColorSpace:vb,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!rS.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const i=iS[e].toReference;return(0,iS[n].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return iS[t].primaries},getTransfer:function(t){return t===gb?bb:iS[t].transfer},getLuminanceCoefficients:function(t,e=this._workingColorSpace){return t.fromArray(iS[e].luminanceCoefficients)}};function aS(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function oS(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let lS;class uS{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===lS&&(lS=Jb("canvas")),lS.width=t.width,lS.height=t.height;const n=lS.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=lS}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Jb("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const i=n.getImageData(0,0,t.width,t.height),r=i.data;for(let t=0;t<r.length;t++)r[t]=255*aS(r[t]/255);return n.putImageData(i,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*aS(e[t]/255)):e[t]=aS(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let hS=0;class cS{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:hS++}),this.uuid=Vb(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let t;if(Array.isArray(i)){t=[];for(let e=0,n=i.length;e<n;e++)i[e].isDataTexture?t.push(AS(i[e].image)):t.push(AS(i[e]))}else t=AS(i);n.url=t}return e||(t.images[this.uuid]=n),n}}function AS(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?uS.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let dS=0;class pS extends Fb{constructor(t=pS.DEFAULT_IMAGE,e=pS.DEFAULT_MAPPING,n=1001,i=1001,r=1006,s=1008,a=1023,o=1009,l=pS.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:dS++}),this.uuid=Vb(),this.name="",this.source=new cS(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new $b(0,0),this.repeat=new $b(1,1),this.center=new $b(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Zb,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).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&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Sx:t.x=t.x-Math.floor(t.x);break;case Mx:t.x=t.x<0?0:1;break;case wx:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case Sx:t.y=t.y-Math.floor(t.y);break;case Mx:t.y=t.y<0?0:1;break;case wx:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}pS.DEFAULT_IMAGE=null,pS.DEFAULT_MAPPING=300,pS.DEFAULT_ANISOTROPY=1;class fS{constructor(t=0,e=0,n=0,i=1){fS.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],u=o[4],h=o[8],c=o[1],A=o[5],d=o[9],p=o[2],f=o[6],m=o[10];if(Math.abs(u-c)<s&&Math.abs(h-p)<s&&Math.abs(d-f)<s){if(Math.abs(u+c)<a&&Math.abs(h+p)<a&&Math.abs(d+f)<a&&Math.abs(l+A+m-3)<a)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,o=(A+1)/2,g=(m+1)/2,y=(u+c)/4,v=(h+p)/4,_=(d+f)/4;return t>o&&t>g?t<s?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=y/n,r=v/n):o>g?o<s?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(o),n=y/i,r=_/i):g<s?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(g),n=v/r,i=_/r),this.set(n,i,r,e),this}let g=Math.sqrt((f-d)*(f-d)+(h-p)*(h-p)+(c-u)*(c-u));return Math.abs(g)<.001&&(g=1),this.x=(f-d)/g,this.y=(h-p)/g,this.z=(c-u)/g,this.w=Math.acos((l+A+m-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),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 mS extends Fb{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new fS(0,0,t,e),this.scissorTest=!1,this.viewport=new fS(0,0,t,e);const i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Rx,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const r=new pS(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];const s=n.count;for(let t=0;t<s;t++)this.textures[t]=r.clone(),this.textures[t].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++)this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new cS(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class gS extends mS{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class yS extends pS{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=Tx,this.minFilter=Tx,this.wrapR=Mx,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class vS{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,s,a){let o=n[i+0],l=n[i+1],u=n[i+2],h=n[i+3];const c=r[s+0],A=r[s+1],d=r[s+2],p=r[s+3];if(0===a)return t[e+0]=o,t[e+1]=l,t[e+2]=u,void(t[e+3]=h);if(1===a)return t[e+0]=c,t[e+1]=A,t[e+2]=d,void(t[e+3]=p);if(h!==p||o!==c||l!==A||u!==d){let t=1-a;const e=o*c+l*A+u*d+h*p,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+c*r,l=l*t+A*r,u=u*t+d*r,h=h*t+p*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+u*u+h*h);o*=t,l*=t,u*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=u,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],u=n[i+3],h=r[s],c=r[s+1],A=r[s+2],d=r[s+3];return t[e]=a*d+u*h+o*A-l*c,t[e+1]=o*d+u*c+l*h-a*A,t[e+2]=l*d+u*A+a*c-o*h,t[e+3]=u*d-a*h-o*c-l*A,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),u=a(i/2),h=a(r/2),c=o(n/2),A=o(i/2),d=o(r/2);switch(s){case"XYZ":this._x=c*u*h+l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h-c*A*d;break;case"YXZ":this._x=c*u*h+l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h+c*A*d;break;case"ZXY":this._x=c*u*h-l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h-c*A*d;break;case"ZYX":this._x=c*u*h-l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h+c*A*d;break;case"YZX":this._x=c*u*h+l*A*d,this._y=l*A*h+c*u*d,this._z=l*u*d-c*A*h,this._w=l*u*h-c*A*d;break;case"XZY":this._x=c*u*h-l*A*d,this._y=l*A*h-c*u*d,this._z=l*u*d+c*A*h,this._w=l*u*h+c*A*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],u=e[6],h=e[10],c=n+a+h;if(c>0){const t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(u-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(u-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+u)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+u)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Hb(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,u=e._w;return this._x=n*u+s*a+i*l-r*o,this._y=i*u+s*o+r*a-n*l,this._z=r*u+s*l+n*o-i*a,this._w=s*u-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this}const l=Math.sqrt(o),u=Math.atan2(l,a),h=Math.sin((1-e)*u)/l,c=Math.sin(e*u)/l;return this._w=s*h+this._w*c,this._x=n*h+this._x*c,this._y=i*h+this._y*c,this._z=r*h+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class _S{constructor(t=0,e=0,n=0){_S.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(bS.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(bS.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=2*(s*i-a*n),u=2*(a*e-r*i),h=2*(r*n-s*e);return this.x=e+o*l+s*h-a*u,this.y=n+o*u+a*l-r*h,this.z=i+o*h+r*u-s*l,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return xS.copy(this).projectOnVector(t),this.sub(xS)}reflect(t){return this.sub(xS.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Hb(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const xS=new _S,bS=new vS;class SS{constructor(t=new _S(1/0,1/0,1/0),e=new _S(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(wS.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(wS.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=wS.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const i=n.getAttribute("position");if(!0===e&&void 0!==i&&!0!==t.isInstancedMesh)for(let e=0,n=i.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,wS):wS.fromBufferAttribute(i,e),wS.applyMatrix4(t.matrixWorld),this.expandByPoint(wS);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),TS.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),TS.copy(n.boundingBox)),TS.applyMatrix4(t.matrixWorld),this.union(TS)}const i=t.children;for(let t=0,n=i.length;t<n;t++)this.expandByObject(i[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,wS),wS.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(IS),LS.subVectors(this.max,IS),ES.subVectors(t.a,IS),CS.subVectors(t.b,IS),RS.subVectors(t.c,IS),NS.subVectors(CS,ES),PS.subVectors(RS,CS),DS.subVectors(ES,RS);let e=[0,-NS.z,NS.y,0,-PS.z,PS.y,0,-DS.z,DS.y,NS.z,0,-NS.x,PS.z,0,-PS.x,DS.z,0,-DS.x,-NS.y,NS.x,0,-PS.y,PS.x,0,-DS.y,DS.x,0];return!!OS(e,ES,CS,RS,LS)&&(e=[1,0,0,0,1,0,0,0,1],!!OS(e,ES,CS,RS,LS)&&(BS.crossVectors(NS,PS),e=[BS.x,BS.y,BS.z],OS(e,ES,CS,RS,LS)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,wS).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(wS).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(MS[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),MS[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),MS[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),MS[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),MS[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),MS[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),MS[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),MS[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(MS)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const MS=[new _S,new _S,new _S,new _S,new _S,new _S,new _S,new _S],wS=new _S,TS=new SS,ES=new _S,CS=new _S,RS=new _S,NS=new _S,PS=new _S,DS=new _S,IS=new _S,LS=new _S,BS=new _S,US=new _S;function OS(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){US.fromArray(t,s);const a=r.x*Math.abs(US.x)+r.y*Math.abs(US.y)+r.z*Math.abs(US.z),o=e.dot(US),l=n.dot(US),u=i.dot(US);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>a)return!1}return!0}const FS=new SS,kS=new _S,zS=new _S;class qS{constructor(t=new _S,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):FS.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;e<r;e++)i=Math.max(i,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(i),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;kS.subVectors(t,this.center);const e=kS.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(kS,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(zS.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(kS.copy(t.center).add(zS)),this.expandByPoint(kS.copy(t.center).sub(zS))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const GS=new _S,VS=new _S,HS=new _S,jS=new _S,WS=new _S,XS=new _S,YS=new _S;class QS{constructor(t=new _S,e=new _S(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,GS)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=GS.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(GS.copy(this.origin).addScaledVector(this.direction,e),GS.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){VS.copy(t).add(e).multiplyScalar(.5),HS.copy(e).sub(t).normalize(),jS.copy(this.origin).sub(VS);const r=.5*t.distanceTo(e),s=-this.direction.dot(HS),a=jS.dot(this.direction),o=-jS.dot(HS),l=jS.lengthSq(),u=Math.abs(1-s*s);let h,c,A,d;if(u>0)if(h=s*o-a,c=s*a-o,d=r*u,h>=0)if(c>=-d)if(c<=d){const t=1/u;h*=t,c*=t,A=h*(h+s*c+2*a)+c*(s*h+c+2*o)+l}else c=r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;else c=-r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;else c<=-d?(h=Math.max(0,-(-s*r+a)),c=h>0?-r:Math.min(Math.max(-r,-o),r),A=-h*h+c*(c+2*o)+l):c<=d?(h=0,c=Math.min(Math.max(-r,-o),r),A=c*(c+2*o)+l):(h=Math.max(0,-(s*r+a)),c=h>0?r:Math.min(Math.max(-r,-o),r),A=-h*h+c*(c+2*o)+l);else c=s>0?-r:r,h=Math.max(0,-(s*c+a)),A=-h*h+c*(c+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(VS).addScaledVector(HS,c),A}intersectSphere(t,e){GS.subVectors(t.center,this.origin);const n=GS.dot(this.direction),i=GS.dot(GS)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,c=this.origin;return l>=0?(n=(t.min.x-c.x)*l,i=(t.max.x-c.x)*l):(n=(t.max.x-c.x)*l,i=(t.min.x-c.x)*l),u>=0?(r=(t.min.y-c.y)*u,s=(t.max.y-c.y)*u):(r=(t.max.y-c.y)*u,s=(t.min.y-c.y)*u),n>s||r>i?null:((r>n||isNaN(n))&&(n=r),(s<i||isNaN(i))&&(i=s),h>=0?(a=(t.min.z-c.z)*h,o=(t.max.z-c.z)*h):(a=(t.max.z-c.z)*h,o=(t.min.z-c.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o<i||i!=i)&&(i=o),i<0?null:this.at(n>=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,GS)}intersectTriangle(t,e,n,i,r){WS.subVectors(e,t),XS.subVectors(n,t),YS.crossVectors(WS,XS);let s,a=this.direction.dot(YS);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}jS.subVectors(this.origin,t);const o=s*this.direction.dot(XS.crossVectors(jS,XS));if(o<0)return null;const l=s*this.direction.dot(WS.cross(jS));if(l<0)return null;if(o+l>a)return null;const u=-s*jS.dot(YS);return u<0?null:this.at(u/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class $S{constructor(t,e,n,i,r,s,a,o,l,u,h,c,A,d,p,f){$S.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,i,r,s,a,o,l,u,h,c,A,d,p,f)}set(t,e,n,i,r,s,a,o,l,u,h,c,A,d,p,f){const m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=i,m[1]=r,m[5]=s,m[9]=a,m[13]=o,m[2]=l,m[6]=u,m[10]=h,m[14]=c,m[3]=A,m[7]=d,m[11]=p,m[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 $S).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/ZS.setFromMatrixColumn(t,0).length(),r=1/ZS.setFromMatrixColumn(t,1).length(),s=1/ZS.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),u=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*u,n=s*h,i=a*u,r=a*h;e[0]=o*u,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*u,n=o*h,i=l*u,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*u,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*u,n=o*h,i=l*u,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*u,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*u,n=s*h,i=a*u,r=a*h;e[0]=o*u,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*u,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*u,e[9]=-a*u,e[2]=-l*u,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*u,e[4]=-h,e[8]=l*u,e[1]=t*h+r,e[5]=s*u,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*u,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(JS,t,tM)}lookAt(t,e,n){const i=this.elements;return iM.subVectors(t,e),0===iM.lengthSq()&&(iM.z=1),iM.normalize(),eM.crossVectors(n,iM),0===eM.lengthSq()&&(1===Math.abs(n.z)?iM.x+=1e-4:iM.z+=1e-4,iM.normalize(),eM.crossVectors(n,iM)),eM.normalize(),nM.crossVectors(iM,eM),i[0]=eM.x,i[4]=nM.x,i[8]=iM.x,i[1]=eM.y,i[5]=nM.y,i[9]=iM.y,i[2]=eM.z,i[6]=nM.z,i[10]=iM.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],u=n[1],h=n[5],c=n[9],A=n[13],d=n[2],p=n[6],f=n[10],m=n[14],g=n[3],y=n[7],v=n[11],_=n[15],x=i[0],b=i[4],S=i[8],M=i[12],w=i[1],T=i[5],E=i[9],C=i[13],R=i[2],N=i[6],P=i[10],D=i[14],I=i[3],L=i[7],B=i[11],U=i[15];return r[0]=s*x+a*w+o*R+l*I,r[4]=s*b+a*T+o*N+l*L,r[8]=s*S+a*E+o*P+l*B,r[12]=s*M+a*C+o*D+l*U,r[1]=u*x+h*w+c*R+A*I,r[5]=u*b+h*T+c*N+A*L,r[9]=u*S+h*E+c*P+A*B,r[13]=u*M+h*C+c*D+A*U,r[2]=d*x+p*w+f*R+m*I,r[6]=d*b+p*T+f*N+m*L,r[10]=d*S+p*E+f*P+m*B,r[14]=d*M+p*C+f*D+m*U,r[3]=g*x+y*w+v*R+_*I,r[7]=g*b+y*T+v*N+_*L,r[11]=g*S+y*E+v*P+_*B,r[15]=g*M+y*C+v*D+_*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],u=t[2],h=t[6],c=t[10],A=t[14];return t[3]*(+r*o*h-i*l*h-r*a*c+n*l*c+i*a*A-n*o*A)+t[7]*(+e*o*A-e*l*c+r*s*c-i*s*A+i*l*u-r*o*u)+t[11]*(+e*l*h-e*a*A-r*s*h+n*s*A+r*a*u-n*l*u)+t[15]*(-i*a*u-e*o*h+e*a*c+i*s*h-n*s*c+n*o*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],u=t[8],h=t[9],c=t[10],A=t[11],d=t[12],p=t[13],f=t[14],m=t[15],g=h*f*l-p*c*l+p*o*A-a*f*A-h*o*m+a*c*m,y=d*c*l-u*f*l-d*o*A+s*f*A+u*o*m-s*c*m,v=u*p*l-d*h*l+d*a*A-s*p*A-u*a*m+s*h*m,_=d*h*o-u*p*o-d*a*c+s*p*c+u*a*f-s*h*f,x=e*g+n*y+i*v+r*_;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return t[0]=g*b,t[1]=(p*c*r-h*f*r-p*i*A+n*f*A+h*i*m-n*c*m)*b,t[2]=(a*f*r-p*o*r+p*i*l-n*f*l-a*i*m+n*o*m)*b,t[3]=(h*o*r-a*c*r-h*i*l+n*c*l+a*i*A-n*o*A)*b,t[4]=y*b,t[5]=(u*f*r-d*c*r+d*i*A-e*f*A-u*i*m+e*c*m)*b,t[6]=(d*o*r-s*f*r-d*i*l+e*f*l+s*i*m-e*o*m)*b,t[7]=(s*c*r-u*o*r+u*i*l-e*c*l-s*i*A+e*o*A)*b,t[8]=v*b,t[9]=(d*h*r-u*p*r-d*n*A+e*p*A+u*n*m-e*h*m)*b,t[10]=(s*p*r-d*a*r+d*n*l-e*p*l-s*n*m+e*a*m)*b,t[11]=(u*a*r-s*h*r-u*n*l+e*h*l+s*n*A-e*a*A)*b,t[12]=_*b,t[13]=(u*p*i-d*h*i+d*n*c-e*p*c-u*n*f+e*h*f)*b,t[14]=(d*a*i-s*p*i-d*n*o+e*p*o+s*n*f-e*a*f)*b,t[15]=(s*h*i-u*a*i+u*n*o-e*h*o-s*n*c+e*a*c)*b,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,u=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,u*a+n,u*o-i*s,0,l*o-i*a,u*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,s){return this.set(1,n,r,0,t,1,s,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,u=s+s,h=a+a,c=r*l,A=r*u,d=r*h,p=s*u,f=s*h,m=a*h,g=o*l,y=o*u,v=o*h,_=n.x,x=n.y,b=n.z;return i[0]=(1-(p+m))*_,i[1]=(A+v)*_,i[2]=(d-y)*_,i[3]=0,i[4]=(A-v)*x,i[5]=(1-(c+m))*x,i[6]=(f+g)*x,i[7]=0,i[8]=(d+y)*b,i[9]=(f-g)*b,i[10]=(1-(c+p))*b,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=ZS.set(i[0],i[1],i[2]).length();const s=ZS.set(i[4],i[5],i[6]).length(),a=ZS.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],KS.copy(this);const o=1/r,l=1/s,u=1/a;return KS.elements[0]*=o,KS.elements[1]*=o,KS.elements[2]*=o,KS.elements[4]*=l,KS.elements[5]*=l,KS.elements[6]*=l,KS.elements[8]*=u,KS.elements[9]*=u,KS.elements[10]*=u,e.setFromRotationMatrix(KS),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s,a=2e3){const o=this.elements,l=2*r/(e-t),u=2*r/(n-i),h=(e+t)/(e-t),c=(n+i)/(n-i);let A,d;if(a===Ub)A=-(s+r)/(s-r),d=-2*s*r/(s-r);else{if(a!==Ob)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);A=-s/(s-r),d=-s*r/(s-r)}return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=u,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=A,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,n,i,r,s,a=2e3){const o=this.elements,l=1/(e-t),u=1/(n-i),h=1/(s-r),c=(e+t)*l,A=(n+i)*u;let d,p;if(a===Ub)d=(s+r)*h,p=-2*h;else{if(a!==Ob)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);d=r*h,p=-1*h}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-A,o[2]=0,o[6]=0,o[10]=p,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const ZS=new _S,KS=new $S,JS=new _S(0,0,0),tM=new _S(1,1,1),eM=new _S,nM=new _S,iM=new _S,rM=new $S,sM=new vS;class aM{constructor(t=0,e=0,n=0,i=aM.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const i=t.elements,r=i[0],s=i[4],a=i[8],o=i[1],l=i[5],u=i[9],h=i[2],c=i[6],A=i[10];switch(e){case"XYZ":this._y=Math.asin(Hb(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,A),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Hb(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,A),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,r),this._z=0);break;case"ZXY":this._x=Math.asin(Hb(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-h,A),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-Hb(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(c,A),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Hb(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,r)):(this._x=0,this._y=Math.atan2(a,A));break;case"XZY":this._z=Math.asin(-Hb(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(c,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,A),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return rM.makeRotationFromQuaternion(t),this.setFromRotationMatrix(rM,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return sM.setFromEuler(this),this.setFromQuaternion(sM,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}aM.DEFAULT_ORDER="XYZ";class oM{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return!!(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}let lM=0;const uM=new _S,hM=new vS,cM=new $S,AM=new _S,dM=new _S,pM=new _S,fM=new vS,mM=new _S(1,0,0),gM=new _S(0,1,0),yM=new _S(0,0,1),vM={type:"added"},_M={type:"removed"},xM={type:"childadded",child:null},bM={type:"childremoved",child:null};class SM extends Fb{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:lM++}),this.uuid=Vb(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=SM.DEFAULT_UP.clone();const t=new _S,e=new aM,n=new vS,i=new _S(1,1,1);e._onChange((function(){n.setFromEuler(e,!1)})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new $S},normalMatrix:{value:new Zb}}),this.matrix=new $S,this.matrixWorld=new $S,this.matrixAutoUpdate=SM.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=SM.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new oM,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return hM.setFromAxisAngle(t,e),this.quaternion.multiply(hM),this}rotateOnWorldAxis(t,e){return hM.setFromAxisAngle(t,e),this.quaternion.premultiply(hM),this}rotateX(t){return this.rotateOnAxis(mM,t)}rotateY(t){return this.rotateOnAxis(gM,t)}rotateZ(t){return this.rotateOnAxis(yM,t)}translateOnAxis(t,e){return uM.copy(t).applyQuaternion(this.quaternion),this.position.add(uM.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(mM,t)}translateY(t){return this.translateOnAxis(gM,t)}translateZ(t){return this.translateOnAxis(yM,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(cM.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?AM.copy(t):AM.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),dM.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?cM.lookAt(dM,AM,this.up):cM.lookAt(AM,dM,this.up),this.quaternion.setFromRotationMatrix(cM),i&&(cM.extractRotation(i.matrixWorld),hM.setFromRotationMatrix(cM),this.quaternion.premultiply(hM.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(vM),xM.child=t,this.dispatchEvent(xM),xM.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(_M),bM.child=t,this.dispatchEvent(bM),bM.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),cM.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),cM.multiply(t.parent.matrixWorld)),t.applyMatrix4(cM),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(vM),xM.child=t,this.dispatchEvent(xM),xM.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const i=this.children;for(let r=0,s=i.length;r<s;r++)i[r].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(dM,t,pM),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(dM,fM,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++){e[n].updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){t[e].updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}else r(t.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++)e.push(r(t.materials,this.material[n]));i.material=e}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];i.animations.push(r(t.animations,n))}}if(e){const e=s(t.geometries),i=s(t.materials),r=s(t.textures),a=s(t.images),o=s(t.shapes),l=s(t.skeletons),u=s(t.animations),h=s(t.nodes);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),h.length>0&&(n.nodes=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}}SM.DEFAULT_UP=new _S(0,1,0),SM.DEFAULT_MATRIX_AUTO_UPDATE=!0,SM.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const MM=new _S,wM=new _S,TM=new _S,EM=new _S,CM=new _S,RM=new _S,NM=new _S,PM=new _S,DM=new _S,IM=new _S,LM=new fS,BM=new fS,UM=new fS;class OM{constructor(t=new _S,e=new _S,n=new _S){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),MM.subVectors(t,e),i.cross(MM);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){MM.subVectors(i,e),wM.subVectors(n,e),TM.subVectors(t,e);const s=MM.dot(MM),a=MM.dot(wM),o=MM.dot(TM),l=wM.dot(wM),u=wM.dot(TM),h=s*l-a*a;if(0===h)return r.set(0,0,0),null;const c=1/h,A=(l*o-a*u)*c,d=(s*u-a*o)*c;return r.set(1-A-d,d,A)}static containsPoint(t,e,n,i){return null!==this.getBarycoord(t,e,n,i,EM)&&(EM.x>=0&&EM.y>=0&&EM.x+EM.y<=1)}static getInterpolation(t,e,n,i,r,s,a,o){return null===this.getBarycoord(t,e,n,i,EM)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,EM.x),o.addScaledVector(s,EM.y),o.addScaledVector(a,EM.z),o)}static getInterpolatedAttribute(t,e,n,i,r,s){return LM.setScalar(0),BM.setScalar(0),UM.setScalar(0),LM.fromBufferAttribute(t,e),BM.fromBufferAttribute(t,n),UM.fromBufferAttribute(t,i),s.setScalar(0),s.addScaledVector(LM,r.x),s.addScaledVector(BM,r.y),s.addScaledVector(UM,r.z),s}static isFrontFacing(t,e,n,i){return MM.subVectors(n,e),wM.subVectors(t,e),MM.cross(wM).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return MM.subVectors(this.c,this.b),wM.subVectors(this.a,this.b),.5*MM.cross(wM).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return OM.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return OM.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,r){return OM.getInterpolation(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return OM.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return OM.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,i=this.b,r=this.c;let s,a;CM.subVectors(i,n),RM.subVectors(r,n),PM.subVectors(t,n);const o=CM.dot(PM),l=RM.dot(PM);if(o<=0&&l<=0)return e.copy(n);DM.subVectors(t,i);const u=CM.dot(DM),h=RM.dot(DM);if(u>=0&&h<=u)return e.copy(i);const c=o*h-u*l;if(c<=0&&o>=0&&u<=0)return s=o/(o-u),e.copy(n).addScaledVector(CM,s);IM.subVectors(t,r);const A=CM.dot(IM),d=RM.dot(IM);if(d>=0&&A<=d)return e.copy(r);const p=A*l-o*d;if(p<=0&&l>=0&&d<=0)return a=l/(l-d),e.copy(n).addScaledVector(RM,a);const f=u*d-A*h;if(f<=0&&h-u>=0&&A-d>=0)return NM.subVectors(r,i),a=(h-u)/(h-u+(A-d)),e.copy(i).addScaledVector(NM,a);const m=1/(f+p+c);return s=p*m,a=c*m,e.copy(n).addScaledVector(CM,s).addScaledVector(RM,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const FM={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},kM={h:0,s:0,l:0},zM={h:0,s:0,l:0};function qM(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}class GM{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=yb){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,sS.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=sS.workingColorSpace){return this.r=t,this.g=e,this.b=n,sS.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=sS.workingColorSpace){if(t=jb(t,1),e=Hb(e,0,1),n=Hb(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=qM(r,i,t+1/3),this.g=qM(r,i,t),this.b=qM(r,i,t-1/3)}return sS.toWorkingColorSpace(this,i),this}setStyle(t,e=yb){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let r;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,e);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,e);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=i[1],r=n.length;if(3===r)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===r)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=yb){const n=FM[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=aS(t.r),this.g=aS(t.g),this.b=aS(t.b),this}copyLinearToSRGB(t){return this.r=oS(t.r),this.g=oS(t.g),this.b=oS(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=yb){return sS.fromWorkingColorSpace(VM.copy(this),t),65536*Math.round(Hb(255*VM.r,0,255))+256*Math.round(Hb(255*VM.g,0,255))+Math.round(Hb(255*VM.b,0,255))}getHexString(t=yb){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=sS.workingColorSpace){sS.fromWorkingColorSpace(VM.copy(this),e);const n=VM.r,i=VM.g,r=VM.b,s=Math.max(n,i,r),a=Math.min(n,i,r);let o,l;const u=(a+s)/2;if(a===s)o=0,l=0;else{const t=s-a;switch(l=u<=.5?t/(s+a):t/(2-s-a),s){case n:o=(i-r)/t+(i<r?6:0);break;case i:o=(r-n)/t+2;break;case r:o=(n-i)/t+4}o/=6}return t.h=o,t.s=l,t.l=u,t}getRGB(t,e=sS.workingColorSpace){return sS.fromWorkingColorSpace(VM.copy(this),e),t.r=VM.r,t.g=VM.g,t.b=VM.b,t}getStyle(t=yb){sS.fromWorkingColorSpace(VM.copy(this),t);const e=VM.r,n=VM.g,i=VM.b;return t!==yb?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(t,e,n){return this.getHSL(kM),this.setHSL(kM.h+t,kM.s+e,kM.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(kM),t.getHSL(zM);const n=Wb(kM.h,zM.h,e),i=Wb(kM.s,zM.s,e),r=Wb(kM.l,zM.l,e);return this.setHSL(n,i,r),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.elements;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const VM=new GM;GM.NAMES=FM;let HM=0;class jM extends Fb{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:HM++}),this.uuid=Vb(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ax,this.blendDst=dx,this.blendEquation=sx,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new GM(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=wb,this.stencilZFail=wb,this.stencilZPass=wb,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(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==Ax&&(n.blendSrc=this.blendSrc),this.blendDst!==dx&&(n.blendDst=this.blendDst),this.blendEquation!==sx&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==wb&&(n.stencilFail=this.stencilFail),this.stencilZFail!==wb&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==wb&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class WM extends jM{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new GM(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 aM,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const XM=YM();function YM(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),i=new Uint32Array(512),r=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(i[t]=0,i[256|t]=32768,r[t]=24,r[256|t]=24):e<-14?(i[t]=1024>>-e-14,i[256|t]=1024>>-e-14|32768,r[t]=-e-1,r[256|t]=-e-1):e<=15?(i[t]=e+15<<10,i[256|t]=e+15<<10|32768,r[t]=13,r[256|t]=13):e<128?(i[t]=31744,i[256|t]=64512,r[t]=24,r[256|t]=24):(i[t]=31744,i[256|t]=64512,r[t]=13,r[256|t]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,n=0;for(;!(8388608&e);)e<<=1,n-=8388608;e&=-8388609,n+=947912704,s[t]=e|n}for(let t=1024;t<2048;++t)s[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(o[t]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function QM(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Hb(t,-65504,65504),XM.floatView[0]=t;const e=XM.uint32View[0],n=e>>23&511;return XM.baseTable[n]+((8388607&e)>>XM.shiftTable[n])}function $M(t){const e=t>>10;return XM.uint32View[0]=XM.mantissaTable[XM.offsetTable[e]+(1023&t)]+XM.exponentTable[e],XM.floatView[0]}const ZM=new _S,KM=new $b;class JM{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=Lb,this.updateRanges=[],this.gpuType=Fx,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)KM.fromBufferAttribute(this,e),KM.applyMatrix3(t),this.setXY(e,KM.x,KM.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)ZM.fromBufferAttribute(this,e),ZM.applyMatrix3(t),this.setXYZ(e,ZM.x,ZM.y,ZM.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)ZM.fromBufferAttribute(this,e),ZM.applyMatrix4(t),this.setXYZ(e,ZM.x,ZM.y,ZM.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)ZM.fromBufferAttribute(this,e),ZM.applyNormalMatrix(t),this.setXYZ(e,ZM.x,ZM.y,ZM.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)ZM.fromBufferAttribute(this,e),ZM.transformDirection(t),this.setXYZ(e,ZM.x,ZM.y,ZM.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Xb(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Yb(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Xb(e,this.array)),e}setX(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Xb(e,this.array)),e}setY(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Xb(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Xb(e,this.array)),e}setW(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array),r=Yb(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==Lb&&(t.usage=this.usage),t}}class tw extends JM{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class ew extends JM{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class nw extends JM{constructor(t,e,n){super(new Uint16Array(t),e,n),this.isFloat16BufferAttribute=!0}getX(t){let e=$M(this.array[t*this.itemSize]);return this.normalized&&(e=Xb(e,this.array)),e}setX(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize]=QM(e),this}getY(t){let e=$M(this.array[t*this.itemSize+1]);return this.normalized&&(e=Xb(e,this.array)),e}setY(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+1]=QM(e),this}getZ(t){let e=$M(this.array[t*this.itemSize+2]);return this.normalized&&(e=Xb(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+2]=QM(e),this}getW(t){let e=$M(this.array[t*this.itemSize+3]);return this.normalized&&(e=Xb(e,this.array)),e}setW(t,e){return this.normalized&&(e=Yb(e,this.array)),this.array[t*this.itemSize+3]=QM(e),this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array)),this.array[t+0]=QM(e),this.array[t+1]=QM(n),this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array)),this.array[t+0]=QM(e),this.array[t+1]=QM(n),this.array[t+2]=QM(i),this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array),r=Yb(r,this.array)),this.array[t+0]=QM(e),this.array[t+1]=QM(n),this.array[t+2]=QM(i),this.array[t+3]=QM(r),this}}class iw extends JM{constructor(t,e,n){super(new Float32Array(t),e,n)}}let rw=0;const sw=new $S,aw=new SM,ow=new _S,lw=new SS,uw=new SS,hw=new _S;class cw extends Fb{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:rw++}),this.uuid=Vb(),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(t){return Array.isArray(t)?this.index=new(function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?ew:tw)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Zb).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return sw.makeRotationFromQuaternion(t),this.applyMatrix4(sw),this}rotateX(t){return sw.makeRotationX(t),this.applyMatrix4(sw),this}rotateY(t){return sw.makeRotationY(t),this.applyMatrix4(sw),this}rotateZ(t){return sw.makeRotationZ(t),this.applyMatrix4(sw),this}translate(t,e,n){return sw.makeTranslation(t,e,n),this.applyMatrix4(sw),this}scale(t,e,n){return sw.makeScale(t,e,n),this.applyMatrix4(sw),this}lookAt(t){return aw.lookAt(t),aw.updateMatrix(),this.applyMatrix4(aw.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ow).negate(),this.translate(ow.x,ow.y,ow.z),this}setFromPoints(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new iw(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new SS);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new _S(-1/0,-1/0,-1/0),new _S(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];lw.setFromBufferAttribute(n),this.morphTargetsRelative?(hw.addVectors(this.boundingBox.min,lw.min),this.boundingBox.expandByPoint(hw),hw.addVectors(this.boundingBox.max,lw.max),this.boundingBox.expandByPoint(hw)):(this.boundingBox.expandByPoint(lw.min),this.boundingBox.expandByPoint(lw.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 qS);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new _S,1/0);if(t){const n=this.boundingSphere.center;if(lw.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];uw.setFromBufferAttribute(n),this.morphTargetsRelative?(hw.addVectors(lw.min,uw.min),lw.expandByPoint(hw),hw.addVectors(lw.max,uw.max),lw.expandByPoint(hw)):(lw.expandByPoint(uw.min),lw.expandByPoint(uw.max))}lw.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)hw.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(hw));if(e)for(let r=0,s=e.length;r<s;r++){const s=e[r],a=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++)hw.fromBufferAttribute(s,e),a&&(ow.fromBufferAttribute(t,e),hw.add(ow)),i=Math.max(i,n.distanceToSquared(hw))}this.boundingSphere.radius=Math.sqrt(i),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 t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.position,i=e.normal,r=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new JM(new Float32Array(4*n.count),4));const s=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<n.count;t++)a[t]=new _S,o[t]=new _S;const l=new _S,u=new _S,h=new _S,c=new $b,A=new $b,d=new $b,p=new _S,f=new _S;function m(t,e,i){l.fromBufferAttribute(n,t),u.fromBufferAttribute(n,e),h.fromBufferAttribute(n,i),c.fromBufferAttribute(r,t),A.fromBufferAttribute(r,e),d.fromBufferAttribute(r,i),u.sub(l),h.sub(l),A.sub(c),d.sub(c);const s=1/(A.x*d.y-d.x*A.y);isFinite(s)&&(p.copy(u).multiplyScalar(d.y).addScaledVector(h,-A.y).multiplyScalar(s),f.copy(h).multiplyScalar(A.x).addScaledVector(u,-d.x).multiplyScalar(s),a[t].add(p),a[e].add(p),a[i].add(p),o[t].add(f),o[e].add(f),o[i].add(f))}let g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(let e=0,n=g.length;e<n;++e){const n=g[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)m(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const y=new _S,v=new _S,_=new _S,x=new _S;function b(t){_.fromBufferAttribute(i,t),x.copy(_);const e=a[t];y.copy(e),y.sub(_.multiplyScalar(_.dot(e))).normalize(),v.crossVectors(x,e);const n=v.dot(o[t])<0?-1:1;s.setXYZW(t,y.x,y.y,y.z,n)}for(let e=0,n=g.length;e<n;++e){const n=g[e],i=n.start;for(let e=i,r=i+n.count;e<r;e+=3)b(t.getX(e+0)),b(t.getX(e+1)),b(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new JM(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new _S,r=new _S,s=new _S,a=new _S,o=new _S,l=new _S,u=new _S,h=new _S;if(t)for(let c=0,A=t.count;c<A;c+=3){const A=t.getX(c+0),d=t.getX(c+1),p=t.getX(c+2);i.fromBufferAttribute(e,A),r.fromBufferAttribute(e,d),s.fromBufferAttribute(e,p),u.subVectors(s,r),h.subVectors(i,r),u.cross(h),a.fromBufferAttribute(n,A),o.fromBufferAttribute(n,d),l.fromBufferAttribute(n,p),a.add(u),o.add(u),l.add(u),n.setXYZ(A,a.x,a.y,a.z),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let t=0,a=e.count;t<a;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),u.subVectors(s,r),h.subVectors(i,r),u.cross(h),n.setXYZ(t+0,u.x,u.y,u.z),n.setXYZ(t+1,u.x,u.y,u.z),n.setXYZ(t+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)hw.fromBufferAttribute(t,e),hw.normalize(),t.setXYZ(e,hw.x,hw.y,hw.z)}toNonIndexed(){function t(t,e){const n=t.array,i=t.itemSize,r=t.normalized,s=new n.constructor(e.length*i);let a=0,o=0;for(let r=0,l=e.length;r<l;r++){a=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*i;for(let t=0;t<i;t++)s[o++]=n[a++]}return new JM(s,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new cw,n=this.index.array,i=this.attributes;for(const r in i){const s=t(i[r],n);e.setAttribute(r,s)}const r=this.morphAttributes;for(const i in r){const s=[],a=r[i];for(let e=0,i=a.length;e<i;e++){const i=t(a[e],n);s.push(i)}e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let t=0,n=s.length;t<n;t++){const n=s[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];s.push(i.toJSON(t.data))}s.length>0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t<r;t++)n.push(i[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Aw=new $S,dw=new QS,pw=new qS,fw=new _S,mw=new _S,gw=new _S,yw=new _S,vw=new _S,_w=new _S,xw=new _S,bw=new _S;class Sw extends SM{constructor(t=new cw,e=new WM){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,s=n.morphTargetsRelative;e.fromBufferAttribute(i,t);const a=this.morphTargetInfluences;if(r&&a){_w.set(0,0,0);for(let n=0,i=r.length;n<i;n++){const i=a[n],o=r[n];0!==i&&(vw.fromBufferAttribute(o,t),s?_w.addScaledVector(vw,i):_w.addScaledVector(vw.sub(e),i))}e.add(_w)}return e}raycast(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0!==i){if(null===n.boundingSphere&&n.computeBoundingSphere(),pw.copy(n.boundingSphere),pw.applyMatrix4(r),dw.copy(t.ray).recast(t.near),!1===pw.containsPoint(dw.origin)){if(null===dw.intersectSphere(pw,fw))return;if(dw.origin.distanceToSquared(fw)>(t.far-t.near)**2)return}Aw.copy(r).invert(),dw.copy(t.ray).applyMatrix4(Aw),null!==n.boundingBox&&!1===dw.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,dw)}}_computeIntersections(t,e,n){let i;const r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,u=r.attributes.uv1,h=r.attributes.normal,c=r.groups,A=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=c.length;r<o;r++){const o=c[r],d=s[o.materialIndex];for(let r=Math.max(o.start,A.start),s=Math.min(a.count,Math.min(o.start+o.count,A.start+A.count));r<s;r+=3){i=Mw(this,d,t,n,l,u,h,a.getX(r),a.getX(r+1),a.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,e.push(i))}}else{for(let r=Math.max(0,A.start),o=Math.min(a.count,A.start+A.count);r<o;r+=3){i=Mw(this,s,t,n,l,u,h,a.getX(r),a.getX(r+1),a.getX(r+2)),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}else if(void 0!==o)if(Array.isArray(s))for(let r=0,a=c.length;r<a;r++){const a=c[r],d=s[a.materialIndex];for(let r=Math.max(a.start,A.start),s=Math.min(o.count,Math.min(a.start+a.count,A.start+A.count));r<s;r+=3){i=Mw(this,d,t,n,l,u,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=a.materialIndex,e.push(i))}}else{for(let r=Math.max(0,A.start),a=Math.min(o.count,A.start+A.count);r<a;r+=3){i=Mw(this,s,t,n,l,u,h,r,r+1,r+2),i&&(i.faceIndex=Math.floor(r/3),e.push(i))}}}}function Mw(t,e,n,i,r,s,a,o,l,u){t.getVertexPosition(o,mw),t.getVertexPosition(l,gw),t.getVertexPosition(u,yw);const h=function(t,e,n,i,r,s,a,o){let l;if(l=1===e.side?i.intersectTriangle(a,s,r,!0,o):i.intersectTriangle(r,s,a,0===e.side,o),null===l)return null;bw.copy(o),bw.applyMatrix4(t.matrixWorld);const u=n.ray.origin.distanceTo(bw);return u<n.near||u>n.far?null:{distance:u,point:bw.clone(),object:t}}(t,e,n,i,mw,gw,yw,xw);if(h){const t=new _S;OM.getBarycoord(xw,mw,gw,yw,t),r&&(h.uv=OM.getInterpolatedAttribute(r,o,l,u,t,new $b)),s&&(h.uv1=OM.getInterpolatedAttribute(s,o,l,u,t,new $b)),a&&(h.normal=OM.getInterpolatedAttribute(a,o,l,u,t,new _S),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const e={a:o,b:l,c:u,normal:new _S,materialIndex:0};OM.getNormal(mw,gw,yw,e.normal),h.face=e,h.barycoord=t}return h}class ww extends cw{constructor(t=1,e=1,n=1,i=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:s};const a=this;i=Math.floor(i),r=Math.floor(r),s=Math.floor(s);const o=[],l=[],u=[],h=[];let c=0,A=0;function d(t,e,n,i,r,s,d,p,f,m,g){const y=s/f,v=d/m,_=s/2,x=d/2,b=p/2,S=f+1,M=m+1;let w=0,T=0;const E=new _S;for(let s=0;s<M;s++){const a=s*v-x;for(let o=0;o<S;o++){const c=o*y-_;E[t]=c*i,E[e]=a*r,E[n]=b,l.push(E.x,E.y,E.z),E[t]=0,E[e]=0,E[n]=p>0?1:-1,u.push(E.x,E.y,E.z),h.push(o/f),h.push(1-s/m),w+=1}}for(let t=0;t<m;t++)for(let e=0;e<f;e++){const n=c+e+S*t,i=c+e+S*(t+1),r=c+(e+1)+S*(t+1),s=c+(e+1)+S*t;o.push(n,i,s),o.push(i,r,s),T+=6}a.addGroup(A,T,g),A+=T,c+=w}d("z","y","x",-1,-1,n,e,t,s,r,0),d("z","y","x",1,-1,n,e,-t,s,r,1),d("x","z","y",1,1,t,n,e,i,s,2),d("x","z","y",1,-1,t,n,-e,i,s,3),d("x","y","z",1,-1,t,e,n,i,r,4),d("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(o),this.setAttribute("position",new iw(l,3)),this.setAttribute("normal",new iw(u,3)),this.setAttribute("uv",new iw(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ww(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Tw(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}class Ew extends jM{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",this.fragmentShader="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={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!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Tw(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class Cw extends SM{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new $S,this.projectionMatrix=new $S,this.projectionMatrixInverse=new $S,this.coordinateSystem=Ub}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const Rw=new _S,Nw=new $b,Pw=new $b;class Dw extends Cw{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*Gb*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*qb*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Gb*Math.atan(Math.tan(.5*qb*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Rw.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Rw.x,Rw.y).multiplyScalar(-t/Rw.z),Rw.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Rw.x,Rw.y).multiplyScalar(-t/Rw.z)}getViewSize(t,e){return this.getViewBounds(t,Nw,Pw),e.subVectors(Pw,Nw)}setViewOffset(t,e,n,i,r,s){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*qb*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Iw=-90;class Lw extends SM{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Dw(Iw,1,t,e);i.layers=this.layers,this.add(i);const r=new Dw(Iw,1,t,e);r.layers=this.layers,this.add(r);const s=new Dw(Iw,1,t,e);s.layers=this.layers,this.add(s);const a=new Dw(Iw,1,t,e);a.layers=this.layers,this.add(a);const o=new Dw(Iw,1,t,e);o.layers=this.layers,this.add(o);const l=new Dw(Iw,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,i,r,s,a,o]=e;for(const t of e)this.remove(t);if(t===Ub)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(t!==Ob)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,s,a,o,l,u]=this.children,h=t.getRenderTarget(),c=t.getActiveCubeFace(),A=t.getActiveMipmapLevel(),d=t.xr.enabled;t.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,r),t.setRenderTarget(n,1,i),t.render(e,s),t.setRenderTarget(n,2,i),t.render(e,a),t.setRenderTarget(n,3,i),t.render(e,o),t.setRenderTarget(n,4,i),t.render(e,l),n.texture.generateMipmaps=p,t.setRenderTarget(n,5,i),t.render(e,u),t.setRenderTarget(h,c,A),t.xr.enabled=d,n.texture.needsPMREMUpdate=!0}}class Bw extends pS{constructor(t,e,n,i,r,s,a,o,l,u){super(t=void 0!==t?t:[],e=void 0!==e?e:vx,n,i,r,s,a,o,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Uw extends gS{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Bw(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:Rx}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={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"},i=new ww(5,5,5),r=new Ew({name:"CubemapFromEquirect",uniforms:Tw(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new Sw(i,r),a=e.minFilter;e.minFilter===Px&&(e.minFilter=Rx);return new Lw(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}class Ow extends SM{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 aM,this.environmentIntensity=1,this.environmentRotation=new aM,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}class Fw{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Lb,this.updateRanges=[],this.version=0,this.uuid=Vb()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Vb()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Vb()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.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 kw=new _S;class zw{constructor(t,e,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)kw.fromBufferAttribute(this,e),kw.applyMatrix4(t),this.setXYZ(e,kw.x,kw.y,kw.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)kw.fromBufferAttribute(this,e),kw.applyNormalMatrix(t),this.setXYZ(e,kw.x,kw.y,kw.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)kw.fromBufferAttribute(this,e),kw.transformDirection(t),this.setXYZ(e,kw.x,kw.y,kw.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Xb(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Yb(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=Yb(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Yb(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Yb(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Yb(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Xb(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Xb(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Xb(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Xb(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Yb(e,this.array),n=Yb(n,this.array),i=Yb(i,this.array),r=Yb(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new JM(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new zw(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class qw extends jM{constructor(t){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new GM(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}class Gw extends pS{constructor(t=null,e=1,n=1,i,r,s,a,o,l=1003,u=1003,h,c){super(null,s,a,o,l,u,i,r,h,c),this.isDataTexture=!0,this.image={data:t,width:e,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Vw extends JM{constructor(t,e,n,i=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}const Hw=new _S,jw=new _S,Ww=new Zb;class Xw{constructor(t=new _S(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const i=Hw.subVectors(n,e).cross(jw.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(Hw),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:e.copy(t.start).addScaledVector(n,r)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Ww.getNormalMatrix(t),i=this.coplanarPoint(Hw).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Yw=new qS,Qw=new _S;class $w{constructor(t=new Xw,e=new Xw,n=new Xw,i=new Xw,r=new Xw,s=new Xw){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,i=t.elements,r=i[0],s=i[1],a=i[2],o=i[3],l=i[4],u=i[5],h=i[6],c=i[7],A=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],y=i[14],v=i[15];if(n[0].setComponents(o-r,c-l,f-A,v-m).normalize(),n[1].setComponents(o+r,c+l,f+A,v+m).normalize(),n[2].setComponents(o+s,c+u,f+d,v+g).normalize(),n[3].setComponents(o-s,c-u,f-d,v-g).normalize(),n[4].setComponents(o-a,c-h,f-p,v-y).normalize(),e===Ub)n[5].setComponents(o+a,c+h,f+p,v+y).normalize();else{if(e!==Ob)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(a,h,p,y).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Yw.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Yw.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Yw)}intersectsSprite(t){return Yw.center.set(0,0,0),Yw.radius=.7071067811865476,Yw.applyMatrix4(t.matrixWorld),this.intersectsSphere(Yw)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<i)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(Qw.x=i.normal.x>0?t.max.x:t.min.x,Qw.y=i.normal.y>0?t.max.y:t.min.y,Qw.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Qw)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}class Zw extends jM{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new GM(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}class Kw extends jM{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new GM(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}class Jw extends pS{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=Tx,this.minFilter=Tx,this.generateMipmaps=!1,this.needsUpdate=!0}}class tT extends pS{constructor(t,e,n,i,r,s,a,o,l,u=1026){if(u!==Vx&&u!==Hx)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Vx&&(n=Ox),void 0===n&&u===Hx&&(n=zx),super(null,i,r,s,a,o,u,n,l),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==a?a:Tx,this.minFilter=void 0!==o?o:Tx,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}class eT extends cw{constructor(t=1,e=32,n=16,i=0,r=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:s,thetaLength:a},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const u=[],h=new _S,c=new _S,A=[],d=[],p=[],f=[];for(let A=0;A<=n;A++){const m=[],g=A/n;let y=0;0===A&&0===s?y=.5/e:A===n&&o===Math.PI&&(y=-.5/e);for(let n=0;n<=e;n++){const o=n/e;h.x=-t*Math.cos(i+o*r)*Math.sin(s+g*a),h.y=t*Math.cos(s+g*a),h.z=t*Math.sin(i+o*r)*Math.sin(s+g*a),d.push(h.x,h.y,h.z),c.copy(h).normalize(),p.push(c.x,c.y,c.z),f.push(o+y,1-g),m.push(l++)}u.push(m)}for(let t=0;t<n;t++)for(let i=0;i<e;i++){const e=u[t][i+1],r=u[t][i],a=u[t+1][i],l=u[t+1][i+1];(0!==t||s>0)&&A.push(e,r,l),(t!==n-1||o<Math.PI)&&A.push(r,a,l)}this.setIndex(A),this.setAttribute("position",new iw(d,3)),this.setAttribute("normal",new iw(p,3)),this.setAttribute("uv",new iw(f,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new eT(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class nT extends jM{constructor(t){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new GM(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}class iT extends jM{constructor(t){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new GM(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 GM(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(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 aM,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class rT extends iT{constructor(t){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 $b(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Hb(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new GM(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 GM(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new GM(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(t)}get anisotropy(){return this._anisotropy}set anisotropy(t){this._anisotropy>0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get dispersion(){return this._dispersion}set dispersion(t){this._dispersion>0!=t>0&&this.version++,this._dispersion=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.dispersion=t.dispersion,this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class sT extends jM{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new GM(16777215),this.specular=new GM(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new GM(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aM,this.combine=0,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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class aT extends jM{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new GM(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new GM(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class oT extends jM{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class lT extends jM{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new GM(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new GM(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new aM,this.combine=0,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(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class uT extends jM{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new GM(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new $b(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class hT extends Zw{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}class cT extends SM{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new GM(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(e.object.target=this.target.uuid),e}}class AT extends cT{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(SM.DEFAULT_UP),this.updateMatrix(),this.groundColor=new GM(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}}const dT=new $S,pT=new _S,fT=new _S;class mT{constructor(t){this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new $b(512,512),this.map=null,this.mapPass=null,this.matrix=new $S,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new $w,this._frameExtents=new $b(1,1),this._viewportCount=1,this._viewports=[new fS(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;pT.setFromMatrixPosition(t.matrixWorld),e.position.copy(pT),fT.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(fT),e.updateMatrixWorld(),dT.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(dT),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(dT)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.intensity=t.intensity,this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 1!==this.intensity&&(t.intensity=this.intensity),0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class gT extends mT{constructor(){super(new Dw(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){const e=this.camera,n=2*Gb*t.angle*this.focus,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}class yT extends cT{constructor(t,e,n=0,i=Math.PI/3,r=0,s=2){super(t,e),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(SM.DEFAULT_UP),this.updateMatrix(),this.target=new SM,this.distance=n,this.angle=i,this.penumbra=r,this.decay=s,this.map=null,this.shadow=new gT}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}const vT=new $S,_T=new _S,xT=new _S;class bT extends mT{constructor(){super(new Dw(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new $b(4,2),this._viewportCount=6,this._viewports=[new fS(2,1,1,1),new fS(0,1,1,1),new fS(3,1,1,1),new fS(1,1,1,1),new fS(3,0,1,1),new fS(1,0,1,1)],this._cubeDirections=[new _S(1,0,0),new _S(-1,0,0),new _S(0,0,1),new _S(0,0,-1),new _S(0,1,0),new _S(0,-1,0)],this._cubeUps=[new _S(0,1,0),new _S(0,1,0),new _S(0,1,0),new _S(0,1,0),new _S(0,0,1),new _S(0,0,-1)]}updateMatrices(t,e=0){const n=this.camera,i=this.matrix,r=t.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),_T.setFromMatrixPosition(t.matrixWorld),n.position.copy(_T),xT.copy(n.position),xT.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(xT),n.updateMatrixWorld(),i.makeTranslation(-_T.x,-_T.y,-_T.z),vT.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vT)}}class ST extends cT{constructor(t,e,n=0,i=2){super(t,e),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new bT}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,e){return super.copy(t,e),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}class MT extends Cw{constructor(t=-1,e=1,n=1,i=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,r,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,s=n+t,a=i+e,o=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,a-=e*this.view.offsetY,o=a-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}class wT extends mT{constructor(){super(new MT(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class TT extends cT{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(SM.DEFAULT_UP),this.updateMatrix(),this.target=new SM,this.shadow=new wT}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}class ET extends cT{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}}class CT extends cT{constructor(t,e,n=10,i=10){super(t,e),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}class RT{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new _S)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*i),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*n),e.addScaledVector(s[4],n*i*1.092548),e.addScaledVector(s[5],i*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],n*r*1.092548),e.addScaledVector(s[8],.546274*(n*n-i*i)),e}getIrradianceAt(t,e){const n=t.x,i=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*i),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*n),e.addScaledVector(s[4],.858086*n*i),e.addScaledVector(s[5],.858086*i*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*n*r),e.addScaledVector(s[8],.429043*(n*n-i*i)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this}toArray(t=[],e=0){const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}static getBasisAt(t,e){const n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}class NT extends cT{constructor(t=new RT,e=1){super(void 0,e),this.isLightProbe=!0,this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}class PT extends Fw{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}const DT=["alphaMap","alphaTest","anisotropy","anisotropyMap","anisotropyRotation","aoMap","attenuationColor","attenuationDistance","bumpMap","clearcoat","clearcoatMap","clearcoatNormalMap","clearcoatNormalScale","clearcoatRoughness","color","dispersion","displacementMap","emissive","emissiveMap","envMap","gradientMap","ior","iridescence","iridescenceIOR","iridescenceMap","iridescenceThicknessMap","lightMap","map","matcap","metalness","metalnessMap","normalMap","normalScale","opacity","roughness","roughnessMap","sheen","sheenColor","sheenColorMap","sheenRoughnessMap","shininess","specular","specularColor","specularColorMap","specularIntensity","specularIntensityMap","specularMap","thickness","transmission","transmissionMap"];class IT{constructor(t){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(t),this.hasAnimation=!0===t.object.isSkinnedMesh,this.refreshUniforms=DT,this.renderId=0}firstInitialization(t){return!1===this.renderObjects.has(t)&&(this.getRenderObjectData(t),!0)}getRenderObjectData(t){let e=this.renderObjects.get(t);return void 0===e&&(e={material:this.getMaterialData(t.material),worldMatrix:t.object.matrixWorld.clone()},t.object.center&&(e.center=t.object.center.clone()),t.object.morphTargetInfluences&&(e.morphTargetInfluences=t.object.morphTargetInfluences.slice()),null!==t.bundle&&(e.version=t.bundle.version),this.renderObjects.set(t,e)),e}containsNode(t){const e=t.material;for(const t in e)if(e[t]&&e[t].isNode)return!0;return null!==t.renderer.nodes.modelViewMatrix||null!==t.renderer.nodes.modelNormalViewMatrix}getMaterialData(t){const e={};for(const n of this.refreshUniforms){const i=t[n];null!=i&&("object"==typeof i&&void 0!==i.clone?!0===i.isTexture?e[n]={id:i.id,version:i.version}:e[n]=i.clone():e[n]=i)}return e}equals(t){const{object:e,material:n}=t,i=this.getRenderObjectData(t);if(!0!==i.worldMatrix.equals(e.matrixWorld))return i.worldMatrix.copy(e.matrixWorld),!1;const r=i.material;for(const t in r){const e=r[t],i=n[t];if(void 0!==e.equals){if(!1===e.equals(i))return e.copy(i),!1}else if(!0===i.isTexture){if(e.id!==i.id||e.version!==i.version)return e.id=i.id,e.version=i.version,!1}else if(e!==i)return r[t]=i,!1}if(i.morphTargetInfluences){let t=!1;for(let n=0;n<i.morphTargetInfluences.length;n++)i.morphTargetInfluences[n]!==e.morphTargetInfluences[n]&&(t=!0);if(t)return!0}return i.center&&!1===i.center.equals(e.center)?(i.center.copy(e.center),!0):(null!==t.bundle&&(i.version=t.bundle.version),!0)}needsRefresh(t,e){if(this.hasNode||this.hasAnimation||this.firstInitialization(t))return!0;const{renderId:n}=e;if(this.renderId!==n)return this.renderId=n,!0;const i=!0===t.object.static,r=null!==t.bundle&&!0===t.bundle.static&&this.getRenderObjectData(t).version===t.bundle.version;if(i||r)return!1;return!0!==this.equals(t)}}function LT(t,e=0){let n=3735928559^e,i=1103547991^e;if(t instanceof Array)for(let e,r=0;r<t.length;r++)e=t[r],n=Math.imul(n^e,2654435761),i=Math.imul(i^e,1597334677);else for(let e,r=0;r<t.length;r++)e=t.charCodeAt(r),n=Math.imul(n^e,2654435761),i=Math.imul(i^e,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&i)+(n>>>0)}const BT=t=>LT(t),UT=(...t)=>LT(t);function OT(t,e=!1){const n=[];!0===t.isNode&&(n.push(t.id),t=t.getSelf());for(const{property:i,childNode:r}of FT(t))n.push(n,LT(i.slice(0,-4)),r.getCacheKey(e));return LT(n)}function*FT(t,e=!1){for(const n in t){if(!0===n.startsWith("_"))continue;const i=t[n];if(!0===Array.isArray(i))for(let t=0;t<i.length;t++){const r=i[t];r&&(!0===r.isNode||e&&"function"==typeof r.toJSON)&&(yield{property:n,index:t,childNode:r})}else if(i&&!0===i.isNode)yield{property:n,childNode:i};else if("object"==typeof i)for(const t in i){const r=i[t];r&&(!0===r.isNode||e&&"function"==typeof r.toJSON)&&(yield{property:n,index:t,childNode:r})}}}function kT(t){if(null==t)return null;const e=typeof t;return!0===t.isNode?"node":"number"===e?"float":"boolean"===e?"bool":"string"===e?"string":"function"===e?"shader":!0===t.isVector2?"vec2":!0===t.isVector3?"vec3":!0===t.isVector4?"vec4":!0===t.isMatrix3?"mat3":!0===t.isMatrix4?"mat4":!0===t.isColor?"color":t instanceof ArrayBuffer?"ArrayBuffer":null}function zT(t,...e){const n=t?t.slice(-4):void 0;return 1===e.length&&("vec2"===n?e=[e[0],e[0]]:"vec3"===n?e=[e[0],e[0],e[0]]:"vec4"===n&&(e=[e[0],e[0],e[0],e[0]])),"color"===t?new GM(...e):"vec2"===n?new $b(...e):"vec3"===n?new _S(...e):"vec4"===n?new fS(...e):"mat3"===n?new Zb(...e):"mat4"===n?new $S(...e):"bool"===t?e[0]||!1:"float"===t||"int"===t||"uint"===t?e[0]||0:"string"===t?e[0]||"":"ArrayBuffer"===t?(i=e[0],Uint8Array.from(atob(i),(t=>t.charCodeAt(0))).buffer):null;var i}const qT="vertex",GT="none",VT="frame",HT="render",jT="object",WT=["setup","analyze","generate"],XT=["fragment","vertex","compute"],YT=["x","y","z","w"];let QT=0;class $T extends Fb{static get type(){return"Node"}constructor(t=null){super(),this.nodeType=t,this.updateType=GT,this.updateBeforeType=GT,this.updateAfterType=GT,this.uuid=Qb.generateUUID(),this.version=0,this._cacheKey=null,this._cacheKeyVersion=0,this.global=!1,this.isNode=!0,Object.defineProperty(this,"id",{value:QT++})}set needsUpdate(t){!0===t&&this.version++}get type(){return this.constructor.type}onUpdate(t,e){return this.updateType=e,this.update=t.bind(this.getSelf()),this}onFrameUpdate(t){return this.onUpdate(t,VT)}onRenderUpdate(t){return this.onUpdate(t,HT)}onObjectUpdate(t){return this.onUpdate(t,jT)}onReference(t){return this.updateReference=t.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:t}of FT(this))yield t}dispose(){this.dispatchEvent({type:"dispose"})}traverse(t){t(this);for(const e of this.getChildren())e.traverse(t)}getCacheKey(t=!1){return!0!==(t=t||this.version!==this._cacheKeyVersion)&&null!==this._cacheKey||(this._cacheKey=OT(this,t),this._cacheKeyVersion=this.version),this._cacheKey}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(t){const e=this.getNodeType(t);return t.getElementType(e)}getNodeType(t){const e=t.getNodeProperties(this);return e.outputNode?e.outputNode.getNodeType(t):this.nodeType}getShared(t){const e=this.getHash(t);return t.getNodeFromHash(e)||this}setup(t){const e=t.getNodeProperties(this);let n=0;for(const t of this.getChildren())e["node"+n++]=t;return null}analyze(t){if(1===t.increaseUsage(this)){const e=t.getNodeProperties(this);for(const n of Object.values(e))n&&!0===n.isNode&&n.build(t)}}generate(t,e){const{outputNode:n}=t.getNodeProperties(this);if(n&&!0===n.isNode)return n.build(t,e)}updateBefore(){console.warn("Abstract function.")}updateAfter(){console.warn("Abstract function.")}update(){console.warn("Abstract function.")}build(t,e=null){const n=this.getShared(t);if(this!==n)return n.build(t,e);t.addNode(this),t.addChain(this);let i=null;const r=t.getBuildStage();if("setup"===r){this.updateReference(t);const e=t.getNodeProperties(this);if(!0!==e.initialized){t.stack.nodes.length;e.initialized=!0,e.outputNode=this.setup(t),null!==e.outputNode&&t.stack.nodes.length;for(const n of Object.values(e))n&&!0===n.isNode&&n.build(t)}}else if("analyze"===r)this.analyze(t);else if("generate"===r){if(1===this.generate.length){const n=this.getNodeType(t),r=t.getDataFromNode(this);i=r.snippet,void 0===i?(i=this.generate(t)||"",r.snippet=i):void 0!==r.flowCodes&&void 0!==t.context.nodeBlock&&t.addFlowCodeHierarchy(this,t.context.nodeBlock),i=t.format(i,n,e)}else i=this.generate(t,e)||""}return t.removeChain(this),i}getSerializeChildren(){return FT(this)}serialize(t){const e=this.getSerializeChildren(),n={};for(const{property:i,index:r,childNode:s}of e)void 0!==r?(void 0===n[i]&&(n[i]=Number.isInteger(r)?[]:{}),n[i][r]=s.toJSON(t.meta).uuid):n[i]=s.toJSON(t.meta).uuid;Object.keys(n).length>0&&(t.inputNodes=n)}deserialize(t){if(void 0!==t.inputNodes){const e=t.meta.nodes;for(const n in t.inputNodes)if(Array.isArray(t.inputNodes[n])){const i=[];for(const r of t.inputNodes[n])i.push(e[r]);this[n]=i}else if("object"==typeof t.inputNodes[n]){const i={};for(const r in t.inputNodes[n]){const s=t.inputNodes[n][r];i[r]=e[s]}this[n]=i}else{const i=t.inputNodes[n];this[n]=e[i]}}}toJSON(t){const{uuid:e,type:n}=this,i=void 0===t||"string"==typeof t;i&&(t={textures:{},images:{},nodes:{}});let r=t.nodes[e];function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(void 0===r&&(r={uuid:e,type:n,meta:t,metadata:{version:4.6,type:"Node",generator:"Node.toJSON"}},!0!==i&&(t.nodes[r.uuid]=r),this.serialize(r),delete r.meta),i){const e=s(t.textures),n=s(t.images),i=s(t.nodes);e.length>0&&(r.textures=e),n.length>0&&(r.images=n),i.length>0&&(r.nodes=i)}return r}}class ZT extends $T{static get type(){return"ArrayElementNode"}constructor(t,e){super(),this.node=t,this.indexNode=e,this.isArrayElementNode=!0}getNodeType(t){return this.node.getElementType(t)}generate(t){return`${this.node.build(t)}[ ${this.indexNode.build(t,"uint")} ]`}}class KT extends $T{static get type(){return"ConvertNode"}constructor(t,e){super(),this.node=t,this.convertTo=e}getNodeType(t){const e=this.node.getNodeType(t);let n=null;for(const i of this.convertTo.split("|"))null!==n&&t.getTypeLength(e)!==t.getTypeLength(i)||(n=i);return n}serialize(t){super.serialize(t),t.convertTo=this.convertTo}deserialize(t){super.deserialize(t),this.convertTo=t.convertTo}generate(t,e){const n=this.node,i=this.getNodeType(t),r=n.build(t,i);return t.format(r,i,e)}}class JT extends $T{static get type(){return"TempNode"}constructor(t){super(t),this.isTempNode=!0}hasDependencies(t){return t.getDataFromNode(this).usageCount>1}build(t,e){if("generate"===t.getBuildStage()){const n=t.getVectorType(this.getNodeType(t,e)),i=t.getDataFromNode(this);if(void 0!==i.propertyName)return t.format(i.propertyName,n,e);if("void"!==n&&"void"!==e&&this.hasDependencies(t)){const r=super.build(t,n),s=t.getVarFromNode(this,null,n),a=t.getPropertyName(s);return t.addLineFlowCode(`${a} = ${r}`,this),i.snippet=r,i.propertyName=a,t.format(i.propertyName,n,e)}}return super.build(t,e)}}class tE extends JT{static get type(){return"JoinNode"}constructor(t=[],e=null){super(e),this.nodes=t}getNodeType(t){return null!==this.nodeType?t.getVectorType(this.nodeType):t.getTypeFromLength(this.nodes.reduce(((e,n)=>e+t.getTypeLength(n.getNodeType(t))),0))}generate(t,e){const n=this.getNodeType(t),i=this.nodes,r=t.getComponentType(n),s=[];for(const e of i){let n=e.build(t);const i=t.getComponentType(e.getNodeType(t));i!==r&&(n=t.format(n,i,r)),s.push(n)}const a=`${t.getType(n)}( ${s.join(", ")} )`;return t.format(a,n,e)}}const eE=YT.join("");class nE extends $T{static get type(){return"SplitNode"}constructor(t,e="x"){super(),this.node=t,this.components=e,this.isSplitNode=!0}getVectorLength(){let t=this.components.length;for(const e of this.components)t=Math.max(YT.indexOf(e)+1,t);return t}getComponentType(t){return t.getComponentType(this.node.getNodeType(t))}getNodeType(t){return t.getTypeFromLength(this.components.length,this.getComponentType(t))}generate(t,e){const n=this.node,i=t.getTypeLength(n.getNodeType(t));let r=null;if(i>1){let s=null;this.getVectorLength()>=i&&(s=t.getTypeFromLength(this.getVectorLength(),this.getComponentType(t)));const a=n.build(t,s);r=this.components.length===i&&this.components===eE.slice(0,this.components.length)?t.format(a,s,e):t.format(`${a}.${this.components}`,this.getNodeType(t),e)}else r=n.build(t,e);return r}serialize(t){super.serialize(t),t.components=this.components}deserialize(t){super.deserialize(t),this.components=t.components}}class iE extends JT{static get type(){return"SetNode"}constructor(t,e,n){super(),this.sourceNode=t,this.components=e,this.targetNode=n}getNodeType(t){return this.sourceNode.getNodeType(t)}generate(t){const{sourceNode:e,components:n,targetNode:i}=this,r=this.getNodeType(t),s=t.getTypeFromLength(n.length,i.getNodeType(t)),a=i.build(t,s),o=e.build(t,r),l=t.getTypeLength(r),u=[];for(let t=0;t<l;t++){const e=YT[t];e===n[0]?(u.push(a),t+=n.length-1):u.push(o+"."+e)}return`${t.getType(r)}( ${u.join(", ")} )`}}class rE extends JT{static get type(){return"FlipNode"}constructor(t,e){super(),this.sourceNode=t,this.components=e}getNodeType(t){return this.sourceNode.getNodeType(t)}generate(t){const{components:e,sourceNode:n}=this,i=this.getNodeType(t),r=n.build(t),s=t.getVarFromNode(this),a=t.getPropertyName(s);t.addLineFlowCode(a+" = "+r,this);const o=t.getTypeLength(i),l=[];let u=0;for(let t=0;t<o;t++){const n=YT[t];n===e[u]?(l.push("1.0 - "+a+"."+n),u++):l.push(a+"."+n)}return`${t.getType(i)}( ${l.join(", ")} )`}}class sE extends $T{static get type(){return"InputNode"}constructor(t,e=null){super(e),this.isInputNode=!0,this.value=t,this.precision=null}getNodeType(){return null===this.nodeType?kT(this.value):this.nodeType}getInputType(t){return this.getNodeType(t)}setPrecision(t){return this.precision=t,this}serialize(t){super.serialize(t),t.value=this.value,this.value&&this.value.toArray&&(t.value=this.value.toArray()),t.valueType=kT(this.value),t.nodeType=this.nodeType,"ArrayBuffer"===t.valueType&&(t.value=function(t){let e="";const n=new Uint8Array(t);for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return btoa(e)}(t.value)),t.precision=this.precision}deserialize(t){super.deserialize(t),this.nodeType=t.nodeType,this.value=Array.isArray(t.value)?zT(t.valueType,...t.value):t.value,this.precision=t.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(t.value))}generate(){console.warn("Abstract function.")}}class aE extends sE{static get type(){return"ConstNode"}constructor(t,e=null){super(t,e),this.isConstNode=!0}generateConst(t){return t.generateConst(this.getNodeType(t),this.value)}generate(t,e){const n=this.getNodeType(t);return t.format(this.generateConst(t),n,e)}}let oE=null;const lE=new Map;function uE(t,e){if(lE.has(t))console.warn(`Redefinition of method chaining ${t}`);else{if("function"!=typeof e)throw new Error(`Node element ${t} is not a function`);lE.set(t,e)}}const hE=t=>t.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),cE=t=>hE(t).split("").sort().join(""),AE={setup(t,e){const n=e.shift();return t(UE(n),...e)},get(t,e,n){if("string"==typeof e&&void 0===t[e]){if(!0!==t.isStackNode&&"assign"===e)return(...t)=>(oE.assign(n,...t),n);if(lE.has(e)){const i=lE.get(e);return t.isStackNode?(...t)=>n.add(i(...t)):(...t)=>i(n,...t)}if("self"===e)return t;if(e.endsWith("Assign")&&lE.has(e.slice(0,e.length-6))){const i=lE.get(e.slice(0,e.length-6));return t.isStackNode?(...t)=>n.assign(t[0],i(...t)):(...t)=>n.assign(i(n,...t))}if(!0===/^[xyzwrgbastpq]{1,4}$/.test(e))return e=hE(e),BE(new nE(n,e));if(!0===/^set[XYZWRGBASTPQ]{1,4}$/.test(e))return e=cE(e.slice(3).toLowerCase()),n=>BE(new iE(t,e,n));if(!0===/^flip[XYZWRGBASTPQ]{1,4}$/.test(e))return e=cE(e.slice(4).toLowerCase()),()=>BE(new rE(BE(t),e));if("width"===e||"height"===e||"depth"===e)return"width"===e?e="x":"height"===e?e="y":"depth"===e&&(e="z"),BE(new nE(t,e));if(!0===/^\d+$/.test(e))return BE(new ZT(n,new aE(Number(e),"uint")))}return Reflect.get(t,e,n)},set:(t,e,n,i)=>"string"!=typeof e||void 0!==t[e]||!0!==/^[xyzwrgbastpq]{1,4}$/.test(e)&&"width"!==e&&"height"!==e&&"depth"!==e&&!0!==/^\d+$/.test(e)?Reflect.set(t,e,n,i):(i[e].assign(n),!0)},dE=new WeakMap,pE=new WeakMap,fE=function(t,e=null){for(const n in t)t[n]=BE(t[n],e);return t},mE=function(t,e=null){const n=t.length;for(let i=0;i<n;i++)t[i]=BE(t[i],e);return t},gE=function(t,e=null,n=null,i=null){const r=t=>BE(null!==i?Object.assign(t,i):t);return null===e?(...e)=>r(new t(...OE(e))):null!==n?(n=BE(n),(...i)=>r(new t(e,...OE(i),n))):(...n)=>r(new t(e,...OE(n)))},yE=function(t,...e){return BE(new t(...OE(e)))};class vE extends $T{constructor(t,e){super(),this.shaderNode=t,this.inputNodes=e}getNodeType(t){return this.shaderNode.nodeType||this.getOutputNode(t).getNodeType(t)}call(t){const{shaderNode:e,inputNodes:n}=this,i=t.getNodeProperties(e);if(i.onceOutput)return i.onceOutput;let r=null;if(e.layout){let i=pE.get(t.constructor);void 0===i&&(i=new WeakMap,pE.set(t.constructor,i));let s=i.get(e);void 0===s&&(s=BE(t.buildFunctionNode(e)),i.set(e,s)),null!==t.currentFunctionNode&&t.currentFunctionNode.includes.push(s),r=BE(s.call(n))}else{const i=e.jsFunc,s=null!==n?i(n,t):i(t);r=BE(s)}return e.once&&(i.onceOutput=r),r}getOutputNode(t){const e=t.getNodeProperties(this);return null===e.outputNode&&(e.outputNode=this.setupOutput(t)),e.outputNode}setup(t){return this.getOutputNode(t)}setupOutput(t){return t.addStack(),t.stack.outputNode=this.call(t),t.removeStack()}generate(t,e){return this.getOutputNode(t).build(t,e)}}class _E extends $T{constructor(t,e){super(e),this.jsFunc=t,this.layout=null,this.global=!0,this.once=!1}setLayout(t){return this.layout=t,this}call(t=null){return UE(t),BE(new vE(this,t))}setup(){return this.call()}}const xE=[!1,!0],bE=[0,1,2,3],SE=[-1,-2],ME=[.5,1.5,1/3,1e-6,1e6,Math.PI,2*Math.PI,1/Math.PI,2/Math.PI,1/(2*Math.PI),Math.PI/2],wE=new Map;for(const t of xE)wE.set(t,new aE(t));const TE=new Map;for(const t of bE)TE.set(t,new aE(t,"uint"));const EE=new Map([...TE].map((t=>new aE(t.value,"int"))));for(const t of SE)EE.set(t,new aE(t,"int"));const CE=new Map([...EE].map((t=>new aE(t.value))));for(const t of ME)CE.set(t,new aE(t));for(const t of ME)CE.set(-t,new aE(-t));const RE={bool:wE,uint:TE,ints:EE,float:CE},NE=new Map([...wE,...CE]),PE=(t,e)=>NE.has(t)?NE.get(t):!0===t.isNode?t:new aE(t,e),DE=function(t,e=null){return(...n)=>{if((0===n.length||!["bool","float","int","uint"].includes(t)&&n.every((t=>"object"!=typeof t)))&&(n=[zT(t,...n)]),1===n.length&&null!==e&&e.has(n[0]))return BE(e.get(n[0]));if(1===n.length){const e=PE(n[0],t);return(t=>{try{return t.getNodeType()}catch(t){return}})(e)===t?BE(e):BE(new KT(e,t))}const i=n.map((t=>PE(t)));return BE(new tE(i,t))}},IE=t=>"object"==typeof t&&null!==t?t.value:t;function LE(t,e){return new Proxy(new _E(t,e),AE)}const BE=(t,e=null)=>function(t,e=null){const n=kT(t);if("node"===n){let e=dE.get(t);return void 0===e&&(e=new Proxy(t,AE),dE.set(t,e),dE.set(e,e)),e}return null===e&&("float"===n||"boolean"===n)||n&&"shader"!==n&&"string"!==n?BE(PE(t,e)):"shader"===n?zE(t):t}(t,e),UE=(t,e=null)=>new fE(t,e),OE=(t,e=null)=>new mE(t,e),FE=(...t)=>new gE(...t),kE=(...t)=>new yE(...t),zE=(t,e)=>{const n=new LE(t,e),i=(...t)=>{let e;return UE(t),e=t[0]&&t[0].isNode?[...t]:t[0],n.call(e)};return i.shaderNode=n,i.setLayout=t=>(n.setLayout(t),i),i.once=()=>(n.once=!0,i),i};uE("toGlobal",(t=>(t.global=!0,t)));const qE=t=>{oE=t},GE=()=>oE,VE=(...t)=>oE.If(...t);uE("append",(function(t){return oE&&oE.add(t),t}));const HE=new DE("color"),jE=new DE("float",RE.float),WE=new DE("int",RE.ints),XE=new DE("uint",RE.uint),YE=new DE("bool",RE.bool),QE=new DE("vec2"),$E=new DE("ivec2"),ZE=new DE("uvec2"),KE=new DE("bvec2"),JE=new DE("vec3"),tC=new DE("ivec3"),eC=new DE("uvec3"),nC=new DE("bvec3"),iC=new DE("vec4"),rC=new DE("ivec4"),sC=new DE("uvec4"),aC=new DE("bvec4"),oC=new DE("mat2"),lC=new DE("mat3"),uC=new DE("mat4");uE("toColor",HE),uE("toFloat",jE),uE("toInt",WE),uE("toUint",XE),uE("toBool",YE),uE("toVec2",QE),uE("toIVec2",$E),uE("toUVec2",ZE),uE("toBVec2",KE),uE("toVec3",JE),uE("toIVec3",tC),uE("toUVec3",eC),uE("toBVec3",nC),uE("toVec4",iC),uE("toIVec4",rC),uE("toUVec4",sC),uE("toBVec4",aC),uE("toMat2",oC),uE("toMat3",lC),uE("toMat4",uC);uE("element",FE(ZT)),uE("convert",((t,e)=>BE(new KT(BE(t),e))));class hC extends $T{static get type(){return"UniformGroupNode"}constructor(t,e=!1,n=1){super("string"),this.name=t,this.version=0,this.shared=e,this.order=n,this.isUniformGroup=!0}set needsUpdate(t){!0===t&&this.version++}serialize(t){super.serialize(t),t.name=this.name,t.version=this.version,t.shared=this.shared}deserialize(t){super.deserialize(t),this.name=t.name,this.version=t.version,this.shared=t.shared}}const cC=t=>new hC(t),AC=(t,e=0)=>new hC(t,!0,e),dC=AC("frame"),pC=AC("render"),fC=cC("object");class mC extends sE{static get type(){return"UniformNode"}constructor(t,e=null){super(t,e),this.isUniformNode=!0,this.name="",this.groupNode=fC}label(t){return this.name=t,this}setGroup(t){return this.groupNode=t,this}getGroup(){return this.groupNode}getUniformHash(t){return this.getHash(t)}onUpdate(t,e){const n=this.getSelf();return t=t.bind(n),super.onUpdate((e=>{const i=t(e,n);void 0!==i&&(this.value=i)}),e)}generate(t,e){const n=this.getNodeType(t),i=this.getUniformHash(t);let r=t.getNodeFromHash(i);void 0===r&&(t.setHashNode(this,i),r=this);const s=r.getInputType(t),a=t.getUniformFromNode(r,s,t.shaderStage,this.name||t.context.label),o=t.getPropertyName(a);return void 0!==t.context.label&&delete t.context.label,t.format(o,n,e)}}const gC=(t,e)=>{const n=(t=>null!=t?t.nodeType||t.convertTo||("string"==typeof t?t:null):null)(e||t),i=t&&!0===t.isNode?t.node&&t.node.value||t.value:t;return BE(new mC(i,n))};class yC extends $T{static get type(){return"PropertyNode"}constructor(t,e=null,n=!1){super(t),this.name=e,this.varying=n,this.isPropertyNode=!0}getHash(t){return this.name||super.getHash(t)}isGlobal(){return!0}generate(t){let e;return!0===this.varying?(e=t.getVaryingFromNode(this,this.name),e.needsInterpolation=!0):e=t.getVarFromNode(this,this.name),t.getPropertyName(e)}}const vC=(t,e)=>BE(new yC(t,e)),_C=(t,e)=>BE(new yC(t,e,!0)),xC=kE(yC,"vec4","DiffuseColor"),bC=kE(yC,"vec3","EmissiveColor"),SC=kE(yC,"float","Roughness"),MC=kE(yC,"float","Metalness"),wC=kE(yC,"float","Clearcoat"),TC=kE(yC,"float","ClearcoatRoughness"),EC=kE(yC,"vec3","Sheen"),CC=kE(yC,"float","SheenRoughness"),RC=kE(yC,"float","Iridescence"),NC=kE(yC,"float","IridescenceIOR"),PC=kE(yC,"float","IridescenceThickness"),DC=kE(yC,"float","AlphaT"),IC=kE(yC,"float","Anisotropy"),LC=kE(yC,"vec3","AnisotropyT"),BC=kE(yC,"vec3","AnisotropyB"),UC=kE(yC,"color","SpecularColor"),OC=kE(yC,"float","SpecularF90"),FC=kE(yC,"float","Shininess"),kC=kE(yC,"vec4","Output"),zC=kE(yC,"float","dashSize"),qC=kE(yC,"float","gapSize"),GC=kE(yC,"float","IOR"),VC=kE(yC,"float","Transmission"),HC=kE(yC,"float","Thickness"),jC=kE(yC,"float","AttenuationDistance"),WC=kE(yC,"color","AttenuationColor"),XC=kE(yC,"float","Dispersion");class YC extends JT{static get type(){return"AssignNode"}constructor(t,e){super(),this.targetNode=t,this.sourceNode=e}hasDependencies(){return!1}getNodeType(t,e){return"void"!==e?this.targetNode.getNodeType(t):"void"}needsSplitAssign(t){const{targetNode:e}=this;if(!1===t.isAvailable("swizzleAssign")&&e.isSplitNode&&e.components.length>1){const n=t.getTypeLength(e.node.getNodeType(t));return YT.join("").slice(0,n)!==e.components}return!1}generate(t,e){const{targetNode:n,sourceNode:i}=this,r=this.needsSplitAssign(t),s=n.getNodeType(t),a=n.context({assign:!0}).build(t),o=i.build(t,s),l=i.getNodeType(t),u=t.getDataFromNode(this);let h;if(!0===u.initialized)"void"!==e&&(h=a);else if(r){const i=t.getVarFromNode(this,null,s),r=t.getPropertyName(i);t.addLineFlowCode(`${r} = ${o}`,this);const l=n.node.context({assign:!0}).build(t);for(let e=0;e<n.components.length;e++){const i=n.components[e];t.addLineFlowCode(`${l}.${i} = ${r}[ ${e} ]`,this)}"void"!==e&&(h=a)}else h=`${a} = ${o}`,"void"!==e&&"void"!==l||(t.addLineFlowCode(h,this),"void"!==e&&(h=a));return u.initialized=!0,t.format(h,s,e)}}uE("assign",FE(YC));class QC extends JT{static get type(){return"FunctionCallNode"}constructor(t=null,e={}){super(),this.functionNode=t,this.parameters=e}setParameters(t){return this.parameters=t,this}getParameters(){return this.parameters}getNodeType(t){return this.functionNode.getNodeType(t)}generate(t){const e=[],n=this.functionNode,i=n.getInputs(t),r=this.parameters;if(Array.isArray(r))for(let n=0;n<r.length;n++){const s=i[n],a=r[n];e.push(a.build(t,s.type))}else for(const n of i){const i=r[n.name];if(void 0===i)throw new Error(`FunctionCallNode: Input '${n.name}' not found in FunctionNode.`);e.push(i.build(t,n.type))}return`${n.build(t,"property")}( ${e.join(", ")} )`}}uE("call",((t,...e)=>(e=e.length>1||e[0]&&!0===e[0].isNode?OE(e):UE(e[0]),BE(new QC(BE(t),e)))));class $C extends JT{static get type(){return"OperatorNode"}constructor(t,e,n,...i){if(super(),i.length>0){let r=new $C(t,e,n);for(let e=0;e<i.length-1;e++)r=new $C(t,r,i[e]);e=r,n=i[i.length-1]}this.op=t,this.aNode=e,this.bNode=n}getNodeType(t,e){const n=this.op,i=this.aNode,r=this.bNode,s=i.getNodeType(t),a=void 0!==r?r.getNodeType(t):null;if("void"===s||"void"===a)return"void";if("%"===n)return s;if("~"===n||"&"===n||"|"===n||"^"===n||">>"===n||"<<"===n)return t.getIntegerType(s);if("!"===n||"=="===n||"&&"===n||"||"===n||"^^"===n)return"bool";if("<"===n||">"===n||"<="===n||">="===n){const n=e?t.getTypeLength(e):Math.max(t.getTypeLength(s),t.getTypeLength(a));return n>1?`bvec${n}`:"bool"}return"float"===s&&t.isMatrix(a)?a:t.isMatrix(s)&&t.isVector(a)?t.getVectorFromMatrix(s):t.isVector(s)&&t.isMatrix(a)?t.getVectorFromMatrix(a):t.getTypeLength(a)>t.getTypeLength(s)?a:s}generate(t,e){const n=this.op,i=this.aNode,r=this.bNode,s=this.getNodeType(t,e);let a=null,o=null;"void"!==s?(a=i.getNodeType(t),o=void 0!==r?r.getNodeType(t):null,"<"===n||">"===n||"<="===n||">="===n||"=="===n?t.isVector(a)?o=a:a!==o&&(a=o="float"):">>"===n||"<<"===n?(a=s,o=t.changeComponentType(o,"uint")):t.isMatrix(a)&&t.isVector(o)?o=t.getVectorFromMatrix(a):a=t.isVector(a)&&t.isMatrix(o)?t.getVectorFromMatrix(o):o=s):a=o=s;const l=i.build(t,a),u=void 0!==r?r.build(t,o):null,h=t.getTypeLength(e),c=t.getFunctionOperator(n);return"void"!==e?"<"===n&&h>1?t.useComparisonMethod?t.format(`${t.getMethod("lessThan",e)}( ${l}, ${u} )`,s,e):t.format(`( ${l} < ${u} )`,s,e):"<="===n&&h>1?t.useComparisonMethod?t.format(`${t.getMethod("lessThanEqual",e)}( ${l}, ${u} )`,s,e):t.format(`( ${l} <= ${u} )`,s,e):">"===n&&h>1?t.useComparisonMethod?t.format(`${t.getMethod("greaterThan",e)}( ${l}, ${u} )`,s,e):t.format(`( ${l} > ${u} )`,s,e):">="===n&&h>1?t.useComparisonMethod?t.format(`${t.getMethod("greaterThanEqual",e)}( ${l}, ${u} )`,s,e):t.format(`( ${l} >= ${u} )`,s,e):"!"===n||"~"===n?t.format(`(${n}${l})`,a,e):c?t.format(`${c}( ${l}, ${u} )`,s,e):t.format(`( ${l} ${n} ${u} )`,s,e):"void"!==a?c?t.format(`${c}( ${l}, ${u} )`,s,e):t.format(`${l} ${n} ${u}`,s,e):void 0}serialize(t){super.serialize(t),t.op=this.op}deserialize(t){super.deserialize(t),this.op=t.op}}const ZC=FE($C,"+"),KC=FE($C,"-"),JC=FE($C,"*"),tR=FE($C,"/"),eR=FE($C,"%"),nR=FE($C,"=="),iR=FE($C,"!="),rR=FE($C,"<"),sR=FE($C,">"),aR=FE($C,"<="),oR=FE($C,">="),lR=FE($C,"&&"),uR=FE($C,"||"),hR=FE($C,"!"),cR=FE($C,"^^"),AR=FE($C,"&"),dR=FE($C,"~"),pR=FE($C,"|"),fR=FE($C,"^"),mR=FE($C,"<<"),gR=FE($C,">>");uE("add",ZC),uE("sub",KC),uE("mul",JC),uE("div",tR),uE("modInt",eR),uE("equal",nR),uE("notEqual",iR),uE("lessThan",rR),uE("greaterThan",sR),uE("lessThanEqual",aR),uE("greaterThanEqual",oR),uE("and",lR),uE("or",uR),uE("not",hR),uE("xor",cR),uE("bitAnd",AR),uE("bitNot",dR),uE("bitOr",pR),uE("bitXor",fR),uE("shiftLeft",mR),uE("shiftRight",gR);uE("remainder",((...t)=>(console.warn("TSL.OperatorNode: .remainder() has been renamed to .modInt()."),eR(...t))));class yR extends JT{static get type(){return"MathNode"}constructor(t,e,n=null,i=null){super(),this.method=t,this.aNode=e,this.bNode=n,this.cNode=i}getInputType(t){const e=this.aNode.getNodeType(t),n=this.bNode?this.bNode.getNodeType(t):null,i=this.cNode?this.cNode.getNodeType(t):null,r=t.isMatrix(e)?0:t.getTypeLength(e),s=t.isMatrix(n)?0:t.getTypeLength(n),a=t.isMatrix(i)?0:t.getTypeLength(i);return r>s&&r>a?e:s>a?n:a>r?i:e}getNodeType(t){const e=this.method;return e===yR.LENGTH||e===yR.DISTANCE||e===yR.DOT?"float":e===yR.CROSS?"vec3":e===yR.ALL?"bool":e===yR.EQUALS?t.changeComponentType(this.aNode.getNodeType(t),"bool"):e===yR.MOD?this.aNode.getNodeType(t):this.getInputType(t)}generate(t,e){const n=this.method,i=this.getNodeType(t),r=this.getInputType(t),s=this.aNode,a=this.bNode,o=this.cNode,l=!0===t.renderer.isWebGLRenderer;if(n===yR.TRANSFORM_DIRECTION){let n=s,i=a;t.isMatrix(n.getNodeType(t))?i=iC(JE(i),0):n=iC(JE(n),0);const r=JC(n,i).xyz;return LR(r).build(t,e)}if(n===yR.NEGATE)return t.format("( - "+s.build(t,r)+" )",i,e);if(n===yR.ONE_MINUS)return KC(1,s).build(t,e);if(n===yR.RECIPROCAL)return tR(1,s).build(t,e);if(n===yR.DIFFERENCE)return GR(KC(s,a)).build(t,e);{const u=[];return n===yR.CROSS||n===yR.MOD?u.push(s.build(t,i),a.build(t,i)):l&&n===yR.STEP?u.push(s.build(t,1===t.getTypeLength(s.getNodeType(t))?"float":r),a.build(t,r)):l&&(n===yR.MIN||n===yR.MAX)||n===yR.MOD?u.push(s.build(t,r),a.build(t,1===t.getTypeLength(a.getNodeType(t))?"float":r)):n===yR.REFRACT?u.push(s.build(t,r),a.build(t,r),o.build(t,"float")):n===yR.MIX?u.push(s.build(t,r),a.build(t,r),o.build(t,1===t.getTypeLength(o.getNodeType(t))?"float":r)):(u.push(s.build(t,r)),null!==a&&u.push(a.build(t,r)),null!==o&&u.push(o.build(t,r))),t.format(`${t.getMethod(n,i)}( ${u.join(", ")} )`,i,e)}}serialize(t){super.serialize(t),t.method=this.method}deserialize(t){super.deserialize(t),this.method=t.method}}yR.ALL="all",yR.ANY="any",yR.EQUALS="equals",yR.RADIANS="radians",yR.DEGREES="degrees",yR.EXP="exp",yR.EXP2="exp2",yR.LOG="log",yR.LOG2="log2",yR.SQRT="sqrt",yR.INVERSE_SQRT="inversesqrt",yR.FLOOR="floor",yR.CEIL="ceil",yR.NORMALIZE="normalize",yR.FRACT="fract",yR.SIN="sin",yR.COS="cos",yR.TAN="tan",yR.ASIN="asin",yR.ACOS="acos",yR.ATAN="atan",yR.ABS="abs",yR.SIGN="sign",yR.LENGTH="length",yR.NEGATE="negate",yR.ONE_MINUS="oneMinus",yR.DFDX="dFdx",yR.DFDY="dFdy",yR.ROUND="round",yR.RECIPROCAL="reciprocal",yR.TRUNC="trunc",yR.FWIDTH="fwidth",yR.BITCAST="bitcast",yR.TRANSPOSE="transpose",yR.ATAN2="atan2",yR.MIN="min",yR.MAX="max",yR.MOD="mod",yR.STEP="step",yR.REFLECT="reflect",yR.DISTANCE="distance",yR.DIFFERENCE="difference",yR.DOT="dot",yR.CROSS="cross",yR.POW="pow",yR.TRANSFORM_DIRECTION="transformDirection",yR.MIX="mix",yR.CLAMP="clamp",yR.REFRACT="refract",yR.SMOOTHSTEP="smoothstep",yR.FACEFORWARD="faceforward";const vR=jE(1e-6),_R=jE(Math.PI),xR=FE(yR,yR.ALL),bR=FE(yR,yR.ANY),SR=FE(yR,yR.EQUALS),MR=FE(yR,yR.RADIANS),wR=FE(yR,yR.DEGREES),TR=FE(yR,yR.EXP),ER=FE(yR,yR.EXP2),CR=FE(yR,yR.LOG),RR=FE(yR,yR.LOG2),NR=FE(yR,yR.SQRT),PR=FE(yR,yR.INVERSE_SQRT),DR=FE(yR,yR.FLOOR),IR=FE(yR,yR.CEIL),LR=FE(yR,yR.NORMALIZE),BR=FE(yR,yR.FRACT),UR=FE(yR,yR.SIN),OR=FE(yR,yR.COS),FR=FE(yR,yR.TAN),kR=FE(yR,yR.ASIN),zR=FE(yR,yR.ACOS),qR=FE(yR,yR.ATAN),GR=FE(yR,yR.ABS),VR=FE(yR,yR.SIGN),HR=FE(yR,yR.LENGTH),jR=FE(yR,yR.NEGATE),WR=FE(yR,yR.ONE_MINUS),XR=FE(yR,yR.DFDX),YR=FE(yR,yR.DFDY),QR=FE(yR,yR.ROUND),$R=FE(yR,yR.RECIPROCAL),ZR=FE(yR,yR.TRUNC),KR=FE(yR,yR.FWIDTH);yR.BITCAST;const JR=FE(yR,yR.TRANSPOSE),tN=FE(yR,yR.ATAN2),eN=FE(yR,yR.MIN),nN=FE(yR,yR.MAX),iN=FE(yR,yR.MOD),rN=FE(yR,yR.STEP),sN=FE(yR,yR.REFLECT),aN=FE(yR,yR.DISTANCE),oN=FE(yR,yR.DIFFERENCE),lN=FE(yR,yR.DOT),uN=FE(yR,yR.CROSS),hN=FE(yR,yR.POW),cN=FE(yR,yR.POW,2),AN=FE(yR,yR.POW,3),dN=FE(yR,yR.POW,4),pN=FE(yR,yR.TRANSFORM_DIRECTION),fN=FE(yR,yR.MIX),mN=(t,e=0,n=1)=>BE(new yR(yR.CLAMP,BE(t),BE(e),BE(n))),gN=FE(yR,yR.REFRACT),yN=FE(yR,yR.SMOOTHSTEP),vN=FE(yR,yR.FACEFORWARD),_N=zE((([t])=>{const e=lN(t.xy,QE(12.9898,78.233)),n=iN(e,_R);return BR(UR(n).mul(43758.5453))}));uE("all",xR),uE("any",bR),uE("equals",SR),uE("radians",MR),uE("degrees",wR),uE("exp",TR),uE("exp2",ER),uE("log",CR),uE("log2",RR),uE("sqrt",NR),uE("inverseSqrt",PR),uE("floor",DR),uE("ceil",IR),uE("normalize",LR),uE("fract",BR),uE("sin",UR),uE("cos",OR),uE("tan",FR),uE("asin",kR),uE("acos",zR),uE("atan",qR),uE("abs",GR),uE("sign",VR),uE("length",HR),uE("lengthSq",(t=>lN(t,t))),uE("negate",jR),uE("oneMinus",WR),uE("dFdx",XR),uE("dFdy",YR),uE("round",QR),uE("reciprocal",$R),uE("trunc",ZR),uE("fwidth",KR),uE("atan2",tN),uE("min",eN),uE("max",nN),uE("mod",iN),uE("step",rN),uE("reflect",sN),uE("distance",aN),uE("dot",lN),uE("cross",uN),uE("pow",hN),uE("pow2",cN),uE("pow3",AN),uE("pow4",dN),uE("transformDirection",pN),uE("mix",((t,e,n)=>fN(e,n,t))),uE("clamp",mN),uE("refract",gN),uE("smoothstep",((t,e,n)=>yN(e,n,t))),uE("faceForward",vN),uE("difference",oN),uE("saturate",(t=>mN(t))),uE("cbrt",(t=>JC(VR(t),hN(GR(t),1/3)))),uE("transpose",JR),uE("rand",_N);class xN extends $T{static get type(){return"ConditionalNode"}constructor(t,e,n=null){super(),this.condNode=t,this.ifNode=e,this.elseNode=n}getNodeType(t){const e=this.ifNode.getNodeType(t);if(null!==this.elseNode){const n=this.elseNode.getNodeType(t);if(t.getTypeLength(n)>t.getTypeLength(e))return n}return e}setup(t){const e=this.condNode.cache(),n=this.ifNode.cache(),i=this.elseNode?this.elseNode.cache():null,r=t.context.nodeBlock;t.getDataFromNode(n).parentNodeBlock=r,null!==i&&(t.getDataFromNode(i).parentNodeBlock=r);const s=t.getNodeProperties(this);s.condNode=e,s.ifNode=n.context({nodeBlock:n}),s.elseNode=i?i.context({nodeBlock:i}):null}generate(t,e){const n=this.getNodeType(t),i=t.getDataFromNode(this);if(void 0!==i.nodeProperty)return i.nodeProperty;const{condNode:r,ifNode:s,elseNode:a}=t.getNodeProperties(this),o="void"!==e,l=o?vC(n).build(t):"";i.nodeProperty=l;const u=r.build(t,"bool");t.addFlowCode(`\n${t.tab}if ( ${u} ) {\n\n`).addFlowTab();let h=s.build(t,n);if(h&&(h=o?l+" = "+h+";":"return "+h+";"),t.removeFlowTab().addFlowCode(t.tab+"\t"+h+"\n\n"+t.tab+"}"),null!==a){t.addFlowCode(" else {\n\n").addFlowTab();let e=a.build(t,n);e&&(e=o?l+" = "+e+";":"return "+e+";"),t.removeFlowTab().addFlowCode(t.tab+"\t"+e+"\n\n"+t.tab+"}\n\n")}else t.addFlowCode("\n\n");return t.format(l,n,e)}}const bN=FE(xN);uE("select",bN);uE("cond",((...t)=>(console.warn("TSL.ConditionalNode: cond() has been renamed to select()."),bN(...t))));class SN extends $T{static get type(){return"ContextNode"}constructor(t,e={}){super(),this.isContextNode=!0,this.node=t,this.value=e}getScope(){return this.node.getScope()}getNodeType(t){return this.node.getNodeType(t)}analyze(t){this.node.build(t)}setup(t){const e=t.getContext();t.setContext({...t.context,...this.value});const n=this.node.build(t);return t.setContext(e),n}generate(t,e){const n=t.getContext();t.setContext({...t.context,...this.value});const i=this.node.build(t,e);return t.setContext(n),i}}const MN=FE(SN);uE("context",MN),uE("label",((t,e)=>MN(t,{label:e})));class wN extends $T{static get type(){return"VarNode"}constructor(t,e=null){super(),this.node=t,this.name=e,this.global=!0,this.isVarNode=!0}getHash(t){return this.name||super.getHash(t)}getNodeType(t){return this.node.getNodeType(t)}generate(t){const{node:e,name:n}=this,i=t.getVarFromNode(this,n,t.getVectorType(this.getNodeType(t))),r=t.getPropertyName(i),s=e.build(t,i.type);return t.addLineFlowCode(`${r} = ${s}`,this),r}}const TN=FE(wN);uE("temp",TN),uE("toVar",((...t)=>TN(...t).append()));class EN extends $T{static get type(){return"VaryingNode"}constructor(t,e=null){super(),this.node=t,this.name=e,this.isVaryingNode=!0}isGlobal(){return!0}getHash(t){return this.name||super.getHash(t)}getNodeType(t){return this.node.getNodeType(t)}setupVarying(t){const e=t.getNodeProperties(this);let n=e.varying;if(void 0===n){const i=this.name,r=this.getNodeType(t);e.varying=n=t.getVaryingFromNode(this,i,r),e.node=this.node}return n.needsInterpolation||(n.needsInterpolation="fragment"===t.shaderStage),n}setup(t){this.setupVarying(t)}analyze(t){return this.setupVarying(t),this.node.analyze(t)}generate(t){const e=t.getNodeProperties(this),n=this.setupVarying(t);if(void 0===e.propertyName){const i=this.getNodeType(t),r=t.getPropertyName(n,qT);t.flowNodeFromShaderStage(qT,this.node,i,r),e.propertyName=r}return t.getPropertyName(n)}}const CN=FE(EN);uE("varying",CN);const RN="WorkingColorSpace",NN="OutputColorSpace";function PN(t){let e=null;return t===vb?e="Linear":t===yb&&(e="sRGB"),e}function DN(t,e){return PN(t)+"To"+PN(e)}class IN extends JT{static get type(){return"ColorSpaceNode"}constructor(t,e,n){super("vec4"),this.colorNode=t,this.source=e,this.target=n}getColorSpace(t,e){return e===RN?sS.workingColorSpace:e===NN?t.context.outputColorSpace||t.renderer.outputColorSpace:e}setup(t){const{renderer:e}=t,{colorNode:n}=this,i=this.getColorSpace(t,this.source),r=this.getColorSpace(t,this.target);if(i===r)return n;const s=DN(i,r);let a=null;const o=e.nodes.library.getColorSpaceFunction(s);return null!==o?a=iC(o(n.rgb),n.a):(console.error("ColorSpaceNode: Unsupported Color Space configuration.",s),a=n),a}}const LN=(t,e)=>BE(new IN(BE(t),e,RN));uE("toOutputColorSpace",(t=>BE(new IN(BE(t),RN,NN)))),uE("toWorkingColorSpace",(t=>BE(new IN(BE(t),NN,RN)))),uE("workingToColorSpace",((t,e)=>BE(new IN(BE(t),RN,e)))),uE("colorSpaceToWorking",LN);let BN=class extends ZT{static get type(){return"ReferenceElementNode"}constructor(t,e){super(t,e),this.referenceNode=t,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(t){const e=super.generate(t),n=this.referenceNode.getNodeType(),i=this.getNodeType();return t.format(e,n,i)}};class UN extends $T{static get type(){return"ReferenceBaseNode"}constructor(t,e,n=null,i=null){super(),this.property=t,this.uniformType=e,this.object=n,this.count=i,this.properties=t.split("."),this.reference=n,this.node=null,this.group=null,this.updateType=jT}setGroup(t){return this.group=t,this}element(t){return BE(new BN(this,BE(t)))}setNodeType(t){const e=gC(null,t).getSelf();null!==this.group&&e.setGroup(this.group),this.node=e}getNodeType(t){return null===this.node&&(this.updateReference(t),this.updateValue()),this.node.getNodeType(t)}getValueFromReference(t=this.reference){const{properties:e}=this;let n=t[e[0]];for(let t=1;t<e.length;t++)n=n[e[t]];return n}updateReference(t){return this.reference=null!==this.object?this.object:t.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){null===this.node&&this.setNodeType(this.uniformType);const t=this.getValueFromReference();Array.isArray(t)?this.node.array=t:this.node.value=t}}class ON extends UN{static get type(){return"RendererReferenceNode"}constructor(t,e,n=null){super(t,e,n),this.renderer=n,this.setGroup(pC)}updateReference(t){return this.reference=null!==this.renderer?this.renderer:t.renderer,this.reference}}const FN=(t,e,n)=>BE(new ON(t,e,n));class kN extends JT{static get type(){return"ToneMappingNode"}constructor(t,e=zN,n=null){super("vec3"),this.toneMapping=t,this.exposureNode=e,this.colorNode=n}getCacheKey(){return UT(super.getCacheKey(),this.toneMapping)}setup(t){const e=this.colorNode||t.context.color,n=this.toneMapping;if(0===n)return e;let i=null;const r=t.renderer.nodes.library.getToneMappingFunction(n);return null!==r?i=iC(r(e.rgb,this.exposureNode),e.a):(console.error("ToneMappingNode: Unsupported Tone Mapping configuration.",n),i=e),i}}const zN=FN("toneMappingExposure","float");uE("toneMapping",((t,e,n)=>((t,e,n)=>BE(new kN(t,BE(e),BE(n))))(e,n,t)));class qN extends sE{static get type(){return"BufferAttributeNode"}constructor(t,e=null,n=0,i=0){super(t,e),this.isBufferNode=!0,this.bufferType=e,this.bufferStride=n,this.bufferOffset=i,this.usage=Lb,this.instanced=!1,this.attribute=null,this.global=!0,t&&!0===t.isBufferAttribute&&(this.attribute=t,this.usage=t.usage,this.instanced=t.isInstancedBufferAttribute)}getHash(t){if(0===this.bufferStride&&0===this.bufferOffset){let e=t.globalCache.getData(this.value);return void 0===e&&(e={node:this},t.globalCache.setData(this.value,e)),e.node.uuid}return this.uuid}getNodeType(t){return null===this.bufferType&&(this.bufferType=t.getTypeFromAttribute(this.attribute)),this.bufferType}setup(t){if(null!==this.attribute)return;const e=this.getNodeType(t),n=this.value,i=t.getTypeLength(e),r=this.bufferStride||i,s=this.bufferOffset,a=!0===n.isInterleavedBuffer?n:new Fw(n,r),o=new zw(a,i,s);a.setUsage(this.usage),this.attribute=o,this.attribute.isInstancedBufferAttribute=this.instanced}generate(t){const e=this.getNodeType(t),n=t.getBufferAttributeFromNode(this,e),i=t.getPropertyName(n);let r=null;if("vertex"===t.shaderStage||"compute"===t.shaderStage)this.name=i,r=i;else{r=CN(this).build(t,e)}return r}getInputType(){return"bufferAttribute"}setUsage(t){return this.usage=t,this.attribute&&!0===this.attribute.isBufferAttribute&&(this.attribute.usage=t),this}setInstanced(t){return this.instanced=t,this}}const GN=(t,e,n,i)=>BE(new qN(t,e,n,i)),VN=(t,e,n,i)=>GN(t,e,n,i).setInstanced(!0),HN=(t,e,n,i)=>((t,e,n,i)=>GN(t,e,n,i).setUsage(Bb))(t,e,n,i).setInstanced(!0);uE("toAttribute",(t=>GN(t.value)));class jN extends $T{static get type(){return"ComputeNode"}constructor(t,e,n=[64]){super("void"),this.isComputeNode=!0,this.computeNode=t,this.count=e,this.workgroupSize=n,this.dispatchCount=0,this.version=1,this.updateBeforeType=jT,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}updateDispatchCount(){const{count:t,workgroupSize:e}=this;let n=e[0];for(let t=1;t<e.length;t++)n*=e[t];this.dispatchCount=Math.ceil(t/n)}onInit(){}updateBefore({renderer:t}){t.compute(this)}generate(t){const{shaderStage:e}=t;if("compute"===e){const e=this.computeNode.build(t,"void");""!==e&&t.addLineFlowCode(e,this)}}}uE("compute",((t,e,n)=>BE(new jN(BE(t),e,n))));class WN extends $T{static get type(){return"CacheNode"}constructor(t,e=!0){super(),this.node=t,this.parent=e,this.isCacheNode=!0}getNodeType(t){return this.node.getNodeType(t)}build(t,...e){const n=t.getCache(),i=t.getCacheFromNode(this,this.parent);t.setCache(i);const r=this.node.build(t,...e);return t.setCache(n),r}}const XN=(t,...e)=>BE(new WN(BE(t),...e));uE("cache",XN);class YN extends $T{static get type(){return"BypassNode"}constructor(t,e){super(),this.isBypassNode=!0,this.outputNode=t,this.callNode=e}getNodeType(t){return this.outputNode.getNodeType(t)}generate(t){const e=this.callNode.build(t,"void");return""!==e&&t.addLineFlowCode(e,this),this.outputNode.build(t)}}uE("bypass",FE(YN));class QN extends $T{static get type(){return"RemapNode"}constructor(t,e,n,i=jE(0),r=jE(1)){super(),this.node=t,this.inLowNode=e,this.inHighNode=n,this.outLowNode=i,this.outHighNode=r,this.doClamp=!0}setup(){const{node:t,inLowNode:e,inHighNode:n,outLowNode:i,outHighNode:r,doClamp:s}=this;let a=t.sub(e).div(n.sub(e));return!0===s&&(a=a.clamp()),a.mul(r.sub(i)).add(i)}}const $N=FE(QN,null,null,{doClamp:!1}),ZN=FE(QN);uE("remap",$N),uE("remapClamp",ZN);class KN extends $T{static get type(){return"ExpressionNode"}constructor(t="",e="void"){super(e),this.snippet=t}generate(t,e){const n=this.getNodeType(t),i=this.snippet;if("void"!==n)return t.format(`( ${i} )`,n,e);t.addLineFlowCode(i,this)}}const JN=FE(KN);uE("discard",(t=>(t?bN(t,JN("discard")):JN("discard")).append()));class tP extends JT{static get type(){return"RenderOutputNode"}constructor(t,e,n){super("vec4"),this.colorNode=t,this.toneMapping=e,this.outputColorSpace=n,this.isRenderOutput=!0}setup({context:t}){let e=this.colorNode||t.color;const n=(null!==this.toneMapping?this.toneMapping:t.toneMapping)||0,i=(null!==this.outputColorSpace?this.outputColorSpace:t.outputColorSpace)||gb;return 0!==n&&(e=e.toneMapping(n)),i!==gb&&i!==sS.workingColorSpace&&(e=e.workingToColorSpace(i)),e}}uE("renderOutput",((t,e=null,n=null)=>BE(new tP(BE(t),e,n))));class eP extends $T{static get type(){return"AttributeNode"}constructor(t,e=null){super(e),this.global=!0,this._attributeName=t}getHash(t){return this.getAttributeName(t)}getNodeType(t){let e=this.nodeType;if(null===e){const n=this.getAttributeName(t);if(t.hasGeometryAttribute(n)){const i=t.geometry.getAttribute(n);e=t.getTypeFromAttribute(i)}else e="float"}return e}setAttributeName(t){return this._attributeName=t,this}getAttributeName(){return this._attributeName}generate(t){const e=this.getAttributeName(t),n=this.getNodeType(t);if(!0===t.hasGeometryAttribute(e)){const i=t.geometry.getAttribute(e),r=t.getTypeFromAttribute(i),s=t.getAttribute(e,r);if("vertex"===t.shaderStage)return t.format(s.name,r,n);return CN(this).build(t,n)}return console.warn(`AttributeNode: Vertex attribute "${e}" not found on geometry.`),t.generateConst(n)}serialize(t){super.serialize(t),t.global=this.global,t._attributeName=this._attributeName}deserialize(t){super.deserialize(t),this.global=t.global,this._attributeName=t._attributeName}}const nP=(t,e)=>BE(new eP(t,e)),iP=t=>nP("uv"+(t>0?t:""),"vec2");class rP extends $T{static get type(){return"TextureSizeNode"}constructor(t,e=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=t,this.levelNode=e}generate(t,e){const n=this.textureNode.build(t,"property"),i=null===this.levelNode?"0":this.levelNode.build(t,"int");return t.format(`${t.getMethod("textureDimensions")}( ${n}, ${i} )`,this.getNodeType(t),e)}}const sP=FE(rP);class aP extends mC{static get type(){return"MaxMipLevelNode"}constructor(t){super(0),this._textureNode=t,this.updateType=VT}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const t=this.texture,e=t.images,n=e&&e.length>0?e[0]&&e[0].image||e[0]:t.image;if(n&&void 0!==n.width){const{width:t,height:e}=n;this.value=Math.log2(Math.max(t,e))}}}const oP=FE(aP);class lP extends mC{static get type(){return"TextureNode"}constructor(t,e=null,n=null,i=null){super(t),this.isTextureNode=!0,this.uvNode=e,this.levelNode=n,this.biasNode=i,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=GT,this.referenceNode=null,this._value=t,this._matrixUniform=null,this.setUpdateMatrix(null===e)}set value(t){this.referenceNode?this.referenceNode.value=t:this._value=t}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return!0===this.value.isDepthTexture?"float":this.value.type===Ox?"uvec4":this.value.type===Ux?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return iP(this.value.channel)}updateReference(){return this.value}getTransformedUV(t){return null===this._matrixUniform&&(this._matrixUniform=gC(this.value.matrix)),this._matrixUniform.mul(JE(t,1)).xy}setUpdateMatrix(t){return this.updateMatrix=t,this.updateType=t?VT:GT,this}setupUV(t,e){const n=this.value;return!t.isFlipY()||!0!==n.isRenderTargetTexture&&!0!==n.isFramebufferTexture&&!0!==n.isDepthTexture||(e=this.sampler?e.flipY():e.setY(WE(sP(this,this.levelNode).y).sub(e.y).sub(1))),e}setup(t){const e=t.getNodeProperties(this);e.referenceNode=this.referenceNode;let n=this.uvNode;null!==n&&!0!==t.context.forceUVContext||!t.context.getUV||(n=t.context.getUV(this)),n||(n=this.getDefaultUV()),!0===this.updateMatrix&&(n=this.getTransformedUV(n)),n=this.setupUV(t,n);let i=this.levelNode;null===i&&t.context.getTextureLevel&&(i=t.context.getTextureLevel(this)),e.uvNode=n,e.levelNode=i,e.biasNode=this.biasNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e.depthNode=this.depthNode}generateUV(t,e){return e.build(t,!0===this.sampler?"vec2":"ivec2")}generateSnippet(t,e,n,i,r,s,a,o){const l=this.value;let u;return u=i?t.generateTextureLevel(l,e,n,i,s):r?t.generateTextureBias(l,e,n,r,s):o?t.generateTextureGrad(l,e,n,o,s):a?t.generateTextureCompare(l,e,n,a,s):!1===this.sampler?t.generateTextureLoad(l,e,n,s):t.generateTexture(l,e,n,s),u}generate(t,e){const n=t.getNodeProperties(this),i=this.value;if(!i||!0!==i.isTexture)throw new Error("TextureNode: Need a three.js texture.");const r=super.generate(t,"property");if("sampler"===e)return r+"_sampler";if(t.isReference(e))return r;{const s=t.getDataFromNode(this);let a=s.propertyName;if(void 0===a){const{uvNode:e,levelNode:i,biasNode:o,compareNode:l,depthNode:u,gradNode:h}=n,c=this.generateUV(t,e),A=i?i.build(t,"float"):null,d=o?o.build(t,"float"):null,p=u?u.build(t,"int"):null,f=l?l.build(t,"float"):null,m=h?[h[0].build(t,"vec2"),h[1].build(t,"vec2")]:null,g=t.getVarFromNode(this);a=t.getPropertyName(g);const y=this.generateSnippet(t,r,c,A,d,p,f,m);t.addLineFlowCode(`${a} = ${y}`,this),s.snippet=y,s.propertyName=a}let o=a;const l=this.getNodeType(t);return t.needsToWorkingColorSpace(i)&&(o=LN(JN(o,l),i.colorSpace).setup(t).build(t,l)),t.format(o,l,e)}}setSampler(t){return this.sampler=t,this}getSampler(){return this.sampler}uv(t){const e=this.clone();return e.uvNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}blur(t){const e=this.clone();return e.biasNode=BE(t).mul(oP(e)),e.referenceNode=this.getSelf(),BE(e)}level(t){const e=this.clone();return e.levelNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}size(t){return sP(this,t)}bias(t){const e=this.clone();return e.biasNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}compare(t){const e=this.clone();return e.compareNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}grad(t,e){const n=this.clone();return n.gradNode=[BE(t),BE(e)],n.referenceNode=this.getSelf(),BE(n)}depth(t){const e=this.clone();return e.depthNode=BE(t),e.referenceNode=this.getSelf(),BE(e)}serialize(t){super.serialize(t),t.value=this.value.toJSON(t.meta).uuid,t.sampler=this.sampler,t.updateMatrix=this.updateMatrix,t.updateType=this.updateType}deserialize(t){super.deserialize(t),this.value=t.meta.textures[t.value],this.sampler=t.sampler,this.updateMatrix=t.updateMatrix,this.updateType=t.updateType}update(){const t=this.value,e=this._matrixUniform;null!==e&&(e.value=t.matrix),!0===t.matrixAutoUpdate&&t.updateMatrix()}clone(){const t=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return t.sampler=this.sampler,t}}const uP=FE(lP),hP=(...t)=>uP(...t).setSampler(!1),cP=gC("float").label("cameraNear").setGroup(pC).onRenderUpdate((({camera:t})=>t.near)),AP=gC("float").label("cameraFar").setGroup(pC).onRenderUpdate((({camera:t})=>t.far)),dP=gC("float").label("cameraLogDepth").setGroup(pC).onRenderUpdate((({camera:t})=>2/(Math.log(t.far+1)/Math.LN2))),pP=gC("mat4").label("cameraProjectionMatrix").setGroup(pC).onRenderUpdate((({camera:t})=>t.projectionMatrix)),fP=gC("mat4").label("cameraViewMatrix").setGroup(pC).onRenderUpdate((({camera:t})=>t.matrixWorldInverse)),mP=gC(new _S).label("cameraPosition").setGroup(pC).onRenderUpdate((({camera:t},e)=>e.value.setFromMatrixPosition(t.matrixWorld)));class gP extends $T{static get type(){return"Object3DNode"}constructor(t,e=null){super(),this.scope=t,this.object3d=e,this.updateType=jT,this._uniformNode=new mC(null)}getNodeType(){const t=this.scope;return t===gP.WORLD_MATRIX?"mat4":t===gP.POSITION||t===gP.VIEW_POSITION||t===gP.DIRECTION||t===gP.SCALE?"vec3":void 0}update(t){const e=this.object3d,n=this._uniformNode,i=this.scope;if(i===gP.WORLD_MATRIX)n.value=e.matrixWorld;else if(i===gP.POSITION)n.value=n.value||new _S,n.value.setFromMatrixPosition(e.matrixWorld);else if(i===gP.SCALE)n.value=n.value||new _S,n.value.setFromMatrixScale(e.matrixWorld);else if(i===gP.DIRECTION)n.value=n.value||new _S,e.getWorldDirection(n.value);else if(i===gP.VIEW_POSITION){const i=t.camera;n.value=n.value||new _S,n.value.setFromMatrixPosition(e.matrixWorld),n.value.applyMatrix4(i.matrixWorldInverse)}}generate(t){const e=this.scope;return e===gP.WORLD_MATRIX?this._uniformNode.nodeType="mat4":e!==gP.POSITION&&e!==gP.VIEW_POSITION&&e!==gP.DIRECTION&&e!==gP.SCALE||(this._uniformNode.nodeType="vec3"),this._uniformNode.build(t)}serialize(t){super.serialize(t),t.scope=this.scope}deserialize(t){super.deserialize(t),this.scope=t.scope}}gP.WORLD_MATRIX="worldMatrix",gP.POSITION="position",gP.SCALE="scale",gP.VIEW_POSITION="viewPosition",gP.DIRECTION="direction",gP.DIRECTION,gP.WORLD_MATRIX,gP.POSITION,gP.SCALE,gP.VIEW_POSITION;class yP extends gP{static get type(){return"ModelNode"}constructor(t){super(t)}update(t){this.object3d=t.object,super.update(t)}}const vP=kE(yP,yP.WORLD_MATRIX),_P=gC(new Zb).onObjectUpdate((({object:t},e)=>e.value.getNormalMatrix(t.matrixWorld))),xP=fP.mul(vP).toVar("modelViewMatrix"),bP=nP("position","vec3"),SP=bP.varying("positionLocal"),MP=bP.varying("positionPrevious"),wP=vP.mul(SP).xyz.varying("v_positionWorld"),TP=SP.transformDirection(vP).varying("v_positionWorldDirection").normalize().toVar("positionWorldDirection"),EP=xP.mul(SP).xyz.varying("v_positionView"),CP=EP.negate().varying("v_positionViewDirection").normalize().toVar("positionViewDirection");class RP extends $T{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(t){const{renderer:e,material:n}=t;return e.coordinateSystem===Ub&&1===n.side?"false":t.getFrontFacing()}}const NP=jE(kE(RP)).mul(2).sub(1),PP=nP("normal","vec3"),DP=zE((t=>!1===t.geometry.hasAttribute("normal")?(console.warn('TSL.NormalNode: Vertex attribute "normal" not found on geometry.'),JE(0,1,0)):PP),"vec3").once()().toVar("normalLocal"),IP=EP.dFdx().cross(EP.dFdy()).normalize().toVar("normalFlat"),LP=zE((t=>{let e;return e=!0===t.material.flatShading?IP:CN(zP(DP),"v_normalView").normalize(),e}),"vec3").once()().toVar("normalView"),BP=CN(LP.transformDirection(fP),"v_normalWorld").normalize().toVar("normalWorld"),UP=zE((t=>t.context.setupNormal()),"vec3").once()().mul(NP).toVar("transformedNormalView"),OP=UP.transformDirection(fP).toVar("transformedNormalWorld"),FP=zE((t=>t.context.setupClearcoatNormal()),"vec3").once()().mul(NP).toVar("transformedClearcoatNormalView"),kP=zE((([t,e=vP])=>{const n=lC(e),i=t.div(JE(n[0].dot(n[0]),n[1].dot(n[1]),n[2].dot(n[2])));return n.mul(i).xyz})),zP=zE((([t],e)=>{const n=e.renderer.nodes.modelNormalViewMatrix;if(null!==n)return n.transformDirection(t);const i=_P.mul(t);return fP.transformDirection(i)})),qP=gC(0).onReference((({material:t})=>t)).onRenderUpdate((({material:t})=>t.refractionRatio)),GP=CP.negate().reflect(UP),VP=CP.negate().refract(UP,qP),HP=GP.transformDirection(fP).toVar("reflectVector"),jP=VP.transformDirection(fP).toVar("reflectVector");class WP extends lP{static get type(){return"CubeTextureNode"}constructor(t,e=null,n=null,i=null){super(t,e,n,i),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const t=this.value;return t.mapping===vx?HP:t.mapping===_x?jP:(console.error('THREE.CubeTextureNode: Mapping "%s" not supported.',t.mapping),JE(0,0,0))}setUpdateMatrix(){}setupUV(t,e){const n=this.value;return t.renderer.coordinateSystem!==Ob&&n.isRenderTargetTexture?e:JE(e.x.negate(),e.yz)}generateUV(t,e){return e.build(t,"vec3")}}const XP=FE(WP);class YP extends mC{static get type(){return"BufferNode"}constructor(t,e,n=0){super(t,e),this.isBufferNode=!0,this.bufferType=e,this.bufferCount=n}getElementType(t){return this.getNodeType(t)}getInputType(){return"buffer"}}const QP=(t,e,n)=>BE(new YP(t,e,n));class $P extends ZT{static get type(){return"UniformArrayElementNode"}constructor(t,e){super(t,e),this.isArrayBufferElementNode=!0}generate(t){const e=super.generate(t),n=this.getNodeType();return t.format(e,"vec4",n)}}class ZP extends YP{static get type(){return"UniformArrayNode"}constructor(t,e=null){super(null,"vec4"),this.array=t,this.elementType=e,this._elementType=null,this._elementLength=0,this.updateType=HT,this.isArrayBufferNode=!0}getElementType(){return this.elementType||this._elementType}getElementLength(){return this._elementLength}update(){const{array:t,value:e}=this,n=this.getElementLength(),i=this.getElementType();if(1===n)for(let n=0;n<t.length;n++){e[4*n]=t[n]}else if("color"===i)for(let n=0;n<t.length;n++){const i=4*n,r=t[n];e[i]=r.r,e[i+1]=r.g,e[i+2]=r.b||0}else for(let n=0;n<t.length;n++){const i=4*n,r=t[n];e[i]=r.x,e[i+1]=r.y,e[i+2]=r.z||0,e[i+3]=r.w||0}}setup(t){const e=this.array.length;this._elementType=null===this.elementType?kT(this.array[0]):this.elementType,this._elementLength=t.getTypeLength(this._elementType);let n=Float32Array;return"i"===this._elementType.charAt(0)?n=Int32Array:"u"===this._elementType.charAt(0)&&(n=Uint32Array),this.value=new n(4*e),this.bufferCount=e,this.bufferType=t.changeComponentType("vec4",t.getComponentType(this._elementType)),super.setup(t)}element(t){return BE(new $P(this,BE(t)))}}const KP=(t,e)=>BE(new ZP(t,e));class JP extends ZT{static get type(){return"ReferenceElementNode"}constructor(t,e){super(t,e),this.referenceNode=t,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(t){const e=super.generate(t),n=this.referenceNode.getNodeType(),i=this.getNodeType();return t.format(e,n,i)}}class tD extends $T{static get type(){return"ReferenceNode"}constructor(t,e,n=null,i=null){super(),this.property=t,this.uniformType=e,this.object=n,this.count=i,this.properties=t.split("."),this.reference=n,this.node=null,this.group=null,this.name=null,this.updateType=jT}element(t){return BE(new JP(this,BE(t)))}setGroup(t){return this.group=t,this}label(t){return this.name=t,this}setNodeType(t){let e=null;e=null!==this.count?QP(null,t,this.count):Array.isArray(this.getValueFromReference())?KP(null,t):"texture"===t?uP(null):"cubeTexture"===t?XP(null):gC(null,t),null!==this.group&&e.setGroup(this.group),null!==this.name&&e.label(this.name),this.node=e.getSelf()}getNodeType(t){return null===this.node&&(this.updateReference(t),this.updateValue()),this.node.getNodeType(t)}getValueFromReference(t=this.reference){const{properties:e}=this;let n=t[e[0]];for(let t=1;t<e.length;t++)n=n[e[t]];return n}updateReference(t){return this.reference=null!==this.object?this.object:t.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){null===this.node&&this.setNodeType(this.uniformType);const t=this.getValueFromReference();Array.isArray(t)?this.node.array=t:this.node.value=t}}const eD=(t,e,n)=>BE(new tD(t,e,n)),nD=(t,e,n,i)=>BE(new tD(t,e,i,n));class iD extends tD{static get type(){return"MaterialReferenceNode"}constructor(t,e,n=null){super(t,e,n),this.material=n,this.isMaterialReferenceNode=!0}updateReference(t){return this.reference=null!==this.material?this.material:t.material,this.reference}}const rD=(t,e,n)=>BE(new iD(t,e,n)),sD=zE((t=>(!1===t.geometry.hasAttribute("tangent")&&t.geometry.computeTangents(),nP("tangent","vec4"))))(),aD=sD.xyz.toVar("tangentLocal"),oD=xP.mul(iC(aD,0)).xyz.varying("v_tangentView").normalize().toVar("tangentView");var lD;const uD=lC(oD,CN((lD=LP.cross(oD),lD.mul(sD.w).xyz),"v_bitangentView").normalize().toVar("bitangentView"),LP),hD=(()=>{let t=BC.cross(CP);return t=t.cross(BC).normalize(),t=fN(t,UP,IC.mul(SC.oneMinus()).oneMinus().pow2().pow2()).normalize(),t})(),cD=zE((t=>{const{eye_pos:e,surf_norm:n,mapN:i,uv:r}=t,s=e.dFdx(),a=e.dFdy(),o=r.dFdx(),l=r.dFdy(),u=n,h=a.cross(u),c=u.cross(s),A=h.mul(o.x).add(c.mul(l.x)),d=h.mul(o.y).add(c.mul(l.y)),p=A.dot(A).max(d.dot(d)),f=NP.mul(p.inverseSqrt());return ZC(A.mul(i.x,f),d.mul(i.y,f),u.mul(i.z)).normalize()}));class AD extends JT{static get type(){return"NormalMapNode"}constructor(t,e=null){super("vec3"),this.node=t,this.scaleNode=e,this.normalMapType=0}setup(t){const{normalMapType:e,scaleNode:n}=this;let i=this.node.mul(2).sub(1);null!==n&&(i=JE(i.xy.mul(n),i.z));let r=null;if(1===e)r=zP(i);else if(0===e){r=!0===t.hasGeometryAttribute("tangent")?uD.mul(i).normalize():cD({eye_pos:EP,surf_norm:LP,mapN:i,uv:iP()})}return r}}const dD=FE(AD),pD=zE((({textureNode:t,bumpScale:e})=>{const n=e=>t.cache().context({getUV:t=>e(t.uvNode||iP()),forceUVContext:!0}),i=jE(n((t=>t)));return QE(jE(n((t=>t.add(t.dFdx())))).sub(i),jE(n((t=>t.add(t.dFdy())))).sub(i)).mul(e)})),fD=zE((t=>{const{surf_pos:e,surf_norm:n,dHdxy:i}=t,r=e.dFdx().normalize(),s=n,a=e.dFdy().normalize().cross(s),o=s.cross(r),l=r.dot(a).mul(NP),u=l.sign().mul(i.x.mul(a).add(i.y.mul(o)));return l.abs().mul(n).sub(u).normalize()}));class mD extends JT{static get type(){return"BumpMapNode"}constructor(t,e=null){super("vec3"),this.textureNode=t,this.scaleNode=e}setup(){const t=null!==this.scaleNode?this.scaleNode:1,e=pD({textureNode:this.textureNode,bumpScale:t});return fD({surf_pos:EP,surf_norm:LP,dHdxy:e})}}const gD=FE(mD),yD=new Map;class vD extends $T{static get type(){return"MaterialNode"}constructor(t){super(),this.scope=t}getCache(t,e){let n=yD.get(t);return void 0===n&&(n=rD(t,e),yD.set(t,n)),n}getFloat(t){return this.getCache(t,"float")}getColor(t){return this.getCache(t,"color")}getTexture(t){return this.getCache("map"===t?"map":t+"Map","texture")}setup(t){const e=t.context.material,n=this.scope;let i=null;if(n===vD.COLOR){const t=void 0!==e.color?this.getColor(n):JE();i=e.map&&!0===e.map.isTexture?t.mul(this.getTexture("map")):t}else if(n===vD.OPACITY){const t=this.getFloat(n);i=e.alphaMap&&!0===e.alphaMap.isTexture?t.mul(this.getTexture("alpha")):t}else if(n===vD.SPECULAR_STRENGTH)i=e.specularMap&&!0===e.specularMap.isTexture?this.getTexture("specular").r:jE(1);else if(n===vD.SPECULAR_INTENSITY){const t=this.getFloat(n);i=e.specularMap?t.mul(this.getTexture(n).a):t}else if(n===vD.SPECULAR_COLOR){const t=this.getColor(n);i=e.specularColorMap&&!0===e.specularColorMap.isTexture?t.mul(this.getTexture(n).rgb):t}else if(n===vD.ROUGHNESS){const t=this.getFloat(n);i=e.roughnessMap&&!0===e.roughnessMap.isTexture?t.mul(this.getTexture(n).g):t}else if(n===vD.METALNESS){const t=this.getFloat(n);i=e.metalnessMap&&!0===e.metalnessMap.isTexture?t.mul(this.getTexture(n).b):t}else if(n===vD.EMISSIVE){const t=this.getFloat("emissiveIntensity"),r=this.getColor(n).mul(t);i=e.emissiveMap&&!0===e.emissiveMap.isTexture?r.mul(this.getTexture(n)):r}else if(n===vD.NORMAL)e.normalMap?(i=dD(this.getTexture("normal"),this.getCache("normalScale","vec2")),i.normalMapType=e.normalMapType):i=e.bumpMap?gD(this.getTexture("bump").r,this.getFloat("bumpScale")):LP;else if(n===vD.CLEARCOAT){const t=this.getFloat(n);i=e.clearcoatMap&&!0===e.clearcoatMap.isTexture?t.mul(this.getTexture(n).r):t}else if(n===vD.CLEARCOAT_ROUGHNESS){const t=this.getFloat(n);i=e.clearcoatRoughnessMap&&!0===e.clearcoatRoughnessMap.isTexture?t.mul(this.getTexture(n).r):t}else if(n===vD.CLEARCOAT_NORMAL)i=e.clearcoatNormalMap?dD(this.getTexture(n),this.getCache(n+"Scale","vec2")):LP;else if(n===vD.SHEEN){const t=this.getColor("sheenColor").mul(this.getFloat("sheen"));i=e.sheenColorMap&&!0===e.sheenColorMap.isTexture?t.mul(this.getTexture("sheenColor").rgb):t}else if(n===vD.SHEEN_ROUGHNESS){const t=this.getFloat(n);i=e.sheenRoughnessMap&&!0===e.sheenRoughnessMap.isTexture?t.mul(this.getTexture(n).a):t,i=i.clamp(.07,1)}else if(n===vD.ANISOTROPY)if(e.anisotropyMap&&!0===e.anisotropyMap.isTexture){const t=this.getTexture(n);i=oC(tI.x,tI.y,tI.y.negate(),tI.x).mul(t.rg.mul(2).sub(QE(1)).normalize().mul(t.b))}else i=tI;else if(n===vD.IRIDESCENCE_THICKNESS){const t=eD("1","float",e.iridescenceThicknessRange);if(e.iridescenceThicknessMap){const r=eD("0","float",e.iridescenceThicknessRange);i=t.sub(r).mul(this.getTexture(n).g).add(r)}else i=t}else if(n===vD.TRANSMISSION){const t=this.getFloat(n);i=e.transmissionMap?t.mul(this.getTexture(n).r):t}else if(n===vD.THICKNESS){const t=this.getFloat(n);i=e.thicknessMap?t.mul(this.getTexture(n).g):t}else if(n===vD.IOR)i=this.getFloat(n);else if(n===vD.LIGHT_MAP)i=this.getTexture(n).rgb.mul(this.getFloat("lightMapIntensity"));else if(n===vD.AO_MAP)i=this.getTexture(n).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else{const e=this.getNodeType(t);i=this.getCache(n,e)}return i}}vD.ALPHA_TEST="alphaTest",vD.COLOR="color",vD.OPACITY="opacity",vD.SHININESS="shininess",vD.SPECULAR="specular",vD.SPECULAR_STRENGTH="specularStrength",vD.SPECULAR_INTENSITY="specularIntensity",vD.SPECULAR_COLOR="specularColor",vD.REFLECTIVITY="reflectivity",vD.ROUGHNESS="roughness",vD.METALNESS="metalness",vD.NORMAL="normal",vD.CLEARCOAT="clearcoat",vD.CLEARCOAT_ROUGHNESS="clearcoatRoughness",vD.CLEARCOAT_NORMAL="clearcoatNormal",vD.EMISSIVE="emissive",vD.ROTATION="rotation",vD.SHEEN="sheen",vD.SHEEN_ROUGHNESS="sheenRoughness",vD.ANISOTROPY="anisotropy",vD.IRIDESCENCE="iridescence",vD.IRIDESCENCE_IOR="iridescenceIOR",vD.IRIDESCENCE_THICKNESS="iridescenceThickness",vD.IOR="ior",vD.TRANSMISSION="transmission",vD.THICKNESS="thickness",vD.ATTENUATION_DISTANCE="attenuationDistance",vD.ATTENUATION_COLOR="attenuationColor",vD.LINE_SCALE="scale",vD.LINE_DASH_SIZE="dashSize",vD.LINE_GAP_SIZE="gapSize",vD.LINE_WIDTH="linewidth",vD.LINE_DASH_OFFSET="dashOffset",vD.POINT_WIDTH="pointWidth",vD.DISPERSION="dispersion",vD.LIGHT_MAP="light",vD.AO_MAP="ao";const _D=kE(vD,vD.ALPHA_TEST),xD=kE(vD,vD.COLOR),bD=kE(vD,vD.SHININESS),SD=kE(vD,vD.EMISSIVE),MD=kE(vD,vD.OPACITY),wD=kE(vD,vD.SPECULAR),TD=kE(vD,vD.SPECULAR_INTENSITY),ED=kE(vD,vD.SPECULAR_COLOR),CD=kE(vD,vD.SPECULAR_STRENGTH),RD=kE(vD,vD.REFLECTIVITY),ND=kE(vD,vD.ROUGHNESS),PD=kE(vD,vD.METALNESS),DD=kE(vD,vD.NORMAL).context({getUV:null}),ID=kE(vD,vD.CLEARCOAT),LD=kE(vD,vD.CLEARCOAT_ROUGHNESS),BD=kE(vD,vD.CLEARCOAT_NORMAL).context({getUV:null}),UD=kE(vD,vD.ROTATION),OD=kE(vD,vD.SHEEN),FD=kE(vD,vD.SHEEN_ROUGHNESS),kD=kE(vD,vD.ANISOTROPY),zD=kE(vD,vD.IRIDESCENCE),qD=kE(vD,vD.IRIDESCENCE_IOR),GD=kE(vD,vD.IRIDESCENCE_THICKNESS),VD=kE(vD,vD.TRANSMISSION),HD=kE(vD,vD.THICKNESS),jD=kE(vD,vD.IOR),WD=kE(vD,vD.ATTENUATION_DISTANCE),XD=kE(vD,vD.ATTENUATION_COLOR),YD=kE(vD,vD.LINE_SCALE),QD=kE(vD,vD.LINE_DASH_SIZE),$D=kE(vD,vD.LINE_GAP_SIZE);vD.LINE_WIDTH,vD.LINE_DASH_OFFSET,vD.POINT_WIDTH;const ZD=kE(vD,vD.DISPERSION),KD=kE(vD,vD.LIGHT_MAP),JD=kE(vD,vD.AO_MAP),tI=gC(new $b).onReference((function(t){return t.material})).onRenderUpdate((function({material:t}){this.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation))}));class eI extends JT{static get type(){return"ModelViewProjectionNode"}constructor(t=null){super("vec4"),this.positionNode=t}setup(t){if("fragment"===t.shaderStage)return CN(t.context.mvp);const e=this.positionNode||SP,n=t.renderer.nodes.modelViewMatrix||xP;return pP.mul(n).mul(e)}}const nI=FE(eI);class iI extends $T{static get type(){return"IndexNode"}constructor(t){super("uint"),this.scope=t,this.isInstanceIndexNode=!0}generate(t){const e=this.getNodeType(t),n=this.scope;let i,r;if(n===iI.VERTEX)i=t.getVertexIndex();else if(n===iI.INSTANCE)i=t.getInstanceIndex();else if(n===iI.DRAW)i=t.getDrawIndex();else if(n===iI.INVOCATION_LOCAL)i=t.getInvocationLocalIndex();else if(n===iI.INVOCATION_SUBGROUP)i=t.getInvocationSubgroupIndex();else{if(n!==iI.SUBGROUP)throw new Error("THREE.IndexNode: Unknown scope: "+n);i=t.getSubgroupIndex()}if("vertex"===t.shaderStage||"compute"===t.shaderStage)r=i;else{r=CN(this).build(t,e)}return r}}iI.VERTEX="vertex",iI.INSTANCE="instance",iI.SUBGROUP="subgroup",iI.INVOCATION_LOCAL="invocationLocal",iI.INVOCATION_SUBGROUP="invocationSubgroup",iI.DRAW="draw";const rI=kE(iI,iI.VERTEX),sI=kE(iI,iI.INSTANCE);iI.SUBGROUP,iI.INVOCATION_SUBGROUP,iI.INVOCATION_LOCAL;const aI=kE(iI,iI.DRAW);class oI extends $T{static get type(){return"InstanceNode"}constructor(t){super("void"),this.instanceMesh=t,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=VT,this.buffer=null,this.bufferColor=null}setup(t){let e=this.instanceMatrixNode,n=this.instanceColorNode;const i=this.instanceMesh;if(null===e){const t=i.instanceMatrix;if(i.count<=1e3)e=QP(t.array,"mat4",Math.max(i.count,1)).element(sI);else{const n=new PT(t.array,16,1);this.buffer=n;const i=t.usage===Bb?HN:VN,r=[i(n,"vec4",16,0),i(n,"vec4",16,4),i(n,"vec4",16,8),i(n,"vec4",16,12)];e=uC(...r)}this.instanceMatrixNode=e}const r=i.instanceColor;if(r&&null===n){const t=new Vw(r.array,3),e=r.usage===Bb?HN:VN;this.bufferColor=t,n=JE(e(t,"vec3",3,0)),this.instanceColorNode=n}const s=e.mul(SP).xyz;if(SP.assign(s),t.hasGeometryAttribute("normal")){const t=kP(DP,e);DP.assign(t)}null!==this.instanceColorNode&&_C("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMesh.instanceMatrix.usage!==Bb&&null!=this.buffer&&this.instanceMesh.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMesh.instanceMatrix.version),this.instanceMesh.instanceColor&&this.instanceMesh.instanceColor.usage!==Bb&&null!=this.bufferColor&&this.instanceMesh.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceMesh.instanceColor.version)}}const lI=FE(oI);class uI extends $T{static get type(){return"BatchNode"}constructor(t){super("void"),this.batchMesh=t,this.batchingIdNode=null}setup(t){null===this.batchingIdNode&&(null===t.getDrawIndex()?this.batchingIdNode=sI:this.batchingIdNode=aI);const e=zE((([t])=>{const e=sP(hP(this.batchMesh._indirectTexture),0),n=WE(t).modInt(WE(e)),i=WE(t).div(WE(e));return hP(this.batchMesh._indirectTexture,$E(n,i)).x})).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]}),n=e(WE(this.batchingIdNode)),i=this.batchMesh._matricesTexture,r=sP(hP(i),0),s=jE(n).mul(4).toInt().toVar(),a=s.modInt(r),o=s.div(WE(r)),l=uC(hP(i,$E(a,o)),hP(i,$E(a.add(1),o)),hP(i,$E(a.add(2),o)),hP(i,$E(a.add(3),o))),u=this.batchMesh._colorsTexture;if(null!==u){const t=zE((([t])=>{const e=sP(hP(u),0).x,n=t,i=n.modInt(e),r=n.div(e);return hP(u,$E(i,r)).rgb})).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]}),e=t(n);_C("vec3","vBatchColor").assign(e)}const h=lC(l);SP.assign(l.mul(SP));const c=DP.div(JE(h[0].dot(h[0]),h[1].dot(h[1]),h[2].dot(h[2]))),A=h.mul(c).xyz;DP.assign(A),t.hasGeometryAttribute("tangent")&&aD.mulAssign(h)}}const hI=FE(uI),cI=new WeakMap;class AI extends $T{static get type(){return"SkinningNode"}constructor(t,e=!1){let n,i,r;super("void"),this.skinnedMesh=t,this.useReference=e,this.updateType=jT,this.skinIndexNode=nP("skinIndex","uvec4"),this.skinWeightNode=nP("skinWeight","vec4"),e?(n=eD("bindMatrix","mat4"),i=eD("bindMatrixInverse","mat4"),r=nD("skeleton.boneMatrices","mat4",t.skeleton.bones.length)):(n=gC(t.bindMatrix,"mat4"),i=gC(t.bindMatrixInverse,"mat4"),r=QP(t.skeleton.boneMatrices,"mat4",t.skeleton.bones.length)),this.bindMatrixNode=n,this.bindMatrixInverseNode=i,this.boneMatricesNode=r,this.previousBoneMatricesNode=null}getSkinnedPosition(t=this.boneMatricesNode,e=SP){const{skinIndexNode:n,skinWeightNode:i,bindMatrixNode:r,bindMatrixInverseNode:s}=this,a=t.element(n.x),o=t.element(n.y),l=t.element(n.z),u=t.element(n.w),h=r.mul(e),c=ZC(a.mul(i.x).mul(h),o.mul(i.y).mul(h),l.mul(i.z).mul(h),u.mul(i.w).mul(h));return s.mul(c).xyz}getSkinnedNormal(t=this.boneMatricesNode,e=DP){const{skinIndexNode:n,skinWeightNode:i,bindMatrixNode:r,bindMatrixInverseNode:s}=this,a=t.element(n.x),o=t.element(n.y),l=t.element(n.z),u=t.element(n.w);let h=ZC(i.x.mul(a),i.y.mul(o),i.z.mul(l),i.w.mul(u));return h=s.mul(h).mul(r),h.transformDirection(e).xyz}getPreviousSkinnedPosition(t){const e=t.object;return null===this.previousBoneMatricesNode&&(e.skeleton.previousBoneMatrices=new Float32Array(e.skeleton.boneMatrices),this.previousBoneMatricesNode=nD("skeleton.previousBoneMatrices","mat4",e.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,MP)}needsPreviousBoneMatrices(t){const e=t.renderer.getMRT();return e&&e.has("velocity")}setup(t){this.needsPreviousBoneMatrices(t)&&MP.assign(this.getPreviousSkinnedPosition(t));const e=this.getSkinnedPosition();if(SP.assign(e),t.hasGeometryAttribute("normal")){const e=this.getSkinnedNormal();DP.assign(e),t.hasGeometryAttribute("tangent")&&aD.assign(e)}}generate(t,e){if("void"!==e)return SP.build(t,e)}update(t){const e=(this.useReference?t.object:this.skinnedMesh).skeleton;cI.get(e)!==t.frameId&&(cI.set(e,t.frameId),null!==this.previousBoneMatricesNode&&e.previousBoneMatrices.set(e.boneMatrices),e.update())}}class dI extends $T{static get type(){return"LoopNode"}constructor(t=[]){super(),this.params=t}getVarName(t){return String.fromCharCode("i".charCodeAt()+t)}getProperties(t){const e=t.getNodeProperties(this);if(void 0!==e.stackNode)return e;const n={};for(let t=0,e=this.params.length-1;t<e;t++){const e=this.params[t],i=!0!==e.isNode&&e.name||this.getVarName(t),r=!0!==e.isNode&&e.type||"int";n[i]=JN(i,r)}const i=t.addStack();return e.returnsNode=this.params[this.params.length-1](n,i,t),e.stackNode=i,t.removeStack(),e}getNodeType(t){const{returnsNode:e}=this.getProperties(t);return e?e.getNodeType(t):"void"}setup(t){this.getProperties(t)}generate(t){const e=this.getProperties(t),n=this.params,i=e.stackNode;for(let e=0,i=n.length-1;e<i;e++){const i=n[e];let r=null,s=null,a=null,o=null,l=null,u=null;i.isNode?(o="int",a=this.getVarName(e),r="0",s=i.build(t,o),l="<"):(o=i.type||"int",a=i.name||this.getVarName(e),r=i.start,s=i.end,l=i.condition,u=i.update,"number"==typeof r?r=r.toString():r&&r.isNode&&(r=r.build(t,o)),"number"==typeof s?s=s.toString():s&&s.isNode&&(s=s.build(t,o)),void 0!==r&&void 0===s?(r+=" - 1",s="0",l=">="):void 0!==s&&void 0===r&&(r="0",l="<"),void 0===l&&(l=Number(r)>Number(s)?">=":"<"));const h={start:r,end:s,condition:l},c=h.start,A=h.end;let d="",p="",f="";u||(u="int"===o||"uint"===o?l.includes("<")?"++":"--":l.includes("<")?"+= 1.":"-= 1."),d+=t.getVar(o,a)+" = "+c,p+=a+" "+l+" "+A,f+=a+" "+u;const m=`for ( ${d}; ${p}; ${f} )`;t.addFlowCode((0===e?"\n":"")+t.tab+m+" {\n\n").addFlowTab()}const r=i.build(t,"void"),s=e.returnsNode?e.returnsNode.build(t):"";t.removeFlowTab().addFlowCode("\n"+t.tab+r);for(let e=0,n=this.params.length-1;e<n;e++)t.addFlowCode((0===e?"":t.tab)+"}\n\n").removeFlowTab();return t.addFlowTab(),s}}const pI=(...t)=>BE(new dI(OE(t,"int"))).append(),fI=new WeakMap,mI=new fS,gI=zE((({bufferMap:t,influence:e,stride:n,width:i,depth:r,offset:s})=>{const a=WE(rI).mul(n).add(s),o=a.div(i),l=a.sub(o.mul(i));return hP(t,$E(l,o)).depth(r).mul(e)}));class yI extends $T{static get type(){return"MorphNode"}constructor(t){super("void"),this.mesh=t,this.morphBaseInfluence=gC(1),this.updateType=jT}setup(t){const{geometry:e}=t,n=void 0!==e.morphAttributes.position,i=e.hasAttribute("normal")&&void 0!==e.morphAttributes.normal,r=e.morphAttributes.position||e.morphAttributes.normal||e.morphAttributes.color,s=void 0!==r?r.length:0,{texture:a,stride:o,size:l}=function(t){const e=void 0!==t.morphAttributes.position,n=void 0!==t.morphAttributes.normal,i=void 0!==t.morphAttributes.color,r=t.morphAttributes.position||t.morphAttributes.normal||t.morphAttributes.color,s=void 0!==r?r.length:0;let a=fI.get(t);if(void 0===a||a.count!==s){void 0!==a&&a.texture.dispose();const o=t.morphAttributes.position||[],l=t.morphAttributes.normal||[],u=t.morphAttributes.color||[];let h=0;!0===e&&(h=1),!0===n&&(h=2),!0===i&&(h=3);let c=t.attributes.position.count*h,A=1;const d=4096;c>d&&(A=Math.ceil(c/d),c=d);const p=new Float32Array(c*A*4*s),f=new yS(p,c,A,s);f.type=Fx,f.needsUpdate=!0;const m=4*h;for(let y=0;y<s;y++){const v=o[y],_=l[y],x=u[y],b=c*A*4*y;for(let S=0;S<v.count;S++){const M=S*m;!0===e&&(mI.fromBufferAttribute(v,S),p[b+M+0]=mI.x,p[b+M+1]=mI.y,p[b+M+2]=mI.z,p[b+M+3]=0),!0===n&&(mI.fromBufferAttribute(_,S),p[b+M+4]=mI.x,p[b+M+5]=mI.y,p[b+M+6]=mI.z,p[b+M+7]=0),!0===i&&(mI.fromBufferAttribute(x,S),p[b+M+8]=mI.x,p[b+M+9]=mI.y,p[b+M+10]=mI.z,p[b+M+11]=4===x.itemSize?mI.w:1)}}function g(){f.dispose(),fI.delete(t),t.removeEventListener("dispose",g)}a={count:s,texture:f,stride:h,size:new $b(c,A)},fI.set(t,a),t.addEventListener("dispose",g)}return a}(e);!0===n&&SP.mulAssign(this.morphBaseInfluence),!0===i&&DP.mulAssign(this.morphBaseInfluence);const u=WE(l.width);pI(s,(({i:t})=>{const e=jE(0).toVar();this.mesh.count>1&&null!==this.mesh.morphTexture&&void 0!==this.mesh.morphTexture?e.assign(hP(this.mesh.morphTexture,$E(WE(t).add(1),WE(sI))).r):e.assign(eD("morphTargetInfluences","float").element(t).toVar()),!0===n&&SP.addAssign(gI({bufferMap:a,influence:e,stride:o,width:u,depth:t,offset:WE(0)})),!0===i&&DP.addAssign(gI({bufferMap:a,influence:e,stride:o,width:u,depth:t,offset:WE(1)}))}))}update(){const t=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?t.value=1:t.value=1-this.mesh.morphTargetInfluences.reduce(((t,e)=>t+e),0)}}const vI=FE(yI),_I=(t,e)=>{for(const n of e)if(n.isAnalyticLightNode&&n.light.id===t)return n;return null},xI=new WeakMap;class bI extends $T{static get type(){return"LightsNode"}constructor(t=[]){super("vec3"),this.totalDiffuseNode=JE().toVar("totalDiffuse"),this.totalSpecularNode=JE().toVar("totalSpecular"),this.outgoingLightNode=JE().toVar("outgoingLight"),this._lights=t,this._lightNodes=null,this._lightNodesHash=null,this.global=!0}getHash(t){if(null===this._lightNodesHash){null===this._lightNodes&&this.setupLightsNode(t);const e=[];for(const t of this._lightNodes)e.push(t.getHash());this._lightNodesHash="lights-"+e.join(",")}return this._lightNodesHash}analyze(t){const e=t.getDataFromNode(this);for(const n of e.nodes)n.build(t)}setupLightsNode(t){const e=[],n=this._lightNodes,i=(t=>t.sort(((t,e)=>t.id-e.id)))(this._lights),r=t.renderer.nodes.library;for(const t of i)if(t.isNode)e.push(BE(t));else{let i=null;if(null!==n&&(i=_I(t.id,n)),null===i){const n=r.getLightNodeClass(t.constructor);if(null===n){console.warn(`LightsNode.setupNodeLights: Light node not found for ${t.constructor.name}`);continue}let i=null;xI.has(t)?i=xI.get(t):(i=new n(t),xI.set(t,i)),e.push(i)}}this._lightNodes=e}setup(t){null===this._lightNodes&&this.setupLightsNode(t);const e=t.context,n=e.lightingModel;let i=this.outgoingLightNode;if(n){const{_lightNodes:r,totalDiffuseNode:s,totalSpecularNode:a}=this;e.outgoingLight=i;const o=t.addStack();t.getDataFromNode(this).nodes=o.nodes,n.start(e,o,t);for(const e of r)e.build(t);n.indirect(e,o,t);const{backdrop:l,backdropAlpha:u}=e,{directDiffuse:h,directSpecular:c,indirectDiffuse:A,indirectSpecular:d}=e.reflectedLight;let p=h.add(A);null!==l&&(p=JE(null!==u?u.mix(p,l):l),e.material.transparent=!0),s.assign(p),a.assign(c.add(d)),i.assign(s.add(a)),n.finish(e,o,t),i=i.bypass(t.removeStack())}return i}setLights(t){return this._lights=t,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}}const SI=FE(bI);class MI extends $T{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}generate(){console.warn("Abstract function.")}}class wI extends MI{static get type(){return"AONode"}constructor(t=null){super(),this.aoNode=t}setup(t){t.context.ambientOcclusion.mulAssign(this.aoNode)}}class TI extends SN{static get type(){return"LightingContextNode"}constructor(t,e=null,n=null,i=null){super(t),this.lightingModel=e,this.backdropNode=n,this.backdropAlphaNode=i,this._value=null}getContext(){const{backdropNode:t,backdropAlphaNode:e}=this,n={directDiffuse:JE().toVar("directDiffuse"),directSpecular:JE().toVar("directSpecular"),indirectDiffuse:JE().toVar("indirectDiffuse"),indirectSpecular:JE().toVar("indirectSpecular")};return{radiance:JE().toVar("radiance"),irradiance:JE().toVar("irradiance"),iblIrradiance:JE().toVar("iblIrradiance"),ambientOcclusion:jE(1).toVar("ambientOcclusion"),reflectedLight:n,backdrop:t,backdropAlpha:e}}setup(t){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||t.context.lightingModel,super.setup(t)}}const EI=FE(TI);class CI extends MI{static get type(){return"IrradianceNode"}constructor(t){super(),this.node=t}setup(t){t.context.irradiance.addAssign(this.node)}}let RI,NI;class PI extends $T{static get type(){return"ScreenNode"}constructor(t){super(),this.scope=t,this.isViewportNode=!0}getNodeType(){return this.scope===PI.VIEWPORT?"vec4":"vec2"}getUpdateType(){let t=GT;return this.scope!==PI.SIZE&&this.scope!==PI.VIEWPORT||(t=HT),this.updateType=t,t}update({renderer:t}){const e=t.getRenderTarget();this.scope===PI.VIEWPORT?null!==e?NI.copy(e.viewport):(t.getViewport(NI),NI.multiplyScalar(t.getPixelRatio())):null!==e?(RI.width=e.width,RI.height=e.height):t.getDrawingBufferSize(RI)}setup(){const t=this.scope;let e=null;return e=t===PI.SIZE?gC(RI||(RI=new $b)):t===PI.VIEWPORT?gC(NI||(NI=new fS)):QE(LI.div(II)),e}generate(t){if(this.scope===PI.COORDINATE){let e=t.getFragCoord();if(t.isFlipY()){const n=t.getNodeProperties(II).outputNode.build(t);e=`${t.getType("vec2")}( ${e}.x, ${n}.y - ${e}.y )`}return e}return super.generate(t)}}PI.COORDINATE="coordinate",PI.VIEWPORT="viewport",PI.SIZE="size",PI.UV="uv";const DI=kE(PI,PI.UV),II=kE(PI,PI.SIZE),LI=kE(PI,PI.COORDINATE),BI=kE(PI,PI.VIEWPORT);BI.zw,BI.xy;const UI=new $b;class OI extends lP{static get type(){return"ViewportTextureNode"}constructor(t=DI,e=null,n=null){null===n&&((n=new Jw).minFilter=Px),super(n,t,e),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=VT}updateBefore(t){const e=t.renderer;e.getDrawingBufferSize(UI);const n=this.value;n.image.width===UI.width&&n.image.height===UI.height||(n.image.width=UI.width,n.image.height=UI.height,n.needsUpdate=!0);const i=n.generateMipmaps;n.generateMipmaps=this.generateMipmaps,e.copyFramebufferToTexture(n),n.generateMipmaps=i}clone(){const t=new this.constructor(this.uvNode,this.levelNode,this.value);return t.generateMipmaps=this.generateMipmaps,t}}const FI=FE(OI,null,null,{generateMipmaps:!0});let kI=null;class zI extends OI{static get type(){return"ViewportDepthTextureNode"}constructor(t=DI,e=null){null===kI&&(kI=new tT),super(t,e,kI)}}const qI=FE(zI);class GI extends $T{static get type(){return"ViewportDepthNode"}constructor(t,e=null){super("float"),this.scope=t,this.valueNode=e,this.isViewportDepthNode=!0}generate(t){const{scope:e}=this;return e===GI.DEPTH_BASE?t.getFragDepth():super.generate(t)}setup({camera:t}){const{scope:e}=this,n=this.valueNode;let i=null;if(e===GI.DEPTH_BASE)null!==n&&(i=WI().assign(n));else if(e===GI.DEPTH)i=t.isPerspectiveCamera?HI(EP.z,cP,AP):VI(EP.z,cP,AP);else if(e===GI.LINEAR_DEPTH)if(null!==n)if(t.isPerspectiveCamera){const t=jI(n,cP,AP);i=VI(t,cP,AP)}else i=n;else i=VI(EP.z,cP,AP);return i}}GI.DEPTH_BASE="depthBase",GI.DEPTH="depth",GI.LINEAR_DEPTH="linearDepth";const VI=(t,e,n)=>t.add(e).div(e.sub(n)),HI=(t,e,n)=>e.add(t).mul(n).div(n.sub(e).mul(t)),jI=(t,e,n)=>e.mul(n).div(n.sub(e).mul(t).sub(n)),WI=FE(GI,GI.DEPTH_BASE),XI=kE(GI,GI.DEPTH);GI.LINEAR_DEPTH;qI(),XI.assign=t=>WI(t);class YI extends $T{static get type(){return"ClippingNode"}constructor(t=YI.DEFAULT){super(),this.scope=t}setup(t){super.setup(t);const e=t.clippingContext,{localClipIntersection:n,localClippingCount:i,globalClippingCount:r}=e,s=r+i,a=n?s-i:s;return this.scope===YI.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(e.planes,s,a):this.setupDefault(e.planes,s,a)}setupAlphaToCoverage(t,e,n){return zE((()=>{const i=KP(t),r=vC("float","distanceToPlane"),s=vC("float","distanceToGradient"),a=vC("float","clipOpacity");let o;if(a.assign(1),pI(n,(({i:t})=>{o=i.element(t),r.assign(EP.dot(o.xyz).negate().add(o.w)),s.assign(r.fwidth().div(2)),a.mulAssign(yN(s.negate(),s,r)),a.equal(0).discard()})),n<e){const t=vC("float","unionclipOpacity");t.assign(1),pI({start:n,end:e},(({i:e})=>{o=i.element(e),r.assign(EP.dot(o.xyz).negate().add(o.w)),s.assign(r.fwidth().div(2)),t.mulAssign(yN(s.negate(),s,r).oneMinus())})),a.mulAssign(t.oneMinus())}xC.a.mulAssign(a),xC.a.equal(0).discard()}))()}setupDefault(t,e,n){return zE((()=>{const i=KP(t);let r;if(pI(n,(({i:t})=>{r=i.element(t),EP.dot(r.xyz).greaterThan(r.w).discard()})),n<e){const t=vC("bool","clipped");t.assign(!0),pI({start:n,end:e},(({i:e})=>{r=i.element(e),t.assign(EP.dot(r.xyz).greaterThan(r.w).and(t))})),t.discard()}}))()}}YI.ALPHA_TO_COVERAGE="alphaToCoverage",YI.DEFAULT="default";class QI extends jM{static get type(){return"NodeMaterial"}constructor(){super(),this.isNodeMaterial=!0,this.type=this.constructor.type,this.forceSinglePass=!1,this.fog=!0,this.lights=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.positionNode=null,this.depthNode=null,this.shadowNode=null,this.shadowPositionNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null}customProgramCacheKey(){return this.type+OT(this)}build(t){this.setup(t)}setupObserver(t){return new IT(t)}setup(t){let e;t.context.setupNormal=()=>this.setupNormal(t),t.addStack(),t.stack.outputNode=this.vertexNode||this.setupPosition(t),t.addFlow("vertex",t.removeStack()),t.addStack();const n=this.setupClipping(t);if(!0===this.depthWrite&&this.setupDepth(t),null===this.fragmentNode){this.setupDiffuseColor(t),this.setupVariants(t);const i=this.setupLighting(t);null!==n&&t.stack.add(n);const r=iC(i,xC.a).max(0);e=this.setupOutput(t,r),kC.assign(e),null!==this.outputNode&&(e=this.outputNode);if(null!==t.renderer.getRenderTarget()){const n=t.renderer.getMRT(),i=this.mrtNode;null!==n?(e=n,null!==i&&(e=n.merge(i))):null!==i&&(e=i)}}else{let n=this.fragmentNode;!0!==n.isOutputStructNode&&(n=iC(n)),e=this.setupOutput(t,n)}t.stack.outputNode=e,t.addFlow("fragment",t.removeStack()),t.monitor=this.setupObserver(t)}setupClipping(t){if(null===t.clippingContext)return null;const{globalClippingCount:e,localClippingCount:n}=t.clippingContext;let i=null;if(e||n){const e=t.renderer.samples;this.alphaToCoverage&&e>1?i=BE(new YI(YI.ALPHA_TO_COVERAGE)):t.stack.add(BE(new YI))}return i}setupDepth(t){const{renderer:e}=t;let n=this.depthNode;if(null===n){const t=e.getMRT();if(t&&t.has("depth"))n=t.get("depth");else if(!0===e.logarithmicDepthBuffer){n=nI().w.add(1).log2().mul(dP).mul(.5)}}null!==n&&XI.assign(n).append()}setupPosition(t){const{object:e}=t,n=e.geometry;var i;if(t.addStack(),(n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color)&&vI(e).append(),!0===e.isSkinnedMesh&&(i=e,BE(new AI(i,!0))).append(),this.displacementMap){const t=rD("displacementMap","texture"),e=rD("displacementScale","float"),n=rD("displacementBias","float");SP.addAssign(DP.normalize().mul(t.x.mul(e).add(n)))}e.isBatchedMesh&&hI(e).append(),e.instanceMatrix&&!0===e.instanceMatrix.isInstancedBufferAttribute&&lI(e).append(),null!==this.positionNode&&SP.assign(this.positionNode);const r=nI();return t.context.vertex=t.removeStack(),t.context.mvp=r,r}setupDiffuseColor({object:t,geometry:e}){let n=this.colorNode?iC(this.colorNode):xD;if(!0===this.vertexColors&&e.hasAttribute("color")&&(n=iC(n.xyz.mul(nP("color","vec3")),n.a)),t.instanceColor){n=_C("vec3","vInstanceColor").mul(n)}if(t.isBatchedMesh&&t._colorsTexture){n=_C("vec3","vBatchColor").mul(n)}xC.assign(n);const i=this.opacityNode?jE(this.opacityNode):MD;if(xC.a.assign(xC.a.mul(i)),null!==this.alphaTestNode||this.alphaTest>0){const t=null!==this.alphaTestNode?jE(this.alphaTestNode):_D;xC.a.lessThanEqual(t).discard()}!1===this.transparent&&1===this.blending&&!1===this.alphaToCoverage&&xC.a.assign(1)}setupVariants(){}setupOutgoingLight(){return!0===this.lights?JE(0):xC.rgb}setupNormal(){return this.normalNode?JE(this.normalNode):DD}setupEnvironment(){let t=null;return this.envNode?t=this.envNode:this.envMap&&(t=this.envMap.isCubeTexture?rD("envMap","cubeTexture"):rD("envMap","texture")),t}setupLightMap(t){let e=null;return t.material.lightMap&&(e=new CI(KD)),e}setupLights(t){const e=[],n=this.setupEnvironment(t);n&&n.isLightingNode&&e.push(n);const i=this.setupLightMap(t);if(i&&i.isLightingNode&&e.push(i),null!==this.aoNode||t.material.aoMap){const t=null!==this.aoNode?this.aoNode:JD;e.push(new wI(t))}let r=this.lightsNode||t.lightsNode;return e.length>0&&(r=SI([...r.getLights(),...e])),r}setupLightingModel(){}setupLighting(t){const{material:e}=t,{backdropNode:n,backdropAlphaNode:i,emissiveNode:r}=this,s=!0===this.lights||null!==this.lightsNode?this.setupLights(t):null;let a=this.setupOutgoingLight(t);if(s&&s.getScope().getLights().length>0){const e=this.setupLightingModel(t);a=EI(s,e,n,i)}else null!==n&&(a=JE(null!==i?fN(a,n,i):n));return(r&&!0===r.isNode||e.emissive&&!0===e.emissive.isColor)&&(bC.assign(JE(r||SD)),a=a.add(bC)),a}setupOutput(t,e){if(!0===this.fog){const n=t.fogNode;n&&(e=iC(n.mix(e.rgb,n.colorNode),e.a))}return e}setDefaultValues(t){for(const e in t){const n=t[e];void 0===this[e]&&(this[e]=n,n&&n.clone&&(this[e]=n.clone()))}const e=Object.getOwnPropertyDescriptors(t.constructor.prototype);for(const t in e)void 0===Object.getOwnPropertyDescriptor(this.constructor.prototype,t)&&void 0!==e[t].get&&Object.defineProperty(this.constructor.prototype,t,e[t])}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{},nodes:{}});const n=jM.prototype.toJSON.call(this,t),i=FT(this);n.inputNodes={};for(const{property:e,childNode:r}of i)n.inputNodes[e]=r.toJSON(t).uuid;function r(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(e){const e=r(t.textures),i=r(t.images),s=r(t.nodes);e.length>0&&(n.textures=e),i.length>0&&(n.images=i),s.length>0&&(n.nodes=s)}return n}copy(t){return this.lightsNode=t.lightsNode,this.envNode=t.envNode,this.colorNode=t.colorNode,this.normalNode=t.normalNode,this.opacityNode=t.opacityNode,this.backdropNode=t.backdropNode,this.backdropAlphaNode=t.backdropAlphaNode,this.alphaTestNode=t.alphaTestNode,this.positionNode=t.positionNode,this.depthNode=t.depthNode,this.shadowNode=t.shadowNode,this.shadowPositionNode=t.shadowPositionNode,this.outputNode=t.outputNode,this.mrtNode=t.mrtNode,this.fragmentNode=t.fragmentNode,this.vertexNode=t.vertexNode,super.copy(t)}}const $I=new Zw;class ZI extends QI{static get type(){return"LineBasicNodeMaterial"}constructor(t){super(),this.isLineBasicNodeMaterial=!0,this.lights=!1,this.setDefaultValues($I),this.setValues(t)}}const KI=new hT;class JI extends QI{static get type(){return"LineDashedNodeMaterial"}constructor(t){super(),this.isLineDashedNodeMaterial=!0,this.lights=!1,this.setDefaultValues(KI),this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(t)}setupVariants(){const t=this.offsetNode,e=this.dashScaleNode?jE(this.dashScaleNode):YD,n=this.dashSizeNode?jE(this.dashSizeNode):QD,i=this.dashSizeNode?jE(this.dashGapNode):$D;zC.assign(n),qC.assign(i);const r=CN(nP("lineDistance").mul(e));(t?r.add(t):r).mod(zC.add(qC)).greaterThan(zC).discard()}}const tL=new oT;class eL extends QI{static get type(){return"MeshNormalNodeMaterial"}constructor(t){super(),this.lights=!1,this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(tL),this.setValues(t)}setupDiffuseColor(){const t=this.opacityNode?jE(this.opacityNode):MD;xC.assign(iC(BE(UP).mul(.5).add(.5),t))}}class nL extends JT{static get type(){return"EquirectUVNode"}constructor(t=TP){super("vec2"),this.dirNode=t}setup(){const t=this.dirNode,e=t.z.atan2(t.x).mul(1/(2*Math.PI)).add(.5),n=t.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return QE(e,n)}}const iL=FE(nL);class rL extends Uw{constructor(t=1,e={}){super(t,e),this.isCubeRenderTarget=!0}fromEquirectangularTexture(t,e){const n=e.minFilter,i=e.generateMipmaps;e.generateMipmaps=!0,this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const r=new ww(5,5,5),s=iL(TP),a=new QI;a.colorNode=uP(e,s,0),a.side=1,a.blending=0;const o=new Sw(r,a),l=new Ow;l.add(o),e.minFilter===Px&&(e.minFilter=Rx);const u=new Lw(1,10,this),h=t.getMRT();return t.setMRT(null),u.update(t,l),t.setMRT(h),e.minFilter=n,e.currentGenerateMipmaps=i,o.geometry.dispose(),o.material.dispose(),this}}const sL=new WeakMap;class aL extends JT{static get type(){return"CubeMapNode"}constructor(t){super("vec3"),this.envNode=t,this._cubeTexture=null,this._cubeTextureNode=XP();const e=new Bw;e.isRenderTargetTexture=!0,this._defaultTexture=e,this.updateBeforeType=HT}updateBefore(t){const{renderer:e,material:n}=t,i=this.envNode;if(i.isTextureNode||i.isMaterialReferenceNode){const t=i.isTextureNode?i.value:n[i.property];if(t&&t.isTexture){const n=t.mapping;if(n===xx||n===bx){if(sL.has(t)){const e=sL.get(t);lL(e,t.mapping),this._cubeTexture=e}else{const n=t.image;if(function(t){return null!=t&&t.height>0}(n)){const i=new rL(n.height);i.fromEquirectangularTexture(e,t),lL(i.texture,t.mapping),this._cubeTexture=i.texture,sL.set(t,i.texture),t.addEventListener("dispose",oL)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(t){return this.updateBefore(t),this._cubeTextureNode}}function oL(t){const e=t.target;e.removeEventListener("dispose",oL);const n=sL.get(e);void 0!==n&&(sL.delete(e),n.dispose())}function lL(t,e){e===xx?t.mapping=vx:e===bx&&(t.mapping=_x)}const uL=FE(aL);class hL extends MI{static get type(){return"BasicEnvironmentNode"}constructor(t=null){super(),this.envNode=t}setup(t){t.context.environment=uL(this.envNode)}}class cL extends MI{static get type(){return"BasicLightMapNode"}constructor(t=null){super(),this.lightMapNode=t}setup(t){const e=jE(1/Math.PI);t.context.irradianceLightMap=this.lightMapNode.mul(e)}}class AL{start(){}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class dL extends AL{constructor(){super()}indirect(t,e,n){const i=t.ambientOcclusion,r=t.reflectedLight,s=n.context.irradianceLightMap;r.indirectDiffuse.assign(iC(0)),s?r.indirectDiffuse.addAssign(s):r.indirectDiffuse.addAssign(iC(1,1,1,0)),r.indirectDiffuse.mulAssign(i),r.indirectDiffuse.mulAssign(xC.rgb)}finish(t,e,n){const i=n.material,r=t.outgoingLight,s=n.context.environment;if(s)switch(i.combine){case 0:r.rgb.assign(fN(r.rgb,r.rgb.mul(s.rgb),CD.mul(RD)));break;case 1:r.rgb.assign(fN(r.rgb,s.rgb,CD.mul(RD)));break;case 2:r.rgb.addAssign(s.rgb.mul(CD.mul(RD)));break;default:console.warn("THREE.BasicLightingModel: Unsupported .combine value:",i.combine)}}}const pL=new WM;class fL extends QI{static get type(){return"MeshBasicNodeMaterial"}constructor(t){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(pL),this.setValues(t)}setupNormal(){return LP}setupEnvironment(t){const e=super.setupEnvironment(t);return e?new hL(e):null}setupLightMap(t){let e=null;return t.material.lightMap&&(e=new cL(KD)),e}setupOutgoingLight(){return xC.rgb}setupLightingModel(){return new dL}}const mL=zE((({f0:t,f90:e,dotVH:n})=>{const i=n.mul(-5.55473).sub(6.98316).mul(n).exp2();return t.mul(i.oneMinus()).add(e.mul(i))})),gL=zE((t=>t.diffuseColor.mul(1/Math.PI))),yL=zE((({dotNH:t})=>FC.mul(jE(.5)).add(1).mul(jE(1/Math.PI)).mul(t.pow(FC)))),vL=zE((({lightDirection:t})=>{const e=t.add(CP).normalize(),n=UP.dot(e).clamp(),i=CP.dot(e).clamp(),r=mL({f0:UC,f90:1,dotVH:i}),s=jE(.25),a=yL({dotNH:n});return r.mul(s).mul(a)}));class _L extends dL{constructor(t=!0){super(),this.specular=t}direct({lightDirection:t,lightColor:e,reflectedLight:n}){const i=UP.dot(t).clamp().mul(e);n.directDiffuse.addAssign(i.mul(gL({diffuseColor:xC.rgb}))),!0===this.specular&&n.directSpecular.addAssign(i.mul(vL({lightDirection:t})).mul(CD))}indirect({ambientOcclusion:t,irradiance:e,reflectedLight:n}){n.indirectDiffuse.addAssign(e.mul(gL({diffuseColor:xC}))),n.indirectDiffuse.mulAssign(t)}}const xL=new lT;class bL extends QI{static get type(){return"MeshLambertNodeMaterial"}constructor(t){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues(xL),this.setValues(t)}setupEnvironment(t){const e=super.setupEnvironment(t);return e?new hL(e):null}setupLightingModel(){return new _L(!1)}}const SL=new sT;class ML extends QI{static get type(){return"MeshPhongNodeMaterial"}constructor(t){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(SL),this.setValues(t)}setupEnvironment(t){const e=super.setupEnvironment(t);return e?new hL(e):null}setupLightingModel(){return new _L}setupVariants(){const t=(this.shininessNode?jE(this.shininessNode):bD).max(1e-4);FC.assign(t);const e=this.specularNode||wD;UC.assign(e)}copy(t){return this.shininessNode=t.shininessNode,this.specularNode=t.specularNode,super.copy(t)}}const wL=zE((()=>{const t=LP.dFdx().abs().max(LP.dFdy().abs());return t.x.max(t.y).max(t.z)})),TL=zE((t=>{const{roughness:e}=t,n=wL();let i=e.max(.0525);return i=i.add(n),i=i.min(1),i})),EL=zE((({alpha:t,dotNL:e,dotNV:n})=>{const i=t.pow2(),r=e.mul(i.add(i.oneMinus().mul(n.pow2())).sqrt()),s=n.mul(i.add(i.oneMinus().mul(e.pow2())).sqrt());return tR(.5,r.add(s).max(vR))})).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),CL=zE((({alphaT:t,alphaB:e,dotTV:n,dotBV:i,dotTL:r,dotBL:s,dotNV:a,dotNL:o})=>{const l=o.mul(JE(t.mul(n),e.mul(i),a).length()),u=a.mul(JE(t.mul(r),e.mul(s),o).length());return tR(.5,l.add(u)).saturate()})).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),RL=zE((({alpha:t,dotNH:e})=>{const n=t.pow2(),i=e.pow2().mul(n.oneMinus()).oneMinus();return n.div(i.pow2()).mul(1/Math.PI)})).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),NL=jE(1/Math.PI),PL=zE((({alphaT:t,alphaB:e,dotNH:n,dotTH:i,dotBH:r})=>{const s=t.mul(e),a=JE(e.mul(i),t.mul(r),s.mul(n)),o=a.dot(a),l=s.div(o);return NL.mul(s.mul(l.pow2()))})).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),DL=zE((t=>{const{lightDirection:e,f0:n,f90:i,roughness:r,f:s,USE_IRIDESCENCE:a,USE_ANISOTROPY:o}=t,l=t.normalView||UP,u=r.pow2(),h=e.add(CP).normalize(),c=l.dot(e).clamp(),A=l.dot(CP).clamp(),d=l.dot(h).clamp(),p=CP.dot(h).clamp();let f,m,g=mL({f0:n,f90:i,dotVH:p});if(IE(a)&&(g=RC.mix(g,s)),IE(o)){const t=LC.dot(e),n=LC.dot(CP),i=LC.dot(h),r=BC.dot(e),s=BC.dot(CP),a=BC.dot(h);f=CL({alphaT:DC,alphaB:u,dotTV:n,dotBV:s,dotTL:t,dotBL:r,dotNV:A,dotNL:c}),m=PL({alphaT:DC,alphaB:u,dotNH:d,dotTH:i,dotBH:a})}else f=EL({alpha:u,dotNL:c,dotNV:A}),m=RL({alpha:u,dotNH:d});return g.mul(f).mul(m)})),IL=zE((({roughness:t,dotNV:e})=>{const n=iC(-1,-.0275,-.572,.022),i=iC(1,.0425,1.04,-.04),r=t.mul(n).add(i),s=r.x.mul(r.x).min(e.mul(-9.28).exp2()).mul(r.x).add(r.y);return QE(-1.04,1.04).mul(s).add(r.zw)})).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),LL=zE((t=>{const{dotNV:e,specularColor:n,specularF90:i,roughness:r}=t,s=IL({dotNV:e,roughness:r});return n.mul(s.x).add(i.mul(s.y))})),BL=zE((({f:t,f90:e,dotVH:n})=>{const i=n.oneMinus().saturate(),r=i.mul(i),s=i.mul(r,r).clamp(0,.9999);return t.sub(JE(e).mul(s)).div(s.oneMinus())})).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),UL=zE((({roughness:t,dotNH:e})=>{const n=t.pow2(),i=jE(1).div(n),r=e.pow2().oneMinus().max(.0078125);return jE(2).add(i).mul(r.pow(i.mul(.5))).div(2*Math.PI)})).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),OL=zE((({dotNV:t,dotNL:e})=>jE(1).div(jE(4).mul(e.add(t).sub(e.mul(t)))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),FL=zE((({lightDirection:t})=>{const e=t.add(CP).normalize(),n=UP.dot(t).clamp(),i=UP.dot(CP).clamp(),r=UP.dot(e).clamp(),s=UL({roughness:CC,dotNH:r}),a=OL({dotNV:i,dotNL:n});return EC.mul(s).mul(a)})),kL=zE((({N:t,V:e,roughness:n})=>{const i=t.dot(e).saturate(),r=QE(n,i.oneMinus().sqrt());return r.assign(r.mul(.984375).add(.0078125)),r})).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),zL=zE((({f:t})=>{const e=t.length();return nN(e.mul(e).add(t.z).div(e.add(1)),0)})).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),qL=zE((({v1:t,v2:e})=>{const n=t.dot(e),i=n.abs().toVar(),r=i.mul(.0145206).add(.4965155).mul(i).add(.8543985).toVar(),s=i.add(4.1616724).mul(i).add(3.417594).toVar(),a=r.div(s),o=n.greaterThan(0).select(a,nN(n.mul(n).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(a));return t.cross(e).mul(o)})).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),GL=zE((({N:t,V:e,P:n,mInv:i,p0:r,p1:s,p2:a,p3:o})=>{const l=s.sub(r).toVar(),u=o.sub(r).toVar(),h=l.cross(u),c=JE().toVar();return VE(h.dot(n.sub(r)).greaterThanEqual(0),(()=>{const l=e.sub(t.mul(e.dot(t))).normalize(),u=t.cross(l).negate(),h=i.mul(lC(l,u,t).transpose()).toVar(),A=h.mul(r.sub(n)).normalize().toVar(),d=h.mul(s.sub(n)).normalize().toVar(),p=h.mul(a.sub(n)).normalize().toVar(),f=h.mul(o.sub(n)).normalize().toVar(),m=JE(0).toVar();m.addAssign(qL({v1:A,v2:d})),m.addAssign(qL({v1:d,v2:p})),m.addAssign(qL({v1:p,v2:f})),m.addAssign(qL({v1:f,v2:A})),c.assign(JE(zL({f:m})))})),c})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),VL=1/6,HL=t=>JC(VL,JC(t,JC(t,t.negate().add(3)).sub(3)).add(1)),jL=t=>JC(VL,JC(t,JC(t,JC(3,t).sub(6))).add(4)),WL=t=>JC(VL,JC(t,JC(t,JC(-3,t).add(3)).add(3)).add(1)),XL=t=>JC(VL,hN(t,3)),YL=t=>HL(t).add(jL(t)),QL=t=>WL(t).add(XL(t)),$L=t=>ZC(-1,jL(t).div(HL(t).add(jL(t)))),ZL=t=>ZC(1,XL(t).div(WL(t).add(XL(t)))),KL=(t,e,n)=>{const i=t.uvNode,r=JC(i,e.zw).add(.5),s=DR(r),a=BR(r),o=YL(a.x),l=QL(a.x),u=$L(a.x),h=ZL(a.x),c=$L(a.y),A=ZL(a.y),d=QE(s.x.add(u),s.y.add(c)).sub(.5).mul(e.xy),p=QE(s.x.add(h),s.y.add(c)).sub(.5).mul(e.xy),f=QE(s.x.add(u),s.y.add(A)).sub(.5).mul(e.xy),m=QE(s.x.add(h),s.y.add(A)).sub(.5).mul(e.xy),g=YL(a.y).mul(ZC(o.mul(t.uv(d).level(n)),l.mul(t.uv(p).level(n)))),y=QL(a.y).mul(ZC(o.mul(t.uv(f).level(n)),l.mul(t.uv(m).level(n))));return g.add(y)},JL=zE((([t,e=jE(3)])=>{const n=QE(t.size(WE(e))),i=QE(t.size(WE(e.add(1)))),r=tR(1,n),s=tR(1,i),a=KL(t,iC(r,n),DR(e)),o=KL(t,iC(s,i),IR(e));return BR(e).mix(a,o)})),tB=zE((([t,e,n,i,r])=>{const s=JE(gN(e.negate(),LR(t),tR(1,i))),a=JE(HR(r[0].xyz),HR(r[1].xyz),HR(r[2].xyz));return LR(s).mul(n.mul(a))})).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),eB=zE((([t,e])=>t.mul(mN(e.mul(2).sub(2),0,1)))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),nB=FI(),iB=zE((([t,e,n])=>{const i=nB.uv(t),r=RR(jE(II.x)).mul(eB(e,n));return JL(i,r)})),rB=zE((([t,e,n])=>(VE(n.notEqual(0),(()=>{const i=CR(e).negate().div(n);return TR(i.negate().mul(t))})),JE(1)))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),sB=zE((([t,e,n,i,r,s,a,o,l,u,h,c,A,d,p])=>{let f,m;if(p){f=iC().toVar(),m=JE().toVar();const r=h.sub(1).mul(p.mul(.025)),s=JE(h.sub(r),h,h.add(r));pI({start:0,end:3},(({i:r})=>{const h=s.element(r),p=tB(t,e,c,h,o),g=a.add(p),y=u.mul(l.mul(iC(g,1))),v=QE(y.xy.div(y.w)).toVar();v.addAssign(1),v.divAssign(2),v.assign(QE(v.x,v.y.oneMinus()));const _=iB(v,n,h);f.element(r).assign(_.element(r)),f.a.addAssign(_.a),m.element(r).assign(i.element(r).mul(rB(HR(p),A,d).element(r)))})),f.a.divAssign(3)}else{const r=tB(t,e,c,h,o),s=a.add(r),p=u.mul(l.mul(iC(s,1))),g=QE(p.xy.div(p.w)).toVar();g.addAssign(1),g.divAssign(2),g.assign(QE(g.x,g.y.oneMinus())),f=iB(g,n,h),m=i.mul(rB(HR(r),A,d))}const g=m.rgb.mul(f.rgb),y=t.dot(e).clamp(),v=JE(LL({dotNV:y,specularColor:r,specularF90:s,roughness:n})),_=m.r.add(m.g,m.b).div(3);return iC(v.oneMinus().mul(g),f.a.oneMinus().mul(_).oneMinus())})),aB=lC(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),oB=(t,e)=>t.sub(e).div(t.add(e)).pow2(),lB=(t,e)=>{const n=t.mul(2*Math.PI*1e-9),i=JE(54856e-17,44201e-17,52481e-17),r=JE(1681e3,1795300,2208400),s=JE(43278e5,93046e5,66121e5),a=jE(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(n.mul(2239900).add(e.x).cos()).mul(n.pow2().mul(-45282e5).exp());let o=i.mul(s.mul(2*Math.PI).sqrt()).mul(r.mul(n).add(e).cos()).mul(n.pow2().negate().mul(s).exp());o=JE(o.x.add(a),o.y,o.z).div(1.0685e-7);return aB.mul(o)},uB=zE((({outsideIOR:t,eta2:e,cosTheta1:n,thinFilmThickness:i,baseF0:r})=>{const s=fN(t,e,yN(0,.03,i)),a=t.div(s).pow2().mul(jE(1).sub(n.pow2())),o=jE(1).sub(a).sqrt(),l=oB(s,t),u=mL({f0:l,f90:1,dotVH:n}),h=u.oneMinus(),c=s.lessThan(t).select(Math.PI,0),A=jE(Math.PI).sub(c),d=(t=>{const e=t.sqrt();return JE(1).add(e).div(JE(1).sub(e))})(r.clamp(0,.9999)),p=oB(d,s.toVec3()),f=mL({f0:p,f90:1,dotVH:o}),m=JE(d.x.lessThan(s).select(Math.PI,0),d.y.lessThan(s).select(Math.PI,0),d.z.lessThan(s).select(Math.PI,0)),g=s.mul(i,o,2),y=JE(A).add(m),v=u.mul(f).clamp(1e-5,.9999),_=v.sqrt(),x=h.pow2().mul(f).div(JE(1).sub(v));let b=u.add(x),S=x.sub(h);for(let t=1;t<=2;++t){S=S.mul(_);const e=lB(jE(t).mul(g),jE(t).mul(y)).mul(2);b=b.add(S.mul(e))}return b.max(JE(0))})).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),hB=zE((({normal:t,viewDir:e,roughness:n})=>{const i=t.dot(e).saturate(),r=n.pow2(),s=bN(n.lessThan(.25),jE(-339.2).mul(r).add(jE(161.4).mul(n)).sub(25.9),jE(-8.48).mul(r).add(jE(14.3).mul(n)).sub(9.95)),a=bN(n.lessThan(.25),jE(44).mul(r).sub(jE(23.7).mul(n)).add(3.26),jE(1.97).mul(r).sub(jE(3.27).mul(n)).add(.72));return bN(n.lessThan(.25),0,jE(.1).mul(n).sub(.025)).add(s.mul(i).add(a).exp()).mul(1/Math.PI).saturate()})),cB=JE(.04),AB=jE(1);class dB extends AL{constructor(t=!1,e=!1,n=!1,i=!1,r=!1,s=!1){super(),this.clearcoat=t,this.sheen=e,this.iridescence=n,this.anisotropy=i,this.transmission=r,this.dispersion=s,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null}start(t){if(!0===this.clearcoat&&(this.clearcoatRadiance=JE().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=JE().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=JE().toVar("clearcoatSpecularIndirect")),!0===this.sheen&&(this.sheenSpecularDirect=JE().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=JE().toVar("sheenSpecularIndirect")),!0===this.iridescence){const t=UP.dot(CP).clamp();this.iridescenceFresnel=uB({outsideIOR:jE(1),eta2:NC,cosTheta1:t,thinFilmThickness:PC,baseF0:UC}),this.iridescenceF0=BL({f:this.iridescenceFresnel,f90:1,dotVH:t})}if(!0===this.transmission){const e=wP,n=mP.sub(wP).normalize(),i=OP;t.backdrop=sB(i,n,SC,xC,UC,OC,e,vP,fP,pP,GC,HC,WC,jC,this.dispersion?XC:null),t.backdropAlpha=VC,xC.a.mulAssign(fN(1,t.backdrop.a,VC))}}computeMultiscattering(t,e,n){const i=UP.dot(CP).clamp(),r=IL({roughness:SC,dotNV:i}),s=(this.iridescenceF0?RC.mix(UC,this.iridescenceF0):UC).mul(r.x).add(n.mul(r.y)),a=r.x.add(r.y).oneMinus(),o=UC.add(UC.oneMinus().mul(.047619)),l=s.mul(o).div(a.mul(o).oneMinus());t.addAssign(s),e.addAssign(l.mul(a))}direct({lightDirection:t,lightColor:e,reflectedLight:n}){const i=UP.dot(t).clamp().mul(e);if(!0===this.sheen&&this.sheenSpecularDirect.addAssign(i.mul(FL({lightDirection:t}))),!0===this.clearcoat){const n=FP.dot(t).clamp().mul(e);this.clearcoatSpecularDirect.addAssign(n.mul(DL({lightDirection:t,f0:cB,f90:AB,roughness:TC,normalView:FP})))}n.directDiffuse.addAssign(i.mul(gL({diffuseColor:xC.rgb}))),n.directSpecular.addAssign(i.mul(DL({lightDirection:t,f0:UC,f90:1,roughness:SC,iridescence:this.iridescence,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:t,lightPosition:e,halfWidth:n,halfHeight:i,reflectedLight:r,ltc_1:s,ltc_2:a}){const o=e.add(n).sub(i),l=e.sub(n).sub(i),u=e.sub(n).add(i),h=e.add(n).add(i),c=UP,A=CP,d=EP.toVar(),p=kL({N:c,V:A,roughness:SC}),f=s.uv(p).toVar(),m=a.uv(p).toVar(),g=lC(JE(f.x,0,f.y),JE(0,1,0),JE(f.z,0,f.w)).toVar(),y=UC.mul(m.x).add(UC.oneMinus().mul(m.y)).toVar();r.directSpecular.addAssign(t.mul(y).mul(GL({N:c,V:A,P:d,mInv:g,p0:o,p1:l,p2:u,p3:h}))),r.directDiffuse.addAssign(t.mul(xC).mul(GL({N:c,V:A,P:d,mInv:lC(1,0,0,0,1,0,0,0,1),p0:o,p1:l,p2:u,p3:h})))}indirect(t,e,n){this.indirectDiffuse(t,e,n),this.indirectSpecular(t,e,n),this.ambientOcclusion(t,e,n)}indirectDiffuse({irradiance:t,reflectedLight:e}){e.indirectDiffuse.addAssign(t.mul(gL({diffuseColor:xC})))}indirectSpecular({radiance:t,iblIrradiance:e,reflectedLight:n}){if(!0===this.sheen&&this.sheenSpecularIndirect.addAssign(e.mul(EC,hB({normal:UP,viewDir:CP,roughness:CC}))),!0===this.clearcoat){const t=FP.dot(CP).clamp(),e=LL({dotNV:t,specularColor:cB,specularF90:AB,roughness:TC});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(e))}const i=JE().toVar("singleScattering"),r=JE().toVar("multiScattering"),s=e.mul(1/Math.PI);this.computeMultiscattering(i,r,OC);const a=i.add(r),o=xC.mul(a.r.max(a.g).max(a.b).oneMinus());n.indirectSpecular.addAssign(t.mul(i)),n.indirectSpecular.addAssign(r.mul(s)),n.indirectDiffuse.addAssign(o.mul(s))}ambientOcclusion({ambientOcclusion:t,reflectedLight:e}){const n=UP.dot(CP).clamp().add(t),i=SC.mul(-16).oneMinus().negate().exp2(),r=t.sub(n.pow(i).oneMinus()).clamp();!0===this.clearcoat&&this.clearcoatSpecularIndirect.mulAssign(t),!0===this.sheen&&this.sheenSpecularIndirect.mulAssign(t),e.indirectDiffuse.mulAssign(t),e.indirectSpecular.mulAssign(r)}finish(t){const{outgoingLight:e}=t;if(!0===this.clearcoat){const t=FP.dot(CP).clamp(),n=mL({dotVH:t,f0:cB,f90:AB}),i=e.mul(wC.mul(n).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul(wC));e.assign(i)}if(!0===this.sheen){const t=EC.r.max(EC.g).max(EC.b).mul(.157).oneMinus(),n=e.mul(t).add(this.sheenSpecularDirect,this.sheenSpecularIndirect);e.assign(n)}}}const pB=jE(1),fB=jE(-2),mB=jE(.8),gB=jE(-1),yB=jE(.4),vB=jE(2),_B=jE(.305),xB=jE(3),bB=jE(.21),SB=jE(4),MB=jE(4),wB=jE(16),TB=zE((([t])=>{const e=JE(GR(t)).toVar(),n=jE(-1).toVar();return VE(e.x.greaterThan(e.z),(()=>{VE(e.x.greaterThan(e.y),(()=>{n.assign(bN(t.x.greaterThan(0),0,3))})).Else((()=>{n.assign(bN(t.y.greaterThan(0),1,4))}))})).Else((()=>{VE(e.z.greaterThan(e.y),(()=>{n.assign(bN(t.z.greaterThan(0),2,5))})).Else((()=>{n.assign(bN(t.y.greaterThan(0),1,4))}))})),n})).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),EB=zE((([t,e])=>{const n=QE().toVar();return VE(e.equal(0),(()=>{n.assign(QE(t.z,t.y).div(GR(t.x)))})).ElseIf(e.equal(1),(()=>{n.assign(QE(t.x.negate(),t.z.negate()).div(GR(t.y)))})).ElseIf(e.equal(2),(()=>{n.assign(QE(t.x.negate(),t.y).div(GR(t.z)))})).ElseIf(e.equal(3),(()=>{n.assign(QE(t.z.negate(),t.y).div(GR(t.x)))})).ElseIf(e.equal(4),(()=>{n.assign(QE(t.x.negate(),t.z).div(GR(t.y)))})).Else((()=>{n.assign(QE(t.x,t.y).div(GR(t.z)))})),JC(.5,n.add(1))})).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),CB=zE((([t])=>{const e=jE(0).toVar();return VE(t.greaterThanEqual(mB),(()=>{e.assign(pB.sub(t).mul(gB.sub(fB)).div(pB.sub(mB)).add(fB))})).ElseIf(t.greaterThanEqual(yB),(()=>{e.assign(mB.sub(t).mul(vB.sub(gB)).div(mB.sub(yB)).add(gB))})).ElseIf(t.greaterThanEqual(_B),(()=>{e.assign(yB.sub(t).mul(xB.sub(vB)).div(yB.sub(_B)).add(vB))})).ElseIf(t.greaterThanEqual(bB),(()=>{e.assign(_B.sub(t).mul(SB.sub(xB)).div(_B.sub(bB)).add(xB))})).Else((()=>{e.assign(jE(-2).mul(RR(JC(1.16,t))))})),e})).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),RB=zE((([t,e])=>{const n=t.toVar();n.assign(JC(2,n).sub(1));const i=JE(n,1).toVar();return VE(e.equal(0),(()=>{i.assign(i.zyx)})).ElseIf(e.equal(1),(()=>{i.assign(i.xzy),i.xz.mulAssign(-1)})).ElseIf(e.equal(2),(()=>{i.x.mulAssign(-1)})).ElseIf(e.equal(3),(()=>{i.assign(i.zyx),i.xz.mulAssign(-1)})).ElseIf(e.equal(4),(()=>{i.assign(i.xzy),i.xy.mulAssign(-1)})).ElseIf(e.equal(5),(()=>{i.z.mulAssign(-1)})),i})).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),NB=zE((([t,e,n,i,r,s])=>{const a=jE(n),o=JE(e),l=mN(CB(a),fB,s),u=BR(l),h=DR(l),c=JE(PB(t,o,h,i,r,s)).toVar();return VE(u.notEqual(0),(()=>{const e=JE(PB(t,o,h.add(1),i,r,s)).toVar();c.assign(fN(c,e,u))})),c})),PB=zE((([t,e,n,i,r,s])=>{const a=jE(n).toVar(),o=JE(e),l=jE(TB(o)).toVar(),u=jE(nN(MB.sub(a),0)).toVar();a.assign(nN(a,MB));const h=jE(ER(a)).toVar(),c=QE(EB(o,l).mul(h.sub(2)).add(1)).toVar();return VE(l.greaterThan(2),(()=>{c.y.addAssign(h),l.subAssign(3)})),c.x.addAssign(l.mul(h)),c.x.addAssign(u.mul(JC(3,wB))),c.y.addAssign(JC(4,ER(s).sub(h))),c.x.mulAssign(i),c.y.mulAssign(r),t.uv(c).grad(QE(),QE())})),DB=zE((({envMap:t,mipInt:e,outputDirection:n,theta:i,axis:r,CUBEUV_TEXEL_WIDTH:s,CUBEUV_TEXEL_HEIGHT:a,CUBEUV_MAX_MIP:o})=>{const l=OR(i),u=n.mul(l).add(r.cross(n).mul(UR(i))).add(r.mul(r.dot(n).mul(l.oneMinus())));return PB(t,u,e,s,a,o)})),IB=zE((({n:t,latitudinal:e,poleAxis:n,outputDirection:i,weights:r,samples:s,dTheta:a,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:h,CUBEUV_MAX_MIP:c})=>{const A=JE(bN(e,n,uN(n,i))).toVar();VE(xR(A.equals(JE(0))),(()=>{A.assign(JE(i.z,0,i.x.negate()))})),A.assign(LR(A));const d=JE().toVar();return d.addAssign(r.element(WE(0)).mul(DB({theta:0,axis:A,outputDirection:i,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:h,CUBEUV_MAX_MIP:c}))),pI({start:WE(1),end:t},(({i:t})=>{VE(t.greaterThanEqual(s),(()=>{JN("break").append()}));const e=jE(a.mul(jE(t))).toVar();d.addAssign(r.element(t).mul(DB({theta:e.mul(-1),axis:A,outputDirection:i,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:h,CUBEUV_MAX_MIP:c}))),d.addAssign(r.element(t).mul(DB({theta:e,axis:A,outputDirection:i,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:h,CUBEUV_MAX_MIP:c})))})),iC(d,1)}));let LB=null;const BB=new WeakMap;function UB(t){let e=BB.get(t);if((void 0!==e?e.pmremVersion:-1)!==t.pmremVersion){const n=t.image;if(t.isCubeTexture){if(!function(t){if(null==t)return!1;let e=0;const n=6;for(let i=0;i<n;i++)void 0!==t[i]&&e++;return e===n}(n))return null;e=LB.fromCubemap(t,e)}else{if(!function(t){return null!=t&&t.height>0}(n))return null;e=LB.fromEquirectangular(t,e)}e.pmremVersion=t.pmremVersion,BB.set(t,e)}return e.texture}class OB extends JT{static get type(){return"PMREMNode"}constructor(t,e=null,n=null){super("vec3"),this._value=t,this._pmrem=null,this.uvNode=e,this.levelNode=n,this._generator=null;const i=new pS;i.isRenderTargetTexture=!0,this._texture=uP(i),this._width=gC(0),this._height=gC(0),this._maxMip=gC(0),this.updateBeforeType=HT}set value(t){this._value=t,this._pmrem=null}get value(){return this._value}updateFromTexture(t){const e=function(t){const e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),112)),texelHeight:n,maxMip:e}}(t.image.height);this._texture.value=t,this._width.value=e.texelWidth,this._height.value=e.texelHeight,this._maxMip.value=e.maxMip}updateBefore(){let t=this._pmrem;const e=t?t.pmremVersion:-1,n=this._value;e!==n.pmremVersion&&(t=!0===n.isPMREMTexture?n:UB(n),null!==t&&(this._pmrem=t,this.updateFromTexture(t)))}setup(t){null===LB&&(LB=t.createPMREMGenerator()),this.updateBefore(t);let e=this.uvNode;null===e&&t.context.getUV&&(e=t.context.getUV(this));const n=this.value;t.renderer.coordinateSystem===Ub&&!0!==n.isPMREMTexture&&!0===n.isRenderTargetTexture&&(e=JE(e.x.negate(),e.yz));let i=this.levelNode;return null===i&&t.context.getTextureLevel&&(i=t.context.getTextureLevel(this)),NB(this._texture,e,i,this._width,this._height,this._maxMip)}}const FB=FE(OB),kB=new WeakMap;class zB extends MI{static get type(){return"EnvironmentNode"}constructor(t=null){super(),this.envNode=t}setup(t){const{material:e}=t;let n=this.envNode;if(n.isTextureNode||n.isMaterialReferenceNode){const t=n.isTextureNode?n.value:e[n.property];let i=kB.get(t);void 0===i&&(i=FB(t),kB.set(t,i)),n=i}const i=e.envMap?eD("envMapIntensity","float",t.material):eD("environmentIntensity","float",t.scene),r=!0===e.useAnisotropy||e.anisotropy>0?hD:UP,s=n.context(qB(SC,r)).mul(i),a=n.context(GB(OP)).mul(Math.PI).mul(i),o=XN(s),l=XN(a);t.context.radiance.addAssign(o),t.context.iblIrradiance.addAssign(l);const u=t.context.lightingModel.clearcoatRadiance;if(u){const t=n.context(qB(TC,FP)).mul(i),e=XN(t);u.addAssign(e)}}}const qB=(t,e)=>{let n=null;return{getUV:()=>(null===n&&(n=CP.negate().reflect(e),n=t.mul(t).mix(n,e).normalize(),n=n.transformDirection(fP)),n),getTextureLevel:()=>t}},GB=t=>({getUV:()=>t,getTextureLevel:()=>jE(1)}),VB=new iT;class HB extends QI{static get type(){return"MeshStandardNodeMaterial"}constructor(t){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(VB),this.setValues(t)}setupEnvironment(t){let e=super.setupEnvironment(t);return null===e&&t.environmentNode&&(e=t.environmentNode),e?new zB(e):null}setupLightingModel(){return new dB}setupSpecular(){const t=fN(JE(.04),xC.rgb,MC);UC.assign(t),OC.assign(1)}setupVariants(){const t=this.metalnessNode?jE(this.metalnessNode):PD;MC.assign(t);let e=this.roughnessNode?jE(this.roughnessNode):ND;e=TL({roughness:e}),SC.assign(e),this.setupSpecular(),xC.assign(iC(xC.rgb.mul(t.oneMinus()),xC.a))}copy(t){return this.emissiveNode=t.emissiveNode,this.metalnessNode=t.metalnessNode,this.roughnessNode=t.roughnessNode,super.copy(t)}}const jB=new rT;class WB extends HB{static get type(){return"MeshPhysicalNodeMaterial"}constructor(t){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(jB),this.setValues(t)}get useClearcoat(){return this.clearcoat>0||null!==this.clearcoatNode}get useIridescence(){return this.iridescence>0||null!==this.iridescenceNode}get useSheen(){return this.sheen>0||null!==this.sheenNode}get useAnisotropy(){return this.anisotropy>0||null!==this.anisotropyNode}get useTransmission(){return this.transmission>0||null!==this.transmissionNode}get useDispersion(){return this.dispersion>0||null!==this.dispersionNode}setupSpecular(){const t=this.iorNode?jE(this.iorNode):jD;GC.assign(t),UC.assign(fN(eN(cN(GC.sub(1).div(GC.add(1))).mul(ED),JE(1)).mul(TD),xC.rgb,MC)),OC.assign(fN(TD,1,MC))}setupLightingModel(){return new dB(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(t){if(super.setupVariants(t),this.useClearcoat){const t=this.clearcoatNode?jE(this.clearcoatNode):ID,e=this.clearcoatRoughnessNode?jE(this.clearcoatRoughnessNode):LD;wC.assign(t),TC.assign(TL({roughness:e}))}if(this.useSheen){const t=this.sheenNode?JE(this.sheenNode):OD,e=this.sheenRoughnessNode?jE(this.sheenRoughnessNode):FD;EC.assign(t),CC.assign(e)}if(this.useIridescence){const t=this.iridescenceNode?jE(this.iridescenceNode):zD,e=this.iridescenceIORNode?jE(this.iridescenceIORNode):qD,n=this.iridescenceThicknessNode?jE(this.iridescenceThicknessNode):GD;RC.assign(t),NC.assign(e),PC.assign(n)}if(this.useAnisotropy){const t=(this.anisotropyNode?QE(this.anisotropyNode):kD).toVar();IC.assign(t.length()),VE(IC.equal(0),(()=>{t.assign(QE(1,0))})).Else((()=>{t.divAssign(QE(IC)),IC.assign(IC.saturate())})),DC.assign(IC.pow2().mix(SC.pow2(),1)),LC.assign(uD[0].mul(t.x).add(uD[1].mul(t.y))),BC.assign(uD[1].mul(t.x).sub(uD[0].mul(t.y)))}if(this.useTransmission){const t=this.transmissionNode?jE(this.transmissionNode):VD,e=this.thicknessNode?jE(this.thicknessNode):HD,n=this.attenuationDistanceNode?jE(this.attenuationDistanceNode):WD,i=this.attenuationColorNode?JE(this.attenuationColorNode):XD;if(VC.assign(t),HC.assign(e),jC.assign(n),WC.assign(i),this.useDispersion){const t=this.dispersionNode?jE(this.dispersionNode):ZD;XC.assign(t)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?JE(this.clearcoatNormalNode):BD}setup(t){t.context.setupClearcoatNormal=()=>this.setupClearcoatNormal(t),super.setup(t)}copy(t){return this.clearcoatNode=t.clearcoatNode,this.clearcoatRoughnessNode=t.clearcoatRoughnessNode,this.clearcoatNormalNode=t.clearcoatNormalNode,this.sheenNode=t.sheenNode,this.sheenRoughnessNode=t.sheenRoughnessNode,this.iridescenceNode=t.iridescenceNode,this.iridescenceIORNode=t.iridescenceIORNode,this.iridescenceThicknessNode=t.iridescenceThicknessNode,this.specularIntensityNode=t.specularIntensityNode,this.specularColorNode=t.specularColorNode,this.transmissionNode=t.transmissionNode,this.thicknessNode=t.thicknessNode,this.attenuationDistanceNode=t.attenuationDistanceNode,this.attenuationColorNode=t.attenuationColorNode,this.dispersionNode=t.dispersionNode,this.anisotropyNode=t.anisotropyNode,super.copy(t)}}const XB=zE((({normal:t,lightDirection:e,builder:n})=>{const i=t.dot(e),r=QE(i.mul(.5).add(.5),0);if(n.material.gradientMap){const t=rD("gradientMap","texture").context({getUV:()=>r});return JE(t.r)}{const t=r.fwidth().mul(.5);return fN(JE(.7),JE(1),yN(jE(.7).sub(t.x),jE(.7).add(t.x),r.x))}}));class YB extends AL{direct({lightDirection:t,lightColor:e,reflectedLight:n},i,r){const s=XB({normal:PP,lightDirection:t,builder:r}).mul(e);n.directDiffuse.addAssign(s.mul(gL({diffuseColor:xC.rgb})))}indirect({ambientOcclusion:t,irradiance:e,reflectedLight:n}){n.indirectDiffuse.addAssign(e.mul(gL({diffuseColor:xC}))),n.indirectDiffuse.mulAssign(t)}}const QB=new aT;class $B extends QI{static get type(){return"MeshToonNodeMaterial"}constructor(t){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(QB),this.setValues(t)}setupLightingModel(){return new YB}}class ZB extends JT{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const t=JE(CP.z,0,CP.x.negate()).normalize(),e=CP.cross(t);return QE(t.dot(UP),e.dot(UP)).mul(.495).add(.5)}}const KB=kE(ZB),JB=new uT;class tU extends QI{static get type(){return"MeshMatcapNodeMaterial"}constructor(t){super(),this.lights=!1,this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(JB),this.setValues(t)}setupVariants(t){const e=KB;let n;n=t.material.matcap?rD("matcap","texture").context({getUV:()=>e}):JE(fN(.2,.8,e.y)),xC.rgb.mulAssign(n.rgb)}}const eU=new Kw;class nU extends QI{static get type(){return"PointsNodeMaterial"}constructor(t){super(),this.isPointsNodeMaterial=!0,this.lights=!1,this.transparent=!0,this.sizeNode=null,this.setDefaultValues(eU),this.setValues(t)}copy(t){return this.sizeNode=t.sizeNode,super.copy(t)}}class iU extends JT{static get type(){return"RotateNode"}constructor(t,e){super(),this.positionNode=t,this.rotationNode=e}getNodeType(t){return this.positionNode.getNodeType(t)}setup(t){const{rotationNode:e,positionNode:n}=this;if("vec2"===this.getNodeType(t)){const t=e.cos(),i=e.sin();return oC(t,i,i.negate(),t).mul(n)}{const t=e,i=uC(iC(1,0,0,0),iC(0,OR(t.x),UR(t.x).negate(),0),iC(0,UR(t.x),OR(t.x),0),iC(0,0,0,1)),r=uC(iC(OR(t.y),0,UR(t.y),0),iC(0,1,0,0),iC(UR(t.y).negate(),0,OR(t.y),0),iC(0,0,0,1)),s=uC(iC(OR(t.z),UR(t.z).negate(),0,0),iC(UR(t.z),OR(t.z),0,0),iC(0,0,1,0),iC(0,0,0,1));return i.mul(r).mul(s).mul(iC(n,1)).xyz}}}const rU=FE(iU),sU=new qw;class aU extends QI{static get type(){return"SpriteNodeMaterial"}constructor(t){super(),this.isSpriteNodeMaterial=!0,this.lights=!1,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.setDefaultValues(sU),this.setValues(t)}setupPosition({object:t,camera:e,context:n}){const i=this.sizeAttenuation,{positionNode:r,rotationNode:s,scaleNode:a}=this,o=SP;let l=xP.mul(JE(r||0)),u=QE(vP[0].xyz.length(),vP[1].xyz.length());null!==a&&(u=u.mul(a)),!i&&e.isPerspectiveCamera&&(u=u.mul(l.z.negate()));let h=o.xy;if(t.center&&!0===t.center.isVector2){const t=((t,e,n)=>BE(new UN(t,e,n)))("center","vec2");h=h.sub(t.sub(.5))}h=h.mul(u);const c=jE(s||UD),A=rU(h,c);l=iC(l.xy.add(A),l.zw);const d=pP.mul(l);return n.vertex=o,d}copy(t){return this.positionNode=t.positionNode,this.rotationNode=t.rotationNode,this.scaleNode=t.scaleNode,super.copy(t)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(t){this._useSizeAttenuation!==t&&(this._useSizeAttenuation=t,this.needsUpdate=!0)}}class oU extends AL{constructor(){super(),this.shadowNode=jE(1).toVar("shadowMask")}direct({shadowMask:t}){this.shadowNode.mulAssign(t)}finish(t){xC.a.mulAssign(this.shadowNode.oneMinus()),t.outgoingLight.rgb.assign(xC.rgb)}}const lU=new nT;class uU extends QI{static get type(){return"ShadowNodeMaterial"}constructor(t){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.setDefaultValues(lU),this.setValues(t)}setupLightingModel(){return new oU}}zE((({texture:t,uv:e})=>{const n=1e-4,i=JE().toVar();return VE(e.x.lessThan(n),(()=>{i.assign(JE(1,0,0))})).ElseIf(e.y.lessThan(n),(()=>{i.assign(JE(0,1,0))})).ElseIf(e.z.lessThan(n),(()=>{i.assign(JE(0,0,1))})).ElseIf(e.x.greaterThan(.9999),(()=>{i.assign(JE(-1,0,0))})).ElseIf(e.y.greaterThan(.9999),(()=>{i.assign(JE(0,-1,0))})).ElseIf(e.z.greaterThan(.9999),(()=>{i.assign(JE(0,0,-1))})).Else((()=>{const n=.01,r=t.uv(e.add(JE(-.01,0,0))).r.sub(t.uv(e.add(JE(n,0,0))).r),s=t.uv(e.add(JE(0,-.01,0))).r.sub(t.uv(e.add(JE(0,n,0))).r),a=t.uv(e.add(JE(0,0,-.01))).r.sub(t.uv(e.add(JE(0,0,n))).r);i.assign(JE(r,s,a))})),i.normalize()}));class hU{constructor(t,e){this.nodes=t,this.info=e,this.animationLoop=null,this.requestId=null,this._init()}_init(){const t=(e,n)=>{this.requestId=self.requestAnimationFrame(t),!0===this.info.autoReset&&this.info.reset(),this.nodes.nodeFrame.update(),this.info.frame=this.nodes.nodeFrame.frameId,null!==this.animationLoop&&this.animationLoop(e,n)};t()}dispose(){self.cancelAnimationFrame(this.requestId),this.requestId=null}setAnimationLoop(t){this.animationLoop=t}}class cU{constructor(){this.weakMap=new WeakMap}get(t){let e=this.weakMap;for(let n=0;n<t.length;n++)if(e=e.get(t[n]),void 0===e)return;return e.get(t[t.length-1])}set(t,e){let n=this.weakMap;for(let e=0;e<t.length;e++){const i=t[e];!1===n.has(i)&&n.set(i,new WeakMap),n=n.get(i)}return n.set(t[t.length-1],e)}delete(t){let e=this.weakMap;for(let n=0;n<t.length;n++)if(e=e.get(t[n]),void 0===e)return!1;return e.delete(t[t.length-1])}}const AU=new Xw;class dU{constructor(){this.version=0,this.globalClippingCount=0,this.localClippingCount=0,this.localClippingEnabled=!1,this.localClipIntersection=!1,this.planes=[],this.parentVersion=0,this.viewNormalMatrix=new Zb,this.cacheKey=0}projectPlanes(t,e){const n=t.length,i=this.planes;for(let r=0;r<n;r++){AU.copy(t[r]).applyMatrix4(this.viewMatrix,this.viewNormalMatrix);const n=i[e+r],s=AU.normal;n.x=-s.x,n.y=-s.y,n.z=-s.z,n.w=AU.constant}}updateGlobal(t,e){const n=t.clippingPlanes;this.viewMatrix=e.matrixWorldInverse,this.viewNormalMatrix.getNormalMatrix(this.viewMatrix);let i=!1;if(Array.isArray(n)&&0!==n.length){const t=n.length;if(t!==this.globalClippingCount){const e=[];for(let n=0;n<t;n++)e.push(new fS);this.globalClippingCount=t,this.planes=e,i=!0}this.projectPlanes(n,0)}else 0!==this.globalClippingCount&&(this.globalClippingCount=0,this.planes=[],i=!0);t.localClippingEnabled!==this.localClippingEnabled&&(this.localClippingEnabled=t.localClippingEnabled,i=!0),i&&(this.version++,this.cacheKey=UT(this.globalClippingCount,!0===this.localClippingEnabled?1:0))}update(t,e){let n=!1;if(this!==t&&t.version!==this.parentVersion&&(this.globalClippingCount=e.isShadowNodeMaterial?0:t.globalClippingCount,this.localClippingEnabled=t.localClippingEnabled,this.planes=Array.from(t.planes),this.parentVersion=t.version,this.viewMatrix=t.viewMatrix,this.viewNormalMatrix=t.viewNormalMatrix,n=!0),this.localClippingEnabled){const t=e.clippingPlanes;if(Array.isArray(t)&&0!==t.length){const e=t.length,i=this.planes,r=this.globalClippingCount;if(n||e!==this.localClippingCount){i.length=r+e;for(let t=0;t<e;t++)i[r+t]=new fS;this.localClippingCount=e,n=!0}this.projectPlanes(t,r)}else 0!==this.localClippingCount&&(this.localClippingCount=0,n=!0);this.localClipIntersection!==e.clipIntersection&&(this.localClipIntersection=e.clipIntersection,n=!0)}n&&(this.version+=t.version,this.cacheKey=UT(t.cacheKey,this.localClippingCount,!0===this.localClipIntersection?1:0))}}let pU=0;class fU{constructor(t,e,n,i,r,s,a,o,l){this._nodes=t,this._geometries=e,this.id=pU++,this.renderer=n,this.object=i,this.material=r,this.scene=s,this.camera=a,this.lightsNode=o,this.context=l,this.geometry=i.geometry,this.version=r.version,this.drawRange=null,this.attributes=null,this.pipeline=null,this.vertexBuffers=null,this.drawParams=null,this.bundle=null,this.updateClipping(l.clippingContext),this.clippingContextVersion=this.clippingContext.version,this.initialNodesCacheKey=this.getDynamicCacheKey(),this.initialCacheKey=this.getCacheKey(),this._nodeBuilderState=null,this._bindings=null,this._monitor=null,this.onDispose=null,this.isRenderObject=!0,this.onMaterialDispose=()=>{this.dispose()},this.material.addEventListener("dispose",this.onMaterialDispose)}updateClipping(t){const e=this.material;let n=this.clippingContext;Array.isArray(e.clippingPlanes)?(n!==t&&n||(n=new dU,this.clippingContext=n),n.update(t,e)):this.clippingContext!==t&&(this.clippingContext=t)}get clippingNeedsUpdate(){return this.clippingContext.version!==this.clippingContextVersion&&(this.clippingContextVersion=this.clippingContext.version,!0)}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().monitor)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getIndex(){return this._geometries.getIndex(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}getAttributes(){if(null!==this.attributes)return this.attributes;const t=this.getNodeBuilderState().nodeAttributes,e=this.geometry,n=[],i=new Set;for(const r of t){const t=r.node&&r.node.attribute?r.node.attribute:e.getAttribute(r.name);if(void 0===t)continue;n.push(t);const s=t.isInterleavedBufferAttribute?t.data:t;i.add(s)}return this.attributes=n,this.vertexBuffers=Array.from(i.values()),n}getVertexBuffers(){return null===this.vertexBuffers&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:t,material:e,geometry:n,group:i,drawRange:r}=this,s=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),a=this.getIndex(),o=null!==a,l=n.isInstancedBufferGeometry?n.instanceCount:t.count>1?t.count:1;if(0===l)return null;if(s.instanceCount=l,!0===t.isBatchedMesh)return s;let u=1;!0!==e.wireframe||t.isPoints||t.isLineSegments||t.isLine||t.isLineLoop||(u=2);let h=r.start*u,c=(r.start+r.count)*u;null!==i&&(h=Math.max(h,i.start*u),c=Math.min(c,(i.start+i.count)*u));const A=!0===o?a.count:n.attributes.position.count;h=Math.max(h,0),c=Math.min(c,A);const d=c-h;return d<0||d===1/0?null:(s.vertexCount=d,s.firstVertex=h,s)}getGeometryCacheKey(){const{geometry:t}=this;let e="";for(const n of Object.keys(t.attributes).sort()){const i=t.attributes[n];e+=n+",",i.data&&(e+=i.data.stride+","),i.offset&&(e+=i.offset+","),i.itemSize&&(e+=i.itemSize+","),i.normalized&&(e+="n,")}return t.index&&(e+="index,"),e}getMaterialCacheKey(){const{object:t,material:e}=this;let n=e.customProgramCacheKey();for(const t of function(t){const e=Object.keys(t);let n=Object.getPrototypeOf(t);for(;n;){const t=Object.getOwnPropertyDescriptors(n);for(const n in t)if(void 0!==t[n]){const i=t[n];i&&"function"==typeof i.get&&e.push(n)}n=Object.getPrototypeOf(n)}return e}(e)){if(/^(is[A-Z]|_)|^(visible|version|uuid|name|opacity|userData)$/.test(t))continue;const i=e[t];let r;if(null!==i){const t=typeof i;"number"===t?r=0!==i?"1":"0":"object"===t?(r="{",i.isTexture&&(r+=i.mapping),r+="}"):r=String(i)}else r=String(i);n+=r+","}return n+=this.clippingContext.cacheKey+",",t.geometry&&(n+=this.getGeometryCacheKey()),t.skeleton&&(n+=t.skeleton.bones.length+","),t.morphTargetInfluences&&(n+=t.morphTargetInfluences.length+","),t.isBatchedMesh&&(n+=t._matricesTexture.uuid+",",null!==t._colorsTexture&&(n+=t._colorsTexture.uuid+",")),t.count>1&&(n+=t.uuid+","),LT(n)}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let t=this._nodes.getCacheKey(this.scene,this.lightsNode);return this.object.receiveShadow&&(t+=1),t}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.onDispose()}}const mU=[];class gU{constructor(t,e,n,i,r,s){this.renderer=t,this.nodes=e,this.geometries=n,this.pipelines=i,this.bindings=r,this.info=s,this.chainMaps={}}get(t,e,n,i,r,s,a){const o=this.getChainMap(a);mU[0]=t,mU[1]=e,mU[2]=s,mU[3]=r;let l=o.get(mU);return void 0===l?(l=this.createRenderObject(this.nodes,this.geometries,this.renderer,t,e,n,i,r,s,a),o.set(mU,l)):(l.updateClipping(s.clippingContext),(l.version!==e.version||l.needsUpdate)&&(l.initialCacheKey!==l.getCacheKey()?(l.dispose(),l=this.get(t,e,n,i,r,s,a)):l.version=e.version)),l}getChainMap(t="default"){return this.chainMaps[t]||(this.chainMaps[t]=new cU)}dispose(){this.chainMaps={}}createRenderObject(t,e,n,i,r,s,a,o,l,u){const h=this.getChainMap(u),c=new fU(t,e,n,i,r,s,a,o,l);return c.onDispose=()=>{this.pipelines.delete(c),this.bindings.delete(c),this.nodes.delete(c),h.delete(c.getChainArray())},c}}class yU{constructor(){this.data=new WeakMap}get(t){let e=this.data.get(t);return void 0===e&&(e={},this.data.set(t,e)),e}delete(t){let e;return this.data.has(t)&&(e=this.data.get(t),this.data.delete(t)),e}has(t){return this.data.has(t)}dispose(){this.data=new WeakMap}}const vU=1,_U=2,xU=4,bU=16;class SU extends yU{constructor(t){super(),this.backend=t}delete(t){const e=super.delete(t);return void 0!==e&&this.backend.destroyAttribute(t),e}update(t,e){const n=this.get(t);if(void 0===n.version)e===vU?this.backend.createAttribute(t):e===_U?this.backend.createIndexAttribute(t):e===xU&&this.backend.createStorageAttribute(t),n.version=this._getBufferAttribute(t).version;else{const e=this._getBufferAttribute(t);(n.version<e.version||e.usage===Bb)&&(this.backend.updateAttribute(t),n.version=e.version)}}_getBufferAttribute(t){return t.isInterleavedBufferAttribute&&(t=t.data),t}}function MU(t){return null!==t.index?t.index.version:t.attributes.position.version}function wU(t){const e=[],n=t.index,i=t.attributes.position;if(null!==n){const t=n.array;for(let n=0,i=t.length;n<i;n+=3){const i=t[n+0],r=t[n+1],s=t[n+2];e.push(i,r,r,s,s,i)}}else{for(let t=0,n=i.array.length/3-1;t<n;t+=3){const n=t+0,i=t+1,r=t+2;e.push(n,i,i,r,r,n)}}const r=new(function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(e)?ew:tw)(e,1);return r.version=MU(t),r}class TU extends yU{constructor(t,e){super(),this.attributes=t,this.info=e,this.wireframes=new WeakMap,this.attributeCall=new WeakMap}has(t){const e=t.geometry;return super.has(e)&&!0===this.get(e).initialized}updateForRender(t){!1===this.has(t)&&this.initGeometry(t),this.updateAttributes(t)}initGeometry(t){const e=t.geometry;this.get(e).initialized=!0,this.info.memory.geometries++;const n=()=>{this.info.memory.geometries--;const i=e.index,r=t.getAttributes();null!==i&&this.attributes.delete(i);for(const t of r)this.attributes.delete(t);const s=this.wireframes.get(e);void 0!==s&&this.attributes.delete(s),e.removeEventListener("dispose",n)};e.addEventListener("dispose",n)}updateAttributes(t){const e=t.getAttributes();for(const t of e)t.isStorageBufferAttribute||t.isStorageInstancedBufferAttribute?this.updateAttribute(t,xU):this.updateAttribute(t,vU);const n=this.getIndex(t);null!==n&&this.updateAttribute(n,_U)}updateAttribute(t,e){const n=this.info.render.calls;t.isInterleavedBufferAttribute?void 0===this.attributeCall.get(t)?(this.attributes.update(t,e),this.attributeCall.set(t,n)):this.attributeCall.get(t.data)!==n&&(this.attributes.update(t,e),this.attributeCall.set(t.data,n),this.attributeCall.set(t,n)):this.attributeCall.get(t)!==n&&(this.attributes.update(t,e),this.attributeCall.set(t,n))}getIndex(t){const{geometry:e,material:n}=t;let i=e.index;if(!0===n.wireframe){const t=this.wireframes;let n=t.get(e);void 0===n?(n=wU(e),t.set(e,n)):n.version!==MU(e)&&(this.attributes.delete(n),n=wU(e),t.set(e,n)),i=n}return i}}class EU{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0,previousFrameCalls:0,timestampCalls:0},this.compute={calls:0,frameCalls:0,timestamp:0,previousFrameCalls:0,timestampCalls:0},this.memory={geometries:0,textures:0}}update(t,e,n){this.render.drawCalls++,t.isMesh||t.isSprite?this.render.triangles+=n*(e/3):t.isPoints?this.render.points+=n*e:t.isLineSegments?this.render.lines+=n*(e/2):t.isLine?this.render.lines+=n*(e-1):console.error("THREE.WebGPUInfo: Unknown object type.")}updateTimestamp(t,e){0===this[t].timestampCalls&&(this[t].timestamp=0),this[t].timestamp+=e,this[t].timestampCalls++,this[t].timestampCalls>=this[t].previousFrameCalls&&(this[t].timestampCalls=0)}reset(){const t=this.render.frameCalls;this.render.previousFrameCalls=t;const e=this.compute.frameCalls;this.compute.previousFrameCalls=e,this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0,this.memory.geometries=0,this.memory.textures=0}}class CU{constructor(t){this.cacheKey=t,this.usedTimes=0}}class RU extends CU{constructor(t,e,n){super(t),this.vertexProgram=e,this.fragmentProgram=n}}class NU extends CU{constructor(t,e){super(t),this.computeProgram=e,this.isComputePipeline=!0}}let PU=0;class DU{constructor(t,e,n=null,i=null){this.id=PU++,this.code=t,this.stage=e,this.transforms=n,this.attributes=i,this.usedTimes=0}}class IU extends yU{constructor(t,e){super(),this.backend=t,this.nodes=e,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(t,e){const{backend:n}=this,i=this.get(t);if(this._needsComputeUpdate(t)){const r=i.pipeline;r&&(r.usedTimes--,r.computeProgram.usedTimes--);const s=this.nodes.getForCompute(t);let a=this.programs.compute.get(s.computeShader);void 0===a&&(r&&0===r.computeProgram.usedTimes&&this._releaseProgram(r.computeProgram),a=new DU(s.computeShader,"compute",s.transforms,s.nodeAttributes),this.programs.compute.set(s.computeShader,a),n.createProgram(a));const o=this._getComputeCacheKey(t,a);let l=this.caches.get(o);void 0===l&&(r&&0===r.usedTimes&&this._releasePipeline(r),l=this._getComputePipeline(t,a,o,e)),l.usedTimes++,a.usedTimes++,i.version=t.version,i.pipeline=l}return i.pipeline}getForRender(t,e=null){const{backend:n}=this,i=this.get(t);if(this._needsRenderUpdate(t)){const r=i.pipeline;r&&(r.usedTimes--,r.vertexProgram.usedTimes--,r.fragmentProgram.usedTimes--);const s=t.getNodeBuilderState();let a=this.programs.vertex.get(s.vertexShader);void 0===a&&(r&&0===r.vertexProgram.usedTimes&&this._releaseProgram(r.vertexProgram),a=new DU(s.vertexShader,"vertex"),this.programs.vertex.set(s.vertexShader,a),n.createProgram(a));let o=this.programs.fragment.get(s.fragmentShader);void 0===o&&(r&&0===r.fragmentProgram.usedTimes&&this._releaseProgram(r.fragmentProgram),o=new DU(s.fragmentShader,"fragment"),this.programs.fragment.set(s.fragmentShader,o),n.createProgram(o));const l=this._getRenderCacheKey(t,a,o);let u=this.caches.get(l);void 0===u?(r&&0===r.usedTimes&&this._releasePipeline(r),u=this._getRenderPipeline(t,a,o,l,e)):t.pipeline=u,u.usedTimes++,a.usedTimes++,o.usedTimes++,i.pipeline=u}return i.pipeline}delete(t){const e=this.get(t).pipeline;return e&&(e.usedTimes--,0===e.usedTimes&&this._releasePipeline(e),e.isComputePipeline?(e.computeProgram.usedTimes--,0===e.computeProgram.usedTimes&&this._releaseProgram(e.computeProgram)):(e.fragmentProgram.usedTimes--,e.vertexProgram.usedTimes--,0===e.vertexProgram.usedTimes&&this._releaseProgram(e.vertexProgram),0===e.fragmentProgram.usedTimes&&this._releaseProgram(e.fragmentProgram))),super.delete(t)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(t){this.getForRender(t)}_getComputePipeline(t,e,n,i){n=n||this._getComputeCacheKey(t,e);let r=this.caches.get(n);return void 0===r&&(r=new NU(n,e),this.caches.set(n,r),this.backend.createComputePipeline(r,i)),r}_getRenderPipeline(t,e,n,i,r){i=i||this._getRenderCacheKey(t,e,n);let s=this.caches.get(i);return void 0===s&&(s=new RU(i,e,n),this.caches.set(i,s),t.pipeline=s,this.backend.createRenderPipeline(t,r)),s}_getComputeCacheKey(t,e){return t.id+","+e.id}_getRenderCacheKey(t,e,n){return e.id+","+n.id+","+this.backend.getRenderCacheKey(t)}_releasePipeline(t){this.caches.delete(t.cacheKey)}_releaseProgram(t){const e=t.code,n=t.stage;this.programs[n].delete(e)}_needsComputeUpdate(t){const e=this.get(t);return void 0===e.pipeline||e.version!==t.version}_needsRenderUpdate(t){return void 0===this.get(t).pipeline||this.backend.needsRenderUpdate(t)}}class LU extends yU{constructor(t,e,n,i,r,s){super(),this.backend=t,this.textures=n,this.pipelines=r,this.attributes=i,this.nodes=e,this.info=s,this.pipelines.bindings=this}getForRender(t){const e=t.getBindings();for(const t of e){const n=this.get(t);void 0===n.bindGroup&&(this._init(t),this.backend.createBindings(t,e),n.bindGroup=t)}return e}getForCompute(t){const e=this.nodes.getForCompute(t).bindings;for(const t of e){const n=this.get(t);void 0===n.bindGroup&&(this._init(t),this.backend.createBindings(t,e),n.bindGroup=t)}return e}updateForCompute(t){this._updateBindings(this.getForCompute(t))}updateForRender(t){this._updateBindings(this.getForRender(t))}_updateBindings(t){for(const e of t)this._update(e,t)}_init(t){for(const e of t.bindings)if(e.isSampledTexture)this.textures.updateTexture(e.texture);else if(e.isStorageBuffer){const t=e.attribute;this.attributes.update(t,xU)}}_update(t,e){const{backend:n}=this;let i=!1;for(const e of t.bindings){if(e.isNodeUniformsGroup){if(!this.nodes.updateGroup(e))continue}if(e.isUniformBuffer){e.update()&&n.updateBinding(e)}else if(e.isSampler)e.update();else if(e.isSampledTexture){e.needsBindingsUpdate(this.textures.get(e.texture).generation)&&(i=!0);const t=e.update(),r=e.texture;t&&this.textures.updateTexture(r);const s=n.get(r);if(!0===n.isWebGPUBackend&&void 0===s.texture&&void 0===s.externalTexture&&(console.error("Bindings._update: binding should be available:",e,t,r,e.textureNode.value,i),this.textures.updateTexture(r),i=!0),!0===r.isStorageTexture){const t=this.get(r);!0===e.store?t.needsMipmap=!0:!0===r.generateMipmaps&&this.textures.needsMipmaps(r)&&!0===t.needsMipmap&&(this.backend.generateMipmaps(r),t.needsMipmap=!1)}}}!0===i&&this.backend.updateBindings(t,e)}}class BU{constructor(t,e,n=null){this.isNodeAttribute=!0,this.name=t,this.type=e,this.node=n}}class UU{constructor(t,e,n){this.isNodeUniform=!0,this.name=t,this.type=e,this.node=n.getSelf()}get value(){return this.node.value}set value(t){this.node.value=t}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}class OU{constructor(t,e){this.isNodeVar=!0,this.name=t,this.type=e}}class FU extends OU{constructor(t,e){super(t,e),this.needsInterpolation=!1,this.isNodeVarying=!0}}class kU{constructor(t,e,n=""){this.name=t,this.type=e,this.code=n,Object.defineProperty(this,"isNodeCode",{value:!0})}}let zU=0;class qU{constructor(t=null){this.id=zU++,this.nodesData=new WeakMap,this.parent=t}getData(t){let e=this.nodesData.get(t);return void 0===e&&null!==this.parent&&(e=this.parent.getData(t)),e}setData(t,e){this.nodesData.set(t,e)}}class GU extends yC{static get type(){return"ParameterNode"}constructor(t,e=null){super(t,e),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}class VU extends $T{static get type(){return"CodeNode"}constructor(t="",e=[],n=""){super("code"),this.isCodeNode=!0,this.code=t,this.language=n,this.includes=e}isGlobal(){return!0}setIncludes(t){return this.includes=t,this}getIncludes(){return this.includes}generate(t){const e=this.getIncludes(t);for(const n of e)n.build(t);const n=t.getCodeFromNode(this,this.getNodeType(t));return n.code=this.code,n.code}serialize(t){super.serialize(t),t.code=this.code,t.language=this.language}deserialize(t){super.deserialize(t),this.code=t.code,this.language=t.language}}class HU extends VU{static get type(){return"FunctionNode"}constructor(t="",e=[],n=""){super(t,e,n)}getNodeType(t){return this.getNodeFunction(t).type}getInputs(t){return this.getNodeFunction(t).inputs}getNodeFunction(t){const e=t.getDataFromNode(this);let n=e.nodeFunction;return void 0===n&&(n=t.parser.parseFunction(this.code),e.nodeFunction=n),n}generate(t,e){super.generate(t);const n=this.getNodeFunction(t),i=n.name,r=n.type,s=t.getCodeFromNode(this,r);""!==i&&(s.name=i);const a=t.getPropertyName(s),o=this.getNodeFunction(t).getCode(a);return s.code=o+"\n","property"===e?a:t.format(`${a}()`,r,e)}}class jU{constructor(t,e){this.name=t,this.value=e,this.boundary=0,this.itemSize=0,this.offset=0}setValue(t){this.value=t}getValue(){return this.value}}class WU extends jU{constructor(t,e=0){super(t,e),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class XU extends jU{constructor(t,e=new $b){super(t,e),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class YU extends jU{constructor(t,e=new _S){super(t,e),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class QU extends jU{constructor(t,e=new fS){super(t,e),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class $U extends jU{constructor(t,e=new GM){super(t,e),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class ZU extends jU{constructor(t,e=new Zb){super(t,e),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class KU extends jU{constructor(t,e=new $S){super(t,e),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class JU extends WU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class tO extends XU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class eO extends YU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class nO extends QU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class iO extends $U{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class rO extends ZU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class sO extends KU{constructor(t){super(t.name,t.value),this.nodeUniform=t}getValue(){return this.nodeUniform.value}}class aO extends $T{static get type(){return"StackNode"}constructor(t=null){super(),this.nodes=[],this.outputNode=null,this.parent=t,this._currentCond=null,this.isStackNode=!0}getNodeType(t){return this.outputNode?this.outputNode.getNodeType(t):"void"}add(t){return this.nodes.push(t),this}If(t,e){const n=new LE(e);return this._currentCond=bN(t,n),this.add(this._currentCond)}ElseIf(t,e){const n=new LE(e),i=bN(t,n);return this._currentCond.elseNode=i,this._currentCond=i,this}Else(t){return this._currentCond.elseNode=new LE(t),this}build(t,...e){const n=GE();qE(this);for(const e of this.nodes)e.build(t,"void");return qE(n),this.outputNode?this.outputNode.build(t,...e):super.build(t,...e)}else(...t){return console.warn("TSL.StackNode: .else() has been renamed to .Else()."),this.Else(...t)}elseif(...t){return console.warn("TSL.StackNode: .elseif() has been renamed to .ElseIf()."),this.ElseIf(...t)}}const oO=FE(aO),lO=[.125,.215,.35,.446,.526,.582],uO=20,hO=new MT(-1,1,1,-1,0,1),cO=new Dw(90,1),AO=new GM;let dO=null,pO=0,fO=0;const mO=(1+Math.sqrt(5))/2,gO=1/mO,yO=[new _S(-mO,gO,0),new _S(mO,gO,0),new _S(-gO,0,mO),new _S(gO,0,mO),new _S(0,mO,-gO),new _S(0,mO,gO),new _S(-1,1,-1),new _S(1,1,-1),new _S(-1,1,1),new _S(1,1,1)],vO=[3,1,5,0,4,2],_O=RB(iP(),nP("faceIndex")).normalize(),xO=JE(_O.x,_O.y.negate(),_O.z);class bO{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}fromScene(t,e=0,n=.1,i=100){dO=this._renderer.getRenderTarget(),pO=this._renderer.getActiveCubeFace(),fO=this._renderer.getActiveMipmapLevel(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}async compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=TO(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=EO(),await this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(dO,pO,fO),t.scissorTest=!1,MO(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===vx||t.mapping===_x?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),dO=this._renderer.getRenderTarget(),pO=this._renderer.getActiveCubeFace(),fO=this._renderer.getActiveMipmapLevel();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:Rx,minFilter:Rx,generateMipmaps:!1,type:kx,format:Gx,colorSpace:vb},i=SO(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=SO(t,e,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas,lodMeshes:this._lodMeshes}=function(t){const e=[],n=[],i=[],r=[];let s=t;const a=t-4+1+lO.length;for(let o=0;o<a;o++){const a=Math.pow(2,s);n.push(a);let l=1/a;o>t-4?l=lO[o-t+4-1]:0===o&&(l=0),i.push(l);const u=1/(a-2),h=-u,c=1+u,A=[h,h,c,h,c,c,h,h,c,c,h,c],d=6,p=6,f=3,m=2,g=1,y=new Float32Array(f*p*d),v=new Float32Array(m*p*d),_=new Float32Array(g*p*d);for(let t=0;t<d;t++){const e=t%3*2/3-1,n=t>2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0],r=vO[t];y.set(i,f*p*r),v.set(A,m*p*r);const s=[r,r,r,r,r,r];_.set(s,g*p*r)}const x=new cw;x.setAttribute("position",new JM(y,f)),x.setAttribute("uv",new JM(v,m)),x.setAttribute("faceIndex",new JM(_,g)),e.push(x),r.push(new Sw(x,null)),s>4&&s--}return{lodPlanes:e,sizeLods:n,sigmas:i,lodMeshes:r}}(i)),this._blurMaterial=function(t,e,n){const i=KP(new Array(uO).fill(0)),r=gC(new _S(0,1,0)),s=gC(0),a=jE(uO),o=gC(0),l=gC(1),u=uP(null),h=gC(0),c=jE(1/e),A=jE(1/n),d=jE(t),p={n:a,latitudinal:o,weights:i,poleAxis:r,outputDirection:xO,dTheta:s,samples:l,envMap:u,mipInt:h,CUBEUV_TEXEL_WIDTH:c,CUBEUV_TEXEL_HEIGHT:A,CUBEUV_MAX_MIP:d},f=wO("blur");return f.uniforms=p,f.fragmentNode=IB({...p,latitudinal:o.equal(1)}),f}(i,t,e)}return i}async _compileMaterial(t){const e=new Sw(this._lodPlanes[0],t);await this._renderer.compile(e,hO)}_sceneToCubeUV(t,e,n,i){const r=cO;r.near=e,r.far=n;const s=[-1,1,-1,-1,-1,-1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear;o.getClearColor(AO),o.autoClear=!1;let u=this._backgroundBox;if(null===u){const t=new WM({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1});u=new Sw(new ww,t)}let h=!1;const c=t.background;c?c.isColor&&(u.material.color.copy(c),t.background=null,h=!0):(u.material.color.copy(AO),h=!0),o.setRenderTarget(i),o.clear(),h&&o.render(u,r);for(let e=0;e<6;e++){const n=e%3;0===n?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===n?(r.up.set(0,0,s[e]),r.lookAt(0,a[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,a[e]));const l=this._cubeSize;MO(i,n*l,e>2?l:0,l,l),o.render(t,r)}o.autoClear=l,t.background=c}_textureToCubeUV(t,e){const n=this._renderer,i=t.mapping===vx||t.mapping===_x;i?null===this._cubemapMaterial&&(this._cubemapMaterial=TO(t)):null===this._equirectMaterial&&(this._equirectMaterial=EO(t));const r=i?this._cubemapMaterial:this._equirectMaterial;r.fragmentNode.value=t;const s=this._lodMeshes[0];s.material=r;const a=this._cubeSize;MO(e,0,0,3*a,2*a),n.setRenderTarget(e),n.render(s,hO)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;const i=this._lodPlanes.length;for(let e=1;e<i;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=yO[(i-e-1)%yO.length];this._blur(t,e-1,e,n,r)}e.autoClear=n}_blur(t,e,n,i,r){const s=this._pingPongRenderTarget;this._halfBlur(t,s,e,n,i,"latitudinal",r),this._halfBlur(s,t,n,n,i,"longitudinal",r)}_halfBlur(t,e,n,i,r,s,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const u=this._lodMeshes[i];u.material=l;const h=l.uniforms,c=this._sizeLods[n]-1,A=isFinite(r)?Math.PI/(2*c):2*Math.PI/39,d=r/A,p=isFinite(r)?1+Math.floor(3*d):uO;p>uO&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);const f=[];let m=0;for(let t=0;t<uO;++t){const e=t/d,n=Math.exp(-e*e/2);f.push(n),0===t?m+=n:t<p&&(m+=2*n)}for(let t=0;t<f.length;t++)f[t]=f[t]/m;t.texture.frame=(t.texture.frame||0)+1,h.envMap.value=t.texture,h.samples.value=p,h.weights.array=f,h.latitudinal.value="latitudinal"===s?1:0,a&&(h.poleAxis.value=a);const{_lodMax:g}=this;h.dTheta.value=A,h.mipInt.value=g-n;const y=this._sizeLods[i];MO(e,3*y*(i>g-4?i-g+4:0),4*(this._cubeSize-y),3*y,2*y),o.setRenderTarget(e),o.render(u,hO)}}function SO(t,e,n){const i=new mS(t,e,n);return i.texture.mapping=306,i.texture.name="PMREM.cubeUv",i.texture.isPMREMTexture=!0,i.scissorTest=!0,i}function MO(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function wO(t){const e=new QI;return e.depthTest=!1,e.depthWrite=!1,e.blending=0,e.name=`PMREM_${t}`,e}function TO(t){const e=wO("cubemap");return e.fragmentNode=XP(t,xO),e}function EO(t){const e=wO("equirect");return e.fragmentNode=uP(t,iL(xO),0),e}let CO=0;class RO{constructor(t="",e=[],n=0,i=[]){this.name=t,this.bindings=e,this.index=n,this.bindingsReference=i,this.id=CO++}}const NO=new WeakMap,PO=new Map([[2,"vec2"],[3,"vec3"],[4,"vec4"],[9,"mat3"],[16,"mat4"]]),DO=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),IO=t=>(t=Number(t))+(t%1?"":".0");class LO{constructor(t,e,n){this.object=t,this.material=t&&t.material||null,this.geometry=t&&t.geometry||null,this.renderer=e,this.parser=n,this.scene=null,this.camera=null,this.nodes=[],this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.monitor=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.flow={code:""},this.chaining=[],this.stack=oO(),this.stacks=[],this.tab="\t",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new qU,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null,this.useComparisonMethod=!1}getBindGroupsCache(){let t=NO.get(this.renderer);return void 0===t&&(t=new cU,NO.set(this.renderer,t)),t}createRenderTarget(t,e,n){return new mS(t,e,n)}createCubeRenderTarget(t,e){return new rL(t,e)}createPMREMGenerator(){return new bO(this.renderer)}includes(t){return this.nodes.includes(t)}_getBindGroup(t,e){const n=this.getBindGroupsCache(),i=[];let r,s=!0;for(const t of e)i.push(t),s=s&&!0!==t.groupNode.shared;return s?(r=n.get(i),void 0===r&&(r=new RO(t,i,this.bindingsIndexes[t].group,i),n.set(i,r))):r=new RO(t,i,this.bindingsIndexes[t].group,i),r}getBindGroupArray(t,e){const n=this.bindings[e];let i=n[t];return void 0===i&&(void 0===this.bindingsIndexes[t]&&(this.bindingsIndexes[t]={binding:0,group:Object.keys(this.bindingsIndexes).length}),n[t]=i=[]),i}getBindings(){let t=this.bindGroups;if(null===t){const e={},n=this.bindings;for(const t of XT)for(const i in n[t]){const r=n[t][i];(e[i]||(e[i]=[])).push(...r)}t=[];for(const n in e){const i=e[n],r=this._getBindGroup(n,i);t.push(r)}this.bindGroups=t}return t}sortBindingGroups(){const t=this.getBindings();t.sort(((t,e)=>t.bindings[0].groupNode.order-e.bindings[0].groupNode.order));for(let e=0;e<t.length;e++){const n=t[e];this.bindingsIndexes[n.name].group=e,n.index=e}}setHashNode(t,e){this.hashNodes[e]=t}addNode(t){!1===this.nodes.includes(t)&&(this.nodes.push(t),this.setHashNode(t,t.getHash(this)))}buildUpdateNodes(){for(const t of this.nodes){const e=t.getUpdateType(),n=t.getUpdateBeforeType(),i=t.getUpdateAfterType();e!==GT&&this.updateNodes.push(t.getSelf()),n!==GT&&this.updateBeforeNodes.push(t.getSelf()),i!==GT&&this.updateAfterNodes.push(t.getSelf())}}get currentNode(){return this.chaining[this.chaining.length-1]}isFilteredTexture(t){return t.magFilter===Rx||t.magFilter===Nx||t.magFilter===Cx||t.magFilter===Px||t.minFilter===Rx||t.minFilter===Nx||t.minFilter===Cx||t.minFilter===Px}addChain(t){this.chaining.push(t)}removeChain(t){if(this.chaining.pop()!==t)throw new Error("NodeBuilder: Invalid node chaining!")}getMethod(t){return t}getNodeFromHash(t){return this.hashNodes[t]}addFlow(t,e){return this.flowNodes[t].push(e),e}setContext(t){this.context=t}getContext(){return this.context}getSharedContext(){return this.context,this.context}setCache(t){this.cache=t}getCache(){return this.cache}getCacheFromNode(t,e=!0){const n=this.getDataFromNode(t);return void 0===n.cache&&(n.cache=new qU(e?this.getCache():null)),n.cache}isAvailable(){return!1}getVertexIndex(){console.warn("Abstract function.")}getInstanceIndex(){console.warn("Abstract function.")}getDrawIndex(){console.warn("Abstract function.")}getFrontFacing(){console.warn("Abstract function.")}getFragCoord(){console.warn("Abstract function.")}isFlipY(){return!1}increaseUsage(t){const e=this.getDataFromNode(t);return e.usageCount=void 0===e.usageCount?1:e.usageCount+1,e.usageCount}generateTexture(){console.warn("Abstract function.")}generateTextureLod(){console.warn("Abstract function.")}generateConst(t,e=null){if(null===e&&("float"===t||"int"===t||"uint"===t?e=0:"bool"===t?e=!1:"color"===t?e=new GM:"vec2"===t?e=new $b:"vec3"===t?e=new _S:"vec4"===t&&(e=new fS)),"float"===t)return IO(e);if("int"===t)return`${Math.round(e)}`;if("uint"===t)return e>=0?`${Math.round(e)}u`:"0u";if("bool"===t)return e?"true":"false";if("color"===t)return`${this.getType("vec3")}( ${IO(e.r)}, ${IO(e.g)}, ${IO(e.b)} )`;const n=this.getTypeLength(t),i=this.getComponentType(t),r=t=>this.generateConst(i,t);if(2===n)return`${this.getType(t)}( ${r(e.x)}, ${r(e.y)} )`;if(3===n)return`${this.getType(t)}( ${r(e.x)}, ${r(e.y)}, ${r(e.z)} )`;if(4===n)return`${this.getType(t)}( ${r(e.x)}, ${r(e.y)}, ${r(e.z)}, ${r(e.w)} )`;if(n>4&&e&&(e.isMatrix3||e.isMatrix4))return`${this.getType(t)}( ${e.elements.map(r).join(", ")} )`;if(n>4)return`${this.getType(t)}()`;throw new Error(`NodeBuilder: Type '${t}' not found in generate constant attempt.`)}getType(t){return"color"===t?"vec3":t}hasGeometryAttribute(t){return this.geometry&&void 0!==this.geometry.getAttribute(t)}getAttribute(t,e){const n=this.attributes;for(const e of n)if(e.name===t)return e;const i=new BU(t,e);return n.push(i),i}getPropertyName(t){return t.name}isVector(t){return/vec\d/.test(t)}isMatrix(t){return/mat\d/.test(t)}isReference(t){return"void"===t||"property"===t||"sampler"===t||"texture"===t||"cubeTexture"===t||"storageTexture"===t||"depthTexture"===t||"texture3D"===t}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(t){const e=t.type;if(t.isDataTexture){if(e===Ux)return"int";if(e===Ox)return"uint"}return"float"}getElementType(t){return"mat2"===t?"vec2":"mat3"===t?"vec3":"mat4"===t?"vec4":this.getComponentType(t)}getComponentType(t){if("float"===(t=this.getVectorType(t))||"bool"===t||"int"===t||"uint"===t)return t;const e=/(b|i|u|)(vec|mat)([2-4])/.exec(t);return null===e?null:"b"===e[1]?"bool":"i"===e[1]?"int":"u"===e[1]?"uint":"float"}getVectorType(t){return"color"===t?"vec3":"texture"===t||"cubeTexture"===t||"storageTexture"===t||"texture3D"===t?"vec4":t}getTypeFromLength(t,e="float"){if(1===t)return e;const n=PO.get(t);return("float"===e?"":e[0])+n}getTypeFromArray(t){return DO.get(t.constructor)}getTypeFromAttribute(t){let e=t;t.isInterleavedBufferAttribute&&(e=t.data);const n=e.array,i=t.itemSize,r=t.normalized;let s;return t instanceof nw||!0===r||(s=this.getTypeFromArray(n)),this.getTypeFromLength(i,s)}getTypeLength(t){const e=this.getVectorType(t),n=/vec([2-4])/.exec(e);return null!==n?Number(n[1]):"float"===e||"bool"===e||"int"===e||"uint"===e?1:!0===/mat2/.test(t)?4:!0===/mat3/.test(t)?9:!0===/mat4/.test(t)?16:0}getVectorFromMatrix(t){return t.replace("mat","vec")}changeComponentType(t,e){return this.getTypeFromLength(this.getTypeLength(t),e)}getIntegerType(t){const e=this.getComponentType(t);return"int"===e||"uint"===e?t:this.changeComponentType(t,"int")}addStack(){return this.stack=oO(this.stack),this.stacks.push(GE()||this.stack),qE(this.stack),this.stack}removeStack(){const t=this.stack;return this.stack=t.parent,qE(this.stacks.pop()),t}getDataFromNode(t,e=this.shaderStage,n=null){let i=(n=null===n?t.isGlobal(this)?this.globalCache:this.cache:n).getData(t);return void 0===i&&(i={},n.setData(t,i)),void 0===i[e]&&(i[e]={}),i[e]}getNodeProperties(t,e="any"){const n=this.getDataFromNode(t,e);return n.properties||(n.properties={outputNode:null})}getBufferAttributeFromNode(t,e){const n=this.getDataFromNode(t);let i=n.bufferAttribute;if(void 0===i){const r=this.uniforms.index++;i=new BU("nodeAttribute"+r,e,t),this.bufferAttributes.push(i),n.bufferAttribute=i}return i}getStructTypeFromNode(t,e=this.shaderStage){const n=this.getDataFromNode(t,e);if(void 0===n.structType){const i=this.structs.index++;t.name=`StructType${i}`,this.structs[e].push(t),n.structType=t}return t}getUniformFromNode(t,e,n=this.shaderStage,i=null){const r=this.getDataFromNode(t,n,this.globalCache);let s=r.uniform;if(void 0===s){const a=this.uniforms.index++;s=new UU(i||"nodeUniform"+a,e,t),this.uniforms[n].push(s),r.uniform=s}return s}getVarFromNode(t,e=null,n=t.getNodeType(this),i=this.shaderStage){const r=this.getDataFromNode(t,i);let s=r.variable;if(void 0===s){const t=this.vars[i]||(this.vars[i]=[]);null===e&&(e="nodeVar"+t.length),s=new OU(e,n),t.push(s),r.variable=s}return s}getVaryingFromNode(t,e=null,n=t.getNodeType(this)){const i=this.getDataFromNode(t,"any");let r=i.varying;if(void 0===r){const t=this.varyings,s=t.length;null===e&&(e="nodeVarying"+s),r=new FU(e,n),t.push(r),i.varying=r}return r}getCodeFromNode(t,e,n=this.shaderStage){const i=this.getDataFromNode(t);let r=i.code;if(void 0===r){const t=this.codes[n]||(this.codes[n]=[]),s=t.length;r=new kU("nodeCode"+s,e),t.push(r),i.code=r}return r}addFlowCodeHierarchy(t,e){const{flowCodes:n,flowCodeBlock:i}=this.getDataFromNode(t);let r=!0,s=e;for(;s;){if(!0===i.get(s)){r=!1;break}s=this.getDataFromNode(s).parentNodeBlock}if(r)for(const t of n)this.addLineFlowCode(t)}addLineFlowCodeBlock(t,e,n){const i=this.getDataFromNode(t),r=i.flowCodes||(i.flowCodes=[]),s=i.flowCodeBlock||(i.flowCodeBlock=new WeakMap);r.push(e),s.set(n,!0)}addLineFlowCode(t,e=null){return""===t||(null!==e&&this.context.nodeBlock&&this.addLineFlowCodeBlock(e,t,this.context.nodeBlock),t=this.tab+t,/;\s*$/.test(t)||(t+=";\n"),this.flow.code+=t),this}addFlowCode(t){return this.flow.code+=t,this}addFlowTab(){return this.tab+="\t",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(t){return this.flowsData.get(t)}flowNode(t){const e=t.getNodeType(this),n=this.flowChildNode(t,e);return this.flowsData.set(t,n),n}buildFunctionNode(t){const e=new HU,n=this.currentFunctionNode;return this.currentFunctionNode=e,e.code=this.buildFunctionCode(t),this.currentFunctionNode=n,e}flowShaderNode(t){const e=t.layout,n={[Symbol.iterator](){let t=0;const e=Object.values(this);return{next:()=>({value:e[t],done:t++>=e.length})}}};for(const t of e.inputs)n[t.name]=new GU(t.type,t.name);t.layout=null;const i=t.call(n),r=this.flowStagesNode(i,e.type);return t.layout=e,r}flowStagesNode(t,e=null){const n=this.flow,i=this.vars,r=this.cache,s=this.buildStage,a=this.stack,o={code:""};this.flow=o,this.vars={},this.cache=new qU,this.stack=oO();for(const n of WT)this.setBuildStage(n),o.result=t.build(this,e);return o.vars=this.getVars(this.shaderStage),this.flow=n,this.vars=i,this.cache=r,this.stack=a,this.setBuildStage(s),o}getFunctionOperator(){return null}flowChildNode(t,e=null){const n=this.flow,i={code:""};return this.flow=i,i.result=t.build(this,e),this.flow=n,i}flowNodeFromShaderStage(t,e,n=null,i=null){const r=this.shaderStage;this.setShaderStage(t);const s=this.flowChildNode(e,n);return null!==i&&(s.code+=`${this.tab+i} = ${s.result};\n`),this.flowCode[t]=this.flowCode[t]+s.code,this.setShaderStage(r),s}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){console.warn("Abstract function.")}getVaryings(){console.warn("Abstract function.")}getVar(t,e){return`${this.getType(t)} ${e}`}getVars(t){let e="";const n=this.vars[t];if(void 0!==n)for(const t of n)e+=`${this.getVar(t.type,t.name)}; `;return e}getUniforms(){console.warn("Abstract function.")}getCodes(t){const e=this.codes[t];let n="";if(void 0!==e)for(const t of e)n+=t.code+"\n";return n}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(t){this.shaderStage=t}getShaderStage(){return this.shaderStage}setBuildStage(t){this.buildStage=t}getBuildStage(){return this.buildStage}buildCode(){console.warn("Abstract function.")}build(){const{object:t,material:e,renderer:n}=this;if(null!==e){let t=n.nodes.library.fromMaterial(e);null===t&&(console.error(`NodeMaterial: Material "${e.type}" is not compatible.`),t=new QI),t.build(this)}else this.addFlow("compute",t);for(const t of WT){this.setBuildStage(t),this.context.vertex&&this.context.vertex.isNode&&this.flowNodeFromShaderStage("vertex",this.context.vertex);for(const e of XT){this.setShaderStage(e);const n=this.flowNodes[e];for(const e of n)"generate"===t?this.flowNode(e):e.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}getNodeUniform(t,e){if("float"===e||"int"===e||"uint"===e)return new JU(t);if("vec2"===e||"ivec2"===e||"uvec2"===e)return new tO(t);if("vec3"===e||"ivec3"===e||"uvec3"===e)return new eO(t);if("vec4"===e||"ivec4"===e||"uvec4"===e)return new nO(t);if("color"===e)return new iO(t);if("mat3"===e)return new rO(t);if("mat4"===e)return new sO(t);throw new Error(`Uniform "${e}" not declared.`)}createNodeMaterial(t="NodeMaterial"){throw new Error(`THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${t}() instead.`)}format(t,e,n){if((e=this.getVectorType(e))===(n=this.getVectorType(n))||null===n||this.isReference(n))return t;const i=this.getTypeLength(e),r=this.getTypeLength(n);return 16===i&&9===r?`${this.getType(n)}(${t}[0].xyz, ${t}[1].xyz, ${t}[2].xyz)`:9===i&&4===r?`${this.getType(n)}(${t}[0].xy, ${t}[1].xy)`:i>4||r>4||0===r?t:i===r?`${this.getType(n)}( ${t} )`:i>r?this.format(`${t}.${"xyz".slice(0,r)}`,this.getTypeFromLength(r,this.getComponentType(e)),n):4===r&&i>1?`${this.getType(n)}( ${this.format(t,e,"vec3")}, 1.0 )`:2===i?`${this.getType(n)}( ${this.format(t,e,"vec2")}, 0.0 )`:(1===i&&r>1&&e!==this.getComponentType(n)&&(t=`${this.getType(this.getComponentType(n))}( ${t} )`),`${this.getType(n)}( ${t} )`)}getSignature(){return`// Three.js r${rx} - Node System\n`}}class BO{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.startTime=null,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(t,e){let n=t.get(e);return void 0===n&&(n={renderMap:new WeakMap,frameMap:new WeakMap},t.set(e,n)),n}updateBeforeNode(t){const e=t.getUpdateBeforeType(),n=t.updateReference(this);if(e===VT){const{frameMap:e}=this._getMaps(this.updateBeforeMap,n);e.get(n)!==this.frameId&&!1!==t.updateBefore(this)&&e.set(n,this.frameId)}else if(e===HT){const{renderMap:e}=this._getMaps(this.updateBeforeMap,n);e.get(n)!==this.renderId&&!1!==t.updateBefore(this)&&e.set(n,this.renderId)}else e===jT&&t.updateBefore(this)}updateAfterNode(t){const e=t.getUpdateAfterType(),n=t.updateReference(this);if(e===VT){const{frameMap:e}=this._getMaps(this.updateAfterMap,n);e.get(n)!==this.frameId&&!1!==t.updateAfter(this)&&e.set(n,this.frameId)}else if(e===HT){const{renderMap:e}=this._getMaps(this.updateAfterMap,n);e.get(n)!==this.renderId&&!1!==t.updateAfter(this)&&e.set(n,this.renderId)}else e===jT&&t.updateAfter(this)}updateNode(t){const e=t.getUpdateType(),n=t.updateReference(this);if(e===VT){const{frameMap:e}=this._getMaps(this.updateMap,n);e.get(n)!==this.frameId&&!1!==t.update(this)&&e.set(n,this.frameId)}else if(e===HT){const{renderMap:e}=this._getMaps(this.updateMap,n);e.get(n)!==this.renderId&&!1!==t.update(this)&&e.set(n,this.renderId)}else e===jT&&t.update(this)}update(){this.frameId++,void 0===this.lastTime&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class UO{constructor(t,e,n=null,i="",r=!1){this.type=t,this.name=e,this.count=n,this.qualifier=i,this.isConst=r}}UO.isNodeFunctionInput=!0;class OO extends mC{static get type(){return"TimerNode"}constructor(t=OO.LOCAL,e=1,n=0){super(n),this.scope=t,this.scale=e,this.updateType=VT}update(t){const e=this.scope,n=this.scale;e===OO.LOCAL?this.value+=t.deltaTime*n:e===OO.DELTA?this.value=t.deltaTime*n:e===OO.FRAME?this.value=t.frameId:this.value=t.time*n}serialize(t){super.serialize(t),t.scope=this.scope,t.scale=this.scale}deserialize(t){super.deserialize(t),this.scope=t.scope,this.scale=t.scale}}OO.LOCAL="local",OO.GLOBAL="global",OO.DELTA="delta",OO.FRAME="frame";class FO extends $T{static get type(){return"OscNode"}constructor(t=FO.SINE,e=((t,e=0)=>BE(new OO(OO.LOCAL,t,e)))()){super(),this.method=t,this.timeNode=e}getNodeType(t){return this.timeNode.getNodeType(t)}setup(){const t=this.method,e=BE(this.timeNode);let n=null;return t===FO.SINE?n=e.add(.75).mul(2*Math.PI).sin().mul(.5).add(.5):t===FO.SQUARE?n=e.fract().round():t===FO.TRIANGLE?n=e.add(.5).fract().mul(2).sub(1).abs():t===FO.SAWTOOTH&&(n=e.fract()),n}serialize(t){super.serialize(t),t.method=this.method}deserialize(t){super.deserialize(t),this.method=t.method}}FO.SINE="sine",FO.SQUARE="square",FO.TRIANGLE="triangle",FO.SAWTOOTH="sawtooth",FO.SINE,FO.SQUARE,FO.TRIANGLE,FO.SAWTOOTH,new Xw,new _S,new _S,new _S,new $S,new _S(0,0,-1),new fS,new _S,new _S,new fS,new $b,new mS,DI.flipX();const kO=new MT(-1,1,1,-1,0,1);class zO extends cw{constructor(t=!1){super();const e=!1===t?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new iw([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new iw(e,2))}}const qO=new zO;class GO extends Sw{constructor(t=null){super(qO,t),this.camera=kO,this.isQuadMesh=!0}renderAsync(t){return t.renderAsync(this,kO)}render(t){t.render(this,kO)}}class VO extends $T{static get type(){return"SceneNode"}constructor(t=VO.BACKGROUND_BLURRINESS,e=null){super(),this.scope=t,this.scene=e}setup(t){const e=this.scope,n=null!==this.scene?this.scene:t.scene;let i;return e===VO.BACKGROUND_BLURRINESS?i=eD("backgroundBlurriness","float",n):e===VO.BACKGROUND_INTENSITY?i=eD("backgroundIntensity","float",n):console.error("THREE.SceneNode: Unknown scope:",e),i}}VO.BACKGROUND_BLURRINESS="backgroundBlurriness",VO.BACKGROUND_INTENSITY="backgroundIntensity";const HO=kE(VO,VO.BACKGROUND_BLURRINESS),jO=kE(VO,VO.BACKGROUND_INTENSITY),WO="point-list",XO="line-list",YO="line-strip",QO="triangle-list",$O="triangle-strip",ZO="never",KO="less",JO="equal",tF="less-equal",eF="greater",nF="not-equal",iF="greater-equal",rF="always",sF="store",aF="load",oF="clear",lF="ccw",uF="none",hF="front",cF="back",AF="uint16",dF="uint32",pF={R8Unorm:"r8unorm",R8Snorm:"r8snorm",R8Uint:"r8uint",R8Sint:"r8sint",R16Uint:"r16uint",R16Sint:"r16sint",R16Float:"r16float",RG8Unorm:"rg8unorm",RG8Snorm:"rg8snorm",RG8Uint:"rg8uint",RG8Sint:"rg8sint",R32Uint:"r32uint",R32Sint:"r32sint",R32Float:"r32float",RG16Uint:"rg16uint",RG16Sint:"rg16sint",RG16Float:"rg16float",RGBA8Unorm:"rgba8unorm",RGBA8UnormSRGB:"rgba8unorm-srgb",RGBA8Snorm:"rgba8snorm",RGBA8Uint:"rgba8uint",RGBA8Sint:"rgba8sint",BGRA8Unorm:"bgra8unorm",BGRA8UnormSRGB:"bgra8unorm-srgb",RGB9E5UFloat:"rgb9e5ufloat",RGB10A2Unorm:"rgb10a2unorm",RG11B10uFloat:"rgb10a2unorm",RG32Uint:"rg32uint",RG32Sint:"rg32sint",RG32Float:"rg32float",RGBA16Uint:"rgba16uint",RGBA16Sint:"rgba16sint",RGBA16Float:"rgba16float",RGBA32Uint:"rgba32uint",RGBA32Sint:"rgba32sint",RGBA32Float:"rgba32float",Stencil8:"stencil8",Depth16Unorm:"depth16unorm",Depth24Plus:"depth24plus",Depth24PlusStencil8:"depth24plus-stencil8",Depth32Float:"depth32float",Depth32FloatStencil8:"depth32float-stencil8",BC1RGBAUnorm:"bc1-rgba-unorm",BC1RGBAUnormSRGB:"bc1-rgba-unorm-srgb",BC2RGBAUnorm:"bc2-rgba-unorm",BC2RGBAUnormSRGB:"bc2-rgba-unorm-srgb",BC3RGBAUnorm:"bc3-rgba-unorm",BC3RGBAUnormSRGB:"bc3-rgba-unorm-srgb",BC4RUnorm:"bc4-r-unorm",BC4RSnorm:"bc4-r-snorm",BC5RGUnorm:"bc5-rg-unorm",BC5RGSnorm:"bc5-rg-snorm",BC6HRGBUFloat:"bc6h-rgb-ufloat",BC6HRGBFloat:"bc6h-rgb-float",BC7RGBAUnorm:"bc7-rgba-unorm",BC7RGBAUnormSRGB:"bc7-rgba-srgb",ETC2RGB8Unorm:"etc2-rgb8unorm",ETC2RGB8UnormSRGB:"etc2-rgb8unorm-srgb",ETC2RGB8A1Unorm:"etc2-rgb8a1unorm",ETC2RGB8A1UnormSRGB:"etc2-rgb8a1unorm-srgb",ETC2RGBA8Unorm:"etc2-rgba8unorm",ETC2RGBA8UnormSRGB:"etc2-rgba8unorm-srgb",EACR11Unorm:"eac-r11unorm",EACR11Snorm:"eac-r11snorm",EACRG11Unorm:"eac-rg11unorm",EACRG11Snorm:"eac-rg11snorm",ASTC4x4Unorm:"astc-4x4-unorm",ASTC4x4UnormSRGB:"astc-4x4-unorm-srgb",ASTC5x4Unorm:"astc-5x4-unorm",ASTC5x4UnormSRGB:"astc-5x4-unorm-srgb",ASTC5x5Unorm:"astc-5x5-unorm",ASTC5x5UnormSRGB:"astc-5x5-unorm-srgb",ASTC6x5Unorm:"astc-6x5-unorm",ASTC6x5UnormSRGB:"astc-6x5-unorm-srgb",ASTC6x6Unorm:"astc-6x6-unorm",ASTC6x6UnormSRGB:"astc-6x6-unorm-srgb",ASTC8x5Unorm:"astc-8x5-unorm",ASTC8x5UnormSRGB:"astc-8x5-unorm-srgb",ASTC8x6Unorm:"astc-8x6-unorm",ASTC8x6UnormSRGB:"astc-8x6-unorm-srgb",ASTC8x8Unorm:"astc-8x8-unorm",ASTC8x8UnormSRGB:"astc-8x8-unorm-srgb",ASTC10x5Unorm:"astc-10x5-unorm",ASTC10x5UnormSRGB:"astc-10x5-unorm-srgb",ASTC10x6Unorm:"astc-10x6-unorm",ASTC10x6UnormSRGB:"astc-10x6-unorm-srgb",ASTC10x8Unorm:"astc-10x8-unorm",ASTC10x8UnormSRGB:"astc-10x8-unorm-srgb",ASTC10x10Unorm:"astc-10x10-unorm",ASTC10x10UnormSRGB:"astc-10x10-unorm-srgb",ASTC12x10Unorm:"astc-12x10-unorm",ASTC12x10UnormSRGB:"astc-12x10-unorm-srgb",ASTC12x12Unorm:"astc-12x12-unorm",ASTC12x12UnormSRGB:"astc-12x12-unorm-srgb"},fF="clamp-to-edge",mF="repeat",gF="mirror-repeat",yF="linear",vF="nearest",_F="zero",xF="one",bF="src",SF="one-minus-src",MF="src-alpha",wF="one-minus-src-alpha",TF="dst",EF="one-minus-dst",CF="dst-alpha",RF="one-minus-dst-alpha",NF="src-alpha-saturated",PF="constant",DF="one-minus-constant",IF="add",LF="subtract",BF="reverse-subtract",UF="min",OF="max",FF=0,kF=15,zF="keep",qF="zero",GF="replace",VF="invert",HF="increment-clamp",jF="decrement-clamp",WF="increment-wrap",XF="decrement-wrap",YF="storage",QF="read-only-storage",$F="write-only",ZF="read-only",KF="float",JF="unfilterable-float",tk="depth",ek="sint",nk="uint",ik="2d",rk="3d",sk="2d",ak="2d-array",ok="cube",lk="3d",uk="all",hk="vertex",ck="instance",Ak={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups"},dk=new $b;class pk extends lP{static get type(){return"PassTextureNode"}constructor(t,e){super(e),this.passNode=t,this.setUpdateMatrix(!1)}setup(t){return t.object.isQuadMesh&&this.passNode.build(t),super.setup(t)}clone(){return new this.constructor(this.passNode,this.value)}}class fk extends pk{static get type(){return"PassMultipleTextureNode"}constructor(t,e,n=!1){super(t,null),this.textureName=e,this.previousTexture=n}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(t){return this.updateTexture(),super.setup(t)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class mk extends JT{static get type(){return"PassNode"}constructor(t,e,n,i={}){super("vec4"),this.scope=t,this.scene=e,this.camera=n,this.options=i,this._pixelRatio=1,this._width=1,this._height=1;const r=new tT;r.isRenderTargetTexture=!0,r.name="depth";const s=new mS(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:kx,...i});s.texture.name="output",s.depthTexture=r,this.renderTarget=s,this.updateBeforeType=VT,this._textures={output:s.texture,depth:r},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=gC(0),this._cameraFar=gC(0),this._mrt=null,this.isPassNode=!0}setMRT(t){return this._mrt=t,this}getMRT(){return this._mrt}isGlobal(){return!0}getTexture(t){let e=this._textures[t];if(void 0===e){e=this.renderTarget.texture.clone(),e.isRenderTargetTexture=!0,e.name=t,this._textures[t]=e,this.renderTarget.textures.push(e)}return e}getPreviousTexture(t){let e=this._previousTextures[t];return void 0===e&&(e=this.getTexture(t).clone(),e.isRenderTargetTexture=!0,this._previousTextures[t]=e),e}toggleTexture(t){const e=this._previousTextures[t];if(void 0!==e){const n=this._textures[t],i=this.renderTarget.textures.indexOf(n);this.renderTarget.textures[i]=e,this._textures[t]=e,this._previousTextures[t]=n,this._textureNodes[t].updateTexture(),this._previousTextureNodes[t].updateTexture()}}getTextureNode(t="output"){let e=this._textureNodes[t];return void 0===e&&(this._textureNodes[t]=e=BE(new fk(this,t)),this._textureNodes[t].updateTexture()),e}getPreviousTextureNode(t="output"){let e=this._previousTextureNodes[t];return void 0===e&&(void 0===this._textureNodes[t]&&this.getTextureNode(t),this._previousTextureNodes[t]=e=BE(new fk(this,t,!0)),this._previousTextureNodes[t].updateTexture()),e}getViewZNode(t="depth"){let e=this._viewZNodes[t];if(void 0===e){const n=this._cameraNear,i=this._cameraFar;this._viewZNodes[t]=e=jI(this.getTextureNode(t),n,i)}return e}getLinearDepthNode(t="depth"){let e=this._linearDepthNodes[t];if(void 0===e){const n=this._cameraNear,i=this._cameraFar,r=this.getViewZNode(t);this._linearDepthNodes[t]=e=VI(r,n,i)}return e}setup({renderer:t}){return this.renderTarget.samples=void 0===this.options.samples?t.samples:this.options.samples,!0===t.backend.isWebGLBackend&&(this.renderTarget.samples=0),this.renderTarget.depthTexture.isMultisampleRenderTargetTexture=this.renderTarget.samples>1,this.scope===mk.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(t){const{renderer:e}=t,{scene:n,camera:i}=this;this._pixelRatio=e.getPixelRatio();const r=e.getSize(dk);this.setSize(r.width,r.height);const s=e.getRenderTarget(),a=e.getMRT();this._cameraNear.value=i.near,this._cameraFar.value=i.far;for(const t in this._previousTextures)this.toggleTexture(t);e.setRenderTarget(this.renderTarget),e.setMRT(this._mrt),e.render(n,i),e.setRenderTarget(s),e.setMRT(a)}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget.setSize(n,i)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}mk.COLOR="color",mk.DEPTH="depth";class gk extends $T{static get type(){return"FogNode"}constructor(t,e){super("float"),this.isFogNode=!0,this.colorNode=t,this.factorNode=e}getViewZNode(t){let e;const n=t.context.getViewZ;return void 0!==n&&(e=n(this)),(e||EP.z).negate()}setup(){return this.factorNode}}class yk extends gk{static get type(){return"FogRangeNode"}constructor(t,e,n){super(t),this.isFogRangeNode=!0,this.nearNode=e,this.farNode=n}setup(t){const e=this.getViewZNode(t);return yN(this.nearNode,this.farNode,e)}}const vk=FE(yk);class _k extends gk{static get type(){return"FogExp2Node"}constructor(t,e){super(t),this.isFogExp2Node=!0,this.densityNode=e}setup(t){const e=this.getViewZNode(t),n=this.densityNode;return n.mul(n,e,e).negate().exp().oneMinus()}}const xk=FE(_k),bk=zE((({depthTexture:t,shadowCoord:e})=>uP(t,e.xy).compare(e.z))),Sk=zE((({depthTexture:t,shadowCoord:e,shadow:n})=>{const i=(e,n)=>uP(t,e).compare(n),r=eD("mapSize","vec2",n).setGroup(pC),s=eD("radius","float",n).setGroup(pC),a=QE(1).div(r),o=a.x.negate().mul(s),l=a.y.negate().mul(s),u=a.x.mul(s),h=a.y.mul(s),c=o.div(2),A=l.div(2),d=u.div(2),p=h.div(2);return ZC(i(e.xy.add(QE(o,l)),e.z),i(e.xy.add(QE(0,l)),e.z),i(e.xy.add(QE(u,l)),e.z),i(e.xy.add(QE(c,A)),e.z),i(e.xy.add(QE(0,A)),e.z),i(e.xy.add(QE(d,A)),e.z),i(e.xy.add(QE(o,0)),e.z),i(e.xy.add(QE(c,0)),e.z),i(e.xy,e.z),i(e.xy.add(QE(d,0)),e.z),i(e.xy.add(QE(u,0)),e.z),i(e.xy.add(QE(c,p)),e.z),i(e.xy.add(QE(0,p)),e.z),i(e.xy.add(QE(d,p)),e.z),i(e.xy.add(QE(o,h)),e.z),i(e.xy.add(QE(0,h)),e.z),i(e.xy.add(QE(u,h)),e.z)).mul(1/17)})),Mk=zE((({depthTexture:t,shadowCoord:e,shadow:n})=>{const i=(e,n)=>uP(t,e).compare(n),r=eD("mapSize","vec2",n).setGroup(pC),s=QE(1).div(r),a=s.x,o=s.y,l=e.xy,u=BR(l.mul(r).add(.5));return l.subAssign(u.mul(s)),ZC(i(l,e.z),i(l.add(QE(a,0)),e.z),i(l.add(QE(0,o)),e.z),i(l.add(s),e.z),fN(i(l.add(QE(a.negate(),0)),e.z),i(l.add(QE(a.mul(2),0)),e.z),u.x),fN(i(l.add(QE(a.negate(),o)),e.z),i(l.add(QE(a.mul(2),o)),e.z),u.x),fN(i(l.add(QE(0,o.negate())),e.z),i(l.add(QE(0,o.mul(2))),e.z),u.y),fN(i(l.add(QE(a,o.negate())),e.z),i(l.add(QE(a,o.mul(2))),e.z),u.y),fN(fN(i(l.add(QE(a.negate(),o.negate())),e.z),i(l.add(QE(a.mul(2),o.negate())),e.z),u.x),fN(i(l.add(QE(a.negate(),o.mul(2))),e.z),i(l.add(QE(a.mul(2),o.mul(2))),e.z),u.x),u.y)).mul(1/9)})),wk=zE((({depthTexture:t,shadowCoord:e})=>{const n=jE(1).toVar(),i=uP(t).uv(e.xy).rg,r=rN(e.z,i.x);return VE(r.notEqual(jE(1)),(()=>{const t=e.z.sub(i.x),s=nN(0,i.y.mul(i.y));let a=s.div(s.add(t.mul(t)));a=mN(KC(a,.3).div(.95-.3)),n.assign(mN(nN(r,a)))})),n})),Tk=zE((({samples:t,radius:e,size:n,shadowPass:i})=>{const r=jE(0).toVar(),s=jE(0).toVar(),a=t.lessThanEqual(jE(1)).select(jE(0),jE(2).div(t.sub(1))),o=t.lessThanEqual(jE(1)).select(jE(0),jE(-1));pI({start:WE(0),end:WE(t),type:"int",condition:"<"},(({i:t})=>{const l=o.add(jE(t).mul(a)),u=i.uv(ZC(LI.xy,QE(0,l).mul(e)).div(n)).x;r.addAssign(u),s.addAssign(u.mul(u))})),r.divAssign(t),s.divAssign(t);const l=NR(s.sub(r.mul(r)));return QE(r,l)})),Ek=zE((({samples:t,radius:e,size:n,shadowPass:i})=>{const r=jE(0).toVar(),s=jE(0).toVar(),a=t.lessThanEqual(jE(1)).select(jE(0),jE(2).div(t.sub(1))),o=t.lessThanEqual(jE(1)).select(jE(0),jE(-1));pI({start:WE(0),end:WE(t),type:"int",condition:"<"},(({i:t})=>{const l=o.add(jE(t).mul(a)),u=i.uv(ZC(LI.xy,QE(l,0).mul(e)).div(n));r.addAssign(u.x),s.addAssign(ZC(u.y.mul(u.y),u.x.mul(u.x)))})),r.divAssign(t),s.divAssign(t);const l=NR(s.sub(r.mul(r)));return QE(r,l)})),Ck=[bk,Sk,Mk,wk];let Rk=null;const Nk=new GO;class Pk extends MI{static get type(){return"AnalyticLightNode"}constructor(t=null){super(),this.updateType=VT,this.light=t,this.color=new GM,this.colorNode=gC(this.color).setGroup(pC),this.baseColorNode=null,this.shadowMap=null,this.shadowNode=null,this.shadowColorNode=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this.isAnalyticLightNode=!0}getCacheKey(){return UT(super.getCacheKey(),this.light.id,this.light.castShadow?1:0)}getHash(){return this.light.uuid}setupShadow(t){const{object:e,renderer:n}=t;if(!1===n.shadowMap.enabled)return;let i=this.shadowColorNode;if(null===i){null===Rk&&(Rk=new QI,Rk.fragmentNode=iC(0,0,0,1),Rk.isShadowNodeMaterial=!0,Rk.name="ShadowMaterial");const r=n.shadowMap.type,s=this.light.shadow,a=new tT;a.compareFunction=513;const o=t.createRenderTarget(s.mapSize.width,s.mapSize.height);if(o.depthTexture=a,s.camera.updateProjectionMatrix(),3===r){a.compareFunction=null,this.vsmShadowMapVertical=t.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Xx,type:kx}),this.vsmShadowMapHorizontal=t.createRenderTarget(s.mapSize.width,s.mapSize.height,{format:Xx,type:kx});const e=uP(a),n=uP(this.vsmShadowMapVertical.texture),i=eD("blurSamples","float",s).setGroup(pC),r=eD("radius","float",s).setGroup(pC),o=eD("mapSize","vec2",s).setGroup(pC);let l=this.vsmMaterialVertical||(this.vsmMaterialVertical=new QI);l.fragmentNode=Tk({samples:i,radius:r,size:o,shadowPass:e}).context(t.getSharedContext()),l.name="VSMVertical",l=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new QI),l.fragmentNode=Ek({samples:i,radius:r,size:o,shadowPass:n}).context(t.getSharedContext()),l.name="VSMHorizontal"}const l=eD("intensity","float",s).setGroup(pC),u=eD("bias","float",s).setGroup(pC),h=eD("normalBias","float",s).setGroup(pC),c=e.material.shadowPositionNode||wP;let A=gC(s.matrix).setGroup(pC).mul(c.add(BP.mul(h)));A=A.xyz.div(A.w);let d=A.z.add(u);n.coordinateSystem===Ob&&(d=d.mul(2).sub(1)),A=JE(A.x,A.y.oneMinus(),d);const p=A.x.greaterThanEqual(0).and(A.x.lessThanEqual(1)).and(A.y.greaterThanEqual(0)).and(A.y.lessThanEqual(1)).and(A.z.lessThanEqual(1)),f=s.filterNode||Ck[n.shadowMap.type]||null;if(null===f)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const m=uP(o.texture,A),g=p.select(f({depthTexture:3===r?this.vsmShadowMapHorizontal.texture:a,shadowCoord:A,shadow:s}),jE(1));this.shadowMap=o,this.light.shadow.map=o,this.shadowNode=g,this.shadowColorNode=i=this.colorNode.mul(fN(1,g.rgb.mix(m,1),l.mul(m.a))),this.baseColorNode=this.colorNode}this.colorNode=i,this.updateBeforeType=HT}setup(t){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?t.object.receiveShadow&&this.setupShadow(t):null!==this.shadowNode&&this.disposeShadow()}updateShadow(t){const{shadowMap:e,light:n}=this,{renderer:i,scene:r,camera:s}=t,a=i.shadowMap.type,o=e.depthTexture.version;this._depthVersionCached=o;const l=r.overrideMaterial;r.overrideMaterial=Rk,e.setSize(n.shadow.mapSize.width,n.shadow.mapSize.height),n.shadow.updateMatrices(n),n.shadow.camera.layers.mask=s.layers.mask;const u=i.getRenderTarget(),h=i.getRenderObjectFunction();i.setRenderObjectFunction(((t,...e)=>{(!0===t.castShadow||t.receiveShadow&&3===a)&&i.renderObject(t,...e)})),i.setRenderTarget(e),i.render(r,n.shadow.camera),i.setRenderObjectFunction(h),!0!==n.isPointLight&&3===a&&this.vsmPass(t,n),i.setRenderTarget(u),r.overrideMaterial=l}vsmPass(t,e){const{renderer:n}=t;this.vsmShadowMapVertical.setSize(e.shadow.mapSize.width,e.shadow.mapSize.height),this.vsmShadowMapHorizontal.setSize(e.shadow.mapSize.width,e.shadow.mapSize.height),n.setRenderTarget(this.vsmShadowMapVertical),Nk.material=this.vsmMaterialVertical,Nk.render(n),n.setRenderTarget(this.vsmShadowMapHorizontal),Nk.material=this.vsmMaterialHorizontal,Nk.render(n)}disposeShadow(){this.shadowMap.dispose(),this.shadowMap=null,null!==this.vsmShadowMapVertical&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),null!==this.vsmShadowMapHorizontal&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),this.shadowNode=null,this.shadowColorNode=null,this.baseColorNode=null,this.updateBeforeType=GT}updateBefore(t){const e=this.light.shadow;(e.needsUpdate||e.autoUpdate)&&(this.updateShadow(t),this.shadowMap.depthTexture.version===this._depthVersionCached&&(e.needsUpdate=!1))}update(){const{light:t}=this;this.color.copy(t.color).multiplyScalar(t.intensity)}}const Dk=zE((t=>{const{lightDistance:e,cutoffDistance:n,decayExponent:i}=t,r=e.pow(i).max(.01).reciprocal();return n.greaterThan(0).select(r.mul(e.div(n).pow4().oneMinus().clamp().pow2()),r)}));let Ik;function Lk(t){Ik=Ik||new WeakMap;let e=Ik.get(t);return void 0===e&&Ik.set(t,e={}),e}function Bk(t){const e=Lk(t);return e.position||(e.position=gC(new _S).setGroup(pC).onRenderUpdate(((e,n)=>n.value.setFromMatrixPosition(t.matrixWorld))))}function Uk(t){const e=Lk(t);return e.viewPosition||(e.viewPosition=gC(new _S).setGroup(pC).onRenderUpdate((({camera:e},n)=>{n.value=n.value||new _S,n.value.setFromMatrixPosition(t.matrixWorld),n.value.applyMatrix4(e.matrixWorldInverse)})))}const Ok=t=>fP.transformDirection(Bk(t).sub(function(t){const e=Lk(t);return e.targetPosition||(e.targetPosition=gC(new _S).setGroup(pC).onRenderUpdate(((e,n)=>n.value.setFromMatrixPosition(t.target.matrixWorld))))}(t))),Fk=zE((([t])=>{const e=t.mul(.9478672986).add(.0521327014).pow(2.4),n=t.mul(.0773993808),i=t.lessThanEqual(.04045);return fN(e,n,i)})).setLayout({name:"sRGBToLinearSRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),kk=zE((([t])=>{const e=t.pow(.41666).mul(1.055).sub(.055),n=t.mul(12.92),i=t.lessThanEqual(.0031308);return fN(e,n,i)})).setLayout({name:"linearSRGBTosRGB",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),zk=zE((([t,e])=>t.mul(e).clamp())).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),qk=zE((([t,e])=>(t=t.mul(e)).div(t.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Gk=zE((([t,e])=>{const n=(t=(t=t.mul(e)).sub(.004).max(0)).mul(t.mul(6.2).add(.5)),i=t.mul(t.mul(6.2).add(1.7)).add(.06);return n.div(i).pow(2.2)})).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Vk=zE((([t])=>{const e=t.mul(t.add(.0245786)).sub(90537e-9),n=t.mul(t.add(.432951).mul(.983729)).add(.238081);return e.div(n)})),Hk=zE((([t,e])=>{const n=lC(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),i=lC(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return t=t.mul(e).div(.6),t=n.mul(t),t=Vk(t),(t=i.mul(t)).clamp()})).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),jk=lC(JE(1.6605,-.1246,-.0182),JE(-.5876,1.1329,-.1006),JE(-.0728,-.0083,1.1187)),Wk=lC(JE(.6274,.0691,.0164),JE(.3293,.9195,.088),JE(.0433,.0113,.8956)),Xk=zE((([t])=>{const e=JE(t).toVar(),n=JE(e.mul(e)).toVar(),i=JE(n.mul(n)).toVar();return jE(15.5).mul(i.mul(n)).sub(JC(40.14,i.mul(e))).add(JC(31.96,i).sub(JC(6.868,n.mul(e))).add(JC(.4298,n).add(JC(.1191,e).sub(.00232))))})),Yk=zE((([t,e])=>{const n=JE(t).toVar(),i=lC(JE(.856627153315983,.137318972929847,.11189821299995),JE(.0951212405381588,.761241990602591,.0767994186031903),JE(.0482516061458583,.101439036467562,.811302368396859)),r=lC(JE(1.1271005818144368,-.1413297634984383,-.14132976349843826),JE(-.11060664309660323,1.157823702216272,-.11060664309660294),JE(-.016493938717834573,-.016493938717834257,1.2519364065950405)),s=jE(-12.47393),a=jE(4.026069);return n.mulAssign(e),n.assign(Wk.mul(n)),n.assign(i.mul(n)),n.assign(nN(n,1e-10)),n.assign(RR(n)),n.assign(n.sub(s).div(a.sub(s))),n.assign(mN(n,0,1)),n.assign(Xk(n)),n.assign(r.mul(n)),n.assign(hN(nN(JE(0),n),JE(2.2))),n.assign(jk.mul(n)),n.assign(mN(n,0,1)),n})).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),Qk=zE((([t,e])=>{const n=jE(.76),i=jE(.15);t=t.mul(e);const r=eN(t.r,eN(t.g,t.b)),s=bN(r.lessThan(.08),r.sub(JC(6.25,r.mul(r))),.04);t.subAssign(s);const a=nN(t.r,nN(t.g,t.b));VE(a.lessThan(n),(()=>t));const o=KC(1,n),l=KC(1,o.mul(o).div(a.add(o.sub(n))));t.mulAssign(l.div(a));const u=KC(1,tR(1,i.mul(a.sub(l)).add(1)));return fN(t,JE(l),u)})).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});FE(class extends $T{constructor(t){super(),this.scope=t}generate(t){const{scope:e}=this,{renderer:n}=t;!0===n.backend.isWebGLBackend?t.addFlowCode(`\t// ${e}Barrier \n`):t.addLineFlowCode(`${e}Barrier()`,this)}});class $k extends JT{static get type(){return"AtomicFunctionNode"}constructor(t,e,n,i=null){super("uint"),this.method=t,this.pointerNode=e,this.valueNode=n,this.storeNode=i}getInputType(t){return this.pointerNode.getNodeType(t)}getNodeType(t){return this.getInputType(t)}generate(t){const e=this.method,n=this.getNodeType(t),i=this.getInputType(t),r=this.pointerNode,s=this.valueNode,a=[];a.push(`&${r.build(t,i)}`),a.push(s.build(t,i));const o=`${t.getMethod(e,n)}( ${a.join(", ")} )`;if(null!==this.storeNode){const e=this.storeNode.build(t,i);t.addLineFlowCode(`${e} = ${o}`,this)}else t.addLineFlowCode(o,this)}}$k.ATOMIC_LOAD="atomicLoad",$k.ATOMIC_STORE="atomicStore",$k.ATOMIC_ADD="atomicAdd",$k.ATOMIC_SUB="atomicSub",$k.ATOMIC_MAX="atomicMax",$k.ATOMIC_MIN="atomicMin",$k.ATOMIC_AND="atomicAnd",$k.ATOMIC_OR="atomicOr",$k.ATOMIC_XOR="atomicXor",FE($k);const Zk=zE((([t,e])=>{const n=t.x,i=t.y,r=t.z;let s=e.element(0).mul(.886227);return s=s.add(e.element(1).mul(1.023328).mul(i)),s=s.add(e.element(2).mul(1.023328).mul(r)),s=s.add(e.element(3).mul(1.023328).mul(n)),s=s.add(e.element(4).mul(.858086).mul(n).mul(i)),s=s.add(e.element(5).mul(.858086).mul(i).mul(r)),s=s.add(e.element(6).mul(r.mul(r).mul(.743125).sub(.247708))),s=s.add(e.element(7).mul(.858086).mul(n).mul(r)),s=s.add(e.element(8).mul(.429043).mul(JC(n,n).sub(JC(i,i)))),s}));class Kk extends Pk{static get type(){return"PointLightNode"}constructor(t=null){super(t),this.cutoffDistanceNode=gC(0).setGroup(pC),this.decayExponentNode=gC(0).setGroup(pC)}update(t){const{light:e}=this;super.update(t),this.cutoffDistanceNode.value=e.distance,this.decayExponentNode.value=e.decay}setup(t){const{colorNode:e,cutoffDistanceNode:n,decayExponentNode:i,light:r}=this,s=t.context.lightingModel,a=Uk(r).sub(EP),o=a.normalize(),l=a.length(),u=Dk({lightDistance:l,cutoffDistance:n,decayExponent:i}),h=e.mul(u),c=t.context.reflectedLight;s.direct({lightDirection:o,lightColor:h,reflectedLight:c},t.stack,t)}}class Jk extends Pk{static get type(){return"DirectionalLightNode"}constructor(t=null){super(t)}setup(t){super.setup(t);const e=t.context.lightingModel,n=this.colorNode,i=Ok(this.light),r=t.context.reflectedLight;e.direct({lightDirection:i,lightColor:n,reflectedLight:r},t.stack,t)}}const tz=new $S,ez=new $S;let nz=null;class iz extends Pk{static get type(){return"RectAreaLightNode"}constructor(t=null){super(t),this.halfHeight=gC(new _S).setGroup(pC),this.halfWidth=gC(new _S).setGroup(pC)}update(t){super.update(t);const{light:e}=this,n=t.camera.matrixWorldInverse;ez.identity(),tz.copy(e.matrixWorld),tz.premultiply(n),ez.extractRotation(tz),this.halfWidth.value.set(.5*e.width,0,0),this.halfHeight.value.set(0,.5*e.height,0),this.halfWidth.value.applyMatrix4(ez),this.halfHeight.value.applyMatrix4(ez)}setup(t){let e,n;super.setup(t),t.isAvailable("float32Filterable")?(e=uP(nz.LTC_FLOAT_1),n=uP(nz.LTC_FLOAT_2)):(e=uP(nz.LTC_HALF_1),n=uP(nz.LTC_HALF_2));const{colorNode:i,light:r}=this,s=t.context.lightingModel,a=Uk(r),o=t.context.reflectedLight;s.directRectArea({lightColor:i,lightPosition:a,halfWidth:this.halfWidth,halfHeight:this.halfHeight,reflectedLight:o,ltc_1:e,ltc_2:n},t.stack,t)}static setLTC(t){nz=t}}class rz extends Pk{static get type(){return"SpotLightNode"}constructor(t=null){super(t),this.coneCosNode=gC(0).setGroup(pC),this.penumbraCosNode=gC(0).setGroup(pC),this.cutoffDistanceNode=gC(0).setGroup(pC),this.decayExponentNode=gC(0).setGroup(pC)}update(t){super.update(t);const{light:e}=this;this.coneCosNode.value=Math.cos(e.angle),this.penumbraCosNode.value=Math.cos(e.angle*(1-e.penumbra)),this.cutoffDistanceNode.value=e.distance,this.decayExponentNode.value=e.decay}getSpotAttenuation(t){const{coneCosNode:e,penumbraCosNode:n}=this;return yN(e,n,t)}setup(t){super.setup(t);const e=t.context.lightingModel,{colorNode:n,cutoffDistanceNode:i,decayExponentNode:r,light:s}=this,a=Uk(s).sub(EP),o=a.normalize(),l=o.dot(Ok(s)),u=this.getSpotAttenuation(l),h=a.length(),c=Dk({lightDistance:h,cutoffDistance:i,decayExponent:r}),A=n.mul(u).mul(c),d=t.context.reflectedLight;e.direct({lightDirection:o,lightColor:A,reflectedLight:d},t.stack,t)}}class sz extends rz{static get type(){return"IESSpotLightNode"}getSpotAttenuation(t){const e=this.light.iesMap;let n=null;if(e&&!0===e.isTexture){const i=t.acos().mul(1/Math.PI);n=uP(e,QE(i,0),0).r}else n=super.getSpotAttenuation(t);return n}}class az extends Pk{static get type(){return"AmbientLightNode"}constructor(t=null){super(t)}setup({context:t}){t.irradiance.addAssign(this.colorNode)}}class oz extends Pk{static get type(){return"HemisphereLightNode"}constructor(t=null){super(t),this.lightPositionNode=Bk(t),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=gC(new GM).setGroup(pC)}update(t){const{light:e}=this;super.update(t),this.lightPositionNode.object3d=e,this.groundColorNode.value.copy(e.groundColor).multiplyScalar(e.intensity)}setup(t){const{colorNode:e,groundColorNode:n,lightDirectionNode:i}=this,r=LP.dot(i).mul(.5).add(.5),s=fN(n,e,r);t.context.irradiance.addAssign(s)}}class lz extends Pk{static get type(){return"LightProbeNode"}constructor(t=null){super(t);const e=[];for(let t=0;t<9;t++)e.push(new _S);this.lightProbe=KP(e)}update(t){const{light:e}=this;super.update(t);for(let t=0;t<9;t++)this.lightProbe.array[t].copy(e.sh.coefficients[t]).multiplyScalar(e.intensity)}setup(t){const e=Zk(BP,this.lightProbe);t.context.irradiance.addAssign(e)}}class uz{parseFunction(){console.warn("Abstract function.")}}class hz{constructor(t,e,n="",i=""){this.type=t,this.inputs=e,this.name=n,this.precision=i}getCode(){console.warn("Abstract function.")}}hz.isNodeFunction=!0;const cz=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,Az=/[a-z_0-9]+/gi,dz="#pragma main";class pz extends hz{constructor(t){const{type:e,inputs:n,name:i,precision:r,inputsCode:s,blockCode:a,headerCode:o}=(t=>{const e=(t=t.trim()).indexOf(dz),n=-1!==e?t.slice(e+12):t,i=n.match(cz);if(null!==i&&5===i.length){const r=i[4],s=[];let a=null;for(;null!==(a=Az.exec(r));)s.push(a);const o=[];let l=0;for(;l<s.length;){const t="const"===s[l][0];!0===t&&l++;let e=s[l][0];"in"===e||"out"===e||"inout"===e?l++:e="";const n=s[l++][0];let i=Number.parseInt(s[l][0]);!1===Number.isNaN(i)?l++:i=null;const r=s[l++][0];o.push(new UO(n,r,i,e,t))}const u=n.substring(i[0].length),h=void 0!==i[3]?i[3]:"";return{type:i[2],inputs:o,name:h,precision:void 0!==i[1]?i[1]:"",inputsCode:r,blockCode:u,headerCode:-1!==e?t.slice(0,e):""}}throw new Error("FunctionNode: Function is not a GLSL code.")})(t);super(e,n,i,r),this.inputsCode=s,this.blockCode=a,this.headerCode=o}getCode(t=this.name){let e;const n=this.blockCode;if(""!==n){const{type:i,inputsCode:r,headerCode:s,precision:a}=this;let o=`${i} ${t} ( ${r.trim()} )`;""!==a&&(o=`${a} ${o}`),e=s+o+n}else e="";return e}}class fz extends uz{parseFunction(t){return new pz(t)}}function mz(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function gz(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}class yz{constructor(){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparent=[],this.bundles=[],this.lightsNode=new bI([]),this.lightsArray=[],this.occlusionQueryCount=0}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(t,e,n,i,r,s){let a=this.renderItems[this.renderItemsIndex];return void 0===a?(a={id:t.id,object:t,geometry:e,material:n,groupOrder:i,renderOrder:t.renderOrder,z:r,group:s},this.renderItems[this.renderItemsIndex]=a):(a.id=t.id,a.object=t,a.geometry=e,a.material=n,a.groupOrder=i,a.renderOrder=t.renderOrder,a.z=r,a.group=s),this.renderItemsIndex++,a}push(t,e,n,i,r,s){const a=this.getNextRenderItem(t,e,n,i,r,s);!0===t.occlusionTest&&this.occlusionQueryCount++,(!0===n.transparent||n.transmission>0?this.transparent:this.opaque).push(a)}unshift(t,e,n,i,r,s){const a=this.getNextRenderItem(t,e,n,i,r,s);(!0===n.transparent?this.transparent:this.opaque).unshift(a)}pushBundle(t){this.bundles.push(t)}pushLight(t){this.lightsArray.push(t)}getLightsNode(){return this.lightsNode.fromLights(this.lightsArray)}sort(t,e){this.opaque.length>1&&this.opaque.sort(t||mz),this.transparent.length>1&&this.transparent.sort(e||gz)}finish(){this.lightsNode.setLights(this.lightsArray);for(let t=this.renderItemsIndex,e=this.renderItems.length;t<e;t++){const e=this.renderItems[t];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.groupOrder=null,e.renderOrder=null,e.z=null,e.group=null}}}class vz{constructor(){this.lists=new cU}get(t,e){const n=this.lists,i=[t,e];let r=n.get(i);return void 0===r&&(r=new yz,n.set(i,r)),r}dispose(){this.lists=new cU}}let _z=0;class xz{constructor(){this.id=_z++,this.color=!0,this.clearColor=!0,this.clearColorValue={r:0,g:0,b:0,a:1},this.depth=!0,this.clearDepth=!0,this.clearDepthValue=1,this.stencil=!1,this.clearStencil=!0,this.clearStencilValue=1,this.viewport=!1,this.viewportValue=new fS,this.scissor=!1,this.scissorValue=new fS,this.textures=null,this.depthTexture=null,this.activeCubeFace=0,this.sampleCount=1,this.width=0,this.height=0,this.isRenderContext=!0}getCacheKey(){return bz(this)}}function bz(t){const{textures:e,activeCubeFace:n}=t,i=[n];for(const t of e)i.push(t.id);return BT(i)}class Sz{constructor(){this.chainMaps={}}get(t,e,n=null){const i=[t,e];let r;if(null===n)r="default";else{const t=n.texture.format;r=`${n.textures.length}:${t}:${n.samples}:${n.depthBuffer}:${n.stencilBuffer}`}const s=this.getChainMap(r);let a=s.get(i);return void 0===a&&(a=new xz,s.set(i,a)),null!==n&&(a.sampleCount=0===n.samples?1:n.samples),a}getChainMap(t){return this.chainMaps[t]||(this.chainMaps[t]=new cU)}dispose(){this.chainMaps={}}}const Mz=new _S;class wz extends yU{constructor(t,e,n){super(),this.renderer=t,this.backend=e,this.info=n}updateRenderTarget(t,e=0){const n=this.get(t),i=0===t.samples?1:t.samples,r=n.depthTextureMips||(n.depthTextureMips={}),s=t.textures,a=this.getSize(s[0]),o=a.width>>e,l=a.height>>e;let u=t.depthTexture||r[e],h=!1;void 0===u&&(u=new tT,u.format=t.stencilBuffer?Hx:Vx,u.type=t.stencilBuffer?zx:Ox,u.image.width=o,u.image.height=l,r[e]=u),n.width===a.width&&a.height===n.height||(h=!0,u.needsUpdate=!0,u.image.width=o,u.image.height=l),n.width=a.width,n.height=a.height,n.textures=s,n.depthTexture=u,n.depth=t.depthBuffer,n.stencil=t.stencilBuffer,n.renderTarget=t,n.sampleCount!==i&&(h=!0,u.needsUpdate=!0,n.sampleCount=i);const c={sampleCount:i};for(let t=0;t<s.length;t++){const e=s[t];h&&(e.needsUpdate=!0),this.updateTexture(e,c)}if(this.updateTexture(u,c),!0!==n.initialized){n.initialized=!0;const e=()=>{t.removeEventListener("dispose",e);for(let t=0;t<s.length;t++)this._destroyTexture(s[t]);this._destroyTexture(u),this.delete(t)};t.addEventListener("dispose",e)}}updateTexture(t,e={}){const n=this.get(t);if(!0===n.initialized&&n.version===t.version)return;const i=t.isRenderTargetTexture||t.isDepthTexture||t.isFramebufferTexture,r=this.backend;if(i&&!0===n.initialized&&(r.destroySampler(t),r.destroyTexture(t)),t.isFramebufferTexture){const e=this.renderer.getRenderTarget();t.type=e?e.texture.type:Dx}const{width:s,height:a,depth:o}=this.getSize(t);if(e.width=s,e.height=a,e.depth=o,e.needsMipmaps=this.needsMipmaps(t),e.levels=e.needsMipmaps?this.getMipLevels(t,s,a):1,i||!0===t.isStorageTexture)r.createSampler(t),r.createTexture(t,e),n.generation=t.version;else{if(!0!==n.initialized&&r.createSampler(t),t.version>0){const i=t.image;if(void 0===i)console.warn("THREE.Renderer: Texture marked for update but image is undefined.");else if(!1===i.complete)console.warn("THREE.Renderer: Texture marked for update but image is incomplete.");else{if(t.images){const n=[];for(const e of t.images)n.push(e);e.images=n}else e.image=i;void 0!==n.isDefaultTexture&&!0!==n.isDefaultTexture||(r.createTexture(t,e),n.isDefaultTexture=!1,n.generation=t.version),!0===t.source.dataReady&&r.updateTexture(t,e),e.needsMipmaps&&0===t.mipmaps.length&&r.generateMipmaps(t)}}else r.createDefaultTexture(t),n.isDefaultTexture=!0,n.generation=t.version}if(!0!==n.initialized){n.initialized=!0,n.generation=t.version,this.info.memory.textures++;const e=()=>{t.removeEventListener("dispose",e),this._destroyTexture(t),this.info.memory.textures--};t.addEventListener("dispose",e)}n.version=t.version}getSize(t,e=Mz){let n=t.images?t.images[0]:t.image;return n?(void 0!==n.image&&(n=n.image),e.width=n.width,e.height=n.height,e.depth=t.isCubeTexture?6:n.depth||1):e.width=e.height=e.depth=1,e}getMipLevels(t,e,n){let i;return i=t.isCompressedTexture?t.mipmaps.length:Math.floor(Math.log2(Math.max(e,n)))+1,i}needsMipmaps(t){return!!this.isEnvironmentTexture(t)||(!0===t.isCompressedTexture||t.minFilter!==Tx&&t.minFilter!==Rx)}isEnvironmentTexture(t){const e=t.mapping;return e===xx||e===bx||e===vx||e===_x}_destroyTexture(t){this.backend.destroySampler(t),this.backend.destroyTexture(t),this.delete(t)}}class Tz extends GM{constructor(t,e,n,i=1){super(t,e,n),this.a=i}set(t,e,n,i=1){return this.a=i,super.set(t,e,n)}copy(t){return void 0!==t.a&&(this.a=t.a),super.copy(t)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}const Ez=new Tz;class Cz extends yU{constructor(t,e){super(),this.renderer=t,this.nodes=e}update(t,e,n){const i=this.renderer,r=this.nodes.getBackgroundNode(t)||t.background;let s=!1;if(null===r)i._clearColor.getRGB(Ez,vb),Ez.a=i._clearColor.a;else if(!0===r.isColor)r.getRGB(Ez,vb),Ez.a=1,s=!0;else if(!0===r.isNode){const n=this.get(t),s=r;Ez.copy(i._clearColor);let a=n.backgroundMesh;if(void 0===a){const t=MN(iC(s).mul(jO),{getUV:()=>BP,getTextureLevel:()=>HO});let e=nI();e=e.setZ(e.w);const i=new QI;i.name="Background.material",i.side=1,i.depthTest=!1,i.depthWrite=!1,i.fog=!1,i.lights=!1,i.vertexNode=e,i.colorNode=t,n.backgroundMeshNode=t,n.backgroundMesh=a=new Sw(new eT(1,32,32),i),a.frustumCulled=!1,a.name="Background.mesh",a.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)}}const o=s.getCacheKey();n.backgroundCacheKey!==o&&(n.backgroundMeshNode.node=iC(s).mul(jO),n.backgroundMeshNode.needsUpdate=!0,a.material.needsUpdate=!0,n.backgroundCacheKey=o),e.unshift(a,a.geometry,a.material,0,0,null)}else console.error("THREE.Renderer: Unsupported background configuration.",r);if(!0===i.autoClear||!0===s){Ez.multiplyScalar(Ez.a);const t=n.clearColorValue;t.r=Ez.r,t.g=Ez.g,t.b=Ez.b,t.a=Ez.a,n.depthClearValue=i._clearDepth,n.stencilClearValue=i._clearStencil,n.clearColor=!0===i.autoClearColor,n.clearDepth=!0===i.autoClearDepth,n.clearStencil=!0===i.autoClearStencil}else n.clearColor=!1,n.clearDepth=!1,n.clearStencil=!1}}class Rz{constructor(t,e,n,i,r,s,a,o,l,u=[]){this.vertexShader=t,this.fragmentShader=e,this.computeShader=n,this.transforms=u,this.nodeAttributes=i,this.bindings=r,this.updateNodes=s,this.updateBeforeNodes=a,this.updateAfterNodes=o,this.monitor=l,this.usedTimes=0}createBindings(){const t=[];for(const e of this.bindings){if(!0!==e.bindings[0].groupNode.shared){const n=new RO(e.name,[],e.index,e);t.push(n);for(const t of e.bindings)n.bindings.push(t.clone())}else t.push(e)}return t}}const Nz=new WeakMap;class Pz extends yU{constructor(t,e){super(),this.renderer=t,this.backend=e,this.nodeFrame=new BO,this.nodeBuilderCache=new Map,this.callHashCache=new cU,this.groupsData=new cU}updateGroup(t){const e=t.groupNode,n=e.name;if(n===fC.name)return!0;if(n===pC.name){const e=this.get(t),n=this.nodeFrame.renderId;return e.renderId!==n&&(e.renderId=n,!0)}if(n===dC.name){const e=this.get(t),n=this.nodeFrame.frameId;return e.frameId!==n&&(e.frameId=n,!0)}const i=[e,t];let r=this.groupsData.get(i);return void 0===r&&this.groupsData.set(i,r={}),r.version!==e.version&&(r.version=e.version,!0)}getForRenderCacheKey(t){return t.initialCacheKey}getForRender(t){const e=this.get(t);let n=e.nodeBuilderState;if(void 0===n){const{nodeBuilderCache:i}=this,r=this.getForRenderCacheKey(t);if(n=i.get(r),void 0===n){const e=this.backend.createNodeBuilder(t.object,this.renderer);e.scene=t.scene,e.material=t.material,e.camera=t.camera,e.context.material=t.material,e.lightsNode=t.lightsNode,e.environmentNode=this.getEnvironmentNode(t.scene),e.fogNode=this.getFogNode(t.scene),e.clippingContext=t.clippingContext,e.build(),n=this._createNodeBuilderState(e),i.set(r,n)}n.usedTimes++,e.nodeBuilderState=n}return n}delete(t){if(t.isRenderObject){const e=this.get(t).nodeBuilderState;e.usedTimes--,0===e.usedTimes&&this.nodeBuilderCache.delete(this.getForRenderCacheKey(t))}return super.delete(t)}getForCompute(t){const e=this.get(t);let n=e.nodeBuilderState;if(void 0===n){const i=this.backend.createNodeBuilder(t,this.renderer);i.build(),n=this._createNodeBuilderState(i),e.nodeBuilderState=n}return n}_createNodeBuilderState(t){return new Rz(t.vertexShader,t.fragmentShader,t.computeShader,t.getAttributesArray(),t.getBindings(),t.updateNodes,t.updateBeforeNodes,t.updateAfterNodes,t.monitor,t.transforms)}getEnvironmentNode(t){return t.environmentNode||this.get(t).environmentNode||null}getBackgroundNode(t){return t.backgroundNode||this.get(t).backgroundNode||null}getFogNode(t){return t.fogNode||this.get(t).fogNode||null}getCacheKey(t,e){const n=[t,e],i=this.renderer.info.calls;let r=this.callHashCache.get(n);if(void 0===r||r.callId!==i){const s=this.getEnvironmentNode(t),a=this.getFogNode(t),o=[];e&&o.push(e.getCacheKey(!0)),s&&o.push(s.getCacheKey()),a&&o.push(a.getCacheKey()),o.push(this.renderer.shadowMap.enabled?1:0),r={callId:i,cacheKey:BT(o)},this.callHashCache.set(n,r)}return r.cacheKey}updateScene(t){this.updateEnvironment(t),this.updateFog(t),this.updateBackground(t)}get isToneMappingState(){return!this.renderer.getRenderTarget()}updateBackground(t){const e=this.get(t),n=t.background;if(n){const i=0===t.backgroundBlurriness&&e.backgroundBlurriness>0||t.backgroundBlurriness>0&&0===e.backgroundBlurriness;if(e.background!==n||i){let i=null;if(!0===n.isCubeTexture||n.mapping===xx||n.mapping===bx||306===n.mapping)if(t.backgroundBlurriness>0||306===n.mapping)i=FB(n,BP);else{let t;t=!0===n.isCubeTexture?XP(n):uP(n),i=uL(t)}else!0===n.isTexture?i=uP(n,DI.flipY()).setUpdateMatrix(!0):!0!==n.isColor&&console.error("WebGPUNodes: Unsupported background configuration.",n);e.backgroundNode=i,e.background=n,e.backgroundBlurriness=t.backgroundBlurriness}}else e.backgroundNode&&(delete e.backgroundNode,delete e.background)}updateFog(t){const e=this.get(t),n=t.fog;if(n){if(e.fog!==n){let t=null;if(n.isFogExp2){const e=eD("color","color",n).setGroup(pC),i=eD("density","float",n).setGroup(pC);t=xk(e,i)}else if(n.isFog){const e=eD("color","color",n).setGroup(pC),i=eD("near","float",n).setGroup(pC),r=eD("far","float",n).setGroup(pC);t=vk(e,i,r)}else console.error("WebGPUNodes: Unsupported fog configuration.",n);e.fogNode=t,e.fog=n}}else delete e.fogNode,delete e.fog}updateEnvironment(t){const e=this.get(t),n=t.environment;if(n){if(e.environment!==n){let t=null;!0===n.isCubeTexture?t=XP(n):!0===n.isTexture?t=uP(n):console.error("Nodes: Unsupported environment configuration.",n),e.environmentNode=t,e.environment=n}}else e.environmentNode&&(delete e.environmentNode,delete e.environment)}getNodeFrame(t=this.renderer,e=null,n=null,i=null,r=null){const s=this.nodeFrame;return s.renderer=t,s.scene=e,s.object=n,s.camera=i,s.material=r,s}getNodeFrameForRender(t){return this.getNodeFrame(t.renderer,t.scene,t.object,t.camera,t.material)}getOutputCacheKey(){const t=this.renderer;return t.toneMapping+","+t.currentColorSpace}hasOutputChange(t){return Nz.get(t)!==this.getOutputCacheKey()}getOutputNode(t){const e=this.renderer,n=this.getOutputCacheKey(),i=uP(t,DI).renderOutput(e.toneMapping,e.currentColorSpace);return Nz.set(t,n),i}updateBefore(t){const e=t.getNodeBuilderState();for(const n of e.updateBeforeNodes)this.getNodeFrameForRender(t).updateBeforeNode(n)}updateAfter(t){const e=t.getNodeBuilderState();for(const n of e.updateAfterNodes)this.getNodeFrameForRender(t).updateAfterNode(n)}updateForCompute(t){const e=this.getNodeFrame(),n=this.getForCompute(t);for(const t of n.updateNodes)e.updateNode(t)}updateForRender(t){const e=this.getNodeFrameForRender(t),n=t.getNodeBuilderState();for(const t of n.updateNodes)e.updateNode(t)}needsRefresh(t){const e=this.getNodeFrameForRender(t);return t.getMonitor().needsRefresh(t,e)}dispose(){super.dispose(),this.nodeFrame=new BO,this.nodeBuilderCache=new Map}}class Dz{constructor(t,e){this.scene=t,this.camera=e}clone(){return Object.assign(new this.constructor,this)}}class Iz{constructor(){this.lists=new cU}get(t,e){const n=this.lists,i=[t,e];let r=n.get(i);return void 0===r&&(r=new Dz(t,e),n.set(i,r)),r}dispose(){this.lists=new cU}}class Lz{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map,this.colorSpaceNodes=new Map}fromMaterial(t){if(t.isNodeMaterial)return t;let e=null;const n=this.getMaterialNodeClass(t.type);if(null!==n){e=new n;for(const n in t)e[n]=t[n]}return e}addColorSpace(t,e){this.addType(t,e,this.colorSpaceNodes)}getColorSpaceFunction(t){return this.colorSpaceNodes.get(t)||null}addToneMapping(t,e){this.addType(t,e,this.toneMappingNodes)}getToneMappingFunction(t){return this.toneMappingNodes.get(t)||null}getMaterialNodeClass(t){return this.materialNodes.get(t)||null}addMaterial(t,e){this.addType(t,e.name,this.materialNodes)}getLightNodeClass(t){return this.lightNodes.get(t)||null}addLight(t,e){this.addClass(t,e,this.lightNodes)}addType(t,e,n){if(n.has(e))console.warn(`Redefinition of node ${e}`);else{if("function"!=typeof t)throw new Error(`Node class ${t.name} is not a class.`);if("function"==typeof e||"object"==typeof e)throw new Error(`Base class ${e} is not a class.`);n.set(e,t)}}addClass(t,e,n){if(n.has(e))console.warn(`Redefinition of node ${e.name}`);else{if("function"!=typeof t)throw new Error(`Node class ${t.name} is not a class.`);if("function"!=typeof e)throw new Error(`Base class ${e.name} is not a class.`);n.set(e,t)}}}const Bz=new Ow,Uz=new $b,Oz=new fS,Fz=new $w,kz=new $S,zz=new fS;class qz{constructor(t,e={}){this.isRenderer=!0;const{logarithmicDepthBuffer:n=!1,alpha:i=!0,depth:r=!0,stencil:s=!1,antialias:a=!1,samples:o=0,getFallback:l=null}=e;this.domElement=t.getDomElement(),this.backend=t,this.samples=o||!0===a?4:0,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.alpha=i,this.logarithmicDepthBuffer=n,this.outputColorSpace=yb,this.toneMapping=0,this.toneMappingExposure=1,this.sortObjects=!0,this.depth=r,this.stencil=s,this.clippingPlanes=[],this.info=new EU,this.nodes={library:new Lz,modelViewMatrix:null,modelNormalViewMatrix:null},this._getFallback=l,this._pixelRatio=1,this._width=this.domElement.width,this._height=this.domElement.height,this._viewport=new fS(0,0,this._width,this._height),this._scissor=new fS(0,0,this._width,this._height),this._scissorTest=!1,this._attributes=null,this._geometries=null,this._nodes=null,this._animation=null,this._bindings=null,this._objects=null,this._pipelines=null,this._bundles=null,this._renderLists=null,this._renderContexts=null,this._textures=null,this._background=null,this._quad=new GO(new QI),this._quad.material.type="Renderer_output",this._currentRenderContext=null,this._opaqueSort=null,this._transparentSort=null,this._frameBufferTarget=null;const u=!0===this.alpha?0:1;this._clearColor=new Tz(0,0,0,u),this._clearDepth=1,this._clearStencil=0,this._renderTarget=null,this._activeCubeFace=0,this._activeMipmapLevel=0,this._mrt=null,this._renderObjectFunction=null,this._currentRenderObjectFunction=null,this._currentRenderBundle=null,this._handleObjectFunction=this._renderObjectDirect,this._initialized=!1,this._initPromise=null,this._compilationPromises=null,this.transparent=!0,this.opaque=!0,this.shadowMap={enabled:!1,type:1},this.xr={enabled:!1},this.debug={checkShaderErrors:!0,onShaderError:null,getShaderAsync:async(t,e,n)=>{await this.compileAsync(t,e);const i=this._renderLists.get(t,e),r=this._renderContexts.get(t,e,this._renderTarget),s=t.overrideMaterial||n.material,a=this._objects.get(n,s,t,e,i.lightsNode,r),{fragmentShader:o,vertexShader:l}=a.getNodeBuilderState();return{fragmentShader:o,vertexShader:l}}}}async init(){if(this._initialized)throw new Error("Renderer: Backend has already been initialized.");return null!==this._initPromise||(this._initPromise=new Promise((async(t,e)=>{let n=this.backend;try{await n.init(this)}catch(t){if(null===this._getFallback)return void e(t);try{this.backend=n=this._getFallback(t),await n.init(this)}catch(t){return void e(t)}}this._nodes=new Pz(this,n),this._animation=new hU(this._nodes,this.info),this._attributes=new SU(n),this._background=new Cz(this,this._nodes),this._geometries=new TU(this._attributes,this.info),this._textures=new wz(this,n,this.info),this._pipelines=new IU(n,this._nodes),this._bindings=new LU(n,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new gU(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new vz,this._bundles=new Iz,this._renderContexts=new Sz,this._initialized=!0,t()}))),this._initPromise}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(t,e,n=null){!1===this._initialized&&await this.init();const i=this._nodes.nodeFrame,r=i.renderId,s=this._currentRenderContext,a=this._currentRenderObjectFunction,o=this._compilationPromises,l=!0===t.isScene?t:Bz;null===n&&(n=t);const u=this._renderTarget,h=this._renderContexts.get(n,e,u),c=this._activeMipmapLevel,A=[];this._currentRenderContext=h,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=A,i.renderId++,i.update(),h.depth=this.depth,h.stencil=this.stencil,h.clippingContext||(h.clippingContext=new dU),h.clippingContext.updateGlobal(this,e),l.onBeforeRender(this,t,e,u);const d=this._renderLists.get(t,e);if(d.begin(),this._projectObject(t,e,0,d),n!==t&&n.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&d.pushLight(t)})),d.finish(),null!==u){this._textures.updateRenderTarget(u,c);const t=this._textures.get(u);h.textures=t.textures,h.depthTexture=t.depthTexture}else h.textures=null,h.depthTexture=null;this._nodes.updateScene(l),this._background.update(l,d,h);const p=d.opaque,f=d.transparent,m=d.lightsNode;!0===this.opaque&&p.length>0&&this._renderObjects(p,e,l,m),!0===this.transparent&&f.length>0&&this._renderObjects(f,e,l,m),i.renderId=r,this._currentRenderContext=s,this._currentRenderObjectFunction=a,this._compilationPromises=o,this._handleObjectFunction=this._renderObjectDirect,await Promise.all(A)}async renderAsync(t,e){!1===this._initialized&&await this.init();const n=this._renderScene(t,e);await this.backend.resolveTimestampAsync(n,"render")}setMRT(t){return this._mrt=t,this}getMRT(){return this._mrt}_renderBundle(t,e,n){const{bundleGroup:i,camera:r,renderList:s}=t,a=this._currentRenderContext,o=this._bundles.get(i,r),l=this.backend.get(o);void 0===l.renderContexts&&(l.renderContexts=new Set);const u=i.version!==l.version,h=!1===l.renderContexts.has(a)||u;if(l.renderContexts.add(a),h){this.backend.beginBundle(a),(void 0===l.renderObjects||u)&&(l.renderObjects=[]),this._currentRenderBundle=o;const t=s.opaque;t.length>0&&this._renderObjects(t,r,e,n),this._currentRenderBundle=null,this.backend.finishBundle(a,o),l.version=i.version}else{const{renderObjects:t}=l;for(let e=0,n=t.length;e<n;e++){const n=t[e];this._nodes.needsRefresh(n)&&(this._nodes.updateBefore(n),this._nodes.updateForRender(n),this._bindings.updateForRender(n),this._nodes.updateAfter(n))}}this.backend.addBundle(a,o)}render(t,e){if(!1===this._initialized)return console.warn("THREE.Renderer: .render() called before the backend is initialized. Try using .renderAsync() instead."),this.renderAsync(t,e);this._renderScene(t,e)}_getFrameBufferTarget(){const{currentToneMapping:t,currentColorSpace:e}=this;if(!1===(0!==t)&&!1===(e!==vb))return null;const{width:n,height:i}=this.getDrawingBufferSize(Uz),{depth:r,stencil:s}=this;let a=this._frameBufferTarget;return null===a&&(a=new mS(n,i,{depthBuffer:r,stencilBuffer:s,type:kx,format:Gx,colorSpace:vb,generateMipmaps:!1,minFilter:Rx,magFilter:Rx,samples:this.samples}),a.isPostProcessingRenderTarget=!0,this._frameBufferTarget=a),a.depthBuffer=r,a.stencilBuffer=s,a.setSize(n,i),a.viewport.copy(this._viewport),a.scissor.copy(this._scissor),a.viewport.multiplyScalar(this._pixelRatio),a.scissor.multiplyScalar(this._pixelRatio),a.scissorTest=this._scissorTest,a}_renderScene(t,e,n=!0){const i=n?this._getFrameBufferTarget():null,r=this._nodes.nodeFrame,s=r.renderId,a=this._currentRenderContext,o=this._currentRenderObjectFunction,l=!0===t.isScene?t:Bz,u=this._renderTarget,h=this._activeCubeFace,c=this._activeMipmapLevel;let A;null!==i?(A=i,this.setRenderTarget(A)):A=u;const d=this._renderContexts.get(t,e,A);this._currentRenderContext=d,this._currentRenderObjectFunction=this._renderObjectFunction||this.renderObject,this.info.calls++,this.info.render.calls++,this.info.render.frameCalls++,r.renderId=this.info.calls;const p=this.coordinateSystem;e.coordinateSystem!==p&&(e.coordinateSystem=p,e.updateProjectionMatrix()),!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld();let f=this._viewport,m=this._scissor,g=this._pixelRatio;null!==A&&(f=A.viewport,m=A.scissor,g=1),this.getDrawingBufferSize(Uz),Oz.set(0,0,Uz.width,Uz.height);const y=void 0===f.minDepth?0:f.minDepth,v=void 0===f.maxDepth?1:f.maxDepth;d.viewportValue.copy(f).multiplyScalar(g).floor(),d.viewportValue.width>>=c,d.viewportValue.height>>=c,d.viewportValue.minDepth=y,d.viewportValue.maxDepth=v,d.viewport=!1===d.viewportValue.equals(Oz),d.scissorValue.copy(m).multiplyScalar(g).floor(),d.scissor=this._scissorTest&&!1===d.scissorValue.equals(Oz),d.scissorValue.width>>=c,d.scissorValue.height>>=c,d.clippingContext||(d.clippingContext=new dU),d.clippingContext.updateGlobal(this,e),l.onBeforeRender(this,t,e,A),kz.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Fz.setFromProjectionMatrix(kz,p);const _=this._renderLists.get(t,e);if(_.begin(),this._projectObject(t,e,0,_),_.finish(),!0===this.sortObjects&&_.sort(this._opaqueSort,this._transparentSort),null!==A){this._textures.updateRenderTarget(A,c);const t=this._textures.get(A);d.textures=t.textures,d.depthTexture=t.depthTexture,d.width=t.width,d.height=t.height,d.renderTarget=A,d.depth=A.depthBuffer,d.stencil=A.stencilBuffer}else d.textures=null,d.depthTexture=null,d.width=this.domElement.width,d.height=this.domElement.height,d.depth=this.depth,d.stencil=this.stencil;d.width>>=c,d.height>>=c,d.activeCubeFace=h,d.activeMipmapLevel=c,d.occlusionQueryCount=_.occlusionQueryCount,this._nodes.updateScene(l),this._background.update(l,_,d),this.backend.beginRender(d);const{bundles:x,lightsNode:b,transparent:S,opaque:M}=_;if(x.length>0&&this._renderBundles(x,l,b),!0===this.opaque&&M.length>0&&this._renderObjects(M,e,l,b),!0===this.transparent&&S.length>0&&this._renderObjects(S,e,l,b),this.backend.finishRender(d),r.renderId=s,this._currentRenderContext=a,this._currentRenderObjectFunction=o,null!==i){this.setRenderTarget(u,h,c);const t=this._quad;this._nodes.hasOutputChange(A.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(A.texture),t.material.needsUpdate=!0),this._renderScene(t,t.camera,!1)}return l.onAfterRender(this,t,e,A),d}getMaxAnisotropy(){return this.backend.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(t){!1===this._initialized&&await this.init(),this._animation.setAnimationLoop(t)}async getArrayBufferAsync(t){return await this.backend.getArrayBufferAsync(t)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(t){return t.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(t){return t.set(this._width,this._height)}setPixelRatio(t=1){this._pixelRatio=t,this.setSize(this._width,this._height,!1)}setDrawingBufferSize(t,e,n){this._width=t,this._height=e,this._pixelRatio=n,this.domElement.width=Math.floor(t*n),this.domElement.height=Math.floor(e*n),this.setViewport(0,0,t,e),this._initialized&&this.backend.updateSize()}setSize(t,e,n=!0){this._width=t,this._height=e,this.domElement.width=Math.floor(t*this._pixelRatio),this.domElement.height=Math.floor(e*this._pixelRatio),!0===n&&(this.domElement.style.width=t+"px",this.domElement.style.height=e+"px"),this.setViewport(0,0,t,e),this._initialized&&this.backend.updateSize()}setOpaqueSort(t){this._opaqueSort=t}setTransparentSort(t){this._transparentSort=t}getScissor(t){const e=this._scissor;return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t}setScissor(t,e,n,i){const r=this._scissor;t.isVector4?r.copy(t):r.set(t,e,n,i)}getScissorTest(){return this._scissorTest}setScissorTest(t){this._scissorTest=t,this.backend.setScissorTest(t)}getViewport(t){return t.copy(this._viewport)}setViewport(t,e,n,i,r=0,s=1){const a=this._viewport;t.isVector4?a.copy(t):a.set(t,e,n,i),a.minDepth=r,a.maxDepth=s}getClearColor(t){return t.copy(this._clearColor)}setClearColor(t,e=1){this._clearColor.set(t),this._clearColor.a=e}getClearAlpha(){return this._clearColor.a}setClearAlpha(t){this._clearColor.a=t}getClearDepth(){return this._clearDepth}setClearDepth(t){this._clearDepth=t}getClearStencil(){return this._clearStencil}setClearStencil(t){this._clearStencil=t}isOccluded(t){const e=this._currentRenderContext;return e&&this.backend.isOccluded(e,t)}clear(t=!0,e=!0,n=!0){if(!1===this._initialized)return console.warn("THREE.Renderer: .clear() called before the backend is initialized. Try using .clearAsync() instead."),this.clearAsync(t,e,n);const i=this._renderTarget||this._getFrameBufferTarget();let r=null;if(null!==i&&(this._textures.updateRenderTarget(i),r=this._textures.get(i)),this.backend.clear(t,e,n,r),null!==i&&null===this._renderTarget){const t=this._quad;this._nodes.hasOutputChange(i.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(i.texture),t.material.needsUpdate=!0),this._renderScene(t,t.camera,!1)}}clearColor(){return this.clear(!0,!1,!1)}clearDepth(){return this.clear(!1,!0,!1)}clearStencil(){return this.clear(!1,!1,!0)}async clearAsync(t=!0,e=!0,n=!0){!1===this._initialized&&await this.init(),this.clear(t,e,n)}clearColorAsync(){return this.clearAsync(!0,!1,!1)}clearDepthAsync(){return this.clearAsync(!1,!0,!1)}clearStencilAsync(){return this.clearAsync(!1,!1,!0)}get currentToneMapping(){return null!==this._renderTarget?0:this.toneMapping}get currentColorSpace(){return null!==this._renderTarget?vb:this.outputColorSpace}dispose(){this.info.dispose(),this._animation.dispose(),this._objects.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose(),this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(t,e=0,n=0){this._renderTarget=t,this._activeCubeFace=e,this._activeMipmapLevel=n}getRenderTarget(){return this._renderTarget}setRenderObjectFunction(t){this._renderObjectFunction=t}getRenderObjectFunction(){return this._renderObjectFunction}async computeAsync(t){!1===this._initialized&&await this.init();const e=this._nodes.nodeFrame,n=e.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,e.renderId=this.info.calls;const i=this.backend,r=this._pipelines,s=this._bindings,a=this._nodes,o=Array.isArray(t)?t:[t];if(void 0===o[0]||!0!==o[0].isComputeNode)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");i.beginCompute(t);for(const e of o){if(!1===r.has(e)){const t=()=>{e.removeEventListener("dispose",t),r.delete(e),s.delete(e),a.delete(e)};e.addEventListener("dispose",t),e.onInit({renderer:this})}a.updateForCompute(e),s.updateForCompute(e);const n=s.getForCompute(e),o=r.getForCompute(e,n);i.compute(t,e,n,o)}i.finishCompute(t),await this.backend.resolveTimestampAsync(t,"compute"),e.renderId=n}async hasFeatureAsync(t){return!1===this._initialized&&await this.init(),this.backend.hasFeature(t)}hasFeature(t){return!1===this._initialized?(console.warn("THREE.Renderer: .hasFeature() called before the backend is initialized. Try using .hasFeatureAsync() instead."),!1):this.backend.hasFeature(t)}copyFramebufferToTexture(t,e=null){const n=this._currentRenderContext;this._textures.updateTexture(t),e=null===e?zz.set(0,0,t.image.width,t.image.height):e,this.backend.copyFramebufferToTexture(t,n,e)}copyTextureToTexture(t,e,n=null,i=null,r=0){this._textures.updateTexture(t),this._textures.updateTexture(e),this.backend.copyTextureToTexture(t,e,n,i,r)}readRenderTargetPixelsAsync(t,e,n,i,r,s=0,a=0){return this.backend.copyTextureToBuffer(t.textures[s],e,n,i,r,a)}_projectObject(t,e,n,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)i.pushLight(t);else if(t.isSprite){if(!t.frustumCulled||Fz.intersectsSprite(t)){!0===this.sortObjects&&zz.setFromMatrixPosition(t.matrixWorld).applyMatrix4(kz);const{geometry:e,material:r}=t;r.visible&&i.push(t,e,r,n,zz.z,null)}}else if(t.isLineLoop)console.error("THREE.Renderer: Objects of type THREE.LineLoop are not supported. Please use THREE.Line or THREE.LineSegments.");else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Fz.intersectsObject(t))){const{geometry:e,material:r}=t;if(!0===this.sortObjects&&(null===e.boundingSphere&&e.computeBoundingSphere(),zz.copy(e.boundingSphere.center).applyMatrix4(t.matrixWorld).applyMatrix4(kz)),Array.isArray(r)){const s=e.groups;for(let a=0,o=s.length;a<o;a++){const o=s[a],l=r[o.materialIndex];l&&l.visible&&i.push(t,e,l,n,zz.z,o)}}else r.visible&&i.push(t,e,r,n,zz.z,null)}if(!0===t.isBundleGroup&&void 0!==this.backend.beginBundle){const n=i;(i=this._renderLists.get(t,e)).begin(),n.pushBundle({bundleGroup:t,camera:e,renderList:i}),i.finish()}const r=t.children;for(let t=0,s=r.length;t<s;t++)this._projectObject(r[t],e,n,i)}_renderBundles(t,e,n){for(const i of t)this._renderBundle(i,e,n)}_renderObjects(t,e,n,i){for(let r=0,s=t.length;r<s;r++){const s=t[r],{object:a,geometry:o,material:l,group:u}=s;if(e.isArrayCamera){const t=e.cameras;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(a.layers.test(r.layers)){const t=r.viewport,e=void 0===t.minDepth?0:t.minDepth,s=void 0===t.maxDepth?1:t.maxDepth,h=this._currentRenderContext.viewportValue;h.copy(t).multiplyScalar(this._pixelRatio).floor(),h.minDepth=e,h.maxDepth=s,this.backend.updateViewport(this._currentRenderContext),this._currentRenderObjectFunction(a,n,r,o,l,u,i)}}}else this._currentRenderObjectFunction(a,n,e,o,l,u,i)}}renderObject(t,e,n,i,r,s,a){let o,l,u;if(t.onBeforeRender(this,e,n,i,r,s),null!==e.overrideMaterial){const t=e.overrideMaterial;r.positionNode&&r.positionNode.isNode&&(o=t.positionNode,t.positionNode=r.positionNode),t.isShadowNodeMaterial&&(t.side=null===r.shadowSide?r.side:r.shadowSide,r.depthNode&&r.depthNode.isNode&&(u=t.depthNode,t.depthNode=r.depthNode),r.shadowNode&&r.shadowNode.isNode&&(l=t.fragmentNode,t.fragmentNode=r.shadowNode),this.localClippingEnabled&&(r.clipShadows?(t.clippingPlanes!==r.clippingPlanes&&(t.clippingPlanes=r.clippingPlanes,t.needsUpdate=!0),t.clipIntersection!==r.clipIntersection&&(t.clipIntersection=r.clipIntersection)):Array.isArray(t.clippingPlanes)&&(t.clippingPlanes=null,t.needsUpdate=!0))),r=t}!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=1,this._handleObjectFunction(t,r,e,n,a,s,"backSide"),r.side=0,this._handleObjectFunction(t,r,e,n,a,s),r.side=2):this._handleObjectFunction(t,r,e,n,a,s),void 0!==o&&(e.overrideMaterial.positionNode=o),void 0!==u&&(e.overrideMaterial.depthNode=u),void 0!==l&&(e.overrideMaterial.fragmentNode=l),t.onAfterRender(this,e,n,i,r,s)}_renderObjectDirect(t,e,n,i,r,s,a){const o=this._objects.get(t,e,n,i,r,this._currentRenderContext,a);o.drawRange=t.geometry.drawRange,o.group=s;const l=this._nodes.needsRefresh(o);if(l&&(this._nodes.updateBefore(o),this._geometries.updateForRender(o),this._nodes.updateForRender(o),this._bindings.updateForRender(o)),this._pipelines.updateForRender(o),null!==this._currentRenderBundle){this.backend.get(this._currentRenderBundle).renderObjects.push(o),o.bundle=this._currentRenderBundle.scene}this.backend.draw(o,this.info),l&&this._nodes.updateAfter(o)}_createObjectPipeline(t,e,n,i,r,s){const a=this._objects.get(t,e,n,i,r,this._currentRenderContext,s);this._nodes.updateBefore(a),this._geometries.updateForRender(a),this._nodes.updateForRender(a),this._bindings.updateForRender(a),this._pipelines.getForRender(a,this._compilationPromises),this._nodes.updateAfter(a)}get compute(){return this.computeAsync}get compile(){return this.compileAsync}}class Gz{constructor(t=""){this.name=t,this.visibility=0}setVisibility(t){this.visibility|=t}clone(){return Object.assign(new this.constructor,this)}}let Vz=class extends Gz{constructor(t,e=null){super(t),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=e}get byteLength(){return(t=this._buffer.byteLength)+(bU-t%bU)%bU;var t}get buffer(){return this._buffer}update(){return!0}};class Hz extends Vz{constructor(t,e=null){super(t,e),this.isUniformBuffer=!0}}let jz=0;class Wz extends Hz{constructor(t,e){super("UniformBuffer_"+jz++,t?t.value:null),this.nodeUniform=t,this.groupNode=e}get buffer(){return this.nodeUniform.value}}class Xz extends Hz{constructor(t){super(t),this.isUniformsGroup=!0,this._values=null,this.uniforms=[]}addUniform(t){return this.uniforms.push(t),this}removeUniform(t){const e=this.uniforms.indexOf(t);return-1!==e&&this.uniforms.splice(e,1),this}get values(){return null===this._values&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let t=this._buffer;if(null===t){const e=this.byteLength;t=new Float32Array(new ArrayBuffer(e)),this._buffer=t}return t}get byteLength(){let t=0;for(let e=0,n=this.uniforms.length;e<n;e++){const n=this.uniforms[e],{boundary:i,itemSize:r}=n,s=t%bU;0!==s&&bU-s-i<0?t+=bU-s:s%i!=0&&(t+=s%i),n.offset=t/this.bytesPerElement,t+=r*this.bytesPerElement}return Math.ceil(t/bU)*bU}update(){let t=!1;for(const e of this.uniforms)!0===this.updateByType(e)&&(t=!0);return t}updateByType(t){return t.isNumberUniform?this.updateNumber(t):t.isVector2Uniform?this.updateVector2(t):t.isVector3Uniform?this.updateVector3(t):t.isVector4Uniform?this.updateVector4(t):t.isColorUniform?this.updateColor(t):t.isMatrix3Uniform?this.updateMatrix3(t):t.isMatrix4Uniform?this.updateMatrix4(t):void console.error("THREE.WebGPUUniformsGroup: Unsupported uniform type.",t)}updateNumber(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r]!==i){this.buffer[r]=n[r]=i,e=!0}return e}updateVector2(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r+0]!==i.x||n[r+1]!==i.y){const t=this.buffer;t[r+0]=n[r+0]=i.x,t[r+1]=n[r+1]=i.y,e=!0}return e}updateVector3(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r+0]!==i.x||n[r+1]!==i.y||n[r+2]!==i.z){const t=this.buffer;t[r+0]=n[r+0]=i.x,t[r+1]=n[r+1]=i.y,t[r+2]=n[r+2]=i.z,e=!0}return e}updateVector4(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r+0]!==i.x||n[r+1]!==i.y||n[r+2]!==i.z||n[r+4]!==i.w){const t=this.buffer;t[r+0]=n[r+0]=i.x,t[r+1]=n[r+1]=i.y,t[r+2]=n[r+2]=i.z,t[r+3]=n[r+3]=i.w,e=!0}return e}updateColor(t){let e=!1;const n=this.values,i=t.getValue(),r=t.offset;if(n[r+0]!==i.r||n[r+1]!==i.g||n[r+2]!==i.b){const t=this.buffer;t[r+0]=n[r+0]=i.r,t[r+1]=n[r+1]=i.g,t[r+2]=n[r+2]=i.b,e=!0}return e}updateMatrix3(t){let e=!1;const n=this.values,i=t.getValue().elements,r=t.offset;if(n[r+0]!==i[0]||n[r+1]!==i[1]||n[r+2]!==i[2]||n[r+4]!==i[3]||n[r+5]!==i[4]||n[r+6]!==i[5]||n[r+8]!==i[6]||n[r+9]!==i[7]||n[r+10]!==i[8]){const t=this.buffer;t[r+0]=n[r+0]=i[0],t[r+1]=n[r+1]=i[1],t[r+2]=n[r+2]=i[2],t[r+4]=n[r+4]=i[3],t[r+5]=n[r+5]=i[4],t[r+6]=n[r+6]=i[5],t[r+8]=n[r+8]=i[6],t[r+9]=n[r+9]=i[7],t[r+10]=n[r+10]=i[8],e=!0}return e}updateMatrix4(t){let e=!1;const n=this.values,i=t.getValue().elements,r=t.offset;if(!1===function(t,e,n){for(let i=0,r=e.length;i<r;i++)if(t[n+i]!==e[i])return!1;return!0}(n,i,r)){this.buffer.set(i,r),function(t,e,n){for(let i=0,r=e.length;i<r;i++)t[n+i]=e[i]}(n,i,r),e=!0}return e}}let Yz=0;class Qz extends Xz{constructor(t,e){super(t),this.id=Yz++,this.groupNode=e,this.isNodeUniformsGroup=!0}getNodes(){const t=[];for(const e of this.uniforms){const n=e.nodeUniform.node;if(!n)throw new Error("NodeUniformsGroup: Uniform has no node.");t.push(n)}return t}}let $z=0;class Zz extends Gz{constructor(t,e){super(t),this.id=$z++,this.texture=e,this.version=e?e.version:0,this.store=!1,this.generation=null,this.isSampledTexture=!0}needsBindingsUpdate(t){const{texture:e}=this;return t!==this.generation?(this.generation=t,!0):e.isVideoTexture}update(){const{texture:t,version:e}=this;return e!==t.version&&(this.version=t.version,!0)}}class Kz extends Zz{constructor(t,e,n,i=null){super(t,e?e.value:null),this.textureNode=e,this.groupNode=n,this.access=i}needsBindingsUpdate(t){return this.textureNode.value!==this.texture||super.needsBindingsUpdate(t)}update(){const{textureNode:t}=this;return this.texture!==t.value?(this.texture=t.value,!0):super.update()}}class Jz extends Kz{constructor(t,e,n,i){super(t,e,n,i),this.isSampledCubeTexture=!0}}class tq extends Kz{constructor(t,e,n,i){super(t,e,n,i),this.isSampledTexture3D=!0}}const eq={atan2:"atan",textureDimensions:"textureSize",equals:"equal"},nq={low:"lowp",medium:"mediump",high:"highp"},iq={swizzleAssign:!0,storageBuffer:!1},rq="\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\nprecision highp sampler3D;\nprecision highp samplerCube;\nprecision highp sampler2DArray;\n\nprecision highp usampler2D;\nprecision highp usampler3D;\nprecision highp usamplerCube;\nprecision highp usampler2DArray;\n\nprecision highp isampler2D;\nprecision highp isampler3D;\nprecision highp isamplerCube;\nprecision highp isampler2DArray;\n\nprecision lowp sampler2DShadow;\n";class sq extends LO{constructor(t,e){super(t,e,new fz),this.uniformGroups={},this.transforms=[],this.extensions={},this.useComparisonMethod=!0}needsColorSpaceToLinearSRGB(t){return!0===t.isVideoTexture&&t.colorSpace!==gb}getMethod(t){return eq[t]||t}getOutputStructName(){return""}buildFunctionCode(t){const e=t.layout,n=this.flowShaderNode(t),i=[];for(const t of e.inputs)i.push(this.getType(t.type)+" "+t.name);return`${this.getType(e.type)} ${e.name}( ${i.join(", ")} ) {\n\n\t${n.vars}\n\n${n.code}\n\treturn ${n.result};\n\n}`}setupPBO(t){const e=t.value;if(void 0===e.pbo){const t=e.array,n=e.count*e.itemSize,{itemSize:i}=e,r=e.array.constructor.name.toLowerCase().includes("int");let s=r?Wx:jx;2===i?s=r?Yx:Xx:3===i?s=r?1032:qx:4===i&&(s=r?Qx:Gx);const a={Float32Array:Fx,Uint8Array:Dx,Uint16Array:Bx,Uint32Array:Ox,Int8Array:Ix,Int16Array:Lx,Int32Array:Ux,Uint8ClampedArray:Dx},o=Math.pow(2,Math.ceil(Math.log2(Math.sqrt(n/i))));let l=Math.ceil(n/i/o);o*l*i<n&&l++;const u=o*l*i,h=new t.constructor(u);h.set(t,0),e.array=h;const c=new Gw(e.array,o,l,s,a[e.array.constructor.name]||Fx);c.needsUpdate=!0,c.isPBOTexture=!0;const A=new lP(c,null,null);A.setPrecision("high"),e.pboNode=A,e.pbo=A.value,this.getUniformFromNode(e.pboNode,"texture",this.shaderStage,this.context.label)}}getPropertyName(t,e=this.shaderStage){return t.isNodeUniform&&!0!==t.node.isTextureNode&&!0!==t.node.isBufferNode?e.charAt(0)+"_"+t.name:super.getPropertyName(t,e)}generatePBO(t){const{node:e,indexNode:n}=t,i=e.value;if(this.renderer.backend.has(i)){this.renderer.backend.get(i).pbo=i.pbo}const r=this.getUniformFromNode(i.pboNode,"texture",this.shaderStage,this.context.label),s=this.getPropertyName(r);this.increaseUsage(n);const a=n.build(this,"uint"),o=this.getDataFromNode(t);let l=o.propertyName;if(void 0===l){const n=this.getVarFromNode(t);l=this.getPropertyName(n);const r=this.getDataFromNode(e);let u=r.propertySizeName;void 0===u&&(u=l+"Size",this.getVarFromNode(e,u,"uint"),this.addLineFlowCode(`${u} = uint( textureSize( ${s}, 0 ).x )`,t),r.propertySizeName=u);const{itemSize:h}=i,c="."+YT.join("").slice(0,h),A=`ivec2(${a} % ${u}, ${a} / ${u})`,d=this.generateTextureLoad(null,s,A,null,"0");let p="vec4";i.pbo.type===Ox?p="uvec4":i.pbo.type===Ux&&(p="ivec4"),this.addLineFlowCode(`${l} = ${p}(${d})${c}`,t),o.propertyName=l}return l}generateTextureLoad(t,e,n,i,r="0"){return i?`texelFetch( ${e}, ivec3( ${n}, ${i} ), ${r} )`:`texelFetch( ${e}, ${n}, ${r} )`}generateTexture(t,e,n,i){return t.isDepthTexture?`texture( ${e}, ${n} ).x`:(i&&(n=`vec3( ${n}, ${i} )`),`texture( ${e}, ${n} )`)}generateTextureLevel(t,e,n,i){return`textureLod( ${e}, ${n}, ${i} )`}generateTextureBias(t,e,n,i){return`texture( ${e}, ${n}, ${i} )`}generateTextureGrad(t,e,n,i){return`textureGrad( ${e}, ${n}, ${i[0]}, ${i[1]} )`}generateTextureCompare(t,e,n,i,r,s=this.shaderStage){if("fragment"===s)return`texture( ${e}, vec3( ${n}, ${i} ) )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${s} shader.`)}getVars(t){const e=[],n=this.vars[t];if(void 0!==n)for(const t of n)e.push(`${this.getVar(t.type,t.name)};`);return e.join("\n\t")}getUniforms(t){const e=this.uniforms[t],n=[],i={};for(const r of e){let e=null,s=!1;if("texture"===r.type){const t=r.node.value;let n="";!0===t.isDataTexture&&(t.type===Ox?n="u":t.type===Ux&&(n="i")),e=t.compareFunction?`sampler2DShadow ${r.name};`:!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture?`${n}sampler2DArray ${r.name};`:`${n}sampler2D ${r.name};`}else if("cubeTexture"===r.type)e=`samplerCube ${r.name};`;else if("texture3D"===r.type)e=`sampler3D ${r.name};`;else if("buffer"===r.type){const t=r.node,n=this.getType(t.bufferType),i=t.bufferCount,s=i>0?i:"";e=`${t.name} {\n\t${n} ${r.name}[${s}];\n};\n`}else{e=`${this.getVectorType(r.type)} ${this.getPropertyName(r,t)};`,s=!0}const a=r.node.precision;if(null!==a&&(e=nq[a]+" "+e),s){e="\t"+e;const t=r.groupNode.name;(i[t]||(i[t]=[])).push(e)}else e="uniform "+e,n.push(e)}let r="";for(const e in i){const n=i[e];r+=this._getGLSLUniformStruct(t+"_"+e,n.join("\n"))+"\n"}return r+=n.join("\n"),r}getTypeFromAttribute(t){let e=super.getTypeFromAttribute(t);if(/^[iu]/.test(e)&&t.gpuType!==Ux){let n=t;t.isInterleavedBufferAttribute&&(n=t.data);const i=n.array;!1==(i instanceof Uint32Array||i instanceof Int32Array)&&(e=e.slice(1))}return e}getAttributes(t){let e="";if("vertex"===t||"compute"===t){const t=this.getAttributesArray();let n=0;for(const i of t)e+=`layout( location = ${n++} ) in ${i.type} ${i.name};\n`}return e}getStructMembers(t){const e=[],n=t.getMemberTypes();for(let t=0;t<n.length;t++){const i=n[t];e.push(`layout( location = ${t} ) out ${i} m${t};`)}return e.join("\n")}getStructs(t){const e=[],n=this.structs[t];if(0===n.length)return"layout( location = 0 ) out vec4 fragColor;\n";for(let t=0,i=n.length;t<i;t++){const i=n[t];let r="\n";r+=this.getStructMembers(i),r+="\n",e.push(r)}return e.join("\n\n")}getVaryings(t){let e="";const n=this.varyings;if("vertex"===t||"compute"===t)for(const i of n){"compute"===t&&(i.needsInterpolation=!0);const n=i.type;e+=`${n.includes("int")||n.includes("uv")||n.includes("iv")?"flat ":""}${i.needsInterpolation?"out":"/*out*/"} ${n} ${i.name};\n`}else if("fragment"===t)for(const t of n)if(t.needsInterpolation){const n=t.type;e+=`${n.includes("int")||n.includes("uv")||n.includes("iv")?"flat ":""}in ${n} ${t.name};\n`}return e}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce(((t,e)=>t*e),1)}u`}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":null}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(t,e,n=this.shaderStage){const i=this.extensions[n]||(this.extensions[n]=new Map);!1===i.has(t)&&i.set(t,{name:t,behavior:e})}getExtensions(t){const e=[];if("vertex"===t){const e=this.renderer.backend.extensions;this.object.isBatchedMesh&&e.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",t)}const n=this.extensions[t];if(void 0!==n)for(const{name:t,behavior:i}of n.values())e.push(`#extension ${t} : ${i}`);return e.join("\n")}isAvailable(t){let e=iq[t];if(void 0===e){if("float32Filterable"===t){const t=this.renderer.backend.extensions;t.has("OES_texture_float_linear")?(t.get("OES_texture_float_linear"),e=!0):e=!1}iq[t]=e}return e}isFlipY(){return!0}registerTransform(t,e){this.transforms.push({varyingName:t,attributeNode:e})}getTransforms(){const t=this.transforms;let e="";for(let n=0;n<t.length;n++){const i=t[n],r=this.getPropertyName(i.attributeNode);e+=`${i.varyingName} = ${r};\n\t`}return e}_getGLSLUniformStruct(t,e){return`\nlayout( std140 ) uniform ${t} {\n${e}\n};`}_getGLSLVertexCode(t){return`#version 300 es\n\n${this.getSignature()}\n\n// extensions \n${t.extensions}\n\n// precision\n${rq}\n\n// uniforms\n${t.uniforms}\n\n// varyings\n${t.varyings}\n\n// attributes\n${t.attributes}\n\n// codes\n${t.codes}\n\nvoid main() {\n\n\t// vars\n\t${t.vars}\n\n\t// transforms\n\t${t.transforms}\n\n\t// flow\n\t${t.flow}\n\n\tgl_PointSize = 1.0;\n\n}\n`}_getGLSLFragmentCode(t){return`#version 300 es\n\n${this.getSignature()}\n\n// precision\n${rq}\n\n// uniforms\n${t.uniforms}\n\n// varyings\n${t.varyings}\n\n// codes\n${t.codes}\n\n${t.structs}\n\nvoid main() {\n\n\t// vars\n\t${t.vars}\n\n\t// flow\n\t${t.flow}\n\n}\n`}buildCode(){const t=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const e in t){let n="// code\n\n";n+=this.flowCode[e];const i=this.flowNodes[e],r=i[i.length-1];for(const t of i){const i=this.getFlowData(t),s=t.name;s&&(n.length>0&&(n+="\n"),n+=`\t// flow -> ${s}\n\t`),n+=`${i.code}\n\t`,t===r&&"compute"!==e&&(n+="// result\n\t","vertex"===e?(n+="gl_Position = ",n+=`${i.result};`):"fragment"===e&&(t.outputNode.isOutputStructNode||(n+="fragColor = ",n+=`${i.result};`)))}const s=t[e];s.extensions=this.getExtensions(e),s.uniforms=this.getUniforms(e),s.attributes=this.getAttributes(e),s.varyings=this.getVaryings(e),s.vars=this.getVars(e),s.structs=this.getStructs(e),s.codes=this.getCodes(e),s.transforms=this.getTransforms(e),s.flow=n}null!==this.material?(this.vertexShader=this._getGLSLVertexCode(t.vertex),this.fragmentShader=this._getGLSLFragmentCode(t.fragment)):this.computeShader=this._getGLSLVertexCode(t.compute)}getUniformFromNode(t,e,n,i=null){const r=super.getUniformFromNode(t,e,n,i),s=this.getDataFromNode(t,n,this.globalCache);let a=s.uniformGPU;if(void 0===a){const i=t.groupNode,o=i.name,l=this.getBindGroupArray(o,n);if("texture"===e)a=new Kz(r.name,r.node,i),l.push(a);else if("cubeTexture"===e)a=new Jz(r.name,r.node,i),l.push(a);else if("texture3D"===e)a=new tq(r.name,r.node,i),l.push(a);else if("buffer"===e){t.name=`NodeBuffer_${t.id}`,r.name=`buffer${t.id}`;const e=new Wz(t,i);e.name=t.name,l.push(e),a=e}else{const t=this.uniformGroups[n]||(this.uniformGroups[n]={});let s=t[o];void 0===s&&(s=new Qz(n+"_"+o,i),t[o]=s,l.push(s)),a=this.getNodeUniform(r,e),s.addUniform(a)}s.uniformGPU=a}return r}}let aq=null,oq=null,lq=null;class uq{constructor(t={}){this.parameters=Object.assign({},t),this.data=new WeakMap,this.renderer=null,this.domElement=null}async init(t){this.renderer=t}begin(){}finish(){}draw(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}createRenderPipeline(){}createComputePipeline(){}destroyPipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}createSampler(){}createDefaultTexture(){}createTexture(){}copyTextureToBuffer(){}createAttribute(){}createIndexAttribute(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}resolveTimestampAsync(){}hasFeatureAsync(){}hasFeature(){}getInstanceCount(t){const{object:e,geometry:n}=t;return n.isInstancedBufferGeometry?n.instanceCount:e.count>1?e.count:1}getDrawingBufferSize(){return aq=aq||new $b,this.renderer.getDrawingBufferSize(aq)}getScissor(){return oq=oq||new fS,this.renderer.getScissor(oq)}setScissorTest(){}getClearColor(){const t=this.renderer;return lq=lq||new Tz,t.getClearColor(lq),lq.getRGB(lq,this.renderer.currentColorSpace),lq}getDomElement(){let t=this.domElement;return null===t&&(t=void 0!==this.parameters.canvas?this.parameters.canvas:function(){const t=Jb("canvas");return t.style.display="block",t}(),"setAttribute"in t&&t.setAttribute("data-engine",`three.js r${rx} webgpu`),this.domElement=t),t}set(t,e){this.data.set(t,e)}get(t){let e=this.data.get(t);return void 0===e&&(e={},this.data.set(t,e)),e}has(t){return this.data.has(t)}delete(t){this.data.delete(t)}}let hq=0;class cq{constructor(t,e){this.buffers=[t.bufferGPU,e],this.type=t.type,this.bufferType=t.bufferType,this.pbo=t.pbo,this.byteLength=t.byteLength,this.bytesPerElement=t.BYTES_PER_ELEMENT,this.version=t.version,this.isInteger=t.isInteger,this.activeBufferIndex=0,this.baseId=t.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[1^this.activeBufferIndex]}switchBuffers(){this.activeBufferIndex^=1}}class Aq{constructor(t){this.backend=t}createAttribute(t,e){const n=this.backend,{gl:i}=n,r=t.array,s=t.usage||i.STATIC_DRAW,a=t.isInterleavedBufferAttribute?t.data:t,o=n.get(a);let l,u=o.bufferGPU;if(void 0===u&&(u=this._createBuffer(i,e,r,s),o.bufferGPU=u,o.bufferType=e,o.version=a.version),r instanceof Float32Array)l=i.FLOAT;else if(r instanceof Uint16Array)l=t.isFloat16BufferAttribute?i.HALF_FLOAT:i.UNSIGNED_SHORT;else if(r instanceof Int16Array)l=i.SHORT;else if(r instanceof Uint32Array)l=i.UNSIGNED_INT;else if(r instanceof Int32Array)l=i.INT;else if(r instanceof Int8Array)l=i.BYTE;else if(r instanceof Uint8Array)l=i.UNSIGNED_BYTE;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+r);l=i.UNSIGNED_BYTE}let h={bufferGPU:u,bufferType:e,type:l,byteLength:r.byteLength,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,pbo:t.pbo,isInteger:l===i.INT||l===i.UNSIGNED_INT||t.gpuType===Ux,id:hq++};if(t.isStorageBufferAttribute||t.isStorageInstancedBufferAttribute){const t=this._createBuffer(i,e,r,s);h=new cq(h,t)}n.set(t,h)}updateAttribute(t){const e=this.backend,{gl:n}=e,i=t.array,r=t.isInterleavedBufferAttribute?t.data:t,s=e.get(r),a=s.bufferType,o=t.isInterleavedBufferAttribute?t.data.updateRanges:t.updateRanges;if(n.bindBuffer(a,s.bufferGPU),0===o.length)n.bufferSubData(a,0,i);else{for(let t=0,e=o.length;t<e;t++){const e=o[t];n.bufferSubData(a,e.start*i.BYTES_PER_ELEMENT,i,e.start,e.count)}r.clearUpdateRanges()}n.bindBuffer(a,null),s.version=r.version}destroyAttribute(t){const e=this.backend,{gl:n}=e;t.isInterleavedBufferAttribute&&e.delete(t.data);const i=e.get(t);n.deleteBuffer(i.bufferGPU),e.delete(t)}async getArrayBufferAsync(t){const e=this.backend,{gl:n}=e,i=t.isInterleavedBufferAttribute?t.data:t,{bufferGPU:r}=e.get(i),s=t.array,a=s.byteLength;n.bindBuffer(n.COPY_READ_BUFFER,r);const o=n.createBuffer();n.bindBuffer(n.COPY_WRITE_BUFFER,o),n.bufferData(n.COPY_WRITE_BUFFER,a,n.STREAM_READ),n.copyBufferSubData(n.COPY_READ_BUFFER,n.COPY_WRITE_BUFFER,0,0,a),await e.utils._clientWaitAsync();const l=new t.array.constructor(s.length);return n.bindBuffer(n.COPY_WRITE_BUFFER,o),n.getBufferSubData(n.COPY_WRITE_BUFFER,0,l),n.deleteBuffer(o),n.bindBuffer(n.COPY_READ_BUFFER,null),n.bindBuffer(n.COPY_WRITE_BUFFER,null),l.buffer}_createBuffer(t,e,n,i){const r=t.createBuffer();return t.bindBuffer(e,r),t.bufferData(e,n,i),t.bindBuffer(e,null),r}}let dq,pq,fq=!1;class mq{constructor(t){this.backend=t,this.gl=this.backend.gl,this.enabled={},this.currentFlipSided=null,this.currentCullFace=null,this.currentProgram=null,this.currentBlendingEnabled=!1,this.currentBlending=null,this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentPremultipledAlpha=null,this.currentPolygonOffsetFactor=null,this.currentPolygonOffsetUnits=null,this.currentColorMask=null,this.currentDepthFunc=null,this.currentDepthMask=null,this.currentStencilFunc=null,this.currentStencilRef=null,this.currentStencilFuncMask=null,this.currentStencilFail=null,this.currentStencilZFail=null,this.currentStencilZPass=null,this.currentStencilMask=null,this.currentLineWidth=null,this.currentBoundFramebuffers={},this.currentDrawbuffers=new WeakMap,this.maxTextures=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),this.currentTextureSlot=null,this.currentBoundTextures={},this.currentBoundBufferBases={},!1===fq&&(this._init(this.gl),fq=!0)}_init(t){dq={[sx]:t.FUNC_ADD,[ax]:t.FUNC_SUBTRACT,[ox]:t.FUNC_REVERSE_SUBTRACT},pq={[lx]:t.ZERO,[ux]:t.ONE,[hx]:t.SRC_COLOR,[Ax]:t.SRC_ALPHA,[yx]:t.SRC_ALPHA_SATURATE,[mx]:t.DST_COLOR,[px]:t.DST_ALPHA,[cx]:t.ONE_MINUS_SRC_COLOR,[dx]:t.ONE_MINUS_SRC_ALPHA,[gx]:t.ONE_MINUS_DST_COLOR,[fx]:t.ONE_MINUS_DST_ALPHA}}enable(t){const{enabled:e}=this;!0!==e[t]&&(this.gl.enable(t),e[t]=!0)}disable(t){const{enabled:e}=this;!1!==e[t]&&(this.gl.disable(t),e[t]=!1)}setFlipSided(t){if(this.currentFlipSided!==t){const{gl:e}=this;t?e.frontFace(e.CW):e.frontFace(e.CCW),this.currentFlipSided=t}}setCullFace(t){const{gl:e}=this;0!==t?(this.enable(e.CULL_FACE),t!==this.currentCullFace&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):this.disable(e.CULL_FACE),this.currentCullFace=t}setLineWidth(t){const{currentLineWidth:e,gl:n}=this;t!==e&&(n.lineWidth(t),this.currentLineWidth=t)}setBlending(t,e,n,i,r,s,a,o){const{gl:l}=this;if(0!==t){if(!1===this.currentBlendingEnabled&&(this.enable(l.BLEND),this.currentBlendingEnabled=!0),5===t)r=r||e,s=s||n,a=a||i,e===this.currentBlendEquation&&r===this.currentBlendEquationAlpha||(l.blendEquationSeparate(dq[e],dq[r]),this.currentBlendEquation=e,this.currentBlendEquationAlpha=r),n===this.currentBlendSrc&&i===this.currentBlendDst&&s===this.currentBlendSrcAlpha&&a===this.currentBlendDstAlpha||(l.blendFuncSeparate(pq[n],pq[i],pq[s],pq[a]),this.currentBlendSrc=n,this.currentBlendDst=i,this.currentBlendSrcAlpha=s,this.currentBlendDstAlpha=a),this.currentBlending=t,this.currentPremultipledAlpha=!1;else if(t!==this.currentBlending||o!==this.currentPremultipledAlpha){if(this.currentBlendEquation===sx&&this.currentBlendEquationAlpha===sx||(l.blendEquation(l.FUNC_ADD),this.currentBlendEquation=sx,this.currentBlendEquationAlpha=sx),o)switch(t){case 1:l.blendFuncSeparate(l.ONE,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA);break;case 2:l.blendFunc(l.ONE,l.ONE);break;case 3:l.blendFuncSeparate(l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ZERO,l.ONE);break;case 4:l.blendFuncSeparate(l.ZERO,l.SRC_COLOR,l.ZERO,l.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA);break;case 2:l.blendFunc(l.SRC_ALPHA,l.ONE);break;case 3:l.blendFuncSeparate(l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ZERO,l.ONE);break;case 4:l.blendFunc(l.ZERO,l.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentBlending=t,this.currentPremultipledAlpha=o}}else!0===this.currentBlendingEnabled&&(this.disable(l.BLEND),this.currentBlendingEnabled=!1)}setColorMask(t){this.currentColorMask!==t&&(this.gl.colorMask(t,t,t,t),this.currentColorMask=t)}setDepthTest(t){const{gl:e}=this;t?this.enable(e.DEPTH_TEST):this.disable(e.DEPTH_TEST)}setDepthMask(t){this.currentDepthMask!==t&&(this.gl.depthMask(t),this.currentDepthMask=t)}setDepthFunc(t){if(this.currentDepthFunc!==t){const{gl:e}=this;switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}this.currentDepthFunc=t}}setStencilTest(t){const{gl:e}=this;t?this.enable(e.STENCIL_TEST):this.disable(e.STENCIL_TEST)}setStencilMask(t){this.currentStencilMask!==t&&(this.gl.stencilMask(t),this.currentStencilMask=t)}setStencilFunc(t,e,n){this.currentStencilFunc===t&&this.currentStencilRef===e&&this.currentStencilFuncMask===n||(this.gl.stencilFunc(t,e,n),this.currentStencilFunc=t,this.currentStencilRef=e,this.currentStencilFuncMask=n)}setStencilOp(t,e,n){this.currentStencilFail===t&&this.currentStencilZFail===e&&this.currentStencilZPass===n||(this.gl.stencilOp(t,e,n),this.currentStencilFail=t,this.currentStencilZFail=e,this.currentStencilZPass=n)}setMaterial(t,e){const{gl:n}=this;2===t.side?this.disable(n.CULL_FACE):this.enable(n.CULL_FACE);let i=1===t.side;e&&(i=!i),this.setFlipSided(i),1===t.blending&&!1===t.transparent?this.setBlending(0):this.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),this.setDepthFunc(t.depthFunc),this.setDepthTest(t.depthTest),this.setDepthMask(t.depthWrite),this.setColorMask(t.colorWrite);const r=t.stencilWrite;this.setStencilTest(r),r&&(this.setStencilMask(t.stencilWriteMask),this.setStencilFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),this.setStencilOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),this.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage&&this.backend.renderer.samples>1?this.enable(n.SAMPLE_ALPHA_TO_COVERAGE):this.disable(n.SAMPLE_ALPHA_TO_COVERAGE)}setPolygonOffset(t,e,n){const{gl:i}=this;t?(this.enable(i.POLYGON_OFFSET_FILL),this.currentPolygonOffsetFactor===e&&this.currentPolygonOffsetUnits===n||(i.polygonOffset(e,n),this.currentPolygonOffsetFactor=e,this.currentPolygonOffsetUnits=n)):this.disable(i.POLYGON_OFFSET_FILL)}useProgram(t){return this.currentProgram!==t&&(this.gl.useProgram(t),this.currentProgram=t,!0)}bindFramebuffer(t,e){const{gl:n,currentBoundFramebuffers:i}=this;return i[t]!==e&&(n.bindFramebuffer(t,e),i[t]=e,t===n.DRAW_FRAMEBUFFER&&(i[n.FRAMEBUFFER]=e),t===n.FRAMEBUFFER&&(i[n.DRAW_FRAMEBUFFER]=e),!0)}drawBuffers(t,e){const{gl:n}=this;let i=[],r=!1;if(null!==t.textures){i=this.currentDrawbuffers.get(e),void 0===i&&(i=[],this.currentDrawbuffers.set(e,i));const s=t.textures;if(i.length!==s.length||i[0]!==n.COLOR_ATTACHMENT0){for(let t=0,e=s.length;t<e;t++)i[t]=n.COLOR_ATTACHMENT0+t;i.length=s.length,r=!0}}else i[0]!==n.BACK&&(i[0]=n.BACK,r=!0);r&&n.drawBuffers(i)}activeTexture(t){const{gl:e,currentTextureSlot:n,maxTextures:i}=this;void 0===t&&(t=e.TEXTURE0+i-1),n!==t&&(e.activeTexture(t),this.currentTextureSlot=t)}bindTexture(t,e,n){const{gl:i,currentTextureSlot:r,currentBoundTextures:s,maxTextures:a}=this;void 0===n&&(n=null===r?i.TEXTURE0+a-1:r);let o=s[n];void 0===o&&(o={type:void 0,texture:void 0},s[n]=o),o.type===t&&o.texture===e||(r!==n&&(i.activeTexture(n),this.currentTextureSlot=n),i.bindTexture(t,e),o.type=t,o.texture=e)}bindBufferBase(t,e,n){const{gl:i}=this,r=`${t}-${e}`;return this.currentBoundBufferBases[r]!==n&&(i.bindBufferBase(t,e,n),this.currentBoundBufferBases[r]=n,!0)}unbindTexture(){const{gl:t,currentTextureSlot:e,currentBoundTextures:n}=this,i=n[e];void 0!==i&&void 0!==i.type&&(t.bindTexture(i.type,null),i.type=void 0,i.texture=void 0)}}class gq{constructor(t){this.backend=t,this.gl=this.backend.gl,this.extensions=t.extensions}convert(t,e=""){const{gl:n,extensions:i}=this;let r;if(t===Dx)return n.UNSIGNED_BYTE;if(1017===t)return n.UNSIGNED_SHORT_4_4_4_4;if(1018===t)return n.UNSIGNED_SHORT_5_5_5_1;if(35902===t)return n.UNSIGNED_INT_5_9_9_9_REV;if(t===Ix)return n.BYTE;if(t===Lx)return n.SHORT;if(t===Bx)return n.UNSIGNED_SHORT;if(t===Ux)return n.INT;if(t===Ox)return n.UNSIGNED_INT;if(t===Fx)return n.FLOAT;if(t===kx)return n.HALF_FLOAT;if(1021===t)return n.ALPHA;if(t===qx)return n.RGB;if(t===Gx)return n.RGBA;if(1024===t)return n.LUMINANCE;if(1025===t)return n.LUMINANCE_ALPHA;if(t===Vx)return n.DEPTH_COMPONENT;if(t===Hx)return n.DEPTH_STENCIL;if(t===jx)return n.RED;if(t===Wx)return n.RED_INTEGER;if(t===Xx)return n.RG;if(t===Yx)return n.RG_INTEGER;if(t===Qx)return n.RGBA_INTEGER;if(t===$x||t===Zx||t===Kx||t===Jx)if(e===yb){if(r=i.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(t===$x)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(t===Zx)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(t===Kx)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(t===Jx)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=i.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(t===$x)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Zx)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Kx)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Jx)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(r=i.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(35840===t)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t||t===tb||t===eb){if(r=i.get("WEBGL_compressed_texture_etc"),null===r)return null;if(36196===t||t===tb)return e===yb?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(t===eb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(t===nb||t===ib||t===rb||t===sb||t===ab||t===ob||t===lb||t===ub||t===hb||t===cb||t===Ab||t===db||t===pb||t===fb){if(r=i.get("WEBGL_compressed_texture_astc"),null===r)return null;if(t===nb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(t===ib)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(t===rb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(t===sb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(t===ab)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(t===ob)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(t===lb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(t===ub)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(t===hb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(t===cb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(t===Ab)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(t===db)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(t===pb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(t===fb)return e===yb?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(t===mb){if(r=i.get("EXT_texture_compression_bptc"),null===r)return null;if(t===mb)return e===yb?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(36283===t||36284===t||36285===t||36286===t){if(r=i.get("EXT_texture_compression_rgtc"),null===r)return null;if(t===mb)return r.COMPRESSED_RED_RGTC1_EXT;if(36284===t)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===t)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===t)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return t===zx?n.UNSIGNED_INT_24_8:void 0!==n[t]?n[t]:null}_clientWaitAsync(){const{gl:t}=this,e=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),new Promise(((n,i)=>{!function r(){const s=t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0);if(s===t.WAIT_FAILED)return t.deleteSync(e),void i();s!==t.TIMEOUT_EXPIRED?(t.deleteSync(e),n()):requestAnimationFrame(r)}()}))}}let yq,vq,_q,xq=!1;class bq{constructor(t){this.backend=t,this.gl=t.gl,this.extensions=t.extensions,this.defaultTextures={},!1===xq&&(this._init(this.gl),xq=!0)}_init(t){yq={[Sx]:t.REPEAT,[Mx]:t.CLAMP_TO_EDGE,[wx]:t.MIRRORED_REPEAT},vq={[Tx]:t.NEAREST,[Ex]:t.NEAREST_MIPMAP_NEAREST,[Cx]:t.NEAREST_MIPMAP_LINEAR,[Rx]:t.LINEAR,[Nx]:t.LINEAR_MIPMAP_NEAREST,[Px]:t.LINEAR_MIPMAP_LINEAR},_q={[Tb]:t.NEVER,[Ib]:t.ALWAYS,[Eb]:t.LESS,[Rb]:t.LEQUAL,[Cb]:t.EQUAL,[Db]:t.GEQUAL,[Nb]:t.GREATER,[Pb]:t.NOTEQUAL}}filterFallback(t){const{gl:e}=this;return t===Tx||t===Ex||t===Cx?e.NEAREST:e.LINEAR}getGLTextureType(t){const{gl:e}=this;let n;return n=!0===t.isCubeTexture?e.TEXTURE_CUBE_MAP:!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:!0===t.isData3DTexture?e.TEXTURE_3D:e.TEXTURE_2D,n}getInternalFormat(t,e,n,i,r=!1){const{gl:s,extensions:a}=this;if(null!==t){if(void 0!==s[t])return s[t];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+t+"'")}let o=e;return e===s.RED&&(n===s.FLOAT&&(o=s.R32F),n===s.HALF_FLOAT&&(o=s.R16F),n===s.UNSIGNED_BYTE&&(o=s.R8),n===s.UNSIGNED_SHORT&&(o=s.R16),n===s.UNSIGNED_INT&&(o=s.R32UI),n===s.BYTE&&(o=s.R8I),n===s.SHORT&&(o=s.R16I),n===s.INT&&(o=s.R32I)),e===s.RED_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.R8UI),n===s.UNSIGNED_SHORT&&(o=s.R16UI),n===s.UNSIGNED_INT&&(o=s.R32UI),n===s.BYTE&&(o=s.R8I),n===s.SHORT&&(o=s.R16I),n===s.INT&&(o=s.R32I)),e===s.RG&&(n===s.FLOAT&&(o=s.RG32F),n===s.HALF_FLOAT&&(o=s.RG16F),n===s.UNSIGNED_BYTE&&(o=s.RG8),n===s.UNSIGNED_SHORT&&(o=s.RG16),n===s.UNSIGNED_INT&&(o=s.RG32UI),n===s.BYTE&&(o=s.RG8I),n===s.SHORT&&(o=s.RG16I),n===s.INT&&(o=s.RG32I)),e===s.RG_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RG8UI),n===s.UNSIGNED_SHORT&&(o=s.RG16UI),n===s.UNSIGNED_INT&&(o=s.RG32UI),n===s.BYTE&&(o=s.RG8I),n===s.SHORT&&(o=s.RG16I),n===s.INT&&(o=s.RG32I)),e===s.RGB&&(n===s.FLOAT&&(o=s.RGB32F),n===s.HALF_FLOAT&&(o=s.RGB16F),n===s.UNSIGNED_BYTE&&(o=s.RGB8),n===s.UNSIGNED_SHORT&&(o=s.RGB16),n===s.UNSIGNED_INT&&(o=s.RGB32UI),n===s.BYTE&&(o=s.RGB8I),n===s.SHORT&&(o=s.RGB16I),n===s.INT&&(o=s.RGB32I),n===s.UNSIGNED_BYTE&&(o=i===yb&&!1===r?s.SRGB8:s.RGB8),n===s.UNSIGNED_SHORT_5_6_5&&(o=s.RGB565),n===s.UNSIGNED_SHORT_5_5_5_1&&(o=s.RGB5_A1),n===s.UNSIGNED_SHORT_4_4_4_4&&(o=s.RGB4),n===s.UNSIGNED_INT_5_9_9_9_REV&&(o=s.RGB9_E5)),e===s.RGB_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RGB8UI),n===s.UNSIGNED_SHORT&&(o=s.RGB16UI),n===s.UNSIGNED_INT&&(o=s.RGB32UI),n===s.BYTE&&(o=s.RGB8I),n===s.SHORT&&(o=s.RGB16I),n===s.INT&&(o=s.RGB32I)),e===s.RGBA&&(n===s.FLOAT&&(o=s.RGBA32F),n===s.HALF_FLOAT&&(o=s.RGBA16F),n===s.UNSIGNED_BYTE&&(o=s.RGBA8),n===s.UNSIGNED_SHORT&&(o=s.RGBA16),n===s.UNSIGNED_INT&&(o=s.RGBA32UI),n===s.BYTE&&(o=s.RGBA8I),n===s.SHORT&&(o=s.RGBA16I),n===s.INT&&(o=s.RGBA32I),n===s.UNSIGNED_BYTE&&(o=i===yb&&!1===r?s.SRGB8_ALPHA8:s.RGBA8),n===s.UNSIGNED_SHORT_4_4_4_4&&(o=s.RGBA4),n===s.UNSIGNED_SHORT_5_5_5_1&&(o=s.RGB5_A1)),e===s.RGBA_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RGBA8UI),n===s.UNSIGNED_SHORT&&(o=s.RGBA16UI),n===s.UNSIGNED_INT&&(o=s.RGBA32UI),n===s.BYTE&&(o=s.RGBA8I),n===s.SHORT&&(o=s.RGBA16I),n===s.INT&&(o=s.RGBA32I)),e===s.DEPTH_COMPONENT&&(n===s.UNSIGNED_INT&&(o=s.DEPTH24_STENCIL8),n===s.FLOAT&&(o=s.DEPTH_COMPONENT32F)),e===s.DEPTH_STENCIL&&n===s.UNSIGNED_INT_24_8&&(o=s.DEPTH24_STENCIL8),o!==s.R16F&&o!==s.R32F&&o!==s.RG16F&&o!==s.RG32F&&o!==s.RGBA16F&&o!==s.RGBA32F||a.get("EXT_color_buffer_float"),o}setTextureParameters(t,e){const{gl:n,extensions:i,backend:r}=this;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,e.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,e.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE),n.texParameteri(t,n.TEXTURE_WRAP_S,yq[e.wrapS]),n.texParameteri(t,n.TEXTURE_WRAP_T,yq[e.wrapT]),t!==n.TEXTURE_3D&&t!==n.TEXTURE_2D_ARRAY||n.texParameteri(t,n.TEXTURE_WRAP_R,yq[e.wrapR]),n.texParameteri(t,n.TEXTURE_MAG_FILTER,vq[e.magFilter]);const s=void 0!==e.mipmaps&&e.mipmaps.length>0,a=e.minFilter===Rx&&s?Px:e.minFilter;if(n.texParameteri(t,n.TEXTURE_MIN_FILTER,vq[a]),e.compareFunction&&(n.texParameteri(t,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(t,n.TEXTURE_COMPARE_FUNC,_q[e.compareFunction])),!0===i.has("EXT_texture_filter_anisotropic")){if(e.magFilter===Tx)return;if(e.minFilter!==Cx&&e.minFilter!==Px)return;if(e.type===Fx&&!1===i.has("OES_texture_float_linear"))return;if(e.anisotropy>1){const s=i.get("EXT_texture_filter_anisotropic");n.texParameterf(t,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,r.getMaxAnisotropy()))}}}createDefaultTexture(t){const{gl:e,backend:n,defaultTextures:i}=this,r=this.getGLTextureType(t);let s=i[r];void 0===s&&(s=e.createTexture(),n.state.bindTexture(r,s),e.texParameteri(r,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(r,e.TEXTURE_MAG_FILTER,e.NEAREST),i[r]=s),n.set(t,{textureGPU:s,glTextureType:r,isDefault:!0})}createTexture(t,e){const{gl:n,backend:i}=this,{levels:r,width:s,height:a,depth:o}=e,l=i.utils.convert(t.format,t.colorSpace),u=i.utils.convert(t.type),h=this.getInternalFormat(t.internalFormat,l,u,t.colorSpace,t.isVideoTexture),c=n.createTexture(),A=this.getGLTextureType(t);i.state.bindTexture(A,c),this.setTextureParameters(A,t),t.isDataArrayTexture||t.isCompressedArrayTexture?n.texStorage3D(n.TEXTURE_2D_ARRAY,r,h,s,a,o):t.isData3DTexture?n.texStorage3D(n.TEXTURE_3D,r,h,s,a,o):t.isVideoTexture||n.texStorage2D(A,r,h,s,a),i.set(t,{textureGPU:c,glTextureType:A,glFormat:l,glType:u,glInternalFormat:h})}copyBufferToTexture(t,e){const{gl:n,backend:i}=this,{textureGPU:r,glTextureType:s,glFormat:a,glType:o}=i.get(e),{width:l,height:u}=e.source.data;n.bindBuffer(n.PIXEL_UNPACK_BUFFER,t),i.state.bindTexture(s,r),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texSubImage2D(s,0,0,0,l,u,a,o,0),n.bindBuffer(n.PIXEL_UNPACK_BUFFER,null),i.state.unbindTexture()}updateTexture(t,e){const{gl:n}=this,{width:i,height:r}=e,{textureGPU:s,glTextureType:a,glFormat:o,glType:l,glInternalFormat:u}=this.backend.get(t);if(t.isRenderTargetTexture||void 0===s)return;const h=t=>t.isDataTexture?t.image.data:t instanceof ImageBitmap||t instanceof OffscreenCanvas||t instanceof HTMLImageElement||t instanceof HTMLCanvasElement?t:t.data;if(this.backend.state.bindTexture(a,s),this.setTextureParameters(a,t),t.isCompressedTexture){const i=t.mipmaps,r=e.image;for(let e=0;e<i.length;e++){const s=i[e];t.isCompressedArrayTexture?t.format!==n.RGBA?null!==o?n.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,e,0,0,0,s.width,s.height,r.depth,o,s.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texSubImage3D(n.TEXTURE_2D_ARRAY,e,0,0,0,s.width,s.height,r.depth,o,l,s.data):null!==o?n.compressedTexSubImage2D(n.TEXTURE_2D,e,0,0,s.width,s.height,o,s.data):console.warn("Unsupported compressed texture format")}}else if(t.isCubeTexture){const t=e.images;for(let e=0;e<6;e++){const s=h(t[e]);n.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,i,r,o,l,s)}}else if(t.isDataArrayTexture){const t=e.image;n.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,o,l,t.data)}else if(t.isData3DTexture){const t=e.image;n.texSubImage3D(n.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,o,l,t.data)}else if(t.isVideoTexture)t.update(),n.texImage2D(a,0,u,o,l,e.image);else{const t=h(e.image);n.texSubImage2D(a,0,0,0,i,r,o,l,t)}}generateMipmaps(t){const{gl:e,backend:n}=this,{textureGPU:i,glTextureType:r}=n.get(t);n.state.bindTexture(r,i),e.generateMipmap(r)}deallocateRenderBuffers(t){const{gl:e,backend:n}=this;if(t){const i=n.get(t);if(i.renderBufferStorageSetup=void 0,i.framebuffers){for(const t in i.framebuffers)e.deleteFramebuffer(i.framebuffers[t]);delete i.framebuffers}if(i.depthRenderbuffer&&(e.deleteRenderbuffer(i.depthRenderbuffer),delete i.depthRenderbuffer),i.stencilRenderbuffer&&(e.deleteRenderbuffer(i.stencilRenderbuffer),delete i.stencilRenderbuffer),i.msaaFrameBuffer&&(e.deleteFramebuffer(i.msaaFrameBuffer),delete i.msaaFrameBuffer),i.msaaRenderbuffers){for(let t=0;t<i.msaaRenderbuffers.length;t++)e.deleteRenderbuffer(i.msaaRenderbuffers[t]);delete i.msaaRenderbuffers}}}destroyTexture(t){const{gl:e,backend:n}=this,{textureGPU:i,renderTarget:r}=n.get(t);this.deallocateRenderBuffers(r),e.deleteTexture(i),n.delete(t)}copyTextureToTexture(t,e,n=null,i=null,r=0){const{gl:s,backend:a}=this,{state:o}=this.backend,{textureGPU:l,glTextureType:u,glType:h,glFormat:c}=a.get(e);let A,d,p,f,m,g;null!==n?(A=n.max.x-n.min.x,d=n.max.y-n.min.y,p=n.min.x,f=n.min.y):(A=t.image.width,d=t.image.height,p=0,f=0),null!==i?(m=i.x,g=i.y):(m=0,g=0),o.bindTexture(u,l),s.pixelStorei(s.UNPACK_ALIGNMENT,e.unpackAlignment),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,e.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,e.unpackAlignment);const y=s.getParameter(s.UNPACK_ROW_LENGTH),v=s.getParameter(s.UNPACK_IMAGE_HEIGHT),_=s.getParameter(s.UNPACK_SKIP_PIXELS),x=s.getParameter(s.UNPACK_SKIP_ROWS),b=s.getParameter(s.UNPACK_SKIP_IMAGES),S=t.isCompressedTexture?t.mipmaps[r]:t.image;s.pixelStorei(s.UNPACK_ROW_LENGTH,S.width),s.pixelStorei(s.UNPACK_IMAGE_HEIGHT,S.height),s.pixelStorei(s.UNPACK_SKIP_PIXELS,p),s.pixelStorei(s.UNPACK_SKIP_ROWS,f),t.isDataTexture?s.texSubImage2D(s.TEXTURE_2D,r,m,g,A,d,c,h,S.data):t.isCompressedTexture?s.compressedTexSubImage2D(s.TEXTURE_2D,r,m,g,S.width,S.height,c,S.data):s.texSubImage2D(s.TEXTURE_2D,r,m,g,A,d,c,h,S),s.pixelStorei(s.UNPACK_ROW_LENGTH,y),s.pixelStorei(s.UNPACK_IMAGE_HEIGHT,v),s.pixelStorei(s.UNPACK_SKIP_PIXELS,_),s.pixelStorei(s.UNPACK_SKIP_ROWS,x),s.pixelStorei(s.UNPACK_SKIP_IMAGES,b),0===r&&e.generateMipmaps&&s.generateMipmap(s.TEXTURE_2D),o.unbindTexture()}copyFramebufferToTexture(t,e,n){const{gl:i}=this,{state:r}=this.backend,{textureGPU:s}=this.backend.get(t),{x:a,y:o,z:l,w:u}=n,h=!0===t.isDepthTexture||e.renderTarget&&e.renderTarget.samples>0,c=e.renderTarget?e.renderTarget.height:this.backend.gerDrawingBufferSize().y;if(h){const n=0!==a||0!==o;let h,A;if(!0===t.isDepthTexture?(h=i.DEPTH_BUFFER_BIT,A=i.DEPTH_ATTACHMENT,e.stencil&&(h|=i.STENCIL_BUFFER_BIT)):(h=i.COLOR_BUFFER_BIT,A=i.COLOR_ATTACHMENT0),n){const t=this.backend.get(e.renderTarget),n=t.framebuffers[e.getCacheKey()],A=t.msaaFrameBuffer;r.bindFramebuffer(i.DRAW_FRAMEBUFFER,n),r.bindFramebuffer(i.READ_FRAMEBUFFER,A);const d=c-o-u;i.blitFramebuffer(a,d,a+l,d+u,a,d,a+l,d+u,h,i.NEAREST),r.bindFramebuffer(i.READ_FRAMEBUFFER,n),r.bindTexture(i.TEXTURE_2D,s),i.copyTexSubImage2D(i.TEXTURE_2D,0,0,0,a,d,l,u),r.unbindTexture()}else{const t=i.createFramebuffer();r.bindFramebuffer(i.DRAW_FRAMEBUFFER,t),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,A,i.TEXTURE_2D,s,0),i.blitFramebuffer(0,0,l,u,0,0,l,u,h,i.NEAREST),i.deleteFramebuffer(t)}}else r.bindTexture(i.TEXTURE_2D,s),i.copyTexSubImage2D(i.TEXTURE_2D,0,0,0,a,c-u-o,l,u),r.unbindTexture();t.generateMipmaps&&this.generateMipmaps(t),this.backend._setFramebuffer(e)}setupRenderBufferStorage(t,e){const{gl:n}=this,i=e.renderTarget,{samples:r,depthTexture:s,depthBuffer:a,stencilBuffer:o,width:l,height:u}=i;if(n.bindRenderbuffer(n.RENDERBUFFER,t),a&&!o){let e=n.DEPTH_COMPONENT24;r>0?(s&&s.isDepthTexture&&s.type===n.FLOAT&&(e=n.DEPTH_COMPONENT32F),n.renderbufferStorageMultisample(n.RENDERBUFFER,r,e,l,u)):n.renderbufferStorage(n.RENDERBUFFER,e,l,u),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t)}else a&&o&&(r>0?n.renderbufferStorageMultisample(n.RENDERBUFFER,r,n.DEPTH24_STENCIL8,l,u):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,l,u),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,t))}async copyTextureToBuffer(t,e,n,i,r,s){const{backend:a,gl:o}=this,{textureGPU:l,glFormat:u,glType:h}=this.backend.get(t),c=o.createFramebuffer();o.bindFramebuffer(o.READ_FRAMEBUFFER,c);const A=t.isCubeTexture?o.TEXTURE_CUBE_MAP_POSITIVE_X+s:o.TEXTURE_2D;o.framebufferTexture2D(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,A,l,0);const d=this._getTypedArrayType(h),p=i*r*this._getBytesPerTexel(h,u),f=o.createBuffer();o.bindBuffer(o.PIXEL_PACK_BUFFER,f),o.bufferData(o.PIXEL_PACK_BUFFER,p,o.STREAM_READ),o.readPixels(e,n,i,r,u,h,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),await a.utils._clientWaitAsync();const m=new d(p/d.BYTES_PER_ELEMENT);return o.bindBuffer(o.PIXEL_PACK_BUFFER,f),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,m),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),o.deleteFramebuffer(c),m}_getTypedArrayType(t){const{gl:e}=this;if(t===e.UNSIGNED_BYTE)return Uint8Array;if(t===e.UNSIGNED_SHORT_4_4_4_4)return Uint16Array;if(t===e.UNSIGNED_SHORT_5_5_5_1)return Uint16Array;if(t===e.UNSIGNED_SHORT_5_6_5)return Uint16Array;if(t===e.UNSIGNED_SHORT)return Uint16Array;if(t===e.UNSIGNED_INT)return Uint32Array;if(t===e.HALF_FLOAT)return Uint16Array;if(t===e.FLOAT)return Float32Array;throw new Error(`Unsupported WebGL type: ${t}`)}_getBytesPerTexel(t,e){const{gl:n}=this;let i=0;return t===n.UNSIGNED_BYTE&&(i=1),t!==n.UNSIGNED_SHORT_4_4_4_4&&t!==n.UNSIGNED_SHORT_5_5_5_1&&t!==n.UNSIGNED_SHORT_5_6_5&&t!==n.UNSIGNED_SHORT&&t!==n.HALF_FLOAT||(i=2),t!==n.UNSIGNED_INT&&t!==n.FLOAT||(i=4),e===n.RGBA?4*i:e===n.RGB?3*i:e===n.ALPHA?i:void 0}}class Sq{constructor(t){this.backend=t,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(t){let e=this.extensions[t];return void 0===e&&(e=this.gl.getExtension(t),this.extensions[t]=e),e}has(t){return this.availableExtensions.includes(t)}}class Mq{constructor(t){this.backend=t,this.maxAnisotropy=null}getMaxAnisotropy(){if(null!==this.maxAnisotropy)return this.maxAnisotropy;const t=this.backend.gl,e=this.backend.extensions;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}}const wq={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBKIT_WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-bc",EXT_texture_compression_bptc:"texture-compression-bptc",EXT_disjoint_timer_query_webgl2:"timestamp-query"};class Tq{constructor(t){this.gl=t.gl,this.extensions=t.extensions,this.info=t.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(t,e){const{gl:n,mode:i,object:r,type:s,info:a,index:o}=this;0!==o?n.drawElements(i,e,s,t):n.drawArrays(i,t,e),a.update(r,e,i,1)}renderInstances(t,e,n){const{gl:i,mode:r,type:s,index:a,object:o,info:l}=this;0!==n&&(0!==a?i.drawElementsInstanced(r,e,s,t,n):i.drawArraysInstanced(r,t,e,n),l.update(o,e,r,n))}renderMultiDraw(t,e,n){const{extensions:i,mode:r,object:s,info:a}=this;if(0===n)return;const o=i.get("WEBGL_multi_draw");if(null===o)for(let i=0;i<n;i++)this.render(t[i],e[i]);else{0!==this.index?o.multiDrawElementsWEBGL(r,e,0,this.type,t,0,n):o.multiDrawArraysWEBGL(r,t,0,e,0,n);let i=0;for(let t=0;t<n;t++)i+=e[t];a.update(s,i,r,1)}}renderMultiDrawInstances(t,e,n,i){const{extensions:r,mode:s,object:a,info:o}=this;if(0===n)return;const l=r.get("WEBGL_multi_draw");if(null===l)for(let r=0;r<n;r++)this.renderInstances(t[r],e[r],i[r]);else{0!==this.index?l.multiDrawElementsInstancedWEBGL(s,e,0,this.type,t,0,i,0,n):l.multiDrawArraysInstancedWEBGL(s,t,0,e,0,i,0,n);let r=0;for(let t=0;t<n;t++)r+=e[t];for(let t=0;t<i.length;t++)o.update(a,r,s,i[t])}}}class Eq extends uq{constructor(t={}){super(t),this.isWebGLBackend=!0}init(t){super.init(t);const e=this.parameters,n=void 0!==e.context?e.context:t.domElement.getContext("webgl2");this.gl=n,this.extensions=new Sq(this),this.capabilities=new Mq(this),this.attributeUtils=new Aq(this),this.textureUtils=new bq(this),this.bufferRenderer=new Tq(this),this.state=new mq(this),this.utils=new gq(this),this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.trackTimestamp=!0===e.trackTimestamp,this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile"),this._currentContext=null}get coordinateSystem(){return Ub}async getArrayBufferAsync(t){return await this.attributeUtils.getArrayBufferAsync(t)}initTimestampQuery(t){if(!this.disjoint||!this.trackTimestamp)return;const e=this.get(t);if(this.queryRunning)return e.queryQueue||(e.queryQueue=[]),void e.queryQueue.push(t);e.activeQuery&&(this.gl.endQuery(this.disjoint.TIME_ELAPSED_EXT),e.activeQuery=null),e.activeQuery=this.gl.createQuery(),null!==e.activeQuery&&(this.gl.beginQuery(this.disjoint.TIME_ELAPSED_EXT,e.activeQuery),this.queryRunning=!0)}prepareTimestampBuffer(t){if(!this.disjoint||!this.trackTimestamp)return;const e=this.get(t);if(e.activeQuery&&(this.gl.endQuery(this.disjoint.TIME_ELAPSED_EXT),e.gpuQueries||(e.gpuQueries=[]),e.gpuQueries.push({query:e.activeQuery}),e.activeQuery=null,this.queryRunning=!1,e.queryQueue&&e.queryQueue.length>0)){const t=e.queryQueue.shift();this.initTimestampQuery(t)}}async resolveTimestampAsync(t,e="render"){if(!this.disjoint||!this.trackTimestamp)return;const n=this.get(t);n.gpuQueries||(n.gpuQueries=[]);for(let t=0;t<n.gpuQueries.length;t++){const i=n.gpuQueries[t],r=this.gl.getQueryParameter(i.query,this.gl.QUERY_RESULT_AVAILABLE),s=this.gl.getParameter(this.disjoint.GPU_DISJOINT_EXT);if(r&&!s){const r=this.gl.getQueryParameter(i.query,this.gl.QUERY_RESULT),s=Number(r)/1e6;this.gl.deleteQuery(i.query),n.gpuQueries.splice(t,1),t--,this.renderer.info.updateTimestamp(e,s)}}}getContext(){return this.gl}beginRender(t){const{gl:e}=this,n=this.get(t);if(this.initTimestampQuery(t),n.previousContext=this._currentContext,this._currentContext=t,this._setFramebuffer(t),this.clear(t.clearColor,t.clearDepth,t.clearStencil,t,!1),t.viewport?this.updateViewport(t):e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.scissor){const{x:n,y:i,width:r,height:s}=t.scissorValue;e.scissor(n,t.height-s-i,r,s)}const i=t.occlusionQueryCount;i>0&&(n.currentOcclusionQueries=n.occlusionQueries,n.currentOcclusionQueryObjects=n.occlusionQueryObjects,n.lastOcclusionObject=null,n.occlusionQueries=new Array(i),n.occlusionQueryObjects=new Array(i),n.occlusionQueryIndex=0)}finishRender(t){const{gl:e,state:n}=this,i=this.get(t),r=i.previousContext,s=t.occlusionQueryCount;s>0&&(s>i.occlusionQueryIndex&&e.endQuery(e.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(t));const a=t.textures;if(null!==a)for(let t=0;t<a.length;t++){const e=a[t];e.generateMipmaps&&this.generateMipmaps(e)}if(this._currentContext=r,null!==t.textures&&t.renderTarget){const i=this.get(t.renderTarget),{samples:r}=t.renderTarget;if(r>0){const r=i.framebuffers[t.getCacheKey()],s=e.COLOR_BUFFER_BIT,a=i.msaaFrameBuffer,o=t.textures;n.bindFramebuffer(e.READ_FRAMEBUFFER,a),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,r);for(let n=0;n<o.length;n++)if(t.scissor){const{x:n,y:r,width:a,height:o}=t.scissorValue,l=t.height-o-r;e.blitFramebuffer(n,l,n+a,l+o,n,l,n+a,l+o,s,e.NEAREST),e.invalidateSubFramebuffer(e.READ_FRAMEBUFFER,i.invalidationArray,n,l,a,o)}else e.blitFramebuffer(0,0,t.width,t.height,0,0,t.width,t.height,s,e.NEAREST),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,i.invalidationArray)}}null!==r&&(this._setFramebuffer(r),r.viewport?this.updateViewport(r):e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight)),this.prepareTimestampBuffer(t)}resolveOccludedAsync(t){const e=this.get(t),{currentOcclusionQueries:n,currentOcclusionQueryObjects:i}=e;if(n&&i){const t=new WeakSet,{gl:r}=this;e.currentOcclusionQueryObjects=null,e.currentOcclusionQueries=null;const s=()=>{let a=0;for(let e=0;e<n.length;e++){const s=n[e];null!==s&&(r.getQueryParameter(s,r.QUERY_RESULT_AVAILABLE)&&(r.getQueryParameter(s,r.QUERY_RESULT)>0&&t.add(i[e]),n[e]=null,r.deleteQuery(s),a++))}a<n.length?requestAnimationFrame(s):e.occluded=t};s()}}isOccluded(t,e){const n=this.get(t);return n.occluded&&n.occluded.has(e)}updateViewport(t){const e=this.gl,{x:n,y:i,width:r,height:s}=t.viewportValue;e.viewport(n,t.height-s-i,r,s)}setScissorTest(t){const e=this.gl;t?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST)}clear(t,e,n,i=null,r=!0){const{gl:s}=this;null===i&&(i={textures:null,clearColorValue:this.getClearColor()});let a=0;if(t&&(a|=s.COLOR_BUFFER_BIT),e&&(a|=s.DEPTH_BUFFER_BIT),n&&(a|=s.STENCIL_BUFFER_BIT),0!==a){const o=i.clearColorValue||this.getClearColor();if(o.r*=o.a,o.g*=o.a,o.b*=o.a,e&&this.state.setDepthMask(!0),null===i.textures)s.clearColor(o.r,o.g,o.b,o.a),s.clear(a);else{if(r&&this._setFramebuffer(i),t)for(let t=0;t<i.textures.length;t++)s.clearBufferfv(s.COLOR,t,[o.r,o.g,o.b,o.a]);e&&n?s.clearBufferfi(s.DEPTH_STENCIL,0,1,0):e?s.clearBufferfv(s.DEPTH,0,[1]):n&&s.clearBufferiv(s.STENCIL,0,[0])}}}beginCompute(t){const{state:e,gl:n}=this;e.bindFramebuffer(n.FRAMEBUFFER,null),this.initTimestampQuery(t)}compute(t,e,n,i){const{state:r,gl:s}=this;this.discard||(s.enable(s.RASTERIZER_DISCARD),this.discard=!0);const{programGPU:a,transformBuffers:o,attributes:l}=this.get(i),u=this._getVaoKey(null,l),h=this.vaoCache[u];void 0===h?this._createVao(null,l):s.bindVertexArray(h),r.useProgram(a),this._bindUniforms(n);const c=this._getTransformFeedback(o);s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,c),s.beginTransformFeedback(s.POINTS),l[0].isStorageInstancedBufferAttribute?s.drawArraysInstanced(s.POINTS,0,1,e.count):s.drawArrays(s.POINTS,0,e.count),s.endTransformFeedback(),s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,null);for(let t=0;t<o.length;t++){const e=o[t];e.pbo&&this.textureUtils.copyBufferToTexture(e.transformBuffer,e.pbo),e.switchBuffers()}}finishCompute(t){const e=this.gl;this.discard=!1,e.disable(e.RASTERIZER_DISCARD),this.prepareTimestampBuffer(t)}draw(t){const{object:e,pipeline:n,material:i,context:r}=t,{programGPU:s}=this.get(n),{gl:a,state:o}=this,l=this.get(r),u=t.getDrawParameters();if(null===u)return;this._bindUniforms(t.getBindings());const h=e.isMesh&&e.matrixWorld.determinant()<0;o.setMaterial(i,h),o.useProgram(s);let c=t.staticVao;if(void 0===c){const e=this._getVaoKey(t.getIndex(),t.getAttributes());if(c=this.vaoCache[e],void 0===c){let e;({vaoGPU:c,staticVao:e}=this._createVao(t.getIndex(),t.getAttributes())),e&&(t.staticVao=c)}}a.bindVertexArray(c);const A=t.getIndex(),d=l.lastOcclusionObject;if(d!==e&&void 0!==d){if(null!==d&&!0===d.occlusionTest&&(a.endQuery(a.ANY_SAMPLES_PASSED),l.occlusionQueryIndex++),!0===e.occlusionTest){const t=a.createQuery();a.beginQuery(a.ANY_SAMPLES_PASSED,t),l.occlusionQueries[l.occlusionQueryIndex]=t,l.occlusionQueryObjects[l.occlusionQueryIndex]=e}l.lastOcclusionObject=e}const p=this.bufferRenderer;e.isPoints?p.mode=a.POINTS:e.isLineSegments?p.mode=a.LINES:e.isLine?p.mode=a.LINE_STRIP:e.isLineLoop?p.mode=a.LINE_LOOP:!0===i.wireframe?(o.setLineWidth(i.wireframeLinewidth*this.renderer.getPixelRatio()),p.mode=a.LINES):p.mode=a.TRIANGLES;const{vertexCount:f,instanceCount:m}=u;let{firstVertex:g}=u;if(p.object=e,null!==A){g*=A.array.BYTES_PER_ELEMENT;const t=this.get(A);p.index=A.count,p.type=t.type}else p.index=0;var y;e.isBatchedMesh?null!==e._multiDrawInstances?p.renderMultiDrawInstances(e._multiDrawStarts,e._multiDrawCounts,e._multiDrawCount,e._multiDrawInstances):this.hasFeature("WEBGL_multi_draw")?p.renderMultiDraw(e._multiDrawStarts,e._multiDrawCounts,e._multiDrawCount):(y="THREE.WebGLRenderer: WEBGL_multi_draw not supported.")in tS||(tS[y]=!0,console.warn(y)):m>1?p.renderInstances(g,f,m):p.render(g,f),a.bindVertexArray(null)}needsRenderUpdate(){return!1}getRenderCacheKey(){return""}createDefaultTexture(t){this.textureUtils.createDefaultTexture(t)}createTexture(t,e){this.textureUtils.createTexture(t,e)}updateTexture(t,e){this.textureUtils.updateTexture(t,e)}generateMipmaps(t){this.textureUtils.generateMipmaps(t)}destroyTexture(t){this.textureUtils.destroyTexture(t)}copyTextureToBuffer(t,e,n,i,r,s){return this.textureUtils.copyTextureToBuffer(t,e,n,i,r,s)}createSampler(){}destroySampler(){}createNodeBuilder(t,e){return new sq(t,e)}createProgram(t){const e=this.gl,{stage:n,code:i}=t,r="fragment"===n?e.createShader(e.FRAGMENT_SHADER):e.createShader(e.VERTEX_SHADER);e.shaderSource(r,i),e.compileShader(r),this.set(t,{shaderGPU:r})}destroyProgram(){console.warn("Abstract class.")}createRenderPipeline(t,e){const n=this.gl,i=t.pipeline,{fragmentProgram:r,vertexProgram:s}=i,a=n.createProgram(),o=this.get(r).shaderGPU,l=this.get(s).shaderGPU;if(n.attachShader(a,o),n.attachShader(a,l),n.linkProgram(a),this.set(i,{programGPU:a,fragmentShader:o,vertexShader:l}),null!==e&&this.parallel){const r=new Promise((e=>{const r=this.parallel,s=()=>{n.getProgramParameter(a,r.COMPLETION_STATUS_KHR)?(this._completeCompile(t,i),e()):requestAnimationFrame(s)};s()}));e.push(r)}else this._completeCompile(t,i)}_handleSource(t,e){const n=t.split("\n"),i=[],r=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let t=r;t<s;t++){const r=t+1;i.push(`${r===e?">":" "} ${r}: ${n[t]}`)}return i.join("\n")}_getShaderErrors(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),r=t.getShaderInfoLog(e).trim();if(i&&""===r)return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const i=parseInt(s[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+this._handleSource(t.getShaderSource(e),i)}return r}_logProgramError(t,e,n){if(this.renderer.debug.checkShaderErrors){const i=this.gl,r=i.getProgramInfoLog(t).trim();if(!1===i.getProgramParameter(t,i.LINK_STATUS))if("function"==typeof this.renderer.debug.onShaderError)this.renderer.debug.onShaderError(i,t,n,e);else{const s=this._getShaderErrors(i,n,"vertex"),a=this._getShaderErrors(i,e,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(t,i.VALIDATE_STATUS)+"\n\nProgram Info Log: "+r+"\n"+s+"\n"+a)}else""!==r&&console.warn("THREE.WebGLProgram: Program Info Log:",r)}}_completeCompile(t,e){const{state:n,gl:i}=this,r=this.get(e),{programGPU:s,fragmentShader:a,vertexShader:o}=r;!1===i.getProgramParameter(s,i.LINK_STATUS)&&this._logProgramError(s,a,o),n.useProgram(s);const l=t.getBindings();this._setupBindings(l,s),this.set(e,{programGPU:s})}createComputePipeline(t,e){const{state:n,gl:i}=this,r={stage:"fragment",code:"#version 300 es\nprecision highp float;\nvoid main() {}"};this.createProgram(r);const{computeProgram:s}=t,a=i.createProgram(),o=this.get(r).shaderGPU,l=this.get(s).shaderGPU,u=s.transforms,h=[],c=[];for(let t=0;t<u.length;t++){const e=u[t];h.push(e.varyingName),c.push(e.attributeNode)}i.attachShader(a,o),i.attachShader(a,l),i.transformFeedbackVaryings(a,h,i.SEPARATE_ATTRIBS),i.linkProgram(a),!1===i.getProgramParameter(a,i.LINK_STATUS)&&this._logProgramError(a,o,l),n.useProgram(a),this.createBindings(null,e),this._setupBindings(e,a);const A=s.attributes,d=[],p=[];for(let t=0;t<A.length;t++){const e=A[t].node.attribute;d.push(e),this.has(e)||this.attributeUtils.createAttribute(e,i.ARRAY_BUFFER)}for(let t=0;t<c.length;t++){const e=c[t].attribute;this.has(e)||this.attributeUtils.createAttribute(e,i.ARRAY_BUFFER);const n=this.get(e);p.push(n)}this.set(t,{programGPU:a,transformBuffers:p,attributes:d})}createBindings(t,e){this.updateBindings(t,e)}updateBindings(t,e){if(!t)return;const{gl:n}=this,i=this.get(e),r=this.get(t);void 0===i.textureIndex&&(i.textureIndex=0),void 0===r.textureIndex?r.textureIndex=i.textureIndex:i.textureIndex=r.textureIndex;let s=0;for(const e of t.bindings)if(e.isUniformsGroup||e.isUniformBuffer){const i=e.buffer,r=n.createBuffer();n.bindBuffer(n.UNIFORM_BUFFER,r),n.bufferData(n.UNIFORM_BUFFER,i,n.DYNAMIC_DRAW),this.set(e,{index:2*t.index+s++,bufferGPU:r})}else if(e.isSampledTexture){const{textureGPU:t,glTextureType:n}=this.get(e.texture);this.set(e,{index:i.textureIndex++,textureGPU:t,glTextureType:n})}}updateBinding(t){const e=this.gl;if(t.isUniformsGroup||t.isUniformBuffer){const n=this.get(t).bufferGPU,i=t.buffer;e.bindBuffer(e.UNIFORM_BUFFER,n),e.bufferData(e.UNIFORM_BUFFER,i,e.DYNAMIC_DRAW)}}createIndexAttribute(t){const e=this.gl;this.attributeUtils.createAttribute(t,e.ELEMENT_ARRAY_BUFFER)}createAttribute(t){if(this.has(t))return;const e=this.gl;this.attributeUtils.createAttribute(t,e.ARRAY_BUFFER)}createStorageAttribute(t){if(this.has(t))return;const e=this.gl;this.attributeUtils.createAttribute(t,e.ARRAY_BUFFER)}updateAttribute(t){this.attributeUtils.updateAttribute(t)}destroyAttribute(t){this.attributeUtils.destroyAttribute(t)}updateSize(){}hasFeature(t){const e=Object.keys(wq).filter((e=>wq[e]===t)),n=this.extensions;for(let t=0;t<e.length;t++)if(n.has(e[t]))return!0;return!1}getMaxAnisotropy(){return this.capabilities.getMaxAnisotropy()}copyTextureToTexture(t,e,n,i){this.textureUtils.copyTextureToTexture(t,e,n,i)}copyFramebufferToTexture(t,e,n){this.textureUtils.copyFramebufferToTexture(t,e,n)}_setFramebuffer(t){const{gl:e,state:n}=this;let i=null;if(null!==t.textures){const r=t.renderTarget,s=this.get(r),{samples:a,depthBuffer:o,stencilBuffer:l}=r,u=!0===r.isWebGLCubeRenderTarget;let h=s.msaaFrameBuffer,c=s.depthRenderbuffer;const A=bz(t);let d;if(u?(s.cubeFramebuffers||(s.cubeFramebuffers={}),d=s.cubeFramebuffers[A]):(s.framebuffers||(s.framebuffers={}),d=s.framebuffers[A]),void 0===d){d=e.createFramebuffer(),n.bindFramebuffer(e.FRAMEBUFFER,d);const i=t.textures;if(u){s.cubeFramebuffers[A]=d;const{textureGPU:t}=this.get(i[0]),n=this.renderer._activeCubeFace;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,t,0)}else{s.framebuffers[A]=d;for(let n=0;n<i.length;n++){const r=i[n],s=this.get(r);s.renderTarget=t.renderTarget;const a=e.COLOR_ATTACHMENT0+n;e.framebufferTexture2D(e.FRAMEBUFFER,a,e.TEXTURE_2D,s.textureGPU,0)}n.drawBuffers(t,d)}if(null!==t.depthTexture){const n=this.get(t.depthTexture),i=l?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.framebufferTexture2D(e.FRAMEBUFFER,i,e.TEXTURE_2D,n.textureGPU,0)}}if(a>0){if(void 0===h){const i=[];h=e.createFramebuffer(),n.bindFramebuffer(e.FRAMEBUFFER,h);const r=[],u=t.textures;for(let n=0;n<u.length;n++){if(r[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r[n]),i.push(e.COLOR_ATTACHMENT0+n),o){const t=l?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;i.push(t)}const s=t.textures[n],u=this.get(s);e.renderbufferStorageMultisample(e.RENDERBUFFER,a,u.glInternalFormat,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,r[n])}if(s.msaaFrameBuffer=h,s.msaaRenderbuffers=r,void 0===c){c=e.createRenderbuffer(),this.textureUtils.setupRenderBufferStorage(c,t),s.depthRenderbuffer=c;const n=l?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;i.push(n)}s.invalidationArray=i}i=s.msaaFrameBuffer}else i=d}n.bindFramebuffer(e.FRAMEBUFFER,i)}_getVaoKey(t,e){let n=[];if(null!==t){n+=":"+this.get(t).id}for(let t=0;t<e.length;t++){n+=":"+this.get(e[t]).id}return n}_createVao(t,e){const{gl:n}=this,i=n.createVertexArray();let r="",s=!0;if(n.bindVertexArray(i),null!==t){const e=this.get(t);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.bufferGPU),r+=":"+e.id}for(let t=0;t<e.length;t++){const i=e[t],a=this.get(i);let o,l;r+=":"+a.id,n.bindBuffer(n.ARRAY_BUFFER,a.bufferGPU),n.enableVertexAttribArray(t),(i.isStorageBufferAttribute||i.isStorageInstancedBufferAttribute)&&(s=!1),!0===i.isInterleavedBufferAttribute?(o=i.data.stride*a.bytesPerElement,l=i.offset*a.bytesPerElement):(o=0,l=0),a.isInteger?n.vertexAttribIPointer(t,i.itemSize,a.type,o,l):n.vertexAttribPointer(t,i.itemSize,a.type,i.normalized,o,l),i.isInstancedBufferAttribute&&!i.isInterleavedBufferAttribute?n.vertexAttribDivisor(t,i.meshPerAttribute):i.isInterleavedBufferAttribute&&i.data.isInstancedInterleavedBuffer&&n.vertexAttribDivisor(t,i.data.meshPerAttribute)}return n.bindBuffer(n.ARRAY_BUFFER,null),this.vaoCache[r]=i,{vaoGPU:i,staticVao:s}}_getTransformFeedback(t){let e="";for(let n=0;n<t.length;n++)e+=":"+t[n].id;let n=this.transformFeedbackCache[e];if(void 0!==n)return n;const{gl:i}=this;n=i.createTransformFeedback(),i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,n);for(let e=0;e<t.length;e++){const n=t[e];i.bindBufferBase(i.TRANSFORM_FEEDBACK_BUFFER,e,n.transformBuffer)}return i.bindTransformFeedback(i.TRANSFORM_FEEDBACK,null),this.transformFeedbackCache[e]=n,n}_setupBindings(t,e){const n=this.gl;for(const i of t)for(const t of i.bindings){const i=this.get(t).index;if(t.isUniformsGroup||t.isUniformBuffer){const r=n.getUniformBlockIndex(e,t.name);n.uniformBlockBinding(e,r,i)}else if(t.isSampledTexture){const r=n.getUniformLocation(e,t.name);n.uniform1i(r,i)}}}_bindUniforms(t){const{gl:e,state:n}=this;for(const i of t)for(const t of i.bindings){const i=this.get(t),r=i.index;t.isUniformsGroup||t.isUniformBuffer?n.bindBufferBase(e.UNIFORM_BUFFER,r,i.bufferGPU):t.isSampledTexture&&n.bindTexture(i.glTextureType,i.textureGPU,e.TEXTURE0+r)}}}class Cq extends Gz{constructor(t,e){super(t),this.texture=e,this.version=e?e.version:0,this.isSampler=!0}}class Rq extends Cq{constructor(t,e,n){super(t,e?e.value:null),this.textureNode=e,this.groupNode=n}update(){this.texture=this.textureNode.value}}class Nq extends Vz{constructor(t,e){super(t,e?e.array:null),this.attribute=e,this.isStorageBuffer=!0}}let Pq=0;class Dq extends Nq{constructor(t,e){super("StorageBuffer_"+Pq++,t?t.value:null),this.nodeUniform=t,this.access=t?t.access:YF,this.groupNode=e}get buffer(){return this.nodeUniform.value}}class Iq extends yU{constructor(t){super(),this.device=t;this.mipmapSampler=t.createSampler({minFilter:yF}),this.flipYSampler=t.createSampler({minFilter:vF}),this.transferPipelines={},this.flipYPipelines={},this.mipmapVertexShaderModule=t.createShaderModule({label:"mipmapVertex",code:"\nstruct VarysStruct {\n\t@builtin( position ) Position: vec4<f32>,\n\t@location( 0 ) vTex : vec2<f32>\n};\n\n@vertex\nfn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {\n\n\tvar Varys : VarysStruct;\n\n\tvar pos = array< vec2<f32>, 4 >(\n\t\tvec2<f32>( -1.0,  1.0 ),\n\t\tvec2<f32>(  1.0,  1.0 ),\n\t\tvec2<f32>( -1.0, -1.0 ),\n\t\tvec2<f32>(  1.0, -1.0 )\n\t);\n\n\tvar tex = array< vec2<f32>, 4 >(\n\t\tvec2<f32>( 0.0, 0.0 ),\n\t\tvec2<f32>( 1.0, 0.0 ),\n\t\tvec2<f32>( 0.0, 1.0 ),\n\t\tvec2<f32>( 1.0, 1.0 )\n\t);\n\n\tVarys.vTex = tex[ vertexIndex ];\n\tVarys.Position = vec4<f32>( pos[ vertexIndex ], 0.0, 1.0 );\n\n\treturn Varys;\n\n}\n"}),this.mipmapFragmentShaderModule=t.createShaderModule({label:"mipmapFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d<f32>;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {\n\n\treturn textureSample( img, imgSampler, vTex );\n\n}\n"}),this.flipYFragmentShaderModule=t.createShaderModule({label:"flipYFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d<f32>;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {\n\n\treturn textureSample( img, imgSampler, vec2( vTex.x, 1.0 - vTex.y ) );\n\n}\n"})}getTransferPipeline(t){let e=this.transferPipelines[t];return void 0===e&&(e=this.device.createRenderPipeline({label:`mipmap-${t}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.mipmapFragmentShaderModule,entryPoint:"main",targets:[{format:t}]},primitive:{topology:$O,stripIndexFormat:dF},layout:"auto"}),this.transferPipelines[t]=e),e}getFlipYPipeline(t){let e=this.flipYPipelines[t];return void 0===e&&(e=this.device.createRenderPipeline({label:`flipY-${t}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.flipYFragmentShaderModule,entryPoint:"main",targets:[{format:t}]},primitive:{topology:$O,stripIndexFormat:dF},layout:"auto"}),this.flipYPipelines[t]=e),e}flipY(t,e,n=0){const i=e.format,{width:r,height:s}=e.size,a=this.getTransferPipeline(i),o=this.getFlipYPipeline(i),l=this.device.createTexture({size:{width:r,height:s,depthOrArrayLayers:1},format:i,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),u=t.createView({baseMipLevel:0,mipLevelCount:1,dimension:sk,baseArrayLayer:n}),h=l.createView({baseMipLevel:0,mipLevelCount:1,dimension:sk,baseArrayLayer:0}),c=this.device.createCommandEncoder({}),A=(t,e,n)=>{const i=t.getBindGroupLayout(0),r=this.device.createBindGroup({layout:i,entries:[{binding:0,resource:this.flipYSampler},{binding:1,resource:e}]}),s=c.beginRenderPass({colorAttachments:[{view:n,loadOp:oF,storeOp:sF,clearValue:[0,0,0,0]}]});s.setPipeline(t),s.setBindGroup(0,r),s.draw(4,1,0,0),s.end()};A(a,u,h),A(o,h,u),this.device.queue.submit([c.finish()]),l.destroy()}generateMipmaps(t,e,n=0){const i=this.get(t);void 0===i.useCount&&(i.useCount=0,i.layers=[]);const r=i.layers[n]||this._mipmapCreateBundles(t,e,n),s=this.device.createCommandEncoder({});this._mipmapRunBundles(s,r),this.device.queue.submit([s.finish()]),0!==i.useCount&&(i.layers[n]=r),i.useCount++}_mipmapCreateBundles(t,e,n){const i=this.getTransferPipeline(e.format),r=i.getBindGroupLayout(0);let s=t.createView({baseMipLevel:0,mipLevelCount:1,dimension:sk,baseArrayLayer:n});const a=[];for(let o=1;o<e.mipLevelCount;o++){const l=this.device.createBindGroup({layout:r,entries:[{binding:0,resource:this.mipmapSampler},{binding:1,resource:s}]}),u=t.createView({baseMipLevel:o,mipLevelCount:1,dimension:sk,baseArrayLayer:n}),h={colorAttachments:[{view:u,loadOp:oF,storeOp:sF,clearValue:[0,0,0,0]}]},c=this.device.createRenderBundleEncoder({colorFormats:[e.format]});c.setPipeline(i),c.setBindGroup(0,l),c.draw(4,1,0,0),a.push({renderBundles:[c.finish()],passDescriptor:h}),s=u}return a}_mipmapRunBundles(t,e){const n=e.length;for(let i=0;i<n;i++){const n=e[i],r=t.beginRenderPass(n.passDescriptor);r.executeBundles(n.renderBundles),r.end()}}}const Lq={[Tb]:"never",[Eb]:"less",[Cb]:"equal",[Rb]:"less-equal",[Nb]:"greater",[Db]:"greater-equal",[Ib]:"always",[Pb]:"not-equal"},Bq=[0,1,3,2,4,5];class Uq{constructor(t){this.backend=t,this._passUtils=null,this.defaultTexture={},this.defaultCubeTexture={},this.defaultVideoFrame=null,this.colorBuffer=null,this.depthTexture=new tT,this.depthTexture.name="depthBuffer"}createSampler(t){const e=this.backend,n=e.device,i=e.get(t),r={addressModeU:this._convertAddressMode(t.wrapS),addressModeV:this._convertAddressMode(t.wrapT),addressModeW:this._convertAddressMode(t.wrapR),magFilter:this._convertFilterMode(t.magFilter),minFilter:this._convertFilterMode(t.minFilter),mipmapFilter:this._convertFilterMode(t.minFilter),maxAnisotropy:t.anisotropy};t.isDepthTexture&&null!==t.compareFunction&&(r.compare=Lq[t.compareFunction]),i.sampler=n.createSampler(r)}createDefaultTexture(t){let e;const n=Oq(t);t.isCubeTexture?e=this._getDefaultCubeTextureGPU(n):t.isVideoTexture?this.backend.get(t).externalTexture=this._getDefaultVideoFrame():e=this._getDefaultTextureGPU(n),this.backend.get(t).texture=e}createTexture(t,e={}){const n=this.backend,i=n.get(t);if(i.initialized)throw new Error("WebGPUTextureUtils: Texture already initialized.");void 0===e.needsMipmaps&&(e.needsMipmaps=!1),void 0===e.levels&&(e.levels=1),void 0===e.depth&&(e.depth=1);const{width:r,height:s,depth:a,levels:o}=e,l=this._getDimension(t),u=t.internalFormat||e.format||Oq(t,n.device);i.format=u;let h=void 0!==e.sampleCount?e.sampleCount:1;h=n.utils.getSampleCount(h);const c=t.isRenderTargetTexture&&!t.isMultisampleRenderTargetTexture?1:h;let A=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC;!0===t.isStorageTexture&&(A|=GPUTextureUsage.STORAGE_BINDING),!0!==t.isCompressedTexture&&!0!==t.isCompressedArrayTexture&&(A|=GPUTextureUsage.RENDER_ATTACHMENT);const d={label:t.name,size:{width:r,height:s,depthOrArrayLayers:a},mipLevelCount:o,sampleCount:c,dimension:l,format:u,usage:A};if(t.isVideoTexture){const e=t.source.data,n=new VideoFrame(e);d.size.width=n.displayWidth,d.size.height=n.displayHeight,n.close(),i.externalTexture=e}else{if(void 0===u)return console.warn("WebGPURenderer: Texture format not supported."),this.createDefaultTexture(t);i.texture=n.device.createTexture(d)}if(t.isRenderTargetTexture&&h>1&&!t.isMultisampleRenderTargetTexture){const t=Object.assign({},d);t.label=t.label+"-msaa",t.sampleCount=h,i.msaaTexture=n.device.createTexture(t)}i.initialized=!0,i.textureDescriptorGPU=d}destroyTexture(t){const e=this.backend,n=e.get(t);n.texture.destroy(),void 0!==n.msaaTexture&&n.msaaTexture.destroy(),e.delete(t)}destroySampler(t){delete this.backend.get(t).sampler}generateMipmaps(t){const e=this.backend.get(t);if(t.isCubeTexture)for(let t=0;t<6;t++)this._generateMipmaps(e.texture,e.textureDescriptorGPU,t);else{const n=t.image.depth||1;for(let t=0;t<n;t++)this._generateMipmaps(e.texture,e.textureDescriptorGPU,t)}}getColorBuffer(){this.colorBuffer&&this.colorBuffer.destroy();const t=this.backend,{width:e,height:n}=t.getDrawingBufferSize();return this.colorBuffer=t.device.createTexture({label:"colorBuffer",size:{width:e,height:n,depthOrArrayLayers:1},sampleCount:t.utils.getSampleCount(t.renderer.samples),format:t.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC}),this.colorBuffer}getDepthBuffer(t=!0,e=!1){const n=this.backend,{width:i,height:r}=n.getDrawingBufferSize(),s=this.depthTexture,a=n.get(s).texture;let o,l;if(e?(o=Hx,l=zx):t&&(o=Vx,l=Ox),void 0!==a){if(s.image.width===i&&s.image.height===r&&s.format===o&&s.type===l)return a;this.destroyTexture(s)}return s.name="depthBuffer",s.format=o,s.type=l,s.image.width=i,s.image.height=r,this.createTexture(s,{sampleCount:n.utils.getSampleCount(n.renderer.samples),width:i,height:r}),n.get(s).texture}updateTexture(t,e){const n=this.backend.get(t),{textureDescriptorGPU:i}=n;if(!t.isRenderTargetTexture&&void 0!==i){if(t.isDataTexture)this._copyBufferToTexture(e.image,n.texture,i,0,t.flipY);else if(t.isDataArrayTexture||t.isData3DTexture)for(let r=0;r<e.image.depth;r++)this._copyBufferToTexture(e.image,n.texture,i,r,t.flipY,r);else if(t.isCompressedTexture||t.isCompressedArrayTexture)this._copyCompressedBufferToTexture(t.mipmaps,n.texture,i);else if(t.isCubeTexture)this._copyCubeMapToTexture(e.images,n.texture,i,t.flipY);else if(t.isVideoTexture){const e=t.source.data;n.externalTexture=e}else this._copyImageToTexture(e.image,n.texture,i,0,t.flipY);n.version=t.version,t.onUpdate&&t.onUpdate(t)}}async copyTextureToBuffer(t,e,n,i,r,s){const a=this.backend.device,o=this.backend.get(t),l=o.texture,u=o.textureDescriptorGPU.format,h=this._getBytesPerTexel(u);let c=i*h;c=256*Math.ceil(c/256);const A=a.createBuffer({size:i*r*h,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),d=a.createCommandEncoder();d.copyTextureToBuffer({texture:l,origin:{x:e,y:n,z:s}},{buffer:A,bytesPerRow:c},{width:i,height:r});const p=this._getTypedArrayType(u);a.queue.submit([d.finish()]),await A.mapAsync(GPUMapMode.READ);return new p(A.getMappedRange())}_isEnvironmentTexture(t){const e=t.mapping;return e===xx||e===bx||e===vx||e===_x}_getDefaultTextureGPU(t){let e=this.defaultTexture[t];if(void 0===e){const n=new pS;n.minFilter=Tx,n.magFilter=Tx,this.createTexture(n,{width:1,height:1,format:t}),this.defaultTexture[t]=e=n}return this.backend.get(e).texture}_getDefaultCubeTextureGPU(t){let e=this.defaultTexture[t];if(void 0===e){const n=new Bw;n.minFilter=Tx,n.magFilter=Tx,this.createTexture(n,{width:1,height:1,depth:6}),this.defaultCubeTexture[t]=e=n}return this.backend.get(e).texture}_getDefaultVideoFrame(){let t=this.defaultVideoFrame;if(null===t){const e={timestamp:0,codedWidth:1,codedHeight:1,format:"RGBA"};this.defaultVideoFrame=t=new VideoFrame(new Uint8Array([0,0,0,255]),e)}return t}_copyCubeMapToTexture(t,e,n,i){for(let r=0;r<6;r++){const s=t[r],a=!0===i?Bq[r]:r;s.isDataTexture?this._copyBufferToTexture(s.image,e,n,a,i):this._copyImageToTexture(s,e,n,a,i)}}_copyImageToTexture(t,e,n,i,r){this.backend.device.queue.copyExternalImageToTexture({source:t},{texture:e,mipLevel:0,origin:{x:0,y:0,z:i}},{width:t.width,height:t.height,depthOrArrayLayers:1}),!0===r&&this._flipY(e,n,i)}_getPassUtils(){let t=this._passUtils;return null===t&&(this._passUtils=t=new Iq(this.backend.device)),t}_generateMipmaps(t,e,n=0){this._getPassUtils().generateMipmaps(t,e,n)}_flipY(t,e,n=0){this._getPassUtils().flipY(t,e,n)}_copyBufferToTexture(t,e,n,i,r,s=0){const a=this.backend.device,o=t.data,l=this._getBytesPerTexel(n.format),u=t.width*l;a.queue.writeTexture({texture:e,mipLevel:0,origin:{x:0,y:0,z:i}},o,{offset:t.width*t.height*l*s,bytesPerRow:u},{width:t.width,height:t.height,depthOrArrayLayers:1}),!0===r&&this._flipY(e,n,i)}_copyCompressedBufferToTexture(t,e,n){const i=this.backend.device,r=this._getBlockData(n.format),s=n.size.depthOrArrayLayers>1;for(let a=0;a<t.length;a++){const o=t[a],l=o.width,u=o.height,h=s?n.size.depthOrArrayLayers:1,c=Math.ceil(l/r.width)*r.byteLength,A=c*Math.ceil(u/r.height);for(let t=0;t<h;t++)i.queue.writeTexture({texture:e,mipLevel:a,origin:{x:0,y:0,z:t}},o.data,{offset:t*A,bytesPerRow:c,rowsPerImage:Math.ceil(u/r.height)},{width:Math.ceil(l/r.width)*r.width,height:Math.ceil(u/r.height)*r.height,depthOrArrayLayers:1})}}_getBlockData(t){return t===pF.BC1RGBAUnorm||t===pF.BC1RGBAUnormSRGB?{byteLength:8,width:4,height:4}:t===pF.BC2RGBAUnorm||t===pF.BC2RGBAUnormSRGB||t===pF.BC3RGBAUnorm||t===pF.BC3RGBAUnormSRGB?{byteLength:16,width:4,height:4}:t===pF.BC4RUnorm||t===pF.BC4RSNorm?{byteLength:8,width:4,height:4}:t===pF.BC5RGUnorm||t===pF.BC5RGSnorm||t===pF.BC6HRGBUFloat||t===pF.BC6HRGBFloat||t===pF.BC7RGBAUnorm||t===pF.BC7RGBAUnormSRGB?{byteLength:16,width:4,height:4}:t===pF.ETC2RGB8Unorm||t===pF.ETC2RGB8UnormSRGB||t===pF.ETC2RGB8A1Unorm||t===pF.ETC2RGB8A1UnormSRGB?{byteLength:8,width:4,height:4}:t===pF.ETC2RGBA8Unorm||t===pF.ETC2RGBA8UnormSRGB?{byteLength:16,width:4,height:4}:t===pF.EACR11Unorm||t===pF.EACR11Snorm?{byteLength:8,width:4,height:4}:t===pF.EACRG11Unorm||t===pF.EACRG11Snorm||t===pF.ASTC4x4Unorm||t===pF.ASTC4x4UnormSRGB?{byteLength:16,width:4,height:4}:t===pF.ASTC5x4Unorm||t===pF.ASTC5x4UnormSRGB?{byteLength:16,width:5,height:4}:t===pF.ASTC5x5Unorm||t===pF.ASTC5x5UnormSRGB?{byteLength:16,width:5,height:5}:t===pF.ASTC6x5Unorm||t===pF.ASTC6x5UnormSRGB?{byteLength:16,width:6,height:5}:t===pF.ASTC6x6Unorm||t===pF.ASTC6x6UnormSRGB?{byteLength:16,width:6,height:6}:t===pF.ASTC8x5Unorm||t===pF.ASTC8x5UnormSRGB?{byteLength:16,width:8,height:5}:t===pF.ASTC8x6Unorm||t===pF.ASTC8x6UnormSRGB?{byteLength:16,width:8,height:6}:t===pF.ASTC8x8Unorm||t===pF.ASTC8x8UnormSRGB?{byteLength:16,width:8,height:8}:t===pF.ASTC10x5Unorm||t===pF.ASTC10x5UnormSRGB?{byteLength:16,width:10,height:5}:t===pF.ASTC10x6Unorm||t===pF.ASTC10x6UnormSRGB?{byteLength:16,width:10,height:6}:t===pF.ASTC10x8Unorm||t===pF.ASTC10x8UnormSRGB?{byteLength:16,width:10,height:8}:t===pF.ASTC10x10Unorm||t===pF.ASTC10x10UnormSRGB?{byteLength:16,width:10,height:10}:t===pF.ASTC12x10Unorm||t===pF.ASTC12x10UnormSRGB?{byteLength:16,width:12,height:10}:t===pF.ASTC12x12Unorm||t===pF.ASTC12x12UnormSRGB?{byteLength:16,width:12,height:12}:void 0}_convertAddressMode(t){let e=fF;return t===Sx?e=mF:t===wx&&(e=gF),e}_convertFilterMode(t){let e=yF;return t!==Tx&&t!==Ex&&t!==Cx||(e=vF),e}_getBytesPerTexel(t){return t===pF.R8Unorm||t===pF.R8Snorm||t===pF.R8Uint||t===pF.R8Sint?1:t===pF.R16Uint||t===pF.R16Sint||t===pF.R16Float||t===pF.RG8Unorm||t===pF.RG8Snorm||t===pF.RG8Uint||t===pF.RG8Sint?2:t===pF.R32Uint||t===pF.R32Sint||t===pF.R32Float||t===pF.RG16Uint||t===pF.RG16Sint||t===pF.RG16Float||t===pF.RGBA8Unorm||t===pF.RGBA8UnormSRGB||t===pF.RGBA8Snorm||t===pF.RGBA8Uint||t===pF.RGBA8Sint||t===pF.BGRA8Unorm||t===pF.BGRA8UnormSRGB||t===pF.RGB9E5UFloat||t===pF.RGB10A2Unorm||t===pF.RG11B10UFloat||t===pF.Depth32Float||t===pF.Depth24Plus||t===pF.Depth24PlusStencil8||t===pF.Depth32FloatStencil8?4:t===pF.RG32Uint||t===pF.RG32Sint||t===pF.RG32Float||t===pF.RGBA16Uint||t===pF.RGBA16Sint||t===pF.RGBA16Float?8:t===pF.RGBA32Uint||t===pF.RGBA32Sint||t===pF.RGBA32Float?16:void 0}_getTypedArrayType(t){return t===pF.R8Uint?Uint8Array:t===pF.R8Sint?Int8Array:t===pF.R8Unorm?Uint8Array:t===pF.R8Snorm?Int8Array:t===pF.RG8Uint?Uint8Array:t===pF.RG8Sint?Int8Array:t===pF.RG8Unorm?Uint8Array:t===pF.RG8Snorm?Int8Array:t===pF.RGBA8Uint?Uint8Array:t===pF.RGBA8Sint?Int8Array:t===pF.RGBA8Unorm?Uint8Array:t===pF.RGBA8Snorm?Int8Array:t===pF.R16Uint?Uint16Array:t===pF.R16Sint?Int16Array:t===pF.RG16Uint?Uint16Array:t===pF.RG16Sint?Int16Array:t===pF.RGBA16Uint?Uint16Array:t===pF.RGBA16Sint?Int16Array:t===pF.R16Float||t===pF.RG16Float||t===pF.RGBA16Float?Uint16Array:t===pF.R32Uint?Uint32Array:t===pF.R32Sint?Int32Array:t===pF.R32Float?Float32Array:t===pF.RG32Uint?Uint32Array:t===pF.RG32Sint?Int32Array:t===pF.RG32Float?Float32Array:t===pF.RGBA32Uint?Uint32Array:t===pF.RGBA32Sint?Int32Array:t===pF.RGBA32Float?Float32Array:t===pF.BGRA8Unorm||t===pF.BGRA8UnormSRGB?Uint8Array:t===pF.RGB10A2Unorm||t===pF.RGB9E5UFloat||t===pF.RG11B10UFloat?Uint32Array:t===pF.Depth32Float?Float32Array:t===pF.Depth24Plus||t===pF.Depth24PlusStencil8?Uint32Array:t===pF.Depth32FloatStencil8?Float32Array:void 0}_getDimension(t){let e;return e=t.isData3DTexture?rk:ik,e}}function Oq(t,e=null){const n=t.format,i=t.type,r=t.colorSpace;let s;if(!0===t.isFramebufferTexture&&t.type===Dx)s=pF.BGRA8Unorm;else if(!0===t.isCompressedTexture||!0===t.isCompressedArrayTexture)switch(n){case Zx:s=r===yb?pF.BC1RGBAUnormSRGB:pF.BC1RGBAUnorm;break;case Kx:s=r===yb?pF.BC2RGBAUnormSRGB:pF.BC2RGBAUnorm;break;case Jx:s=r===yb?pF.BC3RGBAUnormSRGB:pF.BC3RGBAUnorm;break;case tb:s=r===yb?pF.ETC2RGB8UnormSRGB:pF.ETC2RGB8Unorm;break;case eb:s=r===yb?pF.ETC2RGBA8UnormSRGB:pF.ETC2RGBA8Unorm;break;case nb:s=r===yb?pF.ASTC4x4UnormSRGB:pF.ASTC4x4Unorm;break;case ib:s=r===yb?pF.ASTC5x4UnormSRGB:pF.ASTC5x4Unorm;break;case rb:s=r===yb?pF.ASTC5x5UnormSRGB:pF.ASTC5x5Unorm;break;case sb:s=r===yb?pF.ASTC6x5UnormSRGB:pF.ASTC6x5Unorm;break;case ab:s=r===yb?pF.ASTC6x6UnormSRGB:pF.ASTC6x6Unorm;break;case ob:s=r===yb?pF.ASTC8x5UnormSRGB:pF.ASTC8x5Unorm;break;case lb:s=r===yb?pF.ASTC8x6UnormSRGB:pF.ASTC8x6Unorm;break;case ub:s=r===yb?pF.ASTC8x8UnormSRGB:pF.ASTC8x8Unorm;break;case hb:s=r===yb?pF.ASTC10x5UnormSRGB:pF.ASTC10x5Unorm;break;case cb:s=r===yb?pF.ASTC10x6UnormSRGB:pF.ASTC10x6Unorm;break;case Ab:s=r===yb?pF.ASTC10x8UnormSRGB:pF.ASTC10x8Unorm;break;case db:s=r===yb?pF.ASTC10x10UnormSRGB:pF.ASTC10x10Unorm;break;case pb:s=r===yb?pF.ASTC12x10UnormSRGB:pF.ASTC12x10Unorm;break;case fb:s=r===yb?pF.ASTC12x12UnormSRGB:pF.ASTC12x12Unorm;break;default:console.error("WebGPURenderer: Unsupported texture format.",n)}else switch(n){case Gx:switch(i){case Ix:s=pF.RGBA8Snorm;break;case Lx:s=pF.RGBA16Sint;break;case Bx:s=pF.RGBA16Uint;break;case Ox:s=pF.RGBA32Uint;break;case Ux:s=pF.RGBA32Sint;break;case Dx:s=r===yb?pF.RGBA8UnormSRGB:pF.RGBA8Unorm;break;case kx:s=pF.RGBA16Float;break;case Fx:s=pF.RGBA32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RGBAFormat.",i)}break;case qx:if(35902===i)s=pF.RGB9E5UFloat;else console.error("WebGPURenderer: Unsupported texture type with RGBFormat.",i);break;case jx:switch(i){case Ix:s=pF.R8Snorm;break;case Lx:s=pF.R16Sint;break;case Bx:s=pF.R16Uint;break;case Ox:s=pF.R32Uint;break;case Ux:s=pF.R32Sint;break;case Dx:s=pF.R8Unorm;break;case kx:s=pF.R16Float;break;case Fx:s=pF.R32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RedFormat.",i)}break;case Xx:switch(i){case Ix:s=pF.RG8Snorm;break;case Lx:s=pF.RG16Sint;break;case Bx:s=pF.RG16Uint;break;case Ox:s=pF.RG32Uint;break;case Ux:s=pF.RG32Sint;break;case Dx:s=pF.RG8Unorm;break;case kx:s=pF.RG16Float;break;case Fx:s=pF.RG32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with RGFormat.",i)}break;case Vx:switch(i){case Bx:s=pF.Depth16Unorm;break;case Ox:s=pF.Depth24Plus;break;case Fx:s=pF.Depth32Float;break;default:console.error("WebGPURenderer: Unsupported texture type with DepthFormat.",i)}break;case Hx:switch(i){case zx:s=pF.Depth24PlusStencil8;break;case Fx:e&&!1===e.features.has(Ak.Depth32FloatStencil8)&&console.error('WebGPURenderer: Depth textures with DepthStencilFormat + FloatType can only be used with the "depth32float-stencil8" GPU feature.'),s=pF.Depth32FloatStencil8;break;default:console.error("WebGPURenderer: Unsupported texture type with DepthStencilFormat.",i)}break;case Wx:switch(i){case Ux:s=pF.R32Sint;break;case Ox:s=pF.R32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RedIntegerFormat.",i)}break;case Yx:switch(i){case Ux:s=pF.RG32Sint;break;case Ox:s=pF.RG32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RGIntegerFormat.",i)}break;case Qx:switch(i){case Ux:s=pF.RGBA32Sint;break;case Ox:s=pF.RGBA32Uint;break;default:console.error("WebGPURenderer: Unsupported texture type with RGBAIntegerFormat.",i)}break;default:console.error("WebGPURenderer: Unsupported texture format.",n)}return s}const Fq=/^[fn]*\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)\s*[\-\>]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,kq=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/gi,zq={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2<f32>":"vec2","vec2<i32>":"ivec2","vec2<u32>":"uvec2","vec2<bool>":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3<f32>":"vec3","vec3<i32>":"ivec3","vec3<u32>":"uvec3","vec3<bool>":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4<f32>":"vec4","vec4<i32>":"ivec4","vec4<u32>":"uvec4","vec4<bool>":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2<f32>":"mat2",mat2x2f:"mat2","mat3x3<f32>":"mat3",mat3x3f:"mat3","mat4x4<f32>":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"};class qq extends hz{constructor(t){const{type:e,inputs:n,name:i,inputsCode:r,blockCode:s,outputType:a}=(t=>{const e=(t=t.trim()).match(Fq);if(null!==e&&4===e.length){const n=e[2],i=[];let r=null;for(;null!==(r=kq.exec(n));)i.push({name:r[1],type:r[2]});const s=[];for(let t=0;t<i.length;t++){const{name:e,type:n}=i[t];let r=n;r.startsWith("texture")&&(r=n.split("<")[0]),r=zq[r]||r,s.push(new UO(r,e))}const a=t.substring(e[0].length),o=e[3]||"void",l=void 0!==e[1]?e[1]:"";return{type:zq[o]||o,inputs:s,name:l,inputsCode:n,blockCode:a,outputType:o}}throw new Error("FunctionNode: Function is not a WGSL code.")})(t);super(e,n,i),this.inputsCode=r,this.blockCode=s,this.outputType=a}getCode(t=this.name){const e="void"!==this.outputType?"-> "+this.outputType:"";return`fn ${t} ( ${this.inputsCode.trim()} ) ${e}`+this.blockCode}}class Gq extends uz{parseFunction(t){return new qq(t)}}const Vq=self.GPUShaderStage,Hq={vertex:Vq?Vq.VERTEX:1,fragment:Vq?Vq.FRAGMENT:2,compute:Vq?Vq.COMPUTE:4},jq={instance:!0,swizzleAssign:!1,storageBuffer:!0},Wq={"^^":"tsl_xor"},Xq={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3<f32>",vec2:"vec2<f32>",ivec2:"vec2<i32>",uvec2:"vec2<u32>",bvec2:"vec2<bool>",vec3:"vec3<f32>",ivec3:"vec3<i32>",uvec3:"vec3<u32>",bvec3:"vec3<bool>",vec4:"vec4<f32>",ivec4:"vec4<i32>",uvec4:"vec4<u32>",bvec4:"vec4<bool>",mat2:"mat2x2<f32>",imat2:"mat2x2<i32>",umat2:"mat2x2<u32>",bmat2:"mat2x2<bool>",mat3:"mat3x3<f32>",imat3:"mat3x3<i32>",umat3:"mat3x3<u32>",bmat3:"mat3x3<bool>",mat4:"mat4x4<f32>",imat4:"mat4x4<i32>",umat4:"mat4x4<u32>",bmat4:"mat4x4<bool>"},Yq={tsl_xor:new VU("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new VU("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new VU("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new VU("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new VU("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new VU("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new VU("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2<bool> { return vec2<bool>( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new VU("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3<bool> { return vec3<bool>( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new VU("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4<bool> { return vec4<bool>( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping:new VU("\nfn tsl_repeatWrapping( uv : vec2<f32>, dimension : vec2<u32> ) -> vec2<u32> {\n\n\tlet uvScaled = vec2<u32>( uv * vec2<f32>( dimension ) );\n\n\treturn ( ( uvScaled % dimension ) + dimension ) % dimension;\n\n}\n"),biquadraticTexture:new VU("\nfn tsl_biquadraticTexture( map : texture_2d<f32>, coord : vec2f, level : i32 ) -> vec4f {\n\n\tlet iRes = vec2i( textureDimensions( map, level ) );\n\tlet res = vec2f( iRes );\n\n\tlet uvScaled = coord * res;\n\tlet uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n\t// https://www.shadertoy.com/view/WtyXRy\n\n\tlet uv = uvWrapping - 0.5;\n\tlet iuv = floor( uv );\n\tlet f = fract( uv );\n\n\tlet rg1 = textureLoad( map, vec2i( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n\tlet rg2 = textureLoad( map, vec2i( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n\tlet rg3 = textureLoad( map, vec2i( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n\tlet rg4 = textureLoad( map, vec2i( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n\treturn mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n")},Qq={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inversesqrt:"inverseSqrt",bitcast:"bitcast<f32>"};/Windows/g.test(navigator.userAgent)&&(Yq.pow_float=new VU("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),Yq.pow_vec2=new VU("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[Yq.pow_float]),Yq.pow_vec3=new VU("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[Yq.pow_float]),Yq.pow_vec4=new VU("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[Yq.pow_float]),Qq.pow_float="tsl_pow_float",Qq.pow_vec2="tsl_pow_vec2",Qq.pow_vec3="tsl_pow_vec3",Qq.pow_vec4="tsl_pow_vec4");let $q="";!0!==/Firefox/g.test(navigator.userAgent)&&($q+="diagnostic( off, derivative_uniformity );\n");class Zq extends LO{constructor(t,e){super(t,e,new Gq),this.uniformGroups={},this.builtins={},this.directives={},this.scopedArrays=new Map}needsToWorkingColorSpace(t){return!0===t.isVideoTexture&&t.colorSpace!==gb}_generateTextureSample(t,e,n,i,r=this.shaderStage){return"fragment"===r?i?`textureSample( ${e}, ${e}_sampler, ${n}, ${i} )`:`textureSample( ${e}, ${e}_sampler, ${n} )`:this.isFilteredTexture(t)?this.generateFilteredTexture(t,e,n):this.generateTextureLod(t,e,n,"0")}_generateVideoSample(t,e,n=this.shaderStage){if("fragment"===n)return`textureSampleBaseClampToEdge( ${t}, ${t}_sampler, vec2<f32>( ${e}.x, 1.0 - ${e}.y ) )`;console.error(`WebGPURenderer: THREE.VideoTexture does not support ${n} shader.`)}_generateTextureSampleLevel(t,e,n,i,r,s=this.shaderStage){return"fragment"===s&&!1===this.isUnfilterable(t)?`textureSampleLevel( ${e}, ${e}_sampler, ${n}, ${i} )`:this.isFilteredTexture(t)?this.generateFilteredTexture(t,e,n,i):this.generateTextureLod(t,e,n,i)}generateFilteredTexture(t,e,n,i="0"){return this._include("biquadraticTexture"),`tsl_biquadraticTexture( ${e}, ${n}, i32( ${i} ) )`}generateTextureLod(t,e,n,i="0"){this._include("repeatWrapping");return`textureLoad( ${e}, tsl_repeatWrapping( ${n}, ${!0===t.isMultisampleRenderTargetTexture?`textureDimensions( ${e} )`:`textureDimensions( ${e}, 0 )`} ), i32( ${i} ) )`}generateTextureLoad(t,e,n,i,r="0u"){return i?`textureLoad( ${e}, ${n}, ${i}, ${r} )`:`textureLoad( ${e}, ${n}, ${r} )`}generateTextureStore(t,e,n,i){return`textureStore( ${e}, ${n}, ${i} )`}isUnfilterable(t){return"float"!==this.getComponentTypeFromTexture(t)||!this.isAvailable("float32Filterable")&&!0===t.isDataTexture&&t.type===Fx||!0===t.isMultisampleRenderTargetTexture}generateTexture(t,e,n,i,r=this.shaderStage){let s=null;return s=!0===t.isVideoTexture?this._generateVideoSample(e,n,r):this.isUnfilterable(t)?this.generateTextureLod(t,e,n,"0",i,r):this._generateTextureSample(t,e,n,i,r),s}generateTextureGrad(t,e,n,i,r,s=this.shaderStage){if("fragment"===s)return`textureSampleGrad( ${e}, ${e}_sampler, ${n},  ${i[0]}, ${i[1]} )`;console.error(`WebGPURenderer: THREE.TextureNode.gradient() does not support ${s} shader.`)}generateTextureCompare(t,e,n,i,r,s=this.shaderStage){if("fragment"===s)return`textureSampleCompare( ${e}, ${e}_sampler, ${n}, ${i} )`;console.error(`WebGPURenderer: THREE.DepthTexture.compareFunction() does not support ${s} shader.`)}generateTextureLevel(t,e,n,i,r,s=this.shaderStage){let a=null;return a=!0===t.isVideoTexture?this._generateVideoSample(e,n,s):this._generateTextureSampleLevel(t,e,n,i,r,s),a}generateTextureBias(t,e,n,i,r,s=this.shaderStage){if("fragment"===s)return`textureSampleBias( ${e}, ${e}_sampler, ${n}, ${i} )`;console.error(`WebGPURenderer: THREE.TextureNode.biasNode does not support ${s} shader.`)}getPropertyName(t,e=this.shaderStage){if(!0===t.isNodeVarying&&!0===t.needsInterpolation){if("vertex"===e)return`varyings.${t.name}`}else if(!0===t.isNodeUniform){const e=t.name,n=t.type;return"texture"===n||"cubeTexture"===n||"storageTexture"===n||"texture3D"===n?e:"buffer"===n||"storageBuffer"===n?`NodeBuffer_${t.id}.${e}`:t.groupNode.name+"."+e}return super.getPropertyName(t)}getOutputStructName(){return"output"}_getUniformGroupCount(t){return Object.keys(this.uniforms[t]).length}getFunctionOperator(t){const e=Wq[t];return void 0!==e?(this._include(e),e):null}getStorageAccess(t){if(t.isStorageTextureNode)switch(t.access){case ZF:return"read";case $F:return"write";default:return"read_write"}else switch(t.access){case YF:return"read_write";case QF:return"read";default:return"write"}}getUniformFromNode(t,e,n,i=null){const r=super.getUniformFromNode(t,e,n,i),s=this.getDataFromNode(t,n,this.globalCache);if(void 0===s.uniformGPU){let i;const a=t.groupNode,o=a.name,l=this.getBindGroupArray(o,n);if("texture"===e||"cubeTexture"===e||"storageTexture"===e||"texture3D"===e){let s=null;if("texture"===e||"storageTexture"===e?s=new Kz(r.name,r.node,a,t.access?t.access:null):"cubeTexture"===e?s=new Jz(r.name,r.node,a,t.access?t.access:null):"texture3D"===e&&(s=new tq(r.name,r.node,a,t.access?t.access:null)),s.store=!0===t.isStorageTextureNode,s.setVisibility(Hq[n]),"fragment"===n&&!1===this.isUnfilterable(t.value)&&!1===s.store){const t=new Rq(`${r.name}_sampler`,r.node,a);t.setVisibility(Hq[n]),l.push(t,s),i=[t,s]}else l.push(s),i=[s]}else if("buffer"===e||"storageBuffer"===e){const r=new("storageBuffer"===e?Dq:Wz)(t,a);r.setVisibility(Hq[n]),l.push(r),i=r}else{const t=this.uniformGroups[n]||(this.uniformGroups[n]={});let s=t[o];void 0===s&&(s=new Qz(o,a),s.setVisibility(Hq[n]),t[o]=s,l.push(s)),i=this.getNodeUniform(r,e),s.addUniform(i)}s.uniformGPU=i}return r}getBuiltin(t,e,n,i=this.shaderStage){const r=this.builtins[i]||(this.builtins[i]=new Map);return!1===r.has(t)&&r.set(t,{name:t,property:e,type:n}),e}hasBuiltin(t,e=this.shaderStage){return void 0!==this.builtins[e]&&this.builtins[e].has(t)}getVertexIndex(){return"vertex"===this.shaderStage?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(t){const e=t.layout,n=this.flowShaderNode(t),i=[];for(const t of e.inputs)i.push(t.name+" : "+this.getType(t.type));let r=`fn ${e.name}( ${i.join(", ")} ) -> ${this.getType(e.type)} {\n${n.vars}\n${n.code}\n`;return n.result&&(r+=`\treturn ${n.result};\n`),r+="\n}\n",r}getInstanceIndex(){return"vertex"===this.shaderStage?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4<f32>")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}isFlipY(){return!1}enableDirective(t,e=this.shaderStage){(this.directives[e]||(this.directives[e]=new Set)).add(t)}getDirectives(t){const e=[],n=this.directives[t];if(void 0!==n)for(const t of n)e.push(`enable ${t};`);return e.join("\n")}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}getBuiltins(t){const e=[],n=this.builtins[t];if(void 0!==n)for(const{name:t,property:i,type:r}of n.values())e.push(`@builtin( ${t} ) ${i} : ${r}`);return e.join(",\n\t")}getScopedArray(t,e,n,i){return!1===this.scopedArrays.has(t)&&this.scopedArrays.set(t,{name:t,scope:e,bufferType:n,bufferCount:i}),t}getScopedArrays(t){if("compute"!==t)return;const e=[];for(const{name:t,scope:n,bufferType:i,bufferCount:r}of this.scopedArrays.values()){const s=this.getType(i);e.push(`var<${n}> ${t}: array< ${s}, ${r} >;`)}return e.join("\n")}getAttributes(t){const e=[];if("compute"===t&&(this.getBuiltin("global_invocation_id","id","vec3<u32>","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3<u32>","attribute"),this.getBuiltin("local_invocation_id","localId","vec3<u32>","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3<u32>","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",t),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),"vertex"===t||"compute"===t){const t=this.getBuiltins("attribute");t&&e.push(t);const n=this.getAttributesArray();for(let t=0,i=n.length;t<i;t++){const i=n[t],r=i.name,s=this.getType(i.type);e.push(`@location( ${t} ) ${r} : ${s}`)}}return e.join(",\n\t")}getStructMembers(t){const e=[],n=t.getMemberTypes();for(let t=0;t<n.length;t++){const i=n[t];e.push(`\t@location( ${t} ) m${t} : ${i}<f32>`)}const i=this.getBuiltins("output");return i&&e.push("\t"+i),e.join(",\n")}getStructs(t){const e=[],n=this.structs[t];for(let t=0,i=n.length;t<i;t++){const i=n[t],r=i.name;let s=`struct ${r} {\n`;s+=this.getStructMembers(i),s+="\n}",e.push(s),e.push(`\nvar<private> output : ${r};\n\n`)}return e.join("\n\n")}getVar(t,e){return`var ${e} : ${this.getType(t)}`}getVars(t){const e=[],n=this.vars[t];if(void 0!==n)for(const t of n)e.push(`\t${this.getVar(t.type,t.name)};`);return`\n${e.join("\n")}\n`}getVaryings(t){const e=[];if("vertex"===t&&this.getBuiltin("position","Vertex","vec4<f32>","vertex"),"vertex"===t||"fragment"===t){const n=this.varyings,i=this.vars[t];for(let r=0;r<n.length;r++){const s=n[r];if(s.needsInterpolation){let t=`@location( ${r} )`;/^(int|uint|ivec|uvec)/.test(s.type)&&(t+=" @interpolate( flat )"),e.push(`${t} ${s.name} : ${this.getType(s.type)}`)}else"vertex"===t&&!1===i.includes(s)&&i.push(s)}}const n=this.getBuiltins(t);n&&e.push(n);const i=e.join(",\n\t");return"vertex"===t?this._getWGSLStruct("VaryingsStruct","\t"+i):i}getUniforms(t){const e=this.uniforms[t],n=[],i=[],r=[],s={};for(const r of e){const e=r.groupNode.name,a=this.bindingsIndexes[e];if("texture"===r.type||"cubeTexture"===r.type||"storageTexture"===r.type||"texture3D"===r.type){const e=r.node.value;let i;"fragment"===t&&!1===this.isUnfilterable(e)&&!0!==r.node.isStorageTextureNode&&(!0===e.isDepthTexture&&null!==e.compareFunction?n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${r.name}_sampler : sampler_comparison;`):n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${r.name}_sampler : sampler;`));let s="";if(!0===e.isMultisampleRenderTargetTexture&&(s="_multisampled"),!0===e.isCubeTexture)i="texture_cube<f32>";else if(!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture)i="texture_2d_array<f32>";else if(!0===e.isDepthTexture)i=`texture_depth${s}_2d`;else if(!0===e.isVideoTexture)i="texture_external";else if(!0===e.isData3DTexture)i="texture_3d<f32>";else if(!0===r.node.isStorageTextureNode){i=`texture_storage_2d<${Oq(e)}, ${this.getStorageAccess(r.node)}>`}else{i=`texture${s}_2d<${this.getComponentTypeFromTexture(e).charAt(0)}32>`}n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${r.name} : ${i};`)}else if("buffer"===r.type||"storageBuffer"===r.type){const t=r.node,e=this.getType(t.bufferType),n=t.bufferCount,s=n>0?", "+n:"",o=t.isAtomic?`atomic<${e}>`:`${e}`,l=`\t${r.name} : array< ${o}${s} >\n`,u=t.isStorageBufferNode?`storage, ${this.getStorageAccess(t)}`:"uniform";i.push(this._getWGSLStructBinding("NodeBuffer_"+t.id,l,u,a.binding++,a.group))}else{const t=this.getType(this.getVectorType(r.type)),e=r.groupNode.name;(s[e]||(s[e]={index:a.binding++,id:a.group,snippets:[]})).snippets.push(`\t${r.name} : ${t}`)}}for(const t in s){const e=s[t];r.push(this._getWGSLStructBinding(t,e.snippets.join(",\n"),"uniform",e.index,e.id))}let a=n.join("\n");return a+=i.join("\n"),a+=r.join("\n"),a}buildCode(){const t=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const e in t){const n=t[e];n.uniforms=this.getUniforms(e),n.attributes=this.getAttributes(e),n.varyings=this.getVaryings(e),n.structs=this.getStructs(e),n.vars=this.getVars(e),n.codes=this.getCodes(e),n.directives=this.getDirectives(e),n.scopedArrays=this.getScopedArrays(e);let i="// code\n\n";i+=this.flowCode[e];const r=this.flowNodes[e],s=r[r.length-1],a=s.outputNode,o=void 0!==a&&!0===a.isOutputStructNode;for(const t of r){const r=this.getFlowData(t),l=t.name;if(l&&(i.length>0&&(i+="\n"),i+=`\t// flow -> ${l}\n\t`),i+=`${r.code}\n\t`,t===s&&"compute"!==e)if(i+="// result\n\n\t","vertex"===e)i+=`varyings.Vertex = ${r.result};`;else if("fragment"===e)if(o)n.returnType=a.nodeType,i+=`return ${r.result};`;else{let t="\t@location(0) color: vec4<f32>";const e=this.getBuiltins("output");e&&(t+=",\n\t"+e),n.returnType="OutputStruct",n.structs+=this._getWGSLStruct("OutputStruct",t),n.structs+="\nvar<private> output : OutputStruct;\n\n",i+=`output.color = ${r.result};\n\n\treturn output;`}}n.flow=i}null!==this.material?(this.vertexShader=this._getWGSLVertexCode(t.vertex),this.fragmentShader=this._getWGSLFragmentCode(t.fragment)):this.computeShader=this._getWGSLComputeCode(t.compute,(this.object.workgroupSize||[64]).join(", "))}getMethod(t,e=null){let n;return null!==e&&(n=this._getWGSLMethod(t+"_"+e)),void 0===n&&(n=this._getWGSLMethod(t)),n||t}getType(t){return Xq[t]||t}isAvailable(t){let e=jq[t];return void 0===e&&("float32Filterable"===t&&(e=this.renderer.hasFeature("float32-filterable")),jq[t]=e),e}_getWGSLMethod(t){return void 0!==Yq[t]&&this._include(t),Qq[t]}_include(t){const e=Yq[t];return e.build(this),null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(e),e}_getWGSLVertexCode(t){return`${this.getSignature()}\n// directives\n${t.directives}\n\n// uniforms\n${t.uniforms}\n\n// varyings\n${t.varyings}\nvar<private> varyings : VaryingsStruct;\n\n// codes\n${t.codes}\n\n@vertex\nfn main( ${t.attributes} ) -> VaryingsStruct {\n\n\t// vars\n\t${t.vars}\n\n\t// flow\n\t${t.flow}\n\n\treturn varyings;\n\n}\n`}_getWGSLFragmentCode(t){return`${this.getSignature()}\n// global\n${$q}\n\n// uniforms\n${t.uniforms}\n\n// structs\n${t.structs}\n\n// codes\n${t.codes}\n\n@fragment\nfn main( ${t.varyings} ) -> ${t.returnType} {\n\n\t// vars\n\t${t.vars}\n\n\t// flow\n\t${t.flow}\n\n}\n`}_getWGSLComputeCode(t,e){return`${this.getSignature()}\n// directives\n${t.directives}\n\n// system\nvar<private> instanceIndex : u32;\n\n// locals\n${t.scopedArrays}\n\n// uniforms\n${t.uniforms}\n\n// codes\n${t.codes}\n\n@compute @workgroup_size( ${e} )\nfn main( ${t.attributes} ) {\n\n\t// system\n\tinstanceIndex = id.x + id.y * numWorkgroups.x * u32(${e}) + id.z * numWorkgroups.x * numWorkgroups.y * u32(${e});\n\n\t// vars\n\t${t.vars}\n\n\t// flow\n\t${t.flow}\n\n}\n`}_getWGSLStruct(t,e){return`\nstruct ${t} {\n${e}\n};`}_getWGSLStructBinding(t,e,n,i=0,r=0){const s=t+"Struct";return`${this._getWGSLStruct(s,e)}\n@binding( ${i} ) @group( ${r} )\nvar<${n}> ${t} : ${s};`}}class Kq{constructor(t){this.backend=t}getCurrentDepthStencilFormat(t){let e;return null!==t.depthTexture?e=this.getTextureFormatGPU(t.depthTexture):t.depth&&t.stencil?e=pF.Depth24PlusStencil8:t.depth&&(e=pF.Depth24Plus),e}getTextureFormatGPU(t){return this.backend.get(t).format}getCurrentColorFormat(t){let e;return e=null!==t.textures?this.getTextureFormatGPU(t.textures[0]):this.getPreferredCanvasFormat(),e}getCurrentColorSpace(t){return null!==t.textures?t.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(t,e){return t.isPoints?WO:t.isLineSegments||t.isMesh&&!0===e.wireframe?XO:t.isLine?YO:t.isMesh?QO:void 0}getSampleCount(t){let e=1;return t>1&&(e=Math.pow(2,Math.floor(Math.log2(t))),2===e&&(e=4)),e}getSampleCountRenderContext(t){return null!==t.textures?this.getSampleCount(t.sampleCount):this.getSampleCount(this.backend.renderer.samples)}getPreferredCanvasFormat(){return navigator.userAgent.includes("Quest")?pF.BGRA8Unorm:navigator.gpu.getPreferredCanvasFormat()}}const Jq=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]),tG=new Map([[nw,["float16"]]]),eG=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class nG{constructor(t){this.backend=t}createAttribute(t,e){const n=this._getBufferAttribute(t),i=this.backend,r=i.get(n);let s=r.buffer;if(void 0===s){const a=i.device;let o=n.array;if(!1===t.normalized&&(o.constructor===Int16Array||o.constructor===Uint16Array)){const t=new Uint32Array(o.length);for(let e=0;e<o.length;e++)t[e]=o[e];o=t}if(n.array=o,(n.isStorageBufferAttribute||n.isStorageInstancedBufferAttribute)&&3===n.itemSize){o=new o.constructor(4*n.count);for(let t=0;t<n.count;t++)o.set(n.array.subarray(3*t,3*t+3),4*t);n.itemSize=4,n.array=o}const l=o.byteLength+(4-o.byteLength%4)%4;s=a.createBuffer({label:n.name,size:l,usage:e,mappedAtCreation:!0}),new o.constructor(s.getMappedRange()).set(o),s.unmap(),r.buffer=s}}updateAttribute(t){const e=this._getBufferAttribute(t),n=this.backend,i=n.device,r=n.get(e).buffer,s=e.array,a=e.updateRanges;if(0===a.length)i.queue.writeBuffer(r,0,s,0);else{for(let t=0,e=a.length;t<e;t++){const e=a[t];i.queue.writeBuffer(r,0,s,e.start*s.BYTES_PER_ELEMENT,e.count*s.BYTES_PER_ELEMENT)}e.clearUpdateRanges()}}createShaderVertexBuffers(t){const e=t.getAttributes(),n=new Map;for(let t=0;t<e.length;t++){const i=e[t],r=i.array.BYTES_PER_ELEMENT,s=this._getBufferAttribute(i);let a=n.get(s);if(void 0===a){let t,e;!0===i.isInterleavedBufferAttribute?(t=i.data.stride*r,e=i.data.isInstancedInterleavedBuffer?ck:hk):(t=i.itemSize*r,e=i.isInstancedBufferAttribute?ck:hk),!1!==i.normalized||i.array.constructor!==Int16Array&&i.array.constructor!==Uint16Array||(t=4),a={arrayStride:t,attributes:[],stepMode:e},n.set(s,a)}const o=this._getVertexFormat(i),l=!0===i.isInterleavedBufferAttribute?i.offset*r:0;a.attributes.push({shaderLocation:t,offset:l,format:o})}return Array.from(n.values())}destroyAttribute(t){const e=this.backend;e.get(this._getBufferAttribute(t)).buffer.destroy(),e.delete(t)}async getArrayBufferAsync(t){const e=this.backend,n=e.device,i=e.get(this._getBufferAttribute(t)).buffer,r=i.size,s=n.createBuffer({label:t.name,size:r,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),a=n.createCommandEncoder({});a.copyBufferToBuffer(i,0,s,0,r),s.unmap();const o=a.finish();n.queue.submit([o]),await s.mapAsync(GPUMapMode.READ);return s.getMappedRange()}_getVertexFormat(t){const{itemSize:e,normalized:n}=t,i=t.array.constructor,r=t.constructor;let s;if(1==e)s=eG.get(i);else{const t=(tG.get(r)||Jq.get(i))[n?1:0];if(t){const n=i.BYTES_PER_ELEMENT*e,r=4*Math.floor((n+3)/4)/i.BYTES_PER_ELEMENT;if(r%1)throw new Error("THREE.WebGPUAttributeUtils: Bad vertex format item size.");s=`${t}x${r}`}}return s||console.error("THREE.WebGPUAttributeUtils: Vertex format not supported yet."),s}_getBufferAttribute(t){return t.isInterleavedBufferAttribute&&(t=t.data),t}}class iG{constructor(t){this.backend=t,this.bindGroupLayoutCache=new WeakMap}createBindingsLayout(t){const e=this.backend.device,n=[];let i=0;for(const e of t.bindings){const t={binding:i++,visibility:e.visibility};if(e.isUniformBuffer||e.isStorageBuffer){const n={};e.isStorageBuffer&&(n.type=e.access),t.buffer=n}else if(e.isSampler){const n={};e.texture.isDepthTexture&&null!==e.texture.compareFunction&&(n.type="comparison"),t.sampler=n}else if(e.isSampledTexture&&e.texture.isVideoTexture)t.externalTexture={};else if(e.isSampledTexture&&e.store){const n=this.backend.get(e.texture).texture.format,i=e.access;t.storageTexture={format:n,access:i}}else if(e.isSampledTexture){const n={};if(!0===e.texture.isMultisampleRenderTargetTexture&&(n.multisampled=!0),e.texture.isDepthTexture)n.sampleType=tk;else if(e.texture.isDataTexture||e.texture.isDataArrayTexture||e.texture.isData3DTexture){const t=e.texture.type;t===Ux?n.sampleType=ek:t===Ox?n.sampleType=nk:t===Fx&&(this.backend.hasFeature("float32-filterable")?n.sampleType=KF:n.sampleType=JF)}e.isSampledCubeTexture?n.viewDimension=ok:e.texture.isDataArrayTexture||e.texture.isCompressedArrayTexture?n.viewDimension=ak:e.isSampledTexture3D&&(n.viewDimension=lk),t.texture=n}else console.error(`WebGPUBindingUtils: Unsupported binding "${e}".`);n.push(t)}return e.createBindGroupLayout({entries:n})}createBindings(t){const{backend:e,bindGroupLayoutCache:n}=this,i=e.get(t);let r=n.get(t.bindingsReference);void 0===r&&(r=this.createBindingsLayout(t),n.set(t.bindingsReference,r));const s=this.createBindGroup(t,r);i.layout=r,i.group=s}updateBinding(t){const e=this.backend,n=e.device,i=t.buffer,r=e.get(t).buffer;n.queue.writeBuffer(r,0,i,0)}createBindGroup(t,e){const n=this.backend,i=n.device;let r=0;const s=[];for(const e of t.bindings){if(e.isUniformBuffer){const t=n.get(e);if(void 0===t.buffer){const n=e.byteLength,r=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,s=i.createBuffer({label:"bindingBuffer_"+e.name,size:n,usage:r});t.buffer=s}s.push({binding:r,resource:{buffer:t.buffer}})}else if(e.isStorageBuffer){const t=n.get(e);if(void 0===t.buffer){const i=e.attribute;t.buffer=n.get(i).buffer}s.push({binding:r,resource:{buffer:t.buffer}})}else if(e.isSampler){const t=n.get(e.texture);s.push({binding:r,resource:t.sampler})}else if(e.isSampledTexture){const t=n.get(e.texture);let a;if(void 0!==t.externalTexture)a=i.importExternalTexture({source:t.externalTexture});else{const n=e.store?1:t.texture.mipLevelCount,i=`view-${t.texture.width}-${t.texture.height}-${n}`;if(a=t[i],void 0===a){const r=uk;let s;s=e.isSampledCubeTexture?ok:e.isSampledTexture3D?lk:e.texture.isDataArrayTexture||e.texture.isCompressedArrayTexture?ak:sk,a=t[i]=t.texture.createView({aspect:r,dimension:s,mipLevelCount:n})}}s.push({binding:r,resource:a})}r++}return i.createBindGroup({label:"bindGroup_"+t.name,layout:e,entries:s})}}class rG{constructor(t){this.backend=t}_getSampleCount(t){return this.backend.utils.getSampleCountRenderContext(t)}createRenderPipeline(t,e){const{object:n,material:i,geometry:r,pipeline:s}=t,{vertexProgram:a,fragmentProgram:o}=s,l=this.backend,u=l.device,h=l.utils,c=l.get(s),A=[];for(const e of t.getBindings()){const t=l.get(e);A.push(t.layout)}const d=l.attributeUtils.createShaderVertexBuffers(t);let p;!0===i.transparent&&0!==i.blending&&(p=this._getBlending(i));let f={};!0===i.stencilWrite&&(f={compare:this._getStencilCompare(i),failOp:this._getStencilOperation(i.stencilFail),depthFailOp:this._getStencilOperation(i.stencilZFail),passOp:this._getStencilOperation(i.stencilZPass)});const m=this._getColorWriteMask(i),g=[];if(null!==t.context.textures){const e=t.context.textures;for(let t=0;t<e.length;t++){const n=h.getTextureFormatGPU(e[t]);g.push({format:n,blend:p,writeMask:m})}}else{const e=h.getCurrentColorFormat(t.context);g.push({format:e,blend:p,writeMask:m})}const y=l.get(a).module,v=l.get(o).module,_=this._getPrimitiveState(n,r,i),x=this._getDepthCompare(i),b=h.getCurrentDepthStencilFormat(t.context),S=this._getSampleCount(t.context),M={label:`renderPipeline_${i.name||i.type}_${i.id}`,vertex:Object.assign({},y,{buffers:d}),fragment:Object.assign({},v,{targets:g}),primitive:_,depthStencil:{format:b,depthWriteEnabled:i.depthWrite,depthCompare:x,stencilFront:f,stencilBack:{},stencilReadMask:i.stencilFuncMask,stencilWriteMask:i.stencilWriteMask},multisample:{count:S,alphaToCoverageEnabled:i.alphaToCoverage&&S>1},layout:u.createPipelineLayout({bindGroupLayouts:A})};if(null===e)c.pipeline=u.createRenderPipeline(M);else{const t=new Promise((t=>{u.createRenderPipelineAsync(M).then((e=>{c.pipeline=e,t()}))}));e.push(t)}}createBundleEncoder(t){const e=this.backend,{utils:n,device:i}=e,r=n.getCurrentDepthStencilFormat(t),s={label:"renderBundleEncoder",colorFormats:[n.getCurrentColorFormat(t)],depthStencilFormat:r,sampleCount:this._getSampleCount(t)};return i.createRenderBundleEncoder(s)}createComputePipeline(t,e){const n=this.backend,i=n.device,r=n.get(t.computeProgram).module,s=n.get(t),a=[];for(const t of e){const e=n.get(t);a.push(e.layout)}s.pipeline=i.createComputePipeline({compute:r,layout:i.createPipelineLayout({bindGroupLayouts:a})})}_getBlending(t){let e,n;const i=t.blending,r=t.blendSrc,s=t.blendDst,a=t.blendEquation;if(5===i){const i=null!==t.blendSrcAlpha?t.blendSrcAlpha:r,o=null!==t.blendDstAlpha?t.blendDstAlpha:s,l=null!==t.blendEquationAlpha?t.blendEquationAlpha:a;e={srcFactor:this._getBlendFactor(r),dstFactor:this._getBlendFactor(s),operation:this._getBlendOperation(a)},n={srcFactor:this._getBlendFactor(i),dstFactor:this._getBlendFactor(o),operation:this._getBlendOperation(l)}}else{const r=(t,i,r,s)=>{e={srcFactor:t,dstFactor:i,operation:IF},n={srcFactor:r,dstFactor:s,operation:IF}};if(t.premultipliedAlpha)switch(i){case 1:r(xF,wF,xF,wF);break;case 2:r(xF,xF,xF,xF);break;case 3:r(_F,SF,_F,xF);break;case 4:r(_F,bF,_F,MF)}else switch(i){case 1:r(MF,wF,xF,wF);break;case 2:r(MF,xF,MF,xF);break;case 3:r(_F,SF,_F,xF);break;case 4:r(_F,bF,_F,bF)}}if(void 0!==e&&void 0!==n)return{color:e,alpha:n};console.error("THREE.WebGPURenderer: Invalid blending: ",i)}_getBlendFactor(t){let e;switch(t){case 200:e=_F;break;case 201:e=xF;break;case 202:e=bF;break;case 203:e=SF;break;case Ax:e=MF;break;case dx:e=wF;break;case 208:e=TF;break;case 209:e=EF;break;case 206:e=CF;break;case 207:e=RF;break;case 210:e=NF;break;case 211:e=PF;break;case 212:e=DF;break;default:console.error("THREE.WebGPURenderer: Blend factor not supported.",t)}return e}_getStencilCompare(t){let e;const n=t.stencilFunc;switch(n){case 512:e=ZO;break;case 519:e=rF;break;case 513:e=KO;break;case 515:e=tF;break;case 514:e=JO;break;case 518:e=iF;break;case 516:e=eF;break;case 517:e=nF;break;default:console.error("THREE.WebGPURenderer: Invalid stencil function.",n)}return e}_getStencilOperation(t){let e;switch(t){case wb:e=zF;break;case 0:e=qF;break;case 7681:e=GF;break;case 5386:e=VF;break;case 7682:e=HF;break;case 7683:e=jF;break;case 34055:e=WF;break;case 34056:e=XF;break;default:console.error("THREE.WebGPURenderer: Invalid stencil operation.",e)}return e}_getBlendOperation(t){let e;switch(t){case sx:e=IF;break;case 101:e=LF;break;case 102:e=BF;break;case 103:e=UF;break;case 104:e=OF;break;default:console.error("THREE.WebGPUPipelineUtils: Blend equation not supported.",t)}return e}_getPrimitiveState(t,e,n){const i={},r=this.backend.utils;switch(i.topology=r.getPrimitiveTopology(t,n),null!==e.index&&!0===t.isLine&&!0!==t.isLineSegments&&(i.stripIndexFormat=e.index.array instanceof Uint16Array?AF:dF),n.side){case 0:i.frontFace=lF,i.cullMode=cF;break;case 1:i.frontFace=lF,i.cullMode=hF;break;case 2:i.frontFace=lF,i.cullMode=uF;break;default:console.error("THREE.WebGPUPipelineUtils: Unknown material.side value.",n.side)}return i}_getColorWriteMask(t){return!0===t.colorWrite?kF:FF}_getDepthCompare(t){let e;if(!1===t.depthTest)e=rF;else{const n=t.depthFunc;switch(n){case 0:e=ZO;break;case 1:e=rF;break;case 2:e=KO;break;case 3:e=tF;break;case 4:e=JO;break;case 5:e=iF;break;case 6:e=eF;break;case 7:e=nF;break;default:console.error("THREE.WebGPUPipelineUtils: Invalid depth function.",n)}}return e}}class sG extends uq{constructor(t={}){super(t),this.isWebGPUBackend=!0,this.parameters.alpha=void 0===t.alpha||t.alpha,this.parameters.requiredLimits=void 0===t.requiredLimits?{}:t.requiredLimits,this.trackTimestamp=!0===t.trackTimestamp,this.device=null,this.context=null,this.colorBuffer=null,this.defaultRenderPassdescriptor=null,this.utils=new Kq(this),this.attributeUtils=new nG(this),this.bindingUtils=new iG(this),this.pipelineUtils=new rG(this),this.textureUtils=new Uq(this),this.occludedResolveCache=new Map}async init(t){await super.init(t);const e=this.parameters;let n;if(void 0===e.device){const t={powerPreference:e.powerPreference},i=await navigator.gpu.requestAdapter(t);if(null===i)throw new Error("WebGPUBackend: Unable to create WebGPU adapter.");const r=Object.values(Ak),s=[];for(const t of r)i.features.has(t)&&s.push(t);const a={requiredFeatures:s,requiredLimits:e.requiredLimits};n=await i.requestDevice(a)}else n=e.device;const i=void 0!==e.context?e.context:t.domElement.getContext("webgpu");this.device=n,this.context=i;const r=e.alpha?"premultiplied":"opaque";this.trackTimestamp=this.trackTimestamp&&this.hasFeature(Ak.TimestampQuery),this.context.configure({device:this.device,format:this.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:r}),this.updateSize()}get coordinateSystem(){return Ob}async getArrayBufferAsync(t){return await this.attributeUtils.getArrayBufferAsync(t)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){let t=this.defaultRenderPassdescriptor;if(null===t){const e=this.renderer;t={colorAttachments:[{view:null}],depthStencilAttachment:{view:this.textureUtils.getDepthBuffer(e.depth,e.stencil).createView()}};const n=t.colorAttachments[0];this.renderer.samples>0?n.view=this.colorBuffer.createView():n.resolveTarget=void 0,this.defaultRenderPassdescriptor=t}const e=t.colorAttachments[0];return this.renderer.samples>0?e.resolveTarget=this.context.getCurrentTexture().createView():e.view=this.context.getCurrentTexture().createView(),t}_getRenderPassDescriptor(t){const e=t.renderTarget,n=this.get(e);let i=n.descriptors;if(void 0===i||n.width!==e.width||n.height!==e.height||n.activeMipmapLevel!==e.activeMipmapLevel||n.samples!==e.samples){i={},n.descriptors=i;const t=()=>{e.removeEventListener("dispose",t),this.delete(e)};e.addEventListener("dispose",t)}const r=t.getCacheKey();let s=i[r];if(void 0===s){const a=t.textures,o=[];for(let e=0;e<a.length;e++){const n=this.get(a[e]),i=n.texture.createView({baseMipLevel:t.activeMipmapLevel,mipLevelCount:1,baseArrayLayer:t.activeCubeFace,dimension:sk});let r,s;void 0!==n.msaaTexture?(r=n.msaaTexture.createView(),s=i):(r=i,s=void 0),o.push({view:r,resolveTarget:s,loadOp:aF,storeOp:sF})}s={colorAttachments:o,depthStencilAttachment:{view:this.get(t.depthTexture).texture.createView()}},i[r]=s,n.width=e.width,n.height=e.height,n.samples=e.samples,n.activeMipmapLevel=e.activeMipmapLevel}return s}beginRender(t){const e=this.get(t),n=this.device,i=t.occlusionQueryCount;let r,s;i>0&&(e.currentOcclusionQuerySet&&e.currentOcclusionQuerySet.destroy(),e.currentOcclusionQueryBuffer&&e.currentOcclusionQueryBuffer.destroy(),e.currentOcclusionQuerySet=e.occlusionQuerySet,e.currentOcclusionQueryBuffer=e.occlusionQueryBuffer,e.currentOcclusionQueryObjects=e.occlusionQueryObjects,r=n.createQuerySet({type:"occlusion",count:i}),e.occlusionQuerySet=r,e.occlusionQueryIndex=0,e.occlusionQueryObjects=new Array(i),e.lastOcclusionObject=null),s=null===t.textures?this._getDefaultRenderPassDescriptor():this._getRenderPassDescriptor(t),this.initTimestampQuery(t,s),s.occlusionQuerySet=r;const a=s.depthStencilAttachment;if(null!==t.textures){const e=s.colorAttachments;for(let n=0;n<e.length;n++){const i=e[n];t.clearColor?(i.clearValue=0===n?t.clearColorValue:{r:0,g:0,b:0,a:1},i.loadOp=oF,i.storeOp=sF):(i.loadOp=aF,i.storeOp=sF)}}else{const e=s.colorAttachments[0];t.clearColor?(e.clearValue=t.clearColorValue,e.loadOp=oF,e.storeOp=sF):(e.loadOp=aF,e.storeOp=sF)}t.depth&&(t.clearDepth?(a.depthClearValue=t.clearDepthValue,a.depthLoadOp=oF,a.depthStoreOp=sF):(a.depthLoadOp=aF,a.depthStoreOp=sF)),t.stencil&&(t.clearStencil?(a.stencilClearValue=t.clearStencilValue,a.stencilLoadOp=oF,a.stencilStoreOp=sF):(a.stencilLoadOp=aF,a.stencilStoreOp=sF));const o=n.createCommandEncoder({label:"renderContext_"+t.id}),l=o.beginRenderPass(s);if(e.descriptor=s,e.encoder=o,e.currentPass=l,e.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},e.renderBundles=[],t.viewport&&this.updateViewport(t),t.scissor){const{x:e,y:n,width:i,height:r}=t.scissorValue;l.setScissorRect(e,n,i,r)}}finishRender(t){const e=this.get(t),n=t.occlusionQueryCount;if(e.renderBundles.length>0&&e.currentPass.executeBundles(e.renderBundles),n>e.occlusionQueryIndex&&e.currentPass.endOcclusionQuery(),e.currentPass.end(),n>0){const i=8*n;let r=this.occludedResolveCache.get(i);void 0===r&&(r=this.device.createBuffer({size:i,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.occludedResolveCache.set(i,r));const s=this.device.createBuffer({size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});e.encoder.resolveQuerySet(e.occlusionQuerySet,0,n,r,0),e.encoder.copyBufferToBuffer(r,0,s,0,i),e.occlusionQueryBuffer=s,this.resolveOccludedAsync(t)}if(this.prepareTimestampBuffer(t,e.encoder),this.device.queue.submit([e.encoder.finish()]),null!==t.textures){const e=t.textures;for(let t=0;t<e.length;t++){const n=e[t];!0===n.generateMipmaps&&this.textureUtils.generateMipmaps(n)}}}isOccluded(t,e){const n=this.get(t);return n.occluded&&n.occluded.has(e)}async resolveOccludedAsync(t){const e=this.get(t),{currentOcclusionQueryBuffer:n,currentOcclusionQueryObjects:i}=e;if(n&&i){const t=new WeakSet;e.currentOcclusionQueryObjects=null,e.currentOcclusionQueryBuffer=null,await n.mapAsync(GPUMapMode.READ);const r=n.getMappedRange(),s=new BigUint64Array(r);for(let e=0;e<i.length;e++)s[e]!==BigInt(0)&&t.add(i[e]);n.destroy(),e.occluded=t}}updateViewport(t){const{currentPass:e}=this.get(t),{x:n,y:i,width:r,height:s,minDepth:a,maxDepth:o}=t.viewportValue;e.setViewport(n,i,r,s,a,o)}clear(t,e,n,i=null){const r=this.device,s=this.renderer;let a,o,l,u,h=[];if(t){const t=this.getClearColor();if(!0===this.renderer.alpha){const e=t.a;o={r:t.r*e,g:t.g*e,b:t.b*e,a:e}}else o={r:t.r,g:t.g,b:t.b,a:t.a}}if(null===i){l=s.depth,u=s.stencil;const e=this._getDefaultRenderPassDescriptor();if(t){h=e.colorAttachments;const t=h[0];t.clearValue=o,t.loadOp=oF,t.storeOp=sF}(l||u)&&(a=e.depthStencilAttachment)}else{if(l=i.depth,u=i.stencil,t)for(const t of i.textures){const e=this.get(t),n=e.texture.createView();let i,r;void 0!==e.msaaTexture?(i=e.msaaTexture.createView(),r=n):(i=n,r=void 0),h.push({view:i,resolveTarget:r,clearValue:o,loadOp:oF,storeOp:sF})}if(l||u){a={view:this.get(i.depthTexture).texture.createView()}}}l&&(e?(a.depthLoadOp=oF,a.depthClearValue=s.getClearDepth(),a.depthStoreOp=sF):(a.depthLoadOp=aF,a.depthStoreOp=sF)),u&&(n?(a.stencilLoadOp=oF,a.stencilClearValue=s.getClearStencil(),a.stencilStoreOp=sF):(a.stencilLoadOp=aF,a.stencilStoreOp=sF));const c=r.createCommandEncoder({});c.beginRenderPass({colorAttachments:h,depthStencilAttachment:a}).end(),r.queue.submit([c.finish()])}beginCompute(t){const e=this.get(t),n={};this.initTimestampQuery(t,n),e.cmdEncoderGPU=this.device.createCommandEncoder(),e.passEncoderGPU=e.cmdEncoderGPU.beginComputePass(n)}compute(t,e,n,i){const{passEncoderGPU:r}=this.get(t),s=this.get(i).pipeline;r.setPipeline(s);for(let t=0,e=n.length;t<e;t++){const e=n[t],i=this.get(e);r.setBindGroup(t,i.group)}const a=this.device.limits.maxComputeWorkgroupsPerDimension,o=this.get(e);void 0===o.dispatchSize&&(o.dispatchSize={x:0,y:1,z:1});const{dispatchSize:l}=o;e.dispatchCount>a?(l.x=Math.min(e.dispatchCount,a),l.y=Math.ceil(e.dispatchCount/a)):l.x=e.dispatchCount,r.dispatchWorkgroups(l.x,l.y,l.z)}finishCompute(t){const e=this.get(t);e.passEncoderGPU.end(),this.prepareTimestampBuffer(t,e.cmdEncoderGPU),this.device.queue.submit([e.cmdEncoderGPU.finish()])}draw(t,e){const{object:n,context:i,pipeline:r}=t,s=t.getBindings(),a=this.get(i),o=this.get(r).pipeline,l=a.currentSets,u=a.currentPass,h=t.getDrawParameters();if(null===h)return;l.pipeline!==o&&(u.setPipeline(o),l.pipeline=o);const c=l.bindingGroups;for(let t=0,e=s.length;t<e;t++){const e=s[t],n=this.get(e);c[e.index]!==e.id&&(u.setBindGroup(e.index,n.group),c[e.index]=e.id)}const A=t.getIndex(),d=null!==A;if(!0===d&&l.index!==A){const t=this.get(A).buffer,e=A.array instanceof Uint16Array?AF:dF;u.setIndexBuffer(t,e),l.index=A}const p=t.getVertexBuffers();for(let t=0,e=p.length;t<e;t++){const e=p[t];if(l.attributes[t]!==e){const n=this.get(e).buffer;u.setVertexBuffer(t,n),l.attributes[t]=e}}if(void 0!==a.occlusionQuerySet){const t=a.lastOcclusionObject;t!==n&&(null!==t&&!0===t.occlusionTest&&(u.endOcclusionQuery(),a.occlusionQueryIndex++),!0===n.occlusionTest&&(u.beginOcclusionQuery(a.occlusionQueryIndex),a.occlusionQueryObjects[a.occlusionQueryIndex]=n),a.lastOcclusionObject=n)}if(!0===n.isBatchedMesh){const t=n._multiDrawStarts,e=n._multiDrawCounts,i=n._multiDrawCount,r=n._multiDrawInstances,s=d?A.array.BYTES_PER_ELEMENT:1;for(let n=0;n<i;n++){const i=r?r[n]:1,a=i>1?0:n;u.drawIndexed(e[n],i,t[n]/s,0,a)}}else if(!0===d){const{vertexCount:t,instanceCount:i,firstVertex:r}=h;u.drawIndexed(t,i,r,0,0),e.update(n,t,i)}else{const{vertexCount:t,instanceCount:i,firstVertex:r}=h;u.draw(t,i,r,0),e.update(n,t,i)}}needsRenderUpdate(t){const e=this.get(t),{object:n,material:i}=t,r=this.utils,s=r.getSampleCountRenderContext(t.context),a=r.getCurrentColorSpace(t.context),o=r.getCurrentColorFormat(t.context),l=r.getCurrentDepthStencilFormat(t.context),u=r.getPrimitiveTopology(n,i);let h=!1;return e.material===i&&e.materialVersion===i.version&&e.transparent===i.transparent&&e.blending===i.blending&&e.premultipliedAlpha===i.premultipliedAlpha&&e.blendSrc===i.blendSrc&&e.blendDst===i.blendDst&&e.blendEquation===i.blendEquation&&e.blendSrcAlpha===i.blendSrcAlpha&&e.blendDstAlpha===i.blendDstAlpha&&e.blendEquationAlpha===i.blendEquationAlpha&&e.colorWrite===i.colorWrite&&e.depthWrite===i.depthWrite&&e.depthTest===i.depthTest&&e.depthFunc===i.depthFunc&&e.stencilWrite===i.stencilWrite&&e.stencilFunc===i.stencilFunc&&e.stencilFail===i.stencilFail&&e.stencilZFail===i.stencilZFail&&e.stencilZPass===i.stencilZPass&&e.stencilFuncMask===i.stencilFuncMask&&e.stencilWriteMask===i.stencilWriteMask&&e.side===i.side&&e.alphaToCoverage===i.alphaToCoverage&&e.sampleCount===s&&e.colorSpace===a&&e.colorFormat===o&&e.depthStencilFormat===l&&e.primitiveTopology===u&&e.clippingContextCacheKey===t.clippingContext.cacheKey||(e.material=i,e.materialVersion=i.version,e.transparent=i.transparent,e.blending=i.blending,e.premultipliedAlpha=i.premultipliedAlpha,e.blendSrc=i.blendSrc,e.blendDst=i.blendDst,e.blendEquation=i.blendEquation,e.blendSrcAlpha=i.blendSrcAlpha,e.blendDstAlpha=i.blendDstAlpha,e.blendEquationAlpha=i.blendEquationAlpha,e.colorWrite=i.colorWrite,e.depthWrite=i.depthWrite,e.depthTest=i.depthTest,e.depthFunc=i.depthFunc,e.stencilWrite=i.stencilWrite,e.stencilFunc=i.stencilFunc,e.stencilFail=i.stencilFail,e.stencilZFail=i.stencilZFail,e.stencilZPass=i.stencilZPass,e.stencilFuncMask=i.stencilFuncMask,e.stencilWriteMask=i.stencilWriteMask,e.side=i.side,e.alphaToCoverage=i.alphaToCoverage,e.sampleCount=s,e.colorSpace=a,e.colorFormat=o,e.depthStencilFormat=l,e.primitiveTopology=u,e.clippingContextCacheKey=t.clippingContext.cacheKey,h=!0),h}getRenderCacheKey(t){const{object:e,material:n}=t,i=this.utils,r=t.context;return[n.transparent,n.blending,n.premultipliedAlpha,n.blendSrc,n.blendDst,n.blendEquation,n.blendSrcAlpha,n.blendDstAlpha,n.blendEquationAlpha,n.colorWrite,n.depthWrite,n.depthTest,n.depthFunc,n.stencilWrite,n.stencilFunc,n.stencilFail,n.stencilZFail,n.stencilZPass,n.stencilFuncMask,n.stencilWriteMask,n.side,i.getSampleCountRenderContext(r),i.getCurrentColorSpace(r),i.getCurrentColorFormat(r),i.getCurrentDepthStencilFormat(r),i.getPrimitiveTopology(e,n),t.clippingContext.cacheKey].join()}createSampler(t){this.textureUtils.createSampler(t)}destroySampler(t){this.textureUtils.destroySampler(t)}createDefaultTexture(t){this.textureUtils.createDefaultTexture(t)}createTexture(t,e){this.textureUtils.createTexture(t,e)}updateTexture(t,e){this.textureUtils.updateTexture(t,e)}generateMipmaps(t){this.textureUtils.generateMipmaps(t)}destroyTexture(t){this.textureUtils.destroyTexture(t)}copyTextureToBuffer(t,e,n,i,r,s){return this.textureUtils.copyTextureToBuffer(t,e,n,i,r,s)}initTimestampQuery(t,e){if(!this.trackTimestamp)return;const n=this.get(t);if(!n.timeStampQuerySet){const t=this.device.createQuerySet({type:"timestamp",count:2}),i={querySet:t,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1};Object.assign(e,{timestampWrites:i}),n.timeStampQuerySet=t}}prepareTimestampBuffer(t,e){if(!this.trackTimestamp)return;const n=this.get(t),i=2*BigInt64Array.BYTES_PER_ELEMENT;void 0===n.currentTimestampQueryBuffers&&(n.currentTimestampQueryBuffers={resolveBuffer:this.device.createBuffer({label:"timestamp resolve buffer",size:i,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),resultBuffer:this.device.createBuffer({label:"timestamp result buffer",size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),isMappingPending:!1});const{resolveBuffer:r,resultBuffer:s,isMappingPending:a}=n.currentTimestampQueryBuffers;!0!==a&&(e.resolveQuerySet(n.timeStampQuerySet,0,2,r,0),e.copyBufferToBuffer(r,0,s,0,i))}async resolveTimestampAsync(t,e="render"){if(!this.trackTimestamp)return;const n=this.get(t);if(void 0===n.currentTimestampQueryBuffers)return;const{resultBuffer:i,isMappingPending:r}=n.currentTimestampQueryBuffers;!0!==r&&(n.currentTimestampQueryBuffers.isMappingPending=!0,i.mapAsync(GPUMapMode.READ).then((()=>{const t=new BigUint64Array(i.getMappedRange()),r=Number(t[1]-t[0])/1e6;this.renderer.info.updateTimestamp(e,r),i.unmap(),n.currentTimestampQueryBuffers.isMappingPending=!1})))}createNodeBuilder(t,e){return new Zq(t,e)}createProgram(t){this.get(t).module={module:this.device.createShaderModule({code:t.code,label:t.stage}),entryPoint:"main"}}destroyProgram(t){this.delete(t)}createRenderPipeline(t,e){this.pipelineUtils.createRenderPipeline(t,e)}createComputePipeline(t,e){this.pipelineUtils.createComputePipeline(t,e)}beginBundle(t){const e=this.get(t);e._currentPass=e.currentPass,e._currentSets=e.currentSets,e.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},e.currentPass=this.pipelineUtils.createBundleEncoder(t)}finishBundle(t,e){const n=this.get(t),i=n.currentPass.finish();this.get(e).bundleGPU=i,n.currentSets=n._currentSets,n.currentPass=n._currentPass}addBundle(t,e){this.get(t).renderBundles.push(this.get(e).bundleGPU)}createBindings(t){this.bindingUtils.createBindings(t)}updateBindings(t){this.bindingUtils.createBindings(t)}updateBinding(t){this.bindingUtils.updateBinding(t)}createIndexAttribute(t){this.attributeUtils.createAttribute(t,GPUBufferUsage.INDEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createAttribute(t){this.attributeUtils.createAttribute(t,GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createStorageAttribute(t){this.attributeUtils.createAttribute(t,GPUBufferUsage.STORAGE|GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}updateAttribute(t){this.attributeUtils.updateAttribute(t)}destroyAttribute(t){this.attributeUtils.destroyAttribute(t)}updateSize(){this.colorBuffer=this.textureUtils.getColorBuffer(),this.defaultRenderPassdescriptor=null}getMaxAnisotropy(){return 16}hasFeature(t){return this.device.features.has(t)}copyTextureToTexture(t,e,n=null,i=null,r=0){let s=0,a=0,o=0,l=0,u=0,h=0,c=t.image.width,A=t.image.height;null!==n&&(l=n.x,u=n.y,h=n.z||0,c=n.width,A=n.height),null!==i&&(s=i.x,a=i.y,o=i.z||0);const d=this.device.createCommandEncoder({label:"copyTextureToTexture_"+t.id+"_"+e.id}),p=this.get(t).texture,f=this.get(e).texture;d.copyTextureToTexture({texture:p,mipLevel:r,origin:{x:l,y:u,z:h}},{texture:f,mipLevel:r,origin:{x:s,y:a,z:o}},[c,A,1]),this.device.queue.submit([d.finish()])}copyFramebufferToTexture(t,e,n){const i=this.get(e),{encoder:r,descriptor:s}=i;let a=null;a=e.renderTarget?t.isDepthTexture?this.get(e.depthTexture).texture:this.get(e.textures[0]).texture:t.isDepthTexture?this.textureUtils.getDepthBuffer(e.depth,e.stencil):this.context.getCurrentTexture();const o=this.get(t).texture;if(a.format===o.format){i.currentPass.end(),r.copyTextureToTexture({texture:a,origin:{x:n.x,y:n.y,z:0}},{texture:o},[n.z,n.w]),t.generateMipmaps&&this.textureUtils.generateMipmaps(t);for(let t=0;t<s.colorAttachments.length;t++)s.colorAttachments[t].loadOp=aF;e.depth&&(s.depthStencilAttachment.depthLoadOp=aF),e.stencil&&(s.depthStencilAttachment.stencilLoadOp=aF),i.currentPass=r.beginRenderPass(s),i.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null}}else console.error("WebGPUBackend: copyFramebufferToTexture: Source and destination formats do not match.",a.format,o.format)}}class aG extends yT{constructor(t,e,n,i,r,s){super(t,e,n,i,r,s),this.iesMap=null}copy(t,e){return super.copy(t,e),this.iesMap=t.iesMap,this}}class oG extends Lz{constructor(){super(),this.addMaterial(ML,sT),this.addMaterial(HB,iT),this.addMaterial(WB,rT),this.addMaterial($B,aT),this.addMaterial(fL,WM),this.addMaterial(bL,lT),this.addMaterial(eL,oT),this.addMaterial(tU,uT),this.addMaterial(ZI,Zw),this.addMaterial(JI,hT),this.addMaterial(nU,Kw),this.addMaterial(aU,qw),this.addMaterial(uU,nT),this.addLight(Kk,ST),this.addLight(Jk,TT),this.addLight(iz,CT),this.addLight(rz,yT),this.addLight(az,ET),this.addLight(oz,AT),this.addLight(lz,NT),this.addLight(sz,aG),this.addToneMapping(zk,1),this.addToneMapping(qk,2),this.addToneMapping(Gk,3),this.addToneMapping(Hk,4),this.addToneMapping(Yk,6),this.addToneMapping(Qk,7),this.addColorSpace(kk,DN(vb,yb)),this.addColorSpace(Fk,DN(yb,vb))}}class lG extends qz{constructor(t={}){let e;t.forceWebGL?e=Eq:(e=sG,t.getFallback=()=>(console.warn("THREE.WebGPURenderer: WebGPU is not available, running under WebGL2 backend."),new Eq(t)));super(new e(t),t),this.nodes.library=new oG,this.isWebGPURenderer=!0}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:rx}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=rx);const uG={type:"change"},hG={type:"start"},cG={type:"end"},AG=1e-6,dG=-1,pG=0,fG=1,mG=2,gG=3,yG=4,vG=new Ee,_G=new Ee,xG=new en,bG=new en,SG=new en,MG=new tn,wG=new en,TG=new en,EG=new en,CG=new en;class RG extends ru{constructor(t,e=null){super(t,e),this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:a.ROTATE,MIDDLE:a.DOLLY,RIGHT:a.PAN},this.state=dG,this.keyState=dG,this.target=new en,this._lastPosition=new en,this._lastZoom=1,this._touchZoomDistanceStart=0,this._touchZoomDistanceEnd=0,this._lastAngle=0,this._eye=new en,this._movePrev=new Ee,this._moveCurr=new Ee,this._lastAxis=new en,this._zoomStart=new Ee,this._zoomEnd=new Ee,this._panStart=new Ee,this._panEnd=new Ee,this._pointers=[],this._pointerPositions={},this._onPointerMove=PG.bind(this),this._onPointerDown=NG.bind(this),this._onPointerUp=DG.bind(this),this._onPointerCancel=IG.bind(this),this._onContextMenu=zG.bind(this),this._onMouseWheel=kG.bind(this),this._onKeyDown=BG.bind(this),this._onKeyUp=LG.bind(this),this._onTouchStart=qG.bind(this),this._onTouchMove=GG.bind(this),this._onTouchEnd=VG.bind(this),this._onMouseDown=UG.bind(this),this._onMouseMove=OG.bind(this),this._onMouseUp=FG.bind(this),this._target0=this.target.clone(),this._position0=this.object.position.clone(),this._up0=this.object.up.clone(),this._zoom0=this.object.zoom,null!==e&&(this.connect(),this.handleResize()),this.update()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}handleResize(){const t=this.domElement.getBoundingClientRect(),e=this.domElement.ownerDocument.documentElement;this.screen.left=t.left+window.pageXOffset-e.clientLeft,this.screen.top=t.top+window.pageYOffset-e.clientTop,this.screen.width=t.width,this.screen.height=t.height}update(){this._eye.subVectors(this.object.position,this.target),this.noRotate||this._rotateCamera(),this.noZoom||this._zoomCamera(),this.noPan||this._panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this._checkDistances(),this.object.lookAt(this.target),this._lastPosition.distanceToSquared(this.object.position)>AG&&(this.dispatchEvent(uG),this._lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this._lastPosition.distanceToSquared(this.object.position)>AG||this._lastZoom!==this.object.zoom)&&(this.dispatchEvent(uG),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type.")}reset(){this.state=dG,this.keyState=dG,this.target.copy(this._target0),this.object.position.copy(this._position0),this.object.up.copy(this._up0),this.object.zoom=this._zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(uG),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom}_panCamera(){if(_G.copy(this._panEnd).sub(this._panStart),_G.lengthSq()){if(this.object.isOrthographicCamera){const t=(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,e=(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientWidth;_G.x*=t,_G.y*=e}_G.multiplyScalar(this._eye.length()*this.panSpeed),bG.copy(this._eye).cross(this.object.up).setLength(_G.x),bG.add(xG.copy(this.object.up).setLength(_G.y)),this.object.position.add(bG),this.target.add(bG),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(_G.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}_rotateCamera(){CG.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0);let t=CG.length();t?(this._eye.copy(this.object.position).sub(this.target),wG.copy(this._eye).normalize(),TG.copy(this.object.up).normalize(),EG.crossVectors(TG,wG).normalize(),TG.setLength(this._moveCurr.y-this._movePrev.y),EG.setLength(this._moveCurr.x-this._movePrev.x),CG.copy(TG.add(EG)),SG.crossVectors(CG,this._eye).normalize(),t*=this.rotateSpeed,MG.setFromAxisAngle(SG,t),this._eye.applyQuaternion(MG),this.object.up.applyQuaternion(MG),this._lastAxis.copy(SG),this._lastAngle=t):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),MG.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(MG),this.object.up.applyQuaternion(MG)),this._movePrev.copy(this._moveCurr)}_zoomCamera(){let t;this.state===yG?(t=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(t):this.object.isOrthographicCamera?(this.object.zoom=Te.clamp(this.object.zoom/t,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,1!==t&&t>0&&(this.object.isPerspectiveCamera?this._eye.multiplyScalar(t):this.object.isOrthographicCamera?(this.object.zoom=Te.clamp(this.object.zoom/t,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)}_getMouseOnScreen(t,e){return vG.set((t-this.screen.left)/this.screen.width,(e-this.screen.top)/this.screen.height),vG}_getMouseOnCircle(t,e){return vG.set((t-.5*this.screen.width-this.screen.left)/(.5*this.screen.width),(this.screen.height+2*(this.screen.top-e))/this.screen.width),vG}_addPointer(t){this._pointers.push(t)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e].pointerId==t.pointerId)return void this._pointers.splice(e,1)}_trackPointer(t){let e=this._pointerPositions[t.pointerId];void 0===e&&(e=new Ee,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0].pointerId?this._pointers[1]:this._pointers[0];return this._pointerPositions[e.pointerId]}_checkDistances(){this.noZoom&&this.noPan||(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))}}function NG(t){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._addPointer(t),"touch"===t.pointerType?this._onTouchStart(t):this._onMouseDown(t))}function PG(t){!1!==this.enabled&&("touch"===t.pointerType?this._onTouchMove(t):this._onMouseMove(t))}function DG(t){!1!==this.enabled&&("touch"===t.pointerType?this._onTouchEnd(t):this._onMouseUp(),this._removePointer(t),0===this._pointers.length&&(this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp)))}function IG(t){this._removePointer(t)}function LG(){!1!==this.enabled&&(this.keyState=dG,window.addEventListener("keydown",this._onKeyDown))}function BG(t){!1!==this.enabled&&(window.removeEventListener("keydown",this._onKeyDown),this.keyState===dG&&(t.code!==this.keys[pG]||this.noRotate?t.code!==this.keys[fG]||this.noZoom?t.code!==this.keys[mG]||this.noPan||(this.keyState=mG):this.keyState=fG:this.keyState=pG))}function UG(t){let e;switch(t.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case a.DOLLY:this.state=fG;break;case a.ROTATE:this.state=pG;break;case a.PAN:this.state=mG;break;default:this.state=dG}const n=this.keyState!==dG?this.keyState:this.state;n!==pG||this.noRotate?n!==fG||this.noZoom?n!==mG||this.noPan||(this._panStart.copy(this._getMouseOnScreen(t.pageX,t.pageY)),this._panEnd.copy(this._panStart)):(this._zoomStart.copy(this._getMouseOnScreen(t.pageX,t.pageY)),this._zoomEnd.copy(this._zoomStart)):(this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)),this._movePrev.copy(this._moveCurr)),this.dispatchEvent(hG)}function OG(t){const e=this.keyState!==dG?this.keyState:this.state;e!==pG||this.noRotate?e!==fG||this.noZoom?e!==mG||this.noPan||this._panEnd.copy(this._getMouseOnScreen(t.pageX,t.pageY)):this._zoomEnd.copy(this._getMouseOnScreen(t.pageX,t.pageY)):(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)))}function FG(){this.state=dG,this.dispatchEvent(cG)}function kG(t){if(!1!==this.enabled&&!0!==this.noZoom){switch(t.preventDefault(),t.deltaMode){case 2:this._zoomStart.y-=.025*t.deltaY;break;case 1:this._zoomStart.y-=.01*t.deltaY;break;default:this._zoomStart.y-=25e-5*t.deltaY}this.dispatchEvent(hG),this.dispatchEvent(cG)}}function zG(t){!1!==this.enabled&&t.preventDefault()}function qG(t){if(this._trackPointer(t),1===this._pointers.length)this.state=gG,this._moveCurr.copy(this._getMouseOnCircle(this._pointers[0].pageX,this._pointers[0].pageY)),this._movePrev.copy(this._moveCurr);else{this.state=yG;const t=this._pointers[0].pageX-this._pointers[1].pageX,e=this._pointers[0].pageY-this._pointers[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(t*t+e*e);const n=(this._pointers[0].pageX+this._pointers[1].pageX)/2,i=(this._pointers[0].pageY+this._pointers[1].pageY)/2;this._panStart.copy(this._getMouseOnScreen(n,i)),this._panEnd.copy(this._panStart)}this.dispatchEvent(hG)}function GG(t){if(this._trackPointer(t),1===this._pointers.length)this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY));else{const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,i=t.pageY-e.y;this._touchZoomDistanceEnd=Math.sqrt(n*n+i*i);const r=(t.pageX+e.x)/2,s=(t.pageY+e.y)/2;this._panEnd.copy(this._getMouseOnScreen(r,s))}}function VG(t){switch(this._pointers.length){case 0:this.state=dG;break;case 1:this.state=gG,this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)),this._movePrev.copy(this._moveCurr);break;case 2:this.state=yG;for(let e=0;e<this._pointers.length;e++)if(this._pointers[e].pointerId!==t.pointerId){const t=this._pointerPositions[this._pointers[e].pointerId];this._moveCurr.copy(this._getMouseOnCircle(t.x,t.y)),this._movePrev.copy(this._moveCurr);break}}this.dispatchEvent(cG)}const HG={type:"change"},jG={type:"start"},WG={type:"end"},XG=new Pn,YG=new _r,QG=Math.cos(70*Te.DEG2RAD),$G=new en,ZG=2*Math.PI,KG=-1,JG=0,tV=1,eV=2,nV=3,iV=4,rV=5,sV=6,aV=1e-6;class oV extends ru{constructor(t,e=null){super(t,e),this.state=KG,this.enabled=!0,this.target=new en,this.cursor=new en,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:a.ROTATE,MIDDLE:a.DOLLY,RIGHT:a.PAN},this.touches={ONE:o,TWO:u},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new en,this._lastQuaternion=new tn,this._lastTargetPosition=new en,this._quat=(new tn).setFromUnitVectors(t.up,new en(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new tu,this._sphericalDelta=new tu,this._scale=1,this._panOffset=new en,this._rotateStart=new Ee,this._rotateEnd=new Ee,this._rotateDelta=new Ee,this._panStart=new Ee,this._panEnd=new Ee,this._panDelta=new Ee,this._dollyStart=new Ee,this._dollyEnd=new Ee,this._dollyDelta=new Ee,this._dollyDirection=new en,this._mouse=new Ee,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=uV.bind(this),this._onPointerDown=lV.bind(this),this._onPointerUp=hV.bind(this),this._onContextMenu=gV.bind(this),this._onMouseWheel=dV.bind(this),this._onKeyDown=pV.bind(this),this._onTouchStart=fV.bind(this),this._onTouchMove=mV.bind(this),this._onMouseDown=cV.bind(this),this._onMouseMove=AV.bind(this),this._interceptControlDown=yV.bind(this),this._interceptControlUp=vV.bind(this),null!==this.domElement&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1});this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents();this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){null!==this._domElementKeyEvents&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(HG),this.update(),this.state=KG}update(t=null){const e=this.object.position;$G.copy(e).sub(this.target),$G.applyQuaternion(this._quat),this._spherical.setFromVector3($G),this.autoRotate&&this.state===KG&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,i=this.maxAzimuthAngle;isFinite(n)&&isFinite(i)&&(n<-Math.PI?n+=ZG:n>Math.PI&&(n-=ZG),i<-Math.PI?i+=ZG:i>Math.PI&&(i-=ZG),this._spherical.theta=n<=i?Math.max(n,Math.min(i,this._spherical.theta)):this._spherical.theta>(n+i)/2?Math.max(n,this._spherical.theta):Math.min(i,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),!0===this.enableDamping?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let r=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const t=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),r=t!=this._spherical.radius}if($G.setFromSpherical(this._spherical),$G.applyQuaternion(this._quatInverse),e.copy(this.target).add($G),this.object.lookAt(this.target),!0===this.enableDamping?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let t=null;if(this.object.isPerspectiveCamera){const e=$G.length();t=this._clampDistance(e*this._scale);const n=e-t;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),r=!!n}else if(this.object.isOrthographicCamera){const e=new en(this._mouse.x,this._mouse.y,0);e.unproject(this.object);const n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),r=n!==this.object.zoom;const i=new en(this._mouse.x,this._mouse.y,0);i.unproject(this.object),this.object.position.sub(i).add(e),this.object.updateMatrixWorld(),t=$G.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;null!==t&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(t).add(this.object.position):(XG.origin.copy(this.object.position),XG.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(XG.direction))<QG?this.object.lookAt(this.target):(YG.setFromNormalAndCoplanarPoint(this.object.up,this.target),XG.intersectPlane(YG,this.target))))}else if(this.object.isOrthographicCamera){const t=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),t!==this.object.zoom&&(this.object.updateProjectionMatrix(),r=!0)}return this._scale=1,this._performCursorZoom=!1,!!(r||this._lastPosition.distanceToSquared(this.object.position)>aV||8*(1-this._lastQuaternion.dot(this.object.quaternion))>aV||this._lastTargetPosition.distanceToSquared(this.target)>aV)&&(this.dispatchEvent(HG),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0)}_getAutoRotationAngle(t){return null!==t?ZG/60*this.autoRotateSpeed*t:ZG/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(.01*t);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){$G.setFromMatrixColumn(e,0),$G.multiplyScalar(-t),this._panOffset.add($G)}_panUp(t,e){!0===this.screenSpacePanning?$G.setFromMatrixColumn(e,1):($G.setFromMatrixColumn(e,0),$G.crossVectors(this.object.up,$G)),$G.multiplyScalar(t),this._panOffset.add($G)}_pan(t,e){const n=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;$G.copy(i).sub(this.target);let r=$G.length();r*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*r/n.clientHeight,this.object.matrix),this._panUp(2*e*r/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),i=t-n.left,r=e-n.top,s=n.width,a=n.height;this._mouse.x=i/s*2-1,this._mouse.y=-r/a*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(ZG*this._rotateDelta.x/e.clientHeight),this._rotateUp(ZG*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(ZG*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(-ZG*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(ZG*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(-ZG*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(1===this._pointers.length)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._rotateStart.set(n,i)}}_handleTouchStartPan(t){if(1===this._pointers.length)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._panStart.set(n,i)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,i=t.pageY-e.y,r=Math.sqrt(n*n+i*i);this._dollyStart.set(0,r)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(1==this._pointers.length)this._rotateEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._rotateEnd.set(n,i)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(ZG*this._rotateDelta.x/e.clientHeight),this._rotateUp(ZG*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(1===this._pointers.length)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._panEnd.set(n,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,i=t.pageY-e.y,r=Math.sqrt(n*n+i*i);this._dollyEnd.set(0,r),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const s=.5*(t.pageX+e.x),a=.5*(t.pageY+e.y);this._updateZoomParameters(s,a)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return void this._pointers.splice(e,1)}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(t){let e=this._pointerPositions[t.pointerId];void 0===e&&(e=new Ee,this._pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,n={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}return t.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function lV(t){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._isTrackingPointer(t)||(this._addPointer(t),"touch"===t.pointerType?this._onTouchStart(t):this._onMouseDown(t)))}function uV(t){!1!==this.enabled&&("touch"===t.pointerType?this._onTouchMove(t):this._onMouseMove(t))}function hV(t){switch(this._removePointer(t),this._pointers.length){case 0:this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(WG),this.state=KG;break;case 1:const e=this._pointers[0],n=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:n.x,pageY:n.y})}}function cV(t){let e;switch(t.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case a.DOLLY:if(!1===this.enableZoom)return;this._handleMouseDownDolly(t),this.state=tV;break;case a.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===this.enablePan)return;this._handleMouseDownPan(t),this.state=eV}else{if(!1===this.enableRotate)return;this._handleMouseDownRotate(t),this.state=JG}break;case a.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===this.enableRotate)return;this._handleMouseDownRotate(t),this.state=JG}else{if(!1===this.enablePan)return;this._handleMouseDownPan(t),this.state=eV}break;default:this.state=KG}this.state!==KG&&this.dispatchEvent(jG)}function AV(t){switch(this.state){case JG:if(!1===this.enableRotate)return;this._handleMouseMoveRotate(t);break;case tV:if(!1===this.enableZoom)return;this._handleMouseMoveDolly(t);break;case eV:if(!1===this.enablePan)return;this._handleMouseMovePan(t)}}function dV(t){!1!==this.enabled&&!1!==this.enableZoom&&this.state===KG&&(t.preventDefault(),this.dispatchEvent(jG),this._handleMouseWheel(this._customWheelEvent(t)),this.dispatchEvent(WG))}function pV(t){!1!==this.enabled&&!1!==this.enablePan&&this._handleKeyDown(t)}function fV(t){switch(this._trackPointer(t),this._pointers.length){case 1:switch(this.touches.ONE){case o:if(!1===this.enableRotate)return;this._handleTouchStartRotate(t),this.state=nV;break;case l:if(!1===this.enablePan)return;this._handleTouchStartPan(t),this.state=iV;break;default:this.state=KG}break;case 2:switch(this.touches.TWO){case u:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchStartDollyPan(t),this.state=rV;break;case h:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchStartDollyRotate(t),this.state=sV;break;default:this.state=KG}break;default:this.state=KG}this.state!==KG&&this.dispatchEvent(jG)}function mV(t){switch(this._trackPointer(t),this.state){case nV:if(!1===this.enableRotate)return;this._handleTouchMoveRotate(t),this.update();break;case iV:if(!1===this.enablePan)return;this._handleTouchMovePan(t),this.update();break;case rV:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchMoveDollyPan(t),this.update();break;case sV:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchMoveDollyRotate(t),this.update();break;default:this.state=KG}}function gV(t){!1!==this.enabled&&t.preventDefault()}function yV(t){if("Control"===t.key){this._controlActive=!0;this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0})}}function vV(t){if("Control"===t.key){this._controlActive=!1;this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0})}}const _V={type:"change"},xV=1e-6,bV=new tn;class SV extends ru{constructor(t,e=null){super(t,e),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this._moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this._moveVector=new en(0,0,0),this._rotationVector=new en(0,0,0),this._lastQuaternion=new tn,this._lastPosition=new en,this._status=0,this._onKeyDown=MV.bind(this),this._onKeyUp=wV.bind(this),this._onPointerMove=EV.bind(this),this._onPointerDown=TV.bind(this),this._onPointerUp=CV.bind(this),this._onPointerCancel=RV.bind(this),this._onContextMenu=NV.bind(this),null!==e&&this.connect()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu)}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu)}dispose(){this.disconnect()}update(t){if(!1===this.enabled)return;const e=this.object,n=t*this.movementSpeed,i=t*this.rollSpeed;e.translateX(this._moveVector.x*n),e.translateY(this._moveVector.y*n),e.translateZ(this._moveVector.z*n),bV.set(this._rotationVector.x*i,this._rotationVector.y*i,this._rotationVector.z*i,1).normalize(),e.quaternion.multiply(bV),(this._lastPosition.distanceToSquared(e.position)>xV||8*(1-this._lastQuaternion.dot(e.quaternion))>xV)&&(this.dispatchEvent(_V),this._lastQuaternion.copy(e.quaternion),this._lastPosition.copy(e.position))}_updateMovementVector(){const t=this._moveState.forward||this.autoForward&&!this._moveState.back?1:0;this._moveVector.x=-this._moveState.left+this._moveState.right,this._moveVector.y=-this._moveState.down+this._moveState.up,this._moveVector.z=-t+this._moveState.back}_updateRotationVector(){this._rotationVector.x=-this._moveState.pitchDown+this._moveState.pitchUp,this._rotationVector.y=-this._moveState.yawRight+this._moveState.yawLeft,this._rotationVector.z=-this._moveState.rollRight+this._moveState.rollLeft}_getContainerDimensions(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}}}function MV(t){if(!t.altKey&&!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this._moveState.forward=1;break;case"KeyS":this._moveState.back=1;break;case"KeyA":this._moveState.left=1;break;case"KeyD":this._moveState.right=1;break;case"KeyR":this._moveState.up=1;break;case"KeyF":this._moveState.down=1;break;case"ArrowUp":this._moveState.pitchUp=1;break;case"ArrowDown":this._moveState.pitchDown=1;break;case"ArrowLeft":this._moveState.yawLeft=1;break;case"ArrowRight":this._moveState.yawRight=1;break;case"KeyQ":this._moveState.rollLeft=1;break;case"KeyE":this._moveState.rollRight=1}this._updateMovementVector(),this._updateRotationVector()}}function wV(t){if(!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this._moveState.forward=0;break;case"KeyS":this._moveState.back=0;break;case"KeyA":this._moveState.left=0;break;case"KeyD":this._moveState.right=0;break;case"KeyR":this._moveState.up=0;break;case"KeyF":this._moveState.down=0;break;case"ArrowUp":this._moveState.pitchUp=0;break;case"ArrowDown":this._moveState.pitchDown=0;break;case"ArrowLeft":this._moveState.yawLeft=0;break;case"ArrowRight":this._moveState.yawRight=0;break;case"KeyQ":this._moveState.rollLeft=0;break;case"KeyE":this._moveState.rollRight=0}this._updateMovementVector(),this._updateRotationVector()}}function TV(t){if(!1!==this.enabled)if(this.dragToLook)this._status++;else{switch(t.button){case 0:this._moveState.forward=1;break;case 2:this._moveState.back=1}this._updateMovementVector()}}function EV(t){if(!1!==this.enabled&&(!this.dragToLook||this._status>0)){const e=this._getContainerDimensions(),n=e.size[0]/2,i=e.size[1]/2;this._moveState.yawLeft=-(t.pageX-e.offset[0]-n)/n,this._moveState.pitchDown=(t.pageY-e.offset[1]-i)/i,this._updateRotationVector()}}function CV(t){if(!1!==this.enabled){if(this.dragToLook)this._status--,this._moveState.yawLeft=this._moveState.pitchDown=0;else{switch(t.button){case 0:this._moveState.forward=0;break;case 2:this._moveState.back=0}this._updateMovementVector()}this._updateRotationVector()}}function RV(){!1!==this.enabled&&(this.dragToLook?(this._status=0,this._moveState.yawLeft=this._moveState.pitchDown=0):(this._moveState.forward=0,this._moveState.back=0,this._updateMovementVector()),this._updateRotationVector())}function NV(t){!1!==this.enabled&&t.preventDefault()}const PV={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class DV{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const IV=new kr(-1,1,1,-1,0,1);const LV=new class extends Gi{constructor(){super(),this.setAttribute("position",new Li([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Li([0,2,0,0,2,0],2))}};class BV{constructor(t){this._mesh=new tr(LV,t)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,IV)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}}class UV extends DV{constructor(t,e){super(),this.textureID=void 0!==e?e:"tDiffuse",t instanceof or?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=ar.clone(t.uniforms),this.material=new or({name:void 0!==t.name?t.name:"unspecified",defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new BV(this.material)}render(t,e,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class OV extends DV{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(t,e,n){const i=t.getContext(),r=t.state;let s,a;r.buffers.color.setMask(!1),r.buffers.depth.setMask(!1),r.buffers.color.setLocked(!0),r.buffers.depth.setLocked(!0),this.inverse?(s=0,a=1):(s=1,a=0),r.buffers.stencil.setTest(!0),r.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),r.buffers.stencil.setFunc(i.ALWAYS,s,4294967295),r.buffers.stencil.setClear(a),r.buffers.stencil.setLocked(!0),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),r.buffers.color.setLocked(!1),r.buffers.depth.setLocked(!1),r.buffers.color.setMask(!0),r.buffers.depth.setMask(!0),r.buffers.stencil.setLocked(!1),r.buffers.stencil.setFunc(i.EQUAL,1,4294967295),r.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),r.buffers.stencil.setLocked(!0)}}class FV extends DV{constructor(){super(),this.needsSwap=!1}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}}class kV{constructor(t,e){if(this.renderer=t,this._pixelRatio=t.getPixelRatio(),void 0===e){const n=t.getSize(new Ee);this._width=n.width,this._height=n.height,(e=new Ze(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:st})).texture.name="EffectComposer.rt1"}else this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new UV(PV),this.copyPass.material.blending=0,this.clock=new Yl}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();let n=!1;for(let e=0,i=this.passes.length;e<i;e++){const i=this.passes[e];if(!1!==i.enabled){if(i.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),i.render(this.renderer,this.writeBuffer,this.readBuffer,t,n),i.needsSwap){if(n){const e=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(e.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),n.setFunc(e.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==OV&&(i instanceof OV?n=!0:i instanceof FV&&(n=!1))}}this.renderer.setRenderTarget(e)}reset(t){if(void 0===t){const e=this.renderer.getSize(new Ee);this._pixelRatio=this.renderer.getPixelRatio(),this._width=e.width,this._height=e.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(n,i)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class zV extends DV{constructor(t,e,n=null,i=null,r=null){super(),this.scene=t,this.camera=e,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=r,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Mi}render(t,e,n){const i=t.autoClear;let r,s;t.autoClear=!1,null!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(t.getClearColor(this._oldClearColor),t.setClearColor(this.clearColor,t.getClearAlpha())),null!==this.clearAlpha&&(r=t.getClearAlpha(),t.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),null!==this.clearColor&&t.setClearColor(this._oldClearColor),null!==this.clearAlpha&&t.setClearAlpha(r),null!==this.overrideMaterial&&(this.scene.overrideMaterial=s),t.autoClear=i}}function qV(){return qV=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},qV.apply(null,arguments)}function GV(t,e){return GV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},GV(t,e)}function VV(t){return VV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},VV(t)}function HV(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(HV=function(){return!!t})()}function jV(t){var e="function"==typeof Map?new Map:void 0;return jV=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(HV())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var r=new(t.bind.apply(t,i));return n&&GV(r,n.prototype),r}(t,arguments,VV(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),GV(n,t)},jV(t)}var WV={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function XV(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i,r=e[0],s=[];for(i=1;i<e.length;i+=1)s.push(e[i]);return s.forEach((function(t){r=r.replace(/%[a-z]/,t)})),r}var YV=function(t){var e,n;function i(e){var n;if("production"===process.env.NODE_ENV)n=t.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+e+" for more information.")||this;else{for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];n=t.call(this,XV.apply(void 0,[WV[e]].concat(r)))||this}return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,GV(e,n),i}(jV(Error));function QV(t){return Math.round(255*t)}function $V(t,e,n){return QV(t)+","+QV(e)+","+QV(n)}function ZV(t,e,n,i){if(void 0===i&&(i=$V),0===e)return i(n,n,n);var r=(t%360+360)%360/60,s=(1-Math.abs(2*n-1))*e,a=s*(1-Math.abs(r%2-1)),o=0,l=0,u=0;r>=0&&r<1?(o=s,l=a):r>=1&&r<2?(o=a,l=s):r>=2&&r<3?(l=s,u=a):r>=3&&r<4?(l=a,u=s):r>=4&&r<5?(o=a,u=s):r>=5&&r<6&&(o=s,u=a);var h=n-s/2;return i(o+h,l+h,u+h)}var KV={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var JV=/^#[a-fA-F0-9]{6}$/,tH=/^#[a-fA-F0-9]{8}$/,eH=/^#[a-fA-F0-9]{3}$/,nH=/^#[a-fA-F0-9]{4}$/,iH=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,rH=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,sH=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,aH=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function oH(t){if("string"!=typeof t)throw new YV(3);var e=function(t){if("string"!=typeof t)return t;var e=t.toLowerCase();return KV[e]?"#"+KV[e]:t}(t);if(e.match(JV))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(tH)){var n=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:n}}if(e.match(eH))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(nH)){var i=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:i}}var r=iH.exec(e);if(r)return{red:parseInt(""+r[1],10),green:parseInt(""+r[2],10),blue:parseInt(""+r[3],10)};var s=rH.exec(e.substring(0,50));if(s)return{red:parseInt(""+s[1],10),green:parseInt(""+s[2],10),blue:parseInt(""+s[3],10),alpha:parseFloat(""+s[4])>1?parseFloat(""+s[4])/100:parseFloat(""+s[4])};var a=sH.exec(e);if(a){var o="rgb("+ZV(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",l=iH.exec(o);if(!l)throw new YV(4,e,o);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var u=aH.exec(e.substring(0,50));if(u){var h="rgb("+ZV(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",c=iH.exec(h);if(!c)throw new YV(4,e,h);return{red:parseInt(""+c[1],10),green:parseInt(""+c[2],10),blue:parseInt(""+c[3],10),alpha:parseFloat(""+u[4])>1?parseFloat(""+u[4])/100:parseFloat(""+u[4])}}throw new YV(5)}function lH(t){return function(t){var e,n=t.red/255,i=t.green/255,r=t.blue/255,s=Math.max(n,i,r),a=Math.min(n,i,r),o=(s+a)/2;if(s===a)return void 0!==t.alpha?{hue:0,saturation:0,lightness:o,alpha:t.alpha}:{hue:0,saturation:0,lightness:o};var l=s-a,u=o>.5?l/(2-s-a):l/(s+a);switch(s){case n:e=(i-r)/l+(i<r?6:0);break;case i:e=(r-n)/l+2;break;default:e=(n-i)/l+4}return e*=60,void 0!==t.alpha?{hue:e,saturation:u,lightness:o,alpha:t.alpha}:{hue:e,saturation:u,lightness:o}}(oH(t))}var uH=function(t){return 7===t.length&&t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?"#"+t[1]+t[3]+t[5]:t};function hH(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function cH(t){return hH(Math.round(255*t))}function AH(t,e,n){return uH("#"+cH(t)+cH(e)+cH(n))}function dH(t,e,n){return ZV(t,e,n,AH)}function pH(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return uH("#"+hH(t)+hH(e)+hH(n));if("object"==typeof t&&void 0===e&&void 0===n)return uH("#"+hH(t.red)+hH(t.green)+hH(t.blue));throw new YV(6)}function fH(t,e,n,i){if("string"==typeof t&&"number"==typeof e){var r=oH(t);return"rgba("+r.red+","+r.green+","+r.blue+","+e+")"}if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof i)return i>=1?pH(t,e,n):"rgba("+t+","+e+","+n+","+i+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===i)return t.alpha>=1?pH(t.red,t.green,t.blue):"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")";throw new YV(7)}function mH(t){if("object"!=typeof t)throw new YV(8);if(function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&"number"==typeof t.alpha}(t))return fH(t);if(function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&("number"!=typeof t.alpha||void 0===t.alpha)}(t))return pH(t);if(function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&"number"==typeof t.alpha}(t))return function(t,e,n,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof i)return i>=1?dH(t,e,n):"rgba("+ZV(t,e,n)+","+i+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===i)return t.alpha>=1?dH(t.hue,t.saturation,t.lightness):"rgba("+ZV(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new YV(2)}(t);if(function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&("number"!=typeof t.alpha||void 0===t.alpha)}(t))return function(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return dH(t,e,n);if("object"==typeof t&&void 0===e&&void 0===n)return dH(t.hue,t.saturation,t.lightness);throw new YV(1)}(t);throw new YV(8)}function gH(t,e,n){return function(){var i=n.concat(Array.prototype.slice.call(arguments));return i.length>=e?t.apply(this,i):gH(t,e,i)}}function yH(t){return gH(t,t.length,[])}function vH(t,e,n){return Math.max(t,Math.min(e,n))}yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{hue:n.hue+parseFloat(t)}))})),yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{lightness:vH(0,1,n.lightness-parseFloat(t))}))})),yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{saturation:vH(0,1,n.saturation-parseFloat(t))}))})),yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{lightness:vH(0,1,n.lightness+parseFloat(t))}))}));var _H=yH((function(t,e,n){if("transparent"===e)return n;if("transparent"===n)return e;if(0===t)return n;var i=oH(e),r=qV({},i,{alpha:"number"==typeof i.alpha?i.alpha:1}),s=oH(n),a=qV({},s,{alpha:"number"==typeof s.alpha?s.alpha:1}),o=r.alpha-a.alpha,l=2*parseFloat(t)-1,u=((l*o==-1?l:l+o)/(1+l*o)+1)/2,h=1-u;return fH({red:Math.floor(r.red*u+a.red*h),green:Math.floor(r.green*u+a.green*h),blue:Math.floor(r.blue*u+a.blue*h),alpha:r.alpha*parseFloat(t)+a.alpha*(1-parseFloat(t))})})),xH=_H;var bH=yH((function(t,e){if("transparent"===e)return e;var n=oH(e);return fH(qV({},n,{alpha:vH(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(t))/100)}))})),SH=bH;yH((function(t,e){if("transparent"===e)return e;var n=lH(e);return mH(qV({},n,{saturation:vH(0,1,n.saturation+parseFloat(t))}))})),yH((function(t,e){return"transparent"===e?e:mH(qV({},lH(e),{hue:parseFloat(t)}))})),yH((function(t,e){return"transparent"===e?e:mH(qV({},lH(e),{lightness:parseFloat(t)}))})),yH((function(t,e){return"transparent"===e?e:mH(qV({},lH(e),{saturation:parseFloat(t)}))})),yH((function(t,e){return"transparent"===e?e:xH(parseFloat(t),"rgb(0, 0, 0)",e)})),yH((function(t,e){return"transparent"===e?e:xH(parseFloat(t),"rgb(255, 255, 255)",e)})),yH((function(t,e){if("transparent"===e)return e;var n=oH(e);return fH(qV({},n,{alpha:vH(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(t)).toFixed(2)/100)}))}));function MH(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function wH(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TH(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(l=(i=s.call(n)).done)&&(o.push(i.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t,e)||CH(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EH(t){return function(t){if(Array.isArray(t))return MH(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||CH(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function CH(t,e){if(t){if("string"==typeof t)return MH(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?MH(t,e):void 0}}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}(".scene-nav-info {\n  bottom: 5px;\n  width: 100%;\n  text-align: center;\n  color: slategrey;\n  opacity: 0.7;\n  font-size: 10px;\n}\n\n.scene-tooltip {\n  top: 0;\n  color: lavender;\n  font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n  position: absolute;\n  font-family: sans-serif;\n  pointer-events: none;\n  user-select: none;\n}\n\n.scene-container canvas:focus {\n  outline: none;\n}");var RH=window.THREE?window.THREE:{WebGLRenderer:class{constructor(t={}){const{canvas:e=De(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:c=!1}=t;let A;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");A=n.getContextAttributes().alpha}else A=a;const d=new Uint32Array(4),p=new Int32Array(4);let f=null,m=null;const g=[],y=[];this.domElement=e,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=Yt,this.toneMapping=0,this.toneMappingExposure=1;const v=this;let _=!1,x=0,b=0,S=null,M=-1,w=null;const T=new Qe,E=new Qe;let C=null;const R=new Mi(0);let N=0,P=e.width,D=e.height,I=1,L=null,B=null;const U=new Qe(0,0,P,D),O=new Qe(0,0,P,D);let F=!1;const k=new Sr;let z=!1,q=!1;const G=new Dn,V=new Dn,H=new en,j=new Qe,W={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let X=!1;function Y(){return null===S?I:1}let Q,$,J,tt,nt,rt,ut,ht,ct,At,mt,gt,yt,vt,_t,xt,bt,St,Mt,wt,Tt,Et,Ct,Rt,Nt=n;function Pt(t,n){return e.getContext(t,n)}try{const t={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:h,failIfMajorPerformanceCaveat:c};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${s}`),e.addEventListener("webglcontextlost",Lt,!1),e.addEventListener("webglcontextrestored",Bt,!1),e.addEventListener("webglcontextcreationerror",Ut,!1),null===Nt){const e="webgl2";if(Nt=Pt(e,t),null===Nt)throw Pt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function Dt(){Q=new rs(Nt),Q.init(),Et=new io(Nt,Q),$=new Ur(Nt,Q,t,Et),J=new to(Nt),$.reverseDepthBuffer&&J.buffers.depth.setReversed(!0),tt=new os(Nt),nt=new ka,rt=new no(Nt,Q,J,nt,$,Et,tt),ut=new Fr(v),ht=new is(v),ct=new wr(Nt),Ct=new Lr(Nt,ct),At=new ss(Nt,ct,tt,Ct),mt=new us(Nt,At,ct,tt),Mt=new ls(Nt,$,rt),xt=new Or(nt),gt=new Fa(v,ut,ht,Q,$,Ct,xt),yt=new Ao(v,nt),vt=new Va,_t=new Qa(Q),St=new Ir(v,ut,ht,J,mt,A,l),bt=new Ka(v,mt,$),Rt=new po(Nt,tt,$,J),wt=new Br(Nt,Q,tt),Tt=new as(Nt,Q,tt),tt.programs=gt.programs,v.capabilities=$,v.extensions=Q,v.properties=nt,v.renderLists=vt,v.shadowMap=bt,v.state=J,v.info=tt}Dt();const It=new uo(v,Nt);function Lt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),_=!0}function Bt(){console.log("THREE.WebGLRenderer: Context Restored."),_=!1;const t=tt.autoReset,e=bt.enabled,n=bt.autoUpdate,i=bt.needsUpdate,r=bt.type;Dt(),tt.autoReset=t,bt.enabled=e,bt.autoUpdate=n,bt.needsUpdate=i,bt.type=r}function Ut(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function Ot(t){const e=t.target;e.removeEventListener("dispose",Ot),function(t){(function(t){const e=nt.get(t).programs;void 0!==e&&(e.forEach((function(t){gt.releaseProgram(t)})),t.isShaderMaterial&&gt.releaseShaderCache(t))})(t),nt.remove(t)}(e)}function Ft(t,e,n){!0===t.transparent&&2===t.side&&!1===t.forceSinglePass?(t.side=1,t.needsUpdate=!0,$t(t,e,n),t.side=0,t.needsUpdate=!0,$t(t,e,n),t.side=2):$t(t,e,n)}this.xr=It,this.getContext=function(){return Nt},this.getContextAttributes=function(){return Nt.getContextAttributes()},this.forceContextLoss=function(){const t=Q.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=Q.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return I},this.setPixelRatio=function(t){void 0!==t&&(I=t,this.setSize(P,D,!1))},this.getSize=function(t){return t.set(P,D)},this.setSize=function(t,n,i=!0){It.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(P=t,D=n,e.width=Math.floor(t*I),e.height=Math.floor(n*I),!0===i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(P*I,D*I).floor()},this.setDrawingBufferSize=function(t,n,i){P=t,D=n,I=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(T)},this.getViewport=function(t){return t.copy(U)},this.setViewport=function(t,e,n,i){t.isVector4?U.set(t.x,t.y,t.z,t.w):U.set(t,e,n,i),J.viewport(T.copy(U).multiplyScalar(I).round())},this.getScissor=function(t){return t.copy(O)},this.setScissor=function(t,e,n,i){t.isVector4?O.set(t.x,t.y,t.z,t.w):O.set(t,e,n,i),J.scissor(E.copy(O).multiplyScalar(I).round())},this.getScissorTest=function(){return F},this.setScissorTest=function(t){J.setScissorTest(F=t)},this.setOpaqueSort=function(t){L=t},this.setTransparentSort=function(t){B=t},this.getClearColor=function(t){return t.copy(St.getClearColor())},this.setClearColor=function(){St.setClearColor.apply(St,arguments)},this.getClearAlpha=function(){return St.getClearAlpha()},this.setClearAlpha=function(){St.setClearAlpha.apply(St,arguments)},this.clear=function(t=!0,e=!0,n=!0){let i=0;if(t){let t=!1;if(null!==S){const e=S.texture.format;t=e===ft||e===pt||e===dt}if(t){const t=S.texture.type,e=t===K||t===it||t===et||t===lt||t===at||t===ot,n=St.getClearColor(),i=St.getClearAlpha(),r=n.r,s=n.g,a=n.b;e?(d[0]=r,d[1]=s,d[2]=a,d[3]=i,Nt.clearBufferuiv(Nt.COLOR,0,d)):(p[0]=r,p[1]=s,p[2]=a,p[3]=i,Nt.clearBufferiv(Nt.COLOR,0,p))}else i|=Nt.COLOR_BUFFER_BIT}e&&(i|=Nt.DEPTH_BUFFER_BIT,Nt.clearDepth(this.capabilities.reverseDepthBuffer?0:1)),n&&(i|=Nt.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Nt.clear(i)},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(){e.removeEventListener("webglcontextlost",Lt,!1),e.removeEventListener("webglcontextrestored",Bt,!1),e.removeEventListener("webglcontextcreationerror",Ut,!1),vt.dispose(),_t.dispose(),nt.dispose(),ut.dispose(),ht.dispose(),mt.dispose(),Ct.dispose(),Rt.dispose(),gt.dispose(),It.dispose(),It.removeEventListener("sessionstart",zt),It.removeEventListener("sessionend",qt),Gt.stop()},this.renderBufferDirect=function(t,e,n,i,r,s){null===e&&(e=W);const a=r.isMesh&&r.matrixWorld.determinant()<0,o=function(t,e,n,i,r){!0!==e.isScene&&(e=W);rt.resetTextureUnits();const s=e.fog,a=i.isMeshStandardMaterial?e.environment:null,o=null===S?v.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:Qt,l=(i.isMeshStandardMaterial?ht:ut).get(i.envMap||a),u=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,h=!!n.attributes.tangent&&(!!i.normalMap||i.anisotropy>0),c=!!n.morphAttributes.position,A=!!n.morphAttributes.normal,d=!!n.morphAttributes.color;let p=0;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(p=v.toneMapping));const f=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=void 0!==f?f.length:0,y=nt.get(i),_=m.state.lights;if(!0===z&&(!0===q||t!==w)){const e=t===w&&i.id===M;xt.setState(i,t,e)}let x=!1;i.version===y.__version?y.needsLights&&y.lightsStateVersion!==_.state.version||y.outputColorSpace!==o||r.isBatchedMesh&&!1===y.batching?x=!0:r.isBatchedMesh||!0!==y.batching?r.isBatchedMesh&&!0===y.batchingColor&&null===r.colorTexture||r.isBatchedMesh&&!1===y.batchingColor&&null!==r.colorTexture||r.isInstancedMesh&&!1===y.instancing?x=!0:r.isInstancedMesh||!0!==y.instancing?r.isSkinnedMesh&&!1===y.skinning?x=!0:r.isSkinnedMesh||!0!==y.skinning?r.isInstancedMesh&&!0===y.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===y.instancingColor&&null!==r.instanceColor||r.isInstancedMesh&&!0===y.instancingMorph&&null===r.morphTexture||r.isInstancedMesh&&!1===y.instancingMorph&&null!==r.morphTexture||y.envMap!==l||!0===i.fog&&y.fog!==s?x=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===xt.numPlanes&&y.numIntersection===xt.numIntersection?(y.vertexAlphas!==u||y.vertexTangents!==h||y.morphTargets!==c||y.morphNormals!==A||y.morphColors!==d||y.toneMapping!==p||y.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,y.__version=i.version);let b=y.currentProgram;!0===x&&(b=$t(i,e,r));let T=!1,E=!1,C=!1;const R=b.getUniforms(),N=y.uniforms;J.useProgram(b.program)&&(T=!0,E=!0,C=!0);i.id!==M&&(M=i.id,E=!0);if(T||w!==t){$.reverseDepthBuffer?(G.copy(t.projectionMatrix),function(t){const e=t.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}(G),function(t){const e=t.elements;-1===e[11]?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=1-e[14])}(G),R.setValue(Nt,"projectionMatrix",G)):R.setValue(Nt,"projectionMatrix",t.projectionMatrix),R.setValue(Nt,"viewMatrix",t.matrixWorldInverse);const e=R.map.cameraPosition;void 0!==e&&e.setValue(Nt,H.setFromMatrixPosition(t.matrixWorld)),$.logarithmicDepthBuffer&&R.setValue(Nt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&R.setValue(Nt,"isOrthographic",!0===t.isOrthographicCamera),w!==t&&(w=t,E=!0,C=!0)}if(r.isSkinnedMesh){R.setOptional(Nt,r,"bindMatrix"),R.setOptional(Nt,r,"bindMatrixInverse");const t=r.skeleton;t&&(null===t.boneTexture&&t.computeBoneTexture(),R.setValue(Nt,"boneTexture",t.boneTexture,rt))}r.isBatchedMesh&&(R.setOptional(Nt,r,"batchingTexture"),R.setValue(Nt,"batchingTexture",r._matricesTexture,rt),R.setOptional(Nt,r,"batchingIdTexture"),R.setValue(Nt,"batchingIdTexture",r._indirectTexture,rt),R.setOptional(Nt,r,"batchingColorTexture"),null!==r._colorsTexture&&R.setValue(Nt,"batchingColorTexture",r._colorsTexture,rt));const P=n.morphAttributes;void 0===P.position&&void 0===P.normal&&void 0===P.color||Mt.update(r,n,b);(E||y.receiveShadow!==r.receiveShadow)&&(y.receiveShadow=r.receiveShadow,R.setValue(Nt,"receiveShadow",r.receiveShadow));i.isMeshGouraudMaterial&&null!==i.envMap&&(N.envMap.value=l,N.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1);i.isMeshStandardMaterial&&null===i.envMap&&null!==e.environment&&(N.envMapIntensity.value=e.environmentIntensity);E&&(R.setValue(Nt,"toneMappingExposure",v.toneMappingExposure),y.needsLights&&(B=C,(L=N).ambientLightColor.needsUpdate=B,L.lightProbe.needsUpdate=B,L.directionalLights.needsUpdate=B,L.directionalLightShadows.needsUpdate=B,L.pointLights.needsUpdate=B,L.pointLightShadows.needsUpdate=B,L.spotLights.needsUpdate=B,L.spotLightShadows.needsUpdate=B,L.rectAreaLights.needsUpdate=B,L.hemisphereLights.needsUpdate=B),s&&!0===i.fog&&yt.refreshFogUniforms(N,s),yt.refreshMaterialUniforms(N,i,I,D,m.state.transmissionRenderTarget[t.id]),fa.upload(Nt,Zt(y),N,rt));var L,B;i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(fa.upload(Nt,Zt(y),N,rt),i.uniformsNeedUpdate=!1);i.isSpriteMaterial&&R.setValue(Nt,"center",r.center);if(R.setValue(Nt,"modelViewMatrix",r.modelViewMatrix),R.setValue(Nt,"normalMatrix",r.normalMatrix),R.setValue(Nt,"modelMatrix",r.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,n=t.length;e<n;e++){const n=t[e];Rt.update(n,b),Rt.bind(n,b)}}return b}(t,e,n,i,r);J.setMaterial(i,a);let l=n.index,u=1;if(!0===i.wireframe){if(l=At.getWireframeAttribute(n),void 0===l)return;u=2}const h=n.drawRange,c=n.attributes.position;let A=h.start*u,d=(h.start+h.count)*u;null!==s&&(A=Math.max(A,s.start*u),d=Math.min(d,(s.start+s.count)*u)),null!==l?(A=Math.max(A,0),d=Math.min(d,l.count)):null!=c&&(A=Math.max(A,0),d=Math.min(d,c.count));const p=d-A;if(p<0||p===1/0)return;let f;Ct.setup(r,i,o,n,l);let g=wt;if(null!==l&&(f=ct.get(l),g=Tt,g.setIndex(f)),r.isMesh)!0===i.wireframe?(J.setLineWidth(i.wireframeLinewidth*Y()),g.setMode(Nt.LINES)):g.setMode(Nt.TRIANGLES);else if(r.isLine){let t=i.linewidth;void 0===t&&(t=1),J.setLineWidth(t*Y()),r.isLineSegments?g.setMode(Nt.LINES):r.isLineLoop?g.setMode(Nt.LINE_LOOP):g.setMode(Nt.LINE_STRIP)}else r.isPoints?g.setMode(Nt.POINTS):r.isSprite&&g.setMode(Nt.TRIANGLES);if(r.isBatchedMesh)if(null!==r._multiDrawInstances)g.renderMultiDrawInstances(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount,r._multiDrawInstances);else if(Q.get("WEBGL_multi_draw"))g.renderMultiDraw(r._multiDrawStarts,r._multiDrawCounts,r._multiDrawCount);else{const t=r._multiDrawStarts,e=r._multiDrawCounts,n=r._multiDrawCount,s=l?ct.get(l).bytesPerElement:1,a=nt.get(i).currentProgram.getUniforms();for(let i=0;i<n;i++)a.setValue(Nt,"_gl_DrawID",i),g.render(t[i]/s,e[i])}else if(r.isInstancedMesh)g.renderInstances(A,p,r.count);else if(n.isInstancedBufferGeometry){const t=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,e=Math.min(n.instanceCount,t);g.renderInstances(A,p,e)}else g.render(A,p)},this.compile=function(t,e,n=null){null===n&&(n=t),m=_t.get(n),m.init(e),y.push(m),n.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(m.pushLight(t),t.castShadow&&m.pushShadow(t))})),t!==n&&t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(m.pushLight(t),t.castShadow&&m.pushShadow(t))})),m.setupLights();const i=new Set;return t.traverse((function(t){if(!(t.isMesh||t.isPoints||t.isLine||t.isSprite))return;const e=t.material;if(e)if(Array.isArray(e))for(let r=0;r<e.length;r++){const s=e[r];Ft(s,n,t),i.add(s)}else Ft(e,n,t),i.add(e)})),y.pop(),m=null,i},this.compileAsync=function(t,e,n=null){const i=this.compile(t,e,n);return new Promise((e=>{function n(){i.forEach((function(t){nt.get(t).currentProgram.isReady()&&i.delete(t)})),0!==i.size?setTimeout(n,10):e(t)}null!==Q.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let kt=null;function zt(){Gt.stop()}function qt(){Gt.start()}const Gt=new Mr;function Vt(t,e,n,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)m.pushLight(t),t.castShadow&&m.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||k.intersectsSprite(t)){i&&j.setFromMatrixPosition(t.matrixWorld).applyMatrix4(V);const e=mt.update(t),r=t.material;r.visible&&f.push(t,e,r,n,j.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||k.intersectsObject(t))){const e=mt.update(t),r=t.material;if(i&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),j.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),j.copy(e.boundingSphere.center)),j.applyMatrix4(t.matrixWorld).applyMatrix4(V)),Array.isArray(r)){const i=e.groups;for(let s=0,a=i.length;s<a;s++){const a=i[s],o=r[a.materialIndex];o&&o.visible&&f.push(t,e,o,n,j.z,a)}}else r.visible&&f.push(t,e,r,n,j.z,null)}const r=t.children;for(let t=0,s=r.length;t<s;t++)Vt(r[t],e,n,i)}function Ht(t,e,n,i){const r=t.opaque,s=t.transmissive,a=t.transparent;m.setupLightsView(n),!0===z&&xt.setGlobalState(v.clippingPlanes,n),i&&J.viewport(T.copy(i)),r.length>0&&Wt(r,e,n),s.length>0&&Wt(s,e,n),a.length>0&&Wt(a,e,n),J.buffers.depth.setTest(!0),J.buffers.depth.setMask(!0),J.buffers.color.setMask(!0),J.setPolygonOffset(!1)}function jt(t,e,n,i){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;void 0===m.state.transmissionRenderTarget[i.id]&&(m.state.transmissionRenderTarget[i.id]=new Ze(1,1,{generateMipmaps:!0,type:Q.has("EXT_color_buffer_half_float")||Q.has("EXT_color_buffer_float")?st:K,minFilter:Z,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ke.workingColorSpace}));const s=m.state.transmissionRenderTarget[i.id],a=i.viewport||T;s.setSize(a.z,a.w);const o=v.getRenderTarget();v.setRenderTarget(s),v.getClearColor(R),N=v.getClearAlpha(),N<1&&v.setClearColor(16777215,.5),v.clear(),X&&St.render(n);const l=v.toneMapping;v.toneMapping=0;const u=i.viewport;if(void 0!==i.viewport&&(i.viewport=void 0),m.setupLightsView(i),!0===z&&xt.setGlobalState(v.clippingPlanes,i),Wt(t,n,i),rt.updateMultisampleRenderTarget(s),rt.updateRenderTargetMipmap(s),!1===Q.has("WEBGL_multisampled_render_to_texture")){let t=!1;for(let r=0,s=e.length;r<s;r++){const s=e[r],a=s.object,o=s.geometry,l=s.material,u=s.group;if(2===l.side&&a.layers.test(i.layers)){const e=l.side;l.side=1,l.needsUpdate=!0,Xt(a,n,i,o,l,u),l.side=e,l.needsUpdate=!0,t=!0}}!0===t&&(rt.updateMultisampleRenderTarget(s),rt.updateRenderTargetMipmap(s))}v.setRenderTarget(o),v.setClearColor(R,N),void 0!==u&&(i.viewport=u),v.toneMapping=l}function Wt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r<s;r++){const s=t[r],a=s.object,o=s.geometry,l=null===i?s.material:i,u=s.group;a.layers.test(n.layers)&&Xt(a,e,n,o,l,u)}}function Xt(t,e,n,i,r,s){t.onBeforeRender(v,e,n,i,r,s),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),r.onBeforeRender(v,e,n,i,t,s),!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=1,r.needsUpdate=!0,v.renderBufferDirect(n,e,i,r,t,s),r.side=0,r.needsUpdate=!0,v.renderBufferDirect(n,e,i,r,t,s),r.side=2):v.renderBufferDirect(n,e,i,r,t,s),t.onAfterRender(v,e,n,i,r,s)}function $t(t,e,n){!0!==e.isScene&&(e=W);const i=nt.get(t),r=m.state.lights,s=m.state.shadowsArray,a=r.state.version,o=gt.getParameters(t,r.state,s,e,n),l=gt.getProgramCacheKey(o);let u=i.programs;i.environment=t.isMeshStandardMaterial?e.environment:null,i.fog=e.fog,i.envMap=(t.isMeshStandardMaterial?ht:ut).get(t.envMap||i.environment),i.envMapRotation=null!==i.environment&&null===t.envMap?e.environmentRotation:t.envMapRotation,void 0===u&&(t.addEventListener("dispose",Ot),u=new Map,i.programs=u);let h=u.get(l);if(void 0!==h){if(i.currentProgram===h&&i.lightsStateVersion===a)return Kt(t,o),h}else o.uniforms=gt.getUniforms(t),t.onBeforeCompile(o,v),h=gt.acquireProgram(o,l),u.set(l,h),i.uniforms=o.uniforms;const c=i.uniforms;return(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(c.clippingPlanes=xt.uniform),Kt(t,o),i.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),i.lightsStateVersion=a,i.needsLights&&(c.ambientLightColor.value=r.state.ambient,c.lightProbe.value=r.state.probe,c.directionalLights.value=r.state.directional,c.directionalLightShadows.value=r.state.directionalShadow,c.spotLights.value=r.state.spot,c.spotLightShadows.value=r.state.spotShadow,c.rectAreaLights.value=r.state.rectArea,c.ltc_1.value=r.state.rectAreaLTC1,c.ltc_2.value=r.state.rectAreaLTC2,c.pointLights.value=r.state.point,c.pointLightShadows.value=r.state.pointShadow,c.hemisphereLights.value=r.state.hemi,c.directionalShadowMap.value=r.state.directionalShadowMap,c.directionalShadowMatrix.value=r.state.directionalShadowMatrix,c.spotShadowMap.value=r.state.spotShadowMap,c.spotLightMatrix.value=r.state.spotLightMatrix,c.spotLightMap.value=r.state.spotLightMap,c.pointShadowMap.value=r.state.pointShadowMap,c.pointShadowMatrix.value=r.state.pointShadowMatrix),i.currentProgram=h,i.uniformsList=null,h}function Zt(t){if(null===t.uniformsList){const e=t.currentProgram.getUniforms();t.uniformsList=fa.seqWithValue(e.seq,t.uniforms)}return t.uniformsList}function Kt(t,e){const n=nt.get(t);n.outputColorSpace=e.outputColorSpace,n.batching=e.batching,n.batchingColor=e.batchingColor,n.instancing=e.instancing,n.instancingColor=e.instancingColor,n.instancingMorph=e.instancingMorph,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}Gt.setAnimationLoop((function(t){kt&&kt(t)})),"undefined"!=typeof self&&Gt.setContext(self),this.setAnimationLoop=function(t){kt=t,It.setAnimationLoop(t),null===t?Gt.stop():Gt.start()},It.addEventListener("sessionstart",zt),It.addEventListener("sessionend",qt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===_)return;if(!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===It.enabled&&!0===It.isPresenting&&(!0===It.cameraAutoUpdate&&It.updateCamera(e),e=It.getCamera()),!0===t.isScene&&t.onBeforeRender(v,t,e,S),m=_t.get(t,y.length),m.init(e),y.push(m),V.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),k.setFromProjectionMatrix(V),q=this.localClippingEnabled,z=xt.init(this.clippingPlanes,q),f=vt.get(t,g.length),f.init(),g.push(f),!0===It.enabled&&!0===It.isPresenting){const t=v.xr.getDepthSensingMesh();null!==t&&Vt(t,e,-1/0,v.sortObjects)}Vt(t,e,0,v.sortObjects),f.finish(),!0===v.sortObjects&&f.sort(L,B),X=!1===It.enabled||!1===It.isPresenting||!1===It.hasDepthSensing(),X&&St.addToRenderList(f,t),this.info.render.frame++,!0===z&&xt.beginShadows();const n=m.state.shadowsArray;bt.render(n,t,e),!0===z&&xt.endShadows(),!0===this.info.autoReset&&this.info.reset();const i=f.opaque,r=f.transmissive;if(m.setupLights(),e.isArrayCamera){const n=e.cameras;if(r.length>0)for(let e=0,s=n.length;e<s;e++){jt(i,r,t,n[e])}X&&St.render(t);for(let e=0,i=n.length;e<i;e++){const i=n[e];Ht(f,t,i,i.viewport)}}else r.length>0&&jt(i,r,t,e),X&&St.render(t),Ht(f,t,e);null!==S&&(rt.updateMultisampleRenderTarget(S),rt.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(v,t,e),Ct.resetDefaultState(),M=-1,w=null,y.pop(),y.length>0?(m=y[y.length-1],!0===z&&xt.setGlobalState(v.clippingPlanes,m.state.camera)):m=null,g.pop(),f=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,n){nt.get(t.texture).__webglTexture=e,nt.get(t.depthTexture).__webglTexture=n;const i=nt.get(t);i.__hasExternalTextures=!0,i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===Q.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(t,e){const n=nt.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){S=t,x=e,b=n;let i=!0,r=null,s=!1,a=!1;if(t){const o=nt.get(t);if(void 0!==o.__useDefaultFramebuffer)J.bindFramebuffer(Nt.FRAMEBUFFER,null),i=!1;else if(void 0===o.__webglFramebuffer)rt.setupRenderTarget(t);else if(o.__hasExternalTextures)rt.rebindTextures(t,nt.get(t.texture).__webglTexture,nt.get(t.depthTexture).__webglTexture);else if(t.depthBuffer){const e=t.depthTexture;if(o.__boundDepthTexture!==e){if(null!==e&&nt.has(e)&&(t.width!==e.image.width||t.height!==e.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");rt.setupDepthRenderbuffer(t)}}const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(a=!0);const u=nt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=Array.isArray(u[e])?u[e][n]:u[e],s=!0):r=t.samples>0&&!1===rt.useMultisampledRTT(t)?nt.get(t).__webglMultisampledFramebuffer:Array.isArray(u)?u[n]:u,T.copy(t.viewport),E.copy(t.scissor),C=t.scissorTest}else T.copy(U).multiplyScalar(I).floor(),E.copy(O).multiplyScalar(I).floor(),C=F;if(J.bindFramebuffer(Nt.FRAMEBUFFER,r)&&i&&J.drawBuffers(t,r),J.viewport(T),J.scissor(E),J.setScissorTest(C),s){const i=nt.get(t.texture);Nt.framebufferTexture2D(Nt.FRAMEBUFFER,Nt.COLOR_ATTACHMENT0,Nt.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,n)}else if(a){const i=nt.get(t.texture),r=e||0;Nt.framebufferTextureLayer(Nt.FRAMEBUFFER,Nt.COLOR_ATTACHMENT0,i.__webglTexture,n||0,r)}M=-1},this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=nt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){J.bindFramebuffer(Nt.FRAMEBUFFER,o);try{const a=t.texture,o=a.format,l=a.type;if(!$.textureFormatReadable(o))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!$.textureTypeReadable(l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&Nt.readPixels(e,n,i,r,Et.convert(o),Et.convert(l),s)}finally{const t=null!==S?nt.get(S).__webglFramebuffer:null;J.bindFramebuffer(Nt.FRAMEBUFFER,t)}}},this.readRenderTargetPixelsAsync=async function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=nt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){const a=t.texture,l=a.format,u=a.type;if(!$.textureFormatReadable(l))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!$.textureTypeReadable(u))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r){J.bindFramebuffer(Nt.FRAMEBUFFER,o);const t=Nt.createBuffer();Nt.bindBuffer(Nt.PIXEL_PACK_BUFFER,t),Nt.bufferData(Nt.PIXEL_PACK_BUFFER,s.byteLength,Nt.STREAM_READ),Nt.readPixels(e,n,i,r,Et.convert(l),Et.convert(u),0);const a=null!==S?nt.get(S).__webglFramebuffer:null;J.bindFramebuffer(Nt.FRAMEBUFFER,a);const h=Nt.fenceSync(Nt.SYNC_GPU_COMMANDS_COMPLETE,0);return Nt.flush(),await function(t,e,n){return new Promise((function(i,r){setTimeout((function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}),n)}))}(Nt,h,4),Nt.bindBuffer(Nt.PIXEL_PACK_BUFFER,t),Nt.getBufferSubData(Nt.PIXEL_PACK_BUFFER,0,s),Nt.deleteBuffer(t),Nt.deleteSync(h),s}throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(t,e=null,n=0){!0!==t.isTexture&&(Le("WebGLRenderer: copyFramebufferToTexture function signature has changed."),e=arguments[0]||null,t=arguments[1]);const i=Math.pow(2,-n),r=Math.floor(t.image.width*i),s=Math.floor(t.image.height*i),a=null!==e?e.x:0,o=null!==e?e.y:0;rt.setTexture2D(t,0),Nt.copyTexSubImage2D(Nt.TEXTURE_2D,n,0,0,a,o,r,s),J.unbindTexture()},this.copyTextureToTexture=function(t,e,n=null,i=null,r=0){let s,a,o,l,u,h;!0!==t.isTexture&&(Le("WebGLRenderer: copyTextureToTexture function signature has changed."),i=arguments[0]||null,t=arguments[1],e=arguments[2],r=arguments[3]||0,n=null),null!==n?(s=n.max.x-n.min.x,a=n.max.y-n.min.y,o=n.min.x,l=n.min.y):(s=t.image.width,a=t.image.height,o=0,l=0),null!==i?(u=i.x,h=i.y):(u=0,h=0);const c=Et.convert(e.format),A=Et.convert(e.type);rt.setTexture2D(e,0),Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,e.flipY),Nt.pixelStorei(Nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),Nt.pixelStorei(Nt.UNPACK_ALIGNMENT,e.unpackAlignment);const d=Nt.getParameter(Nt.UNPACK_ROW_LENGTH),p=Nt.getParameter(Nt.UNPACK_IMAGE_HEIGHT),f=Nt.getParameter(Nt.UNPACK_SKIP_PIXELS),m=Nt.getParameter(Nt.UNPACK_SKIP_ROWS),g=Nt.getParameter(Nt.UNPACK_SKIP_IMAGES),y=t.isCompressedTexture?t.mipmaps[r]:t.image;Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,y.width),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,y.height),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,o),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,l),t.isDataTexture?Nt.texSubImage2D(Nt.TEXTURE_2D,r,u,h,s,a,c,A,y.data):t.isCompressedTexture?Nt.compressedTexSubImage2D(Nt.TEXTURE_2D,r,u,h,y.width,y.height,c,y.data):Nt.texSubImage2D(Nt.TEXTURE_2D,r,u,h,s,a,c,A,y),Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,d),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,p),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,f),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,m),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,g),0===r&&e.generateMipmaps&&Nt.generateMipmap(Nt.TEXTURE_2D),J.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n=null,i=null,r=0){let s,a,o,l,u,h,c,A,d;!0!==t.isTexture&&(Le("WebGLRenderer: copyTextureToTexture3D function signature has changed."),n=arguments[0]||null,i=arguments[1]||null,t=arguments[2],e=arguments[3],r=arguments[4]||0);const p=t.isCompressedTexture?t.mipmaps[r]:t.image;null!==n?(s=n.max.x-n.min.x,a=n.max.y-n.min.y,o=n.max.z-n.min.z,l=n.min.x,u=n.min.y,h=n.min.z):(s=p.width,a=p.height,o=p.depth,l=0,u=0,h=0),null!==i?(c=i.x,A=i.y,d=i.z):(c=0,A=0,d=0);const f=Et.convert(e.format),m=Et.convert(e.type);let g;if(e.isData3DTexture)rt.setTexture3D(e,0),g=Nt.TEXTURE_3D;else{if(!e.isDataArrayTexture&&!e.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");rt.setTexture2DArray(e,0),g=Nt.TEXTURE_2D_ARRAY}Nt.pixelStorei(Nt.UNPACK_FLIP_Y_WEBGL,e.flipY),Nt.pixelStorei(Nt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),Nt.pixelStorei(Nt.UNPACK_ALIGNMENT,e.unpackAlignment);const y=Nt.getParameter(Nt.UNPACK_ROW_LENGTH),v=Nt.getParameter(Nt.UNPACK_IMAGE_HEIGHT),_=Nt.getParameter(Nt.UNPACK_SKIP_PIXELS),x=Nt.getParameter(Nt.UNPACK_SKIP_ROWS),b=Nt.getParameter(Nt.UNPACK_SKIP_IMAGES);Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,p.width),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,p.height),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,l),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,u),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,h),t.isDataTexture||t.isData3DTexture?Nt.texSubImage3D(g,r,c,A,d,s,a,o,f,m,p.data):e.isCompressedArrayTexture?Nt.compressedTexSubImage3D(g,r,c,A,d,s,a,o,f,p.data):Nt.texSubImage3D(g,r,c,A,d,s,a,o,f,m,p),Nt.pixelStorei(Nt.UNPACK_ROW_LENGTH,y),Nt.pixelStorei(Nt.UNPACK_IMAGE_HEIGHT,v),Nt.pixelStorei(Nt.UNPACK_SKIP_PIXELS,_),Nt.pixelStorei(Nt.UNPACK_SKIP_ROWS,x),Nt.pixelStorei(Nt.UNPACK_SKIP_IMAGES,b),0===r&&e.generateMipmaps&&Nt.generateMipmap(g),J.unbindTexture()},this.initRenderTarget=function(t){void 0===nt.get(t).__webglFramebuffer&&rt.setupRenderTarget(t)},this.initTexture=function(t){t.isCubeTexture?rt.setTextureCube(t,0):t.isData3DTexture?rt.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?rt.setTexture2DArray(t,0):rt.setTexture2D(t,0),J.unbindTexture()},this.resetState=function(){x=0,b=0,S=null,J.reset(),Ct.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return de}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===$t?"display-p3":"srgb",e.unpackColorSpace=ke.workingColorSpace===Zt?"display-p3":"srgb"}},Scene:class extends si{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 Gn,this.environmentIntensity=1,this.environmentRotation=new Gn,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}},PerspectiveCamera:Ar,Raycaster:class{constructor(t,e,n=0,i=1/0){this.ray=new Pn(t,e),this.near=n,this.far=i,this.camera=null,this.layers=new Vn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return Zl.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Zl),this}intersectObject(t,e=!0,n=[]){return Jl(t,this,n,e),n.sort(Kl),n}intersectObjects(t,e=!0,n=[]){for(let i=0,r=t.length;i<r;i++)Jl(t[i],this,n,e);return n.sort(Kl),n}},SRGBColorSpace:Yt,TextureLoader:zl,Vector2:Ee,Vector3:en,Box3:sn,Color:Mi,Mesh:tr,SphereGeometry:Nl,MeshBasicMaterial:Ci,BackSide:1,EventDispatcher:fe,MOUSE:a,Quaternion:tn,Spherical:tu,Clock:Yl},NH=Fu({props:{width:{default:window.innerWidth,onChange:function(t,e,n){isNaN(t)&&(e.width=n)}},height:{default:window.innerHeight,onChange:function(t,e,n){isNaN(t)&&(e.height=n)}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(t,e){e.hoverObj=null,e.toolTipElem&&(e.toolTipElem.innerHTML="")},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(t){if(t.initialised){if(t.controls.update&&t.controls.update(Math.min(1,t.clock.getDelta())),t.postProcessingComposer?t.postProcessingComposer.render():t.renderer.render(t.scene,t.camera),t.extraRenderers.forEach((function(e){return e.render(t.scene,t.camera)})),t.enablePointerInteraction){var e=null;if(t.hoverDuringDrag||!t.isPointerDragging){var n=this.intersectingObjects(t.pointerPos.x,t.pointerPos.y).filter((function(e){return t.hoverFilter(e.object)})).sort((function(e,n){return t.hoverOrderComparator(e.object,n.object)})),i=n.length?n[0]:null;e=i?i.object:null,t.intersectionPoint=i?i.point:null}e!==t.hoverObj&&(t.onHover(e,t.hoverObj),t.toolTipElem.innerHTML=e&&Xd(t.tooltipContent)(e)||"",t.hoverObj=e)}t.tweenGroup.update()}return this},getPointerPos:function(t){var e=t.pointerPos;return{x:e.x,y:e.y}},cameraPosition:function(t,e,n,i){var r=t.camera;if(e&&t.initialised){var s=e,a=n||{x:0,y:0,z:0};if(i){var o=Object.assign({},r.position),l=c();t.tweenGroup.add(new Wu(o).to(s,i).easing(zu.Quadratic.Out).onUpdate(u).start()),t.tweenGroup.add(new Wu(l).to(a,i/3).easing(zu.Quadratic.Out).onUpdate(h).start())}else u(s),h(a);return this}return Object.assign({},r.position,{lookAt:c()});function u(t){var e=t.x,n=t.y,i=t.z;void 0!==e&&(r.position.x=e),void 0!==n&&(r.position.y=n),void 0!==i&&(r.position.z=i)}function h(e){var n=new RH.Vector3(e.x,e.y,e.z);t.controls.target?t.controls.target=n:r.lookAt(n)}function c(){return Object.assign(new RH.Vector3(0,0,-1e3).applyQuaternion(r.quaternion).add(r.position))}},zoomToFit:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i=arguments.length,r=new Array(i>3?i-3:0),s=3;s<i;s++)r[s-3]=arguments[s];return this.fitToBbox(this.getBbox.apply(this,r),e,n)},fitToBbox:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,r=t.camera;if(e){var s=new RH.Vector3(0,0,0),a=2*Math.max.apply(Math,EH(Object.entries(e).map((function(t){var e=TH(t,2),n=e[0],i=e[1];return Math.max.apply(Math,EH(i.map((function(t){return Math.abs(s[n]-t)}))))})))),o=(1-2*i/t.height)*r.fov,l=a/Math.atan(o*Math.PI/180),u=l/r.aspect,h=Math.max(l,u);if(h>0){var c=s.clone().sub(r.position).normalize().multiplyScalar(-h);this.cameraPosition(c,s,n)}}return this},getBbox:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=new RH.Box3(new RH.Vector3(0,0,0),new RH.Vector3(0,0,0)),i=t.objects.filter(e);return i.length?(i.forEach((function(t){return n.expandByObject(t)})),Object.assign.apply(Object,EH(["x","y","z"].map((function(t){return wH({},t,[n.min[t],n.max[t]])}))))):null},getScreenCoords:function(t,e,n,i){var r=new RH.Vector3(e,n,i);return r.project(this.camera()),{x:(r.x+1)*t.width/2,y:-(r.y-1)*t.height/2}},getSceneCoords:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=new RH.Vector2(e/t.width*2-1,-n/t.height*2+1),s=new RH.Raycaster;return s.setFromCamera(r,t.camera),Object.assign({},s.ray.at(i,new RH.Vector3))},intersectingObjects:function(t,e,n){var i=new RH.Vector2(e/t.width*2-1,-n/t.height*2+1),r=new RH.Raycaster;return r.params.Line.threshold=t.lineHoverPrecision,r.setFromCamera(i,t.camera),r.intersectObjects(t.objects,!0)},renderer:function(t){return t.renderer},scene:function(t){return t.scene},camera:function(t){return t.camera},postProcessingComposer:function(t){return t.postProcessingComposer},controls:function(t){return t.controls},tbControls:function(t){return t.controls}},stateInit:function(){return{scene:new RH.Scene,camera:new RH.PerspectiveCamera,clock:new RH.Clock,tweenGroup:new Gu}},init:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.controlType,r=void 0===i?"trackball":i,s=n.useWebGPU,a=void 0!==s&&s,o=n.rendererConfig,l=void 0===o?{}:o,u=n.extraRenderers,h=void 0===u?[]:u,c=n.waitForLoadComplete,A=void 0===c||c;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.className="scene-container",e.container.style.position="relative",e.container.appendChild(e.navInfo=document.createElement("div")),e.navInfo.className="scene-nav-info",e.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[r]||"",e.navInfo.style.display=e.showNavInfo?null:"none",e.toolTipElem=document.createElement("div"),e.toolTipElem.classList.add("scene-tooltip"),e.container.appendChild(e.toolTipElem),e.pointerPos=new RH.Vector2,e.pointerPos.x=-2,e.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(t){return e.container.addEventListener(t,(function(n){if("pointerdown"===t&&(e.isPointerPressed=!0),!e.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||e.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(t){return Math.abs(t)>1})))&&(e.isPointerDragging=!0),e.enablePointerInteraction){var i=(r=e.container,s=r.getBoundingClientRect(),a=window.pageXOffset||document.documentElement.scrollLeft,o=window.pageYOffset||document.documentElement.scrollTop,{top:s.top+o,left:s.left+a});e.pointerPos.x=n.pageX-i.left,e.pointerPos.y=n.pageY-i.top,e.toolTipElem.style.top="".concat(e.pointerPos.y,"px"),e.toolTipElem.style.left="".concat(e.pointerPos.x,"px"),e.toolTipElem.style.transform="translate(-".concat(e.pointerPos.x/e.width*100,"%, ").concat(e.height-e.pointerPos.y<100?"calc(-100% - 8px)":"21px",")")}var r,s,a,o}),{passive:!0})})),e.container.addEventListener("pointerup",(function(t){e.isPointerPressed=!1,e.isPointerDragging&&(e.isPointerDragging=!1,!e.clickAfterDrag)||requestAnimationFrame((function(){0===t.button&&e.onClick(e.hoverObj||null,t,e.intersectionPoint),2===t.button&&e.onRightClick&&e.onRightClick(e.hoverObj||null,t,e.intersectionPoint)}))}),{passive:!0,capture:!0}),e.container.addEventListener("contextmenu",(function(t){e.onRightClick&&t.preventDefault()})),e.renderer=new(a?lG:RH.WebGLRenderer)(Object.assign({antialias:!0,alpha:!0},l)),e.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),e.container.appendChild(e.renderer.domElement),e.extraRenderers=h,e.extraRenderers.forEach((function(t){t.domElement.style.position="absolute",t.domElement.style.top="0px",t.domElement.style.pointerEvents="none",e.container.appendChild(t.domElement)})),e.postProcessingComposer=new kV(e.renderer),e.postProcessingComposer.addPass(new zV(e.scene,e.camera)),e.controls=new{trackball:RG,orbit:oV,fly:SV}[r](e.camera,e.renderer.domElement),"fly"===r&&(e.controls.movementSpeed=300,e.controls.rollSpeed=Math.PI/6,e.controls.dragToLook=!0),"trackball"!==r&&"orbit"!==r||(e.controls.minDistance=.1,e.controls.maxDistance=e.skyRadius,e.controls.addEventListener("start",(function(){e.controlsEngaged=!0})),e.controls.addEventListener("change",(function(){e.controlsEngaged&&(e.controlsDragging=!0)})),e.controls.addEventListener("end",(function(){e.controlsEngaged=!1,e.controlsDragging=!1}))),[e.renderer,e.postProcessingComposer].concat(EH(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix(),e.camera.position.z=1e3,e.scene.add(e.skysphere=new RH.Mesh),e.skysphere.visible=!1,e.loadComplete=e.scene.visible=!A,window.scene=e.scene},update:function(t,e){if(t.width&&t.height&&(e.hasOwnProperty("width")||e.hasOwnProperty("height"))&&(t.container.style.width="".concat(t.width,"px"),t.container.style.height="".concat(t.height,"px"),[t.renderer,t.postProcessingComposer].concat(EH(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix()),e.hasOwnProperty("skyRadius")&&t.skyRadius&&(t.controls.hasOwnProperty("maxDistance")&&e.skyRadius&&(t.controls.maxDistance=Math.min(t.controls.maxDistance,t.skyRadius)),t.camera.far=2.5*t.skyRadius,t.camera.updateProjectionMatrix(),t.skysphere.geometry=new RH.SphereGeometry(t.skyRadius)),e.hasOwnProperty("backgroundColor")){var n=oH(t.backgroundColor).alpha;void 0===n&&(n=1),t.renderer.setClearColor(new RH.Color(SH(1,t.backgroundColor)),n)}function i(){t.loadComplete=t.scene.visible=!0}e.hasOwnProperty("backgroundImageUrl")&&(t.backgroundImageUrl?(new RH.TextureLoader).load(t.backgroundImageUrl,(function(e){e.colorSpace=RH.SRGBColorSpace,t.skysphere.material=new RH.MeshBasicMaterial({map:e,side:RH.BackSide}),t.skysphere.visible=!0,t.onBackgroundImageLoaded&&setTimeout(t.onBackgroundImageLoaded),!t.loadComplete&&i()})):(t.skysphere.visible=!1,t.skysphere.material.map=null,!t.loadComplete&&i())),e.hasOwnProperty("showNavInfo")&&(t.navInfo.style.display=t.showNavInfo?null:"none"),e.hasOwnProperty("lights")&&((e.lights||[]).forEach((function(e){return t.scene.remove(e)})),t.lights.forEach((function(e){return t.scene.add(e)}))),e.hasOwnProperty("objects")&&((e.objects||[]).forEach((function(e){return t.scene.remove(e)})),t.objects.forEach((function(e){return t.scene.add(e)})))}});function PH(t,e){var n=new e;return n._destructor&&n._destructor(),{linkProp:function(e){return{default:n[e](),onChange:function(n,i){i[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var i=n[t],r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];var o=i[e].apply(i,s);return o===i?this:o}}}}var DH=["rendererConfig","waitForGlobeReady"],IH=i(i({},window.THREE?window.THREE:{AmbientLight:class extends ql{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}},DirectionalLight:class extends ql{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(si.DEFAULT_UP),this.updateMatrix(),this.target=new si,this.shadow=new Wl}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}},Vector2:Ee,REVISION:s}),{},{CSS2DRenderer:class{constructor(t={}){const e=this;let n,i,r,s;const a={objects:new WeakMap},o=void 0!==t.element?t.element:document.createElement("div");function l(t){t.isCSS2DObject&&(t.element.style.display="none");for(let e=0,n=t.children.length;e<n;e++)l(t.children[e])}function u(t,n,i){if(!1!==t.visible){if(t.isCSS2DObject){su.setFromMatrixPosition(t.matrixWorld),su.applyMatrix4(ou);const l=su.z>=-1&&su.z<=1&&!0===t.layers.test(i.layers),u=t.element;u.style.display=!0===l?"":"none",!0===l&&(t.onBeforeRender(e,n,i),u.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(su.x*r+r)+"px,"+(-su.y*s+s)+"px)",u.parentNode!==o&&o.appendChild(u),t.onAfterRender(e,n,i));const c={distanceToCameraSquared:h(i,t)};a.objects.set(t,c)}for(let e=0,r=t.children.length;e<r;e++)u(t.children[e],n,i)}else l(t)}function h(t,e){return lu.setFromMatrixPosition(t.matrixWorld),uu.setFromMatrixPosition(e.matrixWorld),lu.distanceToSquared(uu)}o.style.overflow="hidden",this.domElement=o,this.getSize=function(){return{width:n,height:i}},this.render=function(t,e){!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),au.copy(e.matrixWorldInverse),ou.multiplyMatrices(e.projectionMatrix,au),u(t,t,e),function(t){const e=function(t){const e=[];return t.traverseVisible((function(t){t.isCSS2DObject&&e.push(t)})),e}(t).sort((function(t,e){if(t.renderOrder!==e.renderOrder)return e.renderOrder-t.renderOrder;return a.objects.get(t).distanceToCameraSquared-a.objects.get(e).distanceToCameraSquared})),n=e.length;for(let t=0,i=e.length;t<i;t++)e[t].element.style.zIndex=n-t}(t)},this.setSize=function(t,e){n=t,i=e,r=n/2,s=i/2,o.style.width=t+"px",o.style.height=e+"px"}}}}),LH=PH("globe",ix),BH=Object.assign.apply(Object,r(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return e({},t,LH.linkProp(t))})))),UH=Object.assign.apply(Object,r(["globeMaterial","getGlobeRadius","getCoords","toGeoCoords"].map((function(t){return e({},t,LH.linkMethod(t))})))),OH=PH("renderObjs",NH),FH=Object.assign.apply(Object,r(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map((function(t){return e({},t,OH.linkProp(t))})))),kH=Object.assign.apply(Object,r(["lights","postProcessingComposer"].map((function(t){return e({},t,OH.linkMethod(t))})))),zH=Fu({props:i(i({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return!0},triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.hoverFilter((function(e){return t(e,e.__data)}))}},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.lineHoverPrecision(t)}}},BH),FH),methods:i(i({pauseAnimation:function(t){var e;return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),null===(e=t.globe)||void 0===e||e.pauseAnimation(),this},resumeAnimation:function(t){var e;return null===t.animationFrameRequestId&&this._animationCycle(),null===(e=t.globe)||void 0===e||e.resumeAnimation(),this},_animationCycle:function(t){t.renderObjs.tick(),t.tweenGroup.update(),t.animationFrameRequestId=requestAnimationFrame(this._animationCycle)},pointOfView:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.globe.toGeoCoords(t.renderObjs.cameraPosition());if(void 0===e.lat&&void 0===e.lng&&void 0===e.altitude)return i;var r=Object.assign({},i,e);if(["lat","lng","altitude"].forEach((function(t){return r[t]=+r[t]})),n){for(;i.lng-r.lng>180;)i.lng-=360;for(;i.lng-r.lng<-180;)i.lng+=360;t.tweenGroup.add(new Wu(i).to(r,n).easing(zu.Cubic.InOut).onUpdate(s).start())}else s(r);return this;function s(e){var n=e.lat,i=e.lng,r=e.altitude;t.renderObjs.cameraPosition(t.globe.getCoords(n,i,r))}},getScreenCoords:function(t){for(var e,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var s=(e=t.globe).getCoords.apply(e,i);return t.renderObjs.getScreenCoords(s.x,s.y,s.z)},toGlobeCoords:function(t,e,n){var i=t.renderObjs.intersectingObjects(e,n).find((function(t){return"globe"===t.object.__globeObjType}));if(!i)return null;var r=t.globe.toGeoCoords(i.point);return{lat:r.lat,lng:r.lng}},scene:function(t){return t.renderObjs.scene()},camera:function(t){return t.renderObjs.camera()},renderer:function(t){return t.renderObjs.renderer()},controls:function(t){return t.renderObjs.controls()},_destructor:function(t){t.globe._destructor(),this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([])}},UH),kH),stateInit:function(t){var e=t.rendererConfig,n=t.waitForGlobeReady,r=void 0===n||n,s=function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.includes(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,DH),a=new ix(i({waitForGlobeReady:r},s));return{globe:a,renderObjs:NH({controlType:"orbit",rendererConfig:e,waitForLoadComplete:r,extraRenderers:[new IH.CSS2DRenderer]}).skyRadius(500*a.getGlobeRadius()).showNavInfo(!1).objects([a]).lights([new IH.AmbientLight(13421772,Math.PI),new IH.DirectionalLight(16777215,.6*Math.PI)]),tweenGroup:new Gu}},init:function(t,e){var n=this;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.style.position="relative";var i=document.createElement("div");e.container.appendChild(i),e.renderObjs(i),e.globe.rendererSize(e.renderObjs.renderer().getSize(new IH.Vector2)),this.pointOfView({altitude:2.5});var r=e.globe.getGlobeRadius(),s=e.renderObjs.controls();s.minDistance=1.01*r,s.maxDistance=100*r,s.enablePan=!1,s.enableDamping=!0,s.dampingFactor=.1,s.rotateSpeed=.3,s.zoomSpeed=.3,s.addEventListener("change",(function(){var t=n.pointOfView();s.rotateSpeed=.2*t.altitude,s.zoomSpeed=.1*(t.altitude+1),e.globe.setPointOfView(e.renderObjs.camera().position),e.onZoom&&e.onZoom(t)}));var a=function(t){for(var e=t;e&&!e.hasOwnProperty("__globeObjType");)e=e.parent;return e},o={point:function(t){return t},arc:function(t){return t},polygon:function(t){return t.data},path:function(t){return t},heatmap:function(t){return t},hexbin:function(t){return t},hexPolygon:function(t){return t},tile:function(t){return t},label:function(t){return t},object:function(t){return t},custom:function(t){return t}};IH.REVISION<155&&(e.renderObjs.renderer().useLegacyLights=!1),e.renderObjs.hoverOrderComparator((function(t,e){var n=a(t),i=a(e),r=function(t){return!t};return r(n)-r(i)})).tooltipContent((function(t){var n={point:e.pointLabel,arc:e.arcLabel,polygon:e.polygonLabel,path:e.pathLabel,hexbin:e.hexLabel,hexPolygon:e.hexPolygonLabel,tile:e.tileLabel,label:e.labelLabel,object:e.objectLabel,custom:e.customLayerLabel},i=a(t),r=i&&i.__globeObjType;return i&&r&&n.hasOwnProperty(r)&&o.hasOwnProperty(r)&&Xd(n[r])(o[r](i.__data))||""})).onHover((function(t){var n={point:e.onPointHover,arc:e.onArcHover,polygon:e.onPolygonHover,path:e.onPathHover,heatmap:e.onHeatmapHover,hexbin:e.onHexHover,hexPolygon:e.onHexPolygonHover,tile:e.onTileHover,label:e.onLabelHover,object:e.onObjectHover,custom:e.onCustomLayerHover},i={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},r=a(t);if(r&&!n.hasOwnProperty(r.__globeObjType)&&(r=null),r!==e.hoverObj){var s=e.hoverObj?e.hoverObj.__globeObjType:null,l=e.hoverObj?o[s](e.hoverObj.__data):null,u=r?r.__globeObjType:null,h=r?o[u](r.__data):null;s&&s!==u&&n[s]&&n[s](null,l),u&&n[u]&&n[u](h,s===u?l:null),e.renderObjs.renderer().domElement.classList[u&&i[u]?"add":"remove"]("clickable"),e.hoverObj=r}})).onClick((function(t,i,r){if(t){var s={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},l=a(t),u=l.__globeObjType;if(l&&s.hasOwnProperty(u)&&s[u]){var h=[i];if("globe"===u){var c=n.toGeoCoords(r),A=c.lat,d=c.lng;h.unshift({lat:A,lng:d})}else h.push(n.toGeoCoords(r));o.hasOwnProperty(u)&&h.unshift(o[u](l.__data)),s[u].apply(s,h)}}})).onRightClick((function(t,i,r){if(t){var s={globe:e.onGlobeRightClick,point:e.onPointRightClick,arc:e.onArcRightClick,polygon:e.onPolygonRightClick,path:e.onPathRightClick,heatmap:e.onHeatmapRightClick,hexbin:e.onHexRightClick,hexPolygon:e.onHexPolygonRightClick,tile:e.onTileRightClick,label:e.onLabelRightClick,object:e.onObjectRightClick,custom:e.onCustomLayerRightClick},l=a(t),u=l.__globeObjType;if(l&&s.hasOwnProperty(u)&&s[u]){var h=[i];if("globe"===u){var c=n.toGeoCoords(r),A=c.lat,d=c.lng;h.unshift({lat:A,lng:d})}else h.push(n.toGeoCoords(r));o.hasOwnProperty(u)&&h.unshift(o[u](l.__data)),s[u].apply(s,h)}}})),this._animationCycle()}});return zH}));
  • interactive-globes/trunk/interactive-globes.php

    r3158721 r3207680  
    77 * Plugin URI:        https://wpinteractiveglobes.com/
    88 * Description:       Create interactive geographic globes. Color full regions or create markers on specific locations that will have information on hover and can also have actions on click. This plugin uses the online globe.gl library to generate the maps.
    9  * Version:           1.3.1
     9 * Version:           1.4.3
    1010 * Requires PHP:      7.0
    1111 * Author:            Interactive Globes
     
    1818
    1919use Saltus\WP\Framework\Core as FrameworkCore;
     20use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Project;
     21use Saltus\WP\Framework\Infrastructure\Container\ServiceContainer;
    2022use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Plugin\Freemius;
    2123use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Prepare;
    22 use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Project;
    23 use Saltus\WP\Framework\Infrastructure\Container\ServiceContainer;
    2424
     25/**
     26 * Step 1: Validate wp and php
     27 * ######
     28 */
    2529// If this file is called directly, quit.
    2630if ( ! defined( 'ABSPATH' ) ) {
     
    3236    return;
    3337}
     38
    3439/**
    35  * Configuration values
     40 * Step 2: Check if other plugin variants are active
     41 * ######
    3642 */
    37 if ( ! defined( 'WP_ENV' ) ) {
    38     define( 'WP_ENV', 'production' ); // possible: production, development
     43if ( ! function_exists( 'Saltus\WP\Plugin\Saltus\InteractiveGlobes\is_plugin_active' ) ) {
     44    function is_plugin_active( $plugin ) {
     45        return in_array( $plugin, (array) get_option( 'active_plugins', array() ), true );
     46    }
    3947}
    40 if ( ! defined( 'SALTUS_PLAN' ) ) {
    41     define( 'SALTUS_PLAN', 'free' ); // possible: pro, free, other?
     48$variant_suffix = '-premium/';
     49if ( strpos( __DIR__, 'premium' ) !== false ) {
     50    $variant_suffix = '/';
    4251}
    4352
     53$plugin_name         = 'interactive-globes';
     54$variant_main_dir    = $plugin_name . $variant_suffix;
     55$variant_plugin_dir  = plugin_dir_path( __DIR__ ) . $variant_main_dir;
     56$variant_plugin_file = $variant_plugin_dir . 'interactive-globes.php';
     57$variant_plugin_slug = $plugin_name . $variant_suffix . $plugin_name . '.php';
    4458
     59// run as early as possible
     60register_activation_hook(
     61    __FILE__,
     62    function () use ( $variant_plugin_file, $variant_plugin_slug ) {
     63
     64        if ( ! file_exists( $variant_plugin_file ) || ! is_plugin_active( $variant_plugin_slug ) ) {
     65            return;
     66        }
     67        // Deactivate the premium plugin.
     68        \deactivate_plugins( \plugin_basename( $variant_plugin_file ) );
     69        \add_action(
     70            'admin_notices',
     71            function () {
     72                printf(
     73                    '<div class="notice notice-warning is-dismissible">
     74                        <p>%1$s</p>
     75                    </div>',
     76                    esc_html_e( 'The premium version of the plugin has been deactivated to avoid conflicts', 'interactive-globes' )
     77                );
     78            }
     79        );
     80    }
     81);
     82
     83if ( file_exists( $variant_plugin_file ) && is_plugin_active( $variant_plugin_slug ) ) {
     84    return;
     85}
     86
     87/**
     88 * Step 3: check if Freemius was already set by other variant
     89 * ######
     90 */
     91global $ig_fs;
     92// Freemius logic
     93if ( isset( $ig_fs ) && $ig_fs ) {
     94    $ig_fs()->set_basename( true, __FILE__ );
     95    return;
     96}
     97
     98/**
     99 * Step 4: Load config and setup constants
     100 * ######
     101 */
     102if ( ! function_exists( __NAMESPACE__ . '\load_config' ) ) {
     103    function load_config( $root_dir ) {
     104        if ( ! file_exists( $root_dir . '/.saltus' ) ) {
     105            return;
     106        }
     107        // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
     108        $env   = file_get_contents( $root_dir . '/.saltus' );
     109        $lines = explode( "\n", $env );
     110
     111        foreach ( $lines as $line ) {
     112            preg_match( '/([^#]+)\=(.*)/', $line, $matches );
     113            if ( isset( $matches[2] ) ) {
     114                // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_putenv
     115                putenv( trim( $line ) );
     116            }
     117        }
     118    }
     119}
     120load_config( __DIR__ );
     121
     122// before any model
     123if ( ! defined( 'WP_ENV' ) ) {
     124    // this is replaced during build time
     125    define( 'WP_ENV', 'production' );
     126}
     127
     128/**
     129 * Step 5: Load plugin classes
     130 * ######
     131 */
    45132if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
    46133    require_once __DIR__ . '/vendor/autoload.php';
    47134}
    48135
     136/**
     137 * Step 6: Start Freemius and do early Prepare cycle
     138 * ######
     139 */
     140// this is replaced during build time
     141$fs_is_premium_variant = false;
     142
     143$fs = null;
     144// if premium version, setup Freemium
     145if ( $fs_is_premium_variant ) {
     146    $fs = new Freemius( __DIR__ );
     147    $fs->init( $fs_is_premium_variant );
     148
     149    // make sure if even if its the premium version, the license is valid
     150    // then do Prepare cycle
     151    if ( $fs->is_pro() ) {
     152
     153        $prepare = new Prepare();
     154        $prepare->register();
     155    }
     156}
     157
     158/**
     159 * Step 7: Start Plugin
     160 * ######
     161 */
    49162if ( ! class_exists( FrameworkCore::class ) ||
    50163    ! class_exists( Project::class ) ||
    51164    ! class_exists( ServiceContainer::class ) ) {
    52165        return;
    53 }
    54 
    55 global $ig_fs;
    56 
    57 // Freemius logic
    58 if ( isset( $ig_fs ) && $ig_fs ) {
    59     $ig_fs()->set_basename( true, __FILE__ );
    60     //return;
    61 }
    62 
    63 // before any model
    64 $is_pro = false;
    65 
    66 if ( ( defined( 'SALTUS_PLAN' ) && SALTUS_PLAN === 'pro' ) ) {
    67     $fs = new Freemius( __DIR__ );
    68     $fs->load();
    69     $fs->init();
    70     $is_pro = $fs->is_pro();
    71 }
    72 
    73 if ( $is_pro ) {
    74     $prepare = new Prepare();
    75     $prepare->register();
    76166}
    77167
     
    83173$services_container = new ServiceContainer();
    84174
    85 $project = new Project( 'interactive-globes', '1.3.1', __FILE__ );
     175$project = new Project( 'interactive-globes', '1.4.3', __FILE__ );
    86176
    87 /**
    88  * Initialize plugin
    89  */
     177// Initialize plugin
    90178add_action(
    91179    'plugins_loaded',
    92     function () use ( $project, $framework, $feature_container, $services_container, $is_pro ) {
     180    function () use ( $project, $framework, $feature_container, $services_container, $fs, $fs_is_premium_variant ) {
    93181
    94         if ( $is_pro ) {
     182        if ( $fs_is_premium_variant && $fs->is_pro() ) {
    95183            $plugin = new CorePro( $project, $framework, $feature_container, $services_container );
    96184        } else {
     
    102190);
    103191
     192/**
     193 * Step 8: Run Activation cycle
     194 * ######
     195 */
    104196// run as early as possible
    105197register_activation_hook( __FILE__, [ __NAMESPACE__ . '\\Plugin\\Lifecycle', 'activation_actions' ] );
  • interactive-globes/trunk/languages/interactive-globes.pot

    r3158721 r3207680  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Interactive Globes 1.3.0\n"
     5"Project-Id-Version: Interactive Globes 1.4.0\n"
    66"Report-Msgid-Bugs-To: https://saltus.dev/\n"
    7 "POT-Creation-Date: 2024-09-18 22:17:20+00:00\n"
     7"POT-Creation-Date: 2024-11-07 04:19:47+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
     
    2525"X-Generator: grunt-wp-i18n 1.0.3\n"
    2626
     27#: interactive-globes.php:76
     28msgid "The premium version of the plugin has been deactivated to avoid conflicts"
     29msgstr ""
     30
    2731#: src/Features/ClickActions/DisplayContentAbove.php:21
    2832#: src/Features/ClickActions/DisplayContentBelow.php:21
     
    7680msgstr ""
    7781
    78 #: src/Features/CptManager/CptManagerCore.php:67
     82#: src/Features/CptManager/CptManagerCore.php:68
    7983msgid "Add title"
    8084msgstr ""
    8185
    8286#: src/Features/DotLabel/DotLabelProMeta.php:22
    83 #: src/Features/Point/PointProMeta.php:22 src/models/globe-region.php:17
     87#: src/Features/Point/PointProMeta.php:22 src/models/globe-region.php:26
    8488msgid "Default"
    8589msgstr ""
    8690
    8791#: src/Features/DotLabel/DotLabelProMeta.php:29
    88 #: src/models/globe-dotlabel.php:122 src/models/globe-line.php:132
    89 #: src/models/globe-point.php:108 src/models/globe-region.php:173
     92#: src/models/globe-dotlabel.php:138 src/models/globe-line.php:150
     93#: src/models/globe-point.php:133 src/models/globe-region.php:205
    9094msgid "Details"
    9195msgstr ""
    9296
    9397#: src/Features/DotLabel/DotLabelProMeta.php:33
    94 #: src/Features/Point/PointProMeta.php:28 src/models/globe-line.php:198
    95 #: src/models/globe-region.php:203
     98#: src/Features/Point/PointProMeta.php:28 src/models/globe-line.php:258
     99#: src/models/globe-region.php:235
    96100msgid "Customize"
    97101msgstr ""
    98102
    99103#: src/Features/DotLabel/DotLabelProMeta.php:39
    100 #: src/Features/Point/PointProMeta.php:33 src/models/globe-line.php:203
    101 #: src/models/globe-region.php:208
     104#: src/Features/Point/PointProMeta.php:33 src/models/globe-line.php:263
     105#: src/models/globe-region.php:240
    102106msgid "Use Custom Options"
    103107msgstr ""
    104108
    105109#: src/Features/DotLabel/DotLabelProMeta.php:40
    106 #: src/Features/Point/PointProMeta.php:34 src/models/globe-line.php:204
    107 #: src/models/globe-region.php:209
     110#: src/Features/Point/PointProMeta.php:34 src/models/globe-line.php:264
     111#: src/models/globe-region.php:241
    108112msgid "Define custom colors and actions."
    109113msgstr ""
     
    113117#: src/Services/Model/Base/MetaDotLabel.php:105
    114118#: src/Services/Model/Base/MetaPoint.php:104
    115 #: src/Services/Model/Pro/MetaRegions.php:70 src/models/globe-pro.php:143
    116 #: src/models/globe-pro.php:189 src/models/globe-region.php:214
     119#: src/Services/Model/Pro/MetaRegions.php:71 src/models/globe-pro.php:186
     120#: src/models/globe-pro.php:232 src/models/globe-region.php:246
    117121msgid "Click Action"
    118122msgstr ""
     
    122126#: src/Services/Model/Base/MetaDotLabel.php:115
    123127#: src/Services/Model/Base/MetaPoint.php:119
    124 #: src/Services/Model/Pro/MetaLines.php:75 src/models/globe-line.php:255
    125 #: src/models/globe-pro.php:160 src/models/globe-pro.php:199
     128#: src/Services/Model/Pro/MetaLines.php:76 src/models/globe-line.php:315
     129#: src/models/globe-pro.php:203 src/models/globe-pro.php:242
    126130msgid "Altitude"
    127131msgstr ""
    128132
    129133#: src/Features/DotLabel/DotLabelProMeta.php:62
    130 #: src/Services/Model/Base/MetaDotLabel.php:121 src/models/globe-pro.php:206
     134#: src/Services/Model/Base/MetaDotLabel.php:121 src/models/globe-pro.php:249
    131135msgid "Label Size"
    132136msgstr ""
     
    136140#: src/Services/Model/Base/MetaDotLabel.php:125
    137141#: src/Services/Model/Base/MetaPoint.php:123
    138 #: src/Services/Model/Pro/MetaRegions.php:77 src/models/globe-pro.php:165
    139 #: src/models/globe-pro.php:211 src/models/globe-region.php:222
     142#: src/Services/Model/Pro/MetaRegions.php:78 src/models/globe-pro.php:208
     143#: src/models/globe-pro.php:254 src/models/globe-region.php:254
    140144msgid "Fill Color"
    141145msgstr ""
     
    145149#: src/Services/Model/Base/MetaDotLabel.php:130
    146150#: src/Services/Model/Base/MetaPoint.php:128
    147 #: src/Services/Model/Pro/MetaRegions.php:82 src/models/globe-pro.php:171
    148 #: src/models/globe-pro.php:217 src/models/globe-region.php:228
     151#: src/Services/Model/Pro/MetaRegions.php:83 src/models/globe-pro.php:133
     152#: src/models/globe-pro.php:214 src/models/globe-pro.php:260
     153#: src/models/globe-region.php:260
    149154msgid "Hover Color"
    150155msgstr ""
    151156
    152157#: src/Features/DotLabel/DotLabelProMeta.php:78
    153 #: src/Services/Model/Base/MetaDotLabel.php:134 src/models/globe-pro.php:222
     158#: src/Services/Model/Base/MetaDotLabel.php:134 src/models/globe-pro.php:265
    154159msgid "Display Dot"
    155160msgstr ""
    156161
    157162#: src/Features/DotLabel/DotLabelProMeta.php:79
    158 #: src/Services/Model/Base/MetaDotLabel.php:135 src/models/globe-pro.php:223
     163#: src/Services/Model/Base/MetaDotLabel.php:135 src/models/globe-pro.php:266
    159164msgid ""
    160165"Display a dot marker next to the text indicating the exact coordinates of "
     
    163168
    164169#: src/Features/DotLabel/DotLabelProMeta.php:88
    165 #: src/Services/Model/Base/MetaDotLabel.php:143 src/models/globe-pro.php:232
     170#: src/Services/Model/Base/MetaDotLabel.php:143 src/models/globe-pro.php:275
    166171msgid "Dot Radius"
    167172msgstr ""
    168173
    169174#: src/Features/DotLabel/DotLabelProMeta.php:95
    170 #: src/Services/Model/Base/MetaDotLabel.php:151 src/models/globe-pro.php:239
     175#: src/Services/Model/Base/MetaDotLabel.php:151
     176#: src/Services/Model/Pro/MetaSearch.php:33 src/models/globe-pro.php:282
    171177msgid "Bottom"
    172178msgstr ""
    173179
    174180#: src/Features/DotLabel/DotLabelProMeta.php:96
    175 #: src/Services/Model/Base/MetaDotLabel.php:152 src/models/globe-pro.php:240
     181#: src/Services/Model/Base/MetaDotLabel.php:152
     182#: src/Services/Model/Pro/MetaSearch.php:32 src/models/globe-pro.php:283
    176183msgid "Top"
    177184msgstr ""
    178185
    179186#: src/Features/DotLabel/DotLabelProMeta.php:97
    180 #: src/Services/Model/Base/MetaDotLabel.php:153 src/models/globe-pro.php:241
     187#: src/Services/Model/Base/MetaDotLabel.php:153 src/models/globe-pro.php:284
    181188msgid "Right"
    182189msgstr ""
    183190
    184191#: src/Features/DotLabel/DotLabelProMeta.php:99
    185 #: src/Services/Model/Base/MetaDotLabel.php:155 src/models/globe-pro.php:243
     192#: src/Services/Model/Base/MetaDotLabel.php:155 src/models/globe-pro.php:286
    186193msgid "Dot Orientation"
    187194msgstr ""
     
    202209
    203210#: src/Features/Point/PointProMeta.php:49
    204 #: src/Services/Model/Base/MetaPoint.php:113 src/models/globe-pro.php:153
     211#: src/Services/Model/Base/MetaPoint.php:113 src/models/globe-pro.php:196
    205212msgid "Radius"
    206213msgstr ""
     
    210217msgstr ""
    211218
    212 #: src/Plugin/Assets.php:218
     219#: src/Plugin/Assets.php:225
    213220msgid "New center saved"
    214221msgstr ""
    215222
    216 #: src/Plugin/Assets.php:219
     223#: src/Plugin/Assets.php:226
    217224msgid "Set initial center"
    218225msgstr ""
    219226
    220 #: src/Plugin/Freemius.php:89 src/Plugin/Freemius.php:100
    221 msgid "You do not have permission to edit this globe."
    222 msgstr ""
    223 
    224 #: src/Services/Model/Base/Features.php:12 src/models/globe-pro.php:22
     227#: src/Plugin/Freemius.php:106
     228msgid "Error"
     229msgstr ""
     230
     231#: src/Plugin/Freemius.php:107
     232msgid "Your license does not have permission to use this premium feature."
     233msgstr ""
     234
     235#: src/Plugin/Freemius.php:109
     236msgid "Return Home"
     237msgstr ""
     238
     239#: src/Plugin/Freemius.php:118 src/Plugin/Freemius.php:132
     240msgid "Interactive Globes - Error"
     241msgstr ""
     242
     243#: src/Plugin/Freemius.php:163
     244msgid ""
     245"You are on the Interactive Globes Free plan. To activate your license, set "
     246"it here: <a "
     247"onclick=\"document.querySelector('.fs-modal.fs-modal-license-activation-"
     248"interactive-globes').classList.add('active');\" "
     249"id=\"igfs-show-license-box\" href=\"#\">Activate license</a>,"
     250msgstr ""
     251
     252#: src/Services/Model/Base/Features.php:12 src/models/globe-pro.php:30
    225253msgid "Download Globe Export File"
    226254msgstr ""
    227255
    228 #: src/Services/Model/Base/Features.php:21 src/models/globe-pro.php:31
     256#: src/Services/Model/Base/Features.php:21 src/models/globe-pro.php:39
    229257msgid "Shortcode"
    230258msgstr ""
     
    239267msgstr ""
    240268
    241 #: src/Services/Model/Base/Labels.php:21 src/models/globe-dotlabel.php:48
    242 #: src/models/globe-line.php:51 src/models/globe-point.php:33
    243 #: src/models/globe-region.php:99
     269#: src/Services/Model/Base/Labels.php:21 src/models/globe-dotlabel.php:64
     270#: src/models/globe-line.php:73 src/models/globe-point.php:58
     271#: src/models/globe-region.php:131
    244272msgid "Create New"
    245273msgstr ""
     
    337365msgstr ""
    338366
    339 #: src/Services/Model/Base/Labels.php:48 src/models/globe-dotlabel.php:75
    340 #: src/models/globe-line.php:82 src/models/globe-point.php:60
    341 #: src/models/globe-region.php:126
     367#: src/Services/Model/Base/Labels.php:48 src/models/globe-dotlabel.php:91
     368#: src/models/globe-line.php:100 src/models/globe-point.php:85
     369#: src/models/globe-region.php:158
    342370msgid "Custom field updated"
    343371msgstr ""
    344372
    345 #: src/Services/Model/Base/Labels.php:49 src/models/globe-dotlabel.php:76
    346 #: src/models/globe-line.php:83 src/models/globe-point.php:61
    347 #: src/models/globe-region.php:127
     373#: src/Services/Model/Base/Labels.php:49 src/models/globe-dotlabel.php:92
     374#: src/models/globe-line.php:101 src/models/globe-point.php:86
     375#: src/models/globe-region.php:159
    348376msgid "Custom field deleted"
    349377msgstr ""
     
    450478
    451479#: src/Services/Model/Base/Meta.php:119
     480#: src/Services/Model/Pro/MetaLines.php:100
    452481msgid "Enabled"
    453482msgstr ""
    454483
    455484#: src/Services/Model/Base/Meta.php:124
     485#: src/Services/Model/Pro/PluginSettings.php:104 src/models/globe-pro.php:128
    456486msgid "Color"
    457487msgstr ""
     
    505535#: src/Services/Model/Base/Meta.php:166
    506536#: src/Services/Model/Base/MetaDotLabel.php:63
    507 #: src/Services/Model/Base/MetaPoint.php:63 src/models/globe-dotlabel.php:148
    508 #: src/models/globe-line.php:183 src/models/globe-point.php:134
     537#: src/Services/Model/Base/MetaPoint.php:63 src/models/globe-dotlabel.php:164
     538#: src/models/globe-line.php:211 src/models/globe-point.php:159
    509539msgid "Latitude"
    510540msgstr ""
     
    512542#: src/Services/Model/Base/Meta.php:173
    513543#: src/Services/Model/Base/MetaDotLabel.php:69
    514 #: src/Services/Model/Base/MetaPoint.php:69 src/models/globe-dotlabel.php:155
    515 #: src/models/globe-line.php:188 src/models/globe-point.php:141
     544#: src/Services/Model/Base/MetaPoint.php:69 src/models/globe-dotlabel.php:171
     545#: src/models/globe-line.php:216 src/models/globe-point.php:166
    516546msgid "Longitude"
    517547msgstr ""
     
    585615msgstr ""
    586616
    587 #: src/Services/Model/Base/MetaDotLabel.php:21 src/models/globe-dotlabel.php:44
    588 #: src/models/globe-dotlabel.php:46 src/models/globe-dotlabel.php:47
    589 #: src/models/globe-dotlabel.php:58
     617#: src/Services/Model/Base/MetaDotLabel.php:21 src/models/globe-dotlabel.php:60
     618#: src/models/globe-dotlabel.php:62 src/models/globe-dotlabel.php:63
     619#: src/models/globe-dotlabel.php:74
    590620msgid "Dot Labels"
    591621msgstr ""
     
    603633
    604634#: src/Services/Model/Base/MetaDotLabel.php:51
    605 #: src/Services/Model/Base/MetaPoint.php:51 src/models/globe-dotlabel.php:126
    606 #: src/models/globe-point.php:112
     635#: src/Services/Model/Base/MetaPoint.php:51 src/models/globe-dotlabel.php:142
     636#: src/models/globe-point.php:137
    607637msgid "Coordinates"
    608638msgstr ""
    609639
    610640#: src/Services/Model/Base/MetaDotLabel.php:78
    611 #: src/Services/Model/Base/MetaPoint.php:78 src/models/globe-dotlabel.php:169
    612 #: src/models/globe-point.php:155 src/models/globe-region.php:193
     641#: src/Services/Model/Base/MetaPoint.php:78 src/models/globe-dotlabel.php:185
     642#: src/models/globe-point.php:180 src/models/globe-region.php:225
    613643msgid "Tooltip Content"
    614644msgstr ""
    615645
    616646#: src/Services/Model/Base/MetaDotLabel.php:82
    617 #: src/Services/Model/Base/MetaPoint.php:82 src/models/globe-dotlabel.php:173
    618 #: src/models/globe-point.php:159 src/models/globe-region.php:197
     647#: src/Services/Model/Base/MetaPoint.php:82 src/models/globe-dotlabel.php:189
     648#: src/models/globe-point.php:184 src/models/globe-region.php:229
    619649msgid "Action Content"
    620650msgstr ""
    621651
    622652#: src/Services/Model/Base/MetaDotLabel.php:83
    623 #: src/Services/Model/Base/MetaPoint.php:83 src/models/globe-dotlabel.php:174
    624 #: src/models/globe-point.php:160 src/models/globe-region.php:198
     653#: src/Services/Model/Base/MetaPoint.php:83 src/models/globe-dotlabel.php:190
     654#: src/models/globe-point.php:185 src/models/globe-region.php:230
    625655msgid "URL or content to trigger when marker is clicked."
    626656msgstr ""
    627657
    628658#: src/Services/Model/Base/MetaDotLabel.php:83
    629 #: src/Services/Model/Base/MetaPoint.php:83 src/models/globe-region.php:198
     659#: src/Services/Model/Base/MetaPoint.php:83 src/models/globe-region.php:230
    630660msgid "Don't forget to select a click action below."
    631661msgstr ""
     
    633663#: src/Services/Model/Base/MetaDotLabel.php:99
    634664#: src/Services/Model/Base/MetaPoint.php:99
    635 #: src/Services/Model/Pro/MetaRegions.php:64
     665#: src/Services/Model/Pro/MetaRegions.php:65
    636666msgid "Default values"
    637667msgstr ""
     
    649679msgstr ""
    650680
    651 #: src/Services/Model/Base/MetaPoint.php:21 src/models/globe-point.php:29
    652 #: src/models/globe-point.php:31 src/models/globe-point.php:32
    653 #: src/models/globe-point.php:43
     681#: src/Services/Model/Base/MetaPoint.php:21 src/models/globe-point.php:54
     682#: src/models/globe-point.php:56 src/models/globe-point.php:57
     683#: src/models/globe-point.php:68
    654684msgid "Points"
    655685msgstr ""
     
    690720msgstr ""
    691721
    692 #: src/Services/Model/Pro/MetaDotLabel.php:12
     722#: src/Services/Model/Pro/MetaDotLabel.php:15
    693723msgid "PTSerif Regular (~130kb)"
    694724msgstr ""
    695725
    696 #: src/Services/Model/Pro/MetaLines.php:16
     726#: src/Services/Model/Pro/MetaDotLabel.php:25
     727#: src/Services/Model/Pro/MetaPoint.php:15
     728#: src/Services/Model/Pro/MetaRegions.php:95
     729#: src/Services/Model/Pro/MetaTooltip.php:98
     730msgid "Tooltip Template"
     731msgstr ""
     732
     733#: src/Services/Model/Pro/MetaDotLabel.php:27
     734#: src/Services/Model/Pro/MetaPoint.php:17
     735msgid ""
     736"Override default tooltip template. You can use placeholders with curly "
     737"brackets like {title} that exist in your data source.<br>Default value is "
     738"{tooltipContent}."
     739msgstr ""
     740
     741#: src/Services/Model/Pro/MetaLayers.php:12
     742msgid "Data Layers & Filters"
     743msgstr ""
     744
     745#: src/Services/Model/Pro/MetaLayers.php:18
     746msgid "Load data from other globes."
     747msgstr ""
     748
     749#: src/Services/Model/Pro/MetaLayers.php:21
     750msgid "Select Globes"
     751msgstr ""
     752
     753#: src/Services/Model/Pro/MetaLayers.php:22
     754msgid ""
     755"Select globes you want to load data from.<br>You can sort the options using "
     756"drag&drop to change their order."
     757msgstr ""
     758
     759#: src/Services/Model/Pro/MetaLayers.php:43
     760msgid "Live Filter"
     761msgstr ""
     762
     763#: src/Services/Model/Pro/MetaLayers.php:44
     764msgid "Display a live filter to show/hide data in the globe."
     765msgstr ""
     766
     767#: src/Services/Model/Pro/MetaLayers.php:48
     768#: src/Services/Model/Pro/PluginSettings.php:162
     769#. translators: field type = input type (textarea, rich text editor...)
     770msgid "Enable"
     771msgstr ""
     772
     773#: src/Services/Model/Pro/MetaLayers.php:53
     774#: src/Services/Model/Pro/MetaRegions.php:30 src/models/globe-line.php:156
     775msgid "Type"
     776msgstr ""
     777
     778#: src/Services/Model/Pro/MetaLayers.php:57
     779msgid "Filter Menu"
     780msgstr ""
     781
     782#: src/Services/Model/Pro/MetaLayers.php:58
     783msgid "Dropdown Filter"
     784msgstr ""
     785
     786#: src/Services/Model/Pro/MetaLayers.php:59
     787msgid "Filter Menu & Dropdown on Mobile"
     788msgstr ""
     789
     790#: src/Services/Model/Pro/MetaLayers.php:60
     791msgid "Toggle Menu"
     792msgstr ""
     793
     794#: src/Services/Model/Pro/MetaLayers.php:65
     795#: src/Services/Model/Pro/MetaSearch.php:30
     796msgid "Position"
     797msgstr ""
     798
     799#: src/Services/Model/Pro/MetaLayers.php:69
     800msgid "Above"
     801msgstr ""
     802
     803#: src/Services/Model/Pro/MetaLayers.php:70
     804msgid "Below"
     805msgstr ""
     806
     807#: src/Services/Model/Pro/MetaLayers.php:75
     808msgid "Label for \"All\""
     809msgstr ""
     810
     811#: src/Services/Model/Pro/MetaLayers.php:77
     812msgid "Leave blank if you don't want the option to display."
     813msgstr ""
     814
     815#: src/Services/Model/Pro/MetaLayers.php:81
     816msgid "Display by default"
     817msgstr ""
     818
     819#: src/Services/Model/Pro/MetaLayers.php:82
     820msgid ""
     821"Display the data from this globe by default and hide all the others. Select "
     822"the current globe if you want all to display by default."
     823msgstr ""
     824
     825#: src/Services/Model/Pro/MetaLayers.php:94
     826msgid "Keep Base Map"
     827msgstr ""
     828
     829#: src/Services/Model/Pro/MetaLayers.php:95
     830msgid "Set the data from this base globe always be visible."
     831msgstr ""
     832
     833#: src/Services/Model/Pro/MetaLayers.php:101
     834msgid ""
     835"The menu order will be the same as the layers order above. You can "
     836"drag&drop the items to rearrange them."
     837msgstr ""
     838
     839#: src/Services/Model/Pro/MetaLines.php:17
    697840msgid "Arc Lines"
    698841msgstr ""
    699842
    700 #: src/Services/Model/Pro/MetaLines.php:24
     843#: src/Services/Model/Pro/MetaLines.php:25
    701844msgid "Add New Line"
    702845msgstr ""
    703846
    704 #: src/Services/Model/Pro/MetaLines.php:29
    705 #: src/Services/Model/Pro/PluginSettings.php:61 src/models/globe-pro.php:90
     847#: src/Services/Model/Pro/MetaLines.php:30
     848#: src/Services/Model/Pro/PluginSettings.php:75 src/models/globe-pro.php:98
    706849msgid "Defaults"
    707850msgstr ""
    708851
    709 #: src/Services/Model/Pro/MetaLines.php:33
     852#: src/Services/Model/Pro/MetaLines.php:34
    710853msgid "Arc Line Color"
    711854msgstr ""
    712855
    713 #: src/Services/Model/Pro/MetaLines.php:45 src/models/globe-line.php:222
     856#: src/Services/Model/Pro/MetaLines.php:46 src/models/globe-line.php:282
    714857msgid "Line Dash"
    715858msgstr ""
    716859
    717 #: src/Services/Model/Pro/MetaLines.php:46 src/models/globe-line.php:223
     860#: src/Services/Model/Pro/MetaLines.php:47 src/models/globe-line.php:283
    718861msgid ""
    719862"The length of the dashed segments in the arc, in terms of relative line "
     
    721864msgstr ""
    722865
    723 #: src/Services/Model/Pro/MetaLines.php:57 src/models/globe-line.php:235
     866#: src/Services/Model/Pro/MetaLines.php:58 src/models/globe-line.php:295
    724867msgid "Line Dash Gap"
    725868msgstr ""
    726869
    727 #: src/Services/Model/Pro/MetaLines.php:58 src/models/globe-line.php:236
     870#: src/Services/Model/Pro/MetaLines.php:59 src/models/globe-line.php:296
    728871msgid ""
    729872"The length of the gap between dash segments, in terms of relative line "
     
    731874msgstr ""
    732875
    733 #: src/Services/Model/Pro/MetaLines.php:63 src/models/globe-line.php:242
     876#: src/Services/Model/Pro/MetaLines.php:64 src/models/globe-line.php:302
    734877msgid "Line Width"
    735878msgstr ""
    736879
    737 #: src/Services/Model/Pro/MetaLines.php:64 src/models/globe-line.php:243
     880#: src/Services/Model/Pro/MetaLines.php:65 src/models/globe-line.php:303
    738881msgid "The line’s diameter, in angular degrees"
    739882msgstr ""
    740883
    741 #: src/Services/Model/Pro/MetaLines.php:76 src/models/globe-line.php:256
     884#: src/Services/Model/Pro/MetaLines.php:77 src/models/globe-line.php:316
    742885msgid ""
    743886"The arc’s maximum altitude, ocurring at the half-way distance between the "
     
    745888msgstr ""
    746889
    747 #: src/Services/Model/Pro/MetaLines.php:81 src/models/globe-line.php:268
     890#: src/Services/Model/Pro/MetaLines.php:82 src/models/globe-line.php:328
    748891msgid ""
    749892"Time duration (in seconds) to animate the motion of dash positions from the "
     
    753896msgstr ""
    754897
    755 #: src/Services/Model/Pro/MetaLines.php:87 src/models/globe-line.php:267
     898#: src/Services/Model/Pro/MetaLines.php:88 src/models/globe-line.php:327
    756899msgid "Animation speed"
    757900msgstr ""
    758901
    759 #: src/Services/Model/Pro/MetaRegions.php:19
     902#: src/Services/Model/Pro/MetaLines.php:94
     903msgid "Connect Points"
     904msgstr ""
     905
     906#: src/Services/Model/Pro/MetaLines.php:95
     907msgid "Connect points or dot labels to a specific point or dot label"
     908msgstr ""
     909
     910#: src/Services/Model/Pro/MetaLines.php:104
     911msgid "Connection Rules"
     912msgstr ""
     913
     914#: src/Services/Model/Pro/MetaLines.php:108
     915msgid "Connection Rule"
     916msgstr ""
     917
     918#: src/Services/Model/Pro/MetaLines.php:110
     919msgid "Connect all points to/from"
     920msgstr ""
     921
     922#: src/Services/Model/Pro/MetaLines.php:111
     923msgid "Connect all dotLabels to/from"
     924msgstr ""
     925
     926#: src/Services/Model/Pro/MetaLines.php:117
     927msgid "Connection Type"
     928msgstr ""
     929
     930#: src/Services/Model/Pro/MetaLines.php:119
     931msgid "Source"
     932msgstr ""
     933
     934#: src/Services/Model/Pro/MetaLines.php:120
     935msgid "Destination"
     936msgstr ""
     937
     938#: src/Services/Model/Pro/MetaLines.php:126
     939msgid "Target Point"
     940msgstr ""
     941
     942#: src/Services/Model/Pro/MetaLines.php:127
     943msgid ""
     944"Select the point to connect to/from. Currently only points created manually "
     945"are supported."
     946msgstr ""
     947
     948#: src/Services/Model/Pro/MetaLines.php:144
     949msgid "Target Dot Label"
     950msgstr ""
     951
     952#: src/Services/Model/Pro/MetaRegions.php:20
    760953msgid "Regions Layer"
    761954msgstr ""
    762955
    763 #: src/Services/Model/Pro/MetaRegions.php:25
     956#: src/Services/Model/Pro/MetaRegions.php:26
    764957msgid "Load a layer with region/country shapes and add interactivity to them."
    765958msgstr ""
    766959
    767 #: src/Services/Model/Pro/MetaRegions.php:29
    768 msgid "Type"
    769 msgstr ""
    770 
    771 #: src/Services/Model/Pro/MetaRegions.php:31
     960#: src/Services/Model/Pro/MetaRegions.php:32
    772961msgid "Disabled"
    773962msgstr ""
    774963
    775 #: src/Services/Model/Pro/MetaRegions.php:32
     964#: src/Services/Model/Pro/MetaRegions.php:33
    776965msgid "Continents"
    777966msgstr ""
    778967
    779 #: src/Services/Model/Pro/MetaRegions.php:33
     968#: src/Services/Model/Pro/MetaRegions.php:34
    780969msgid "Countries"
    781970msgstr ""
    782971
    783 #: src/Services/Model/Pro/MetaRegions.php:34
     972#: src/Services/Model/Pro/MetaRegions.php:35
    784973msgid "Countries (Morocco)"
    785974msgstr ""
    786975
    787 #: src/Services/Model/Pro/MetaRegions.php:35
     976#: src/Services/Model/Pro/MetaRegions.php:36
    788977msgid "Countries (India)"
    789978msgstr ""
    790979
    791 #: src/Services/Model/Pro/MetaRegions.php:36
     980#: src/Services/Model/Pro/MetaRegions.php:37
    792981msgid "Countries (China)"
    793982msgstr ""
    794983
    795 #: src/Services/Model/Pro/MetaRegions.php:37
     984#: src/Services/Model/Pro/MetaRegions.php:38
    796985msgid "Countries (Russia)"
    797986msgstr ""
    798987
    799 #: src/Services/Model/Pro/MetaRegions.php:38
     988#: src/Services/Model/Pro/MetaRegions.php:39
    800989msgid "Outline"
    801990msgstr ""
    802991
    803 #: src/Services/Model/Pro/MetaRegions.php:44
     992#: src/Services/Model/Pro/MetaRegions.php:40
     993msgid "Custom Source"
     994msgstr ""
     995
     996#: src/Services/Model/Pro/MetaRegions.php:45
    804997msgid "Custom GEOJSON Url"
    805998msgstr ""
    806999
    807 #: src/Services/Model/Pro/MetaRegions.php:49
     1000#: src/Services/Model/Pro/MetaRegions.php:50
    8081001msgid ""
    8091002"Click the \"Add New Region Interactivity\" button below to start adding "
     
    8111004msgstr ""
    8121005
    813 #: src/Services/Model/Pro/MetaRegions.php:59
     1006#: src/Services/Model/Pro/MetaRegions.php:60
    8141007msgid "Add New Region Interactivity"
    8151008msgstr ""
    8161009
    817 #: src/Services/Model/Pro/MetaRegions.php:87
     1010#: src/Services/Model/Pro/MetaRegions.php:88
    8181011msgid "Inactive Regions Color"
    8191012msgstr ""
    8201013
     1014#: src/Services/Model/Pro/MetaRegions.php:97
     1015msgid ""
     1016"Override default tooltip template. You can use placeholders with curly "
     1017"brackets like {name} that exist in your data source.<br>Default value is "
     1018"{tooltipContent}."
     1019msgstr ""
     1020
    8211021#: src/Services/Model/Pro/MetaRotate.php:14
    822 #: src/Services/Model/Pro/MetaRotate.php:20 src/models/globe-pro.php:252
    823 #: src/models/globe-pro.php:258
     1022#: src/Services/Model/Pro/MetaRotate.php:20 src/models/globe-pro.php:295
     1023#: src/models/globe-pro.php:301
    8241024#. translators: legend refers to a caption or visual element explaining colours
    8251025#. on map
     
    8281028
    8291029#: src/Services/Model/Pro/MetaRotate.php:15
    830 #: src/Services/Model/Pro/MetaRotate.php:21 src/models/globe-pro.php:253
    831 #: src/models/globe-pro.php:259
     1030#: src/Services/Model/Pro/MetaRotate.php:21 src/models/globe-pro.php:296
     1031#: src/models/globe-pro.php:302
    8321032msgid "Rotate animation"
    8331033msgstr ""
    8341034
    835 #: src/Services/Model/Pro/MetaRotate.php:28 src/models/globe-pro.php:266
     1035#: src/Services/Model/Pro/MetaRotate.php:28 src/models/globe-pro.php:309
    8361036msgid "Speed"
    8371037msgstr ""
    8381038
    839 #: src/Services/Model/Pro/MetaTooltip.php:12
     1039#: src/Services/Model/Pro/MetaSearch.php:12
     1040msgid "External Controls"
     1041msgstr ""
     1042
     1043#: src/Services/Model/Pro/MetaSearch.php:21
     1044msgid "Autocomplete Search Dropdown"
     1045msgstr ""
     1046
     1047#: src/Services/Model/Pro/MetaSearch.php:25
     1048msgid "Enable Search Dropdown"
     1049msgstr ""
     1050
     1051#: src/Services/Model/Pro/MetaSearch.php:40
     1052msgid "Mobile Only"
     1053msgstr ""
     1054
     1055#: src/Services/Model/Pro/MetaSearch.php:46
     1056msgid "Use Choices.js"
     1057msgstr ""
     1058
     1059#: src/Services/Model/Pro/MetaSearch.php:47
     1060msgid ""
     1061"Use Choices.js for the search dropdown. This will allow you to use a custom "
     1062"search input and dropdown styling. <br>When disabled the it will display a "
     1063"simple select dropdown with no search."
     1064msgstr ""
     1065
     1066#: src/Services/Model/Pro/MetaSearch.php:53
     1067msgid "Placeholder Text"
     1068msgstr ""
     1069
     1070#: src/Services/Model/Pro/MetaSearch.php:54
     1071msgid "Search..."
     1072msgstr ""
     1073
     1074#: src/Services/Model/Pro/MetaSearch.php:59
     1075msgid "No Matches Text"
     1076msgstr ""
     1077
     1078#: src/Services/Model/Pro/MetaSearch.php:60
     1079msgid "No matches found"
     1080msgstr ""
     1081
     1082#: src/Services/Model/Pro/MetaSearch.php:65
     1083msgid "Select Text"
     1084msgstr ""
     1085
     1086#: src/Services/Model/Pro/MetaSearch.php:66
     1087msgid "Select"
     1088msgstr ""
     1089
     1090#: src/Services/Model/Pro/MetaSearch.php:71
     1091msgid "Label Property"
     1092msgstr ""
     1093
     1094#: src/Services/Model/Pro/MetaSearch.php:72
     1095msgid ""
     1096"The property of the data object to use as the label for the search "
     1097"dropdown. Default: \"title\""
     1098msgstr ""
     1099
     1100#: src/Services/Model/Pro/MetaSearch.php:78
     1101msgid "Properties to search"
     1102msgstr ""
     1103
     1104#: src/Services/Model/Pro/MetaSearch.php:79
     1105msgid ""
     1106"The properties of the data object to include in search for in the search "
     1107"dropdown. It will search for the label property by default already. You can "
     1108"add multiple properties by separating them with a comma."
     1109msgstr ""
     1110
     1111#: src/Services/Model/Pro/MetaTooltip.php:16
    8401112msgid "Tooltip"
    8411113msgstr ""
    8421114
    843 #: src/Services/Model/Pro/MetaTooltip.php:21
    844 msgid "Tooltip Settings"
    845 msgstr ""
    846 
    8471115#: src/Services/Model/Pro/MetaTooltip.php:25
     1116msgid "Tooltip Visual Settings"
     1117msgstr ""
     1118
     1119#: src/Services/Model/Pro/MetaTooltip.php:29
    8481120msgid "Background color"
    8491121msgstr ""
    8501122
    851 #: src/Services/Model/Pro/MetaTooltip.php:30
     1123#: src/Services/Model/Pro/MetaTooltip.php:34
    8521124msgid "Font Family"
    8531125msgstr ""
    8541126
    855 #: src/Services/Model/Pro/MetaTooltip.php:35
     1127#: src/Services/Model/Pro/MetaTooltip.php:39
    8561128msgid "Font Settings"
    8571129msgstr ""
    8581130
    859 #: src/Services/Model/Pro/MetaTooltip.php:49
     1131#: src/Services/Model/Pro/MetaTooltip.php:53
    8601132msgid "Corner radius"
    8611133msgstr ""
    8621134
    863 #: src/Services/Model/Pro/MetaTooltip.php:56
     1135#: src/Services/Model/Pro/MetaTooltip.php:60
    8641136msgid "Border"
    8651137msgstr ""
    8661138
    867 #: src/Services/Model/Pro/MetaTooltip.php:70
     1139#: src/Services/Model/Pro/MetaTooltip.php:74
    8681140msgid "Padding"
    8691141msgstr ""
    8701142
    871 #: src/Services/Model/Pro/MetaTooltip.php:78
     1143#: src/Services/Model/Pro/MetaTooltip.php:82
    8721144msgid "Tooltip padding"
    8731145msgstr ""
    8741146
    875 #: src/Services/Model/Pro/MetaTooltip.php:82
     1147#: src/Services/Model/Pro/MetaTooltip.php:86
    8761148msgid "Maximum Width"
    8771149msgstr ""
    8781150
    879 #: src/Services/Model/Pro/MetaTooltip.php:86
     1151#: src/Services/Model/Pro/MetaTooltip.php:90
    8801152msgid "Leave it blank if you want the tooltip to calculate the size automatically."
    8811153msgstr ""
    8821154
    883 #: src/Services/Model/Pro/PluginSettings.php:13 src/models/globe-pro.php:45
     1155#: src/Services/Model/Pro/MetaTooltip.php:100
     1156msgid ""
     1157"You can use placeholders with curly brackets {} that exist in your data "
     1158"source.<br>Default value is {tooltipContent}."
     1159msgstr ""
     1160
     1161#: src/Services/Model/Pro/MetaTooltip.php:104
     1162msgid "Only active regions"
     1163msgstr ""
     1164
     1165#: src/Services/Model/Pro/MetaTooltip.php:106
     1166msgid "Only display tooltip on entries with data (regions added manually)."
     1167msgstr ""
     1168
     1169#: src/Services/Model/Pro/PluginSettings.php:13 src/models/globe-pro.php:53
    8841170msgid "Plugin Settings"
    8851171msgstr ""
    8861172
    887 #: src/Services/Model/Pro/PluginSettings.php:15 src/models/globe-pro.php:47
     1173#: src/Services/Model/Pro/PluginSettings.php:15 src/models/globe-pro.php:55
    8881174msgid "Settings"
    8891175msgstr ""
    8901176
    891 #: src/Services/Model/Pro/PluginSettings.php:21 src/models/globe-pro.php:50
     1177#: src/Services/Model/Pro/PluginSettings.php:21 src/models/globe-pro.php:58
    8921178msgid "Editing"
    8931179msgstr ""
    8941180
    895 #: src/Services/Model/Pro/PluginSettings.php:22 src/models/globe-pro.php:51
     1181#: src/Services/Model/Pro/PluginSettings.php:22 src/models/globe-pro.php:59
    8961182msgid "Edit screen settings"
    8971183msgstr ""
    8981184
    899 #: src/Services/Model/Pro/PluginSettings.php:27 src/models/globe-pro.php:56
     1185#: src/Services/Model/Pro/PluginSettings.php:27 src/models/globe-pro.php:64
    9001186msgid "Use OpenStreeMap"
    9011187msgstr ""
    9021188
    903 #: src/Services/Model/Pro/PluginSettings.php:28 src/models/globe-pro.php:57
     1189#: src/Services/Model/Pro/PluginSettings.php:28 src/models/globe-pro.php:65
    9041190msgid ""
    9051191"If you want to select the coordinates using a visual map with search "
     
    9121198msgstr ""
    9131199
    914 #: src/Services/Model/Pro/PluginSettings.php:34 src/models/globe-pro.php:63
     1200#: src/Services/Model/Pro/PluginSettings.php:34 src/models/globe-pro.php:71
    9151201#. translators: field type = input type (textarea, rich text editor...)
    9161202msgid "Tooltip field type"
     
    9181204
    9191205#: src/Services/Model/Pro/PluginSettings.php:35
    920 #: src/Services/Model/Pro/PluginSettings.php:49 src/models/globe-pro.php:64
    921 #: src/models/globe-pro.php:78
    922 msgid ""
    923 "Type of field to use to edit the tooltip content. <br> When using the Rich "
    924 "Text Editor, if you have a lot of entries, you might come across the \"<a "
    925 "href='https://interactivegeomaps.com/docs/max-input-vars-issue/' "
    926 "target='_blank'>Too much data\" issue</a>."
     1206#: src/Services/Model/Pro/PluginSettings.php:49 src/models/globe-pro.php:72
     1207#: src/models/globe-pro.php:86
     1208msgid "Type of field to use to edit the tooltip content."
    9271209msgstr ""
    9281210
    9291211#: src/Services/Model/Pro/PluginSettings.php:38
    930 #: src/Services/Model/Pro/PluginSettings.php:52 src/models/globe-pro.php:67
    931 #: src/models/globe-pro.php:81
     1212#: src/Services/Model/Pro/PluginSettings.php:52
     1213#: src/Services/Model/Pro/PluginSettings.php:66 src/models/globe-pro.php:75
     1214#: src/models/globe-pro.php:89
    9321215msgid "Textarea"
    9331216msgstr ""
    9341217
    9351218#: src/Services/Model/Pro/PluginSettings.php:40
    936 #: src/Services/Model/Pro/PluginSettings.php:54 src/models/globe-pro.php:69
    937 #: src/models/globe-pro.php:83
     1219#: src/Services/Model/Pro/PluginSettings.php:54
     1220#: src/Services/Model/Pro/PluginSettings.php:68 src/models/globe-pro.php:77
     1221#: src/models/globe-pro.php:91
    9381222#. translators: equivalent to classic editor in a way
    9391223msgid "WP Rich Text Editor"
     
    9411225
    9421226#: src/Services/Model/Pro/PluginSettings.php:41
    943 #: src/Services/Model/Pro/PluginSettings.php:55 src/models/globe-pro.php:70
    944 #: src/models/globe-pro.php:84
     1227#: src/Services/Model/Pro/PluginSettings.php:55
     1228#: src/Services/Model/Pro/PluginSettings.php:69 src/models/globe-pro.php:78
     1229#: src/models/globe-pro.php:92
    9451230msgid "Text Input"
    9461231msgstr ""
    9471232
    948 #: src/Services/Model/Pro/PluginSettings.php:48 src/models/globe-pro.php:77
     1233#: src/Services/Model/Pro/PluginSettings.php:48 src/models/globe-pro.php:85
    9491234#. translators: field type = input type (textarea, rich text editor...)
    9501235msgid "Action Content field type"
    9511236msgstr ""
    9521237
    953 #: src/Services/Model/Pro/PluginSettings.php:67 src/models/globe-pro.php:96
     1238#: src/Services/Model/Pro/PluginSettings.php:62
     1239#. translators: field type = input type (textarea, rich text editor...)
     1240msgid "Templates field type"
     1241msgstr ""
     1242
     1243#: src/Services/Model/Pro/PluginSettings.php:63
     1244msgid "Type of field to use to edit the tooltip and action content templates."
     1245msgstr ""
     1246
     1247#: src/Services/Model/Pro/PluginSettings.php:81 src/models/globe-pro.php:104
    9541248msgid "Default Active Colour"
    9551249msgstr ""
    9561250
    957 #: src/Services/Model/Pro/PluginSettings.php:68 src/models/globe-pro.php:97
     1251#: src/Services/Model/Pro/PluginSettings.php:82 src/models/globe-pro.php:105
    9581252msgid ""
    9591253"Set the default colour for the active colour field, when you create new "
     
    9611255msgstr ""
    9621256
    963 #: src/Services/Model/Pro/PluginSettings.php:74 src/models/globe-pro.php:103
     1257#: src/Services/Model/Pro/PluginSettings.php:88 src/models/globe-pro.php:111
    9641258msgid "Default Hover Colour"
    9651259msgstr ""
    9661260
    967 #: src/Services/Model/Pro/PluginSettings.php:75 src/models/globe-pro.php:104
     1261#: src/Services/Model/Pro/PluginSettings.php:89 src/models/globe-pro.php:112
    9681262msgid "Set the default colour for the hover colour field, when you create new maps."
    9691263msgstr ""
    9701264
    971 #: src/Services/Model/Pro/PluginSettings.php:81 src/models/globe-pro.php:110
     1265#: src/Services/Model/Pro/PluginSettings.php:94 src/models/globe-pro.php:118
     1266msgid "Visuals"
     1267msgstr ""
     1268
     1269#: src/Services/Model/Pro/PluginSettings.php:99 src/models/globe-pro.php:123
     1270msgid "Filter Menu Styles"
     1271msgstr ""
     1272
     1273#: src/Services/Model/Pro/PluginSettings.php:100 src/models/globe-pro.php:124
     1274msgid "Customize the styles of the filter menu."
     1275msgstr ""
     1276
     1277#: src/Services/Model/Pro/PluginSettings.php:116
     1278msgid "Text Color"
     1279msgstr ""
     1280
     1281#: src/Services/Model/Pro/PluginSettings.php:128 src/models/globe-pro.php:143
     1282msgid "Border Radius"
     1283msgstr ""
     1284
     1285#: src/Services/Model/Pro/PluginSettings.php:137 src/models/globe-pro.php:152
    9721286msgid "Capabilities"
    9731287msgstr ""
    9741288
    975 #: src/Services/Model/Pro/PluginSettings.php:82 src/models/globe-pro.php:111
     1289#: src/Services/Model/Pro/PluginSettings.php:138 src/models/globe-pro.php:153
    9761290msgid "Add custom styles to the pages loading the layouts."
    9771291msgstr ""
    9781292
    979 #: src/Services/Model/Pro/PluginSettings.php:87 src/models/globe-pro.php:116
     1293#: src/Services/Model/Pro/PluginSettings.php:143 src/models/globe-pro.php:158
    9801294msgid "Capability Type"
    9811295msgstr ""
    9821296
    983 #: src/Services/Model/Pro/PluginSettings.php:88 src/models/globe-pro.php:117
     1297#: src/Services/Model/Pro/PluginSettings.php:144 src/models/globe-pro.php:159
    9841298msgid ""
    9851299"Refer to the <code>capability_type</code> argument from the "
     
    9891303msgstr ""
    9901304
    991 #: src/Services/Model/Pro/PluginSettings.php:94
     1305#: src/Services/Model/Pro/PluginSettings.php:150
    9921306msgid "Expose Data Types"
    9931307msgstr ""
    9941308
    995 #: src/Services/Model/Pro/PluginSettings.php:95
     1309#: src/Services/Model/Pro/PluginSettings.php:151
    9961310msgid ""
    9971311"If enabled, data types like points, dot labels, regions and others will "
     
    9991313msgstr ""
    10001314
    1001 #: src/Services/Model/Pro/PluginSettings.php:100
     1315#: src/Services/Model/Pro/PluginSettings.php:156
    10021316msgid "Globe single pages"
    10031317msgstr ""
    10041318
    1005 #: src/Services/Model/Pro/PluginSettings.php:101
     1319#: src/Services/Model/Pro/PluginSettings.php:157
    10061320msgid ""
    10071321"When enabled the globes will automatically have a single page where you can "
     
    10091323msgstr ""
    10101324
    1011 #: src/Services/Model/Pro/PluginSettings.php:106
    1012 #. translators: field type = input type (textarea, rich text editor...)
    1013 msgid "Enable"
    1014 msgstr ""
    1015 
    1016 #: src/Services/Model/Pro/PluginSettings.php:111
     1325#: src/Services/Model/Pro/PluginSettings.php:167
    10171326msgid "slug"
    10181327msgstr ""
    10191328
    1020 #: src/Services/Model/Pro/PluginSettings.php:112
     1329#: src/Services/Model/Pro/PluginSettings.php:168
    10211330msgid ""
    10221331"URL slug to use on single globe pages. You might need to resave your "
     
    10241333msgstr ""
    10251334
    1026 #: src/models/globe-dotlabel.php:18
     1335#: src/models/globe-dotlabel.php:19
    10271336msgid "Clone Dot Label"
    10281337msgstr ""
    10291338
    1030 #: src/models/globe-dotlabel.php:19
     1339#: src/models/globe-dotlabel.php:20
    10311340msgid "Create a copy of this dot label"
    10321341msgstr ""
    10331342
    1034 #: src/models/globe-dotlabel.php:22
     1343#: src/models/globe-dotlabel.php:23
    10351344msgid "Download Dot Labels Export File"
    10361345msgstr ""
    10371346
    1038 #: src/models/globe-dotlabel.php:45
     1347#: src/models/globe-dotlabel.php:32 src/models/globe-line.php:41
     1348#: src/models/globe-point.php:28 src/models/globe-region.php:99
     1349msgid "Parent Globe"
     1350msgstr ""
     1351
     1352#: src/models/globe-dotlabel.php:61
    10391353msgid "Dot Label"
    10401354msgstr ""
    10411355
    1042 #: src/models/globe-dotlabel.php:49
     1356#: src/models/globe-dotlabel.php:65
    10431357msgid "Create New Dot Label"
    10441358msgstr ""
    10451359
    1046 #: src/models/globe-dotlabel.php:50 src/models/globe-line.php:53
    1047 #: src/models/globe-point.php:35 src/models/globe-region.php:101
     1360#: src/models/globe-dotlabel.php:66 src/models/globe-line.php:75
     1361#: src/models/globe-point.php:60 src/models/globe-region.php:133
    10481362msgid "Edit"
    10491363msgstr ""
    10501364
    1051 #: src/models/globe-dotlabel.php:51
     1365#: src/models/globe-dotlabel.php:67
    10521366msgid "New Dot Label"
    10531367msgstr ""
    10541368
    1055 #: src/models/globe-dotlabel.php:52
     1369#: src/models/globe-dotlabel.php:68
    10561370msgid "View Dot Label"
    10571371msgstr ""
    10581372
    1059 #: src/models/globe-dotlabel.php:53
     1373#: src/models/globe-dotlabel.php:69
    10601374msgid "View Dot Labels"
    10611375msgstr ""
    10621376
    1063 #: src/models/globe-dotlabel.php:54
     1377#: src/models/globe-dotlabel.php:70
    10641378msgid "Search Dot Labels"
    10651379msgstr ""
    10661380
    1067 #: src/models/globe-dotlabel.php:55
     1381#: src/models/globe-dotlabel.php:71
    10681382msgid "No Dot Labels found."
    10691383msgstr ""
    10701384
    1071 #: src/models/globe-dotlabel.php:56
     1385#: src/models/globe-dotlabel.php:72
    10721386msgid "No Dot Labels found in Trash."
    10731387msgstr ""
    10741388
    1075 #: src/models/globe-dotlabel.php:57 src/models/globe-line.php:60
    1076 #: src/models/globe-point.php:42 src/models/globe-region.php:108
     1389#: src/models/globe-dotlabel.php:73 src/models/globe-line.php:82
     1390#: src/models/globe-point.php:67 src/models/globe-region.php:140
    10771391msgid "Parent Globe:"
    10781392msgstr ""
    10791393
    1080 #: src/models/globe-dotlabel.php:59
     1394#: src/models/globe-dotlabel.php:75
    10811395msgid "Dot Label Archives"
    10821396msgstr ""
    10831397
    1084 #: src/models/globe-dotlabel.php:60
     1398#: src/models/globe-dotlabel.php:76
    10851399msgid "Dot Label Attributes"
    10861400msgstr ""
    10871401
    1088 #: src/models/globe-dotlabel.php:61
     1402#: src/models/globe-dotlabel.php:77
    10891403msgid "Insert into Dot Label"
    10901404msgstr ""
    10911405
    1092 #: src/models/globe-dotlabel.php:62
     1406#: src/models/globe-dotlabel.php:78
    10931407msgid "Uploaded to this Dot Label"
    10941408msgstr ""
    10951409
    1096 #: src/models/globe-dotlabel.php:63
     1410#: src/models/globe-dotlabel.php:79
    10971411msgid "Filter Dot Label list"
    10981412msgstr ""
    10991413
    1100 #: src/models/globe-dotlabel.php:64
     1414#: src/models/globe-dotlabel.php:80
    11011415msgid "Dot Label list navigation"
    11021416msgstr ""
    11031417
    1104 #: src/models/globe-dotlabel.php:65
     1418#: src/models/globe-dotlabel.php:81
    11051419msgid "Dot Label list"
    11061420msgstr ""
    11071421
    1108 #: src/models/globe-dotlabel.php:66
     1422#: src/models/globe-dotlabel.php:82
    11091423msgid "Dot Label Cover Image"
    11101424msgstr ""
    11111425
    1112 #: src/models/globe-dotlabel.php:67
     1426#: src/models/globe-dotlabel.php:83
    11131427msgid "Set Dot Label Cover Image"
    11141428msgstr ""
    11151429
    1116 #: src/models/globe-dotlabel.php:68
     1430#: src/models/globe-dotlabel.php:84
    11171431msgid "Remove Dot Label Cover"
    11181432msgstr ""
    11191433
    1120 #: src/models/globe-dotlabel.php:69
     1434#: src/models/globe-dotlabel.php:85
    11211435msgid "Use as Dot Label Cover"
    11221436msgstr ""
    11231437
    1124 #: src/models/globe-dotlabel.php:73
     1438#: src/models/globe-dotlabel.php:89
    11251439msgid ""
    11261440"Dot Label information updated. <a href=\"{permalink}\" "
     
    11281442msgstr ""
    11291443
    1130 #: src/models/globe-dotlabel.php:74
     1444#: src/models/globe-dotlabel.php:90
    11311445msgid "Dot Label info updated"
    11321446msgstr ""
    11331447
    1134 #: src/models/globe-dotlabel.php:77
     1448#: src/models/globe-dotlabel.php:93
    11351449msgid "Dot Label content restored from revision"
    11361450msgstr ""
    11371451
    1138 #: src/models/globe-dotlabel.php:78
     1452#: src/models/globe-dotlabel.php:94
    11391453msgid "Dot Label Published"
    11401454msgstr ""
    11411455
    1142 #: src/models/globe-dotlabel.php:79
     1456#: src/models/globe-dotlabel.php:95
    11431457msgid "Dot Label information saved."
    11441458msgstr ""
    11451459
    1146 #: src/models/globe-dotlabel.php:80
     1460#: src/models/globe-dotlabel.php:96
    11471461msgid "Dot Label submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    11481462msgstr ""
    11491463
    1150 #: src/models/globe-dotlabel.php:81
     1464#: src/models/globe-dotlabel.php:97
    11511465msgid ""
    11521466"Dot Label scheduled for {date}. <a href=\"{preview_url}\" "
     
    11541468msgstr ""
    11551469
    1156 #: src/models/globe-dotlabel.php:82
     1470#: src/models/globe-dotlabel.php:98
    11571471msgid ""
    11581472"Dot Label draft updated. <a href=\"{preview_url}\" "
     
    11601474msgstr ""
    11611475
    1162 #: src/models/globe-dotlabel.php:85
     1476#: src/models/globe-dotlabel.php:101
    11631477msgid "Dot Label updated. Yay!"
    11641478msgstr ""
    11651479
    1166 #: src/models/globe-dotlabel.php:86
     1480#: src/models/globe-dotlabel.php:102
    11671481msgid "%s Dot Label updated. Yay!"
    11681482msgstr ""
    11691483
    1170 #: src/models/globe-dotlabel.php:87
     1484#: src/models/globe-dotlabel.php:103
    11711485msgid "Dot Label not updated, somebody is editing it"
    11721486msgstr ""
    11731487
    1174 #: src/models/globe-dotlabel.php:88
     1488#: src/models/globe-dotlabel.php:104
    11751489msgid "%s Dot Label not updated, somebody is editing them"
    11761490msgstr ""
    11771491
    1178 #: src/models/globe-dotlabel.php:89
     1492#: src/models/globe-dotlabel.php:105
    11791493msgid "Dot Label permanetly deleted. Fahrenheit 451 team was here?"
    11801494msgstr ""
    11811495
    1182 #: src/models/globe-dotlabel.php:90
     1496#: src/models/globe-dotlabel.php:106
    11831497msgid "%s Dot Label permanently deleted. Why? :("
    11841498msgstr ""
    11851499
    1186 #: src/models/globe-dotlabel.php:91
     1500#: src/models/globe-dotlabel.php:107
    11871501msgid "Dot Label moved to the trash. I'm sad :("
    11881502msgstr ""
    11891503
    1190 #: src/models/globe-dotlabel.php:92
     1504#: src/models/globe-dotlabel.php:108
    11911505msgid "%s Dot Label moved to the trash. Why? :("
    11921506msgstr ""
    11931507
    1194 #: src/models/globe-dotlabel.php:93
     1508#: src/models/globe-dotlabel.php:109
    11951509msgid "Dot Label recovered from trash. Well done!"
    11961510msgstr ""
    11971511
    1198 #: src/models/globe-dotlabel.php:94
     1512#: src/models/globe-dotlabel.php:110
    11991513msgid "%s Dot Label saved from the enemies!"
    12001514msgstr ""
    12011515
    1202 #: src/models/globe-dotlabel.php:98
     1516#: src/models/globe-dotlabel.php:114
    12031517msgid "Enter Dot Label name here"
    12041518msgstr ""
    12051519
    1206 #: src/models/globe-dotlabel.php:118 src/models/globe-line.php:123
    1207 #: src/models/globe-point.php:103 src/models/globe-region.php:167
     1520#: src/models/globe-dotlabel.php:134 src/models/globe-line.php:141
     1521#: src/models/globe-point.php:128 src/models/globe-region.php:199
    12081522msgid "Information"
    12091523msgstr ""
    12101524
    1211 #: src/models/globe-dotlabel.php:131 src/models/globe-line.php:166
    1212 #: src/models/globe-point.php:117
     1525#: src/models/globe-dotlabel.php:147 src/models/globe-line.php:194
     1526#: src/models/globe-point.php:142
    12131527msgid "zoom"
    12141528msgstr ""
    12151529
    1216 #: src/models/globe-dotlabel.php:140 src/models/globe-line.php:175
    1217 #: src/models/globe-point.php:126
     1530#: src/models/globe-dotlabel.php:156 src/models/globe-line.php:203
     1531#: src/models/globe-point.php:151
    12181532msgid "address"
    12191533msgstr ""
    12201534
    1221 #: src/models/globe-dotlabel.php:182
     1535#: src/models/globe-dotlabel.php:198
    12221536msgid "Globe - Dot Label relationship"
    12231537msgstr ""
    12241538
    1225 #: src/models/globe-dotlabel.php:191 src/models/globe-line.php:286
    1226 #: src/models/globe-point.php:178 src/models/globe-region.php:247
     1539#: src/models/globe-dotlabel.php:206 src/models/globe-dotlabel.php:208
     1540#: src/models/globe-dotlabel.php:223 src/models/globe-line.php:345
     1541#: src/models/globe-line.php:347 src/models/globe-line.php:362
     1542#: src/models/globe-point.php:202 src/models/globe-point.php:204
     1543#: src/models/globe-point.php:219 src/models/globe-region.php:278
     1544#: src/models/globe-region.php:280 src/models/globe-region.php:295
    12271545msgid "Associated Globe"
    12281546msgstr ""
    12291547
    1230 #: src/models/globe-line.php:21
     1548#: src/models/globe-dotlabel.php:213 src/models/globe-line.php:352
     1549#: src/models/globe-point.php:209 src/models/globe-region.php:285
     1550msgid "Select a Parent Globe"
     1551msgstr ""
     1552
     1553#: src/models/globe-line.php:28
    12311554msgid "Clone Line"
    12321555msgstr ""
    12331556
    1234 #: src/models/globe-line.php:22
     1557#: src/models/globe-line.php:29
    12351558msgid "Create a copy of this Line"
    12361559msgstr ""
    12371560
    1238 #: src/models/globe-line.php:25
     1561#: src/models/globe-line.php:32
    12391562msgid "Download Lines Export File"
    12401563msgstr ""
    12411564
    1242 #: src/models/globe-line.php:47 src/models/globe-line.php:49
    1243 #: src/models/globe-line.php:50 src/models/globe-line.php:61
     1565#: src/models/globe-line.php:69 src/models/globe-line.php:71
     1566#: src/models/globe-line.php:72 src/models/globe-line.php:83
    12441567msgid "Lines"
    12451568msgstr ""
    12461569
    1247 #: src/models/globe-line.php:48
     1570#: src/models/globe-line.php:70
    12481571msgid "Line"
    12491572msgstr ""
    12501573
    1251 #: src/models/globe-line.php:52
     1574#: src/models/globe-line.php:74
    12521575msgid "Create New Line"
    12531576msgstr ""
    12541577
    1255 #: src/models/globe-line.php:54
     1578#: src/models/globe-line.php:76
    12561579msgid "New Line"
    12571580msgstr ""
    12581581
    1259 #: src/models/globe-line.php:55
     1582#: src/models/globe-line.php:77
    12601583msgid "View Line"
    12611584msgstr ""
    12621585
    1263 #: src/models/globe-line.php:56
     1586#: src/models/globe-line.php:78
    12641587msgid "View Lines"
    12651588msgstr ""
    12661589
    1267 #: src/models/globe-line.php:57
     1590#: src/models/globe-line.php:79
    12681591msgid "Search Lines"
    12691592msgstr ""
    12701593
    1271 #: src/models/globe-line.php:58
     1594#: src/models/globe-line.php:80
    12721595msgid "No Lines found."
    12731596msgstr ""
    12741597
    1275 #: src/models/globe-line.php:59
     1598#: src/models/globe-line.php:81
    12761599msgid "No Lines found in Trash."
    12771600msgstr ""
    12781601
    1279 #: src/models/globe-line.php:62
     1602#: src/models/globe-line.php:84
    12801603msgid "Line Archives"
    12811604msgstr ""
    12821605
    1283 #: src/models/globe-line.php:63
     1606#: src/models/globe-line.php:85
    12841607msgid "Line Attributes"
    12851608msgstr ""
    12861609
    1287 #: src/models/globe-line.php:64
     1610#: src/models/globe-line.php:86
    12881611msgid "Insert into Line"
    12891612msgstr ""
    12901613
    1291 #: src/models/globe-line.php:65
     1614#: src/models/globe-line.php:87
    12921615msgid "Uploaded to this Line"
    12931616msgstr ""
    12941617
    1295 #: src/models/globe-line.php:66
    1296 msgid "Featured Image"
    1297 msgstr ""
    1298 
    1299 #: src/models/globe-line.php:67
    1300 msgid "Set featured image"
    1301 msgstr ""
    1302 
    1303 #: src/models/globe-line.php:68
    1304 msgid "Remove featured image"
    1305 msgstr ""
    1306 
    1307 #: src/models/globe-line.php:69
    1308 msgid "Use featured image"
    1309 msgstr ""
    1310 
    1311 #: src/models/globe-line.php:70
     1618#: src/models/globe-line.php:88
    13121619msgid "Filter Line list"
    13131620msgstr ""
    13141621
    1315 #: src/models/globe-line.php:71
     1622#: src/models/globe-line.php:89
    13161623msgid "Line list navigation"
    13171624msgstr ""
    13181625
    1319 #: src/models/globe-line.php:72
     1626#: src/models/globe-line.php:90
    13201627msgid "Line list"
    13211628msgstr ""
    13221629
    1323 #: src/models/globe-line.php:73
     1630#: src/models/globe-line.php:91
    13241631msgid "Line Cover Image"
    13251632msgstr ""
    13261633
    1327 #: src/models/globe-line.php:74
     1634#: src/models/globe-line.php:92
    13281635msgid "Set Line Cover Image"
    13291636msgstr ""
    13301637
    1331 #: src/models/globe-line.php:75
     1638#: src/models/globe-line.php:93
    13321639msgid "Remove Line Cover"
    13331640msgstr ""
    13341641
    1335 #: src/models/globe-line.php:76
     1642#: src/models/globe-line.php:94
    13361643msgid "Use as Line Cover"
    13371644msgstr ""
    13381645
    1339 #: src/models/globe-line.php:80
     1646#: src/models/globe-line.php:98
    13401647msgid ""
    13411648"Line information updated. <a href=\"{permalink}\" target=\"_blank\">View "
     
    13431650msgstr ""
    13441651
    1345 #: src/models/globe-line.php:81
     1652#: src/models/globe-line.php:99
    13461653msgid "Line info updated"
    13471654msgstr ""
    13481655
    1349 #: src/models/globe-line.php:84
     1656#: src/models/globe-line.php:102
    13501657msgid "Line content restored from revision"
    13511658msgstr ""
    13521659
    1353 #: src/models/globe-line.php:85
     1660#: src/models/globe-line.php:103
    13541661msgid "Line Published"
    13551662msgstr ""
    13561663
    1357 #: src/models/globe-line.php:86
     1664#: src/models/globe-line.php:104
    13581665msgid "Line information saved."
    13591666msgstr ""
    13601667
    1361 #: src/models/globe-line.php:87
     1668#: src/models/globe-line.php:105
    13621669msgid "Line submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    13631670msgstr ""
    13641671
    1365 #: src/models/globe-line.php:88
     1672#: src/models/globe-line.php:106
    13661673msgid ""
    13671674"Line scheduled for {date}. <a href=\"{preview_url}\" "
     
    13691676msgstr ""
    13701677
    1371 #: src/models/globe-line.php:89
     1678#: src/models/globe-line.php:107
    13721679msgid "Line draft updated. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    13731680msgstr ""
    13741681
    1375 #: src/models/globe-line.php:92
     1682#: src/models/globe-line.php:110
    13761683msgid "Line updated. Yay!"
    13771684msgstr ""
    13781685
    1379 #: src/models/globe-line.php:93
     1686#: src/models/globe-line.php:111
    13801687msgid "%s Line updated. Yay!"
    13811688msgstr ""
    13821689
    1383 #: src/models/globe-line.php:94
     1690#: src/models/globe-line.php:112
    13841691msgid "Line not updated, somebody is editing it"
    13851692msgstr ""
    13861693
    1387 #: src/models/globe-line.php:95
     1694#: src/models/globe-line.php:113
    13881695msgid "%s Line not updated, somebody is editing them"
    13891696msgstr ""
    13901697
    1391 #: src/models/globe-line.php:96
     1698#: src/models/globe-line.php:114
    13921699msgid "Line permanetly deleted. Fahrenheit 451 team was here?"
    13931700msgstr ""
    13941701
    1395 #: src/models/globe-line.php:97
     1702#: src/models/globe-line.php:115
    13961703msgid "%s Line permanently deleted. Why? :("
    13971704msgstr ""
    13981705
    1399 #: src/models/globe-line.php:98
     1706#: src/models/globe-line.php:116
    14001707msgid "Line moved to the trash. I'm sad :("
    14011708msgstr ""
    14021709
    1403 #: src/models/globe-line.php:99
     1710#: src/models/globe-line.php:117
    14041711msgid "%s Line moved to the trash. Why? :("
    14051712msgstr ""
    14061713
    1407 #: src/models/globe-line.php:100
     1714#: src/models/globe-line.php:118
    14081715msgid "Line recovered from trash. Well done!"
    14091716msgstr ""
    14101717
    1411 #: src/models/globe-line.php:101
     1718#: src/models/globe-line.php:119
    14121719msgid "%s Line saved from the enemies!"
    14131720msgstr ""
    14141721
    1415 #: src/models/globe-line.php:105
     1722#: src/models/globe-line.php:123
    14161723msgid "Enter Line name here"
    14171724msgstr ""
    14181725
    1419 #: src/models/globe-line.php:133 src/models/globe-region.php:174
     1726#: src/models/globe-line.php:151 src/models/globe-region.php:206
    14201727msgid "Details."
    14211728msgstr ""
    14221729
    1423 #: src/models/globe-line.php:139
     1730#: src/models/globe-line.php:158
     1731msgid "Enter manually"
     1732msgstr ""
     1733
     1734#: src/models/globe-line.php:159
     1735msgid "Connect existing markers"
     1736msgstr ""
     1737
     1738#: src/models/globe-line.php:166
    14241739msgid "Add More End Points"
    14251740msgstr ""
    14261741
    1427 #: src/models/globe-line.php:140
    1428 msgid "Lines to Connect"
    1429 msgstr ""
    1430 
    1431 #: src/models/globe-line.php:162
     1742#: src/models/globe-line.php:167
     1743msgid "Locations to connect"
     1744msgstr ""
     1745
     1746#: src/models/globe-line.php:190
    14321747msgid "Line Info"
    14331748msgstr ""
    14341749
    1435 #: src/models/globe-line.php:209
     1750#: src/models/globe-line.php:225
     1751msgid "Markers"
     1752msgstr ""
     1753
     1754#: src/models/globe-line.php:227
     1755msgid "Add More Markers"
     1756msgstr ""
     1757
     1758#: src/models/globe-line.php:239
     1759msgid "Select Marker"
     1760msgstr ""
     1761
     1762#: src/models/globe-line.php:269
    14361763msgid "Line Color"
    14371764msgstr ""
    14381765
    1439 #: src/models/globe-line.php:277 src/models/globe-point.php:169
    1440 #: src/models/globe-region.php:238
     1766#: src/models/globe-line.php:337 src/models/globe-point.php:194
     1767#: src/models/globe-region.php:270
    14411768msgid "Globe rel"
    14421769msgstr ""
    14431770
    1444 #: src/models/globe-point.php:30
     1771#: src/models/globe-point.php:18
     1772msgid "Clone Point"
     1773msgstr ""
     1774
     1775#: src/models/globe-point.php:19
     1776msgid "Create a copy of this point"
     1777msgstr ""
     1778
     1779#: src/models/globe-point.php:55
    14451780msgid "Point"
    14461781msgstr ""
    14471782
    1448 #: src/models/globe-point.php:34
     1783#: src/models/globe-point.php:59
    14491784msgid "Create New Point"
    14501785msgstr ""
    14511786
    1452 #: src/models/globe-point.php:36
     1787#: src/models/globe-point.php:61
    14531788msgid "New Point"
    14541789msgstr ""
    14551790
    1456 #: src/models/globe-point.php:37
     1791#: src/models/globe-point.php:62
    14571792msgid "View Point"
    14581793msgstr ""
    14591794
    1460 #: src/models/globe-point.php:38
     1795#: src/models/globe-point.php:63
    14611796msgid "View Points"
    14621797msgstr ""
    14631798
    1464 #: src/models/globe-point.php:39
     1799#: src/models/globe-point.php:64
    14651800msgid "Search Points"
    14661801msgstr ""
    14671802
    1468 #: src/models/globe-point.php:40
     1803#: src/models/globe-point.php:65
    14691804msgid "No Points found."
    14701805msgstr ""
    14711806
    1472 #: src/models/globe-point.php:41
     1807#: src/models/globe-point.php:66
    14731808msgid "No Points found in Trash."
    14741809msgstr ""
    14751810
    1476 #: src/models/globe-point.php:44
     1811#: src/models/globe-point.php:69
    14771812msgid "Point Archives"
    14781813msgstr ""
    14791814
    1480 #: src/models/globe-point.php:45
     1815#: src/models/globe-point.php:70
    14811816msgid "Point Attributes"
    14821817msgstr ""
    14831818
    1484 #: src/models/globe-point.php:46
     1819#: src/models/globe-point.php:71
    14851820msgid "Insert into Point"
    14861821msgstr ""
    14871822
    1488 #: src/models/globe-point.php:47
     1823#: src/models/globe-point.php:72
    14891824msgid "Uploaded to this Point"
    14901825msgstr ""
    14911826
    1492 #: src/models/globe-point.php:48
     1827#: src/models/globe-point.php:73
    14931828msgid "Filter Point list"
    14941829msgstr ""
    14951830
    1496 #: src/models/globe-point.php:49
     1831#: src/models/globe-point.php:74
    14971832msgid "Point list navigation"
    14981833msgstr ""
    14991834
    1500 #: src/models/globe-point.php:50
     1835#: src/models/globe-point.php:75
    15011836msgid "Point list"
    15021837msgstr ""
    15031838
    1504 #: src/models/globe-point.php:51
     1839#: src/models/globe-point.php:76
    15051840msgid "Point Cover Image"
    15061841msgstr ""
    15071842
    1508 #: src/models/globe-point.php:52
     1843#: src/models/globe-point.php:77
    15091844msgid "Set Point Cover Image"
    15101845msgstr ""
    15111846
    1512 #: src/models/globe-point.php:53
     1847#: src/models/globe-point.php:78
    15131848msgid "Remove Point Cover"
    15141849msgstr ""
    15151850
    1516 #: src/models/globe-point.php:54
     1851#: src/models/globe-point.php:79
    15171852msgid "Use as Point Cover"
    15181853msgstr ""
    15191854
    1520 #: src/models/globe-point.php:58
     1855#: src/models/globe-point.php:83
    15211856msgid ""
    15221857"Point information updated. <a href=\"{permalink}\" target=\"_blank\">View "
     
    15241859msgstr ""
    15251860
    1526 #: src/models/globe-point.php:59
     1861#: src/models/globe-point.php:84
    15271862msgid "Point info updated"
    15281863msgstr ""
    15291864
    1530 #: src/models/globe-point.php:62
     1865#: src/models/globe-point.php:87
    15311866msgid "Point content restored from revision"
    15321867msgstr ""
    15331868
    1534 #: src/models/globe-point.php:63
     1869#: src/models/globe-point.php:88
    15351870msgid "Point Published"
    15361871msgstr ""
    15371872
    1538 #: src/models/globe-point.php:64
     1873#: src/models/globe-point.php:89
    15391874msgid "Point information saved."
    15401875msgstr ""
    15411876
    1542 #: src/models/globe-point.php:65
     1877#: src/models/globe-point.php:90
    15431878msgid "Point submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    15441879msgstr ""
    15451880
    1546 #: src/models/globe-point.php:66
     1881#: src/models/globe-point.php:91
    15471882msgid ""
    15481883"Point scheduled for {date}. <a href=\"{preview_url}\" "
     
    15501885msgstr ""
    15511886
    1552 #: src/models/globe-point.php:67
     1887#: src/models/globe-point.php:92
    15531888msgid "Point draft updated. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    15541889msgstr ""
    15551890
    1556 #: src/models/globe-point.php:70
     1891#: src/models/globe-point.php:95
    15571892msgid "Point updated. Yay!"
    15581893msgstr ""
    15591894
    1560 #: src/models/globe-point.php:71
     1895#: src/models/globe-point.php:96
    15611896msgid "%s Point updated. Yay!"
    15621897msgstr ""
    15631898
    1564 #: src/models/globe-point.php:72
     1899#: src/models/globe-point.php:97
    15651900msgid "Point not updated, somebody is editing it"
    15661901msgstr ""
    15671902
    1568 #: src/models/globe-point.php:73
     1903#: src/models/globe-point.php:98
    15691904msgid "%s Point not updated, somebody is editing them"
    15701905msgstr ""
    15711906
    1572 #: src/models/globe-point.php:74
     1907#: src/models/globe-point.php:99
    15731908msgid "Point permanetly deleted. Fahrenheit 451 team was here?"
    15741909msgstr ""
    15751910
    1576 #: src/models/globe-point.php:75
     1911#: src/models/globe-point.php:100
    15771912msgid "%s Point permanently deleted. Why? :("
    15781913msgstr ""
    15791914
    1580 #: src/models/globe-point.php:76
     1915#: src/models/globe-point.php:101
    15811916msgid "Point moved to the trash. I'm sad :("
    15821917msgstr ""
    15831918
    1584 #: src/models/globe-point.php:77
     1919#: src/models/globe-point.php:102
    15851920msgid "%s Point moved to the trash. Why? :("
    15861921msgstr ""
    15871922
    1588 #: src/models/globe-point.php:78
     1923#: src/models/globe-point.php:103
    15891924msgid "Point recovered from trash. Well done!"
    15901925msgstr ""
    15911926
    1592 #: src/models/globe-point.php:79
     1927#: src/models/globe-point.php:104
    15931928msgid "%s Point saved from the enemies!"
    15941929msgstr ""
    15951930
    1596 #: src/models/globe-point.php:83
     1931#: src/models/globe-point.php:108
    15971932msgid "Enter Point name here"
    15981933msgstr ""
    15991934
    1600 #: src/models/globe-pro.php:18
     1935#: src/models/globe-pro.php:26
    16011936msgid "Clone Globe"
    16021937msgstr ""
    16031938
    1604 #: src/models/globe-pro.php:19
     1939#: src/models/globe-pro.php:27
    16051940msgid "Create a copy of this globe"
    16061941msgstr ""
    16071942
    1608 #: src/models/globe-pro.php:129
     1943#: src/models/globe-pro.php:138
     1944msgid "Active Color"
     1945msgstr ""
     1946
     1947#: src/models/globe-pro.php:172
    16091948msgid "Use default"
    16101949msgstr ""
    16111950
    1612 #: src/models/globe-pro.php:137 src/models/globe-pro.php:183
     1951#: src/models/globe-pro.php:180 src/models/globe-pro.php:226
    16131952msgid "Use defaults"
    16141953msgstr ""
    16151954
    1616 #: src/models/globe-pro.php:138 src/models/globe-pro.php:184
     1955#: src/models/globe-pro.php:181 src/models/globe-pro.php:227
    16171956msgid "Use default colors and actions."
    16181957msgstr ""
    16191958
    1620 #: src/models/globe-region.php:69
     1959#: src/models/globe-region.php:63
     1960msgid "URL not found"
     1961msgstr ""
     1962
     1963#: src/models/globe-region.php:86
    16211964msgid "Clone Region"
    16221965msgstr ""
    16231966
    1624 #: src/models/globe-region.php:70
     1967#: src/models/globe-region.php:87
    16251968msgid "Create a copy of this Region"
    16261969msgstr ""
    16271970
    1628 #: src/models/globe-region.php:73
     1971#: src/models/globe-region.php:90
    16291972msgid "Download Regions Export File"
    16301973msgstr ""
    16311974
    1632 #: src/models/globe-region.php:95 src/models/globe-region.php:97
    1633 #: src/models/globe-region.php:98 src/models/globe-region.php:109
     1975#: src/models/globe-region.php:127 src/models/globe-region.php:129
     1976#: src/models/globe-region.php:130 src/models/globe-region.php:141
    16341977msgid "Regions"
    16351978msgstr ""
    16361979
    1637 #: src/models/globe-region.php:96
     1980#: src/models/globe-region.php:128
    16381981msgid "Region"
    16391982msgstr ""
    16401983
    1641 #: src/models/globe-region.php:100
     1984#: src/models/globe-region.php:132
    16421985msgid "Create New Region"
    16431986msgstr ""
    16441987
    1645 #: src/models/globe-region.php:102
     1988#: src/models/globe-region.php:134
    16461989msgid "New Region"
    16471990msgstr ""
    16481991
    1649 #: src/models/globe-region.php:103
     1992#: src/models/globe-region.php:135
    16501993msgid "View Region"
    16511994msgstr ""
    16521995
    1653 #: src/models/globe-region.php:104
     1996#: src/models/globe-region.php:136
    16541997msgid "View Regions"
    16551998msgstr ""
    16561999
    1657 #: src/models/globe-region.php:105
     2000#: src/models/globe-region.php:137
    16582001msgid "Search Regions"
    16592002msgstr ""
    16602003
    1661 #: src/models/globe-region.php:106
     2004#: src/models/globe-region.php:138
    16622005msgid "No Regions found."
    16632006msgstr ""
    16642007
    1665 #: src/models/globe-region.php:107
     2008#: src/models/globe-region.php:139
    16662009msgid "No Regions found in Trash."
    16672010msgstr ""
    16682011
    1669 #: src/models/globe-region.php:110
     2012#: src/models/globe-region.php:142
    16702013msgid "Region Archives"
    16712014msgstr ""
    16722015
    1673 #: src/models/globe-region.php:111
     2016#: src/models/globe-region.php:143
    16742017msgid "Region Attributes"
    16752018msgstr ""
    16762019
    1677 #: src/models/globe-region.php:112
     2020#: src/models/globe-region.php:144
    16782021msgid "Insert into Region"
    16792022msgstr ""
    16802023
    1681 #: src/models/globe-region.php:113
     2024#: src/models/globe-region.php:145
    16822025msgid "Uploaded to this Region"
    16832026msgstr ""
    16842027
    1685 #: src/models/globe-region.php:114
     2028#: src/models/globe-region.php:146
    16862029msgid "Filter Region list"
    16872030msgstr ""
    16882031
    1689 #: src/models/globe-region.php:115
     2032#: src/models/globe-region.php:147
    16902033msgid "Region list navigation"
    16912034msgstr ""
    16922035
    1693 #: src/models/globe-region.php:116
     2036#: src/models/globe-region.php:148
    16942037msgid "Region list"
    16952038msgstr ""
    16962039
    1697 #: src/models/globe-region.php:117
     2040#: src/models/globe-region.php:149
    16982041msgid "Region Cover Image"
    16992042msgstr ""
    17002043
    1701 #: src/models/globe-region.php:118
     2044#: src/models/globe-region.php:150
    17022045msgid "Set Region Cover Image"
    17032046msgstr ""
    17042047
    1705 #: src/models/globe-region.php:119
     2048#: src/models/globe-region.php:151
    17062049msgid "Remove Region Cover"
    17072050msgstr ""
    17082051
    1709 #: src/models/globe-region.php:120
     2052#: src/models/globe-region.php:152
    17102053msgid "Use as Region Cover"
    17112054msgstr ""
    17122055
    1713 #: src/models/globe-region.php:124
     2056#: src/models/globe-region.php:156
    17142057msgid ""
    17152058"Region information updated. <a href=\"{permalink}\" target=\"_blank\">View "
     
    17172060msgstr ""
    17182061
    1719 #: src/models/globe-region.php:125
     2062#: src/models/globe-region.php:157
    17202063msgid "Region info updated"
    17212064msgstr ""
    17222065
    1723 #: src/models/globe-region.php:128
     2066#: src/models/globe-region.php:160
    17242067msgid "Region content restored from revision"
    17252068msgstr ""
    17262069
    1727 #: src/models/globe-region.php:129
     2070#: src/models/globe-region.php:161
    17282071msgid "Region Published"
    17292072msgstr ""
    17302073
    1731 #: src/models/globe-region.php:130
     2074#: src/models/globe-region.php:162
    17322075msgid "Region information saved."
    17332076msgstr ""
    17342077
    1735 #: src/models/globe-region.php:131
     2078#: src/models/globe-region.php:163
    17362079msgid "Region submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    17372080msgstr ""
    17382081
    1739 #: src/models/globe-region.php:132
     2082#: src/models/globe-region.php:164
    17402083msgid ""
    17412084"Region scheduled for {date}. <a href=\"{preview_url}\" "
     
    17432086msgstr ""
    17442087
    1745 #: src/models/globe-region.php:133
     2088#: src/models/globe-region.php:165
    17462089msgid ""
    17472090"Region draft updated. <a href=\"{preview_url}\" "
     
    17492092msgstr ""
    17502093
    1751 #: src/models/globe-region.php:136
     2094#: src/models/globe-region.php:168
    17522095msgid "Region updated. Yay!"
    17532096msgstr ""
    17542097
    1755 #: src/models/globe-region.php:137
     2098#: src/models/globe-region.php:169
    17562099msgid "%s Region updated. Yay!"
    17572100msgstr ""
    17582101
    1759 #: src/models/globe-region.php:138
     2102#: src/models/globe-region.php:170
    17602103msgid "Region not updated, somebody is editing it"
    17612104msgstr ""
    17622105
    1763 #: src/models/globe-region.php:139
     2106#: src/models/globe-region.php:171
    17642107msgid "%s Region not updated, somebody is editing them"
    17652108msgstr ""
    17662109
    1767 #: src/models/globe-region.php:140
     2110#: src/models/globe-region.php:172
    17682111msgid "Region permanetly deleted. Fahrenheit 451 team was here?"
    17692112msgstr ""
    17702113
    1771 #: src/models/globe-region.php:141
     2114#: src/models/globe-region.php:173
    17722115msgid "%s Region permanently deleted. Why? :("
    17732116msgstr ""
    17742117
    1775 #: src/models/globe-region.php:142
     2118#: src/models/globe-region.php:174
    17762119msgid "Region moved to the trash. I'm sad :("
    17772120msgstr ""
    17782121
    1779 #: src/models/globe-region.php:143
     2122#: src/models/globe-region.php:175
    17802123msgid "%s Region moved to the trash. Why? :("
    17812124msgstr ""
    17822125
    1783 #: src/models/globe-region.php:144
     2126#: src/models/globe-region.php:176
    17842127msgid "Region recovered from trash. Well done!"
    17852128msgstr ""
    17862129
    1787 #: src/models/globe-region.php:145
     2130#: src/models/globe-region.php:177
    17882131msgid "%s Region saved from the enemies!"
    17892132msgstr ""
    17902133
    1791 #: src/models/globe-region.php:149
     2134#: src/models/globe-region.php:181
    17922135msgid "Enter Region name here"
    17932136msgstr ""
    17942137
    1795 #: src/models/globe-region.php:181
     2138#: src/models/globe-region.php:213
    17962139msgid "Select a region"
    17972140msgstr ""
    17982141
    1799 #: src/models/globe-region.php:182
     2142#: src/models/globe-region.php:214
    18002143msgid "Region Code *"
    18012144msgstr ""
    18022145
    1803 #: src/models/globe-region.php:185
     2146#: src/models/globe-region.php:217
    18042147msgid "Fetching regions from: "
    18052148msgstr ""
  • interactive-globes/trunk/src/Core.php

    r3158721 r3207680  
    77use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\Shortcode\ShortcodeCore;
    88use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\Meta\MetaFeature;
     9use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\Duplicate\DuplicateFeature;
    910use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\CptManager\CptManagerFeature;
    1011use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\Sales\UpsellPageFeature;
     
    126127            'CPTManager' => CptManagerFeature::class,
    127128            'Meta'       => MetaFeature::class,
     129            'Duplicate'  => DuplicateFeature::class,
    128130            'shortcode'  => ShortcodeFeature::class,
    129131            'Updater'    => UpdateFeature::class,
  • interactive-globes/trunk/src/Features/CptManager/CptManagerCore.php

    r3158721 r3207680  
    152152
    153153    // get globe items
     154    /**
     155     * @deprecated
     156     */
    154157    public function get_globe_items( int $globe_id, string $cpt ) {
    155158        $args = [
  • interactive-globes/trunk/src/Features/Meta/MetaCore.php

    r3158721 r3207680  
    6767        register_rest_route(
    6868            'ittglobes/v1',
    69             '/globe/(?<id>\d+)/(?<post_type>\w+)/list',
     69            '/globe/(?<id>\d+)/(?<post_type>[a-zA-Z0-9_-]+)/list',
    7070            [
    7171                'methods'             => 'GET',
     
    330330            }
    331331            $cpt_id      = $cpt_post->ID;
    332             $cpt_post_title = $cpt_post->post_title;
     332            $cpt_post_title = empty($cpt_post->post_title) ? __( '(no title)', 'interactive-globes' ) : $cpt_post->post_title;
    333333
    334334            $content .= sprintf(
  • interactive-globes/trunk/src/Features/Shortcode/ShortcodeCore.php

    r3158721 r3207680  
    178178        // prepare meta
    179179        $this->setup_meta( $atts );
    180         $this->meta = apply_filters( 'itt_globes/shortcode/post_setup_meta', $this->meta, $id );
     180        $this->meta = apply_filters( 'itt_globes/render/post_setup_meta', $this->meta, $id );
    181181        $namespace  = 'Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\ClickActions\\';
    182182
    183         $enabled_click_actions = $this->meta['enabled_click_actions'];
     183        // prepare overlays
     184        if ( isset( $this->meta['layer'] ) && is_array( $this->meta['layer'] ) ) {
     185            foreach ( $this->meta['layer'] as $layer ) {
     186                $layer_id = absint( $layer );
     187                if ( $layer_id !== 0 ) {
     188                    $layer_meta = get_post_meta( $layer_id, 'globe_info', true );
     189                    if ( $layer_meta !== false ) {
     190
     191                        // in case globe id is not defined
     192                        if ( ! isset( $layer_meta['id'] ) ) {
     193                            $layer_meta['id'] = $layer_id;
     194                        }
     195
     196                        // let's remove some features we don't want the layer to carry
     197                        unset( $layer_meta['liveFilter'] );
     198                        unset( $layer_meta['search'] );
     199
     200                       
     201                        $new_meta = apply_filters( 'itt_globes/render/post_setup_meta', $layer_meta, $layer_id );
     202                        $this->meta['layers'][] = $new_meta;
     203                        if ( isset( $new_meta['enabled_click_actions'] ) && is_array( $new_meta['enabled_click_actions'] ) ) {
     204                            $this->meta['enabled_click_actions'] = array_merge( $this->meta['enabled_click_actions'], $new_meta['enabled_click_actions'] );
     205                        }
     206                    }
     207                }
     208            }
     209        }
     210
     211        $enabled_click_actions = $this->meta['enabled_click_actions'] ?? [];
    184212        foreach ( $enabled_click_actions as $click_action ) {
    185213            $click_action_classname = $namespace . $click_action;
     
    292320    public function render_shortcode_in_cpt_footer() {
    293321
     322        global $typenow;
    294323        global $pagenow;
    295324        // Check if we're on the edit page for a specific CPT
    296325        if ( get_post_type() === 'iglobe' &&
    297326            ( $pagenow === 'post.php' && isset( $_GET['post'] ) ) ||
    298             ( $pagenow === 'post-new.php' ) ) {
     327            ( $typenow === 'iglobe' && $pagenow === 'post-new.php' ) ) {
    299328            // Render the shortcode output
    300329            echo '<div id="custom-footer-shortcode">';
  • interactive-globes/trunk/src/Features/Tooltip/TooltipCore.php

    r3158721 r3207680  
    2525
    2626    public function content_before( $before, $id ) {
    27         $globe = get_post_meta( $id, 'globe_info', true );
    28 
    29         if ( empty( $globe['tooltip'] ) ) {
     27        $meta = get_post_meta( $id, 'globe_info', true );
     28   
     29        if ( empty( $meta['tooltip'] ) ) {
    3030            return $before;
    3131        }
    3232
    33         $tooltip = $globe['tooltip'];
     33        $meta['id'] = $id;
    3434
    35         $bg = ! empty( $tooltip['backgroundColor'] ) ? $tooltip['backgroundColor'] : '#FFFFFF';
    36         $color = ! empty( $tooltip['font']['color'] ) ? $tooltip['font']['color'] : '#000000';
    37         $padding = ! empty( $tooltip['padding'] ) ? $tooltip['padding']['top'] . $tooltip['padding']['unit'] . ' ' . $tooltip['padding']['right'] . $tooltip['padding']['unit'] . ' ' .  $tooltip['padding']['bottom'] . $tooltip['padding']['unit'] . ' ' . $tooltip['padding']['left'] . $tooltip['padding']['unit'] . ' ' : '8px';
    38         $border_radius = ! empty( $tooltip['cornerRadius'] ) ? $tooltip['cornerRadius'] .'px' : '3px';
    39         $box_shadow = '';
    40         $font_family = ! empty( $tooltip['fontFamily'] ) ? $tooltip['fontFamily'] : 'inherit';
    41         $text_align = ! empty( $tooltip['font']['text-align'] ) ? $tooltip['font']['text-align'] : 'initial';
    42         $font_size = ! empty( $tooltip['font']['font-size'] ) ? $tooltip['font']['font-size'] . 'px' : 'inherit';
    43         $max_width = ! empty( $tooltip['maxWidth'] ) ? 'max-width: ' . $tooltip['maxWidth'] . 'px' : '';
    44         $border = ! empty( $tooltip['border'] ) && ! empty( $tooltip['border']['all'] ) ? $tooltip['border'] : false;
    45         $border_rule = $border ? $border['all'] .'px ' . $border['style'] . ' ' . $border['color'] : 'none';
     35        $style = '<style>';
    4636
    47         $style = sprintf( '<style>
    48             .itt_globe_wrapper_pro .itt_globe_tooltip {
    49                 background:%1$s;
    50                 color:%2$s;
    51                 padding:%3$s;
    52                 border-radius: %4$s;
    53                 box-shadow: %5$s;
    54                 font-family: %6$s;
    55                 text-align: %7$s;
    56                 font-size: %8$s;
    57                 border: %9$s;
    58                 %10$s;
    59             }',
    60             $bg,
    61             $color,
    62             $padding,
    63             $border_radius,
    64             $box_shadow,
    65             $font_family,
    66             $text_align,
    67             $font_size, // 8
    68             $border_rule,
    69             $max_width
    70         );
     37        $meta['tooltip']['globe_id'] = $id;
     38
     39        $tooltip_styles = [ $meta['tooltip'] ];
     40
     41        if( ! empty( $meta['layer'] ) ){
     42            foreach( $meta['layer'] as $layer ){
     43                $layer_meta = get_post_meta( $layer, 'globe_info', true );
     44                if( ! empty( $layer_meta['tooltip'] ) ){
     45                    $layer_meta['tooltip']['globe_id'] = $layer;
     46                    $tooltip_styles[] = $layer_meta['tooltip'];
     47                }
     48            }
     49        }
     50
     51        foreach( $tooltip_styles as $tooltip ){
     52            $globe_id = $tooltip['globe_id'];
     53            $bg = ! empty( $tooltip['backgroundColor'] ) ? $tooltip['backgroundColor'] : '#FFFFFF';
     54            $color = ! empty( $tooltip['font']['color'] ) ? $tooltip['font']['color'] : '#000000';
     55            $padding = ! empty( $tooltip['padding'] ) ? $tooltip['padding']['top'] . $tooltip['padding']['unit'] . ' ' . $tooltip['padding']['right'] . $tooltip['padding']['unit'] . ' ' .  $tooltip['padding']['bottom'] . $tooltip['padding']['unit'] . ' ' . $tooltip['padding']['left'] . $tooltip['padding']['unit'] . ' ' : '8px';
     56            $border_radius = ! empty( $tooltip['cornerRadius'] ) ? $tooltip['cornerRadius'] .'px' : '3px';
     57            $box_shadow = '';
     58            $font_family = ! empty( $tooltip['fontFamily'] ) ? $tooltip['fontFamily'] : 'inherit';
     59            $text_align = ! empty( $tooltip['font']['text-align'] ) ? $tooltip['font']['text-align'] : 'initial';
     60            $font_size = ! empty( $tooltip['font']['font-size'] ) ? $tooltip['font']['font-size'] . 'px' : 'inherit';
     61            $max_width = ! empty( $tooltip['maxWidth'] ) ? 'max-width: ' . $tooltip['maxWidth'] . 'px;' : '';
     62            $border = ! empty( $tooltip['border'] ) && ! empty( $tooltip['border']['all'] ) ? $tooltip['border'] : false;
     63            $border_rule = $border ? $border['all'] .'px ' . $border['style'] . ' ' . $border['color'] : 'none';
     64
     65           
     66            $style .= sprintf( '
     67                .itt_globe_%11$s.itt_globe_tooltip {
     68                    background:%1$s;
     69                    color:%2$s;
     70                    padding:%3$s;
     71                    border-radius: %4$s;
     72                    box-shadow: %5$s;
     73                    font-family: %6$s;
     74                    text-align: %7$s;
     75                    font-size: %8$s;
     76                    border: %9$s;
     77                    %10$s
     78                }',
     79                $bg,
     80                $color,
     81                $padding,
     82                $border_radius,
     83                $box_shadow,
     84                $font_family,
     85                $text_align,
     86                $font_size, // 8
     87                $border_rule,
     88                $max_width,
     89                $globe_id
     90                );
     91        }
     92
    7193        $style .= '</style>';
    7294        return $before . $style;
  • interactive-globes/trunk/src/Plugin/Assets.php

    r3158721 r3207680  
    202202            }
    203203        }
     204        $name = $assets->register_script(
     205            '/assets/js/admin/rel_sel.js',
     206            [],
     207            true
     208        );
     209        wp_enqueue_script( $name );
     210
    204211        $name = $assets->register_script(
    205212            '/assets/js/admin/admin.js',
     
    283290        global $typenow;
    284291        global $pagenow;
     292        return true; //TODO by pcarvalho: revert this
    285293        if ( $typenow !== 'iglobe' || ( $pagenow !== 'post.php' && $pagenow !== 'post-new.php' ) ) {
    286294            return false;
  • interactive-globes/trunk/src/Services/Model/Base/Features.php

    r3115164 r3207680  
    2626                ],
    2727            ],
     28            'duplicate'     => [
     29                'label'      => __( 'Clone Globe', 'interactive-globes' ),
     30                'attr_title' => __( 'Create a copy of this globe', 'interactive-globes' ),
     31            ],
    2832            'remember_tabs' => true,
    2933        ];
  • interactive-globes/trunk/src/Services/Model/Base/MetaDotLabel.php

    r3158721 r3207680  
    1818
    1919        // Default Point meta
    20         $meta['globe_info']['sections']['labelLegacy'] = [
     20        $meta['globe_info']['sections']['dotlabel'] = [
    2121            'title'  => __( 'Dot Labels', 'interactive-globes' ),
    2222            'icon'   => 'fa fa-font fa-lg',
  • interactive-globes/trunk/src/Services/Model/Base/Settings.php

    r3115164 r3207680  
    99    public static function get( $path ) {
    1010        $plugins_url = plugin_dir_url( $path );
    11         $options     = get_option( 'interactive-globes' );
     11        $options     = get_option( 'ittglobes' );
    1212        $dist_dir    = WP_ENV === 'development' ? '' : 'dist';
    1313        $assets_url  = $plugins_url . $dist_dir;
  • interactive-globes/trunk/vendor/composer/ClassLoader.php

    r2986425 r3207680  
    4646    private static $includeFile;
    4747
    48     /** @var ?string */
     48    /** @var string|null */
    4949    private $vendorDir;
    5050
    5151    // PSR-4
    5252    /**
    53      * @var array[]
    54      * @psalm-var array<string, array<string, int>>
     53     * @var array<string, array<string, int>>
    5554     */
    5655    private $prefixLengthsPsr4 = array();
    5756    /**
    58      * @var array[]
    59      * @psalm-var array<string, array<int, string>>
     57     * @var array<string, list<string>>
    6058     */
    6159    private $prefixDirsPsr4 = array();
    6260    /**
    63      * @var array[]
    64      * @psalm-var array<string, string>
     61     * @var list<string>
    6562     */
    6663    private $fallbackDirsPsr4 = array();
     
    6865    // PSR-0
    6966    /**
    70      * @var array[]
    71      * @psalm-var array<string, array<string, string[]>>
     67     * List of PSR-0 prefixes
     68     *
     69     * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
     70     *
     71     * @var array<string, array<string, list<string>>>
    7272     */
    7373    private $prefixesPsr0 = array();
    7474    /**
    75      * @var array[]
    76      * @psalm-var array<string, string>
     75     * @var list<string>
    7776     */
    7877    private $fallbackDirsPsr0 = array();
     
    8281
    8382    /**
    84      * @var string[]
    85      * @psalm-var array<string, string>
     83     * @var array<string, string>
    8684     */
    8785    private $classMap = array();
     
    9189
    9290    /**
    93      * @var bool[]
    94      * @psalm-var array<string, bool>
     91     * @var array<string, bool>
    9592     */
    9693    private $missingClasses = array();
    9794
    98     /** @var ?string */
     95    /** @var string|null */
    9996    private $apcuPrefix;
    10097
    10198    /**
    102      * @var self[]
     99     * @var array<string, self>
    103100     */
    104101    private static $registeredLoaders = array();
    105102
    106103    /**
    107      * @param ?string $vendorDir
     104     * @param string|null $vendorDir
    108105     */
    109106    public function __construct($vendorDir = null)
     
    114111
    115112    /**
    116      * @return string[]
     113     * @return array<string, list<string>>
    117114     */
    118115    public function getPrefixes()
     
    126123
    127124    /**
    128      * @return array[]
    129      * @psalm-return array<string, array<int, string>>
     125     * @return array<string, list<string>>
    130126     */
    131127    public function getPrefixesPsr4()
     
    135131
    136132    /**
    137      * @return array[]
    138      * @psalm-return array<string, string>
     133     * @return list<string>
    139134     */
    140135    public function getFallbackDirs()
     
    144139
    145140    /**
    146      * @return array[]
    147      * @psalm-return array<string, string>
     141     * @return list<string>
    148142     */
    149143    public function getFallbackDirsPsr4()
     
    153147
    154148    /**
    155      * @return string[] Array of classname => path
    156      * @psalm-return array<string, string>
     149     * @return array<string, string> Array of classname => path
    157150     */
    158151    public function getClassMap()
     
    162155
    163156    /**
    164      * @param string[] $classMap Class to filename map
    165      * @psalm-param array<string, string> $classMap
     157     * @param array<string, string> $classMap Class to filename map
    166158     *
    167159     * @return void
     
    180172     * appending or prepending to the ones previously set for this prefix.
    181173     *
    182      * @param string          $prefix  The prefix
    183      * @param string[]|string $paths   The PSR-0 root directories
    184      * @param bool            $prepend Whether to prepend the directories
     174     * @param string              $prefix  The prefix
     175     * @param list<string>|string $paths   The PSR-0 root directories
     176     * @param bool                $prepend Whether to prepend the directories
    185177     *
    186178     * @return void
     
    188180    public function add($prefix, $paths, $prepend = false)
    189181    {
     182        $paths = (array) $paths;
    190183        if (!$prefix) {
    191184            if ($prepend) {
    192185                $this->fallbackDirsPsr0 = array_merge(
    193                     (array) $paths,
     186                    $paths,
    194187                    $this->fallbackDirsPsr0
    195188                );
     
    197190                $this->fallbackDirsPsr0 = array_merge(
    198191                    $this->fallbackDirsPsr0,
    199                     (array) $paths
     192                    $paths
    200193                );
    201194            }
     
    206199        $first = $prefix[0];
    207200        if (!isset($this->prefixesPsr0[$first][$prefix])) {
    208             $this->prefixesPsr0[$first][$prefix] = (array) $paths;
     201            $this->prefixesPsr0[$first][$prefix] = $paths;
    209202
    210203            return;
     
    212205        if ($prepend) {
    213206            $this->prefixesPsr0[$first][$prefix] = array_merge(
    214                 (array) $paths,
     207                $paths,
    215208                $this->prefixesPsr0[$first][$prefix]
    216209            );
     
    218211            $this->prefixesPsr0[$first][$prefix] = array_merge(
    219212                $this->prefixesPsr0[$first][$prefix],
    220                 (array) $paths
     213                $paths
    221214            );
    222215        }
     
    227220     * appending or prepending to the ones previously set for this namespace.
    228221     *
    229      * @param string          $prefix  The prefix/namespace, with trailing '\\'
    230      * @param string[]|string $paths   The PSR-4 base directories
    231      * @param bool            $prepend Whether to prepend the directories
     222     * @param string              $prefix  The prefix/namespace, with trailing '\\'
     223     * @param list<string>|string $paths   The PSR-4 base directories
     224     * @param bool                $prepend Whether to prepend the directories
    232225     *
    233226     * @throws \InvalidArgumentException
     
    237230    public function addPsr4($prefix, $paths, $prepend = false)
    238231    {
     232        $paths = (array) $paths;
    239233        if (!$prefix) {
    240234            // Register directories for the root namespace.
    241235            if ($prepend) {
    242236                $this->fallbackDirsPsr4 = array_merge(
    243                     (array) $paths,
     237                    $paths,
    244238                    $this->fallbackDirsPsr4
    245239                );
     
    247241                $this->fallbackDirsPsr4 = array_merge(
    248242                    $this->fallbackDirsPsr4,
    249                     (array) $paths
     243                    $paths
    250244                );
    251245            }
     
    257251            }
    258252            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
    259             $this->prefixDirsPsr4[$prefix] = (array) $paths;
     253            $this->prefixDirsPsr4[$prefix] = $paths;
    260254        } elseif ($prepend) {
    261255            // Prepend directories for an already registered namespace.
    262256            $this->prefixDirsPsr4[$prefix] = array_merge(
    263                 (array) $paths,
     257                $paths,
    264258                $this->prefixDirsPsr4[$prefix]
    265259            );
     
    268262            $this->prefixDirsPsr4[$prefix] = array_merge(
    269263                $this->prefixDirsPsr4[$prefix],
    270                 (array) $paths
     264                $paths
    271265            );
    272266        }
     
    277271     * replacing any others previously set for this prefix.
    278272     *
    279      * @param string          $prefix The prefix
    280      * @param string[]|string $paths  The PSR-0 base directories
     273     * @param string              $prefix The prefix
     274     * @param list<string>|string $paths  The PSR-0 base directories
    281275     *
    282276     * @return void
     
    295289     * replacing any others previously set for this namespace.
    296290     *
    297      * @param string          $prefix The prefix/namespace, with trailing '\\'
    298      * @param string[]|string $paths  The PSR-4 base directories
     291     * @param string              $prefix The prefix/namespace, with trailing '\\'
     292     * @param list<string>|string $paths  The PSR-4 base directories
    299293     *
    300294     * @throws \InvalidArgumentException
     
    482476
    483477    /**
    484      * Returns the currently registered loaders indexed by their corresponding vendor directories.
    485      *
    486      * @return self[]
     478     * Returns the currently registered loaders keyed by their corresponding vendor directories.
     479     *
     480     * @return array<string, self>
    487481     */
    488482    public static function getRegisteredLoaders()
  • interactive-globes/trunk/vendor/composer/LICENSE

    r2986425 r3207680  
    1 
    21Copyright (c) Nils Adermann, Jordi Boggiano
    32
     
    1918OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    2019THE SOFTWARE.
    21 
  • interactive-globes/trunk/vendor/composer/autoload_classmap.php

    r3158721 r3207680  
    9797    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerFeature' => $baseDir . '/../src/Features/CptManager/CptManagerFeature.php',
    9898    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\DotLabel\\DotLabelProMeta' => $baseDir . '/../src/Features/DotLabel/DotLabelProMeta.php',
     99    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Duplicate\\DuplicateCore' => $baseDir . '/../src/Features/Duplicate/DuplicateCore.php',
     100    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Duplicate\\DuplicateFeature' => $baseDir . '/../src/Features/Duplicate/DuplicateFeature.php',
     101    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterCore' => $baseDir . '/../src/Features/LiveFilter/LiveFilterCore.php',
     102    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterFeature' => $baseDir . '/../src/Features/LiveFilter/LiveFilterFeature.php',
    99103    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaCore' => $baseDir . '/../src/Features/Meta/MetaCore.php',
    100104    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaFeature' => $baseDir . '/../src/Features/Meta/MetaFeature.php',
     
    102106    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPage' => $baseDir . '/../src/Features/Sales/UpsellPage.php',
    103107    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPageFeature' => $baseDir . '/../src/Features/Sales/UpsellPageFeature.php',
     108    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownCore' => $baseDir . '/../src/Features/SearchDropdown/SearchDropdownCore.php',
     109    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownFeature' => $baseDir . '/../src/Features/SearchDropdown/SearchDropdownFeature.php',
    104110    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeCore' => $baseDir . '/../src/Features/Shortcode/ShortcodeCore.php',
    105111    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeFeature' => $baseDir . '/../src/Features/Shortcode/ShortcodeFeature.php',
     
    128134    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Model' => $baseDir . '/../src/Services/Model/Base/Model.php',
    129135    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Options' => $baseDir . '/../src/Services/Model/Base/Options.php',
     136    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\SafeNL2BR' => $baseDir . '/../src/Services/Model/Base/SafeNL2BR.php',
    130137    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Settings' => $baseDir . '/../src/Services/Model/Base/Settings.php',
    131138    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\ClickActions' => $baseDir . '/../src/Services/Model/Pro/ClickActions.php',
    132139    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaColor' => $baseDir . '/../src/Services/Model/Pro/MetaColor.php',
    133140    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaDotLabel' => $baseDir . '/../src/Services/Model/Pro/MetaDotLabel.php',
     141    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLayers' => $baseDir . '/../src/Services/Model/Pro/MetaLayers.php',
    134142    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLines' => $baseDir . '/../src/Services/Model/Pro/MetaLines.php',
     143    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaPoint' => $baseDir . '/../src/Services/Model/Pro/MetaPoint.php',
    135144    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRegions' => $baseDir . '/../src/Services/Model/Pro/MetaRegions.php',
    136145    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRotate' => $baseDir . '/../src/Services/Model/Pro/MetaRotate.php',
     146    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaSearch' => $baseDir . '/../src/Services/Model/Pro/MetaSearch.php',
    137147    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaTooltip' => $baseDir . '/../src/Services/Model/Pro/MetaTooltip.php',
    138148    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\Options' => $baseDir . '/../src/Services/Model/Pro/Options.php',
  • interactive-globes/trunk/vendor/composer/autoload_static.php

    r3158721 r3207680  
    129129        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/CptManager/CptManagerFeature.php',
    130130        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\DotLabel\\DotLabelProMeta' => __DIR__ . '/../..'.'/build' . '/../src/Features/DotLabel/DotLabelProMeta.php',
     131        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Duplicate\\DuplicateCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Duplicate/DuplicateCore.php',
     132        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Duplicate\\DuplicateFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Duplicate/DuplicateFeature.php',
     133        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/LiveFilter/LiveFilterCore.php',
     134        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\LiveFilter\\LiveFilterFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/LiveFilter/LiveFilterFeature.php',
    131135        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Meta/MetaCore.php',
    132136        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Meta/MetaFeature.php',
     
    134138        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPage' => __DIR__ . '/../..'.'/build' . '/../src/Features/Sales/UpsellPage.php',
    135139        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPageFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Sales/UpsellPageFeature.php',
     140        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/SearchDropdown/SearchDropdownCore.php',
     141        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\SearchDropdown\\SearchDropdownFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/SearchDropdown/SearchDropdownFeature.php',
    136142        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Shortcode/ShortcodeCore.php',
    137143        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Shortcode/ShortcodeFeature.php',
     
    160166        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Model' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Model.php',
    161167        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Options' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Options.php',
     168        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\SafeNL2BR' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/SafeNL2BR.php',
    162169        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Settings' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Settings.php',
    163170        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\ClickActions' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/ClickActions.php',
    164171        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaColor' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaColor.php',
    165172        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaDotLabel' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaDotLabel.php',
     173        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLayers' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaLayers.php',
    166174        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLines' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaLines.php',
     175        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaPoint' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaPoint.php',
    167176        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRegions' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaRegions.php',
    168177        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaRotate' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaRotate.php',
     178        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaSearch' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaSearch.php',
    169179        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaTooltip' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaTooltip.php',
    170180        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\Options' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/Options.php',
  • interactive-globes/trunk/vendor/composer/installed.json

    r3158721 r3207680  
    33        {
    44            "name": "freemius/wordpress-sdk",
    5             "version": "2.7.3",
    6             "version_normalized": "2.7.3.0",
     5            "version": "2.9.0",
     6            "version_normalized": "2.9.0.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/Freemius/wordpress-sdk.git",
    10                 "reference": "dad8c4f268f826d1f5a98737d26216d6dede5b03"
     10                "reference": "56696717c5f0b7fb395618e88e1b592d1893e5dc"
    1111            },
    1212            "dist": {
    1313                "type": "zip",
    14                 "url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/dad8c4f268f826d1f5a98737d26216d6dede5b03",
    15                 "reference": "dad8c4f268f826d1f5a98737d26216d6dede5b03",
     14                "url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/56696717c5f0b7fb395618e88e1b592d1893e5dc",
     15                "reference": "56696717c5f0b7fb395618e88e1b592d1893e5dc",
    1616                "shasum": ""
    1717            },
     
    2828                "wp-coding-standards/wpcs": "^2.3"
    2929            },
    30             "time": "2024-07-01T05:51:06+00:00",
     30            "time": "2024-10-21T10:21:58+00:00",
    3131            "type": "library",
    3232            "installation-source": "dist",
     
    4848            "support": {
    4949                "issues": "https://github.com/Freemius/wordpress-sdk/issues",
    50                 "source": "https://github.com/Freemius/wordpress-sdk/tree/2.7.3"
     50                "source": "https://github.com/Freemius/wordpress-sdk/tree/2.9.0"
    5151            },
    5252            "install-path": "../freemius/wordpress-sdk"
     
    5454        {
    5555            "name": "hassankhan/config",
    56             "version": "3.1.0",
    57             "version_normalized": "3.1.0.0",
     56            "version": "3.2.0",
     57            "version_normalized": "3.2.0.0",
    5858            "source": {
    5959                "type": "git",
    6060                "url": "https://github.com/hassankhan/config.git",
    61                 "reference": "8e1c07f4fdc2b986b8a781f0dcba155af2a579b6"
     61                "reference": "cf63da451c4d226df983017932b9cef1b6d49db5"
    6262            },
    6363            "dist": {
    6464                "type": "zip",
    65                 "url": "https://api.github.com/repos/hassankhan/config/zipball/8e1c07f4fdc2b986b8a781f0dcba155af2a579b6",
    66                 "reference": "8e1c07f4fdc2b986b8a781f0dcba155af2a579b6",
     65                "url": "https://api.github.com/repos/hassankhan/config/zipball/cf63da451c4d226df983017932b9cef1b6d49db5",
     66                "reference": "cf63da451c4d226df983017932b9cef1b6d49db5",
    6767                "shasum": ""
    6868            },
     
    7979                "symfony/yaml": "^5.4"
    8080            },
    81             "time": "2022-12-20T19:48:37+00:00",
     81            "time": "2024-12-09T16:20:44+00:00",
    8282            "type": "library",
    8383            "installation-source": "dist",
     
    113113            "support": {
    114114                "issues": "https://github.com/hassankhan/config/issues",
    115                 "source": "https://github.com/hassankhan/config/tree/3.1.0"
     115                "source": "https://github.com/hassankhan/config/tree/3.2.0"
    116116            },
    117117            "install-path": "../hassankhan/config"
     
    119119        {
    120120            "name": "saltus/framework",
    121             "version": "dev-feature/feature-as-cpts",
    122             "version_normalized": "dev-feature/feature-as-cpts",
     121            "version": "dev-dev",
     122            "version_normalized": "dev-dev",
    123123            "source": {
    124124                "type": "git",
    125125                "url": "https://github.com/SaltusDev/saltus-framework.git",
    126                 "reference": "b907f029e06f3cf8748bdc3e02195638733fa69e"
     126                "reference": "dff0acfe679535ccbead90b3560d2ca045d532ae"
    127127            },
    128128            "dist": {
    129129                "type": "zip",
    130                 "url": "https://api.github.com/repos/SaltusDev/saltus-framework/zipball/b907f029e06f3cf8748bdc3e02195638733fa69e",
    131                 "reference": "b907f029e06f3cf8748bdc3e02195638733fa69e",
     130                "url": "https://api.github.com/repos/SaltusDev/saltus-framework/zipball/dff0acfe679535ccbead90b3560d2ca045d532ae",
     131                "reference": "dff0acfe679535ccbead90b3560d2ca045d532ae",
    132132                "shasum": ""
    133133            },
     
    137137            },
    138138            "require-dev": {
    139                 "phpunit/phpunit": "^9.6.0",
    140                 "squizlabs/php_codesniffer": "^3.2.3"
     139                "phpunit/phpunit": "^11.4.3",
     140                "squizlabs/php_codesniffer": "^3.10.3"
    141141            },
    142             "time": "2024-06-18T14:11:22+00:00",
     142            "time": "2024-12-10T16:29:46+00:00",
    143143            "type": "project",
    144144            "installation-source": "dist",
     
    179179            ],
    180180            "support": {
    181                 "source": "https://github.com/SaltusDev/saltus-framework/tree/feature/feature-as-cpts",
     181                "source": "https://github.com/SaltusDev/saltus-framework/tree/dev",
    182182                "issues": "https://github.com/SaltusDev/saltus-framework/issues"
    183183            },
  • interactive-globes/trunk/vendor/composer/installed.php

    r3158721 r3207680  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => 'ef1ec57ac76205246119445ce9f392fb446f8c41',
     6        'reference' => '502edfcaaf76874ec30efabf90f20a53d2f1c898',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../build',
     
    1212    'versions' => array(
    1313        'freemius/wordpress-sdk' => array(
    14             'pretty_version' => '2.7.3',
    15             'version' => '2.7.3.0',
    16             'reference' => 'dad8c4f268f826d1f5a98737d26216d6dede5b03',
     14            'pretty_version' => '2.9.0',
     15            'version' => '2.9.0.0',
     16            'reference' => '56696717c5f0b7fb395618e88e1b592d1893e5dc',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../freemius/wordpress-sdk',
     
    2121        ),
    2222        'hassankhan/config' => array(
    23             'pretty_version' => '3.1.0',
    24             'version' => '3.1.0.0',
    25             'reference' => '8e1c07f4fdc2b986b8a781f0dcba155af2a579b6',
     23            'pretty_version' => '3.2.0',
     24            'version' => '3.2.0.0',
     25            'reference' => 'cf63da451c4d226df983017932b9cef1b6d49db5',
    2626            'type' => 'library',
    2727            'install_path' => __DIR__ . '/../hassankhan/config',
     
    3030        ),
    3131        'saltus/framework' => array(
    32             'pretty_version' => 'dev-feature/feature-as-cpts',
    33             'version' => 'dev-feature/feature-as-cpts',
    34             'reference' => 'b907f029e06f3cf8748bdc3e02195638733fa69e',
     32            'pretty_version' => 'dev-dev',
     33            'version' => 'dev-dev',
     34            'reference' => 'dff0acfe679535ccbead90b3560d2ca045d532ae',
    3535            'type' => 'project',
    3636            'install_path' => __DIR__ . '/../saltus/framework',
     
    4141            'pretty_version' => 'dev-main',
    4242            'version' => 'dev-main',
    43             'reference' => 'ef1ec57ac76205246119445ce9f392fb446f8c41',
     43            'reference' => '502edfcaaf76874ec30efabf90f20a53d2f1c898',
    4444            'type' => 'wordpress-plugin',
    4545            'install_path' => __DIR__ . '/../../build',
  • interactive-globes/trunk/vendor/hassankhan/config/CHANGELOG.md

    r2986425 r3207680  
    22
    33All notable changes to `Config` will be documented in this file
     4
     5## 3.2.0 - 2024-12-09
     6
     7### Added
     8* PHP 8.3 and 8.4 to the build matrix (#164)
     9
     10### Fixed
     11* Fatal error when root is null in has() method (#159 and #160)
     12* PHP 8.4 deprecations implicitly marking parameter as nullable is deprecated (#163)
     13
    414
    515## 3.1.0 - 2022-12-20
  • interactive-globes/trunk/vendor/hassankhan/config/src/AbstractConfig.php

    r2986425 r3207680  
    124124        // nested case
    125125        foreach ($segments as $segment) {
    126             if (array_key_exists($segment, $root)) {
     126            if (is_array($root) && array_key_exists($segment, $root)) {
    127127                $root = $root[$segment];
    128128                continue;
  • interactive-globes/trunk/vendor/hassankhan/config/src/Config.php

    r2986425 r3207680  
    6868     *
    6969     * @param  string|array    $values Filenames or string with configuration
    70      * @param  ParserInterface $parser Configuration parser
     70     * @param  ?ParserInterface $parser Configuration parser
    7171     * @param  bool            $string Enable loading from string
    7272     */
    73     public function __construct($values, ParserInterface $parser = null, $string = false)
     73    public function __construct($values, ?ParserInterface $parser = null, $string = false)
    7474    {
    7575        if ($string === true) {
     
    8686     *
    8787     * @param  string|array     $path   Filenames or directories with configuration
    88      * @param  ParserInterface $parser Configuration parser
     88     * @param  ?ParserInterface $parser Configuration parser
    8989     *
    9090     * @throws EmptyDirectoryException If `$path` is an empty directory
    9191     */
    92     protected function loadFromFile($path, ParserInterface $parser = null)
     92    protected function loadFromFile($path, ?ParserInterface $parser = null)
    9393    {
    9494        $paths      = $this->getValidPath($path);
     
    126126     *
    127127     * @param  string           $filename   Filename to save configuration to
    128      * @param  WriterInterface $writer Configuration writer
     128     * @param  ?WriterInterface $writer Configuration writer
    129129     *
    130130     * @throws WriteException if the data could not be written to the file
    131131     */
    132     public function toFile($filename, WriterInterface $writer = null)
     132    public function toFile($filename, ?WriterInterface $writer = null)
    133133    {
    134134        if ($writer === null) {
  • interactive-globes/trunk/vendor/saltus/framework/README.md

    r2986425 r3207680  
    33
    44We built it to make things easier and faster for developers with different skills. Add metaboxes, settings pages and other enhancements with just a few lines of code.
     5
     6**Version 1.1.2**
    57
    68### Features
  • interactive-globes/trunk/vendor/saltus/framework/assets/Feature/DragAndDrop/order.js

    r2986425 r3207680  
    77        'update': function (e, ui) {
    88            $.post( drag_drop_object.ajaxurl, {
    9                 action: 'dda-update-menu-order',
     9                action: 'saltus-dad-update-menu-order',
    1010                order: $('#the-list').sortable('serialize'),
    1111                nonce: drag_drop_object.nonce,
  • interactive-globes/trunk/vendor/saltus/framework/composer.json

    r2986425 r3207680  
    3939    },
    4040    "require-dev": {
    41         "phpunit/phpunit": "^9.6.0",
    42         "squizlabs/php_codesniffer": "^3.2.3"
     41        "phpunit/phpunit": "^11.4.3",
     42        "squizlabs/php_codesniffer": "^3.10.3"
    4343    },
    4444    "scripts": {
  • interactive-globes/trunk/vendor/saltus/framework/composer.lock

    r2986425 r3207680  
    55        "This file is @generated automatically"
    66    ],
    7     "content-hash": "4f56f79c3d02f4b07de1334fa70472e0",
     7    "content-hash": "fb38984e693c081da72a7b5b36e77aa9",
    88    "packages": [
    99        {
     
    7272    "packages-dev": [
    7373        {
    74             "name": "doctrine/instantiator",
    75             "version": "1.5.0",
    76             "source": {
    77                 "type": "git",
    78                 "url": "https://github.com/doctrine/instantiator.git",
    79                 "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
    80             },
    81             "dist": {
    82                 "type": "zip",
    83                 "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
    84                 "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
    85                 "shasum": ""
    86             },
    87             "require": {
    88                 "php": "^7.1 || ^8.0"
    89             },
    90             "require-dev": {
    91                 "doctrine/coding-standard": "^9 || ^11",
    92                 "ext-pdo": "*",
    93                 "ext-phar": "*",
    94                 "phpbench/phpbench": "^0.16 || ^1",
    95                 "phpstan/phpstan": "^1.4",
    96                 "phpstan/phpstan-phpunit": "^1",
    97                 "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
    98                 "vimeo/psalm": "^4.30 || ^5.4"
    99             },
    100             "type": "library",
    101             "autoload": {
    102                 "psr-4": {
    103                     "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
    104                 }
    105             },
    106             "notification-url": "https://packagist.org/downloads/",
    107             "license": [
    108                 "MIT"
    109             ],
    110             "authors": [
    111                 {
    112                     "name": "Marco Pivetta",
    113                     "email": "ocramius@gmail.com",
    114                     "homepage": "https://ocramius.github.io/"
    115                 }
    116             ],
    117             "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
    118             "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
    119             "keywords": [
    120                 "constructor",
    121                 "instantiate"
    122             ],
    123             "support": {
    124                 "issues": "https://github.com/doctrine/instantiator/issues",
    125                 "source": "https://github.com/doctrine/instantiator/tree/1.5.0"
    126             },
    127             "funding": [
    128                 {
    129                     "url": "https://www.doctrine-project.org/sponsorship.html",
    130                     "type": "custom"
    131                 },
    132                 {
    133                     "url": "https://www.patreon.com/phpdoctrine",
    134                     "type": "patreon"
    135                 },
    136                 {
    137                     "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
    138                     "type": "tidelift"
    139                 }
    140             ],
    141             "time": "2022-12-30T00:15:36+00:00"
    142         },
    143         {
    14474            "name": "myclabs/deep-copy",
    145             "version": "1.11.1",
     75            "version": "1.12.0",
    14676            "source": {
    14777                "type": "git",
    14878                "url": "https://github.com/myclabs/DeepCopy.git",
    149                 "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c"
    150             },
    151             "dist": {
    152                 "type": "zip",
    153                 "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
    154                 "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c",
     79                "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c"
     80            },
     81            "dist": {
     82                "type": "zip",
     83                "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
     84                "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c",
    15585                "shasum": ""
    15686            },
     
    16090            "conflict": {
    16191                "doctrine/collections": "<1.6.8",
    162                 "doctrine/common": "<2.13.3 || >=3,<3.2.2"
     92                "doctrine/common": "<2.13.3 || >=3 <3.2.2"
    16393            },
    16494            "require-dev": {
    16595                "doctrine/collections": "^1.6.8",
    16696                "doctrine/common": "^2.13.3 || ^3.2.2",
     97                "phpspec/prophecy": "^1.10",
    16798                "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
    16899            },
     
    190121            "support": {
    191122                "issues": "https://github.com/myclabs/DeepCopy/issues",
    192                 "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1"
     123                "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0"
    193124            },
    194125            "funding": [
     
    198129                }
    199130            ],
    200             "time": "2023-03-08T13:26:56+00:00"
     131            "time": "2024-06-12T14:39:25+00:00"
    201132        },
    202133        {
    203134            "name": "nikic/php-parser",
    204             "version": "v4.15.4",
     135            "version": "v5.3.1",
    205136            "source": {
    206137                "type": "git",
    207138                "url": "https://github.com/nikic/PHP-Parser.git",
    208                 "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290"
    209             },
    210             "dist": {
    211                 "type": "zip",
    212                 "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290",
    213                 "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290",
    214                 "shasum": ""
    215             },
    216             "require": {
     139                "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b"
     140            },
     141            "dist": {
     142                "type": "zip",
     143                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b",
     144                "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b",
     145                "shasum": ""
     146            },
     147            "require": {
     148                "ext-ctype": "*",
     149                "ext-json": "*",
    217150                "ext-tokenizer": "*",
    218                 "php": ">=7.0"
     151                "php": ">=7.4"
    219152            },
    220153            "require-dev": {
    221154                "ircmaxell/php-yacc": "^0.0.7",
    222                 "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
     155                "phpunit/phpunit": "^9.0"
    223156            },
    224157            "bin": [
     
    228161            "extra": {
    229162                "branch-alias": {
    230                     "dev-master": "4.9-dev"
     163                    "dev-master": "5.0-dev"
    231164                }
    232165            },
     
    252185            "support": {
    253186                "issues": "https://github.com/nikic/PHP-Parser/issues",
    254                 "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4"
    255             },
    256             "time": "2023-03-05T19:49:14+00:00"
     187                "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1"
     188            },
     189            "time": "2024-10-08T18:51:32+00:00"
    257190        },
    258191        {
    259192            "name": "phar-io/manifest",
    260             "version": "2.0.3",
     193            "version": "2.0.4",
    261194            "source": {
    262195                "type": "git",
    263196                "url": "https://github.com/phar-io/manifest.git",
    264                 "reference": "97803eca37d319dfa7826cc2437fc020857acb53"
    265             },
    266             "dist": {
    267                 "type": "zip",
    268                 "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
    269                 "reference": "97803eca37d319dfa7826cc2437fc020857acb53",
     197                "reference": "54750ef60c58e43759730615a392c31c80e23176"
     198            },
     199            "dist": {
     200                "type": "zip",
     201                "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176",
     202                "reference": "54750ef60c58e43759730615a392c31c80e23176",
    270203                "shasum": ""
    271204            },
    272205            "require": {
    273206                "ext-dom": "*",
     207                "ext-libxml": "*",
    274208                "ext-phar": "*",
    275209                "ext-xmlwriter": "*",
     
    312246            "support": {
    313247                "issues": "https://github.com/phar-io/manifest/issues",
    314                 "source": "https://github.com/phar-io/manifest/tree/2.0.3"
    315             },
    316             "time": "2021-07-20T11:28:43+00:00"
     248                "source": "https://github.com/phar-io/manifest/tree/2.0.4"
     249            },
     250            "funding": [
     251                {
     252                    "url": "https://github.com/theseer",
     253                    "type": "github"
     254                }
     255            ],
     256            "time": "2024-03-03T12:33:53+00:00"
    317257        },
    318258        {
     
    369309        {
    370310            "name": "phpunit/php-code-coverage",
    371             "version": "9.2.26",
     311            "version": "11.0.7",
    372312            "source": {
    373313                "type": "git",
    374314                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
    375                 "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1"
    376             },
    377             "dist": {
    378                 "type": "zip",
    379                 "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1",
    380                 "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1",
     315                "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca"
     316            },
     317            "dist": {
     318                "type": "zip",
     319                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f7f08030e8811582cc459871d28d6f5a1a4d35ca",
     320                "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca",
    381321                "shasum": ""
    382322            },
     
    385325                "ext-libxml": "*",
    386326                "ext-xmlwriter": "*",
    387                 "nikic/php-parser": "^4.15",
    388                 "php": ">=7.3",
    389                 "phpunit/php-file-iterator": "^3.0.3",
    390                 "phpunit/php-text-template": "^2.0.2",
    391                 "sebastian/code-unit-reverse-lookup": "^2.0.2",
    392                 "sebastian/complexity": "^2.0",
    393                 "sebastian/environment": "^5.1.2",
    394                 "sebastian/lines-of-code": "^1.0.3",
    395                 "sebastian/version": "^3.0.1",
    396                 "theseer/tokenizer": "^1.2.0"
    397             },
    398             "require-dev": {
    399                 "phpunit/phpunit": "^9.3"
     327                "nikic/php-parser": "^5.3.1",
     328                "php": ">=8.2",
     329                "phpunit/php-file-iterator": "^5.1.0",
     330                "phpunit/php-text-template": "^4.0.1",
     331                "sebastian/code-unit-reverse-lookup": "^4.0.1",
     332                "sebastian/complexity": "^4.0.1",
     333                "sebastian/environment": "^7.2.0",
     334                "sebastian/lines-of-code": "^3.0.1",
     335                "sebastian/version": "^5.0.2",
     336                "theseer/tokenizer": "^1.2.3"
     337            },
     338            "require-dev": {
     339                "phpunit/phpunit": "^11.4.1"
    400340            },
    401341            "suggest": {
     
    406346            "extra": {
    407347                "branch-alias": {
    408                     "dev-master": "9.2-dev"
     348                    "dev-main": "11.0.x-dev"
    409349                }
    410350            },
     
    434374            "support": {
    435375                "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
    436                 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26"
    437             },
    438             "funding": [
    439                 {
    440                     "url": "https://github.com/sebastianbergmann",
    441                     "type": "github"
    442                 }
    443             ],
    444             "time": "2023-03-06T12:58:08+00:00"
     376                "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
     377                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.7"
     378            },
     379            "funding": [
     380                {
     381                    "url": "https://github.com/sebastianbergmann",
     382                    "type": "github"
     383                }
     384            ],
     385            "time": "2024-10-09T06:21:38+00:00"
    445386        },
    446387        {
    447388            "name": "phpunit/php-file-iterator",
    448             "version": "3.0.6",
     389            "version": "5.1.0",
    449390            "source": {
    450391                "type": "git",
    451392                "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
    452                 "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
    453             },
    454             "dist": {
    455                 "type": "zip",
    456                 "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
    457                 "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
    458                 "shasum": ""
    459             },
    460             "require": {
    461                 "php": ">=7.3"
    462             },
    463             "require-dev": {
    464                 "phpunit/phpunit": "^9.3"
    465             },
    466             "type": "library",
    467             "extra": {
    468                 "branch-alias": {
    469                     "dev-master": "3.0-dev"
     393                "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6"
     394            },
     395            "dist": {
     396                "type": "zip",
     397                "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6",
     398                "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6",
     399                "shasum": ""
     400            },
     401            "require": {
     402                "php": ">=8.2"
     403            },
     404            "require-dev": {
     405                "phpunit/phpunit": "^11.0"
     406            },
     407            "type": "library",
     408            "extra": {
     409                "branch-alias": {
     410                    "dev-main": "5.0-dev"
    470411                }
    471412            },
     
    494435            "support": {
    495436                "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
    496                 "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
    497             },
    498             "funding": [
    499                 {
    500                     "url": "https://github.com/sebastianbergmann",
    501                     "type": "github"
    502                 }
    503             ],
    504             "time": "2021-12-02T12:48:52+00:00"
     437                "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy",
     438                "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0"
     439            },
     440            "funding": [
     441                {
     442                    "url": "https://github.com/sebastianbergmann",
     443                    "type": "github"
     444                }
     445            ],
     446            "time": "2024-08-27T05:02:59+00:00"
    505447        },
    506448        {
    507449            "name": "phpunit/php-invoker",
    508             "version": "3.1.1",
     450            "version": "5.0.1",
    509451            "source": {
    510452                "type": "git",
    511453                "url": "https://github.com/sebastianbergmann/php-invoker.git",
    512                 "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
    513             },
    514             "dist": {
    515                 "type": "zip",
    516                 "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
    517                 "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
    518                 "shasum": ""
    519             },
    520             "require": {
    521                 "php": ">=7.3"
     454                "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2"
     455            },
     456            "dist": {
     457                "type": "zip",
     458                "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2",
     459                "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2",
     460                "shasum": ""
     461            },
     462            "require": {
     463                "php": ">=8.2"
    522464            },
    523465            "require-dev": {
    524466                "ext-pcntl": "*",
    525                 "phpunit/phpunit": "^9.3"
     467                "phpunit/phpunit": "^11.0"
    526468            },
    527469            "suggest": {
     
    531473            "extra": {
    532474                "branch-alias": {
    533                     "dev-master": "3.1-dev"
     475                    "dev-main": "5.0-dev"
    534476                }
    535477            },
     
    557499            "support": {
    558500                "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
    559                 "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
    560             },
    561             "funding": [
    562                 {
    563                     "url": "https://github.com/sebastianbergmann",
    564                     "type": "github"
    565                 }
    566             ],
    567             "time": "2020-09-28T05:58:55+00:00"
     501                "security": "https://github.com/sebastianbergmann/php-invoker/security/policy",
     502                "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1"
     503            },
     504            "funding": [
     505                {
     506                    "url": "https://github.com/sebastianbergmann",
     507                    "type": "github"
     508                }
     509            ],
     510            "time": "2024-07-03T05:07:44+00:00"
    568511        },
    569512        {
    570513            "name": "phpunit/php-text-template",
    571             "version": "2.0.4",
     514            "version": "4.0.1",
    572515            "source": {
    573516                "type": "git",
    574517                "url": "https://github.com/sebastianbergmann/php-text-template.git",
    575                 "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
    576             },
    577             "dist": {
    578                 "type": "zip",
    579                 "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
    580                 "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
    581                 "shasum": ""
    582             },
    583             "require": {
    584                 "php": ">=7.3"
    585             },
    586             "require-dev": {
    587                 "phpunit/phpunit": "^9.3"
    588             },
    589             "type": "library",
    590             "extra": {
    591                 "branch-alias": {
    592                     "dev-master": "2.0-dev"
     518                "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964"
     519            },
     520            "dist": {
     521                "type": "zip",
     522                "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964",
     523                "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964",
     524                "shasum": ""
     525            },
     526            "require": {
     527                "php": ">=8.2"
     528            },
     529            "require-dev": {
     530                "phpunit/phpunit": "^11.0"
     531            },
     532            "type": "library",
     533            "extra": {
     534                "branch-alias": {
     535                    "dev-main": "4.0-dev"
    593536                }
    594537            },
     
    616559            "support": {
    617560                "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
    618                 "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
    619             },
    620             "funding": [
    621                 {
    622                     "url": "https://github.com/sebastianbergmann",
    623                     "type": "github"
    624                 }
    625             ],
    626             "time": "2020-10-26T05:33:50+00:00"
     561                "security": "https://github.com/sebastianbergmann/php-text-template/security/policy",
     562                "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1"
     563            },
     564            "funding": [
     565                {
     566                    "url": "https://github.com/sebastianbergmann",
     567                    "type": "github"
     568                }
     569            ],
     570            "time": "2024-07-03T05:08:43+00:00"
    627571        },
    628572        {
    629573            "name": "phpunit/php-timer",
    630             "version": "5.0.3",
     574            "version": "7.0.1",
    631575            "source": {
    632576                "type": "git",
    633577                "url": "https://github.com/sebastianbergmann/php-timer.git",
    634                 "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
    635             },
    636             "dist": {
    637                 "type": "zip",
    638                 "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
    639                 "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
    640                 "shasum": ""
    641             },
    642             "require": {
    643                 "php": ">=7.3"
    644             },
    645             "require-dev": {
    646                 "phpunit/phpunit": "^9.3"
    647             },
    648             "type": "library",
    649             "extra": {
    650                 "branch-alias": {
    651                     "dev-master": "5.0-dev"
     578                "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3"
     579            },
     580            "dist": {
     581                "type": "zip",
     582                "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3",
     583                "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3",
     584                "shasum": ""
     585            },
     586            "require": {
     587                "php": ">=8.2"
     588            },
     589            "require-dev": {
     590                "phpunit/phpunit": "^11.0"
     591            },
     592            "type": "library",
     593            "extra": {
     594                "branch-alias": {
     595                    "dev-main": "7.0-dev"
    652596                }
    653597            },
     
    675619            "support": {
    676620                "issues": "https://github.com/sebastianbergmann/php-timer/issues",
    677                 "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
    678             },
    679             "funding": [
    680                 {
    681                     "url": "https://github.com/sebastianbergmann",
    682                     "type": "github"
    683                 }
    684             ],
    685             "time": "2020-10-26T13:16:10+00:00"
     621                "security": "https://github.com/sebastianbergmann/php-timer/security/policy",
     622                "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1"
     623            },
     624            "funding": [
     625                {
     626                    "url": "https://github.com/sebastianbergmann",
     627                    "type": "github"
     628                }
     629            ],
     630            "time": "2024-07-03T05:09:35+00:00"
    686631        },
    687632        {
    688633            "name": "phpunit/phpunit",
    689             "version": "9.6.6",
     634            "version": "11.4.3",
    690635            "source": {
    691636                "type": "git",
    692637                "url": "https://github.com/sebastianbergmann/phpunit.git",
    693                 "reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115"
    694             },
    695             "dist": {
    696                 "type": "zip",
    697                 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b65d59a059d3004a040c16a82e07bbdf6cfdd115",
    698                 "reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115",
    699                 "shasum": ""
    700             },
    701             "require": {
    702                 "doctrine/instantiator": "^1.3.1 || ^2",
     638                "reference": "e8e8ed1854de5d36c088ec1833beae40d2dedd76"
     639            },
     640            "dist": {
     641                "type": "zip",
     642                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e8e8ed1854de5d36c088ec1833beae40d2dedd76",
     643                "reference": "e8e8ed1854de5d36c088ec1833beae40d2dedd76",
     644                "shasum": ""
     645            },
     646            "require": {
    703647                "ext-dom": "*",
    704648                "ext-json": "*",
     
    707651                "ext-xml": "*",
    708652                "ext-xmlwriter": "*",
    709                 "myclabs/deep-copy": "^1.10.1",
    710                 "phar-io/manifest": "^2.0.3",
    711                 "phar-io/version": "^3.0.2",
    712                 "php": ">=7.3",
    713                 "phpunit/php-code-coverage": "^9.2.13",
    714                 "phpunit/php-file-iterator": "^3.0.5",
    715                 "phpunit/php-invoker": "^3.1.1",
    716                 "phpunit/php-text-template": "^2.0.3",
    717                 "phpunit/php-timer": "^5.0.2",
    718                 "sebastian/cli-parser": "^1.0.1",
    719                 "sebastian/code-unit": "^1.0.6",
    720                 "sebastian/comparator": "^4.0.8",
    721                 "sebastian/diff": "^4.0.3",
    722                 "sebastian/environment": "^5.1.3",
    723                 "sebastian/exporter": "^4.0.5",
    724                 "sebastian/global-state": "^5.0.1",
    725                 "sebastian/object-enumerator": "^4.0.3",
    726                 "sebastian/resource-operations": "^3.0.3",
    727                 "sebastian/type": "^3.2",
    728                 "sebastian/version": "^3.0.2"
     653                "myclabs/deep-copy": "^1.12.0",
     654                "phar-io/manifest": "^2.0.4",
     655                "phar-io/version": "^3.2.1",
     656                "php": ">=8.2",
     657                "phpunit/php-code-coverage": "^11.0.7",
     658                "phpunit/php-file-iterator": "^5.1.0",
     659                "phpunit/php-invoker": "^5.0.1",
     660                "phpunit/php-text-template": "^4.0.1",
     661                "phpunit/php-timer": "^7.0.1",
     662                "sebastian/cli-parser": "^3.0.2",
     663                "sebastian/code-unit": "^3.0.1",
     664                "sebastian/comparator": "^6.1.1",
     665                "sebastian/diff": "^6.0.2",
     666                "sebastian/environment": "^7.2.0",
     667                "sebastian/exporter": "^6.1.3",
     668                "sebastian/global-state": "^7.0.2",
     669                "sebastian/object-enumerator": "^6.0.1",
     670                "sebastian/type": "^5.1.0",
     671                "sebastian/version": "^5.0.2"
    729672            },
    730673            "suggest": {
    731                 "ext-soap": "To be able to generate mocks based on WSDL files",
    732                 "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
     674                "ext-soap": "To be able to generate mocks based on WSDL files"
    733675            },
    734676            "bin": [
     
    738680            "extra": {
    739681                "branch-alias": {
    740                     "dev-master": "9.6-dev"
     682                    "dev-main": "11.4-dev"
    741683                }
    742684            },
     
    770712                "issues": "https://github.com/sebastianbergmann/phpunit/issues",
    771713                "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
    772                 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.6"
     714                "source": "https://github.com/sebastianbergmann/phpunit/tree/11.4.3"
    773715            },
    774716            "funding": [
     
    786728                }
    787729            ],
    788             "time": "2023-03-27T11:43:46+00:00"
     730            "time": "2024-10-28T13:07:50+00:00"
    789731        },
    790732        {
    791733            "name": "sebastian/cli-parser",
    792             "version": "1.0.1",
     734            "version": "3.0.2",
    793735            "source": {
    794736                "type": "git",
    795737                "url": "https://github.com/sebastianbergmann/cli-parser.git",
    796                 "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2"
    797             },
    798             "dist": {
    799                 "type": "zip",
    800                 "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2",
    801                 "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2",
    802                 "shasum": ""
    803             },
    804             "require": {
    805                 "php": ">=7.3"
    806             },
    807             "require-dev": {
    808                 "phpunit/phpunit": "^9.3"
    809             },
    810             "type": "library",
    811             "extra": {
    812                 "branch-alias": {
    813                     "dev-master": "1.0-dev"
     738                "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180"
     739            },
     740            "dist": {
     741                "type": "zip",
     742                "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180",
     743                "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180",
     744                "shasum": ""
     745            },
     746            "require": {
     747                "php": ">=8.2"
     748            },
     749            "require-dev": {
     750                "phpunit/phpunit": "^11.0"
     751            },
     752            "type": "library",
     753            "extra": {
     754                "branch-alias": {
     755                    "dev-main": "3.0-dev"
    814756                }
    815757            },
     
    834776            "support": {
    835777                "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
    836                 "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1"
    837             },
    838             "funding": [
    839                 {
    840                     "url": "https://github.com/sebastianbergmann",
    841                     "type": "github"
    842                 }
    843             ],
    844             "time": "2020-09-28T06:08:49+00:00"
     778                "security": "https://github.com/sebastianbergmann/cli-parser/security/policy",
     779                "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2"
     780            },
     781            "funding": [
     782                {
     783                    "url": "https://github.com/sebastianbergmann",
     784                    "type": "github"
     785                }
     786            ],
     787            "time": "2024-07-03T04:41:36+00:00"
    845788        },
    846789        {
    847790            "name": "sebastian/code-unit",
    848             "version": "1.0.8",
     791            "version": "3.0.1",
    849792            "source": {
    850793                "type": "git",
    851794                "url": "https://github.com/sebastianbergmann/code-unit.git",
    852                 "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
    853             },
    854             "dist": {
    855                 "type": "zip",
    856                 "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
    857                 "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
    858                 "shasum": ""
    859             },
    860             "require": {
    861                 "php": ">=7.3"
    862             },
    863             "require-dev": {
    864                 "phpunit/phpunit": "^9.3"
    865             },
    866             "type": "library",
    867             "extra": {
    868                 "branch-alias": {
    869                     "dev-master": "1.0-dev"
     795                "reference": "6bb7d09d6623567178cf54126afa9c2310114268"
     796            },
     797            "dist": {
     798                "type": "zip",
     799                "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6bb7d09d6623567178cf54126afa9c2310114268",
     800                "reference": "6bb7d09d6623567178cf54126afa9c2310114268",
     801                "shasum": ""
     802            },
     803            "require": {
     804                "php": ">=8.2"
     805            },
     806            "require-dev": {
     807                "phpunit/phpunit": "^11.0"
     808            },
     809            "type": "library",
     810            "extra": {
     811                "branch-alias": {
     812                    "dev-main": "3.0-dev"
    870813                }
    871814            },
     
    890833            "support": {
    891834                "issues": "https://github.com/sebastianbergmann/code-unit/issues",
    892                 "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
    893             },
    894             "funding": [
    895                 {
    896                     "url": "https://github.com/sebastianbergmann",
    897                     "type": "github"
    898                 }
    899             ],
    900             "time": "2020-10-26T13:08:54+00:00"
     835                "security": "https://github.com/sebastianbergmann/code-unit/security/policy",
     836                "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.1"
     837            },
     838            "funding": [
     839                {
     840                    "url": "https://github.com/sebastianbergmann",
     841                    "type": "github"
     842                }
     843            ],
     844            "time": "2024-07-03T04:44:28+00:00"
    901845        },
    902846        {
    903847            "name": "sebastian/code-unit-reverse-lookup",
    904             "version": "2.0.3",
     848            "version": "4.0.1",
    905849            "source": {
    906850                "type": "git",
    907851                "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
    908                 "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
    909             },
    910             "dist": {
    911                 "type": "zip",
    912                 "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
    913                 "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
    914                 "shasum": ""
    915             },
    916             "require": {
    917                 "php": ">=7.3"
    918             },
    919             "require-dev": {
    920                 "phpunit/phpunit": "^9.3"
    921             },
    922             "type": "library",
    923             "extra": {
    924                 "branch-alias": {
    925                     "dev-master": "2.0-dev"
     852                "reference": "183a9b2632194febd219bb9246eee421dad8d45e"
     853            },
     854            "dist": {
     855                "type": "zip",
     856                "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e",
     857                "reference": "183a9b2632194febd219bb9246eee421dad8d45e",
     858                "shasum": ""
     859            },
     860            "require": {
     861                "php": ">=8.2"
     862            },
     863            "require-dev": {
     864                "phpunit/phpunit": "^11.0"
     865            },
     866            "type": "library",
     867            "extra": {
     868                "branch-alias": {
     869                    "dev-main": "4.0-dev"
    926870                }
    927871            },
     
    945889            "support": {
    946890                "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
    947                 "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
    948             },
    949             "funding": [
    950                 {
    951                     "url": "https://github.com/sebastianbergmann",
    952                     "type": "github"
    953                 }
    954             ],
    955             "time": "2020-09-28T05:30:19+00:00"
     891                "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy",
     892                "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1"
     893            },
     894            "funding": [
     895                {
     896                    "url": "https://github.com/sebastianbergmann",
     897                    "type": "github"
     898                }
     899            ],
     900            "time": "2024-07-03T04:45:54+00:00"
    956901        },
    957902        {
    958903            "name": "sebastian/comparator",
    959             "version": "4.0.8",
     904            "version": "6.2.1",
    960905            "source": {
    961906                "type": "git",
    962907                "url": "https://github.com/sebastianbergmann/comparator.git",
    963                 "reference": "fa0f136dd2334583309d32b62544682ee972b51a"
    964             },
    965             "dist": {
    966                 "type": "zip",
    967                 "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a",
    968                 "reference": "fa0f136dd2334583309d32b62544682ee972b51a",
    969                 "shasum": ""
    970             },
    971             "require": {
    972                 "php": ">=7.3",
    973                 "sebastian/diff": "^4.0",
    974                 "sebastian/exporter": "^4.0"
    975             },
    976             "require-dev": {
    977                 "phpunit/phpunit": "^9.3"
    978             },
    979             "type": "library",
    980             "extra": {
    981                 "branch-alias": {
    982                     "dev-master": "4.0-dev"
     908                "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739"
     909            },
     910            "dist": {
     911                "type": "zip",
     912                "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/43d129d6a0f81c78bee378b46688293eb7ea3739",
     913                "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739",
     914                "shasum": ""
     915            },
     916            "require": {
     917                "ext-dom": "*",
     918                "ext-mbstring": "*",
     919                "php": ">=8.2",
     920                "sebastian/diff": "^6.0",
     921                "sebastian/exporter": "^6.0"
     922            },
     923            "require-dev": {
     924                "phpunit/phpunit": "^11.4"
     925            },
     926            "type": "library",
     927            "extra": {
     928                "branch-alias": {
     929                    "dev-main": "6.2-dev"
    983930                }
    984931            },
     
    1019966            "support": {
    1020967                "issues": "https://github.com/sebastianbergmann/comparator/issues",
    1021                 "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8"
    1022             },
    1023             "funding": [
    1024                 {
    1025                     "url": "https://github.com/sebastianbergmann",
    1026                     "type": "github"
    1027                 }
    1028             ],
    1029             "time": "2022-09-14T12:41:17+00:00"
     968                "security": "https://github.com/sebastianbergmann/comparator/security/policy",
     969                "source": "https://github.com/sebastianbergmann/comparator/tree/6.2.1"
     970            },
     971            "funding": [
     972                {
     973                    "url": "https://github.com/sebastianbergmann",
     974                    "type": "github"
     975                }
     976            ],
     977            "time": "2024-10-31T05:30:08+00:00"
    1030978        },
    1031979        {
    1032980            "name": "sebastian/complexity",
    1033             "version": "2.0.2",
     981            "version": "4.0.1",
    1034982            "source": {
    1035983                "type": "git",
    1036984                "url": "https://github.com/sebastianbergmann/complexity.git",
    1037                 "reference": "739b35e53379900cc9ac327b2147867b8b6efd88"
    1038             },
    1039             "dist": {
    1040                 "type": "zip",
    1041                 "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88",
    1042                 "reference": "739b35e53379900cc9ac327b2147867b8b6efd88",
    1043                 "shasum": ""
    1044             },
    1045             "require": {
    1046                 "nikic/php-parser": "^4.7",
    1047                 "php": ">=7.3"
    1048             },
    1049             "require-dev": {
    1050                 "phpunit/phpunit": "^9.3"
    1051             },
    1052             "type": "library",
    1053             "extra": {
    1054                 "branch-alias": {
    1055                     "dev-master": "2.0-dev"
     985                "reference": "ee41d384ab1906c68852636b6de493846e13e5a0"
     986            },
     987            "dist": {
     988                "type": "zip",
     989                "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0",
     990                "reference": "ee41d384ab1906c68852636b6de493846e13e5a0",
     991                "shasum": ""
     992            },
     993            "require": {
     994                "nikic/php-parser": "^5.0",
     995                "php": ">=8.2"
     996            },
     997            "require-dev": {
     998                "phpunit/phpunit": "^11.0"
     999            },
     1000            "type": "library",
     1001            "extra": {
     1002                "branch-alias": {
     1003                    "dev-main": "4.0-dev"
    10561004                }
    10571005            },
     
    10761024            "support": {
    10771025                "issues": "https://github.com/sebastianbergmann/complexity/issues",
    1078                 "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2"
    1079             },
    1080             "funding": [
    1081                 {
    1082                     "url": "https://github.com/sebastianbergmann",
    1083                     "type": "github"
    1084                 }
    1085             ],
    1086             "time": "2020-10-26T15:52:27+00:00"
     1026                "security": "https://github.com/sebastianbergmann/complexity/security/policy",
     1027                "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1"
     1028            },
     1029            "funding": [
     1030                {
     1031                    "url": "https://github.com/sebastianbergmann",
     1032                    "type": "github"
     1033                }
     1034            ],
     1035            "time": "2024-07-03T04:49:50+00:00"
    10871036        },
    10881037        {
    10891038            "name": "sebastian/diff",
    1090             "version": "4.0.4",
     1039            "version": "6.0.2",
    10911040            "source": {
    10921041                "type": "git",
    10931042                "url": "https://github.com/sebastianbergmann/diff.git",
    1094                 "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d"
    1095             },
    1096             "dist": {
    1097                 "type": "zip",
    1098                 "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d",
    1099                 "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d",
    1100                 "shasum": ""
    1101             },
    1102             "require": {
    1103                 "php": ">=7.3"
    1104             },
    1105             "require-dev": {
    1106                 "phpunit/phpunit": "^9.3",
     1043                "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544"
     1044            },
     1045            "dist": {
     1046                "type": "zip",
     1047                "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544",
     1048                "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544",
     1049                "shasum": ""
     1050            },
     1051            "require": {
     1052                "php": ">=8.2"
     1053            },
     1054            "require-dev": {
     1055                "phpunit/phpunit": "^11.0",
    11071056                "symfony/process": "^4.2 || ^5"
    11081057            },
     
    11101059            "extra": {
    11111060                "branch-alias": {
    1112                     "dev-master": "4.0-dev"
     1061                    "dev-main": "6.0-dev"
    11131062                }
    11141063            },
     
    11421091            "support": {
    11431092                "issues": "https://github.com/sebastianbergmann/diff/issues",
    1144                 "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4"
    1145             },
    1146             "funding": [
    1147                 {
    1148                     "url": "https://github.com/sebastianbergmann",
    1149                     "type": "github"
    1150                 }
    1151             ],
    1152             "time": "2020-10-26T13:10:38+00:00"
     1093                "security": "https://github.com/sebastianbergmann/diff/security/policy",
     1094                "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2"
     1095            },
     1096            "funding": [
     1097                {
     1098                    "url": "https://github.com/sebastianbergmann",
     1099                    "type": "github"
     1100                }
     1101            ],
     1102            "time": "2024-07-03T04:53:05+00:00"
    11531103        },
    11541104        {
    11551105            "name": "sebastian/environment",
    1156             "version": "5.1.5",
     1106            "version": "7.2.0",
    11571107            "source": {
    11581108                "type": "git",
    11591109                "url": "https://github.com/sebastianbergmann/environment.git",
    1160                 "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed"
    1161             },
    1162             "dist": {
    1163                 "type": "zip",
    1164                 "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
    1165                 "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
    1166                 "shasum": ""
    1167             },
    1168             "require": {
    1169                 "php": ">=7.3"
    1170             },
    1171             "require-dev": {
    1172                 "phpunit/phpunit": "^9.3"
     1110                "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5"
     1111            },
     1112            "dist": {
     1113                "type": "zip",
     1114                "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5",
     1115                "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5",
     1116                "shasum": ""
     1117            },
     1118            "require": {
     1119                "php": ">=8.2"
     1120            },
     1121            "require-dev": {
     1122                "phpunit/phpunit": "^11.0"
    11731123            },
    11741124            "suggest": {
     
    11781128            "extra": {
    11791129                "branch-alias": {
    1180                     "dev-master": "5.1-dev"
     1130                    "dev-main": "7.2-dev"
    11811131                }
    11821132            },
     
    11971147            ],
    11981148            "description": "Provides functionality to handle HHVM/PHP environments",
    1199             "homepage": "http://www.github.com/sebastianbergmann/environment",
     1149            "homepage": "https://github.com/sebastianbergmann/environment",
    12001150            "keywords": [
    12011151                "Xdebug",
     
    12051155            "support": {
    12061156                "issues": "https://github.com/sebastianbergmann/environment/issues",
    1207                 "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5"
    1208             },
    1209             "funding": [
    1210                 {
    1211                     "url": "https://github.com/sebastianbergmann",
    1212                     "type": "github"
    1213                 }
    1214             ],
    1215             "time": "2023-02-03T06:03:51+00:00"
     1157                "security": "https://github.com/sebastianbergmann/environment/security/policy",
     1158                "source": "https://github.com/sebastianbergmann/environment/tree/7.2.0"
     1159            },
     1160            "funding": [
     1161                {
     1162                    "url": "https://github.com/sebastianbergmann",
     1163                    "type": "github"
     1164                }
     1165            ],
     1166            "time": "2024-07-03T04:54:44+00:00"
    12161167        },
    12171168        {
    12181169            "name": "sebastian/exporter",
    1219             "version": "4.0.5",
     1170            "version": "6.1.3",
    12201171            "source": {
    12211172                "type": "git",
    12221173                "url": "https://github.com/sebastianbergmann/exporter.git",
    1223                 "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d"
    1224             },
    1225             "dist": {
    1226                 "type": "zip",
    1227                 "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d",
    1228                 "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d",
    1229                 "shasum": ""
    1230             },
    1231             "require": {
    1232                 "php": ">=7.3",
    1233                 "sebastian/recursion-context": "^4.0"
    1234             },
    1235             "require-dev": {
     1174                "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e"
     1175            },
     1176            "dist": {
     1177                "type": "zip",
     1178                "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e",
     1179                "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e",
     1180                "shasum": ""
     1181            },
     1182            "require": {
    12361183                "ext-mbstring": "*",
    1237                 "phpunit/phpunit": "^9.3"
    1238             },
    1239             "type": "library",
    1240             "extra": {
    1241                 "branch-alias": {
    1242                     "dev-master": "4.0-dev"
     1184                "php": ">=8.2",
     1185                "sebastian/recursion-context": "^6.0"
     1186            },
     1187            "require-dev": {
     1188                "phpunit/phpunit": "^11.2"
     1189            },
     1190            "type": "library",
     1191            "extra": {
     1192                "branch-alias": {
     1193                    "dev-main": "6.1-dev"
    12431194                }
    12441195            },
     
    12821233            "support": {
    12831234                "issues": "https://github.com/sebastianbergmann/exporter/issues",
    1284                 "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5"
    1285             },
    1286             "funding": [
    1287                 {
    1288                     "url": "https://github.com/sebastianbergmann",
    1289                     "type": "github"
    1290                 }
    1291             ],
    1292             "time": "2022-09-14T06:03:37+00:00"
     1235                "security": "https://github.com/sebastianbergmann/exporter/security/policy",
     1236                "source": "https://github.com/sebastianbergmann/exporter/tree/6.1.3"
     1237            },
     1238            "funding": [
     1239                {
     1240                    "url": "https://github.com/sebastianbergmann",
     1241                    "type": "github"
     1242                }
     1243            ],
     1244            "time": "2024-07-03T04:56:19+00:00"
    12931245        },
    12941246        {
    12951247            "name": "sebastian/global-state",
    1296             "version": "5.0.5",
     1248            "version": "7.0.2",
    12971249            "source": {
    12981250                "type": "git",
    12991251                "url": "https://github.com/sebastianbergmann/global-state.git",
    1300                 "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2"
    1301             },
    1302             "dist": {
    1303                 "type": "zip",
    1304                 "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2",
    1305                 "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2",
    1306                 "shasum": ""
    1307             },
    1308             "require": {
    1309                 "php": ">=7.3",
    1310                 "sebastian/object-reflector": "^2.0",
    1311                 "sebastian/recursion-context": "^4.0"
     1252                "reference": "3be331570a721f9a4b5917f4209773de17f747d7"
     1253            },
     1254            "dist": {
     1255                "type": "zip",
     1256                "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7",
     1257                "reference": "3be331570a721f9a4b5917f4209773de17f747d7",
     1258                "shasum": ""
     1259            },
     1260            "require": {
     1261                "php": ">=8.2",
     1262                "sebastian/object-reflector": "^4.0",
     1263                "sebastian/recursion-context": "^6.0"
    13121264            },
    13131265            "require-dev": {
    13141266                "ext-dom": "*",
    1315                 "phpunit/phpunit": "^9.3"
    1316             },
    1317             "suggest": {
    1318                 "ext-uopz": "*"
    1319             },
    1320             "type": "library",
    1321             "extra": {
    1322                 "branch-alias": {
    1323                     "dev-master": "5.0-dev"
     1267                "phpunit/phpunit": "^11.0"
     1268            },
     1269            "type": "library",
     1270            "extra": {
     1271                "branch-alias": {
     1272                    "dev-main": "7.0-dev"
    13241273                }
    13251274            },
     
    13401289            ],
    13411290            "description": "Snapshotting of global state",
    1342             "homepage": "http://www.github.com/sebastianbergmann/global-state",
     1291            "homepage": "https://www.github.com/sebastianbergmann/global-state",
    13431292            "keywords": [
    13441293                "global state"
     
    13461295            "support": {
    13471296                "issues": "https://github.com/sebastianbergmann/global-state/issues",
    1348                 "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5"
    1349             },
    1350             "funding": [
    1351                 {
    1352                     "url": "https://github.com/sebastianbergmann",
    1353                     "type": "github"
    1354                 }
    1355             ],
    1356             "time": "2022-02-14T08:28:10+00:00"
     1297                "security": "https://github.com/sebastianbergmann/global-state/security/policy",
     1298                "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2"
     1299            },
     1300            "funding": [
     1301                {
     1302                    "url": "https://github.com/sebastianbergmann",
     1303                    "type": "github"
     1304                }
     1305            ],
     1306            "time": "2024-07-03T04:57:36+00:00"
    13571307        },
    13581308        {
    13591309            "name": "sebastian/lines-of-code",
    1360             "version": "1.0.3",
     1310            "version": "3.0.1",
    13611311            "source": {
    13621312                "type": "git",
    13631313                "url": "https://github.com/sebastianbergmann/lines-of-code.git",
    1364                 "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc"
    1365             },
    1366             "dist": {
    1367                 "type": "zip",
    1368                 "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc",
    1369                 "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc",
    1370                 "shasum": ""
    1371             },
    1372             "require": {
    1373                 "nikic/php-parser": "^4.6",
    1374                 "php": ">=7.3"
    1375             },
    1376             "require-dev": {
    1377                 "phpunit/phpunit": "^9.3"
    1378             },
    1379             "type": "library",
    1380             "extra": {
    1381                 "branch-alias": {
    1382                     "dev-master": "1.0-dev"
     1314                "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a"
     1315            },
     1316            "dist": {
     1317                "type": "zip",
     1318                "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a",
     1319                "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a",
     1320                "shasum": ""
     1321            },
     1322            "require": {
     1323                "nikic/php-parser": "^5.0",
     1324                "php": ">=8.2"
     1325            },
     1326            "require-dev": {
     1327                "phpunit/phpunit": "^11.0"
     1328            },
     1329            "type": "library",
     1330            "extra": {
     1331                "branch-alias": {
     1332                    "dev-main": "3.0-dev"
    13831333                }
    13841334            },
     
    14031353            "support": {
    14041354                "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
    1405                 "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3"
    1406             },
    1407             "funding": [
    1408                 {
    1409                     "url": "https://github.com/sebastianbergmann",
    1410                     "type": "github"
    1411                 }
    1412             ],
    1413             "time": "2020-11-28T06:42:11+00:00"
     1355                "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy",
     1356                "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1"
     1357            },
     1358            "funding": [
     1359                {
     1360                    "url": "https://github.com/sebastianbergmann",
     1361                    "type": "github"
     1362                }
     1363            ],
     1364            "time": "2024-07-03T04:58:38+00:00"
    14141365        },
    14151366        {
    14161367            "name": "sebastian/object-enumerator",
    1417             "version": "4.0.4",
     1368            "version": "6.0.1",
    14181369            "source": {
    14191370                "type": "git",
    14201371                "url": "https://github.com/sebastianbergmann/object-enumerator.git",
    1421                 "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
    1422             },
    1423             "dist": {
    1424                 "type": "zip",
    1425                 "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
    1426                 "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
    1427                 "shasum": ""
    1428             },
    1429             "require": {
    1430                 "php": ">=7.3",
    1431                 "sebastian/object-reflector": "^2.0",
    1432                 "sebastian/recursion-context": "^4.0"
    1433             },
    1434             "require-dev": {
    1435                 "phpunit/phpunit": "^9.3"
    1436             },
    1437             "type": "library",
    1438             "extra": {
    1439                 "branch-alias": {
    1440                     "dev-master": "4.0-dev"
     1372                "reference": "f5b498e631a74204185071eb41f33f38d64608aa"
     1373            },
     1374            "dist": {
     1375                "type": "zip",
     1376                "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa",
     1377                "reference": "f5b498e631a74204185071eb41f33f38d64608aa",
     1378                "shasum": ""
     1379            },
     1380            "require": {
     1381                "php": ">=8.2",
     1382                "sebastian/object-reflector": "^4.0",
     1383                "sebastian/recursion-context": "^6.0"
     1384            },
     1385            "require-dev": {
     1386                "phpunit/phpunit": "^11.0"
     1387            },
     1388            "type": "library",
     1389            "extra": {
     1390                "branch-alias": {
     1391                    "dev-main": "6.0-dev"
    14411392                }
    14421393            },
     
    14601411            "support": {
    14611412                "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
    1462                 "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
    1463             },
    1464             "funding": [
    1465                 {
    1466                     "url": "https://github.com/sebastianbergmann",
    1467                     "type": "github"
    1468                 }
    1469             ],
    1470             "time": "2020-10-26T13:12:34+00:00"
     1413                "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy",
     1414                "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1"
     1415            },
     1416            "funding": [
     1417                {
     1418                    "url": "https://github.com/sebastianbergmann",
     1419                    "type": "github"
     1420                }
     1421            ],
     1422            "time": "2024-07-03T05:00:13+00:00"
    14711423        },
    14721424        {
    14731425            "name": "sebastian/object-reflector",
    1474             "version": "2.0.4",
     1426            "version": "4.0.1",
    14751427            "source": {
    14761428                "type": "git",
    14771429                "url": "https://github.com/sebastianbergmann/object-reflector.git",
    1478                 "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
    1479             },
    1480             "dist": {
    1481                 "type": "zip",
    1482                 "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
    1483                 "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
    1484                 "shasum": ""
    1485             },
    1486             "require": {
    1487                 "php": ">=7.3"
    1488             },
    1489             "require-dev": {
    1490                 "phpunit/phpunit": "^9.3"
    1491             },
    1492             "type": "library",
    1493             "extra": {
    1494                 "branch-alias": {
    1495                     "dev-master": "2.0-dev"
     1430                "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9"
     1431            },
     1432            "dist": {
     1433                "type": "zip",
     1434                "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9",
     1435                "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9",
     1436                "shasum": ""
     1437            },
     1438            "require": {
     1439                "php": ">=8.2"
     1440            },
     1441            "require-dev": {
     1442                "phpunit/phpunit": "^11.0"
     1443            },
     1444            "type": "library",
     1445            "extra": {
     1446                "branch-alias": {
     1447                    "dev-main": "4.0-dev"
    14961448                }
    14971449            },
     
    15151467            "support": {
    15161468                "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
    1517                 "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
    1518             },
    1519             "funding": [
    1520                 {
    1521                     "url": "https://github.com/sebastianbergmann",
    1522                     "type": "github"
    1523                 }
    1524             ],
    1525             "time": "2020-10-26T13:14:26+00:00"
     1469                "security": "https://github.com/sebastianbergmann/object-reflector/security/policy",
     1470                "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1"
     1471            },
     1472            "funding": [
     1473                {
     1474                    "url": "https://github.com/sebastianbergmann",
     1475                    "type": "github"
     1476                }
     1477            ],
     1478            "time": "2024-07-03T05:01:32+00:00"
    15261479        },
    15271480        {
    15281481            "name": "sebastian/recursion-context",
    1529             "version": "4.0.5",
     1482            "version": "6.0.2",
    15301483            "source": {
    15311484                "type": "git",
    15321485                "url": "https://github.com/sebastianbergmann/recursion-context.git",
    1533                 "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1"
    1534             },
    1535             "dist": {
    1536                 "type": "zip",
    1537                 "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
    1538                 "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
    1539                 "shasum": ""
    1540             },
    1541             "require": {
    1542                 "php": ">=7.3"
    1543             },
    1544             "require-dev": {
    1545                 "phpunit/phpunit": "^9.3"
    1546             },
    1547             "type": "library",
    1548             "extra": {
    1549                 "branch-alias": {
    1550                     "dev-master": "4.0-dev"
     1486                "reference": "694d156164372abbd149a4b85ccda2e4670c0e16"
     1487            },
     1488            "dist": {
     1489                "type": "zip",
     1490                "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/694d156164372abbd149a4b85ccda2e4670c0e16",
     1491                "reference": "694d156164372abbd149a4b85ccda2e4670c0e16",
     1492                "shasum": ""
     1493            },
     1494            "require": {
     1495                "php": ">=8.2"
     1496            },
     1497            "require-dev": {
     1498                "phpunit/phpunit": "^11.0"
     1499            },
     1500            "type": "library",
     1501            "extra": {
     1502                "branch-alias": {
     1503                    "dev-main": "6.0-dev"
    15511504                }
    15521505            },
     
    15781531            "support": {
    15791532                "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
    1580                 "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5"
    1581             },
    1582             "funding": [
    1583                 {
    1584                     "url": "https://github.com/sebastianbergmann",
    1585                     "type": "github"
    1586                 }
    1587             ],
    1588             "time": "2023-02-03T06:07:39+00:00"
    1589         },
    1590         {
    1591             "name": "sebastian/resource-operations",
    1592             "version": "3.0.3",
    1593             "source": {
    1594                 "type": "git",
    1595                 "url": "https://github.com/sebastianbergmann/resource-operations.git",
    1596                 "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8"
    1597             },
    1598             "dist": {
    1599                 "type": "zip",
    1600                 "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
    1601                 "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
    1602                 "shasum": ""
    1603             },
    1604             "require": {
    1605                 "php": ">=7.3"
    1606             },
    1607             "require-dev": {
    1608                 "phpunit/phpunit": "^9.0"
    1609             },
    1610             "type": "library",
    1611             "extra": {
    1612                 "branch-alias": {
    1613                     "dev-master": "3.0-dev"
    1614                 }
    1615             },
    1616             "autoload": {
    1617                 "classmap": [
    1618                     "src/"
    1619                 ]
    1620             },
    1621             "notification-url": "https://packagist.org/downloads/",
    1622             "license": [
    1623                 "BSD-3-Clause"
    1624             ],
    1625             "authors": [
    1626                 {
    1627                     "name": "Sebastian Bergmann",
    1628                     "email": "sebastian@phpunit.de"
    1629                 }
    1630             ],
    1631             "description": "Provides a list of PHP built-in functions that operate on resources",
    1632             "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
    1633             "support": {
    1634                 "issues": "https://github.com/sebastianbergmann/resource-operations/issues",
    1635                 "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3"
    1636             },
    1637             "funding": [
    1638                 {
    1639                     "url": "https://github.com/sebastianbergmann",
    1640                     "type": "github"
    1641                 }
    1642             ],
    1643             "time": "2020-09-28T06:45:17+00:00"
     1533                "security": "https://github.com/sebastianbergmann/recursion-context/security/policy",
     1534                "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.2"
     1535            },
     1536            "funding": [
     1537                {
     1538                    "url": "https://github.com/sebastianbergmann",
     1539                    "type": "github"
     1540                }
     1541            ],
     1542            "time": "2024-07-03T05:10:34+00:00"
    16441543        },
    16451544        {
    16461545            "name": "sebastian/type",
    1647             "version": "3.2.1",
     1546            "version": "5.1.0",
    16481547            "source": {
    16491548                "type": "git",
    16501549                "url": "https://github.com/sebastianbergmann/type.git",
    1651                 "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7"
    1652             },
    1653             "dist": {
    1654                 "type": "zip",
    1655                 "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
    1656                 "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
    1657                 "shasum": ""
    1658             },
    1659             "require": {
    1660                 "php": ">=7.3"
    1661             },
    1662             "require-dev": {
    1663                 "phpunit/phpunit": "^9.5"
    1664             },
    1665             "type": "library",
    1666             "extra": {
    1667                 "branch-alias": {
    1668                     "dev-master": "3.2-dev"
     1550                "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac"
     1551            },
     1552            "dist": {
     1553                "type": "zip",
     1554                "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/461b9c5da241511a2a0e8f240814fb23ce5c0aac",
     1555                "reference": "461b9c5da241511a2a0e8f240814fb23ce5c0aac",
     1556                "shasum": ""
     1557            },
     1558            "require": {
     1559                "php": ">=8.2"
     1560            },
     1561            "require-dev": {
     1562                "phpunit/phpunit": "^11.3"
     1563            },
     1564            "type": "library",
     1565            "extra": {
     1566                "branch-alias": {
     1567                    "dev-main": "5.1-dev"
    16691568                }
    16701569            },
     
    16891588            "support": {
    16901589                "issues": "https://github.com/sebastianbergmann/type/issues",
    1691                 "source": "https://github.com/sebastianbergmann/type/tree/3.2.1"
    1692             },
    1693             "funding": [
    1694                 {
    1695                     "url": "https://github.com/sebastianbergmann",
    1696                     "type": "github"
    1697                 }
    1698             ],
    1699             "time": "2023-02-03T06:13:03+00:00"
     1590                "security": "https://github.com/sebastianbergmann/type/security/policy",
     1591                "source": "https://github.com/sebastianbergmann/type/tree/5.1.0"
     1592            },
     1593            "funding": [
     1594                {
     1595                    "url": "https://github.com/sebastianbergmann",
     1596                    "type": "github"
     1597                }
     1598            ],
     1599            "time": "2024-09-17T13:12:04+00:00"
    17001600        },
    17011601        {
    17021602            "name": "sebastian/version",
    1703             "version": "3.0.2",
     1603            "version": "5.0.2",
    17041604            "source": {
    17051605                "type": "git",
    17061606                "url": "https://github.com/sebastianbergmann/version.git",
    1707                 "reference": "c6c1022351a901512170118436c764e473f6de8c"
    1708             },
    1709             "dist": {
    1710                 "type": "zip",
    1711                 "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
    1712                 "reference": "c6c1022351a901512170118436c764e473f6de8c",
    1713                 "shasum": ""
    1714             },
    1715             "require": {
    1716                 "php": ">=7.3"
    1717             },
    1718             "type": "library",
    1719             "extra": {
    1720                 "branch-alias": {
    1721                     "dev-master": "3.0-dev"
     1607                "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874"
     1608            },
     1609            "dist": {
     1610                "type": "zip",
     1611                "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874",
     1612                "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874",
     1613                "shasum": ""
     1614            },
     1615            "require": {
     1616                "php": ">=8.2"
     1617            },
     1618            "type": "library",
     1619            "extra": {
     1620                "branch-alias": {
     1621                    "dev-main": "5.0-dev"
    17221622                }
    17231623            },
     
    17421642            "support": {
    17431643                "issues": "https://github.com/sebastianbergmann/version/issues",
    1744                 "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
    1745             },
    1746             "funding": [
    1747                 {
    1748                     "url": "https://github.com/sebastianbergmann",
    1749                     "type": "github"
    1750                 }
    1751             ],
    1752             "time": "2020-09-28T06:39:44+00:00"
     1644                "security": "https://github.com/sebastianbergmann/version/security/policy",
     1645                "source": "https://github.com/sebastianbergmann/version/tree/5.0.2"
     1646            },
     1647            "funding": [
     1648                {
     1649                    "url": "https://github.com/sebastianbergmann",
     1650                    "type": "github"
     1651                }
     1652            ],
     1653            "time": "2024-10-09T05:16:32+00:00"
    17531654        },
    17541655        {
    17551656            "name": "squizlabs/php_codesniffer",
    1756             "version": "3.7.2",
    1757             "source": {
    1758                 "type": "git",
    1759                 "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
    1760                 "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879"
    1761             },
    1762             "dist": {
    1763                 "type": "zip",
    1764                 "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879",
    1765                 "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879",
     1657            "version": "3.10.3",
     1658            "source": {
     1659                "type": "git",
     1660                "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
     1661                "reference": "62d32998e820bddc40f99f8251958aed187a5c9c"
     1662            },
     1663            "dist": {
     1664                "type": "zip",
     1665                "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c",
     1666                "reference": "62d32998e820bddc40f99f8251958aed187a5c9c",
    17661667                "shasum": ""
    17671668            },
     
    17731674            },
    17741675            "require-dev": {
    1775                 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
     1676                "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
    17761677            },
    17771678            "bin": [
    1778                 "bin/phpcs",
    1779                 "bin/phpcbf"
     1679                "bin/phpcbf",
     1680                "bin/phpcs"
    17801681            ],
    17811682            "type": "library",
     
    17921693                {
    17931694                    "name": "Greg Sherwood",
    1794                     "role": "lead"
     1695                    "role": "Former lead"
     1696                },
     1697                {
     1698                    "name": "Juliette Reinders Folmer",
     1699                    "role": "Current lead"
     1700                },
     1701                {
     1702                    "name": "Contributors",
     1703                    "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors"
    17951704                }
    17961705            ],
    17971706            "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
    1798             "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
     1707            "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
    17991708            "keywords": [
    18001709                "phpcs",
     
    18031712            ],
    18041713            "support": {
    1805                 "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
    1806                 "source": "https://github.com/squizlabs/PHP_CodeSniffer",
    1807                 "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
    1808             },
    1809             "time": "2023-02-22T23:07:41+00:00"
     1714                "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues",
     1715                "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy",
     1716                "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer",
     1717                "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki"
     1718            },
     1719            "funding": [
     1720                {
     1721                    "url": "https://github.com/PHPCSStandards",
     1722                    "type": "github"
     1723                },
     1724                {
     1725                    "url": "https://github.com/jrfnl",
     1726                    "type": "github"
     1727                },
     1728                {
     1729                    "url": "https://opencollective.com/php_codesniffer",
     1730                    "type": "open_collective"
     1731                }
     1732            ],
     1733            "time": "2024-09-18T10:38:58+00:00"
    18101734        },
    18111735        {
    18121736            "name": "theseer/tokenizer",
    1813             "version": "1.2.1",
     1737            "version": "1.2.3",
    18141738            "source": {
    18151739                "type": "git",
    18161740                "url": "https://github.com/theseer/tokenizer.git",
    1817                 "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
    1818             },
    1819             "dist": {
    1820                 "type": "zip",
    1821                 "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
    1822                 "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
     1741                "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2"
     1742            },
     1743            "dist": {
     1744                "type": "zip",
     1745                "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
     1746                "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2",
    18231747                "shasum": ""
    18241748            },
     
    18491773            "support": {
    18501774                "issues": "https://github.com/theseer/tokenizer/issues",
    1851                 "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
     1775                "source": "https://github.com/theseer/tokenizer/tree/1.2.3"
    18521776            },
    18531777            "funding": [
     
    18571781                }
    18581782            ],
    1859             "time": "2021-07-28T10:34:58+00:00"
     1783            "time": "2024-03-03T12:36:25+00:00"
    18601784        }
    18611785    ],
     
    18691793    },
    18701794    "platform-dev": [],
    1871     "plugin-api-version": "2.3.0"
     1795    "plugin-api-version": "2.6.0"
    18721796}
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/assets/js/main.min.js

    r2986425 r3207680  
    1 /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.3.0*/
     1/* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.3.1*/
    22!function(S,_,b,y){"use strict";var j={funcs:{}};j.vars={onloaded:!1,$body:S("body"),$window:S(_),$document:S(b),$form_warning:null,is_confirm:!1,form_modified:!1,code_themes:[],is_rtl:S("body").hasClass("rtl")},j.helper={uid:function(e){return(e||"")+Math.random().toString(36).substr(2,9)},preg_quote:function(e){return(e+"").replace(/(\[|\])/g,"\\$1")},name_nested_replace:function(e,t){var n=new RegExp(j.helper.preg_quote(t+"[\\d+]"),"g");e.find(":radio").each(function(){(this.checked||this.orginal_checked)&&(this.orginal_checked=!0)}),e.each(function(e){S(this).find(":input").each(function(){this.name=this.name.replace(n,t+"["+e+"]"),this.orginal_checked&&(this.checked=!0)})})},debounce:function(i,s,c){var a;return function(){var e=this,t=arguments,n=c&&!a;clearTimeout(a),a=setTimeout(function(){a=null,c||i.apply(e,t)},s),n&&i.apply(e,t)}}},S.fn.csf_clone=function(){for(var e=S.fn.clone.apply(this,arguments),t=this.find("select").add(this.filter("select")),n=e.find("select").add(e.filter("select")),i=0;i<t.length;++i)for(var s=0;s<t[i].options.length;++s)!0===t[i].options[s].selected&&(n[i].options[s].selected=!0);return this.find(":radio").each(function(){this.orginal_checked=this.checked}),e},S.fn.csf_expand_all=function(){return this.each(function(){S(this).on("click",function(e){e.preventDefault(),S(".csf-wrapper").toggleClass("csf-show-all"),S(".csf-section").csf_reload_script(),S(this).find(".fa").toggleClass("fa-indent").toggleClass("fa-outdent")})})},S.fn.csf_nav_options=function(){return this.each(function(){var n,e=S(this),t=S(_),i=S("#wpwrap"),s=e.find("a");t.on("hashchange csf.hashchange",function(){var e=_.location.hash.replace("#tab=",""),e=e||s.first().attr("href").replace("#tab=",""),t=S('[data-tab-id="'+e+'"]');t.length&&(t.closest(".csf-tab-item").addClass("csf-tab-expanded").siblings().removeClass("csf-tab-expanded"),t.next().is("ul")&&(e=(t=t.next().find("li").first().find("a")).data("tab-id")),s.removeClass("csf-active"),t.addClass("csf-active"),n&&n.addClass("hidden"),(t=S('[data-section-id="'+e+'"]')).removeClass("hidden"),t.csf_reload_script(),S(".csf-section-id").val(t.index()+1),n=t,i.hasClass("wp-responsive-open")&&(S("html, body").animate({scrollTop:t.offset().top-50},200),i.removeClass("wp-responsive-open")))}).trigger("csf.hashchange")})},S.fn.csf_nav_metabox=function(){return this.each(function(){var n,e=S(this),i=e.find("a"),s=e.parent().find(".csf-section");i.each(function(t){S(this).on("click",function(e){e.preventDefault();e=S(this),i.removeClass("csf-active"),e.addClass("csf-active"),n!==y&&n.addClass("hidden"),e=s.eq(t);e.removeClass("hidden"),e.csf_reload_script(),n=e})}),i.first().trigger("click")})},S.fn.csf_page_templates=function(){this.length&&S(b).on("change",".editor-page-attributes__template select, #page_template, .edit-post-post-status + div select",function(){var e=S(this).val()||"default";S(".csf-page-templates").removeClass("csf-metabox-show").addClass("csf-metabox-hide"),S(".csf-page-"+e.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-")).removeClass("csf-metabox-hide").addClass("csf-metabox-show")})},S.fn.csf_post_formats=function(){this.length&&S(b).on("change",'.editor-post-format select, #formatdiv input[name="post_format"]',function(){var e="0"===(e=S(this).val()||"default")?"default":e;S(".csf-post-formats").removeClass("csf-metabox-show").addClass("csf-metabox-hide"),S(".csf-post-format-"+e).removeClass("csf-metabox-hide").addClass("csf-metabox-show")})},S.fn.csf_search=function(){return this.each(function(){S(this).find("input").on("change keyup",function(){var t=S(this).val(),e=S(".csf-wrapper"),n=e.find(".csf-section").find("> .csf-field:not(.csf-depend-on)"),i=n.find("> .csf-title, .csf-search-tags");3<t.length?(n.addClass("csf-metabox-hide"),e.addClass("csf-search-all"),i.each(function(){var e=S(this);e.text().match(new RegExp(".*?"+t+".*?","i"))&&((e=e.closest(".csf-field")).removeClass("csf-metabox-hide"),e.parent().csf_reload_script())})):(n.removeClass("csf-metabox-hide"),e.removeClass("csf-search-all"))})})},S.fn.csf_sticky=function(){return this.each(function(){function e(){r=i.scrollTop(),f()}var n=S(this),i=S(_),s=n.find(".csf-header-inner"),c=parseInt(s.css("padding-left"))+parseInt(s.css("padding-right")),a=32,r=0,t=!1,o=function(){var e=n.offset().top,e=Math.max(a,e-r),t=i.innerWidth();e<=a&&782<t?(s.css({width:n.outerWidth()-c}),n.css({height:n.outerHeight()}).addClass("csf-sticky")):(s.removeAttr("style"),n.removeAttr("style").removeClass("csf-sticky"))},f=function(){t||requestAnimationFrame(function(){o(),t=!1}),t=!0};i.on("scroll resize",e),e()})},S.fn.csf_dependency=function(){return this.each(function(){var t,n,o,f,e=S(this),i=e.children("[data-controller]");i.length&&(t=S.csf_deps.createRuleset(),n=S.csf_deps.createRuleset(),o=[],f=[],i.each(function(){var i=S(this),e=i.data("controller").split("|"),s=i.data("condition").split("|"),c=i.data("value").toString().split("|"),a=!!i.data("depend-global"),r=a?n:t;S.each(e,function(e,t){var n=c[e]||"",e=s[e]||s[0];(r=r.createRule('[data-depend-id="'+t+'"]',e,n)).include(i),(a?f:o).push(t)})}),o.length&&S.csf_deps.enable(e,t,o),f.length&&S.csf_deps.enable(j.vars.$body,n,f))})},S.fn.csf_field_accordion=function(){return this.each(function(){S(this).find(".csf-accordion-title").on("click",function(){var e=S(this),t=e.find(".csf-accordion-icon"),e=e.next();t.hasClass("fa-angle-right")?t.removeClass("fa-angle-right").addClass("fa-angle-down"):t.removeClass("fa-angle-down").addClass("fa-angle-right"),e.data("opened")||(e.csf_reload_script(),e.data("opened",!0)),e.toggleClass("csf-accordion-open")})})},S.fn.csf_field_backup=function(){return this.each(function(){var t,n,i,s;_.wp.customize!==y&&(n=S(t=this),S("body"),i=n.find(".csf-import"),s=n.find(".csf-reset"),t.notificationOverlay=function(){wp.customize.notifications&&wp.customize.OverlayNotification&&(wp.customize.state("saved").get()||(wp.customize.state("changesetStatus").set("trash"),wp.customize.each(function(e){e._dirty=!1}),wp.customize.state("saved").set(!0)),wp.customize.notifications.add(new wp.customize.OverlayNotification("csf_field_backup_notification",{type:"default",message:"&nbsp;",loading:!0})))},s.on("click",function(e){e.preventDefault(),j.vars.is_confirm&&(t.notificationOverlay(),_.wp.ajax.post("csf-reset",{unique:s.data("unique"),nonce:s.data("nonce")}).done(function(e){_.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))}),i.on("click",function(e){e.preventDefault(),j.vars.is_confirm&&(t.notificationOverlay(),_.wp.ajax.post("csf-import",{unique:i.data("unique"),nonce:i.data("nonce"),data:n.find(".csf-import-data").val()}).done(function(e){_.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))}))})},S.fn.csf_field_background=function(){return this.each(function(){S(this).find(".csf--background-image").csf_reload_script()})},S.fn.csf_field_code_editor=function(){return this.each(function(){var t,i,e,s,c;"function"==typeof CodeMirror&&(t=S(this),i=t.find("textarea"),e=t.find(".CodeMirror"),s=i.data("editor"),e.length&&e.remove(),c=setInterval(function(){var n,e;t.is(":visible")&&(n=CodeMirror.fromTextArea(i[0],s),"default"!==s.theme&&-1===j.vars.code_themes.indexOf(s.theme)&&(e=S("<link>"),S("#csf-codemirror-css").after(e),e.attr({rel:"stylesheet",id:"csf-codemirror-"+s.theme+"-css",href:s.cdnURL+"/theme/"+s.theme+".min.css",type:"text/css",media:"all"}),j.vars.code_themes.push(s.theme)),CodeMirror.modeURL=s.cdnURL+"/mode/%N/%N.min.js",CodeMirror.autoLoadMode(n,s.mode),n.on("change",function(e,t){i.val(n.getValue()).trigger("change")}),clearInterval(c))}))})},S.fn.csf_field_date=function(){return this.each(function(){var e=S(this),n=e.find("input"),i=e.find(".csf-date-settings").data("settings"),i=S.extend({},i,{showAnim:"",beforeShow:function(e,t){S(t.dpDiv).addClass("csf-datepicker-wrapper")},onClose:function(e,t){S(t.dpDiv).removeClass("csf-datepicker-wrapper")}});2===n.length&&(i=S.extend({},i,{onSelect:function(e){S(this),n.first();var t=n.first().attr("id")===S(this).attr("id")?"minDate":"maxDate",e=S.datepicker.parseDate(i.dateFormat,e);n.not(this).datepicker("option",t,e)}})),n.each(function(){var e=S(this);e.hasClass("hasDatepicker")&&e.removeAttr("id").removeClass("hasDatepicker"),e.datepicker(i)})})},S.fn.csf_field_datetime=function(){return this.each(function(){var e=S(this),i=e.find("input"),t=e.find(".csf-datetime-settings").data("settings"),t=S.extend({},t,{onReady:function(e,t,n){S(n.calendarContainer).addClass("csf-flatpickr")}});2===i.length&&(t=S.extend({},t,{onChange:function(e,t,n){"from"===S(n.element).data("type")?i.last().get(0)._flatpickr.set("minDate",e[0]):i.first().get(0)._flatpickr.set("maxDate",e[0])}})),i.each(function(){S(this).flatpickr(t)})})},S.fn.csf_field_fieldset=function(){return this.each(function(){S(this).find(".csf-fieldset-content").csf_reload_script()})},S.fn.csf_field_gallery=function(){return this.each(function(){var s,e=S(this),c=e.find(".csf-edit-gallery"),a=e.find(".csf-clear-gallery"),r=e.find("ul"),o=e.find("input");e.find("img");e.on("click",".csf-button, .csf-edit-gallery",function(e){var t=S(this),n=o.val(),t=t.hasClass("csf-edit-gallery")?"edit":"add",i="add"!=t||n.length?"gallery-edit":"gallery";e.preventDefault(),void 0!==_.wp&&_.wp.media&&_.wp.media.gallery&&("gallery"==i?(s=_.wp.media({library:{type:"image"},frame:"post",state:"gallery",multiple:!0})).open():(s=_.wp.media.gallery.edit('[gallery ids="'+n+'"]'),"add"==t&&s.setState("gallery-library")),s.on("update",function(e){r.empty();e=e.models.map(function(e){var e=e.toJSON(),t=(e.sizes&&e.sizes.thumbnail&&e.sizes.thumbnail.url?e.sizes.thumbnail:e).url;return r.append('<li><img src="'+t+'"></li>'),e.id});o.val(e.join(",")).trigger("change"),a.removeClass("hidden"),c.removeClass("hidden")}))}),a.on("click",function(e){e.preventDefault(),r.empty(),o.val("").trigger("change"),a.addClass("hidden"),c.addClass("hidden")})})},S.fn.csf_field_group=function(){return this.each(function(){function e(e){e.preventDefault();var t,n,i,s,e=c.children(".csf-cloneable-item").length;r.hide(),h&&h<e+1?a.show():(t=(e=S(this).parent().parent()).children(".csf-cloneable-helper").csf_clone(!0),n=e.children(".csf-cloneable-title").csf_clone(),i=e.children(".csf-cloneable-content").csf_clone(),(s=S('<div class="csf-cloneable-item" />')).append(t),s.append(n),s.append(i),c.children().eq(e.index()).after(s),j.helper.name_nested_replace(c.children(".csf-cloneable-item"),l),c.accordion("refresh"),c.csf_customizer_refresh(),c.csf_customizer_listen({closest:!0}),d&&u(c))}function t(e){e.preventDefault(),e=c.children(".csf-cloneable-item").length,a.hide(),r.hide(),p&&e-1<p?r.show():(S(this).closest(".csf-cloneable-item").remove(),j.helper.name_nested_replace(c.children(".csf-cloneable-item"),l),c.csf_customizer_refresh(),d&&u(c))}var n=S(this),i=n.children(".csf-fieldset"),i=i.length?i:n,c=i.children(".csf-cloneable-wrapper"),s=i.children(".csf-cloneable-hidden"),a=i.children(".csf-cloneable-max"),r=i.children(".csf-cloneable-min"),o=c.data("title-by"),f=c.data("title-by-prefix"),l=c.data("field-id"),d=Boolean(Number(c.data("title-number"))),h=parseInt(c.data("max")),p=parseInt(c.data("min")),u=(c.hasClass("ui-accordion")&&c.find(".ui-accordion-header-icon").remove(),function(e){e.find(".csf-cloneable-title-number").each(function(e){S(this).html(S(this).closest(".csf-cloneable-item").index()+1+".")})});c.accordion({header:"> .csf-cloneable-item > .csf-cloneable-title",collapsible:!0,active:!1,animate:!1,heightStyle:"content",icons:{header:"csf-cloneable-header-icon fas fa-angle-right",activeHeader:"csf-cloneable-header-icon fas fa-angle-down"},activate:function(e,t){var i,s,n=t.newPanel,t=t.newHeader;n.length&&!n.data("opened")?(i=t.find(".csf-cloneable-value"),s=[],S.each(o,function(e,t){s.push(n.find('[data-depend-id="'+t+'"]'))}),S.each(s,function(e,t){t.on("change keyup csf.keyup",function(){var n=[];S.each(s,function(e,t){t=t.val();t&&n.push(t)}),n.length&&i.text(n.join(f))}).trigger("csf.keyup")}),n.csf_reload_script(),n.data("opened",!0),n.data("retry",!1)):n.data("retry")&&(n.csf_reload_script_retry(),n.data("retry",!1))}}),c.sortable({axis:"y",handle:".csf-cloneable-title,.csf-cloneable-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",start:function(e,t){c.accordion({active:!1}),c.sortable("refreshPositions"),t.item.children(".csf-cloneable-content").data("retry",!0)},update:function(e,t){j.helper.name_nested_replace(c.children(".csf-cloneable-item"),l),c.csf_customizer_refresh(),d&&u(c)}}),i.children(".csf-cloneable-add").on("click",function(e){e.preventDefault();var t=c.children(".csf-cloneable-item").length;r.hide(),h&&h<t+1?a.show():((e=s.csf_clone(!0)).removeClass("csf-cloneable-hidden"),e.find(':input[name!="_pseudo"]').each(function(){this.name=this.name.replace("___","").replace(l+"[0]",l+"["+t+"]")}),c.append(e),c.accordion("refresh"),c.accordion({active:t}),c.csf_customizer_refresh(),c.csf_customizer_listen({closest:!0}),d&&u(c))}),c.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",e),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",e);c.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",t),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",t)})},S.fn.csf_field_icon=function(){return this.each(function(){var n=S(this);n.on("click",".csf-icon-add",function(e){e.preventDefault();var e=S(this),t=S("#csf-modal-icon");t.removeClass("hidden"),j.vars.$icon_target=n,j.vars.icon_modal_loaded||(t.find(".csf-modal-loading").show(),_.wp.ajax.post("csf-get-icons",{nonce:e.data("nonce")}).done(function(e){t.find(".csf-modal-loading").hide(),j.vars.icon_modal_loaded=!0;var n=t.find(".csf-modal-load").html(e.content);n.on("click","i",function(e){e.preventDefault();e=S(this).attr("title");j.vars.$icon_target.find(".csf-icon-preview i").removeAttr("class").addClass(e),j.vars.$icon_target.find(".csf-icon-preview").removeClass("hidden"),j.vars.$icon_target.find(".csf-icon-remove").removeClass("hidden"),j.vars.$icon_target.find("input").val(e).trigger("change"),t.addClass("hidden")}),t.on("change keyup",".csf-icon-search",function(){var t=S(this).val();n.find("i").each(function(){var e=S(this);e.attr("title").search(new RegExp(t,"i"))<0?e.hide():e.show()})}),t.on("click",".csf-modal-close, .csf-modal-overlay",function(){t.addClass("hidden")})}).fail(function(e){t.find(".csf-modal-loading").hide(),t.find(".csf-modal-load").html(e.error),t.on("click",function(){t.addClass("hidden")})}))}),n.on("click",".csf-icon-remove",function(e){e.preventDefault(),n.find(".csf-icon-preview").addClass("hidden"),n.find("input").val("").trigger("change"),S(this).addClass("hidden")})})},S.fn.csf_field_map=function(){return this.each(function(){var e,t,n,i,s,c,a,r,o,f,l;"undefined"!=typeof L&&(l=(e=S(this)).find(".csf--map-osm"),t=e.find(".csf--map-search input"),n=e.find(".csf--latitude"),i=e.find(".csf--longitude"),s=e.find(".csf--zoom"),c=l.data("map"),a=L.map(l.get(0),c),L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(a),r=L.marker(c.center,{draggable:!0}).addTo(a),o=function(e){n.val(e.lat),i.val(e.lng),s.val(a.getZoom())},a.on("click",function(e){r.setLatLng(e.latlng),o(e.latlng)}),a.on("zoom",function(){o(r.getLatLng())}),r.on("drag",function(){o(r.getLatLng())}),t.length||(t=S('[data-depend-id="'+e.find(".csf--address-field").data("address-field")+'"]')),f={},t.autocomplete({source:function(e,t){var n=e.term;n in f?t(f[n]):S.get("https://nominatim.openstreetmap.org/search",{format:"json",q:n},function(e){e=e.length?e.map(function(e){return{value:e.display_name,label:e.display_name,lat:e.lat,lon:e.lon}},"json"):[{value:"no-data",label:"No Results."}];f[n]=e,t(e)})},select:function(e,t){if("no-data"===t.item.value)return!1;t=L.latLng(t.item.lat,t.item.lon);a.panTo(t),r.setLatLng(t),o(t)},create:function(e,t){S(this).autocomplete("widget").addClass("csf-map-ui-autocomplate")}}),n.on("change",l=function(){var e=L.latLng(n.val(),i.val());a.panTo(e),r.setLatLng(e)}),i.on("change",l))})},S.fn.csf_field_link=function(){return this.each(function(){var i=S(this),e=i.find(".csf--link"),s=i.find(".csf--add"),c=i.find(".csf--edit"),a=i.find(".csf--remove"),r=i.find(".csf--result"),t=j.helper.uid("csf-wplink-textarea-");s.on("click",function(e){e.preventDefault(),_.wpLink.open(t)}),c.on("click",function(e){e.preventDefault(),s.trigger("click"),S("#wp-link-url").val(i.find(".csf--url").val()),S("#wp-link-text").val(i.find(".csf--text").val()),S("#wp-link-target").prop("checked","_blank"===i.find(".csf--target").val())}),a.on("click",function(e){e.preventDefault(),i.find(".csf--url").val("").trigger("change"),i.find(".csf--text").val(""),i.find(".csf--target").val(""),s.removeClass("hidden"),c.addClass("hidden"),a.addClass("hidden"),r.parent().addClass("hidden")}),e.attr("id",t).on("change",function(){var e=_.wpLink.getAttrs(),t=e.href,n=S("#wp-link-text").val(),e=e.target||"";i.find(".csf--url").val(t).trigger("change"),i.find(".csf--text").val(n),i.find(".csf--target").val(e),r.html('{url:"'+t+'", text:"'+n+'", target:"'+e+'"}'),s.addClass("hidden"),c.removeClass("hidden"),a.removeClass("hidden"),r.parent().removeClass("hidden")})})},S.fn.csf_field_media=function(){return this.each(function(){var n,i=S(this),s=i.find(".csf--button"),c=i.find(".csf--remove"),a=s.data("library")&&s.data("library").split(",")||"",r=!!i.hasClass("csf-assign-field-background")&&i.closest(".csf-field-background").find(".csf--auto-attributes");s.on("click",function(e){e.preventDefault(),void 0!==_.wp&&_.wp.media&&_.wp.media.gallery&&(n||(n=_.wp.media({library:{type:a}})).on("select",function(){var e=n.state().get("selection").first().attributes,t=s.data("preview-size")||"thumbnail";a.length&&-1===a.indexOf(e.subtype)&&-1===a.indexOf(e.type)||(i.find(".csf--id").val(e.id),i.find(".csf--width").val(e.width),i.find(".csf--height").val(e.height),i.find(".csf--alt").val(e.alt),i.find(".csf--title").val(e.title),i.find(".csf--description").val(e.description),t=void 0!==e.sizes&&void 0!==e.sizes.thumbnail&&"thumbnail"===t?e.sizes.thumbnail.url:void 0!==e.sizes&&void 0!==e.sizes.full?e.sizes.full.url:"image"===e.type?e.url:e.icon,r&&r.removeClass("csf--attributes-hidden"),c.removeClass("hidden"),i.find(".csf--preview").removeClass("hidden"),i.find(".csf--src").attr("src",t),i.find(".csf--thumbnail").val(t),i.find(".csf--url").val(e.url).trigger("change"))}),n.open())}),c.on("click",function(e){e.preventDefault(),r&&r.addClass("csf--attributes-hidden"),c.addClass("hidden"),i.find("input").val(""),i.find(".csf--preview").addClass("hidden"),i.find(".csf--url").trigger("change")})})},S.fn.csf_field_repeater=function(){return this.each(function(){function e(e){e.preventDefault();var t,n,i,e=s.children(".csf-repeater-item").length;r.hide(),f&&f<e+1?a.show():(t=(e=S(this).parent().parent().parent()).children(".csf-repeater-content").csf_clone(),n=e.children(".csf-repeater-helper").csf_clone(!0),(i=S('<div class="csf-repeater-item" />')).append(t),i.append(n),s.children().eq(e.index()).after(i),i.children(".csf-repeater-content").csf_reload_script(),j.helper.name_nested_replace(s.children(".csf-repeater-item"),o),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}))}function t(e){e.preventDefault(),e=s.children(".csf-repeater-item").length,a.hide(),r.hide(),l&&e-1<l?r.show():(S(this).closest(".csf-repeater-item").remove(),j.helper.name_nested_replace(s.children(".csf-repeater-item"),o),s.csf_customizer_refresh())}var n=S(this),i=n.children(".csf-fieldset"),i=i.length?i:n,s=i.children(".csf-repeater-wrapper"),c=i.children(".csf-repeater-hidden"),a=i.children(".csf-repeater-max"),r=i.children(".csf-repeater-min"),o=s.data("field-id"),f=parseInt(s.data("max")),l=parseInt(s.data("min"));s.children(".csf-repeater-item").children(".csf-repeater-content").csf_reload_script(),s.sortable({axis:"y",handle:".csf-repeater-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,t){j.helper.name_nested_replace(s.children(".csf-repeater-item"),o),s.csf_customizer_refresh(),t.item.csf_reload_script_retry()}}),i.children(".csf-repeater-add").on("click",function(e){e.preventDefault();var t=s.children(".csf-repeater-item").length;r.hide(),f&&f<t+1?a.show():((e=c.csf_clone(!0)).removeClass("csf-repeater-hidden"),e.find(':input[name!="_pseudo"]').each(function(){this.name=this.name.replace("___","").replace(o+"[0]",o+"["+t+"]")}),s.append(e),e.children(".csf-repeater-content").csf_reload_script(),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}))}),s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-clone",e),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-clone",e);s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-remove",t),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-remove",t)})},S.fn.csf_field_slider=function(){return this.each(function(){var e=S(this),n=e.find("input"),t=e.find(".csf-slider-ui"),e=n.data(),i=n.val()||0;t.hasClass("ui-slider")&&t.empty(),t.slider({range:"min",value:i,min:e.min||0,max:e.max||100,step:e.step||1,slide:function(e,t){n.val(t.value).trigger("change")}}),n.on("keyup",function(){t.slider("value",n.val())})})},S.fn.csf_field_sortable=function(){return this.each(function(){var n=S(this).find(".csf-sortable");n.sortable({axis:"y",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,t){n.csf_customizer_refresh()}}),n.find(".csf-sortable-content").csf_reload_script()})},S.fn.csf_field_sorter=function(){return this.each(function(){var i=S(this),e=i.find(".csf-enabled"),t=i.find(".csf-disabled"),t=!!t.length&&t;e.sortable({connectWith:t,placeholder:"ui-sortable-placeholder",update:function(e,t){var n=t.item.find("input");t.item.parent().hasClass("csf-enabled")?n.attr("name",n.attr("name").replace("disabled","enabled")):n.attr("name",n.attr("name").replace("enabled","disabled")),i.csf_customizer_refresh()}}),t&&t.sortable({connectWith:e,placeholder:"ui-sortable-placeholder",update:function(e,t){i.csf_customizer_refresh()}})})},S.fn.csf_field_spinner=function(){return this.each(function(){var e=S(this),n=e.find("input"),e=e.find(".ui-button"),i=n.data();e.length&&e.remove(),n.spinner({min:i.min||0,max:i.max||100,step:i.step||1,create:function(e,t){i.unit&&n.after('<span class="ui-button csf--unit">'+i.unit+"</span>")},spin:function(e,t){n.val(t.value).trigger("change")}})})},S.fn.csf_field_switcher=function(){return this.each(function(){var n=S(this).find(".csf--switcher");n.on("click",function(){var e=0,t=n.find("input");n.hasClass("csf--active")?n.removeClass("csf--active"):(e=1,n.addClass("csf--active")),t.val(e).trigger("change")})})},S.fn.csf_field_tabbed=function(){return this.each(function(){var e=S(this),t=e.find(".csf-tabbed-nav a"),n=e.find(".csf-tabbed-content");n.eq(0).csf_reload_script(),t.on("click",function(e){e.preventDefault();var e=S(this),t=e.index(),t=n.eq(t);e.addClass("csf-tabbed-active").siblings().removeClass("csf-tabbed-active"),t.csf_reload_script(),t.removeClass("hidden").siblings().addClass("hidden")})})},S.fn.csf_field_typography=function(){return this.each(function(){var x=this,z=S(this),i=[],D=csf_typography_json.webfonts,t=csf_typography_json.googlestyles,O=csf_typography_json.defaultstyles;x.sanitize_subset=function(e){return e=(e=e.replace("-ext"," Extended")).charAt(0).toUpperCase()+e.slice(1)},x.sanitize_style=function(e){return t[e]||e},x.load_google_font=function(e,t,n){e&&"object"==typeof WebFont&&(t=t?t.replace("normal",""):"",n=n?n.replace("normal",""):"",-1===i.indexOf(e=t||n?e+":"+t+n:e)&&WebFont.load({google:{families:[e]}}),i.push(e))},x.append_select_options=function(e,t,s,c,a){e.find("option").not(":first").remove();var r="";S.each(t,function(e,t){var n=t,i=a?s&&-1!==s.indexOf(t)?" selected":"":s&&s===t?" selected":"";"subset"===c?n=x.sanitize_subset(t):"style"===c&&(n=x.sanitize_style(t)),r+='<option value="'+t+'"'+i+">"+n+"</option>"}),e.append(r).trigger("csf.change").trigger("chosen:updated")},x.init=function(){var c,a,r,o,f,l,d,h,g,p=[],e=z.find(".csf--typography"),u=z.find(".csf--type"),v=z.find(".csf--block-font-style"),m=e.data("unit"),_=e.data("line-height-unit"),t=e.data("exclude")?e.data("exclude").split(","):[],b=(z.find(".csf--chosen").length&&z.find("select").each(function(){var e=S(this),t=e.parent().find(".chosen-container");t.length&&t.remove(),e.chosen({allow_single_deselect:!0,disable_search_threshold:15,width:"100%"})}),z.find(".csf--font-family")),i=b.val(),s=(b.find("option").not(":first-child").remove(),""),y=(S.each(D,function(n,e){t&&-1!==t.indexOf(n)||(s+='<optgroup label="'+e.label+'">',S.each(e.fonts,function(e,t){s+='<option value="'+(t="object"==typeof t?e:t)+'" data-type="'+n+'"'+(t===i?" selected":"")+">"+t+"</option>"}),s+="</optgroup>")}),b.append(s).trigger("chosen:updated"),z.find(".csf--block-font-style")),w=(y.length&&(c=z.find(".csf--font-style-select"),a=c.val()?c.val().replace(/normal/g,""):"",c.on("change csf.change",function(e){var t=c.val(),n=(t=!t&&p&&-1===p.indexOf("normal")?p[0]:t)&&"italic"!==t&&"normal"===t?"normal":"",n=t&&"italic"!==t&&"normal"!==t?t.replace("italic",""):n,t=t&&"italic"===t.substr(-6)?"italic":"";z.find(".csf--font-weight").val(n),z.find(".csf--font-style").val(t)}),(r=z.find(".csf--block-extra-styles")).length&&(o=z.find(".csf--extra-styles"),f=o.val())),z.find(".csf--block-subset")),C=(w.length&&(l=z.find(".csf--subset"),d=l.val(),h=l.data("multiple")||!1),z.find(".csf--block-backup-font-family")),k=(b.on("change csf.change",function(e){w.length&&w.addClass("hidden"),r.length&&r.addClass("hidden"),C.length&&C.addClass("hidden");var t,n,i=b.find(":selected"),s=i.val(),i=i.data("type");i&&s?("google"!==i&&"custom"!==i||!C.length||C.removeClass("hidden"),y.length&&(n=O,"google"===i&&D[i].fonts[s][0]?n=D[i].fonts[s][0]:"custom"===i&&D[i].fonts[s]&&(n=D[i].fonts[s]),t=-1!==(p=n).indexOf("normal")?"normal":n[0],t=a&&-1!==n.indexOf(a)?a:t,x.append_select_options(c,n,t,"style"),a=!1,y.removeClass("hidden"),"google"===i&&r.length&&1<n.length&&(x.append_select_options(o,n,f,"style",!0),f=!1,r.removeClass("hidden"))),"google"===i&&w.length&&D[i].fonts[s][1]&&(n=(t=D[i].fonts[s][1]).length<2&&"latin"!==t[0]?t[0]:"",s=d&&-1!==t.indexOf(d)?d:n,s=h&&d?d:s,x.append_select_options(l,t,s,"subset",h),d=!1,w.removeClass("hidden"))):(v.find(":input").val(""),w.length&&(l.find("option").not(":first-child").remove(),l.trigger("chosen:updated")),y.length&&(c.find("option").not(":first-child").remove(),c.trigger("chosen:updated"))),u.val(i)}).trigger("csf.change"),z.find(".csf--block-preview"));k.length&&(g=z.find(".csf--preview"),z.on("change",j.helper.debounce(function(e){k.removeClass("hidden");var t=b.val(),n=z.find(".csf--font-weight").val(),i=z.find(".csf--font-style").val(),s=z.find(".csf--font-size").val(),c=z.find(".csf--font-variant").val(),a=z.find(".csf--line-height").val(),r=z.find(".csf--text-align").val(),o=z.find(".csf--text-transform").val(),f=z.find(".csf--text-decoration").val(),l=z.find(".csf--color").val(),d=z.find(".csf--word-spacing").val(),h=z.find(".csf--letter-spacing").val(),p=z.find(".csf--custom-style").val(),u=("google"===z.find(".csf--type").val()&&x.load_google_font(t,n,i),{});t&&(u.fontFamily=t),n&&(u.fontWeight=n),i&&(u.fontStyle=i),c&&(u.fontVariant=c),s&&(u.fontSize=s+m),a&&(u.lineHeight=a+_),h&&(u.letterSpacing=h+m),d&&(u.wordSpacing=d+m),r&&(u.textAlign=r),o&&(u.textTransform=o),f&&(u.textDecoration=f),l&&(u.color=l),g.removeAttr("style"),p&&g.attr("style",p),g.css(u)},100)),k.on("click",function(){g.toggleClass("csf--black-background");var e=k.find(".csf--toggle");e.hasClass("fa-toggle-off")?e.removeClass("fa-toggle-off").addClass("fa-toggle-on"):e.removeClass("fa-toggle-on").addClass("fa-toggle-off")}),k.hasClass("hidden")||z.trigger("change"))},x.init()})},S.fn.csf_field_upload=function(){return this.each(function(){var t,e=S(this),n=e.find("input"),i=e.find(".csf--button"),s=e.find(".csf--remove"),c=e.find(".csf--preview"),a=e.find(".csf--src"),r=i.data("library")&&i.data("library").split(",")||"";i.on("click",function(e){e.preventDefault(),void 0!==_.wp&&_.wp.media&&_.wp.media.gallery&&(t||(t=_.wp.media({library:{type:r}})).on("select",function(){var e=t.state().get("selection").first().attributes;r.length&&-1===r.indexOf(e.subtype)&&-1===r.indexOf(e.type)||n.val(e.url).trigger("change")}),t.open())}),s.on("click",function(e){e.preventDefault(),n.val("").trigger("change")}),n.on("change",function(e){var t=n.val();t?s.removeClass("hidden"):s.addClass("hidden"),c.length&&(-1!==S.inArray(t.split(".").pop().toLowerCase(),["jpg","jpeg","gif","png","svg","webp"])?(c.removeClass("hidden"),a.attr("src",t)):c.addClass("hidden"))})})},S.fn.csf_field_wp_editor=function(){return this.each(function(){var e,t,n,i,s,c,a,r;void 0!==_.wp.editor&&void 0!==_.tinyMCEPreInit&&void 0!==_.tinyMCEPreInit.mceInit.csf_wp_editor&&(t=(e=S(this)).find(".csf-wp-editor"),n=e.find("textarea"),(e.find(".wp-editor-wrap").length||e.find(".mce-container").length)&&(t.empty(),t.append(n),n.css("display","")),i=j.helper.uid("csf-editor-"),n.attr("id",i),s={tinymce:_.tinyMCEPreInit.mceInit.csf_wp_editor,quicktags:_.tinyMCEPreInit.qtInit.csf_wp_editor},c=t.data("editor-settings"),(r=wp.oldEditor||wp.editor)&&r.hasOwnProperty("autop")&&(wp.editor.autop=r.autop,wp.editor.removep=r.removep,wp.editor.initialize=r.initialize),s.tinymce=S.extend({},s.tinymce,{selector:"#"+i,setup:function(t){t.on("change keyup",function(){var e=c.wpautop?t.getContent():wp.editor.removep(t.getContent());n.val(e).trigger("change")})}}),!1===c.tinymce&&(s.tinymce=!1,t.addClass("csf-no-tinymce")),!1===c.quicktags&&(s.quicktags=!1,t.addClass("csf-no-quicktags")),a=setInterval(function(){e.is(":visible")&&(_.wp.editor.initialize(i,s),clearInterval(a))}),c.media_buttons&&_.csf_media_buttons&&((r=t.find(".wp-media-buttons")).length?r.find(".csf-shortcode-button").data("editor-id",i):((r=S(_.csf_media_buttons)).find(".csf-shortcode-button").data("editor-id",i),t.prepend(r))))})},S.fn.csf_confirm=function(){return this.each(function(){S(this).on("click",function(e){var t=S(this).data("confirm")||_.csf_vars.i18n.confirm;if(!confirm(t))return e.preventDefault(),!1;j.vars.is_confirm=!0,j.vars.form_modified=!1})})},S.fn.serializeObject=function(){var i={};return S.each(this.serializeArray(),function(e,t){var n=t.name,t=t.value;i[n]=i[n]===y?t:S.isArray(i[n])?i[n].concat(t):[i[n],t]}),i},S.fn.csf_save=function(){return this.each(function(){var i,s=S(this),c=S(".csf-save"),a=S(".csf-options"),r=!1;s.on("click",function(e){var t,n;r||(t=s.data("save"),n=s.val(),c.attr("value",t),s.hasClass("csf-save-ajax")?(e.preventDefault(),a.addClass("csf-saving"),c.prop("disabled",!0),_.wp.ajax.post("csf_"+a.data("unique")+"_ajax_save",{data:S("#csf-form").serializeJSONCSF()}).done(function(e){S(".csf-error").remove(),Object.keys(e.errors).length&&(s='<i class="csf-label-error csf-error">!</i>',S.each(e.errors,function(e,t){var e=S('[data-depend-id="'+e+'"]'),n=S('a[href="#tab='+e.closest(".csf-section").data("section-id")+'"]'),i=n.closest(".csf-tab-item");e.closest(".csf-fieldset").append('<p class="csf-error csf-error-text">'+t+"</p>"),n.find(".csf-error").length||n.append(s),i.find(".csf-arrow .csf-error").length||i.find(".csf-arrow").append(s)})),a.removeClass("csf-saving"),c.prop("disabled",!1).attr("value",n),r=!1,j.vars.form_modified=!1,j.vars.$form_warning.hide(),clearTimeout(i);var s,t=S(".csf-form-success");t.empty().append(e.notice).fadeIn("fast",function(){i=setTimeout(function(){t.fadeOut("fast")},1e3)})}).fail(function(e){alert(e.error)})):j.vars.form_modified=!1),r=!0})})},S.fn.csf_options=function(){return this.each(function(){var e=S(this),t=e.find(".csf-content"),n=e.find(".csf-form-success"),i=e.find(".csf-form-warning"),s=e.find(".csf-header .csf-save");(j.vars.$form_warning=i).length&&(_.onbeforeunload=function(){return!!j.vars.form_modified||y},t.on("change keypress",":input",function(){j.vars.form_modified||(n.hide(),i.fadeIn("fast"),j.vars.form_modified=!0)})),n.hasClass("csf-form-show")&&setTimeout(function(){n.fadeOut("fast")},1e3),S(b).keydown(function(e){if((e.ctrlKey||e.metaKey)&&83===e.which)return s.trigger("click"),e.preventDefault(),!1})})},S.fn.csf_taxonomy=function(){return this.each(function(){var e,t,n=S(this),i=n.parents("form");"addtag"===i.attr("id")&&(e=i.find("#submit"),t=n.children(".csf-field").csf_clone(),e.on("click",function(){i.find(".form-required").hasClass("form-invalid")||(n.data("inited",!1),n.empty(),n.html(t),t=t.csf_clone(),n.csf_reload_script())}))})},S.fn.csf_shortcode=function(){var m=this;return m.shortcode_parse=function(e,n){var i="";return S.each(e,function(e,t){i+="["+(n=n||e),S.each(t,function(e,t){"content"===e?i=(i+="]")+t+"[/"+n:i+=m.shortcode_tags(e,t)}),i+="]"}),i},m.shortcode_tags=function(e,t){var n="";return""!==t&&("object"!=typeof t||S.isArray(t)?n+=" "+e+'="'+t.toString()+'"':S.each(t,function(e,t){""!==(t="background-image"===e?t.url||"":t)&&(n+=" "+e+'="'+t.toString()+'"')})),n},m.insertAtChars=function(e,t){e=void 0!==e[0].name?e[0]:e;return e.value.length&&void 0!==e.selectionStart?(e.focus(),e.value.substring(0,e.selectionStart)+t+e.value.substring(e.selectionEnd,e.value.length)):(e.focus(),t)},m.send_to_editor=function(e,t){var n;(n="undefined"!=typeof tinymce?tinymce.get(t):n)&&!n.isHidden()?n.execCommand("mceInsertContent",!1,e):(n=S("#"+t)).val(m.insertAtChars(n,e)).trigger("change")},this.each(function(){var s,c,a,n,r,o,f,i,l,d=S(this),h=d.find(".csf-modal-load"),p=(d.find(".csf-modal-content"),d.find(".csf-modal-insert")),u=d.find(".csf-modal-loading"),t=d.find("select"),g=d.data("modal-id"),v=d.data("nonce");S(b).on("click",'.csf-shortcode-button[data-modal-id="'+g+'"]',function(e){e.preventDefault(),l=S(this),s=l.data("editor-id")||!1,c=l.data("target-id")||!1,a=l.data("gutenberg-id")||!1,d.removeClass("hidden"),d.hasClass("csf-shortcode-single")&&r===y&&t.trigger("change")}),t.on("change",function(){var e=S(this),t=e.find(":selected");n=e.val(),r=t.data("shortcode"),o=t.data("view")||"normal",f=t.data("group")||r,h.empty(),n?(u.show(),_.wp.ajax.post("csf-get-shortcode-"+g,{shortcode_key:n,nonce:v}).done(function(e){u.hide();e=S(e.content).appendTo(h);p.parent().removeClass("hidden"),i=e.find(".csf--repeat-shortcode").csf_clone(),e.csf_reload_script(),e.find(".csf-fields").csf_reload_script()})):p.parent().addClass("hidden")}),p.on("click",function(e){if(e.preventDefault(),!p.prop("disabled")&&!p.attr("disabled")){var n="",t=d.find(".csf-field:not(.csf-depend-on)").find(":input:not(.ignore)").serializeObjectCSF();switch(o){case"contents":var i=r?t[r]:t;S.each(i,function(e,t){e=r||e;n+="["+e+"]"+t+"[/"+e+"]"});break;case"group":n+="["+r,S.each(t[r],function(e,t){n+=m.shortcode_tags(e,t)}),n=(n=(n+="]")+m.shortcode_parse(t[f],f))+("[/"+r+"]");break;case"repeater":n+=m.shortcode_parse(t[f],f);break;default:n+=m.shortcode_parse(t)}n=""===n?"["+r+"]":n,a?(e=_.csf_gutenberg_props.attributes.hasOwnProperty("shortcode")?_.csf_gutenberg_props.attributes.shortcode:"",_.csf_gutenberg_props.setAttributes({shortcode:e+n})):s?m.send_to_editor(n,s):(e=c?S(c):l.parent().find("textarea")).val(m.insertAtChars(e,n)).trigger("change"),d.addClass("hidden")}}),d.on("click",".csf--repeat-button",function(e){e.preventDefault();var e=d.find(".csf--repeatable"),t=i.csf_clone(),n=t.find(".csf-repeat-remove");t.appendTo(e);t.find(".csf-fields").csf_reload_script(),j.helper.name_nested_replace(d.find(".csf--repeat-shortcode"),f),n.on("click",function(){t.remove(),j.helper.name_nested_replace(d.find(".csf--repeat-shortcode"),f)})}),d.on("click",".csf-modal-close, .csf-modal-overlay",function(){d.addClass("hidden")})})},"function"==typeof Color&&(Color.prototype.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;0<=t;t--)e="0"+e;return"#"+e}),j.funcs.parse_color=function(e){var e=e.replace(/\s+/g,""),t=-1!==e.indexOf("rgba")?parseFloat(100*e.replace(/^.*,(.+)\)/,"$1")):100;return{value:e,transparent:t,rgba:t<100}},S.fn.csf_color=function(){return this.each(function(){var a,r=S(this),n=j.funcs.parse_color(r.val()),e=!_.csf_vars.color_palette.length||_.csf_vars.color_palette;r.hasClass("wp-color-picker")&&r.closest(".wp-picker-container").after(r).remove(),r.wpColorPicker({palettes:e,change:function(e,t){t=t.color.toString();a.removeClass("csf--transparent-active"),a.find(".csf--transparent-offset").css("background-color",t),r.val(t).trigger("change")},create:function(){a=r.closest(".wp-picker-container");var i=r.data("a8cIris"),e=S('<div class="csf--transparent-wrap"><div class="csf--transparent-slider"></div><div class="csf--transparent-offset"></div><div class="csf--transparent-text"></div><div class="csf--transparent-button">transparent <i class="fas fa-toggle-off"></i></div></div>').appendTo(a.find(".wp-picker-holder")),s=e.find(".csf--transparent-slider"),c=e.find(".csf--transparent-text"),t=e.find(".csf--transparent-offset"),e=e.find(".csf--transparent-button");"transparent"===r.val()&&a.addClass("csf--transparent-active"),e.on("click",function(){"transparent"!==r.val()?(r.val("transparent").trigger("change").removeClass("iris-error"),a.addClass("csf--transparent-active")):(r.val(i._color.toString()).trigger("change"),a.removeClass("csf--transparent-active"))}),s.slider({value:n.transparent,step:1,min:0,max:100,slide:function(e,t){t=parseFloat(t.value/100);i._color._alpha=t,r.wpColorPicker("color",i._color.toString()),c.text(1===t||0===t?"":t)},create:function(){var e=parseFloat(n.transparent/100);c.text(e<1?e:""),t.css("background-color",n.value),a.on("click",".wp-picker-clear",function(){i._color._alpha=1,c.text(""),s.slider("option","value",100),a.removeClass("csf--transparent-active"),r.trigger("change")}),a.on("click",".wp-picker-default",function(){var e=j.funcs.parse_color(r.data("default-color")),t=parseFloat(e.transparent/100),n=t<1?t:"";i._color._alpha=t,c.text(n),s.slider("option","value",e.transparent),"transparent"===e.value&&(r.removeClass("iris-error"),a.addClass("csf--transparent-active"))})}})}})})},S.fn.csf_chosen=function(){return this.each(function(){var n,c,a=S(this),e=a.parent().find(".chosen-container"),t=a.hasClass("csf-chosen-sortable")||!1,i=a.hasClass("csf-chosen-ajax")||!1,s=a.attr("multiple")||!1,r=S.extend({allow_single_deselect:!0,disable_search_threshold:10,width:s?"100%":"auto",no_results_text:_.csf_vars.i18n.no_results_text},a.data("chosen-settings"));e.length&&e.remove(),i?(e=S.extend({data:{type:"post",nonce:""},allow_single_deselect:!0,disable_search_threshold:-1,width:"100%",min_length:3,type_delay:500,typing_text:_.csf_vars.i18n.typing_text,searching_text:_.csf_vars.i18n.searching_text,no_results_text:_.csf_vars.i18n.no_results_text},a.data("chosen-settings")),a.CSFAjaxChosen(e)):a.chosen(r),s&&(i=(n=a.parent().find(".csf-hide-select")).val()||[],a.on("change",function(e,t){t&&t.selected?n.append('<option value="'+t.selected+'" selected="selected">'+t.selected+"</option>"):t&&t.deselected&&n.find('option[value="'+t.deselected+'"]').remove(),_.wp.customize!==y&&0===n.children().length&&n.data("customize-setting-link")&&_.wp.customize.control(n.data("customize-setting-link")).setting.set(""),n.trigger("change")}),a.CSFChosenOrder(i,!0)),t&&((c=a.parent().find(".chosen-container").find(".chosen-choices")).bind("mousedown",function(e){S(e.target).is("span")&&e.stopPropagation()}),c.sortable({items:"li:not(.search-field)",helper:"orginal",cursor:"move",placeholder:"search-choice-placeholder",start:function(e,t){t.placeholder.width(t.item.innerWidth()),t.placeholder.height(t.item.innerHeight())},update:function(e,t){var i="",s=a.data("chosen"),n=a.parent().find(".csf-hide-select");c.find(".search-choice-close").each(function(){var n=S(this).data("option-array-index");S.each(s.results_data,function(e,t){t.array_index===n&&(i+='<option value="'+t.value+'" selected>'+t.value+"</option>")})}),n.children().remove(),n.append(i),n.trigger("change")}}))})},S.fn.csf_checkbox=function(){return this.each(function(){var e=S(this),t=e.find(".csf--input"),n=e.find(".csf--checkbox");n.on("click",function(){t.val(Number(n.prop("checked"))).trigger("change")})})},S.fn.csf_checkbox_all=function(){return this.each(function(){var n=S(this);n.on("click",function(){var e=n.closest(".csf-field-checkbox").find(":input"),t=!1;e.each(function(){S(this).prop("checked")||(t=!0)}),t?(e.prop("checked","checked"),e.attr("checked","checked")):(e.prop("checked",""),e.removeAttr("checked")),e.first().trigger("change")})})},S.fn.csf_siblings=function(){return this.each(function(){var t=S(this),e=t.find(".csf--sibling"),n=t.data("multiple")||!1;e.on("click",function(){var e=S(this);n?e.hasClass("csf--active")?(e.removeClass("csf--active"),e.find("input").prop("checked",!1).trigger("change")):(e.addClass("csf--active"),e.find("input").prop("checked",!0).trigger("change")):(t.find("input").prop("checked",!1),e.find("input").prop("checked",!0).trigger("change"),e.addClass("csf--active").siblings().removeClass("csf--active"))})})},S.fn.csf_help=function(){return this.each(function(){var e,t,n=S(this);n.on({mouseenter:function(){e=S('<div class="csf-tooltip"></div>').html(n.find(".csf-help-text").html()).appendTo("body"),t=j.vars.is_rtl?n.offset().left+24:n.offset().left-e.outerWidth(),e.css({top:n.offset().top-(e.outerHeight()/2-14),left:t})},mouseleave:function(){e!==y&&e.remove()}})})},S.fn.csf_customizer_refresh=function(){return this.each(function(){var e=S(this),t=e.closest(".csf-customize-complex");if(t.length){var n=t.data("unique-id");if(n===y)return;var i=t.find(":input"),t=t.data("option-id"),i=i.serializeObjectCSF(),i=!S.isEmptyObject(i)&&i[n]&&i[n][t]?i[n][t]:"",n=_.wp.customize.control(n+"["+t+"]");n.setting._value=null,n.setting.set(i)}else e.find(":input").first().trigger("change");S(b).trigger("csf-customizer-refresh",e)})},S.fn.csf_customizer_listen=function(e){var s=S.extend({closest:!1},e);return this.each(function(){var t,e,n,i;_.wp.customize!==y&&(e=(t=s.closest?S(this).closest(".csf-customize-complex"):S(this)).find(":input"),n=t.data("unique-id"),i=t.data("option-id"),n!==y&&e.on("change keyup csf.change",function(){var e=t.find(":input").serializeObjectCSF(),e=!S.isEmptyObject(e)&&e[n]&&e[n][i]?e[n][i]:"";_.wp.customize.control(n+"["+i+"]").setting.set(e)}))})},S(b).on("expanded",".control-section",function(){var e,t,n=S(this);n.hasClass("open")&&!n.data("inited")&&(e=n.find(".csf-customize-field"),t=n.find(".csf-customize-complex"),e.length&&(n.csf_dependency(),e.csf_reload_script({dependency:!1}),t.csf_customizer_listen()),n.data("inited",!0))}),j.vars.$window.on("resize csf.resize",j.helper.debounce(function(e){(-1<navigator.userAgent.indexOf("AppleWebKit/")?j.vars.$window.width():_.innerWidth)<=782&&!j.vars.onloaded&&(S(".csf-section").csf_reload_script(),j.vars.onloaded=!0)},200)).trigger("csf.resize"),S.fn.csf_widgets=function(){return this.each(function(){S(b).on("widget-added widget-updated",function(e,t){t=t.find(".csf-fields");t.length&&t.csf_reload_script()}),S(b).on("click",".widget-top",function(e){var t=S(this).parent().find(".csf-fields");t.length&&t.csf_reload_script()}),S(".widgets-sortables, .control-section-sidebar").on("sortstop",function(e,t){t.item.find(".csf-fields").csf_reload_script_retry()})})},S.fn.csf_nav_menu=function(){return this.each(function(){var e=S(this);e.on("click","a.item-edit",function(){S(this).closest("li.menu-item").find(".csf-fields").csf_reload_script()}),e.on("sortstop",function(e,t){t.item.find(".csf-fields").csf_reload_script_retry()})})},S.fn.csf_reload_script_retry=function(){return this.each(function(){var e=S(this);e.data("inited")&&e.children(".csf-field-wp_editor").csf_field_wp_editor()})},S.fn.csf_reload_script=function(e){var t=S.extend({dependency:!0},e);return this.each(function(){var e=S(this);e.data("inited")||(e.children(".csf-field-accordion").csf_field_accordion(),e.children(".csf-field-backup").csf_field_backup(),e.children(".csf-field-background").csf_field_background(),e.children(".csf-field-code_editor").csf_field_code_editor(),e.children(".csf-field-date").csf_field_date(),e.children(".csf-field-datetime").csf_field_datetime(),e.children(".csf-field-fieldset").csf_field_fieldset(),e.children(".csf-field-gallery").csf_field_gallery(),e.children(".csf-field-group").csf_field_group(),e.children(".csf-field-icon").csf_field_icon(),e.children(".csf-field-link").csf_field_link(),e.children(".csf-field-media").csf_field_media(),e.children(".csf-field-map").csf_field_map(),e.children(".csf-field-repeater").csf_field_repeater(),e.children(".csf-field-slider").csf_field_slider(),e.children(".csf-field-sortable").csf_field_sortable(),e.children(".csf-field-sorter").csf_field_sorter(),e.children(".csf-field-spinner").csf_field_spinner(),e.children(".csf-field-switcher").csf_field_switcher(),e.children(".csf-field-tabbed").csf_field_tabbed(),e.children(".csf-field-typography").csf_field_typography(),e.children(".csf-field-upload").csf_field_upload(),e.children(".csf-field-wp_editor").csf_field_wp_editor(),e.children(".csf-field-border").find(".csf-color").csf_color(),e.children(".csf-field-background").find(".csf-color").csf_color(),e.children(".csf-field-color").find(".csf-color").csf_color(),e.children(".csf-field-color_group").find(".csf-color").csf_color(),e.children(".csf-field-link_color").find(".csf-color").csf_color(),e.children(".csf-field-typography").find(".csf-color").csf_color(),e.children(".csf-field-select").find(".csf-chosen").csf_chosen(),e.children(".csf-field-checkbox").find(".csf-checkbox").csf_checkbox(),e.children(".csf-field-checkbox").find(".csf-checkbox-all").csf_checkbox_all(),e.children(".csf-field-button_set").find(".csf-siblings").csf_siblings(),e.children(".csf-field-image_select").find(".csf-siblings").csf_siblings(),e.children(".csf-field-palette").find(".csf-siblings").csf_siblings(),e.children(".csf-field").find(".csf-help").csf_help(),t.dependency&&e.csf_dependency(),e.data("inited",!0),S(b).trigger("csf-reload-script",e))})},S(b).ready(function(){S(".csf-save").csf_save(),S(".csf-options").csf_options(),S(".csf-sticky-header").csf_sticky(),S(".csf-nav-options").csf_nav_options(),S(".csf-nav-metabox").csf_nav_metabox(),S(".csf-taxonomy").csf_taxonomy(),S(".csf-page-templates").csf_page_templates(),S(".csf-post-formats").csf_post_formats(),S(".csf-shortcode").csf_shortcode(),S(".csf-search").csf_search(),S(".csf-confirm").csf_confirm(),S(".csf-expand-all").csf_expand_all(),S(".csf-onload").csf_reload_script(),S("#widgets-editor").csf_widgets(),S("#widgets-right").csf_widgets(),S("#menu-to-edit").csf_nav_menu()})}(jQuery,window,document);
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/assets/js/plugins.min.js

    r2986425 r3207680  
    1 /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.3.0*/
     1/* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.3.1*/
    22!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).flatpickr=t()}(this,function(){"use strict";var ce=function(){return(ce=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function he(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),o=0,t=0;t<n;t++)for(var s=arguments[t],r=0,a=s.length;r<a;r++,o++)i[o]=s[r];return i}var ue=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],de={_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 e=new Date(e.getTime()),t=(e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7),new Date(e.getFullYear(),0,4));return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.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},fe={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){e%=100;if(3<e&&e<21)return"th";switch(e%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},pe=function(e,t){return("000"+e).slice(-1*(t=void 0===t?2:t))},_e=function(e){return!0===e?1:0};function me(t,n){var i;return function(){var e=this;clearTimeout(i),i=setTimeout(function(){return t.apply(e,arguments)},n)}}var ge=function(e){return e instanceof Array?e:[e]};function ve(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function ye(e,t,n){e=window.document.createElement(e);return n=n||"",e.className=t=t||"",void 0!==n&&(e.textContent=n),e}function be(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function we(e,t){var n=ye("div","numInputWrapper"),i=ye("input","numInput "+e),e=ye("span","arrowUp"),o=ye("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?i.type="number":(i.type="text",i.pattern="\\d*"),void 0!==t)for(var s in t)i.setAttribute(s,t[s]);return n.appendChild(i),n.appendChild(e),n.appendChild(o),n}function De(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}catch(e){return t.target}}function e(){}var Ce=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},g={D:e,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*_e(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.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,n){t=parseInt(t),e=new Date(e.getFullYear(),0,2+7*(t-1),0,0,0,0);return e.setDate(e.getDate()-e.getDay()+n.firstDayOfWeek),e},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(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:e,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:e,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},xe={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",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:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},a={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[a.w(e,t,n)]},F:function(e,t,n){return Ce(a.n(e,t,n)-1,!1,t)},G:function(e,t,n){return pe(a.h(e,t,n))},H:function(e){return pe(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[_e(11<e.getHours())]},M:function(e,t){return Ce(e.getMonth(),!0,t)},S:function(e){return pe(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return pe(e.getFullYear(),4)},d:function(e){return pe(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return pe(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return pe(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)}},Me=function(e){var t=e.config,s=void 0===t?de:t,t=e.l10n,n=void 0===t?fe:t,t=e.isMobile,r=void 0!==t&&t;return function(i,e,t){var o=t||n;return void 0===s.formatDate||r?e.split("").map(function(e,t,n){return a[e]&&"\\"!==n[t-1]?a[e](i,o,s):"\\"!==e?e:""}).join(""):s.formatDate(i,e,o)}},ke=function(e){var t=e.config,_=void 0===t?de:t,t=e.l10n,m=void 0===t?fe:t;return function(e,t,n,i){if(0===e||e){var o=i||m,i=e;if(e instanceof Date)r=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)r=new Date(e);else if("string"==typeof e){var s=t||(_||de).dateFormat,t=String(e).trim();if("today"===t)r=new Date,n=!0;else if(/Z$/.test(t)||/GMT$/.test(t))r=new Date(e);else if(_&&_.parseDate)r=_.parseDate(e,s);else{for(var r=_&&_.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),a=void 0,l=[],c=0,h=0,u="";c<s.length;c++){var d=s[c],f="\\"===d,p="\\"===s[c-1]||f;xe[d]&&!p?(u+=xe[d],(p=new RegExp(u).exec(e))&&(a=!0)&&l["Y"!==d?"push":"unshift"]({fn:g[d],val:p[++h]})):f||(u+="."),l.forEach(function(e){var t=e.fn,e=e.val;return r=t(r,e,o)||r})}r=a?r:void 0}}if(r instanceof Date&&!isNaN(r.getTime()))return!0===n&&r.setHours(0,0,0,0),r;_.errorHandler(new Error("Invalid date provided: "+i))}}};function Ee(e,t,n){return!1!==(n=void 0===n?!0:n)?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var Te=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},Oe={DAY:864e5};function Se(e){var t,n,i,o=e.defaultHour,s=e.defaultMinute,r=e.defaultSeconds;return void 0!==e.minDate&&(n=e.minDate.getHours(),i=e.minDate.getMinutes(),t=e.minDate.getSeconds(),(o=o<n?n:o)===n&&s<i&&(s=i),o===n&&s===i&&r<t&&(r=e.minDate.getSeconds())),void 0!==e.maxDate&&(n=e.maxDate.getHours(),i=e.maxDate.getMinutes(),(o=Math.min(o,n))===n&&(s=Math.min(i,s)),o===n&&s===i&&(r=e.maxDate.getSeconds())),{hours:o,minutes:s,seconds:r}}"function"!=typeof Object.assign&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=0,o=e;i<o.length;i++)!function(t){t&&Object.keys(t).forEach(function(e){return n[e]=t[e]})}(o[i]);return n});var Ae=300;function r(c,P){var p={config:ce(ce({},de),Ie.defaultConfig),l10n:fe};function Y(e){return e.bind(p)}function H(){var t=p.config;!1===t.weekNumbers&&1===t.showMonths||!0!==t.noCalendar&&window.requestAnimationFrame(function(){var e;void 0!==p.calendarContainer&&(p.calendarContainer.style.visibility="hidden",p.calendarContainer.style.display="block"),void 0!==p.daysContainer&&(e=(p.days.offsetWidth+1)*t.showMonths,p.daysContainer.style.width=e+"px",p.calendarContainer.style.width=e+(void 0!==p.weekWrapper?p.weekWrapper.offsetWidth:0)+"px",p.calendarContainer.style.removeProperty("visibility"),p.calendarContainer.style.removeProperty("display"))})}function h(e){0===p.selectedDates.length&&(o=void 0===p.config.minDate||0<=Ee(new Date,p.config.minDate)?new Date:new Date(p.config.minDate.getTime()),s=Se(p.config),o.setHours(s.hours,s.minutes,s.seconds,o.getMilliseconds()),p.selectedDates=[o],p.latestSelectedDateObj=o),void 0!==e&&"blur"!==e.type&&((s=e).preventDefault(),o="keydown"===s.type,t=e=De(s),void 0!==p.amPM&&e===p.amPM&&(p.amPM.textContent=p.l10n.amPM[_e(p.amPM.textContent===p.l10n.amPM[0])]),e=parseFloat(t.getAttribute("min")),a=parseFloat(t.getAttribute("max")),n=parseFloat(t.getAttribute("step")),i=parseInt(t.value,10),o=s.delta||(o?38===s.which?1:-1:0),s=i+n*o,void 0!==t.value&&2===t.value.length&&(o=t===p.hourElement,r=t===p.minuteElement,s<e?(s=a+s+_e(!o)+(_e(o)&&_e(!p.amPM)),r&&l(void 0,-1,p.hourElement)):a<s&&(s=t===p.hourElement?s-a-_e(!p.amPM):e,r&&l(void 0,1,p.hourElement)),p.amPM&&o&&(1===n?s+i===23:Math.abs(s-i)>n)&&(p.amPM.textContent=p.l10n.amPM[_e(p.amPM.textContent===p.l10n.amPM[0])]),t.value=pe(s)));var t,n,i,o,s,r,a=p._input.value;u(),T(),p._input.value!==a&&p._debouncedChange()}function u(){var e,t,n,i,o,s;void 0!==p.hourElement&&void 0!==p.minuteElement&&(o=(parseInt(p.hourElement.value.slice(-2),10)||0)%24,e=(parseInt(p.minuteElement.value,10)||0)%60,t=void 0!==p.secondElement?(parseInt(p.secondElement.value,10)||0)%60:0,void 0!==p.amPM&&(n=o,i=p.amPM.textContent,o=n%12+12*_e(i===p.l10n.amPM[1])),n=void 0!==p.config.minTime||p.config.minDate&&p.minDateHasTime&&p.latestSelectedDateObj&&0===Ee(p.latestSelectedDateObj,p.config.minDate,!0),(void 0!==p.config.maxTime||p.config.maxDate&&p.maxDateHasTime&&p.latestSelectedDateObj&&0===Ee(p.latestSelectedDateObj,p.config.maxDate,!0))&&(i=void 0!==p.config.maxTime?p.config.maxTime:p.config.maxDate,(e=(o=Math.min(o,i.getHours()))===i.getHours()?Math.min(e,i.getMinutes()):e)===i.getMinutes()&&(t=Math.min(t,i.getSeconds()))),n&&(s=void 0!==p.config.minTime?p.config.minTime:p.config.minDate,(e=(o=Math.max(o,s.getHours()))===s.getHours()&&e<s.getMinutes()?s.getMinutes():e)===s.getMinutes()&&(t=Math.max(t,s.getSeconds()))),r(o,e,t))}function i(e){e=e||p.latestSelectedDateObj;e&&r(e.getHours(),e.getMinutes(),e.getSeconds())}function r(e,t,n){void 0!==p.latestSelectedDateObj&&p.latestSelectedDateObj.setHours(e%24,t,n||0,0),p.hourElement&&p.minuteElement&&!p.isMobile&&(p.hourElement.value=pe(p.config.time_24hr?e:(12+e)%12+12*_e(e%12==0)),p.minuteElement.value=pe(t),void 0!==p.amPM&&(p.amPM.textContent=p.l10n.amPM[_e(12<=e)]),void 0!==p.secondElement&&(p.secondElement.value=pe(n)))}function L(e){var t=De(e),t=parseInt(t.value)+(e.delta||0);(1<t/1e3||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&w(t)}function a(t,n,i,o){return n instanceof Array?n.forEach(function(e){return a(t,e,i,o)}):t instanceof Array?t.forEach(function(e){return a(e,n,i,o)}):(t.addEventListener(n,i,o),void p._handlers.push({remove:function(){return t.removeEventListener(n,i)}}))}function o(){k("onChange")}function s(t,e){var t=void 0!==t?p.parseDate(t):p.latestSelectedDateObj||(p.config.minDate&&p.config.minDate>p.now?p.config.minDate:p.config.maxDate&&p.config.maxDate<p.now?p.config.maxDate:p.now),n=p.currentYear,i=p.currentMonth;try{void 0!==t&&(p.currentYear=t.getFullYear(),p.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,p.config.errorHandler(e)}e&&p.currentYear!==n&&(k("onYearChange"),v()),!e||p.currentYear===n&&p.currentMonth===i||k("onMonthChange"),p.redraw()}function R(e){var t=De(e);~t.className.indexOf("arrow")&&l(e,t.classList.contains("arrowUp")?1:-1)}function l(e,t,n){e=e&&De(e),n=n||e&&e.parentNode&&e.parentNode.firstChild,e=ie("increment");e.delta=t,n&&n.dispatchEvent(e)}function d(e,t,n,i){var o=D(t,!0),s=ye("span","flatpickr-day "+e,t.getDate().toString());return s.dateObj=t,s.$i=i,s.setAttribute("aria-label",p.formatDate(t,p.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===Ee(t,p.now)&&((p.todayDateElem=s).classList.add("today"),s.setAttribute("aria-current","date")),o?(s.tabIndex=-1,oe(t)&&(s.classList.add("selected"),p.selectedDateElem=s,"range"===p.config.mode&&(ve(s,"startRange",p.selectedDates[0]&&0===Ee(t,p.selectedDates[0],!0)),ve(s,"endRange",p.selectedDates[1]&&0===Ee(t,p.selectedDates[1],!0)),"nextMonthDay"===e&&s.classList.add("inRange")))):s.classList.add("flatpickr-disabled"),"range"===p.config.mode&&(i=t,"range"!==p.config.mode||p.selectedDates.length<2||!(0<=Ee(i,p.selectedDates[0])&&Ee(i,p.selectedDates[1])<=0)||oe(t)||s.classList.add("inRange")),p.weekNumbers&&1===p.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&p.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+p.config.getWeek(t)+"</span>"),k("onDayCreate",s),s}function _(e){e.focus(),"range"===p.config.mode&&K(e)}function m(e){for(var t=0<e?0:p.config.showMonths-1,n=0<e?p.config.showMonths:-1,i=t;i!=n;i+=e)for(var o=p.daysContainer.children[i],s=0<e?0:o.children.length-1,r=0<e?o.children.length:-1,a=s;a!=r;a+=e){var l=o.children[a];if(-1===l.className.indexOf("hidden")&&D(l.dateObj))return l}}function g(e,t){var n=C(document.activeElement||document.body),e=void 0!==e?e:n?document.activeElement:void 0!==p.selectedDateElem&&C(p.selectedDateElem)?p.selectedDateElem:void 0!==p.todayDateElem&&C(p.todayDateElem)?p.todayDateElem:m(0<t?1:-1);if(void 0===e)p._input.focus();else if(n){for(var i=e,o=t,s=-1===i.className.indexOf("Month")?i.dateObj.getMonth():p.currentMonth,r=0<o?p.config.showMonths:-1,a=0<o?1:-1,l=s-p.currentMonth;l!=r;l+=a)for(var c=p.daysContainer.children[l],h=s-p.currentMonth===l?i.$i+o:o<0?c.children.length-1:0,u=c.children.length,d=h;0<=d&&d<u&&d!=(0<o?u:-1);d+=a){var f=c.children[d];if(-1===f.className.indexOf("hidden")&&D(f.dateObj)&&Math.abs(i.$i-d)>=Math.abs(o))return void _(f)}p.changeMonth(a),g(m(a),0)}else _(e)}function f(){if(void 0!==p.daysContainer){be(p.daysContainer),p.weekNumbers&&be(p.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<p.config.showMonths;t++){var n=new Date(p.currentYear,p.currentMonth,1);n.setMonth(p.currentMonth+t),e.appendChild(function(e,t){for(var n=(new Date(e,t,1).getDay()-p.l10n.firstDayOfWeek+7)%7,i=p.utils.getDaysInMonth((t-1+12)%12,e),o=p.utils.getDaysInMonth(t,e),s=window.document.createDocumentFragment(),r=1<p.config.showMonths,a=r?"prevMonthDay hidden":"prevMonthDay",l=r?"nextMonthDay hidden":"nextMonthDay",c=i+1-n,h=0;c<=i;c++,h++)s.appendChild(d(a,new Date(e,t-1,c),c,h));for(c=1;c<=o;c++,h++)s.appendChild(d("",new Date(e,t,c),c,h));for(var u=o+1;u<=42-n&&(1===p.config.showMonths||h%7!=0);u++,h++)s.appendChild(d(l,new Date(e,t+1,u%o),u,h));return(r=ye("div","dayContainer")).appendChild(s),r}(n.getFullYear(),n.getMonth()))}p.daysContainer.appendChild(e),p.days=p.daysContainer.firstChild,"range"===p.config.mode&&1===p.selectedDates.length&&K()}}function v(){if(!(1<p.config.showMonths||"dropdown"!==p.config.monthSelectorType)){p.monthsDropdownContainer.tabIndex=-1,p.monthsDropdownContainer.innerHTML="";for(var e,t=0;t<12;t++)e=t,void 0!==p.config.minDate&&p.currentYear===p.config.minDate.getFullYear()&&e<p.config.minDate.getMonth()||void 0!==p.config.maxDate&&p.currentYear===p.config.maxDate.getFullYear()&&e>p.config.maxDate.getMonth()||((e=ye("option","flatpickr-monthDropdown-month")).value=new Date(p.currentYear,t).getMonth().toString(),e.textContent=Ce(t,p.config.shorthandCurrentMonth,p.l10n),e.tabIndex=-1,p.currentMonth===t&&(e.selected=!0),p.monthsDropdownContainer.appendChild(e))}}function q(){be(p.monthNav),p.monthNav.appendChild(p.prevMonthNav),p.config.showMonths&&(p.yearElements=[],p.monthElements=[]);for(var e,t,n,i,o,s=p.config.showMonths;s--;){o=i=r=n=t=e=void 0,e=ye("div","flatpickr-month"),t=window.document.createDocumentFragment(),n=1<p.config.showMonths||"static"===p.config.monthSelectorType?ye("span","cur-month"):(p.monthsDropdownContainer=ye("select","flatpickr-monthDropdown-months"),p.monthsDropdownContainer.setAttribute("aria-label",p.l10n.monthAriaLabel),a(p.monthsDropdownContainer,"change",function(e){e=De(e),e=parseInt(e.value,10);p.changeMonth(e-p.currentMonth),k("onMonthChange")}),v(),p.monthsDropdownContainer),r=we("cur-year",{tabindex:"-1"}),(i=r.getElementsByTagName("input")[0]).setAttribute("aria-label",p.l10n.yearAriaLabel),p.config.minDate&&i.setAttribute("min",p.config.minDate.getFullYear().toString()),p.config.maxDate&&(i.setAttribute("max",p.config.maxDate.getFullYear().toString()),i.disabled=!!p.config.minDate&&p.config.minDate.getFullYear()===p.config.maxDate.getFullYear()),(o=ye("div","flatpickr-current-month")).appendChild(n),o.appendChild(r),t.appendChild(o),e.appendChild(t);var r={container:e,yearElement:i,monthElement:n};p.yearElements.push(r.yearElement),p.monthElements.push(r.monthElement),p.monthNav.appendChild(r.container)}p.monthNav.appendChild(p.nextMonthNav)}function W(){p.weekdayContainer?be(p.weekdayContainer):p.weekdayContainer=ye("div","flatpickr-weekdays");for(var e=p.config.showMonths;e--;){var t=ye("div","flatpickr-weekdaycontainer");p.weekdayContainer.appendChild(t)}return B(),p.weekdayContainer}function B(){if(p.weekdayContainer){var e=p.l10n.firstDayOfWeek,t=he(p.l10n.weekdays.shorthand);0<e&&e<t.length&&(t=he(t.splice(e,t.length),t.splice(0,e)));for(var n=p.config.showMonths;n--;)p.weekdayContainer.children[n].innerHTML="\n      <span class='flatpickr-weekday'>\n        "+t.join("</span><span class='flatpickr-weekday'>")+"\n      </span>\n      "}}function y(e,t){t=(t=void 0===t?!0:t)?e:e-p.currentMonth;t<0&&!0===p._hidePrevMonthArrow||0<t&&!0===p._hideNextMonthArrow||(p.currentMonth+=t,(p.currentMonth<0||11<p.currentMonth)&&(p.currentYear+=11<p.currentMonth?1:-1,p.currentMonth=(p.currentMonth+12)%12,k("onYearChange"),v()),f(),k("onMonthChange"),E())}function b(e){return!(!p.config.appendTo||!p.config.appendTo.contains(e))||p.calendarContainer.contains(e)}function z(e){var t,n,i;p.isOpen&&!p.config.inline&&(i=b(t=De(e)),n=t===p.input||t===p.altInput||p.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(p.input)||~e.path.indexOf(p.altInput)),n="blur"===e.type?n&&e.relatedTarget&&!b(e.relatedTarget):!n&&!i&&!b(e.relatedTarget),i=!p.config.ignoredFocusElements.some(function(e){return e.contains(t)}),n&&i&&(void 0!==p.timeContainer&&void 0!==p.minuteElement&&void 0!==p.hourElement&&""!==p.input.value&&void 0!==p.input.value&&h(),p.close(),p.config&&"range"===p.config.mode&&1===p.selectedDates.length&&(p.clear(!1),p.redraw())))}function w(e){var t;!e||p.config.minDate&&e<p.config.minDate.getFullYear()||p.config.maxDate&&e>p.config.maxDate.getFullYear()||(t=p.currentYear!==e,p.currentYear=e||p.currentYear,p.config.maxDate&&p.currentYear===p.config.maxDate.getFullYear()?p.currentMonth=Math.min(p.config.maxDate.getMonth(),p.currentMonth):p.config.minDate&&p.currentYear===p.config.minDate.getFullYear()&&(p.currentMonth=Math.max(p.config.minDate.getMonth(),p.currentMonth)),t&&(p.redraw(),k("onYearChange"),v()))}function D(e,t){var n=p.parseDate(e,void 0,t=void 0===t?!0:t);if(p.config.minDate&&n&&Ee(n,p.config.minDate,void 0!==t?t:!p.minDateHasTime)<0||p.config.maxDate&&n&&0<Ee(n,p.config.maxDate,void 0!==t?t:!p.maxDateHasTime))return!1;if(!p.config.enable&&0===p.config.disable.length)return!0;if(void 0===n)return!1;for(var i,o=!!p.config.enable,s=null!=(e=p.config.enable)?e:p.config.disable,r=0,a=void 0;r<s.length;r++){if("function"==typeof(a=s[r])&&a(n))return o;if(a instanceof Date&&void 0!==n&&a.getTime()===n.getTime())return o;if("string"==typeof a)return(i=p.parseDate(a,void 0,!0))&&i.getTime()===n.getTime()?o:!o;if("object"==typeof a&&void 0!==n&&a.from&&a.to&&n.getTime()>=a.from.getTime()&&n.getTime()<=a.to.getTime())return o}return!o}function C(e){return void 0!==p.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&p.daysContainer.contains(e))}function U(e){e.target===p._input&&(0<p.selectedDates.length||0<p._input.value.length)&&(!e.relatedTarget||!b(e.relatedTarget))&&p.setDate(p._input.value,!0,e.target===p.altInput?p.config.altFormat:p.config.dateFormat)}function J(e){var t=De(e),n=p.config.wrap?c.contains(t):t===p._input,i=p.config.allowInput,o=p.isOpen&&(!i||!n),s=p.config.inline&&n&&!i;if(13===e.keyCode&&n){if(i)return p.setDate(p._input.value,!0,t===p.altInput?p.config.altFormat:p.config.dateFormat),t.blur();p.open()}else if(b(t)||o||s){var r,a=!!p.timeContainer&&p.timeContainer.contains(t);switch(e.keyCode){case 13:a?(e.preventDefault(),h(),Z()):ee(e);break;case 27:e.preventDefault(),Z();break;case 8:case 46:n&&!p.config.allowInput&&(e.preventDefault(),p.clear());break;case 37:case 39:a||n?p.hourElement&&p.hourElement.focus():(e.preventDefault(),void 0!==p.daysContainer&&(!1===i||document.activeElement&&C(document.activeElement))&&(l=39===e.keyCode?1:-1,e.ctrlKey?(e.stopPropagation(),y(l),g(m(1),0)):g(void 0,l)));break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;p.daysContainer&&void 0!==t.$i||t===p.input||t===p.altInput?e.ctrlKey?(e.stopPropagation(),w(p.currentYear-l),g(m(1),0)):a||g(void 0,7*l):t===p.currentYearElement?w(p.currentYear-l):p.config.enableTime&&(!a&&p.hourElement&&p.hourElement.focus(),h(e),p._debouncedChange());break;case 9:a?-1!==(r=(l=[p.hourElement,p.minuteElement,p.secondElement,p.amPM].concat(p.pluginElements).filter(function(e){return e})).indexOf(t))&&(l=l[r+(e.shiftKey?-1:1)],e.preventDefault(),(l||p._input).focus()):!p.config.noCalendar&&p.daysContainer&&p.daysContainer.contains(t)&&e.shiftKey&&(e.preventDefault(),p._input.focus())}}if(void 0!==p.amPM&&t===p.amPM)switch(e.key){case p.l10n.amPM[0].charAt(0):case p.l10n.amPM[0].charAt(0).toLowerCase():p.amPM.textContent=p.l10n.amPM[0],u(),T();break;case p.l10n.amPM[1].charAt(0):case p.l10n.amPM[1].charAt(0).toLowerCase():p.amPM.textContent=p.l10n.amPM[1],u(),T()}(n||b(t))&&k("onKeyDown",e)}function K(i){if(1===p.selectedDates.length&&(!i||i.classList.contains("flatpickr-day")&&!i.classList.contains("flatpickr-disabled"))){for(var o=(i||p.days.firstElementChild).dateObj.getTime(),s=p.parseDate(p.selectedDates[0],void 0,!0).getTime(),e=Math.min(o,p.selectedDates[0].getTime()),t=Math.max(o,p.selectedDates[0].getTime()),r=!1,a=0,l=0,n=e;n<t;n+=Oe.DAY)D(new Date(n),!0)||(r=r||e<n&&n<t,n<s&&(!a||a<n)?a=n:s<n&&(!l||n<l)&&(l=n));for(var c=0;c<p.config.showMonths;c++)for(var h=p.daysContainer.children[c],u=0,d=h.children.length;u<d;u++)!function(e){var t=h.children[e],e=t.dateObj.getTime(),n=0<a&&e<a||0<l&&l<e;n?(t.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e)})):r&&!n||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e)}),void 0!==i&&(i.classList.add(o<=p.selectedDates[0].getTime()?"startRange":"endRange"),s<o&&e===s?t.classList.add("startRange"):o<s&&e===s&&t.classList.add("endRange"),a<=e&&(0===l||e<=l)&&Te(e,s,o)&&t.classList.add("inRange")))}(u)}}function $(){!p.isOpen||p.config.static||p.config.inline||x()}function Q(n){return function(e){var e=p.config["_"+n+"Date"]=p.parseDate(e,p.config.dateFormat),t=p.config["_"+("min"===n?"max":"min")+"Date"];void 0!==e&&(p["min"===n?"minDateHasTime":"maxDateHasTime"]=0<e.getHours()||0<e.getMinutes()||0<e.getSeconds()),p.selectedDates&&(p.selectedDates=p.selectedDates.filter(function(e){return D(e)}),p.selectedDates.length||"min"!==n||i(e),T()),p.daysContainer&&(X(),void 0!==e?p.currentYearElement[n]=e.getFullYear().toString():p.currentYearElement.removeAttribute(n),p.currentYearElement.disabled=!!t&&void 0!==e&&t.getFullYear()===e.getFullYear())}}function V(){return p.config.wrap?c.querySelector("[data-input]"):c}function G(){"object"!=typeof p.config.locale&&void 0===Ie.l10ns[p.config.locale]&&p.config.errorHandler(new Error("flatpickr: invalid locale "+p.config.locale)),p.l10n=ce(ce({},Ie.l10ns.default),"object"==typeof p.config.locale?p.config.locale:"default"!==p.config.locale?Ie.l10ns[p.config.locale]:void 0),xe.K="("+p.l10n.amPM[0]+"|"+p.l10n.amPM[1]+"|"+p.l10n.amPM[0].toLowerCase()+"|"+p.l10n.amPM[1].toLowerCase()+")",void 0===ce(ce({},P),JSON.parse(JSON.stringify(c.dataset||{}))).time_24hr&&void 0===Ie.defaultConfig.time_24hr&&(p.config.time_24hr=p.l10n.time_24hr),p.formatDate=Me(p),p.parseDate=ke({config:p.config,l10n:p.l10n})}function x(e){var t,n,i,o,s,r;"function"==typeof p.config.position?p.config.position(p,e):void 0!==p.calendarContainer&&(k("onPreCalendarPosition"),e=e||p._positionElement,n=Array.prototype.reduce.call(p.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),r=p.calendarContainer.offsetWidth,s=(i=p.config.position.split(" "))[0],i=1<i.length?i[1]:null,t=e.getBoundingClientRect(),o=window.innerHeight-t.bottom,s="above"===s||"below"!==s&&o<n&&t.top>n,o=window.pageYOffset+t.top+(s?-n-2:e.offsetHeight+2),ve(p.calendarContainer,"arrowTop",!s),ve(p.calendarContainer,"arrowBottom",s),p.config.inline||(n=window.pageXOffset+t.left,s=e=!1,"center"===i?(n-=(r-t.width)/2,e=!0):"right"===i&&(n-=r-t.width,s=!0),ve(p.calendarContainer,"arrowLeft",!e&&!s),ve(p.calendarContainer,"arrowCenter",e),ve(p.calendarContainer,"arrowRight",s),i=window.document.body.offsetWidth-(window.pageXOffset+t.right),e=n+r>window.document.body.offsetWidth,s=i+r>window.document.body.offsetWidth,ve(p.calendarContainer,"rightMost",e),p.config.static||(p.calendarContainer.style.top=o+"px",e?s?void 0!==(o=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var n=document.styleSheets[t];try{n.cssRules}catch(e){continue}e=n;break}return null!=e?e:function(){var e=document.createElement("style");return document.head.appendChild(e),e.sheet}()}())&&(e=window.document.body.offsetWidth,s=Math.max(0,e/2-r/2),e=o.cssRules.length,r="{left:"+t.left+"px;right:auto;}",ve(p.calendarContainer,"rightMost",!1),ve(p.calendarContainer,"centerMost",!0),o.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+r,e),p.calendarContainer.style.left=s+"px",p.calendarContainer.style.right="auto"):(p.calendarContainer.style.left="auto",p.calendarContainer.style.right=i+"px"):(p.calendarContainer.style.left=n+"px",p.calendarContainer.style.right="auto"))))}function X(){p.config.noCalendar||p.isMobile||(v(),E(),f())}function Z(){p._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(p.close,0):p.close()}function ee(e){e.preventDefault(),e.stopPropagation();var t,n,i,e=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(De(e),function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});void 0!==e&&(e=e,t=((n=p.latestSelectedDateObj=new Date(e.dateObj.getTime())).getMonth()<p.currentMonth||n.getMonth()>p.currentMonth+p.config.showMonths-1)&&"range"!==p.config.mode,p.selectedDateElem=e,"single"===p.config.mode?p.selectedDates=[n]:"multiple"===p.config.mode?(i=oe(n))?p.selectedDates.splice(parseInt(i),1):p.selectedDates.push(n):"range"===p.config.mode&&(2===p.selectedDates.length&&p.clear(!1,!1),p.latestSelectedDateObj=n,p.selectedDates.push(n),0!==Ee(n,p.selectedDates[0],!0)&&p.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})),u(),t&&(i=p.currentYear!==n.getFullYear(),p.currentYear=n.getFullYear(),p.currentMonth=n.getMonth(),i&&(k("onYearChange"),v()),k("onMonthChange")),E(),f(),T(),t||"range"===p.config.mode||1!==p.config.showMonths?void 0!==p.selectedDateElem&&void 0===p.hourElement&&p.selectedDateElem&&p.selectedDateElem.focus():_(e),void 0!==p.hourElement&&void 0!==p.hourElement&&p.hourElement.focus(),p.config.closeOnSelect&&(n="single"===p.config.mode&&!p.config.enableTime,i="range"===p.config.mode&&2===p.selectedDates.length&&!p.config.enableTime,(n||i)&&Z()),o())}p.parseDate=ke({config:p.config,l10n:p.l10n}),p._handlers=[],p.pluginElements=[],p.loadedPlugins=[],p._bind=a,p._setHoursFromDate=i,p._positionCalendar=x,p.changeMonth=y,p.changeYear=w,p.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);p.input.value="",void 0!==p.altInput&&(p.altInput.value="");void 0!==p.mobileInput&&(p.mobileInput.value="");p.selectedDates=[],!(p.latestSelectedDateObj=void 0)===t&&(p.currentYear=p._initialDate.getFullYear(),p.currentMonth=p._initialDate.getMonth());{var n,i;!0===p.config.enableTime&&(t=Se(p.config),n=t.hours,i=t.minutes,t=t.seconds,r(n,i,t))}p.redraw(),e&&k("onChange")},p.close=function(){p.isOpen=!1,p.isMobile||(void 0!==p.calendarContainer&&p.calendarContainer.classList.remove("open"),void 0!==p._input&&p._input.classList.remove("active"));k("onClose")},p._createElement=ye,p.destroy=function(){void 0!==p.config&&k("onDestroy");for(var e=p._handlers.length;e--;)p._handlers[e].remove();if(p._handlers=[],p.mobileInput)p.mobileInput.parentNode&&p.mobileInput.parentNode.removeChild(p.mobileInput),p.mobileInput=void 0;else if(p.calendarContainer&&p.calendarContainer.parentNode)if(p.config.static&&p.calendarContainer.parentNode){var t=p.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 p.calendarContainer.parentNode.removeChild(p.calendarContainer);p.altInput&&(p.input.type="text",p.altInput.parentNode&&p.altInput.parentNode.removeChild(p.altInput),delete p.altInput);p.input&&(p.input.type=p.input._type,p.input.classList.remove("flatpickr-input"),p.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 p[e]}catch(e){}})},p.isEnabled=D,p.jumpToDate=s,p.open=function(e,t){void 0===t&&(t=p._positionElement);var n;!0===p.isMobile?(e&&(e.preventDefault(),(n=De(e))&&n.blur()),void 0!==p.mobileInput&&(p.mobileInput.focus(),p.mobileInput.click()),k("onOpen")):p._input.disabled||p.config.inline||(n=p.isOpen,p.isOpen=!0,n||(p.calendarContainer.classList.add("open"),p._input.classList.add("active"),k("onOpen"),x(t)),!0!==p.config.enableTime||!0!==p.config.noCalendar||!1!==p.config.allowInput||void 0!==e&&p.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return p.hourElement.select()},50))},p.redraw=X,p.set=function(e,t){if(null!==e&&"object"==typeof e)for(var n in Object.assign(p.config,e),e)void 0!==M[n]&&M[n].forEach(function(e){return e()});else p.config[e]=t,void 0!==M[e]?M[e].forEach(function(e){return e()}):-1<ue.indexOf(e)&&(p.config[e]=ge(t));p.redraw(),T(!0)},p.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=p.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return p.clear(t);te(e,n),p.latestSelectedDateObj=p.selectedDates[p.selectedDates.length-1],p.redraw(),s(void 0,t),i(),0===p.selectedDates.length&&p.clear(!1);T(t),t&&k("onChange")},p.toggle=function(e){if(!0===p.isOpen)return p.close();p.open(e)};var M={locale:[G,B],showMonths:[q,H,W],minDate:[s],maxDate:[s],clickOpens:[function(){!0===p.config.clickOpens?(a(p._input,"focus",p.open),a(p._input,"click",p.open)):(p._input.removeEventListener("focus",p.open),p._input.removeEventListener("click",p.open))}]};function te(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return p.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[p.parseDate(e,t)];else if("string"==typeof e)switch(p.config.mode){case"single":case"time":n=[p.parseDate(e,t)];break;case"multiple":n=e.split(p.config.conjunction).map(function(e){return p.parseDate(e,t)});break;case"range":n=e.split(p.l10n.rangeSeparator).map(function(e){return p.parseDate(e,t)})}else p.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));p.selectedDates=p.config.allowInvalidPreload?n:n.filter(function(e){return e instanceof Date&&D(e,!1)}),"range"===p.config.mode&&p.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function ne(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?p.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:p.parseDate(e.from,void 0),to:p.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function k(e,t){if(void 0!==p.config){var n=p.config[e];if(void 0!==n&&0<n.length)for(var i=0;n[i]&&i<n.length;i++)n[i](p.selectedDates,p.input.value,p,t);"onChange"===e&&(p.input.dispatchEvent(ie("change")),p.input.dispatchEvent(ie("input")))}}function ie(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function oe(e){for(var t=0;t<p.selectedDates.length;t++)if(0===Ee(p.selectedDates[t],e))return""+t;return!1}function E(){p.config.noCalendar||p.isMobile||!p.monthNav||(p.yearElements.forEach(function(e,t){var n=new Date(p.currentYear,p.currentMonth,1);n.setMonth(p.currentMonth+t),1<p.config.showMonths||"static"===p.config.monthSelectorType?p.monthElements[t].textContent=Ce(n.getMonth(),p.config.shorthandCurrentMonth,p.l10n)+" ":p.monthsDropdownContainer.value=n.getMonth().toString(),e.value=n.getFullYear().toString()}),p._hidePrevMonthArrow=void 0!==p.config.minDate&&(p.currentYear===p.config.minDate.getFullYear()?p.currentMonth<=p.config.minDate.getMonth():p.currentYear<p.config.minDate.getFullYear()),p._hideNextMonthArrow=void 0!==p.config.maxDate&&(p.currentYear===p.config.maxDate.getFullYear()?p.currentMonth+1>p.config.maxDate.getMonth():p.currentYear>p.config.maxDate.getFullYear()))}function se(t){return p.selectedDates.map(function(e){return p.formatDate(e,t)}).filter(function(e,t,n){return"range"!==p.config.mode||p.config.enableTime||n.indexOf(e)===t}).join("range"!==p.config.mode?p.config.conjunction:p.l10n.rangeSeparator)}function T(e){void 0===e&&(e=!0),void 0!==p.mobileInput&&p.mobileFormatStr&&(p.mobileInput.value=void 0!==p.latestSelectedDateObj?p.formatDate(p.latestSelectedDateObj,p.mobileFormatStr):""),p.input.value=se(p.config.dateFormat),void 0!==p.altInput&&(p.altInput.value=se(p.config.altFormat)),!1!==e&&k("onValueUpdate")}function re(e){var e=De(e),t=p.prevMonthNav.contains(e),n=p.nextMonthNav.contains(e);t||n?y(t?-1:1):0<=p.yearElements.indexOf(e)?e.select():e.classList.contains("arrowUp")?p.changeYear(p.currentYear+1):e.classList.contains("arrowDown")&&p.changeYear(p.currentYear-1)}p.element=p.input=c,p.isOpen=!1;var e=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=ce(ce({},JSON.parse(JSON.stringify(c.dataset||{}))),P),n={},O=(p.config.parseDate=t.parseDate,p.config.formatDate=t.formatDate,Object.defineProperty(p.config,"enable",{get:function(){return p.config._enable},set:function(e){p.config._enable=ne(e)}}),Object.defineProperty(p.config,"disable",{get:function(){return p.config._disable},set:function(e){p.config._disable=ne(e)}}),"time"===t.mode);function ae(t){return function(e){p.config["min"===t?"_minTime":"_maxTime"]=p.parseDate(e,"H:i:S")}}t.dateFormat||!t.enableTime&&!O||(N=Ie.defaultConfig.dateFormat||de.dateFormat,n.dateFormat=t.noCalendar||O?"H:i"+(t.enableSeconds?":S":""):N+" H:i"+(t.enableSeconds?":S":"")),t.altInput&&(t.enableTime||O)&&!t.altFormat&&(N=Ie.defaultConfig.altFormat||de.altFormat,n.altFormat=t.noCalendar||O?"h:i"+(t.enableSeconds?":S K":" K"):N+(" h:i"+(t.enableSeconds?":S":""))+" K"),Object.defineProperty(p.config,"minDate",{get:function(){return p.config._minDate},set:Q("min")}),Object.defineProperty(p.config,"maxDate",{get:function(){return p.config._maxDate},set:Q("max")}),Object.defineProperty(p.config,"minTime",{get:function(){return p.config._minTime},set:ae("min")}),Object.defineProperty(p.config,"maxTime",{get:function(){return p.config._maxTime},set:ae("max")}),"time"===t.mode&&(p.config.noCalendar=!0,p.config.enableTime=!0),Object.assign(p.config,n,t);for(var S=0;S<e.length;S++)p.config[e[S]]=!0===p.config[e[S]]||"true"===p.config[e[S]];for(ue.filter(function(e){return void 0!==p.config[e]}).forEach(function(e){p.config[e]=ge(p.config[e]||[]).map(Y)}),p.isMobile=!p.config.disableMobile&&!p.config.inline&&"single"===p.config.mode&&!p.config.disable.length&&!p.config.enable&&!p.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),S=0;S<p.config.plugins.length;S++){var A,le=p.config.plugins[S](p)||{};for(A in le)-1<ue.indexOf(A)?p.config[A]=ge(le[A]).map(Y).concat(p.config[A]):void 0===t[A]&&(p.config[A]=le[A])}if(t.altInputClass||(p.config.altInputClass=V().className+" "+p.config.altInputClass),k("onParseConfig"),G(),p.input=V(),p.input?(p.input._type=p.input.type,p.input.type="text",p.input.classList.add("flatpickr-input"),p._input=p.input,p.config.altInput&&(p.altInput=ye(p.input.nodeName,p.config.altInputClass),p._input=p.altInput,p.altInput.placeholder=p.input.placeholder,p.altInput.disabled=p.input.disabled,p.altInput.required=p.input.required,p.altInput.tabIndex=p.input.tabIndex,p.altInput.type="text",p.input.setAttribute("type","hidden"),!p.config.static&&p.input.parentNode&&p.input.parentNode.insertBefore(p.altInput,p.input.nextSibling)),p.config.allowInput||p._input.setAttribute("readonly","readonly"),p._positionElement=p.config.positionElement||p._input):p.config.errorHandler(new Error("Invalid input element specified")),p.selectedDates=[],p.now=p.parseDate(p.config.now)||new Date,(O=p.config.defaultDate||("INPUT"!==p.input.nodeName&&"TEXTAREA"!==p.input.nodeName||!p.input.placeholder||p.input.value!==p.input.placeholder?p.input.value:null))&&te(O,p.config.dateFormat),p._initialDate=0<p.selectedDates.length?p.selectedDates[0]:p.config.minDate&&p.config.minDate.getTime()>p.now.getTime()?p.config.minDate:p.config.maxDate&&p.config.maxDate.getTime()<p.now.getTime()?p.config.maxDate:p.now,p.currentYear=p._initialDate.getFullYear(),p.currentMonth=p._initialDate.getMonth(),0<p.selectedDates.length&&(p.latestSelectedDateObj=p.selectedDates[0]),void 0!==p.config.minTime&&(p.config.minTime=p.parseDate(p.config.minTime,"H:i")),void 0!==p.config.maxTime&&(p.config.maxTime=p.parseDate(p.config.maxTime,"H:i")),p.minDateHasTime=!!p.config.minDate&&(0<p.config.minDate.getHours()||0<p.config.minDate.getMinutes()||0<p.config.minDate.getSeconds()),p.maxDateHasTime=!!p.config.maxDate&&(0<p.config.maxDate.getHours()||0<p.config.maxDate.getMinutes()||0<p.config.maxDate.getSeconds()),p.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=p.currentMonth),void 0===t&&(t=p.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:p.l10n.daysInMonth[e]}},!p.isMobile){var I,N=window.document.createDocumentFragment(),F=(p.calendarContainer=ye("div","flatpickr-calendar"),p.calendarContainer.tabIndex=-1,p.config.noCalendar||(N.appendChild((p.monthNav=ye("div","flatpickr-months"),p.yearElements=[],p.monthElements=[],p.prevMonthNav=ye("span","flatpickr-prev-month"),p.prevMonthNav.innerHTML=p.config.prevArrow,p.nextMonthNav=ye("span","flatpickr-next-month"),p.nextMonthNav.innerHTML=p.config.nextArrow,q(),Object.defineProperty(p,"_hidePrevMonthArrow",{get:function(){return p.__hidePrevMonthArrow},set:function(e){p.__hidePrevMonthArrow!==e&&(ve(p.prevMonthNav,"flatpickr-disabled",e),p.__hidePrevMonthArrow=e)}}),Object.defineProperty(p,"_hideNextMonthArrow",{get:function(){return p.__hideNextMonthArrow},set:function(e){p.__hideNextMonthArrow!==e&&(ve(p.nextMonthNav,"flatpickr-disabled",e),p.__hideNextMonthArrow=e)}}),p.currentYearElement=p.yearElements[0],E(),p.monthNav)),p.innerContainer=ye("div","flatpickr-innerContainer"),p.config.weekNumbers&&(F=function(){p.calendarContainer.classList.add("hasWeeks");var e=ye("div","flatpickr-weekwrapper"),t=(e.appendChild(ye("span","flatpickr-weekday",p.l10n.weekAbbreviation)),ye("div","flatpickr-weeks"));return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),I=F.weekWrapper,F=F.weekNumbers,p.innerContainer.appendChild(I),p.weekNumbers=F,p.weekWrapper=I),p.rContainer=ye("div","flatpickr-rContainer"),p.rContainer.appendChild(W()),p.daysContainer||(p.daysContainer=ye("div","flatpickr-days"),p.daysContainer.tabIndex=-1),f(),p.rContainer.appendChild(p.daysContainer),p.innerContainer.appendChild(p.rContainer),N.appendChild(p.innerContainer)),p.config.enableTime&&N.appendChild(function(){p.calendarContainer.classList.add("hasTime"),p.config.noCalendar&&p.calendarContainer.classList.add("noCalendar");var e=Se(p.config),t=(p.timeContainer=ye("div","flatpickr-time"),p.timeContainer.tabIndex=-1,ye("span","flatpickr-time-separator",":")),n=we("flatpickr-hour",{"aria-label":p.l10n.hourAriaLabel}),i=(p.hourElement=n.getElementsByTagName("input")[0],we("flatpickr-minute",{"aria-label":p.l10n.minuteAriaLabel}));p.minuteElement=i.getElementsByTagName("input")[0],p.hourElement.tabIndex=p.minuteElement.tabIndex=-1,p.hourElement.value=pe(p.latestSelectedDateObj?p.latestSelectedDateObj.getHours():p.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),p.minuteElement.value=pe(p.latestSelectedDateObj?p.latestSelectedDateObj.getMinutes():e.minutes),p.hourElement.setAttribute("step",p.config.hourIncrement.toString()),p.minuteElement.setAttribute("step",p.config.minuteIncrement.toString()),p.hourElement.setAttribute("min",p.config.time_24hr?"0":"1"),p.hourElement.setAttribute("max",p.config.time_24hr?"23":"12"),p.hourElement.setAttribute("maxlength","2"),p.minuteElement.setAttribute("min","0"),p.minuteElement.setAttribute("max","59"),p.minuteElement.setAttribute("maxlength","2"),p.timeContainer.appendChild(n),p.timeContainer.appendChild(t),p.timeContainer.appendChild(i),p.config.time_24hr&&p.timeContainer.classList.add("time24hr");p.config.enableSeconds&&(p.timeContainer.classList.add("hasSeconds"),n=we("flatpickr-second"),p.secondElement=n.getElementsByTagName("input")[0],p.secondElement.value=pe(p.latestSelectedDateObj?p.latestSelectedDateObj.getSeconds():e.seconds),p.secondElement.setAttribute("step",p.minuteElement.getAttribute("step")),p.secondElement.setAttribute("min","0"),p.secondElement.setAttribute("max","59"),p.secondElement.setAttribute("maxlength","2"),p.timeContainer.appendChild(ye("span","flatpickr-time-separator",":")),p.timeContainer.appendChild(n));p.config.time_24hr||(p.amPM=ye("span","flatpickr-am-pm",p.l10n.amPM[_e(11<(p.latestSelectedDateObj?p.hourElement.value:p.config.defaultHour))]),p.amPM.title=p.l10n.toggleTitle,p.amPM.tabIndex=-1,p.timeContainer.appendChild(p.amPM));return p.timeContainer}()),ve(p.calendarContainer,"rangeMode","range"===p.config.mode),ve(p.calendarContainer,"animate",!0===p.config.animate),ve(p.calendarContainer,"multiMonth",1<p.config.showMonths),p.calendarContainer.appendChild(N),void 0!==p.config.appendTo&&void 0!==p.config.appendTo.nodeType);(p.config.inline||p.config.static)&&(p.calendarContainer.classList.add(p.config.inline?"inline":"static"),p.config.inline&&(!F&&p.element.parentNode?p.element.parentNode.insertBefore(p.calendarContainer,p._input.nextSibling):void 0!==p.config.appendTo&&p.config.appendTo.appendChild(p.calendarContainer)),p.config.static&&(I=ye("div","flatpickr-wrapper"),p.element.parentNode&&p.element.parentNode.insertBefore(I,p.element),I.appendChild(p.element),p.altInput&&I.appendChild(p.altInput),I.appendChild(p.calendarContainer))),p.config.static||p.config.inline||(void 0!==p.config.appendTo?p.config.appendTo:window.document.body).appendChild(p.calendarContainer)}if(p.config.wrap&&["open","close","toggle","clear"].forEach(function(t){Array.prototype.forEach.call(p.element.querySelectorAll("[data-"+t+"]"),function(e){return a(e,"click",p[t])})}),p.isMobile){var j=p.config.enableTime?p.config.noCalendar?"time":"datetime-local":"date";p.mobileInput=ye("input",p.input.className+" flatpickr-mobile"),p.mobileInput.tabIndex=1,p.mobileInput.type=j,p.mobileInput.disabled=p.input.disabled,p.mobileInput.required=p.input.required,p.mobileInput.placeholder=p.input.placeholder,p.mobileFormatStr="datetime-local"==j?"Y-m-d\\TH:i:S":"date"==j?"Y-m-d":"H:i:S",0<p.selectedDates.length&&(p.mobileInput.defaultValue=p.mobileInput.value=p.formatDate(p.selectedDates[0],p.mobileFormatStr)),p.config.minDate&&(p.mobileInput.min=p.formatDate(p.config.minDate,"Y-m-d")),p.config.maxDate&&(p.mobileInput.max=p.formatDate(p.config.maxDate,"Y-m-d")),p.input.getAttribute("step")&&(p.mobileInput.step=String(p.input.getAttribute("step"))),p.input.type="hidden",void 0!==p.altInput&&(p.altInput.type="hidden");try{p.input.parentNode&&p.input.parentNode.insertBefore(p.mobileInput,p.input.nextSibling)}catch(e){}a(p.mobileInput,"change",function(e){p.setDate(De(e).value,!1,p.mobileFormatStr),k("onChange"),k("onClose")})}else j=me($,50),p._debouncedChange=me(o,Ae),p.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&a(p.daysContainer,"mouseover",function(e){"range"===p.config.mode&&K(De(e))}),a(window.document.body,"keydown",J),p.config.inline||p.config.static||a(window,"resize",j),void 0!==window.ontouchstart?a(window.document,"touchstart",z):a(window.document,"mousedown",z),a(window.document,"focus",z,{capture:!0}),!0===p.config.clickOpens&&(a(p._input,"focus",p.open),a(p._input,"click",p.open)),void 0!==p.daysContainer&&(a(p.monthNav,"click",re),a(p.monthNav,["keyup","increment"],L),a(p.daysContainer,"click",ee)),void 0!==p.timeContainer&&void 0!==p.minuteElement&&void 0!==p.hourElement&&(a(p.timeContainer,["increment"],h),a(p.timeContainer,"blur",h,{capture:!0}),a(p.timeContainer,"click",R),a([p.hourElement,p.minuteElement],["focus","click"],function(e){return De(e).select()}),void 0!==p.secondElement&&a(p.secondElement,"focus",function(){return p.secondElement&&p.secondElement.select()}),void 0!==p.amPM&&a(p.amPM,"click",function(e){h(e),o()})),p.config.allowInput&&a(p._input,"blur",U);return(p.selectedDates.length||p.config.noCalendar)&&(p.config.enableTime&&i(p.config.noCalendar?p.latestSelectedDateObj:void 0),T(!1)),H(),n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),!p.isMobile&&n&&x(),k("onReady"),p}function n(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),i=[],o=0;o<n.length;o++){var s=n[o];try{null===s.getAttribute("data-fp-omit")&&(void 0!==s._flatpickr&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=r(s,t||{}),i.push(s._flatpickr))}catch(e){console.error(e)}}return 1===i.length?i[0]:i}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return n(this,e)},HTMLElement.prototype.flatpickr=function(e){return n([this],e)});var Ie=function(e,t){return"string"==typeof e?n(window.document.querySelectorAll(e),t):e instanceof Node?n([e],t):n(e,t)};return Ie.defaultConfig={},Ie.l10ns={en:ce({},fe),default:ce({},fe)},Ie.localize=function(e){Ie.l10ns.default=ce(ce({},Ie.l10ns.default),e)},Ie.setDefaults=function(e){Ie.defaultConfig=ce(ce({},Ie.defaultConfig),e)},Ie.parseDate=ke({}),Ie.formatDate=Me({}),Ie.compareDates=Ee,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return n(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=Ie),Ie}),function(r){function t(e,t){this.element=r(e),this.options=t,this.init()}t.prototype.init=function(){this.element.chosen(this.options),this.container=this.element.next(".chosen-container"),this.search_field=this.container.find(".chosen-search-input"),this.is_multiple=this.container.hasClass("chosen-container-multi"),this.is_typing=!1,this.chosenXhr=null,this.events()},t.prototype.events=function(){var e=this;this.search_field.on("compositionstart",function(){e.is_typing=!0}),this.search_field.on("compositionend",function(){e.is_typing=!1,e.update_list()}),this.search_field.on("keyup",function(){e.update_list()}),this.search_field.on("focus",function(){e.search_field_focused()})},t.prototype.search_field_focused=function(){this.search_welcome_message(),0===this.options.min_length&&0===this.search_field.val().length&&this.update_list()},t.prototype.search_welcome_message=function(){var e=r.trim(this.search_field.val()),t=this.container.find(".chosen-results");0===t.children().length&&0===e.length&&t.html('<li class="no-results">'+this.options.typing_text.replace("%s",this.options.min_length-e.length)+"</li>")},t.prototype.update_list=function(){var e,t,n=this;this.search_welcome_message(),this.is_typing||(t=(e=r.trim(this.search_field.val())).length<this.options.min_length?this.options.typing_text.replace("%s",this.options.min_length-e.length):this.options.searching_text,this.container.find(".no-results").text(t),e!==this.search_field.data("prevVal")&&(this.search_field.data("prevVal",e),this.timer&&clearTimeout(this.timer),e.length<this.options.min_length||(this.timer=setTimeout(function(){n.chosenXhr&&n.chosenXhr.abort(),n.options.data.term=e,n.chosenXhr=window.wp.ajax.post("csf-chosen",n.options.data).done(function(e){n.show_results(e)}).fail(function(e){n.container.find(".no-results").text(e.error)})},this.options.type_delay))))},t.prototype.show_results=function(e){var n,t,i,o,s=this;this.is_typing||null===e||(0===e.length?(this.element.data().chosen.no_results_clear(),this.element.data().chosen.no_results(this.search_field.val())):(n=[],this.element.find("option").each(function(){r(this).is(":selected")?n.push(r(this).val()+"-"+r(this).text()):r(this).attr("value").length&&r(this).remove()}),r.each(e,function(e,t){-1===r.inArray(t.value+"-"+t.text,n)&&r("<option />").attr("value",t.value).html(t.text).appendTo(s.element)}),t=this.search_field.val(),i=this.search_field.innerWidth(),this.element.trigger("chosen:updated"),this.is_multiple&&(o=this.element.parent().find(".csf-hide-select").val()||[],this.element.CSFChosenOrder(o,!0),this.search_field.css("width",i)),this.search_field.val(t),null!==this.chosenXhr.done&&this.chosenXhr.done(e)))},r.fn.CSFAjaxChosen=function(e){return this.each(function(){new t(this,e)})}}(jQuery),function(){var s,r,a=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},l={}.hasOwnProperty;function e(){}e.insertAt=function(e,t,n){return n.insertBefore(e,n.children[t].nextSibling)},e.getFlattenedOptionsAndGroups=function(e){for(var t,n,i,o,s,r=Array.prototype.filter.call(e.childNodes,function(e){return"OPTION"===(e=e.nodeName.toUpperCase())||"OPTGROUP"===e}),a=[],l=0,c=r.length;l<c;l++)if(t=r[l],a.push(t),"OPTGROUP"===t.nodeName.toUpperCase())for(o=0,s=(i=Array.prototype.filter.call(t.childNodes,function(e){return"OPTION"===e.nodeName.toUpperCase()})).length;o<s;o++)n=i[o],a.push(n);return a},e.isValidMultipleSelectElement=function(e){return null!=e&&"SELECT"===e.nodeName&&e.multiple},e.getChosenUIContainer=function(e){return""!==e.id?document.getElementById(e.id.replace(/-/g,"_")+"_chosen"):this.searchChosenUIContainer(e)},e.isChosenified=function(e){return null!=this.getChosenUIContainer(e)},e.forceSelection=function(e,t){for(var n,i,o=this.getFlattenedOptionsAndGroups(e),s=0;s<o.length;)i=(n=o[s]).getAttribute("value"),0<=a.call(t,i)?(n.selected=!0,n.setAttribute("selected","")):(n.selected=!1,n.removeAttribute("selected")),s++;return this.triggerEvent(e,"chosen:updated")},e.CSFChosenOrder=function(e,t,n){var i,o,s,r,a,l,c,h,u,d,f,p,_;if(null!=this.getDOMElement&&(e=this.getDOMElement(e)),this.isValidMultipleSelectElement(e)&&null!=(i=this.getChosenUIContainer(e))&&t instanceof Array){for(t=t.map(Function.prototype.call,String.prototype.trim),l=this.getFlattenedOptionsAndGroups(e),null!=n&&!0===n&&this.forceSelection(e,t),_=[],o=u=0,f=t.length;u<f;o=++u){for(r=t[o],c=null,s=d=0,p=l.length;d<p;s=++d)l[s].value===r&&(c=s);a=i.querySelectorAll(".search-choice"),h=this.relAttributeName,null!=(a=Array.prototype.filter.call(a,function(e){return null!=e.querySelector("a.search-choice-close["+h+'="'+c+'"]')})[0])&&(i.querySelector("ul.chosen-choices"),_.push(this.insertAt(a,o,i.querySelector("ul.chosen-choices"))))}return _}},r=e,(s=jQuery).fn.extend({CSFChosenOrder:function(e,t){return _CSFChosenOrder.CSFChosenOrder(this,e,t)}}),this._CSFChosenOrder=function(){var e,t=o,n=r;for(e in n)l.call(n,e)&&(t[e]=n[e]);function i(){this.constructor=t}function o(){return o.__super__.constructor.apply(this,arguments)}return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,o.relAttributeName="data-option-array-index",o.isjQueryObject=function(e){return"undefined"!=typeof jQuery&&null!==jQuery&&e instanceof jQuery},o.getDOMElement=function(e){return this.isjQueryObject(e)?e.get(0):e},o.searchChosenUIContainer=function(e){return null!=s(e).data("chosen")?s(e).data("chosen").container[0]:s(e).next(".chosen-container.chosen-container-multi").get(0)},o.triggerEvent=function(e,t){return s(e).trigger(t)},o}()}.call(this),function(){var a,s,o,r,l={}.hasOwnProperty;function e(){this.options_index=0,this.parsed=[]}function c(e,t){var n,i;this.form_field=e,this.options=null!=t?t:{},this.label_click_handler=(n=this.label_click_handler,i=this,function(){return n.apply(i,arguments)}),c.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}e.prototype.add_node=function(e){return"OPTGROUP"===e.nodeName.toUpperCase()?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,i,o,s,r=this.parsed.length;for(this.parsed.push({array_index:r,group:!0,label:e.label,title:e.title||void 0,children:0,disabled:e.disabled,classes:e.className}),s=[],t=0,n=(o=e.childNodes).length;t<n;t++)i=o[t],s.push(this.add_option(i,r,e.disabled));return s},e.prototype.add_option=function(e,t,n){if("OPTION"===e.nodeName.toUpperCase())return""!==e.text?(null!=t&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,title:e.title||void 0,selected:e.selected,disabled:!0===n?n:e.disabled,group_array_index:t,group_label:null!=t?this.parsed[t].label:null,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},(r=e).select_to_array=function(e){for(var t,n=new r,i=e.childNodes,o=0,s=i.length;o<s;o++)t=i[o],n.add_node(t);return n.parsed},c.prototype.set_default_values=function(){var t,n;return this.click_test_action=(t=this,function(e){return t.test_active_click(e)}),this.activate_action=(n=this,function(e){return n.activate_field(e)}),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},c.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||c.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||c.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||c.default_no_result_text},c.prototype.choice_label=function(e){return this.include_group_label_in_selected&&null!=e.group_label?"<b class='group-name'>"+this.escape_html(e.group_label)+"</b>"+e.html:e.html},c.prototype.mouse_enter=function(){return this.mouse_on_container=!0},c.prototype.mouse_leave=function(){return this.mouse_on_container=!1},c.prototype.input_focus=function(e){if(this.is_multiple){if(!this.active_field)return setTimeout((t=this,function(){return t.container_mousedown()}),50)}else if(!this.active_field)return this.activate_field();var t},c.prototype.input_blur=function(e){if(!this.mouse_on_container)return this.active_field=!1,setTimeout((t=this,function(){return t.blur_test()}),100);var t},c.prototype.label_click_handler=function(e){return this.is_multiple?this.container_mousedown(e):this.activate_field()},c.prototype.results_option_build=function(e){for(var t,n,i="",o=0,s=this.results_data,r=0,a=s.length;r<a&&((n="")!==(n=(t=s[r]).group?this.result_add_group(t):this.result_add_option(t))&&(o++,i+=n),null!=e&&e.first&&(t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(t))),!(o>=this.max_shown_results));r++);return i},c.prototype.result_add_option=function(e){var t,n;return e.search_match&&this.include_option_in_results(e)?(t=[],e.disabled||e.selected&&this.is_multiple||t.push("active-result"),!e.disabled||e.selected&&this.is_multiple||t.push("disabled-result"),e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),(n=document.createElement("li")).className=t.join(" "),e.style&&(n.style.cssText=e.style),n.setAttribute("data-option-array-index",e.array_index),n.innerHTML=e.highlighted_html||e.html,e.title&&(n.title=e.title),this.outerHTML(n)):""},c.prototype.result_add_group=function(e){var t,n;return(e.search_match||e.group_match)&&0<e.active_options?((t=[]).push("group-result"),e.classes&&t.push(e.classes),(n=document.createElement("li")).className=t.join(" "),n.innerHTML=e.highlighted_html||this.escape_html(e.label),e.title&&(n.title=e.title),this.outerHTML(n)):""},c.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},c.prototype.reset_single_select_options=function(){for(var e,t=this.results_data,n=[],i=0,o=t.length;i<o;i++)(e=t[i]).selected?n.push(e.selected=!1):n.push(void 0);return n},c.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},c.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},c.prototype.winnow_results=function(e){var t,n,i,o,s,r,a,l,c,h,u,d,f;for(this.no_results_clear(),h=0,t=(a=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(t),i=0,o=(l=this.results_data).length;i<o;i++)(s=l[i]).search_match=!1,u=null,s.highlighted_html="",this.include_option_in_results(s)&&(s.group&&(s.group_match=!1,s.active_options=0),null!=s.group_array_index&&this.results_data[s.group_array_index]&&(0===(u=this.results_data[s.group_array_index]).active_options&&u.search_match&&(h+=1),u.active_options+=1),f=s.group?s.label:s.text,s.group&&!this.group_search||(d=this.search_string_match(f,c),s.search_match=null!=d,s.search_match&&!s.group&&(h+=1),s.search_match?(a.length&&(d=d.index,r=f.slice(0,d),n=f.slice(d,d+a.length),f=f.slice(d+a.length),s.highlighted_html=this.escape_html(r)+"<em>"+this.escape_html(n)+"</em>"+this.escape_html(f)),null!=u&&(u.group_match=!0)):null!=s.group_array_index&&this.results_data[s.group_array_index].search_match&&(s.search_match=!0)));return this.result_clear_highlight(),h<1&&a.length?(this.update_results_content(""),this.no_results(a)):(this.update_results_content(this.results_option_build()),null!=e&&e.skip_highlight?void 0:this.winnow_results_set_highlight())},c.prototype.get_search_regex=function(e){var t,e=this.search_contains?e:"(^|\\s|\\b)"+e+"[^\\s]*";return this.enable_split_word_search||this.search_contains||(e="^"+e),t=this.case_sensitive_search?"":"i",new RegExp(e,t)},c.prototype.search_string_match=function(e,t){t=t.exec(e);return!this.search_contains&&null!=t&&t[1]&&(t.index+=1),t},c.prototype.choices_count=function(){var e,t,n;if(null==this.selected_option_count)for(e=this.selected_option_count=0,t=(n=this.form_field.options).length;e<t;e++)n[e].selected&&(this.selected_option_count+=1);return this.selected_option_count},c.prototype.choices_click=function(e){if(e.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},c.prototype.keydown_checker=function(e){var t=null!=(t=e.which)?t:e.keyCode;switch(this.search_field_scale(),8!==t&&this.pending_backstroke&&this.clear_backstroke(),t){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&e.preventDefault();break;case 32:this.disable_search&&e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:e.preventDefault(),this.keydown_arrow()}},c.prototype.keyup_checker=function(e){var t=null!=(t=e.which)?t:e.keyCode;switch(this.search_field_scale(),t){case 8:this.is_multiple&&this.backstroke_length<1&&0<this.choices_count()?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:e.preventDefault(),this.results_showing&&this.result_select(e);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},c.prototype.clipboard_event_checker=function(e){var t;if(!this.is_disabled)return setTimeout((t=this,function(){return t.results_search()}),50)},c.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},c.prototype.include_option_in_results=function(e){return!(this.is_multiple&&!this.display_selected_options&&e.selected)&&(!(!this.display_disabled_options&&e.disabled)&&!e.empty)},c.prototype.search_results_touchstart=function(e){return this.touch_started=!0,this.search_results_mouseover(e)},c.prototype.search_results_touchmove=function(e){return this.touch_started=!1,this.search_results_mouseout(e)},c.prototype.search_results_touchend=function(e){if(this.touch_started)return this.search_results_mouseup(e)},c.prototype.outerHTML=function(e){var t;return e.outerHTML||((t=document.createElement("div")).appendChild(e),t.innerHTML)},c.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n  <span>'+this.default_text+'</span>\n  <div><b></b></div>\n</a>\n<div class="chosen-drop">\n  <div class="chosen-search">\n    <input class="chosen-search-input" type="text" autocomplete="off" />\n  </div>\n  <ul class="chosen-results"></ul>\n</div>'},c.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n  <li class="search-field">\n    <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n  </li>\n</ul>\n<div class="chosen-drop">\n  <ul class="chosen-results"></ul>\n</div>'},c.prototype.get_no_results_html=function(e){return'<li class="no-results">\n  '+this.results_none_found+" <span>"+this.escape_html(e)+"</span>\n</li>"},c.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?8<=document.documentMode:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},c.default_multiple_text="Select Some Options",c.default_single_text="Select an Option",c.default_no_result_text="No results match",s=c,(a=jQuery).fn.extend({chosen:function(i){return s.browser_is_supported()?this.each(function(e){var t=a(this),n=t.data("chosen");"destroy"===i?n instanceof o&&n.destroy():n instanceof o||t.data("chosen",new o(this,i))}):this}}),o=function(){var e,t=o,n=s;for(e in n)l.call(n,e)&&(t[e]=n[e]);function i(){this.constructor=t}function o(){return o.__super__.constructor.apply(this,arguments)}return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,o.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},o.prototype.set_up_html=function(){var e=["chosen-container"];return e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),e={class:e.join(" "),title:this.form_field.title},this.form_field.id.length&&(e.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",e),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},o.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},o.prototype.register_observers=function(){var t,n,i,o,s,r,a,l,c,h,u,d,f,p,_,m,g,v,y,b,w,D,C,x;return this.container.on("touchstart.chosen",(t=this,function(e){t.container_mousedown(e)})),this.container.on("touchend.chosen",(n=this,function(e){n.container_mouseup(e)})),this.container.on("mousedown.chosen",(i=this,function(e){i.container_mousedown(e)})),this.container.on("mouseup.chosen",(o=this,function(e){o.container_mouseup(e)})),this.container.on("mouseenter.chosen",(s=this,function(e){s.mouse_enter(e)})),this.container.on("mouseleave.chosen",(r=this,function(e){r.mouse_leave(e)})),this.search_results.on("mouseup.chosen",(a=this,function(e){a.search_results_mouseup(e)})),this.search_results.on("mouseover.chosen",(l=this,function(e){l.search_results_mouseover(e)})),this.search_results.on("mouseout.chosen",(c=this,function(e){c.search_results_mouseout(e)})),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",(h=this,function(e){h.search_results_mousewheel(e)})),this.search_results.on("touchstart.chosen",(u=this,function(e){u.search_results_touchstart(e)})),this.search_results.on("touchmove.chosen",(d=this,function(e){d.search_results_touchmove(e)})),this.search_results.on("touchend.chosen",(f=this,function(e){f.search_results_touchend(e)})),this.form_field_jq.on("chosen:updated.chosen",(p=this,function(e){p.results_update_field(e)})),this.form_field_jq.on("chosen:activate.chosen",(_=this,function(e){_.activate_field(e)})),this.form_field_jq.on("chosen:open.chosen",(m=this,function(e){m.container_mousedown(e)})),this.form_field_jq.on("chosen:close.chosen",(g=this,function(e){g.close_field(e)})),this.search_field.on("blur.chosen",(v=this,function(e){v.input_blur(e)})),this.search_field.on("keyup.chosen",(y=this,function(e){y.keyup_checker(e)})),this.search_field.on("keydown.chosen",(b=this,function(e){b.keydown_checker(e)})),this.search_field.on("focus.chosen",(w=this,function(e){w.input_focus(e)})),this.search_field.on("cut.chosen",(D=this,function(e){D.clipboard_event_checker(e)})),this.search_field.on("paste.chosen",(C=this,function(e){C.clipboard_event_checker(e)})),this.is_multiple?this.search_choices.on("click.chosen",(x=this,function(e){x.choices_click(e)})):this.container.on("click.chosen",function(e){e.preventDefault()})},o.prototype.destroy=function(){return a(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),0<this.form_field_label.length&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},o.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},o.prototype.container_mousedown=function(e){var t;if(!this.is_disabled)return!e||"mousedown"!==(t=e.type)&&"touchstart"!==t||this.results_showing||e.preventDefault(),null!=e&&a(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||a(e.target)[0]!==this.selected_item[0]&&!a(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},o.prototype.container_mouseup=function(e){if("ABBR"===e.target.nodeName&&!this.is_disabled)return this.results_reset(e)},o.prototype.search_results_mousewheel=function(e){var t;if(null!=(t=e.originalEvent?e.originalEvent.deltaY||-e.originalEvent.wheelDelta||e.originalEvent.detail:t))return e.preventDefault(),"DOMMouseScroll"===e.type&&(t*=40),this.search_results.scrollTop(t+this.search_results.scrollTop())},o.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},o.prototype.close_field=function(){return a(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},o.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},o.prototype.test_active_click=function(e){e=a(e.target).closest(".chosen-container");return e.length&&this.container[0]===e[0]?this.active_field=!0:this.close_field()},o.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=r.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},o.prototype.result_do_highlight=function(e){var t,n,i;if(e.length)return this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),(e=parseInt(this.search_results.css("maxHeight"),10))+(i=this.search_results.scrollTop())<=(t=(n=this.result_highlight.position().top+this.search_results.scrollTop())+this.result_highlight.outerHeight())?this.search_results.scrollTop(0<t-e?t-e:0):n<i?this.search_results.scrollTop(n):void 0},o.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},o.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},o.prototype.update_results_content=function(e){return this.search_results.html(e)},o.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},o.prototype.set_tab_index=function(e){var t;if(this.form_field.tabIndex)return t=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=t},o.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),0<this.form_field_label.length)return this.form_field_label.on("click.chosen",this.label_click_handler)},o.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},o.prototype.search_results_mouseup=function(e){var t=a(e.target).hasClass("active-result")?a(e.target):a(e.target).parents(".active-result").first();if(t.length)return this.result_highlight=t,this.result_select(e),this.search_field.focus()},o.prototype.search_results_mouseover=function(e){e=a(e.target).hasClass("active-result")?a(e.target):a(e.target).parents(".active-result").first();if(e)return this.result_do_highlight(e)},o.prototype.search_results_mouseout=function(e){if(a(e.target).hasClass("active-result")||a(e.target).parents(".active-result").first())return this.result_clear_highlight()},o.prototype.choice_build=function(e){var t,n=a("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(e)+"</span>");return e.disabled?n.addClass("search-choice-disabled"):((e=a("<a />",{class:"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",(t=this,function(e){return t.choice_destroy_link_click(e)})),n.append(e)),this.search_container.before(n)},o.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(a(e.target))},o.prototype.choice_destroy=function(e){if(this.result_deselect(e[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&0<this.choices_count()&&this.get_search_field_value().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},o.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},o.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},o.prototype.result_select=function(e){var t;if(this.result_highlight)return t=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?t.removeClass("active-result"):this.reset_single_select_options(),t.addClass("result-selected"),(t=this.results_data[t[0].getAttribute("data-option-array-index")]).selected=!0,this.form_field.options[t.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(t):this.single_set_selected_text(this.choice_label(t)),this.is_multiple&&(!this.hide_results_on_select||e.metaKey||e.ctrlKey)?e.metaKey||e.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),!this.is_multiple&&this.form_field.selectedIndex===this.current_selectedIndex||this.trigger_form_field_change({selected:this.form_field.options[t.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,e.preventDefault(),this.search_field_scale())},o.prototype.single_set_selected_text=function(e){return(e=null==e?this.default_text:e)===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(e)},o.prototype.result_deselect=function(e){e=this.results_data[e];return!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},o.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},o.prototype.get_search_field_value=function(){return this.search_field.val()},o.prototype.get_search_text=function(){return a.trim(this.get_search_field_value())},o.prototype.escape_html=function(e){return a("<div/>").text(e).html()},o.prototype.winnow_results_set_highlight=function(){var e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=(e.length?e:this.search_results.find(".active-result")).first();if(null!=e)return this.result_do_highlight(e)},o.prototype.no_results=function(e){e=this.get_no_results_html(e);return this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},o.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},o.prototype.keydown_arrow=function(){var e;return this.results_showing&&this.result_highlight?(e=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(e):void 0:this.results_show()},o.prototype.keyup_arrow=function(){var e;return this.results_showing||this.is_multiple?this.result_highlight?(e=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(e.first()):(0<this.choices_count()&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},o.prototype.keydown_backstroke=function(){var e;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(e=this.search_container.siblings("li.search-choice").last()).length&&!e.hasClass("search-choice-disabled")?(this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},o.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},o.prototype.search_field_scale=function(){var e,t,n,i,o,s,r;if(this.is_multiple){for(o={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},t=0,n=(s=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;t<n;t++)o[i=s[t]]=this.search_field.css(i);return(e=a("<div />").css(o)).text(this.get_search_field_value()),a("body").append(e),r=e.width()+25,e.remove(),this.container.is(":visible")&&(r=Math.min(this.container.outerWidth()-10,r)),this.search_field.width(r)}},o.prototype.trigger_form_field_change=function(e){return this.form_field_jq.trigger("input",e),this.form_field_jq.trigger("change",e)},o}()}.call(this),function(r){"use strict";function i(e,t,n){this.init(e,t,n)}function e(){this.rules=[]}r.extend(i.prototype,{init:function(e,t,n){this.controller=e,this.condition=t,this.value=n,this.rules=[],this.controls=[]},evalCondition:function(e,t,n,i,o){if("=="==n)return this.checkBoolean(i)==this.checkBoolean(o);if("!="==n)return this.checkBoolean(i)!=this.checkBoolean(o);if(">="==n)return Number(o)>=Number(i);if("<="==n)return Number(o)<=Number(i);if(">"==n)return Number(o)>Number(i);if("<"==n)return Number(o)<Number(i);if("()"==n)return window[i](e,t,o);if("any"==n){if(r.isArray(o)){for(var s=o.length-1;0<=s;s--)if(-1!==r.inArray(o[s],i.split(",")))return!0}else if(-1!==r.inArray(o,i.split(",")))return!0}else if("not-any"==n)if(r.isArray(o)){for(s=o.length-1;0<=s;s--)if(-1==r.inArray(o[s],i.split(",")))return!0}else if(-1==r.inArray(o,i.split(",")))return!0;return!1},checkBoolean:function(e){switch(e){case!0:case"true":case 1:case"1":e=!0;break;case null:case!1:case"false":case 0:case"0":e=!1}return e},checkCondition:function(e){if(!this.condition)return!0;var t=e.find(this.controller),n=this.getControlValue(e,t);return void 0!==n&&(n=this.normalizeValue(t,this.value,n),this.evalCondition(e,t,this.condition,this.value,n))},normalizeValue:function(e,t,n){return"number"==typeof t?parseFloat(n):n},getControlValue:function(e,t){return 1<t.length&&("radio"==t.attr("type")||"checkbox"==t.attr("type"))?t.filter(":checked").map(function(){return this.value}).get():"checkbox"==t.attr("type")||"radio"==t.attr("type")?t.is(":checked"):t.val()},createRule:function(e,t,n){e=new i(e,t,n);return this.rules.push(e),e},include:function(e){this.controls.push(e)},applyRule:function(n,e){var e=void 0===e?this.checkCondition(n):e,t=r.map(this.controls,function(e,t){return n.find(e)});e?(r(t).each(function(){r(this).removeClass("csf-depend-on")}),r(this.rules).each(function(){this.applyRule(n)})):(r(t).each(function(){r(this).addClass("csf-depend-on")}),r(this.rules).each(function(){this.applyRule(n,!1)}))}}),r.extend(e.prototype,{createRule:function(e,t,n){e=new i(e,t,n);return this.rules.push(e),e},applyRules:function(e){r(this.rules).each(function(){this.applyRule(e)})}}),r.csf_deps={createRuleset:function(){return new e},enable:function(t,n,i){return t.on("change keyup",function(e){e=e.target.getAttribute("data-depend-id")||e.target.getAttribute("data-sub-depend-id");-1!==i.indexOf(e)&&n.applyRules(t)}),n.applyRules(t),!0}}}(jQuery),function(e,t){var n;"function"==typeof define&&define.amd?define(["exports","jquery"],t):"undefined"!=typeof exports?(n=require("jquery"),t(exports,n)):t(e,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,t){var a={validate:/^(?!(_nonce|_pseudo))[a-zA-Z0-9_-]*(?:\[(?:\d*|(?!(_nonce|_pseudo))[a-zA-Z0-9_-]+)\])*$/i,key:/[a-zA-Z0-9_-]+|(?=\[\])/g,named:/^[a-zA-Z0-9_-]+$/,push:/^$/,fixed:/^\d+$/};function n(i,e){var t={},o={};function s(e,t,n){return e[t]=n,e}function n(e,t){for(var n,i=e.match(a.key);void 0!==(n=i.pop());)a.push.test(n)?t=s([],function(e){void 0===o[e]&&(o[e]=0);return o[e]++}(e.replace(/\[\]$/,"")),t):a.fixed.test(n)?t=s([],n,t):a.named.test(n)&&(t=s({},n,t));return t}function r(){return t}this.addPair=function(e){return a.validate.test(e.name)&&(e=n(e.name,e.value),t=i.extend(!0,t,e)),this},this.addPairs=function(e){if(!i.isArray(e))throw new Error("formSerializer.addPairs expects an Array");for(var t=0,n=e.length;t<n;t++)this.addPair(e[t]);return this},this.serialize=r,this.serializeJSON=function(){return JSON.stringify(t)}}return n.patterns=a,n.serializeObject=function(){return new n(t).addPairs(this.serializeArray()).serialize()},n.serializeJSON=function(){return new n(t).addPairs(this.serializeArray()).serializeJSON()},void 0!==t.fn&&(t.fn.serializeObjectCSF=n.serializeObject,t.fn.serializeJSONCSF=n.serializeJSON),e.FormSerializer=n});
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/classes/abstract.class.php

    r2986425 r3207680  
    99 */
    1010if ( ! class_exists( 'CSF_Abstract' ) ) {
    11   abstract class CSF_Abstract {
     11#[AllowDynamicProperties]
     12abstract class CSF_Abstract {
    1213
    13     public $abstract   = '';
    14     public $output_css = '';
     14  public $abstract   = '';
     15  public $output_css = '';
    1516
    16     public function __construct() {
     17  public function __construct() {
    1718
    18       // Collect output css and typography
    19       if ( ! empty( $this->args['output_css'] ) || ! empty( $this->args['enqueue_webfont'] ) ) {
    20         add_action( 'wp_enqueue_scripts', array( $this, 'collect_output_css_and_typography' ), 10 );
    21         CSF::$css = apply_filters( "csf_{$this->unique}_output_css", CSF::$css, $this );
    22       }
    23 
     19    // Collect output css and typography
     20    if ( ! empty( $this->args['output_css'] ) || ! empty( $this->args['enqueue_webfont'] ) ) {
     21      add_action( 'wp_enqueue_scripts', array( $this, 'collect_output_css_and_typography' ), 10 );
     22      CSF::$css = apply_filters( "csf_{$this->unique}_output_css", CSF::$css, $this );
    2423    }
    2524
    26     public function collect_output_css_and_typography() {
    27       $this->recursive_output_css( $this->pre_fields );
    28     }
     25  }
    2926
    30     public function recursive_output_css( $fields = array(), $combine_field = array() ) {
     27  public function collect_output_css_and_typography() {
     28    $this->recursive_output_css( $this->pre_fields );
     29  }
    3130
    32       if ( ! empty( $fields ) ) {
     31  public function recursive_output_css( $fields = array(), $combine_field = array() ) {
    3332
    34         foreach ( $fields as $field ) {
     33    if ( ! empty( $fields ) ) {
    3534
    36           $field_id     = ( ! empty( $field['id'] ) ) ? $field['id'] : '';
    37           $field_type   = ( ! empty( $field['type'] ) ) ? $field['type'] : '';
    38           $field_output = ( ! empty( $field['output'] ) ) ? $field['output'] : '';
    39           $field_check  = ( $field_type === 'typography' || $field_output ) ? true : false;
    40           $field_class  = 'CSF_Field_' . $field_type;
     35      foreach ( $fields as $field ) {
    4136
    42           if ( $field_type && $field_id ) {
     37        $field_id     = ( ! empty( $field['id'] ) ) ? $field['id'] : '';
     38        $field_type   = ( ! empty( $field['type'] ) ) ? $field['type'] : '';
     39        $field_output = ( ! empty( $field['output'] ) ) ? $field['output'] : '';
     40        $field_check  = ( $field_type === 'typography' || $field_output ) ? true : false;
     41        $field_class  = 'CSF_Field_' . $field_type;
     42
     43        if ( $field_type && $field_id ) {
    4344
    4445
    45             if( $field_type === 'fieldset' ) {
    46               if ( ! empty( $field['fields'] ) ) {
    47                 $this->recursive_output_css( $field['fields'], $field );
     46          if( $field_type === 'fieldset' ) {
     47            if ( ! empty( $field['fields'] ) ) {
     48              $this->recursive_output_css( $field['fields'], $field );
     49            }
     50          }
     51
     52          if( $field_type === 'accordion' ) {
     53            if ( ! empty( $field['accordions'] ) ) {
     54              foreach ( $field['accordions'] as $accordion ) {
     55                $this->recursive_output_css( $accordion['fields'], $field );
    4856              }
    4957            }
     58          }
    5059
    51             if( $field_type === 'accordion' ) {
    52               if ( ! empty( $field['accordions'] ) ) {
    53                 foreach ( $field['accordions'] as $accordion ) {
    54                   $this->recursive_output_css( $accordion['fields'], $field );
    55                 }
     60          if( $field_type === 'tabbed' ) {
     61            if ( ! empty( $field['tabs'] ) ) {
     62              foreach ( $field['tabs'] as $accordion ) {
     63                $this->recursive_output_css( $accordion['fields'], $field );
    5664              }
    5765            }
     66          }
    5867
    59             if( $field_type === 'tabbed' ) {
    60               if ( ! empty( $field['tabs'] ) ) {
    61                 foreach ( $field['tabs'] as $accordion ) {
    62                   $this->recursive_output_css( $accordion['fields'], $field );
    63                 }
    64               }
    65             }
     68          if ( class_exists( $field_class ) ) {
    6669
    67             if ( class_exists( $field_class ) ) {
     70            if ( method_exists( $field_class, 'output' ) || method_exists( $field_class, 'enqueue_google_fonts' ) ) {
    6871
    69               if ( method_exists( $field_class, 'output' ) || method_exists( $field_class, 'enqueue_google_fonts' ) ) {
     72              $field_value = '';
    7073
    71                 $field_value = '';
     74              if ( $field_check && ( $this->abstract === 'options' || $this->abstract === 'customize' ) ) {
    7275
    73                 if ( $field_check && ( $this->abstract === 'options' || $this->abstract === 'customize' ) ) {
     76                if( ! empty( $combine_field ) ) {
    7477
    75                   if( ! empty( $combine_field ) ) {
     78                  $field_value = ( isset( $this->options[$combine_field['id']][$field_id] ) ) ? $this->options[$combine_field['id']][$field_id] : '';
    7679
    77                     $field_value = ( isset( $this->options[$combine_field['id']][$field_id] ) ) ? $this->options[$combine_field['id']][$field_id] : '';
     80                } else {
    7881
    79                   } else {
    80 
    81                     $field_value = ( isset( $this->options[$field_id] ) ) ? $this->options[$field_id] : '';
    82 
    83                   }
    84 
    85                 } else if ( $field_check && ( $this->abstract === 'metabox' && is_singular() || $this->abstract === 'taxonomy' && is_archive() ) ) {
    86 
    87                   if( ! empty( $combine_field ) ) {
    88 
    89                     $meta_value  = $this->get_meta_value( $combine_field );
    90                     $field_value = ( isset( $meta_value[$field_id] ) ) ? $meta_value[$field_id] : '';
    91 
    92                   } else {
    93 
    94                     $meta_value  = $this->get_meta_value( $field );
    95                     $field_value = ( isset( $meta_value ) ) ? $meta_value : '';
    96 
    97                   }
     82                  $field_value = ( isset( $this->options[$field_id] ) ) ? $this->options[$field_id] : '';
    9883
    9984                }
    10085
    101                 $instance = new $field_class( $field, $field_value, $this->unique, 'wp/enqueue', $this );
     86              } else if ( $field_check && ( $this->abstract === 'metabox' && is_singular() || $this->abstract === 'taxonomy' && is_archive() ) ) {
    10287
    103                 // typography enqueue and embed google web fonts
    104                 if ( $field_type === 'typography' && $this->args['enqueue_webfont'] && ! empty( $field_value['font-family'] ) ) {
     88                if( ! empty( $combine_field ) ) {
    10589
    106                   $method = ( ! empty( $this->args['async_webfont'] ) ) ? 'async' : 'enqueue';
     90                  $meta_value  = $this->get_meta_value( $combine_field );
     91                  $field_value = ( isset( $meta_value[$field_id] ) ) ? $meta_value[$field_id] : '';
    10792
    108                   $instance->enqueue_google_fonts( $method );
     93                } else {
     94
     95                  $meta_value  = $this->get_meta_value( $field );
     96                  $field_value = ( isset( $meta_value ) ) ? $meta_value : '';
    10997
    11098                }
    11199
    112                 // output css
    113                 if ( $field_output && $this->args['output_css'] ) {
    114                   CSF::$css .= $instance->output();
    115                 }
     100              }
    116101
    117                 unset( $instance );
     102              $instance = new $field_class( $field, $field_value, $this->unique, 'wp/enqueue', $this );
     103
     104              // typography enqueue and embed google web fonts
     105              if ( $field_type === 'typography' && $this->args['enqueue_webfont'] && ! empty( $field_value['font-family'] ) ) {
     106
     107                $method = ( ! empty( $this->args['async_webfont'] ) ) ? 'async' : 'enqueue';
     108
     109                $instance->enqueue_google_fonts( $method );
    118110
    119111              }
     112
     113              // output css
     114              if ( $field_output && $this->args['output_css'] ) {
     115                CSF::$css .= $instance->output();
     116              }
     117
     118              unset( $instance );
    120119
    121120            }
     
    129128    }
    130129
    131     public function pre_tabs( $sections ) {
     130  }
    132131
    133       $count   = 100;
    134       $result  = array();
    135       $parents = array();
     132  public function pre_tabs( $sections ) {
    136133
    137       foreach ( $sections as $key => $section ) {
    138         if ( ! empty( $section['parent'] ) ) {
    139           $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
    140           $parents[$section['parent']][] = $section;
    141           unset( $sections[$key] );
    142         }
    143         $count++;
     134    $count   = 100;
     135    $result  = array();
     136    $parents = array();
     137
     138    foreach ( $sections as $key => $section ) {
     139      if ( ! empty( $section['parent'] ) ) {
     140        $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
     141        $parents[$section['parent']][] = $section;
     142        unset( $sections[$key] );
    144143      }
    145 
    146       foreach ( $sections as $key => $section ) {
    147         $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
    148         if ( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
    149           $section['subs'] = wp_list_sort( $parents[$section['id']], array( 'priority' => 'ASC' ), 'ASC', true );
    150         }
    151         $result[] = $section;
    152         $count++;
    153       }
    154 
    155       return wp_list_sort( $result, array( 'priority' => 'ASC' ), 'ASC', true );
    156 
     144      $count++;
    157145    }
    158146
    159     public function pre_sections( $sections ) {
     147    foreach ( $sections as $key => $section ) {
     148      $section['priority'] = ( isset( $section['priority'] ) ) ? $section['priority'] : $count;
     149      if ( ! empty( $section['id'] ) && ! empty( $parents[$section['id']] ) ) {
     150        $section['subs'] = wp_list_sort( $parents[$section['id']], array( 'priority' => 'ASC' ), 'ASC', true );
     151      }
     152      $result[] = $section;
     153      $count++;
     154    }
    160155
    161       $result = array();
     156    return wp_list_sort( $result, array( 'priority' => 'ASC' ), 'ASC', true );
    162157
    163       foreach ( $this->pre_tabs( $sections ) as $section ) {
    164         if ( ! empty( $section['subs'] ) ) {
    165           foreach ( $section['subs'] as $sub ) {
    166             $sub['ptitle'] = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
    167             $result[] = $sub;
    168           }
    169         }
    170         if ( empty( $section['subs'] ) ) {
    171           $result[] = $section;
     158  }
     159
     160  public function pre_sections( $sections ) {
     161
     162    $result = array();
     163
     164    foreach ( $this->pre_tabs( $sections ) as $section ) {
     165      if ( ! empty( $section['subs'] ) ) {
     166        foreach ( $section['subs'] as $sub ) {
     167          $sub['ptitle'] = ( ! empty( $section['title'] ) ) ? $section['title'] : '';
     168          $result[] = $sub;
    172169        }
    173170      }
    174 
    175       return $result;
     171      if ( empty( $section['subs'] ) ) {
     172        $result[] = $section;
     173      }
    176174    }
    177175
    178     public function pre_fields( $sections ) {
     176    return $result;
     177  }
    179178
    180       $result = array();
     179  public function pre_fields( $sections ) {
    181180
    182       foreach ( $sections as $key => $section ) {
    183         if ( ! empty( $section['fields'] ) ) {
    184           foreach ( $section['fields'] as $field ) {
    185             $result[] = $field;
    186           }
     181    $result = array();
     182
     183    foreach ( $sections as $key => $section ) {
     184      if ( ! empty( $section['fields'] ) ) {
     185        foreach ( $section['fields'] as $field ) {
     186          $result[] = $field;
    187187        }
    188188      }
    189 
    190       return $result;
    191189    }
    192190
     191    return $result;
    193192  }
     193
    194194}
     195}
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/classes/setup.class.php

    r3115164 r3207680  
    1313    // Default constants
    1414    public static $premium  = true;
    15     public static $version  = '2.3.0';
     15    public static $version  = '2.3.1';
    1616    public static $dir      = '';
    1717    public static $url      = '';
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/codestar-framework.php

    r3098987 r3207680  
    1212 * Author: Codestar
    1313 * Author URI: http://codestarthemes.com/
    14  * Version: 2.3.0
     14 * Version: 2.3.1
    1515 * Description: A Simple and Lightweight WordPress Option Framework for Themes and Plugins
    1616 * Text Domain: csf
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/fields/map/map.php

    r2986425 r3207680  
    1111  class CSF_Field_map extends CSF_Fields {
    1212
    13     public $version = '1.9.2';
     13    public $version = '1.9.4';
    1414    public $cdn_url = 'https://cdn.jsdelivr.net/npm/leaflet@';
    1515
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/fields/typography/google-fonts.php

    r2986425 r3207680  
    55    return [
    66      'ABeeZee'=>[['normal','italic'],['latin','latin-ext']],
     7      'ADLaM Display'=>[['normal'],['adlam','latin','latin-ext']],
     8      'AR One Sans'=>[['normal','500','600','700'],['latin','latin-ext','vietnamese']],
    79      'Abel'=>[['normal'],['latin']],
    810      'Abhaya Libre'=>[['normal','500','600','700','800'],['latin','latin-ext','sinhala']],
     
    1416      'Actor'=>[['normal'],['latin']],
    1517      'Adamina'=>[['normal'],['latin']],
    16       'Advent Pro'=>[['100','200','300','normal','500','600','700'],['greek','latin','latin-ext']],
     18      'Advent Pro'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext']],
     19      'Afacad'=>[['normal','500','600','700','italic','500italic','600italic','700italic'],['cyrillic-ext','latin','latin-ext','math','symbols','vietnamese']],
     20      'Agbalumo'=>[['normal'],['cyrillic-ext','latin','latin-ext','vietnamese']],
     21      'Agdasima'=>[['normal','700'],['latin','latin-ext']],
    1722      'Aguafina Script'=>[['normal'],['latin','latin-ext']],
     23      'Akatab'=>[['normal','500','600','700','800','900'],['latin','latin-ext','tifinagh']],
    1824      'Akaya Kanadaka'=>[['normal'],['kannada','latin','latin-ext']],
    1925      'Akaya Telivigala'=>[['normal'],['latin','latin-ext','telugu']],
     
    3036      'Alegreya Sans'=>[['100','100italic','300','300italic','normal','italic','500','500italic','700','700italic','800','800italic','900','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    3137      'Alegreya Sans SC'=>[['100','100italic','300','300italic','normal','italic','500','500italic','700','700italic','800','800italic','900','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    32       'Aleo'=>[['300','300italic','normal','italic','700','700italic'],['latin','latin-ext']],
     38      'Aleo'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    3339      'Alex Brush'=>[['normal'],['latin','latin-ext','vietnamese']],
    3440      'Alexandria'=>[['100','200','300','normal','500','600','700','800','900'],['arabic','latin','latin-ext','vietnamese']],
    3541      'Alfa Slab One'=>[['normal'],['latin','latin-ext','vietnamese']],
    3642      'Alice'=>[['normal'],['cyrillic','cyrillic-ext','latin','latin-ext']],
    37       'Alike'=>[['normal'],['latin']],
    38       'Alike Angular'=>[['normal'],['latin']],
     43      'Alike'=>[['normal'],['latin','latin-ext','math','symbols']],
     44      'Alike Angular'=>[['normal'],['latin','latin-ext','math','symbols']],
    3945      'Alkalami'=>[['normal'],['arabic','latin','latin-ext']],
     46      'Alkatra'=>[['normal','500','600','700'],['bengali','devanagari','latin','latin-ext','oriya']],
    4047      'Allan'=>[['normal','700'],['latin','latin-ext']],
    4148      'Allerta'=>[['normal'],['latin']],
     
    8087      'Anton'=>[['normal'],['latin','latin-ext','vietnamese']],
    8188      'Antonio'=>[['100','200','300','normal','500','600','700'],['latin','latin-ext']],
     89      'Anuphan'=>[['100','200','300','normal','500','600','700'],['cyrillic-ext','latin','latin-ext','thai','vietnamese']],
    8290      'Anybody'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
     91      'Aoboshi One'=>[['normal'],['japanese','latin','latin-ext']],
    8392      'Arapey'=>[['normal','italic'],['latin']],
    8493      'Arbutus'=>[['normal'],['latin','latin-ext']],
     
    92101      'Aref Ruqaa Ink'=>[['normal','700'],['arabic','latin','latin-ext']],
    93102      'Arima'=>[['100','200','300','normal','500','600','700'],['greek','greek-ext','latin','latin-ext','malayalam','tamil','vietnamese']],
    94       'Arima Madurai'=>[['100','200','300','normal','500','700','800','900'],['latin','latin-ext','tamil','vietnamese']],
    95103      'Arimo'=>[['normal','500','600','700','italic','500italic','600italic','700italic'],['cyrillic','cyrillic-ext','greek','greek-ext','hebrew','latin','latin-ext','vietnamese']],
    96104      'Arizonia'=>[['normal'],['latin','latin-ext','vietnamese']],
     
    124132      'B612 Mono'=>[['normal','italic','700','700italic'],['latin']],
    125133      'BIZ UDGothic'=>[['normal','700'],['cyrillic','greek-ext','japanese','latin','latin-ext']],
    126       'BIZ UDMincho'=>[['normal'],['cyrillic','greek-ext','japanese','latin','latin-ext']],
     134      'BIZ UDMincho'=>[['normal','700'],['cyrillic','greek-ext','japanese','latin','latin-ext']],
    127135      'BIZ UDPGothic'=>[['normal','700'],['cyrillic','greek-ext','japanese','latin','latin-ext']],
    128       'BIZ UDPMincho'=>[['normal'],['cyrillic','greek-ext','japanese','latin','latin-ext']],
     136      'BIZ UDPMincho'=>[['normal','700'],['cyrillic','greek-ext','japanese','latin','latin-ext']],
    129137      'Babylonica'=>[['normal'],['latin','latin-ext','vietnamese']],
     138      'Bacasime Antique'=>[['normal'],['latin','latin-ext']],
    130139      'Bad Script'=>[['normal'],['cyrillic','latin']],
     140      'Bagel Fat One'=>[['normal'],['korean','latin','latin-ext']],
    131141      'Bahiana'=>[['normal'],['latin','latin-ext']],
    132142      'Bahianita'=>[['normal'],['latin','latin-ext','vietnamese']],
     
    160170      'Beau Rivage'=>[['normal'],['latin','latin-ext','vietnamese']],
    161171      'Bebas Neue'=>[['normal'],['latin','latin-ext']],
     172      'Belanosima'=>[['normal','600','700'],['latin','latin-ext']],
    162173      'Belgrano'=>[['normal'],['latin']],
    163174      'Bellefair'=>[['normal'],['hebrew','latin','latin-ext']],
     
    183194      'Bilbo'=>[['normal'],['latin','latin-ext','vietnamese']],
    184195      'Bilbo Swash Caps'=>[['normal'],['latin','latin-ext']],
    185       'BioRhyme'=>[['200','300','normal','700','800'],['latin','latin-ext']],
     196      'BioRhyme'=>[['200','300','normal','500','600','700','800'],['latin','latin-ext']],
    186197      'BioRhyme Expanded'=>[['200','300','normal','700','800'],['latin','latin-ext']],
    187198      'Birthstone'=>[['normal'],['latin','latin-ext','vietnamese']],
     
    202213      'Bonheur Royale'=>[['normal'],['latin','latin-ext','vietnamese']],
    203214      'Boogaloo'=>[['normal'],['latin']],
     215      'Borel'=>[['normal'],['latin','latin-ext','math','symbols','vietnamese']],
    204216      'Bowlby One'=>[['normal'],['latin']],
    205217      'Bowlby One SC'=>[['normal'],['latin','latin-ext']],
     218      'Braah One'=>[['normal'],['gurmukhi','latin','latin-ext','vietnamese']],
    206219      'Brawler'=>[['normal','700'],['latin']],
    207220      'Bree Serif'=>[['normal'],['latin','latin-ext']],
     221      'Bricolage Grotesque'=>[['200','300','normal','500','600','700','800'],['cyrillic-ext','latin','latin-ext','vietnamese']],
     222      'Bruno Ace'=>[['normal'],['latin','latin-ext']],
     223      'Bruno Ace SC'=>[['normal'],['latin','latin-ext']],
    208224      'Brygada 1918'=>[['normal','500','600','700','italic','500italic','600italic','700italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    209225      'Bubblegum Sans'=>[['normal'],['latin','latin-ext']],
     
    230246      'Calligraffitti'=>[['normal'],['latin']],
    231247      'Cambay'=>[['normal','italic','700','700italic'],['devanagari','latin','latin-ext']],
    232       'Cambo'=>[['normal'],['latin']],
     248      'Cambo'=>[['normal'],['latin','latin-ext']],
    233249      'Candal'=>[['normal'],['latin']],
    234250      'Cantarell'=>[['normal','italic','700','700italic'],['latin','latin-ext']],
    235251      'Cantata One'=>[['normal'],['latin','latin-ext']],
    236252      'Cantora One'=>[['normal'],['latin','latin-ext']],
     253      'Caprasimo'=>[['normal'],['latin','latin-ext']],
    237254      'Capriola'=>[['normal'],['latin','latin-ext']],
    238255      'Caramel'=>[['normal'],['latin','latin-ext','vietnamese']],
    239256      'Carattere'=>[['normal'],['latin','latin-ext','vietnamese']],
    240257      'Cardo'=>[['normal','italic','700'],['greek','greek-ext','latin','latin-ext']],
     258      'Carlito'=>[['normal','italic','700','700italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    241259      'Carme'=>[['normal'],['latin']],
    242260      'Carrois Gothic'=>[['normal'],['latin']],
     
    244262      'Carter One'=>[['normal'],['latin']],
    245263      'Castoro'=>[['normal','italic'],['latin','latin-ext']],
     264      'Castoro Titling'=>[['normal'],['latin','latin-ext']],
    246265      'Catamaran'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','tamil']],
    247266      'Caudex'=>[['normal','italic','700','700italic'],['greek','greek-ext','latin','latin-ext']],
     
    263282      'Chenla'=>[['normal'],['khmer']],
    264283      'Cherish'=>[['normal'],['latin','latin-ext','vietnamese']],
     284      'Cherry Bomb One'=>[['normal'],['japanese','latin','latin-ext','vietnamese']],
    265285      'Cherry Cream Soda'=>[['normal'],['latin']],
    266286      'Cherry Swash'=>[['normal','700'],['latin','latin-ext']],
    267287      'Chewy'=>[['normal'],['latin']],
    268288      'Chicle'=>[['normal'],['latin','latin-ext']],
    269       'Chilanka'=>[['normal'],['latin','malayalam']],
     289      'Chilanka'=>[['normal'],['latin','latin-ext','malayalam']],
    270290      'Chivo'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
     291      'Chivo Mono'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
     292      'Chokokutai'=>[['normal'],['japanese','latin','latin-ext','vietnamese']],
    271293      'Chonburi'=>[['normal'],['latin','latin-ext','thai','vietnamese']],
    272294      'Cinzel'=>[['normal','500','600','700','800','900'],['latin','latin-ext']],
    273295      'Cinzel Decorative'=>[['normal','700','900'],['latin']],
    274296      'Clicker Script'=>[['normal'],['latin','latin-ext']],
     297      'Climate Crisis'=>[['normal'],['latin','latin-ext']],
    275298      'Coda'=>[['normal','800'],['latin','latin-ext']],
    276       'Coda Caption'=>[['800'],['latin','latin-ext']],
    277299      'Codystar'=>[['300','normal'],['latin','latin-ext']],
    278300      'Coiny'=>[['normal'],['latin','latin-ext','tamil','vietnamese']],
     
    283305      'Comic Neue'=>[['300','300italic','normal','italic','700','700italic'],['latin']],
    284306      'Coming Soon'=>[['normal'],['latin']],
     307      'Comme'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext']],
    285308      'Commissioner'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    286309      'Concert One'=>[['normal'],['latin','latin-ext']],
     
    316339      'Cutive Mono'=>[['normal'],['latin','latin-ext']],
    317340      'DM Mono'=>[['300','300italic','normal','italic','500','500italic'],['latin','latin-ext']],
    318       'DM Sans'=>[['normal','italic','500','500italic','700','700italic'],['latin','latin-ext']],
     341      'DM Sans'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext']],
    319342      'DM Serif Display'=>[['normal','italic'],['latin','latin-ext']],
    320343      'DM Serif Text'=>[['normal','italic'],['latin','latin-ext']],
     344      'Dai Banna SIL'=>[['300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin','latin-ext','new-tai-lue']],
    321345      'Damion'=>[['normal'],['latin']],
    322346      'Dancing Script'=>[['normal','500','600','700'],['latin','latin-ext','vietnamese']],
    323347      'Dangrek'=>[['normal'],['khmer','latin']],
    324348      'Darker Grotesque'=>[['300','normal','500','600','700','800','900'],['latin','latin-ext','vietnamese']],
     349      'Darumadrop One'=>[['normal'],['japanese','latin','latin-ext']],
    325350      'David Libre'=>[['normal','500','700'],['hebrew','latin','latin-ext','vietnamese']],
    326351      'Dawning of a New Day'=>[['normal'],['latin']],
     
    328353      'Dekko'=>[['normal'],['devanagari','latin','latin-ext']],
    329354      'Dela Gothic One'=>[['normal'],['cyrillic','greek','japanese','latin','latin-ext','vietnamese']],
     355      'Delicious Handrawn'=>[['normal'],['latin','latin-ext']],
    330356      'Delius'=>[['normal'],['latin']],
    331357      'Delius Swash Caps'=>[['normal'],['latin']],
    332358      'Delius Unicase'=>[['normal','700'],['latin']],
    333359      'Della Respira'=>[['normal'],['latin']],
    334       'Denk One'=>[['normal'],['latin','latin-ext']],
     360      'Denk One'=>[['normal'],['cyrillic-ext','latin','latin-ext','vietnamese']],
    335361      'Devonshire'=>[['normal'],['latin','latin-ext']],
    336362      'Dhurjati'=>[['normal'],['latin','telugu']],
    337363      'Didact Gothic'=>[['normal'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext']],
     364      'Diphylleia'=>[['normal'],['korean','latin','latin-ext']],
    338365      'Diplomata'=>[['normal'],['latin','latin-ext']],
    339366      'Diplomata SC'=>[['normal'],['latin','latin-ext']],
     
    395422      'Fascinate'=>[['normal'],['latin']],
    396423      'Fascinate Inline'=>[['normal'],['latin']],
    397       'Faster One'=>[['normal'],['latin']],
     424      'Faster One'=>[['normal'],['latin','latin-ext']],
    398425      'Fasthand'=>[['normal'],['khmer','latin']],
    399426      'Fauna One'=>[['normal'],['latin','latin-ext']],
     
    412439      'Fira Sans Condensed'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    413440      'Fira Sans Extra Condensed'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    414       'Fjalla One'=>[['normal'],['latin','latin-ext']],
     441      'Fjalla One'=>[['normal'],['cyrillic-ext','latin','latin-ext','vietnamese']],
    415442      'Fjord One'=>[['normal'],['latin']],
    416443      'Flamenco'=>[['300','normal'],['latin']],
     
    420447      'Flow Circular'=>[['normal'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    421448      'Flow Rounded'=>[['normal'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
     449      'Foldit'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','vietnamese']],
    422450      'Fondamento'=>[['normal','italic'],['latin','latin-ext']],
    423451      'Fontdiner Swanky'=>[['normal'],['latin']],
     
    425453      'Fragment Mono'=>[['normal','italic'],['cyrillic-ext','latin','latin-ext']],
    426454      'Francois One'=>[['normal'],['latin','latin-ext','vietnamese']],
    427       'Frank Ruhl Libre'=>[['300','normal','500','700','900'],['hebrew','latin','latin-ext']],
     455      'Frank Ruhl Libre'=>[['300','normal','500','600','700','800','900'],['hebrew','latin','latin-ext']],
    428456      'Fraunces'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    429457      'Freckle Face'=>[['normal'],['latin','latin-ext']],
    430458      'Fredericka the Great'=>[['normal'],['latin','latin-ext']],
    431459      'Fredoka'=>[['300','normal','500','600','700'],['hebrew','latin','latin-ext']],
    432       'Fredoka One'=>[['normal'],['latin']],
    433460      'Freehand'=>[['normal'],['khmer','latin']],
    434461      'Fresca'=>[['normal'],['latin','latin-ext']],
     
    440467      'GFS Didot'=>[['normal'],['greek']],
    441468      'GFS Neohellenic'=>[['normal','italic','700','700italic'],['greek']],
    442       'Gabriela'=>[['normal'],['cyrillic','cyrillic-ext','latin']],
     469      'Gabarito'=>[['normal','500','600','700','800','900'],['latin','latin-ext']],
     470      'Gabriela'=>[['normal'],['cyrillic','cyrillic-ext','latin','latin-ext']],
    443471      'Gaegu'=>[['300','normal','700'],['korean','latin']],
    444472      'Gafata'=>[['normal'],['latin','latin-ext']],
     473      'Gajraj One'=>[['normal'],['devanagari','latin','latin-ext']],
    445474      'Galada'=>[['normal'],['bengali','latin']],
    446475      'Galdeano'=>[['normal'],['latin']],
     
    448477      'Gamja Flower'=>[['normal'],['korean','latin']],
    449478      'Gantari'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext']],
     479      'Gasoek One'=>[['normal'],['korean','latin','latin-ext']],
    450480      'Gayathri'=>[['100','normal','700'],['latin','malayalam']],
    451481      'Gelasio'=>[['normal','italic','500','500italic','600','600italic','700','700italic'],['latin','latin-ext','vietnamese']],
    452482      'Gemunu Libre'=>[['200','300','normal','500','600','700','800'],['latin','latin-ext','sinhala']],
    453483      'Genos'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cherokee','latin','latin-ext','vietnamese']],
    454       'Gentium Book Basic'=>[['normal','italic','700','700italic'],['latin','latin-ext']],
    455484      'Gentium Book Plus'=>[['normal','italic','700','700italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    456485      'Gentium Plus'=>[['normal','italic','700','700italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    457486      'Geo'=>[['normal','italic'],['latin']],
     487      'Geologica'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    458488      'Georama'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    459489      'Geostar'=>[['normal'],['latin']],
     
    467497      'Glass Antiqua'=>[['normal'],['latin','latin-ext']],
    468498      'Glegoo'=>[['normal','700'],['devanagari','latin','latin-ext']],
     499      'Gloock'=>[['normal'],['cyrillic-ext','latin','latin-ext']],
    469500      'Gloria Hallelujah'=>[['normal'],['latin']],
    470501      'Glory'=>[['100','200','300','normal','500','600','700','800','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic'],['latin','latin-ext','vietnamese']],
     
    473504      'Gochi Hand'=>[['normal'],['latin']],
    474505      'Goldman'=>[['normal','700'],['latin','latin-ext','vietnamese']],
     506      'Golos Text'=>[['normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','latin','latin-ext']],
    475507      'Gorditas'=>[['normal','700'],['latin']],
    476508      'Gothic A1'=>[['100','200','300','normal','500','600','700','800','900'],['korean','latin']],
     
    481513      'Graduate'=>[['normal'],['latin']],
    482514      'Grand Hotel'=>[['normal'],['latin','latin-ext']],
     515      'Grandiflora One'=>[['normal'],['korean','latin','latin-ext']],
    483516      'Grandstander'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    484517      'Grape Nuts'=>[['normal'],['latin','latin-ext','vietnamese']],
     
    504537      'Hanalei'=>[['normal'],['latin','latin-ext']],
    505538      'Hanalei Fill'=>[['normal'],['latin','latin-ext']],
     539      'Handjet'=>[['100','200','300','normal','500','600','700','800','900'],['arabic','armenian','cyrillic','cyrillic-ext','greek','hebrew','latin','latin-ext','vietnamese']],
    506540      'Handlee'=>[['normal'],['latin']],
     541      'Hanken Grotesk'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic-ext','latin','latin-ext','vietnamese']],
    507542      'Hanuman'=>[['100','300','normal','700','900'],['khmer','latin']],
    508543      'Happy Monkey'=>[['normal'],['latin','latin-ext']],
    509       'Harmattan'=>[['normal','700'],['arabic','latin','latin-ext']],
     544      'Harmattan'=>[['normal','500','600','700'],['arabic','latin','latin-ext']],
    510545      'Headland One'=>[['normal'],['latin','latin-ext']],
     546      'Hedvig Letters Sans'=>[['normal'],['latin','latin-ext','math','symbols']],
     547      'Hedvig Letters Serif'=>[['normal'],['latin','latin-ext','math','symbols']],
    511548      'Heebo'=>[['100','200','300','normal','500','600','700','800','900'],['hebrew','latin']],
    512549      'Henny Penny'=>[['normal'],['latin']],
     
    523560      'Homemade Apple'=>[['normal'],['latin']],
    524561      'Homenaje'=>[['normal'],['latin']],
     562      'Honk'=>[['normal'],['latin','latin-ext','math','symbols','vietnamese']],
    525563      'Hubballi'=>[['normal'],['kannada','latin','latin-ext']],
    526564      'Hurricane'=>[['normal'],['latin','latin-ext','vietnamese']],
     
    552590      'Imperial Script'=>[['normal'],['latin','latin-ext','vietnamese']],
    553591      'Imprima'=>[['normal'],['latin','latin-ext']],
     592      'Inclusive Sans'=>[['normal','italic'],['latin','latin-ext','vietnamese']],
    554593      'Inconsolata'=>[['200','300','normal','500','600','700','800','900'],['latin','latin-ext','vietnamese']],
    555594      'Inder'=>[['normal'],['latin','latin-ext']],
     
    561600      'Inria Serif'=>[['300','300italic','normal','italic','700','700italic'],['latin','latin-ext']],
    562601      'Inspiration'=>[['normal'],['latin','latin-ext','vietnamese']],
     602      'Instrument Sans'=>[['normal','500','600','700','italic','500italic','600italic','700italic'],['latin','latin-ext']],
     603      'Instrument Serif'=>[['normal','italic'],['latin','latin-ext']],
    563604      'Inter'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    564605      'Inter Tight'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
     
    585626      'Jua'=>[['normal'],['korean','latin']],
    586627      'Judson'=>[['normal','italic','700'],['latin','latin-ext','vietnamese']],
    587       'Julee'=>[['normal'],['latin']],
     628      'Julee'=>[['normal'],['latin','latin-ext']],
    588629      'Julius Sans One'=>[['normal'],['latin','latin-ext']],
    589630      'Junge'=>[['normal'],['latin']],
     
    592633      'Just Me Again Down Here'=>[['normal'],['latin','latin-ext']],
    593634      'K2D'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic'],['latin','latin-ext','thai','vietnamese']],
     635      'Kablammo'=>[['normal'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    594636      'Kadwa'=>[['normal','700'],['devanagari','latin']],
    595637      'Kaisei Decol'=>[['normal','500','700'],['cyrillic','japanese','latin','latin-ext']],
     
    598640      'Kaisei Tokumin'=>[['normal','500','700','800'],['cyrillic','japanese','latin','latin-ext']],
    599641      'Kalam'=>[['300','normal','700'],['devanagari','latin','latin-ext']],
    600       'Kameron'=>[['normal','700'],['latin']],
     642      'Kalnia'=>[['100','200','300','normal','500','600','700'],['latin','latin-ext','math']],
     643      'Kameron'=>[['normal','500','600','700'],['latin','latin-ext']],
    601644      'Kanit'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin','latin-ext','thai','vietnamese']],
    602       'Kantumruy'=>[['300','normal','700'],['khmer']],
    603645      'Kantumruy Pro'=>[['100','200','300','normal','500','600','700','100italic','200italic','300italic','italic','500italic','600italic','700italic'],['khmer','latin','latin-ext']],
    604646      'Karantina'=>[['300','normal','700'],['hebrew','latin','latin-ext']],
     
    609651      'Kavivanar'=>[['normal'],['latin','latin-ext','tamil']],
    610652      'Kavoon'=>[['normal'],['latin','latin-ext']],
     653      'Kay Pho Du'=>[['normal','500','600','700'],['kayah-li','latin','latin-ext']],
    611654      'Kdam Thmor Pro'=>[['normal'],['khmer','latin','latin-ext']],
    612655      'Keania One'=>[['normal'],['latin','latin-ext']],
     
    618661      'Kings'=>[['normal'],['latin','latin-ext','vietnamese']],
    619662      'Kirang Haerang'=>[['normal'],['korean','latin']],
    620       'Kite One'=>[['normal'],['latin']],
     663      'Kite One'=>[['normal'],['latin','latin-ext']],
    621664      'Kiwi Maru'=>[['300','normal','500'],['cyrillic','japanese','latin','latin-ext']],
    622665      'Klee One'=>[['normal','600'],['cyrillic','greek-ext','japanese','latin','latin-ext']],
     
    626669      'Koh Santepheap'=>[['100','300','normal','700','900'],['khmer','latin']],
    627670      'Kolker Brush'=>[['normal'],['latin','latin-ext','vietnamese']],
     671      'Konkhmer Sleokchher'=>[['normal'],['khmer','latin','latin-ext']],
    628672      'Kosugi'=>[['normal'],['cyrillic','japanese','latin','latin-ext']],
    629673      'Kosugi Maru'=>[['normal'],['cyrillic','japanese','latin','latin-ext']],
     
    639683      'Kumar One'=>[['normal'],['gujarati','latin','latin-ext']],
    640684      'Kumar One Outline'=>[['normal'],['gujarati','latin','latin-ext']],
    641       'Kumbh Sans'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext']],
     685      'Kumbh Sans'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','math','symbols']],
    642686      'Kurale'=>[['normal'],['cyrillic','cyrillic-ext','devanagari','latin','latin-ext']],
    643687      'La Belle Aurore'=>[['normal'],['latin']],
     688      'Labrada'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    644689      'Lacquer'=>[['normal'],['latin']],
    645690      'Laila'=>[['300','normal','500','600','700'],['devanagari','latin','latin-ext']],
     
    657702      'Ledger'=>[['normal'],['cyrillic','latin','latin-ext']],
    658703      'Lekton'=>[['normal','italic','700'],['latin','latin-ext']],
    659       'Lemon'=>[['normal'],['latin']],
     704      'Lemon'=>[['normal'],['latin','latin-ext']],
    660705      'Lemonada'=>[['300','normal','500','600','700'],['arabic','latin','latin-ext','vietnamese']],
    661706      'Lexend'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','vietnamese']],
     
    685730      'Limelight'=>[['normal'],['latin','latin-ext']],
    686731      'Linden Hill'=>[['normal','italic'],['latin']],
     732      'Linefont'=>[['100','200','300','normal','500','600','700','800','900'],['latin']],
     733      'Lisu Bosa'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin','latin-ext','lisu']],
    687734      'Literata'=>[['200','300','normal','500','600','700','800','900','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    688735      'Liu Jian Mao Cao'=>[['normal'],['chinese-simplified','latin']],
     
    701748      'Lovers Quarrel'=>[['normal'],['latin','latin-ext','vietnamese']],
    702749      'Luckiest Guy'=>[['normal'],['latin']],
     750      'Lugrasimo'=>[['normal'],['latin','latin-ext']],
     751      'Lumanosimo'=>[['normal'],['latin','latin-ext']],
     752      'Lunasima'=>[['normal','700'],['cyrillic','cyrillic-ext','greek','greek-ext','hebrew','latin','latin-ext','vietnamese']],
    703753      'Lusitana'=>[['normal','700'],['latin']],
    704754      'Lustria'=>[['normal'],['latin']],
     
    714764      'Macondo'=>[['normal'],['latin']],
    715765      'Macondo Swash Caps'=>[['normal'],['latin']],
    716       'Mada'=>[['200','300','normal','500','600','700','900'],['arabic','latin']],
     766      'Mada'=>[['200','300','normal','500','600','700','800','900'],['arabic','latin','latin-ext']],
    717767      'Magra'=>[['normal','700'],['latin','latin-ext']],
    718768      'Maiden Orange'=>[['normal'],['latin']],
    719769      'Maitree'=>[['200','300','normal','500','600','700'],['latin','latin-ext','thai','vietnamese']],
    720770      'Major Mono Display'=>[['normal'],['latin','latin-ext','vietnamese']],
    721       'Mako'=>[['normal'],['latin']],
     771      'Mako'=>[['normal'],['latin','latin-ext']],
    722772      'Mali'=>[['200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic'],['latin','latin-ext','thai','vietnamese']],
    723773      'Mallanna'=>[['normal'],['latin','telugu']],
     
    734784      'Markazi Text'=>[['normal','500','600','700'],['arabic','latin','latin-ext','vietnamese']],
    735785      'Marko One'=>[['normal'],['latin']],
    736       'Marmelad'=>[['normal'],['cyrillic','latin','latin-ext']],
     786      'Marmelad'=>[['normal'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    737787      'Martel'=>[['200','300','normal','600','700','800','900'],['devanagari','latin','latin-ext']],
    738788      'Martel Sans'=>[['200','300','normal','600','700','800','900'],['devanagari','latin','latin-ext']],
     789      'Martian Mono'=>[['100','200','300','normal','500','600','700','800'],['cyrillic','cyrillic-ext','latin','latin-ext']],
    739790      'Marvel'=>[['normal','italic','700','700italic'],['latin']],
    740       'Mate'=>[['normal','italic'],['latin']],
    741       'Mate SC'=>[['normal'],['latin']],
     791      'Mate'=>[['normal','italic'],['latin','latin-ext']],
     792      'Mate SC'=>[['normal'],['latin','latin-ext']],
     793      'Material Icons'=>[['normal'],['latin']],
     794      'Material Icons Outlined'=>[['normal'],['latin']],
     795      'Material Icons Round'=>[['normal'],['latin']],
     796      'Material Icons Sharp'=>[['normal'],['latin']],
     797      'Material Icons Two Tone'=>[['normal'],['latin']],
     798      'Material Symbols Outlined'=>[['100','200','300','normal','500','600','700'],['latin']],
     799      'Material Symbols Rounded'=>[['100','200','300','normal','500','600','700'],['latin']],
     800      'Material Symbols Sharp'=>[['100','200','300','normal','500','600','700'],['latin']],
    742801      'Maven Pro'=>[['normal','500','600','700','800','900'],['latin','latin-ext','vietnamese']],
    743802      'McLaren'=>[['normal'],['latin','latin-ext']],
     
    751810      'Meow Script'=>[['normal'],['latin','latin-ext','vietnamese']],
    752811      'Merienda'=>[['300','normal','500','600','700','800','900'],['latin','latin-ext','vietnamese']],
    753       'Merienda One'=>[['normal'],['latin']],
    754812      'Merriweather'=>[['300','300italic','normal','italic','700','700italic','900','900italic'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    755813      'Merriweather Sans'=>[['300','normal','500','600','700','800','300italic','italic','500italic','600italic','700italic','800italic'],['cyrillic-ext','latin','latin-ext','vietnamese']],
     
    758816      'Metamorphous'=>[['normal'],['latin','latin-ext']],
    759817      'Metrophobic'=>[['normal'],['latin','latin-ext','vietnamese']],
    760       'Michroma'=>[['normal'],['latin']],
     818      'Michroma'=>[['normal'],['latin','latin-ext']],
    761819      'Milonga'=>[['normal'],['latin','latin-ext']],
    762820      'Miltonian'=>[['normal'],['latin']],
     
    775833      'Mogra'=>[['normal'],['gujarati','latin','latin-ext']],
    776834      'Mohave'=>[['300','normal','500','600','700','300italic','italic','500italic','600italic','700italic'],['latin','latin-ext']],
     835      'Moirai One'=>[['normal'],['korean','latin','latin-ext']],
    777836      'Molengo'=>[['normal'],['latin','latin-ext']],
    778837      'Molle'=>[['italic'],['latin','latin-ext']],
    779838      'Monda'=>[['normal','700'],['latin','latin-ext','vietnamese']],
    780       'Monofett'=>[['normal'],['latin']],
     839      'Monofett'=>[['normal'],['latin','latin-ext']],
     840      'Monomaniac One'=>[['normal'],['japanese','latin','latin-ext']],
    781841      'Monoton'=>[['normal'],['latin']],
    782842      'Monsieur La Doulaise'=>[['normal'],['latin','latin-ext']],
     
    789849      'Montserrat Subrayada'=>[['normal','700'],['latin']],
    790850      'Moo Lah Lah'=>[['normal'],['latin','latin-ext','vietnamese']],
     851      'Mooli'=>[['normal'],['latin','latin-ext']],
    791852      'Moon Dance'=>[['normal'],['latin','latin-ext','vietnamese']],
    792853      'Moul'=>[['normal'],['khmer','latin']],
     
    808869      'MuseoModerno'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    809870      'My Soul'=>[['normal'],['latin','latin-ext','vietnamese']],
     871      'Mynerve'=>[['normal'],['greek','latin','latin-ext','vietnamese']],
    810872      'Mystery Quest'=>[['normal'],['latin','latin-ext']],
    811873      'NTR'=>[['normal'],['latin','telugu']],
     
    816878      'Nanum Myeongjo'=>[['normal','700','800'],['korean','latin']],
    817879      'Nanum Pen Script'=>[['normal'],['korean','latin']],
     880      'Narnoor'=>[['normal','500','600','700','800'],['gunjala-gondi','latin','latin-ext','math','symbols']],
    818881      'Neonderthaw'=>[['normal'],['latin','latin-ext','vietnamese']],
    819882      'Nerko One'=>[['normal'],['latin','latin-ext']],
     
    838901      'Noto Kufi Arabic'=>[['100','200','300','normal','500','600','700','800','900'],['arabic']],
    839902      'Noto Music'=>[['normal'],['latin','latin-ext','music']],
    840       'Noto Naskh Arabic'=>[['normal','500','600','700'],['arabic']],
     903      'Noto Naskh Arabic'=>[['normal','500','600','700'],['arabic','latin','latin-ext']],
    841904      'Noto Nastaliq Urdu'=>[['normal','500','600','700'],['arabic','latin','latin-ext']],
    842905      'Noto Rashi Hebrew'=>[['100','200','300','normal','500','600','700','800','900'],['hebrew','latin','latin-ext']],
    843       'Noto Sans'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic','cyrillic-ext','devanagari','greek','greek-ext','latin','latin-ext','vietnamese']],
     906      'Noto Sans'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','devanagari','greek','greek-ext','latin','latin-ext','vietnamese']],
    844907      'Noto Sans Adlam'=>[['normal','500','600','700'],['adlam','latin','latin-ext']],
    845908      'Noto Sans Adlam Unjoined'=>[['normal','500','600','700'],['adlam','latin','latin-ext']],
    846       'Noto Sans Anatolian Hieroglyphs'=>[['normal'],['anatolian-hieroglyphs']],
     909      'Noto Sans Anatolian Hieroglyphs'=>[['normal'],['anatolian-hieroglyphs','latin','latin-ext']],
    847910      'Noto Sans Arabic'=>[['100','200','300','normal','500','600','700','800','900'],['arabic']],
    848911      'Noto Sans Armenian'=>[['100','200','300','normal','500','600','700','800','900'],['armenian','latin','latin-ext']],
     
    853916      'Noto Sans Batak'=>[['normal'],['batak','latin','latin-ext']],
    854917      'Noto Sans Bengali'=>[['100','200','300','normal','500','600','700','800','900'],['bengali','latin','latin-ext']],
    855       'Noto Sans Bhaiksuki'=>[['normal'],['bhaiksuki']],
    856       'Noto Sans Brahmi'=>[['normal'],['brahmi']],
     918      'Noto Sans Bhaiksuki'=>[['normal'],['bhaiksuki','latin','latin-ext']],
     919      'Noto Sans Brahmi'=>[['normal'],['brahmi','latin','latin-ext']],
    857920      'Noto Sans Buginese'=>[['normal'],['buginese','latin','latin-ext']],
    858921      'Noto Sans Buhid'=>[['normal'],['buhid','latin','latin-ext']],
    859922      'Noto Sans Canadian Aboriginal'=>[['100','200','300','normal','500','600','700','800','900'],['canadian-aboriginal','latin','latin-ext']],
    860       'Noto Sans Carian'=>[['normal'],['carian']],
    861       'Noto Sans Caucasian Albanian'=>[['normal'],['caucasian-albanian']],
     923      'Noto Sans Carian'=>[['normal'],['carian','latin','latin-ext']],
     924      'Noto Sans Caucasian Albanian'=>[['normal'],['caucasian-albanian','latin','latin-ext']],
    862925      'Noto Sans Chakma'=>[['normal'],['chakma','latin','latin-ext']],
    863926      'Noto Sans Cham'=>[['100','200','300','normal','500','600','700','800','900'],['cham','latin','latin-ext']],
    864927      'Noto Sans Cherokee'=>[['100','200','300','normal','500','600','700','800','900'],['cherokee','latin','latin-ext']],
     928      'Noto Sans Chorasmian'=>[['normal'],['chorasmian','latin','latin-ext','math','symbols']],
    865929      'Noto Sans Coptic'=>[['normal'],['coptic','latin','latin-ext']],
    866       'Noto Sans Cuneiform'=>[['normal'],['cuneiform']],
    867       'Noto Sans Cypriot'=>[['normal'],['cypriot']],
    868       'Noto Sans Deseret'=>[['normal'],['deseret']],
     930      'Noto Sans Cuneiform'=>[['normal'],['cuneiform','latin','latin-ext']],
     931      'Noto Sans Cypriot'=>[['normal'],['cypriot','latin','latin-ext']],
     932      'Noto Sans Cypro Minoan'=>[['normal'],['cypro-minoan','latin','latin-ext']],
     933      'Noto Sans Deseret'=>[['normal'],['deseret','latin','latin-ext']],
    869934      'Noto Sans Devanagari'=>[['100','200','300','normal','500','600','700','800','900'],['devanagari','latin','latin-ext']],
    870935      'Noto Sans Display'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    871       'Noto Sans Duployan'=>[['normal'],['duployan']],
    872       'Noto Sans Egyptian Hieroglyphs'=>[['normal'],['egyptian-hieroglyphs']],
    873       'Noto Sans Elbasan'=>[['normal'],['elbasan']],
    874       'Noto Sans Elymaic'=>[['normal'],['elymaic']],
     936      'Noto Sans Duployan'=>[['normal','700'],['duployan','latin','latin-ext']],
     937      'Noto Sans Egyptian Hieroglyphs'=>[['normal'],['egyptian-hieroglyphs','latin','latin-ext']],
     938      'Noto Sans Elbasan'=>[['normal'],['elbasan','latin','latin-ext']],
     939      'Noto Sans Elymaic'=>[['normal'],['elymaic','latin','latin-ext']],
    875940      'Noto Sans Ethiopic'=>[['100','200','300','normal','500','600','700','800','900'],['ethiopic','latin','latin-ext']],
    876941      'Noto Sans Georgian'=>[['100','200','300','normal','500','600','700','800','900'],['georgian','latin','latin-ext']],
    877       'Noto Sans Glagolitic'=>[['normal'],['glagolitic']],
    878       'Noto Sans Gothic'=>[['normal'],['gothic']],
     942      'Noto Sans Glagolitic'=>[['normal'],['cyrillic-ext','glagolitic','latin','latin-ext','math','symbols']],
     943      'Noto Sans Gothic'=>[['normal'],['gothic','latin','latin-ext']],
    879944      'Noto Sans Grantha'=>[['normal'],['grantha','latin','latin-ext']],
    880       'Noto Sans Gujarati'=>[['100','200','300','normal','500','600','700','800','900'],['gujarati','latin','latin-ext']],
    881       'Noto Sans Gunjala Gondi'=>[['normal'],['gunjala-gondi']],
     945      'Noto Sans Gujarati'=>[['100','200','300','normal','500','600','700','800','900'],['gujarati','latin','latin-ext','math','symbols']],
     946      'Noto Sans Gunjala Gondi'=>[['normal','500','600','700'],['gunjala-gondi','latin','latin-ext']],
    882947      'Noto Sans Gurmukhi'=>[['100','200','300','normal','500','600','700','800','900'],['gurmukhi','latin','latin-ext']],
    883       'Noto Sans HK'=>[['100','300','normal','500','700','900'],['chinese-hongkong','latin']],
    884       'Noto Sans Hanifi Rohingya'=>[['normal','500','600','700'],['hanifi-rohingya']],
     948      'Noto Sans HK'=>[['100','200','300','normal','500','600','700','800','900'],['chinese-hongkong','cyrillic','latin','latin-ext','vietnamese']],
     949      'Noto Sans Hanifi Rohingya'=>[['normal','500','600','700'],['hanifi-rohingya','latin','latin-ext']],
    885950      'Noto Sans Hanunoo'=>[['normal'],['hanunoo','latin','latin-ext']],
    886       'Noto Sans Hatran'=>[['normal'],['hatran']],
     951      'Noto Sans Hatran'=>[['normal'],['hatran','latin','latin-ext']],
    887952      'Noto Sans Hebrew'=>[['100','200','300','normal','500','600','700','800','900'],['hebrew','latin','latin-ext']],
    888       'Noto Sans Imperial Aramaic'=>[['normal'],['imperial-aramaic']],
    889       'Noto Sans Indic Siyaq Numbers'=>[['normal'],['indic-siyaq-numbers']],
    890       'Noto Sans Inscriptional Pahlavi'=>[['normal'],['inscriptional-pahlavi']],
    891       'Noto Sans Inscriptional Parthian'=>[['normal'],['inscriptional-parthian']],
    892       'Noto Sans JP'=>[['100','300','normal','500','700','900'],['japanese','latin']],
     953      'Noto Sans Imperial Aramaic'=>[['normal'],['imperial-aramaic','latin','latin-ext']],
     954      'Noto Sans Indic Siyaq Numbers'=>[['normal'],['indic-siyaq-numbers','latin','latin-ext']],
     955      'Noto Sans Inscriptional Pahlavi'=>[['normal'],['inscriptional-pahlavi','latin','latin-ext']],
     956      'Noto Sans Inscriptional Parthian'=>[['normal'],['inscriptional-parthian','latin','latin-ext']],
     957      'Noto Sans JP'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic','japanese','latin','latin-ext','vietnamese']],
    893958      'Noto Sans Javanese'=>[['normal','500','600','700'],['javanese','latin','latin-ext']],
    894       'Noto Sans KR'=>[['100','300','normal','500','700','900'],['korean','latin']],
    895       'Noto Sans Kaithi'=>[['normal'],['kaithi']],
     959      'Noto Sans KR'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic','korean','latin','latin-ext','vietnamese']],
     960      'Noto Sans Kaithi'=>[['normal'],['kaithi','latin','latin-ext']],
    896961      'Noto Sans Kannada'=>[['100','200','300','normal','500','600','700','800','900'],['kannada','latin','latin-ext']],
     962      'Noto Sans Kawi'=>[['normal','500','600','700'],['kawi','latin','latin-ext']],
    897963      'Noto Sans Kayah Li'=>[['normal','500','600','700'],['kayah-li','latin','latin-ext']],
    898       'Noto Sans Kharoshthi'=>[['normal'],['kharoshthi']],
     964      'Noto Sans Kharoshthi'=>[['normal'],['kharoshthi','latin','latin-ext']],
    899965      'Noto Sans Khmer'=>[['100','200','300','normal','500','600','700','800','900'],['khmer','latin','latin-ext']],
    900966      'Noto Sans Khojki'=>[['normal'],['khojki','latin','latin-ext']],
    901       'Noto Sans Khudawadi'=>[['normal'],['khudawadi']],
     967      'Noto Sans Khudawadi'=>[['normal'],['khudawadi','latin','latin-ext']],
    902968      'Noto Sans Lao'=>[['100','200','300','normal','500','600','700','800','900'],['lao','latin','latin-ext']],
    903969      'Noto Sans Lao Looped'=>[['100','200','300','normal','500','600','700','800','900'],['lao','latin','latin-ext']],
    904970      'Noto Sans Lepcha'=>[['normal'],['latin','latin-ext','lepcha']],
    905971      'Noto Sans Limbu'=>[['normal'],['latin','latin-ext','limbu']],
    906       'Noto Sans Linear A'=>[['normal'],['linear-a']],
    907       'Noto Sans Linear B'=>[['normal'],['linear-b']],
     972      'Noto Sans Linear A'=>[['normal'],['latin','latin-ext','linear-a']],
     973      'Noto Sans Linear B'=>[['normal'],['latin','latin-ext','linear-b']],
    908974      'Noto Sans Lisu'=>[['normal','500','600','700'],['latin','latin-ext','lisu']],
    909975      'Noto Sans Lycian'=>[['normal'],['lycian']],
    910       'Noto Sans Lydian'=>[['normal'],['lydian']],
    911       'Noto Sans Mahajani'=>[['normal'],['mahajani']],
     976      'Noto Sans Lydian'=>[['normal'],['latin','latin-ext','lydian']],
     977      'Noto Sans Mahajani'=>[['normal'],['latin','latin-ext','mahajani']],
    912978      'Noto Sans Malayalam'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','malayalam']],
    913       'Noto Sans Mandaic'=>[['normal'],['mandaic']],
    914       'Noto Sans Manichaean'=>[['normal'],['manichaean']],
    915       'Noto Sans Marchen'=>[['normal'],['marchen']],
     979      'Noto Sans Mandaic'=>[['normal'],['latin','latin-ext','mandaic']],
     980      'Noto Sans Manichaean'=>[['normal'],['latin','latin-ext','manichaean']],
     981      'Noto Sans Marchen'=>[['normal'],['latin','latin-ext','marchen']],
    916982      'Noto Sans Masaram Gondi'=>[['normal'],['latin','latin-ext','masaram-gondi']],
    917983      'Noto Sans Math'=>[['normal'],['math']],
    918       'Noto Sans Mayan Numerals'=>[['normal'],['mayan-numerals']],
     984      'Noto Sans Mayan Numerals'=>[['normal'],['latin','latin-ext','mayan-numerals']],
    919985      'Noto Sans Medefaidrin'=>[['normal','500','600','700'],['latin','latin-ext','medefaidrin']],
    920986      'Noto Sans Meetei Mayek'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','meetei-mayek']],
    921987      'Noto Sans Mende Kikakui'=>[['normal'],['latin','latin-ext','mende-kikakui']],
    922       'Noto Sans Meroitic'=>[['normal'],['meroitic']],
     988      'Noto Sans Meroitic'=>[['normal'],['latin','latin-ext','meroitic','meroitic-cursive','meroitic-hieroglyphs']],
    923989      'Noto Sans Miao'=>[['normal'],['latin','latin-ext','miao']],
    924990      'Noto Sans Modi'=>[['normal'],['latin','latin-ext','modi']],
    925991      'Noto Sans Mongolian'=>[['normal'],['latin','latin-ext','mongolian']],
    926992      'Noto Sans Mono'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    927       'Noto Sans Mro'=>[['normal'],['mro']],
     993      'Noto Sans Mro'=>[['normal'],['latin','latin-ext','mro']],
    928994      'Noto Sans Multani'=>[['normal'],['latin','latin-ext','multani']],
    929995      'Noto Sans Myanmar'=>[['100','200','300','normal','500','600','700','800','900'],['myanmar']],
    930       'Noto Sans N Ko'=>[['normal'],['nko']],
    931       'Noto Sans Nabataean'=>[['normal'],['nabataean']],
     996      'Noto Sans NKo'=>[['normal'],['latin','latin-ext','nko']],
     997      'Noto Sans NKo Unjoined'=>[['normal','500','600','700'],['latin','latin-ext','nko']],
     998      'Noto Sans Nabataean'=>[['normal'],['latin','latin-ext','nabataean']],
     999      'Noto Sans Nag Mundari'=>[['normal','500','600','700'],['latin','latin-ext','nag-mundari']],
     1000      'Noto Sans Nandinagari'=>[['normal'],['latin','latin-ext','nandinagari']],
    9321001      'Noto Sans New Tai Lue'=>[['normal','500','600','700'],['latin','latin-ext','new-tai-lue']],
    9331002      'Noto Sans Newa'=>[['normal'],['latin','latin-ext','newa']],
    934       'Noto Sans Nushu'=>[['normal'],['nushu']],
    935       'Noto Sans Ogham'=>[['normal'],['ogham']],
     1003      'Noto Sans Nushu'=>[['normal'],['latin','latin-ext','nushu']],
     1004      'Noto Sans Ogham'=>[['normal'],['latin','latin-ext','ogham']],
    9361005      'Noto Sans Ol Chiki'=>[['normal','500','600','700'],['latin','latin-ext','ol-chiki']],
    937       'Noto Sans Old Hungarian'=>[['normal'],['old-hungarian']],
    938       'Noto Sans Old Italic'=>[['normal'],['old-italic']],
    939       'Noto Sans Old North Arabian'=>[['normal'],['old-north-arabian']],
    940       'Noto Sans Old Permic'=>[['normal'],['old-permic']],
    941       'Noto Sans Old Persian'=>[['normal'],['old-persian']],
    942       'Noto Sans Old Sogdian'=>[['normal'],['old-sogdian']],
    943       'Noto Sans Old South Arabian'=>[['normal'],['old-south-arabian']],
    944       'Noto Sans Old Turkic'=>[['normal'],['old-turkic']],
     1006      'Noto Sans Old Hungarian'=>[['normal'],['latin','latin-ext','old-hungarian']],
     1007      'Noto Sans Old Italic'=>[['normal'],['latin','latin-ext','old-italic']],
     1008      'Noto Sans Old North Arabian'=>[['normal'],['latin','latin-ext','old-north-arabian']],
     1009      'Noto Sans Old Permic'=>[['normal'],['cyrillic-ext','latin','latin-ext','old-permic']],
     1010      'Noto Sans Old Persian'=>[['normal'],['latin','latin-ext','old-persian']],
     1011      'Noto Sans Old Sogdian'=>[['normal'],['latin','latin-ext','old-sogdian']],
     1012      'Noto Sans Old South Arabian'=>[['normal'],['latin','latin-ext','old-south-arabian']],
     1013      'Noto Sans Old Turkic'=>[['normal'],['latin','latin-ext','old-turkic']],
    9451014      'Noto Sans Oriya'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','oriya']],
    9461015      'Noto Sans Osage'=>[['normal'],['latin','latin-ext','osage']],
    9471016      'Noto Sans Osmanya'=>[['normal'],['latin','latin-ext','osmanya']],
    9481017      'Noto Sans Pahawh Hmong'=>[['normal'],['latin','latin-ext','pahawh-hmong']],
    949       'Noto Sans Palmyrene'=>[['normal'],['palmyrene']],
     1018      'Noto Sans Palmyrene'=>[['normal'],['latin','latin-ext','palmyrene']],
    9501019      'Noto Sans Pau Cin Hau'=>[['normal'],['latin','latin-ext','pau-cin-hau']],
    9511020      'Noto Sans Phags Pa'=>[['normal'],['phags-pa']],
    952       'Noto Sans Phoenician'=>[['normal'],['phoenician']],
    953       'Noto Sans Psalter Pahlavi'=>[['normal'],['psalter-pahlavi']],
     1021      'Noto Sans Phoenician'=>[['normal'],['latin','latin-ext','phoenician']],
     1022      'Noto Sans Psalter Pahlavi'=>[['normal'],['latin','latin-ext','psalter-pahlavi']],
    9541023      'Noto Sans Rejang'=>[['normal'],['latin','latin-ext','rejang']],
    955       'Noto Sans Runic'=>[['normal'],['runic']],
    956       'Noto Sans SC'=>[['100','300','normal','500','700','900'],['chinese-simplified','latin']],
    957       'Noto Sans Samaritan'=>[['normal'],['samaritan']],
     1024      'Noto Sans Runic'=>[['normal'],['latin','latin-ext','runic']],
     1025      'Noto Sans SC'=>[['100','200','300','normal','500','600','700','800','900'],['chinese-simplified','cyrillic','latin','latin-ext','vietnamese']],
     1026      'Noto Sans Samaritan'=>[['normal'],['latin','latin-ext','samaritan']],
    9581027      'Noto Sans Saurashtra'=>[['normal'],['latin','latin-ext','saurashtra']],
    9591028      'Noto Sans Sharada'=>[['normal'],['latin','latin-ext','sharada']],
    960       'Noto Sans Shavian'=>[['normal'],['shavian']],
     1029      'Noto Sans Shavian'=>[['normal'],['latin','latin-ext','shavian']],
    9611030      'Noto Sans Siddham'=>[['normal'],['latin','latin-ext','siddham']],
     1031      'Noto Sans SignWriting'=>[['normal'],['latin','latin-ext','signwriting']],
    9621032      'Noto Sans Sinhala'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','sinhala']],
    963       'Noto Sans Sogdian'=>[['normal'],['sogdian']],
     1033      'Noto Sans Sogdian'=>[['normal'],['latin','latin-ext','sogdian']],
    9641034      'Noto Sans Sora Sompeng'=>[['normal','500','600','700'],['latin','latin-ext','sora-sompeng']],
    965       'Noto Sans Soyombo'=>[['normal'],['soyombo']],
     1035      'Noto Sans Soyombo'=>[['normal'],['latin','latin-ext','soyombo']],
    9661036      'Noto Sans Sundanese'=>[['normal','500','600','700'],['latin','latin-ext','sundanese']],
    9671037      'Noto Sans Syloti Nagri'=>[['normal'],['latin','latin-ext','syloti-nagri']],
    9681038      'Noto Sans Symbols'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','symbols']],
    969       'Noto Sans Symbols 2'=>[['normal'],['symbols']],
    970       'Noto Sans Syriac'=>[['100','normal','900'],['syriac']],
    971       'Noto Sans TC'=>[['100','300','normal','500','700','900'],['chinese-traditional','latin']],
     1039      'Noto Sans Symbols 2'=>[['normal'],['braille','latin','latin-ext','math','mayan-numerals','symbols']],
     1040      'Noto Sans Syriac'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','syriac']],
     1041      'Noto Sans Syriac Eastern'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','syriac']],
     1042      'Noto Sans TC'=>[['100','200','300','normal','500','600','700','800','900'],['chinese-traditional','cyrillic','latin','latin-ext','vietnamese']],
    9721043      'Noto Sans Tagalog'=>[['normal'],['latin','latin-ext','tagalog']],
    9731044      'Noto Sans Tagbanwa'=>[['normal'],['latin','latin-ext','tagbanwa']],
     
    9771048      'Noto Sans Takri'=>[['normal'],['latin','latin-ext','takri']],
    9781049      'Noto Sans Tamil'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','tamil']],
    979       'Noto Sans Tamil Supplement'=>[['normal'],['tamil-supplement']],
     1050      'Noto Sans Tamil Supplement'=>[['normal'],['latin','latin-ext','tamil-supplement']],
     1051      'Noto Sans Tangsa'=>[['normal','500','600','700'],['latin','latin-ext','tangsa']],
    9801052      'Noto Sans Telugu'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','telugu']],
    9811053      'Noto Sans Thaana'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','thaana']],
    9821054      'Noto Sans Thai'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','thai']],
    983       'Noto Sans Thai Looped'=>[['100','200','300','normal','500','600','700','800','900'],['thai']],
    984       'Noto Sans Tifinagh'=>[['normal'],['tifinagh']],
    985       'Noto Sans Tirhuta'=>[['normal'],['tirhuta']],
    986       'Noto Sans Ugaritic'=>[['normal'],['ugaritic']],
     1055      'Noto Sans Thai Looped'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','thai']],
     1056      'Noto Sans Tifinagh'=>[['normal'],['latin','latin-ext','tifinagh']],
     1057      'Noto Sans Tirhuta'=>[['normal'],['latin','latin-ext','tirhuta']],
     1058      'Noto Sans Ugaritic'=>[['normal'],['latin','latin-ext','ugaritic']],
    9871059      'Noto Sans Vai'=>[['normal'],['latin','latin-ext','vai']],
     1060      'Noto Sans Vithkuqi'=>[['normal','500','600','700'],['latin','latin-ext','vithkuqi']],
    9881061      'Noto Sans Wancho'=>[['normal'],['latin','latin-ext','wancho']],
    9891062      'Noto Sans Warang Citi'=>[['normal'],['latin','latin-ext','warang-citi']],
    9901063      'Noto Sans Yi'=>[['normal'],['latin','latin-ext','yi']],
    9911064      'Noto Sans Zanabazar Square'=>[['normal'],['latin','latin-ext','zanabazar-square']],
    992       'Noto Serif'=>[['normal','italic','700','700italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
     1065      'Noto Serif'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    9931066      'Noto Serif Ahom'=>[['normal'],['ahom','latin','latin-ext']],
    9941067      'Noto Serif Armenian'=>[['100','200','300','normal','500','600','700','800','900'],['armenian','latin','latin-ext']],
     
    9971070      'Noto Serif Devanagari'=>[['100','200','300','normal','500','600','700','800','900'],['devanagari','latin','latin-ext']],
    9981071      'Noto Serif Display'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    999       'Noto Serif Dogra'=>[['normal'],['dogra']],
     1072      'Noto Serif Dogra'=>[['normal'],['dogra','latin','latin-ext']],
    10001073      'Noto Serif Ethiopic'=>[['100','200','300','normal','500','600','700','800','900'],['ethiopic','latin','latin-ext']],
    10011074      'Noto Serif Georgian'=>[['100','200','300','normal','500','600','700','800','900'],['georgian','latin','latin-ext']],
    10021075      'Noto Serif Grantha'=>[['normal'],['grantha','latin','latin-ext']],
    1003       'Noto Serif Gujarati'=>[['100','200','300','normal','500','600','700','800','900'],['gujarati','latin','latin-ext']],
     1076      'Noto Serif Gujarati'=>[['100','200','300','normal','500','600','700','800','900'],['gujarati','latin','latin-ext','math','symbols']],
    10041077      'Noto Serif Gurmukhi'=>[['100','200','300','normal','500','600','700','800','900'],['gurmukhi','latin','latin-ext']],
    10051078      'Noto Serif HK'=>[['200','300','normal','500','600','700','800','900'],['chinese-hongkong','cyrillic','latin','latin-ext','vietnamese']],
     
    10081081      'Noto Serif KR'=>[['200','300','normal','500','600','700','900'],['korean','latin']],
    10091082      'Noto Serif Kannada'=>[['100','200','300','normal','500','600','700','800','900'],['kannada','latin','latin-ext']],
     1083      'Noto Serif Khitan Small Script'=>[['normal'],['khitan-small-script','latin','latin-ext']],
    10101084      'Noto Serif Khmer'=>[['100','200','300','normal','500','600','700','800','900'],['khmer','latin','latin-ext']],
    10111085      'Noto Serif Khojki'=>[['normal','500','600','700'],['khojki','latin','latin-ext']],
    10121086      'Noto Serif Lao'=>[['100','200','300','normal','500','600','700','800','900'],['lao','latin','latin-ext']],
     1087      'Noto Serif Makasar'=>[['normal'],['latin','latin-ext','makasar']],
    10131088      'Noto Serif Malayalam'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','malayalam']],
    10141089      'Noto Serif Myanmar'=>[['100','200','300','normal','500','600','700','800','900'],['myanmar']],
    1015       'Noto Serif Nyiakeng Puachue Hmong'=>[['normal','500','600','700'],['nyiakeng-puachue-hmong']],
     1090      'Noto Serif NP Hmong'=>[['normal','500','600','700'],['latin','nyiakeng-puachue-hmong']],
     1091      'Noto Serif Old Uyghur'=>[['normal'],['latin','latin-ext','old-uyghur']],
    10161092      'Noto Serif Oriya'=>[['normal','500','600','700'],['latin','latin-ext','oriya']],
     1093      'Noto Serif Ottoman Siyaq'=>[['normal'],['latin','latin-ext','ottoman-siyaq-numbers']],
    10171094      'Noto Serif SC'=>[['200','300','normal','500','600','700','900'],['chinese-simplified','latin']],
    10181095      'Noto Serif Sinhala'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','sinhala']],
    10191096      'Noto Serif TC'=>[['200','300','normal','500','600','700','900'],['chinese-traditional','latin']],
    10201097      'Noto Serif Tamil'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','tamil']],
    1021       'Noto Serif Tangut'=>[['normal'],['tangut']],
     1098      'Noto Serif Tangut'=>[['normal'],['latin','latin-ext','tangut']],
    10221099      'Noto Serif Telugu'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','telugu']],
    10231100      'Noto Serif Thai'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','thai']],
    10241101      'Noto Serif Tibetan'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','tibetan']],
    1025       'Noto Serif Yezidi'=>[['normal','500','600','700'],['yezidi']],
    1026       'Noto Traditional Nushu'=>[['normal'],['nushu']],
     1102      'Noto Serif Toto'=>[['normal','500','600','700'],['latin','latin-ext','toto']],
     1103      'Noto Serif Vithkuqi'=>[['normal','500','600','700'],['latin','latin-ext','vithkuqi']],
     1104      'Noto Serif Yezidi'=>[['normal','500','600','700'],['latin','latin-ext','yezidi']],
     1105      'Noto Traditional Nushu'=>[['300','normal','500','600','700'],['latin','latin-ext','nushu']],
    10271106      'Nova Cut'=>[['normal'],['latin']],
    10281107      'Nova Flat'=>[['normal'],['latin']],
     
    10351114      'Numans'=>[['normal'],['latin']],
    10361115      'Nunito'=>[['200','300','normal','500','600','700','800','900','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    1037       'Nunito Sans'=>[['200','200italic','300','300italic','normal','italic','600','600italic','700','700italic','800','800italic','900','900italic'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
     1116      'Nunito Sans'=>[['200','300','normal','500','600','700','800','900','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    10381117      'Nuosu SIL'=>[['normal'],['latin','latin-ext','yi']],
    10391118      'Odibee Sans'=>[['normal'],['latin']],
    10401119      'Odor Mean Chey'=>[['normal'],['khmer','latin']],
    1041       'Offside'=>[['normal'],['latin']],
     1120      'Offside'=>[['normal'],['latin','latin-ext']],
    10421121      'Oi'=>[['normal'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','tamil','vietnamese']],
    10431122      'Old Standard TT'=>[['normal','italic','700'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
     
    10461125      'Oleo Script'=>[['normal','700'],['latin','latin-ext']],
    10471126      'Oleo Script Swash Caps'=>[['normal','700'],['latin','latin-ext']],
     1127      'Onest'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','latin','latin-ext']],
    10481128      'Oooh Baby'=>[['normal'],['latin','latin-ext','vietnamese']],
    1049       'Open Sans'=>[['300','normal','500','600','700','800','300italic','italic','500italic','600italic','700italic','800italic'],['cyrillic','cyrillic-ext','greek','greek-ext','hebrew','latin','latin-ext','vietnamese']],
     1129      'Open Sans'=>[['300','normal','500','600','700','800','300italic','italic','500italic','600italic','700italic','800italic'],['cyrillic','cyrillic-ext','greek','greek-ext','hebrew','latin','latin-ext','math','symbols','vietnamese']],
    10501130      'Oranienbaum'=>[['normal'],['cyrillic','cyrillic-ext','latin','latin-ext']],
     1131      'Orbit'=>[['normal'],['korean','latin','latin-ext']],
    10511132      'Orbitron'=>[['normal','500','600','700','800','900'],['latin']],
    10521133      'Oregano'=>[['normal','italic'],['latin','latin-ext']],
     
    10551136      'Original Surfer'=>[['normal'],['latin']],
    10561137      'Oswald'=>[['200','300','normal','500','600','700'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    1057       'Outfit'=>[['100','200','300','normal','500','600','700','800','900'],['latin']],
     1138      'Outfit'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext']],
    10581139      'Over the Rainbow'=>[['normal'],['latin']],
    10591140      'Overlock'=>[['normal','italic','700','700italic','900','900italic'],['latin','latin-ext']],
     
    10731154      'Pacifico'=>[['normal'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    10741155      'Padauk'=>[['normal','700'],['latin','latin-ext','myanmar']],
     1156      'Padyakke Expanded One'=>[['normal'],['kannada','latin','latin-ext']],
    10751157      'Palanquin'=>[['100','200','300','normal','500','600','700'],['devanagari','latin','latin-ext']],
    10761158      'Palanquin Dark'=>[['normal','500','600','700'],['devanagari','latin','latin-ext']],
     1159      'Palette Mosaic'=>[['normal'],['japanese','latin']],
    10771160      'Pangolin'=>[['normal'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    10781161      'Paprika'=>[['normal'],['latin','latin-ext']],
     
    10811164      'Passion One'=>[['normal','700','900'],['latin','latin-ext']],
    10821165      'Passions Conflict'=>[['normal'],['latin','latin-ext','vietnamese']],
     1166      'Pathway Extreme'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    10831167      'Pathway Gothic One'=>[['normal'],['latin','latin-ext']],
    10841168      'Patrick Hand'=>[['normal'],['latin','latin-ext','vietnamese']],
     
    10951179      'Petrona'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    10961180      'Philosopher'=>[['normal','italic','700','700italic'],['cyrillic','cyrillic-ext','latin','vietnamese']],
     1181      'Phudu'=>[['300','normal','500','600','700','800','900'],['cyrillic-ext','latin','latin-ext','vietnamese']],
    10971182      'Piazzolla'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    10981183      'Piedra'=>[['normal'],['latin','latin-ext']],
    10991184      'Pinyon Script'=>[['normal'],['latin','latin-ext','vietnamese']],
    11001185      'Pirata One'=>[['normal'],['latin','latin-ext']],
     1186      'Pixelify Sans'=>[['normal','500','600','700'],['cyrillic','latin','latin-ext']],
    11011187      'Plaster'=>[['normal'],['latin','latin-ext']],
    11021188      'Play'=>[['normal','700'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    11031189      'Playball'=>[['normal'],['latin','latin-ext','vietnamese']],
     1190      'Playfair'=>[['300','normal','500','600','700','800','900','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    11041191      'Playfair Display'=>[['normal','500','600','700','800','900','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','latin','latin-ext','vietnamese']],
    11051192      'Playfair Display SC'=>[['normal','italic','700','700italic','900','900italic'],['cyrillic','latin','latin-ext','vietnamese']],
     1193      'Playpen Sans'=>[['100','200','300','normal','500','600','700','800'],['emoji','latin','latin-ext','math','vietnamese']],
    11061194      'Plus Jakarta Sans'=>[['200','300','normal','500','600','700','800','200italic','300italic','italic','500italic','600italic','700italic','800italic'],['cyrillic-ext','latin','latin-ext','vietnamese']],
    11071195      'Podkova'=>[['normal','500','600','700','800'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    11081196      'Poiret One'=>[['normal'],['cyrillic','latin','latin-ext']],
    11091197      'Poller One'=>[['normal'],['latin']],
     1198      'Poltawski Nowy'=>[['normal','500','600','700','italic','500italic','600italic','700italic'],['latin','latin-ext','vietnamese']],
    11101199      'Poly'=>[['normal','italic'],['latin']],
    11111200      'Pompiere'=>[['normal'],['latin']],
    1112       'Pontano Sans'=>[['normal'],['latin','latin-ext']],
     1201      'Pontano Sans'=>[['300','normal','500','600','700'],['latin','latin-ext']],
    11131202      'Poor Story'=>[['normal'],['korean','latin']],
    11141203      'Poppins'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['devanagari','latin','latin-ext']],
     
    11411230      'Qwigley'=>[['normal'],['latin','latin-ext','vietnamese']],
    11421231      'Qwitcher Grypen'=>[['normal','700'],['latin','latin-ext','vietnamese']],
     1232      'REM'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    11431233      'Racing Sans One'=>[['normal'],['latin','latin-ext']],
    1144       'Radio Canada'=>[['300','normal','500','600','700','300italic','italic','500italic','600italic','700italic'],['latin','latin-ext','vietnamese']],
     1234      'Radio Canada'=>[['300','normal','500','600','700','300italic','italic','500italic','600italic','700italic'],['canadian-aboriginal','latin','latin-ext','vietnamese']],
    11451235      'Radley'=>[['normal','italic'],['latin','latin-ext']],
    11461236      'Rajdhani'=>[['300','normal','500','600','700'],['devanagari','latin','latin-ext']],
     
    11681258      'Redacted Script'=>[['300','normal','700'],['latin','latin-ext']],
    11691259      'Redressed'=>[['normal'],['latin']],
    1170       'Reem Kufi'=>[['normal','500','600','700'],['arabic','latin']],
     1260      'Reem Kufi'=>[['normal','500','600','700'],['arabic','latin','latin-ext','vietnamese']],
    11711261      'Reem Kufi Fun'=>[['normal','500','600','700'],['arabic','latin','latin-ext','vietnamese']],
    11721262      'Reem Kufi Ink'=>[['normal'],['arabic','latin','latin-ext','vietnamese']],
    11731263      'Reenie Beanie'=>[['normal'],['latin']],
    11741264      'Reggae One'=>[['normal'],['cyrillic','japanese','latin','latin-ext']],
     1265      'Rethink Sans'=>[['normal','500','600','700','800','italic','500italic','600italic','700italic','800italic'],['latin','latin-ext']],
    11751266      'Revalia'=>[['normal'],['latin','latin-ext']],
    11761267      'Rhodium Libre'=>[['normal'],['devanagari','latin','latin-ext']],
     
    11811272      'Road Rage'=>[['normal'],['latin','latin-ext','vietnamese']],
    11821273      'Roboto'=>[['100','100italic','300','300italic','normal','italic','500','500italic','700','700italic','900','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    1183       'Roboto Condensed'=>[['300','300italic','normal','italic','700','700italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
     1274      'Roboto Condensed'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    11841275      'Roboto Flex'=>[['normal'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    11851276      'Roboto Mono'=>[['100','200','300','normal','500','600','700','100italic','200italic','300italic','italic','500italic','600italic','700italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    1186       'Roboto Serif'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic-ext','latin','latin-ext','vietnamese']],
     1277      'Roboto Serif'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    11871278      'Roboto Slab'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    11881279      'Rochester'=>[['normal'],['latin']],
     1280      'Rock 3D'=>[['normal'],['japanese','latin']],
    11891281      'Rock Salt'=>[['normal'],['latin']],
    11901282      'RocknRoll One'=>[['normal'],['cyrillic','japanese','latin','latin-ext']],
    1191       'Rokkitt'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','vietnamese']],
     1283      'Rokkitt'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
    11921284      'Romanesco'=>[['normal'],['latin','latin-ext']],
    11931285      'Ropa Sans'=>[['normal','italic'],['latin','latin-ext']],
     
    11971289      'Rowdies'=>[['300','normal','700'],['latin','latin-ext','vietnamese']],
    11981290      'Rozha One'=>[['normal'],['devanagari','latin','latin-ext']],
    1199       'Rubik'=>[['300','normal','500','600','700','800','900','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1291      'Rubik'=>[['300','normal','500','600','700','800','900','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['arabic','cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1292      'Rubik 80s Fade'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
    12001293      'Rubik Beastly'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1294      'Rubik Broken Fax'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext','math','symbols']],
    12011295      'Rubik Bubbles'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
    12021296      'Rubik Burned'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
    12031297      'Rubik Dirt'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
    12041298      'Rubik Distressed'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1299      'Rubik Doodle Shadow'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext','math','symbols']],
     1300      'Rubik Doodle Triangles'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext','math','symbols']],
     1301      'Rubik Gemstones'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
    12051302      'Rubik Glitch'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1303      'Rubik Glitch Pop'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext','math','symbols']],
    12061304      'Rubik Iso'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1305      'Rubik Lines'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext','math','symbols']],
     1306      'Rubik Maps'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext','math','symbols']],
    12071307      'Rubik Marker Hatch'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
    12081308      'Rubik Maze'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     
    12101310      'Rubik Mono One'=>[['normal'],['cyrillic','latin','latin-ext']],
    12111311      'Rubik Moonrocks'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1312      'Rubik Pixels'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
    12121313      'Rubik Puddles'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1314      'Rubik Scribble'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext','math','symbols']],
     1315      'Rubik Spray Paint'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1316      'Rubik Storm'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
     1317      'Rubik Vinyl'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
    12131318      'Rubik Wet Paint'=>[['normal'],['cyrillic','cyrillic-ext','hebrew','latin','latin-ext']],
    12141319      'Ruda'=>[['normal','500','600','700','800','900'],['cyrillic','latin','latin-ext','vietnamese']],
     
    12171322      'Ruluko'=>[['normal'],['latin','latin-ext']],
    12181323      'Rum Raisin'=>[['normal'],['latin','latin-ext']],
    1219       'Ruslan Display'=>[['normal'],['cyrillic','latin','latin-ext']],
     1324      'Ruslan Display'=>[['normal'],['cyrillic','latin','latin-ext','math','symbols']],
    12201325      'Russo One'=>[['normal'],['cyrillic','latin','latin-ext']],
    12211326      'Ruthie'=>[['normal'],['latin','latin-ext','vietnamese']],
     1327      'Ruwudu'=>[['normal','500','600','700'],['arabic','latin','latin-ext']],
    12221328      'Rye'=>[['normal'],['latin','latin-ext']],
    12231329      'STIX Two Text'=>[['normal','500','600','700','italic','500italic','600italic','700italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
     
    12441350      'Sawarabi Mincho'=>[['normal'],['japanese','latin','latin-ext']],
    12451351      'Scada'=>[['normal','italic','700','700italic'],['cyrillic','cyrillic-ext','latin','latin-ext']],
    1246       'Scheherazade New'=>[['normal','700'],['arabic','latin','latin-ext']],
     1352      'Scheherazade New'=>[['normal','500','600','700'],['arabic','latin','latin-ext']],
     1353      'Schibsted Grotesk'=>[['normal','500','600','700','800','900','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext']],
    12471354      'Schoolbell'=>[['normal'],['latin']],
    12481355      'Scope One'=>[['normal'],['latin','latin-ext']],
     
    12511358      'Sedgwick Ave'=>[['normal'],['latin','latin-ext','vietnamese']],
    12521359      'Sedgwick Ave Display'=>[['normal'],['latin','latin-ext','vietnamese']],
    1253       'Sen'=>[['normal','700','800'],['latin','latin-ext']],
     1360      'Sen'=>[['normal','500','600','700','800'],['latin','latin-ext']],
    12541361      'Send Flowers'=>[['normal'],['latin','latin-ext','vietnamese']],
    12551362      'Sevillana'=>[['normal'],['latin','latin-ext']],
     
    12581365      'Shadows Into Light Two'=>[['normal'],['latin','latin-ext']],
    12591366      'Shalimar'=>[['normal'],['latin','latin-ext','vietnamese']],
    1260       'Shanti'=>[['normal'],['latin']],
     1367      'Shantell Sans'=>[['300','normal','500','600','700','800','300italic','italic','500italic','600italic','700italic','800italic'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
     1368      'Shanti'=>[['normal'],['latin','latin-ext']],
    12611369      'Share'=>[['normal','italic','700','700italic'],['latin','latin-ext']],
    12621370      'Share Tech'=>[['normal'],['latin']],
     
    12661374      'Shippori Mincho'=>[['normal','500','600','700','800'],['japanese','latin','latin-ext']],
    12671375      'Shippori Mincho B1'=>[['normal','500','600','700','800'],['japanese','latin','latin-ext']],
     1376      'Shizuru'=>[['normal'],['japanese','latin']],
    12681377      'Shojumaru'=>[['normal'],['latin','latin-ext']],
    12691378      'Short Stack'=>[['normal'],['latin']],
    12701379      'Shrikhand'=>[['normal'],['gujarati','latin','latin-ext']],
    12711380      'Siemreap'=>[['normal'],['khmer']],
     1381      'Sigmar'=>[['normal'],['latin','latin-ext','vietnamese']],
    12721382      'Sigmar One'=>[['normal'],['latin','latin-ext','vietnamese']],
    12731383      'Signika'=>[['300','normal','500','600','700'],['latin','latin-ext','vietnamese']],
     
    12791389      'Sirin Stencil'=>[['normal'],['latin']],
    12801390      'Six Caps'=>[['normal'],['latin']],
     1391      'Sixtyfour'=>[['normal'],['latin','latin-ext','math','symbols']],
    12811392      'Skranji'=>[['normal','700'],['latin','latin-ext']],
    12821393      'Slabo 13px'=>[['normal'],['latin','latin-ext']],
    12831394      'Slabo 27px'=>[['normal'],['latin','latin-ext']],
    12841395      'Slackey'=>[['normal'],['latin']],
     1396      'Slackside One'=>[['normal'],['japanese','latin','latin-ext']],
    12851397      'Smokum'=>[['normal'],['latin']],
    12861398      'Smooch'=>[['normal'],['latin','latin-ext','vietnamese']],
     
    12921404      'Sofadi One'=>[['normal'],['latin']],
    12931405      'Sofia'=>[['normal'],['latin']],
     1406      'Sofia Sans'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext']],
     1407      'Sofia Sans Condensed'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext']],
     1408      'Sofia Sans Extra Condensed'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext']],
     1409      'Sofia Sans Semi Condensed'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext']],
     1410      'Solitreo'=>[['normal'],['hebrew','latin','latin-ext']],
    12941411      'Solway'=>[['300','normal','500','700','800'],['latin']],
     1412      'Sometype Mono'=>[['normal','500','600','700','italic','500italic','600italic','700italic'],['latin','latin-ext']],
    12951413      'Song Myung'=>[['normal'],['korean','latin']],
    12961414      'Sono'=>[['200','300','normal','500','600','700','800'],['latin','latin-ext','vietnamese']],
     
    13001418      'Source Code Pro'=>[['200','300','normal','500','600','700','800','900','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    13011419      'Source Sans 3'=>[['200','300','normal','500','600','700','800','900','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    1302       'Source Sans Pro'=>[['200','200italic','300','300italic','normal','italic','600','600italic','700','700italic','900','900italic'],['cyrillic','cyrillic-ext','greek','greek-ext','latin','latin-ext','vietnamese']],
    13031420      'Source Serif 4'=>[['200','300','normal','500','600','700','800','900','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    1304       'Source Serif Pro'=>[['200','200italic','300','300italic','normal','italic','600','600italic','700','700italic','900','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    13051421      'Space Grotesk'=>[['300','normal','500','600','700'],['latin','latin-ext','vietnamese']],
    13061422      'Space Mono'=>[['normal','italic','700','700italic'],['latin','latin-ext','vietnamese']],
     
    13281444      'Stint Ultra Expanded'=>[['normal'],['latin','latin-ext']],
    13291445      'Stoke'=>[['300','normal'],['latin','latin-ext']],
    1330       'Strait'=>[['normal'],['latin']],
     1446      'Strait'=>[['normal'],['latin','latin-ext']],
    13311447      'Style Script'=>[['normal'],['latin','latin-ext','vietnamese']],
    13321448      'Stylish'=>[['normal'],['korean','latin']],
     
    13551471      'Taviraj'=>[['100','100italic','200','200italic','300','300italic','normal','italic','500','500italic','600','600italic','700','700italic','800','800italic','900','900italic'],['latin','latin-ext','thai','vietnamese']],
    13561472      'Teko'=>[['300','normal','500','600','700'],['devanagari','latin','latin-ext']],
     1473      'Tektur'=>[['normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    13571474      'Telex'=>[['normal'],['latin','latin-ext']],
    13581475      'Tenali Ramakrishna'=>[['normal'],['latin','telugu']],
     
    13651482      'Tienne'=>[['normal','700','900'],['latin']],
    13661483      'Tillana'=>[['normal','500','600','700','800'],['devanagari','latin','latin-ext']],
     1484      'Tilt Neon'=>[['normal'],['latin','latin-ext','vietnamese']],
     1485      'Tilt Prism'=>[['normal'],['latin','latin-ext','vietnamese']],
     1486      'Tilt Warp'=>[['normal'],['latin','latin-ext','vietnamese']],
    13671487      'Timmana'=>[['normal'],['latin','telugu']],
    13681488      'Tinos'=>[['normal','italic','700','700italic'],['cyrillic','cyrillic-ext','greek','greek-ext','hebrew','latin','latin-ext','vietnamese']],
     
    13871507      'Truculenta'=>[['100','200','300','normal','500','600','700','800','900'],['latin','latin-ext','vietnamese']],
    13881508      'Trykker'=>[['normal'],['latin','latin-ext']],
     1509      'Tsukimi Rounded'=>[['300','normal','500','600','700'],['japanese','latin','latin-ext']],
    13891510      'Tulpen One'=>[['normal'],['latin']],
    13901511      'Turret Road'=>[['200','300','normal','500','700','800'],['latin','latin-ext']],
     
    13951516      'Uchen'=>[['normal'],['latin','tibetan']],
    13961517      'Ultra'=>[['normal'],['latin']],
     1518      'Unbounded'=>[['200','300','normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    13971519      'Uncial Antiqua'=>[['normal'],['latin']],
    13981520      'Underdog'=>[['normal'],['cyrillic','latin','latin-ext']],
    1399       'Unica One'=>[['normal'],['latin','latin-ext']],
     1521      'Unica One'=>[['normal'],['latin','latin-ext','vietnamese']],
    14001522      'UnifrakturCook'=>[['700'],['latin']],
    14011523      'UnifrakturMaguntia'=>[['normal'],['latin']],
    14021524      'Unkempt'=>[['normal','700'],['latin']],
    1403       'Unlock'=>[['normal'],['latin']],
     1525      'Unlock'=>[['normal'],['latin','latin-ext']],
    14041526      'Unna'=>[['normal','italic','700','700italic'],['latin','latin-ext']],
    14051527      'Updock'=>[['normal'],['latin','latin-ext','vietnamese']],
     
    14161538      'Vibes'=>[['normal'],['arabic','latin']],
    14171539      'Vibur'=>[['normal'],['latin']],
     1540      'Victor Mono'=>[['100','200','300','normal','500','600','700','100italic','200italic','300italic','italic','500italic','600italic','700italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    14181541      'Vidaloka'=>[['normal'],['latin']],
    14191542      'Viga'=>[['normal'],['latin','latin-ext']],
     1543      'Vina Sans'=>[['normal'],['latin','latin-ext','vietnamese']],
    14201544      'Voces'=>[['normal'],['latin','latin-ext']],
    14211545      'Volkhov'=>[['normal','italic','700','700italic'],['latin']],
    14221546      'Vollkorn'=>[['normal','500','600','700','800','900','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','vietnamese']],
    14231547      'Vollkorn SC'=>[['normal','600','700','900'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    1424       'Voltaire'=>[['normal'],['latin']],
     1548      'Voltaire'=>[['normal'],['latin','latin-ext','vietnamese']],
    14251549      'Vujahday Script'=>[['normal'],['latin','latin-ext','vietnamese']],
    14261550      'Waiting for the Sunrise'=>[['normal'],['latin']],
     
    14301554      'Water Brush'=>[['normal'],['latin','latin-ext','vietnamese']],
    14311555      'Waterfall'=>[['normal'],['latin','latin-ext','vietnamese']],
     1556      'Wavefont'=>[['100','200','300','normal','500','600','700','800','900'],['latin']],
    14321557      'Wellfleet'=>[['normal'],['latin','latin-ext']],
    14331558      'Wendy One'=>[['normal'],['latin','latin-ext']],
     
    14351560      'WindSong'=>[['normal','500'],['latin','latin-ext','vietnamese']],
    14361561      'Wire One'=>[['normal'],['latin']],
     1562      'Wix Madefor Display'=>[['normal','500','600','700','800'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
     1563      'Wix Madefor Text'=>[['normal','italic','500','500italic','600','600italic','700','700italic','800','800italic'],['cyrillic','cyrillic-ext','latin','latin-ext','vietnamese']],
    14371564      'Work Sans'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['latin','latin-ext','vietnamese']],
     1565      'Workbench'=>[['normal'],['latin','math','symbols']],
    14381566      'Xanh Mono'=>[['normal','italic'],['latin','latin-ext','vietnamese']],
    14391567      'Yaldevi'=>[['200','300','normal','500','600','700'],['latin','latin-ext','sinhala']],
     
    14461574      'Yesteryear'=>[['normal'],['latin']],
    14471575      'Yomogi'=>[['normal'],['cyrillic','japanese','latin','latin-ext','vietnamese']],
     1576      'Young Serif'=>[['normal'],['latin','latin-ext']],
    14481577      'Yrsa'=>[['300','normal','500','600','700','300italic','italic','500italic','600italic','700italic'],['latin','latin-ext','vietnamese']],
     1578      'Ysabeau'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','math','symbols','vietnamese']],
     1579      'Ysabeau Infant'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','math','symbols','vietnamese']],
     1580      'Ysabeau Office'=>[['100','200','300','normal','500','600','700','800','900','100italic','200italic','300italic','italic','500italic','600italic','700italic','800italic','900italic'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','math','symbols','vietnamese']],
     1581      'Ysabeau SC'=>[['100','200','300','normal','500','600','700','800','900'],['cyrillic','cyrillic-ext','greek','latin','latin-ext','math','symbols','vietnamese']],
    14491582      'Yuji Boku'=>[['normal'],['cyrillic','japanese','latin','latin-ext']],
     1583      'Yuji Hentaigana Akari'=>[['normal'],['japanese','latin','latin-ext']],
     1584      'Yuji Hentaigana Akebono'=>[['normal'],['japanese','latin','latin-ext']],
    14501585      'Yuji Mai'=>[['normal'],['cyrillic','japanese','latin','latin-ext']],
    14511586      'Yuji Syuku'=>[['normal'],['cyrillic','japanese','latin','latin-ext']],
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/fields/wp_editor/wp_editor.php

    r2986425 r3207680  
    1010if ( ! class_exists( 'CSF_Field_wp_editor' ) ) {
    1111  class CSF_Field_wp_editor extends CSF_Fields {
    12 
    1312
    1413    public function __construct( $field, $value = '', $unique = '', $where = '', $parent = '' ) {
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/views/about.php

    r2986425 r3207680  
    8181
    8282  <ul>
    83     <li>WordPress 6.2.x Ready</li>
     83    <li>WordPress 6.4.x Ready</li>
    8484    <li>Gutenberg Ready</li>
    8585    <li>Multiple instances</li>
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/views/relnotes.php

    r2986425 r3207680  
    11<?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly. ?>
     2
     3<h3>v2.3.1</h3>
     4<ul>
     5  <li>Added: PHP 8.x compatible.</li>
     6  <li>Added: WordPress 6.4 compatible.</li>
     7  <li>Fixed: PHP 8.x deprecated notices.</li>
     8</ul>
    29
    310<h3>v2.3.0</h3>
  • interactive-globes/trunk/vendor/saltus/framework/src/Core.php

    r2986425 r3207680  
    33 * Saltus Framework
    44 *
     5 * @version 1.1.2
    56 */
    67namespace Saltus\WP\Framework;
  • interactive-globes/trunk/vendor/saltus/framework/src/Features/DragAndDrop/UpdateMenuDragAndDrop.php

    r2986425 r3207680  
    1717
    1818    public function add_action() {
    19         add_action( 'wp_ajax_dda-update-menu-order', array( $this, 'update_menu_order' ) );
     19        add_action( 'wp_ajax_saltus-dad-update-menu-order', array( $this, 'update_menu_order' ) );
    2020    }
    2121
     
    7777        }
    7878
    79         do_action( 'dda_update_menu_order' );
     79        do_action( 'saltus/dad/update_menu_order' );
    8080    }
    8181}
  • interactive-globes/trunk/vendor/saltus/framework/src/Features/Duplicate/SaltusDuplicate.php

    r2986425 r3207680  
    6969
    7070        // Die if post not selected
    71         if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'saltus_duplicate_post' === $_REQUEST['action'] ) ) ) {
     71        if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'saltus_duplicate_post' ) ) ) {
    7272            wp_die( esc_html__( 'Please select an item to duplicate.', 'saltus' ) );
    7373        }
     
    137137                continue;
    138138            }
    139             $sql_query_sel[] = $wpdb->prepare( "SELECT %s, %s, %s", $new_post_id, $meta_key, $post_meta->meta_value);
     139            $sql_query_sel[] = $wpdb->prepare( 'SELECT %s, %s, %s', $new_post_id, $meta_key, $post_meta->meta_value );
    140140        }
    141141
     
    147147        $post_type = get_post_type( $post_id );
    148148
     149        do_action( 'saltus/duplicate_post/after', $post_type, $post_id, $new_post_id );
     150
    149151        wp_safe_redirect( admin_url( 'edit.php?post_type=' . $post_type ) );
    150 
    151152    }
    152153}
  • interactive-globes/trunk/vendor/saltus/framework/src/Features/Meta/CodestarMeta.php

    r3115164 r3207680  
    3434            $this->create_metabox( $box_id, $box );
    3535        }
    36 
    3736    }
    3837
     
    8180            if ( ! empty( $box_settings['data_type'] ) && $box_settings['data_type'] === 'serialize' ) {
    8281                $post_type = $this->name;
    83                 if ( ! empty( $box_settings['sections']['details']['fields'] ) ) {
    84                     $this->create_meta_fields_serialized( $box_settings['sections']['details']['fields'], $box_id, $post_type );
     82                foreach ( $box_settings['sections'] as $section ) {
     83                    if ( ! empty( $section['fields'] ) ) {
     84                        $this->create_meta_fields_serialized( $section['fields'], $box_id, $post_type );
     85                    }
    8586                }
    8687            }
     
    8889                ( ! empty( $box_settings['data_type'] ) && $box_settings['data_type'] === 'unserialize' ) ) {
    8990                $post_type = $this->name;
    90                 if ( ! empty( $box_settings['sections']['details']['fields'] ) ) {
    91                     foreach ( $box_settings['sections']['details']['fields'] as $meta_name => $want_to_register_fields ) {
    92                         $meta_type = 'object';
    93                         if ( ! empty( $want_to_register_fields['type'] ) ) {
    94                             $meta_type = $want_to_register_fields['type'];
     91
     92                foreach ( $box_settings['sections'] as $section ) {
     93                    if ( ! empty( $section['fields'] ) ) {
     94                        foreach ( $section['fields'] as $meta_name => $want_to_register_fields ) {
     95                            $meta_type = 'object';
     96                            if ( ! empty( $want_to_register_fields['type'] ) ) {
     97                                $meta_type = $want_to_register_fields['type'];
     98                            }
     99                            $this->create_meta_fields_not_serialized( $meta_name, $meta_type, $post_type );
    95100                        }
    96                         $this->create_meta_fields_not_serialized( $meta_name, $meta_type, $post_type );
    97101                    }
    98102                }
     
    105109    private function setup_restapi_fields( $fields ) {
    106110        $rest_fields = [];
    107         $rest_types = $this->match_fields( $this->list_fields() );
     111        $rest_types  = $this->match_fields( $this->list_fields() );
    108112        foreach ( $fields as $name => $attributes ) {
    109113            if ( empty( $attributes['type'] ) ) {
    110114                continue;
    111115            }
    112             $rest_type = $this->get_field_type( $attributes['type'], $rest_types );
     116            $rest_type            = $this->get_field_type( $attributes['type'], $rest_types );
    113117            $rest_fields[ $name ] = [
    114                 'type' => $rest_type
     118                'type' => $rest_type,
    115119            ];
    116120            if ( $rest_type === 'object' && ! empty( $attributes['fields'] ) ) {
    117                 $rest_properties = $this->setup_restapi_fields( $attributes['fields'] );
     121                $rest_properties                    = $this->setup_restapi_fields( $attributes['fields'] );
    118122                $rest_fields[ $name ]['properties'] = $rest_properties;
    119123            }
     
    124128
    125129        $rest_types = $this->match_fields( $this->list_fields() );
    126         $rest_type = $this->get_field_type( $meta_type, $rest_types );
    127 
    128         add_action( 'rest_api_init', function() use ($post_type, $meta_name, $rest_type ) {
    129             register_meta( 'post', $meta_name, array(
    130                 'object_subtype' => $post_type,
    131                 'type'           => $rest_type,
    132                 'single'         => true,
    133                 'show_in_rest'  => [
    134                     'prepare_callback' => function( $value ) {
    135                         return wp_json_encode( $value );
    136                     }
    137                 ],
    138             ));
    139         });
     130        $rest_type  = $this->get_field_type( $meta_type, $rest_types );
     131
     132        add_action(
     133            'rest_api_init',
     134            function () use ( $post_type, $meta_name, $rest_type ) {
     135                register_meta(
     136                    'post',
     137                    $meta_name,
     138                    array(
     139                        'object_subtype' => $post_type,
     140                        'type'           => $rest_type,
     141                        'single'         => true,
     142                        'show_in_rest'   => [
     143                            'prepare_callback' => function ( $value ) {
     144                                return wp_json_encode( $value );
     145                            },
     146                        ],
     147                    )
     148                );
     149            }
     150        );
    140151    }
    141152
     
    146157        $meta_rest_fields = $this->setup_restapi_fields( $meta_fields );
    147158
    148         add_action( 'rest_api_init', function() use ( $post_type, $meta_name, $meta_type, $meta_rest_fields ) {
    149             register_meta( 'post', $meta_name, array(
    150                 'object_subtype' => $post_type,
    151                 'type'           => $meta_type,
    152                 'single'         => true,
    153                 'show_in_rest'   => [
    154                     'schema' => [
    155                         'type'       => 'object',
    156                         'additionalProperties' => true, // so it handles old meta
    157                         'properties' => $meta_rest_fields,
    158                     ],
    159                 ],
    160             ));
    161         });
     159        add_action(
     160            'rest_api_init',
     161            function () use ( $post_type, $meta_name, $meta_type, $meta_rest_fields ) {
     162                register_meta(
     163                    'post',
     164                    $meta_name,
     165                    array(
     166                        'object_subtype' => $post_type,
     167                        'type'           => $meta_type,
     168                        'single'         => true,
     169                        'show_in_rest'   => [
     170                            'schema' => [
     171                                'type'                 => 'object',
     172                                'additionalProperties' => true, // so it handles old meta
     173                                'properties'           => $meta_rest_fields,
     174                            ],
     175                        ],
     176                    )
     177                );
     178            }
     179        );
    162180    }
    163181
     
    165183
    166184        // Include all framework fields
    167         return apply_filters( 'saltus/cfs/fields', array(
    168             'accordion',
    169             'background',
    170             'backup',
    171             'border',
    172             'button_set',
    173             'callback',
    174             'checkbox',
    175             'code_editor',
    176             'color',
    177             'color_group',
    178             'content',
    179             'date',
    180             'datetime',
    181             'dimensions',
    182             'fieldset',
    183             'gallery',
    184             'group',
    185             'heading',
    186             'icon',
    187             'image_select',
    188             'link',
    189             'link_color',
    190             'map',
    191             'media',
    192             'notice',
    193             'number',
    194             'palette',
    195             'radio',
    196             'repeater',
    197             'select',
    198             'slider',
    199             'sortable',
    200             'sorter',
    201             'spacing',
    202             'spinner',
    203             'subheading',
    204             'submessage',
    205             'switcher',
    206             'tabbed',
    207             'text',
    208             'textarea',
    209             'typography',
    210             'upload',
    211             'wp_editor',
    212         ) );
     185        return apply_filters(
     186            'saltus/cfs/fields',
     187            array(
     188                'accordion',
     189                'background',
     190                'backup',
     191                'border',
     192                'button_set',
     193                'callback',
     194                'checkbox',
     195                'code_editor',
     196                'color',
     197                'color_group',
     198                'content',
     199                'date',
     200                'datetime',
     201                'dimensions',
     202                'fieldset',
     203                'gallery',
     204                'group',
     205                'heading',
     206                'icon',
     207                'image_select',
     208                'link',
     209                'link_color',
     210                'map',
     211                'media',
     212                'notice',
     213                'number',
     214                'palette',
     215                'radio',
     216                'repeater',
     217                'select',
     218                'slider',
     219                'sortable',
     220                'sorter',
     221                'spacing',
     222                'spinner',
     223                'subheading',
     224                'submessage',
     225                'switcher',
     226                'tabbed',
     227                'text',
     228                'textarea',
     229                'typography',
     230                'upload',
     231                'wp_editor',
     232            )
     233        );
    213234    }
    214235    private function match_fields( $allowed_fields ) {
    215236
    216237        $assigned_field_type = [];
    217         foreach( $allowed_fields as $field ) {
    218             switch( $field) {
     238        foreach ( $allowed_fields as $field ) {
     239            switch ( $field ) {
    219240                case 'accordion':
    220241                case 'backup':
     
    235256                case 'link':
    236257                case 'link_color':
    237                 case 'media':
    238258                case 'notice':
    239259                case 'palette':
     
    265285                    $assigned_field_type[ $field ] = 'object';
    266286                    break;
     287                case 'media':
    267288                case 'select':
    268289                case 'repeater':
     
    303324        }
    304325        \CSF::createSection( $id, $section );
    305 
    306326    }
    307327
  • interactive-globes/trunk/vendor/saltus/framework/src/Modeler.php

    r3031895 r3207680  
    5454            $path_dir_iter = new \RecursiveIteratorIterator( $path_dir );
    5555
     56            $files = [];
    5657            foreach ( $path_dir_iter as $filename => $file ) {
    5758                if ( ! in_array( pathinfo( $file, PATHINFO_EXTENSION ), [ 'json', 'php', 'yml', 'yaml' ], true ) ) {
    5859                    continue;
    5960                }
     61                $files[] = $file; // Collect valid files
     62            }
     63
     64            // sort by ascending names so it loads in the desired order
     65            usort(
     66                $files,
     67                function ( $a, $b ) {
     68                    return strcmp( $a->getFilename(), $b->getFilename() );
     69                }
     70            ); // Sort by filename
     71
     72            foreach ( $files as $file ) { // Iterate over sorted files
    6073                $config = new Config( $file );
    6174                ( $this->is_multiple( $config ) ?
Note: See TracChangeset for help on using the changeset viewer.