@mappedin/mappedin-js 6.0.0-alpha.9 → 6.0.1-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +44 -157
  2. package/lib/esm/Arrival-7CH7MHGT.js +1 -0
  3. package/lib/esm/Chalet-HJY2RRWP.js +1 -0
  4. package/lib/esm/GLTFExporter-557DK237.js +1 -0
  5. package/lib/esm/HelveticaNeue-KYLSWWLS.js +1 -0
  6. package/lib/esm/Helvetiker-INS43MZX.js +1 -0
  7. package/lib/esm/Lato-ULDR5SED.js +1 -0
  8. package/lib/esm/MyriadPro-ZAEETUH5.js +1 -0
  9. package/lib/esm/PerformanceController-5OTIOYMZ.js +1 -0
  10. package/lib/esm/ProximaNova-Q6CVROCO.js +1 -0
  11. package/lib/esm/SimonCircular-I6ROXOEJ.js +1 -0
  12. package/lib/esm/browser-BBFNOQJI.js +1 -0
  13. package/lib/esm/chunk-57EUBQRS.js +1 -0
  14. package/lib/esm/chunk-J5IUISYU.js +1 -0
  15. package/lib/esm/chunk-L6WXUWZU.js +1 -0
  16. package/lib/esm/index.css +1 -0
  17. package/lib/esm/index.d.ts +14813 -0
  18. package/lib/esm/index.js +1 -0
  19. package/lib/esm/outdoor-context-BDJWNPA3.js +1 -0
  20. package/lib/index.css +1 -0
  21. package/package.json +18 -53
  22. package/lib/esm/get-venue/index.d.ts +0 -2466
  23. package/lib/esm/get-venue/index.js +0 -1
  24. package/lib/esm/navigator/index.d.ts +0 -243
  25. package/lib/esm/navigator/index.js +0 -1
  26. package/lib/esm/renderer/Arrival-JVXBAUFE.js +0 -1
  27. package/lib/esm/renderer/Chalet-7VKCGC5R.js +0 -1
  28. package/lib/esm/renderer/HelveticaNeue-M6HRIIGZ.js +0 -1
  29. package/lib/esm/renderer/Helvetiker-K2MS62IA.js +0 -1
  30. package/lib/esm/renderer/Lato-PKBWMAQE.js +0 -1
  31. package/lib/esm/renderer/MyriadPro-MKDHQECZ.js +0 -1
  32. package/lib/esm/renderer/ProximaNova-U6AQPIB5.js +0 -1
  33. package/lib/esm/renderer/SimonCircular-LDXYDCAN.js +0 -1
  34. package/lib/esm/renderer/browser-BW4IT6LG.js +0 -1
  35. package/lib/esm/renderer/chunk-GPLIHQI3.js +0 -1
  36. package/lib/esm/renderer/chunk-MWXS32IR.js +0 -1
  37. package/lib/esm/renderer/index.css +0 -1
  38. package/lib/esm/renderer/index.d.ts +0 -5261
  39. package/lib/esm/renderer/index.js +0 -1
  40. package/lib/mappedin.css +0 -1
  41. package/lib/mappedin.js +0 -1
  42. package/lib/node/index.js +0 -1
@@ -1 +0,0 @@
1
- import{a as P,b as j}from"./chunk-MWXS32IR.js";import{a as zt,b as be,c as Ue,d as h,f as Xe,g as gn,h as w,i as _,j as H,k as G,l as H1,m as at,n as Ge}from"./chunk-GPLIHQI3.js";var kx=Xe(((t,e)=>{"use strict";P(),e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))})),Ux=Xe(((t,e)=>{"use strict";P();var i="%[a-f0-9]{2}",n=new RegExp("("+i+")|([^%]+?)","gi"),r=new RegExp("("+i+")+","gi");function s(t,e){try{return[decodeURIComponent(t.join(""))]}catch(t){}if(1===t.length)return t;e=e||1;var i=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],s(i),s(n))}function a(t){try{return decodeURIComponent(t)}catch(r){for(var e=t.match(n)||[],i=1;i<e.length;i++)e=(t=s(e,i).join("")).match(n)||[];return t}}function o(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},i=r.exec(t);i;){try{e[i[0]]=decodeURIComponent(i[0])}catch(t){var n=a(i[0]);n!==i[0]&&(e[i[0]]=n)}i=r.exec(t)}e["%C2"]="�";for(var s=Object.keys(e),o=0;o<s.length;o++){var l=s[o];t=t.replace(new RegExp(l,"g"),e[l])}return t}h(s,"decodeComponents"),h(a,"decode"),h(o,"customDecodeURIComponent"),e.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return o(t)}}})),Hx=Xe(((t,e)=>{"use strict";P(),e.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];let i=t.indexOf(e);return-1===i?[t]:[t.slice(0,i),t.slice(i+e.length)]}})),jx=Xe(((t,e)=>{"use strict";P(),e.exports=function(t,e){for(var i={},n=Object.keys(t),r=Array.isArray(e),s=0;s<n.length;s++){var a=n[s],o=t[a];(r?-1!==e.indexOf(a):e(a,o,t))&&(i[a]=o)}return i}})),Qx=Xe((t=>{"use strict";P();var e=kx(),i=Ux(),n=Hx(),r=jx(),s=h((t=>null==t),"isNullOrUndefined"),a=Symbol("encodeFragmentIdentifier");function o(t){switch(t.arrayFormat){case"index":return e=>(i,n)=>{let r=i.length;return void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?i:null===n?[...i,[c(e,t),"[",r,"]"].join("")]:[...i,[c(e,t),"[",c(r,t),"]=",c(n,t)].join("")]};case"bracket":return e=>(i,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?i:null===n?[...i,[c(e,t),"[]"].join("")]:[...i,[c(e,t),"[]=",c(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e="bracket-separator"===t.arrayFormat?"[]=":"=";return i=>(n,r)=>void 0===r||t.skipNull&&null===r||t.skipEmptyString&&""===r?n:(r=null===r?"":r,0===n.length?[[c(i,t),e,c(r,t)].join("")]:[[n,c(r,t)].join(t.arrayFormatSeparator)])}default:return e=>(i,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?i:null===n?[...i,c(e,t)]:[...i,[c(e,t),"=",c(n,t)].join("")]}}function l(t){let e;switch(t.arrayFormat){case"index":return(t,i,n)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===n[t]&&(n[t]={}),n[t][e[1]]=i):n[t]=i};case"bracket":return(t,i,n)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==n[t]?n[t]=[].concat(n[t],i):n[t]=[i]:n[t]=i};case"comma":case"separator":return(e,i,n)=>{let r="string"==typeof i&&i.includes(t.arrayFormatSeparator),s="string"==typeof i&&!r&&d(i,t).includes(t.arrayFormatSeparator);i=s?d(i,t):i;let a=r||s?i.split(t.arrayFormatSeparator).map((e=>d(e,t))):null===i?i:d(i,t);n[e]=a};case"bracket-separator":return(e,i,n)=>{let r=/(\[\])$/.test(e);if(e=e.replace(/\[\]$/,""),!r)return void(n[e]=i&&d(i,t));let s=null===i?[]:i.split(t.arrayFormatSeparator).map((e=>d(e,t)));void 0!==n[e]?n[e]=[].concat(n[e],s):n[e]=s};default:return(t,e,i)=>{void 0!==i[t]?i[t]=[].concat(i[t],e):i[t]=e}}}function u(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function c(t,i){return i.encode?i.strict?e(t):encodeURIComponent(t):t}function d(t,e){return e.decode?i(t):t}function p(t){return Array.isArray(t)?t.sort():"object"==typeof t?p(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function m(t){let e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function f(t){let e="",i=t.indexOf("#");return-1!==i&&(e=t.slice(i)),e}function g(t){let e=(t=m(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function v(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):e.parseBooleans&&null!==t&&("true"===t.toLowerCase()||"false"===t.toLowerCase())&&(t="true"===t.toLowerCase()),t}function y(t,e){u((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);let i=l(e),r=Object.create(null);if("string"!=typeof t||!(t=t.trim().replace(/^[?#&]/,"")))return r;for(let s of t.split("&")){if(""===s)continue;let[t,a]=n(e.decode?s.replace(/\+/g," "):s,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:d(a,e),i(d(t,e),a,r)}for(let t of Object.keys(r)){let i=r[t];if("object"==typeof i&&null!==i)for(let t of Object.keys(i))i[t]=v(i[t],e);else r[t]=v(i,e)}return!1===e.sort?r:(!0===e.sort?Object.keys(r).sort():Object.keys(r).sort(e.sort)).reduce(((t,e)=>{let i=r[e];return Boolean(i)&&"object"==typeof i&&!Array.isArray(i)?t[e]=p(i):t[e]=i,t}),Object.create(null))}h(o,"encoderForArrayFormat"),h(l,"parserForArrayFormat"),h(u,"validateArrayFormatSeparator"),h(c,"encode"),h(d,"decode"),h(p,"keysSorter"),h(m,"removeHash"),h(f,"getHash"),h(g,"extract"),h(v,"parseValue"),h(y,"parse"),t.extract=g,t.parse=y,t.stringify=(t,e)=>{if(!t)return"";u((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);let i=h((i=>e.skipNull&&s(t[i])||e.skipEmptyString&&""===t[i]),"shouldFilter"),n=o(e),r={};for(let e of Object.keys(t))i(e)||(r[e]=t[e]);let a=Object.keys(r);return!1!==e.sort&&a.sort(e.sort),a.map((i=>{let r=t[i];return void 0===r?"":null===r?c(i,e):Array.isArray(r)?0===r.length&&"bracket-separator"===e.arrayFormat?c(i,e)+"[]":r.reduce(n(i),[]).join("&"):c(i,e)+"="+c(r,e)})).filter((t=>t.length>0)).join("&")},t.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[i,r]=n(t,"#");return Object.assign({url:i.split("?")[0]||"",query:y(g(t),e)},e&&e.parseFragmentIdentifier&&r?{fragmentIdentifier:d(r,e)}:{})},t.stringifyUrl=(e,i)=>{i=Object.assign({encode:!0,strict:!0,[a]:!0},i);let n=m(e.url).split("?")[0]||"",r=t.extract(e.url),s=t.parse(r,{sort:!1}),o=Object.assign(s,e.query),l=t.stringify(o,i);l&&(l=`?${l}`);let h=f(e.url);return e.fragmentIdentifier&&(h=`#${i[a]?c(e.fragmentIdentifier,i):e.fragmentIdentifier}`),`${n}${l}${h}`},t.pick=(e,i,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[a]:!1},n);let{url:s,query:o,fragmentIdentifier:l}=t.parseUrl(e,n);return t.stringifyUrl({url:s,query:r(o,i),fragmentIdentifier:l},n)},t.exclude=(e,i,n)=>{let r=Array.isArray(i)?t=>!i.includes(t):(t,e)=>!i(t,e);return t.pick(e,r,n)}})),e_=Xe(((t,e)=>{P(),function(i){var n="object"==typeof t&&t,r="object"==typeof e&&e&&e.exports==n&&e,s="object"==typeof global&&global;(s.global===s||s.window===s)&&(i=s);var a=h((function(t){this.message=t}),"InvalidCharacterError");a.prototype=new Error,a.prototype.name="InvalidCharacterError";var o=h((function(t){throw new a(t)}),"error"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,c=h((function(t){var e=(t=String(t).replace(u,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&o("Invalid character: the string to be decoded is not correctly encoded.");for(var i,n,r=0,s="",a=-1;++a<e;)n=l.indexOf(t.charAt(a)),i=r%4?64*i+n:n,r++%4&&(s+=String.fromCharCode(255&i>>(-2*r&6)));return s}),"decode"),d={encode:h((function(t){t=String(t),/[^\0-\xFF]/.test(t)&&o("The string to be encoded contains characters outside of the Latin1 range.");for(var e,i,n,r,s=t.length%3,a="",h=-1,u=t.length-s;++h<u;)e=t.charCodeAt(h)<<16,i=t.charCodeAt(++h)<<8,n=t.charCodeAt(++h),a+=l.charAt((r=e+i+n)>>18&63)+l.charAt(r>>12&63)+l.charAt(r>>6&63)+l.charAt(63&r);return 2==s?(e=t.charCodeAt(h)<<8,i=t.charCodeAt(++h),a+=l.charAt((r=e+i)>>10)+l.charAt(r>>4&63)+l.charAt(r<<2&63)+"="):1==s&&(r=t.charCodeAt(h),a+=l.charAt(r>>2)+l.charAt(r<<4&63)+"=="),a}),"encode"),decode:c,version:"1.0.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define((function(){return d}));else if(n&&!n.nodeType)if(r)r.exports=d;else for(var p in d)d.hasOwnProperty(p)&&(n[p]=d[p]);else i.base64=d}(t)})),Rn=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.areaConversion=t.timeConversion=t.distanceConversion=t.altitudeKeys=t.latitudeKeys=t.longitudeKeys=t.MAXLON=t.MINLON=t.MAXLAT=t.MINLAT=t.earthRadius=t.sexagesimalPattern=void 0;t.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;t.earthRadius=6378137;t.MINLAT=-90;t.MAXLAT=90;t.MINLON=-180;t.MAXLON=180;t.longitudeKeys=["lng","lon","longitude",0];t.latitudeKeys=["lat","latitude",1];t.altitudeKeys=["alt","altitude","elevation","elev",2];t.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144};t.timeConversion={m:60,h:3600,d:86400};var e={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};t.areaConversion=e,e.sqm=e.m2,e.sqkm=e.km2,e.sqft=e.ft2,e.sqyd=e.yd2,e.sqin=e.in2})),Au=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=h((function(t,e){return e.reduce((function(e,i){if(null==t)throw new Error("'".concat(t,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(t,i)&&void 0!==i&&void 0===e?(e=i,i):e}),void 0)}),"getCoordinateKey");t.default=e})),qu=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=h((function(t){var e=t.toString().trim();return!isNaN(parseFloat(e))&&parseFloat(e)===Number(e)}),"isDecimal");t.default=e})),Pu=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Rn(),i=h((function(t){return e.sexagesimalPattern.test(t.toString().trim())}),"isSexagesimal");t.default=i})),Cu=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Rn(),i=h((function(t){var i=new RegExp(e.sexagesimalPattern).exec(t);if(null==i)throw new Error("Given value is not in sexagesimal format");var n=Number(i[2])/60||0,r=Number(i[4])/3600||0,s=parseFloat(i[1])+n+r;return["S","W"].includes(i[7])?-s:s}),"sexagesimalToDecimal");t.default=i})),Tf=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Rn(),i=n(Au());function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function s(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){a(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}h(n,"_interopRequireDefault"),h(r,"ownKeys"),h(s,"_objectSpread"),h(a,"_defineProperty");var o=h((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:e.longitudeKeys,latitude:e.latitudeKeys,altitude:e.altitudeKeys},r=(0,i.default)(t,n.longitude),a=(0,i.default)(t,n.latitude),o=(0,i.default)(t,n.altitude);return s({latitude:a,longitude:r},o?{altitude:o}:{})}),"getCoordinateKeys");t.default=o})),a2=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(qu()),i=s(Pu()),n=s(Cu()),r=Rn();function s(t){return t&&t.__esModule?t:{default:t}}h(s,"_interopRequireDefault");var a=h((function t(s){return(0,e.default)(s)?!(parseFloat(s)>r.MAXLAT||s<r.MINLAT):!!(0,i.default)(s)&&t((0,n.default)(s))}),"isValidLatitude");t.default=a})),l2=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(qu()),i=s(Pu()),n=s(Cu()),r=Rn();function s(t){return t&&t.__esModule?t:{default:t}}h(s,"_interopRequireDefault");var a=h((function t(s){return(0,e.default)(s)?!(parseFloat(s)>r.MAXLON||s<r.MINLON):!!(0,i.default)(s)&&t((0,n.default)(s))}),"isValidLongitude");t.default=a})),u2=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=r(Tf()),i=r(a2()),n=r(l2());function r(t){return t&&t.__esModule?t:{default:t}}h(r,"_interopRequireDefault");var s=h((function(t){var r=(0,e.default)(t),s=r.latitude,a=r.longitude;if(Array.isArray(t)&&t.length>=2)return(0,n.default)(t[0])&&(0,i.default)(t[1]);if(void 0===s||void 0===a)return!1;var o=t[a],l=t[s];return!(void 0===l||void 0===o||!1===(0,i.default)(l)||!1===(0,n.default)(o))}),"isValidCoordinate");t.default=s})),Pf=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(qu()),i=a(Pu()),n=a(Cu()),r=a(u2()),s=a(Tf());function a(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach((function(e){u(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function u(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}h(a,"_interopRequireDefault"),h(o,"ownKeys"),h(l,"_objectSpread"),h(u,"_defineProperty");var c=h((function t(a){if((0,e.default)(a))return Number(a);if((0,i.default)(a))return(0,n.default)(a);if((0,r.default)(a)){var o=(0,s.default)(a);return Array.isArray(a)?a.map((function(e,i){return[0,1].includes(i)?t(e):e})):l(l(l({},a),o.latitude&&u({},o.latitude,t(a[o.latitude]))),o.longitude&&u({},o.longitude,t(a[o.longitude])))}return Array.isArray(a)?a.map((function(e){return(0,r.default)(e)?t(e):e})):a}),"toDecimal");t.default=c})),Ii=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Rn(),i=r(Au()),n=r(Pf());function r(t){return t&&t.__esModule?t:{default:t}}h(r,"_interopRequireDefault");var s=h((function(t,r){var s=(0,i.default)(t,e.latitudeKeys);if(null!=s){var a=t[s];return!0===r?a:(0,n.default)(a)}}),"getLatitude");t.default=s})),Li=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Rn(),i=r(Au()),n=r(Pf());function r(t){return t&&t.__esModule?t:{default:t}}h(r,"_interopRequireDefault");var s=h((function(t,r){var s=(0,i.default)(t,e.longitudeKeys);if(null!=s){var a=t[s];return!0===r?a:(0,n.default)(a)}}),"getLongitude");t.default=s})),gr=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=h((function(t){return t*Math.PI/180}),"toRad");t.default=e})),Ya=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=h((function(t){return 180*t/Math.PI}),"toDeg");t.default=e})),h_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ii()),i=a(Li()),n=a(gr()),r=a(Ya()),s=Rn();function a(t){return t&&t.__esModule?t:{default:t}}h(a,"_interopRequireDefault");var o=h((function(t,a,o){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,h=(0,e.default)(t),u=(0,i.default)(t),c=a/l,d=(0,n.default)(o),p=(0,n.default)(h),m=(0,n.default)(u),f=Math.asin(Math.sin(p)*Math.cos(c)+Math.cos(p)*Math.sin(c)*Math.cos(d)),g=m+Math.atan2(Math.sin(d)*Math.sin(c)*Math.cos(p),Math.cos(c)-Math.sin(p)*Math.sin(f)),v=(0,r.default)(g);return(v<s.MINLON||v>s.MAXLON)&&(g=(g+3*Math.PI)%(2*Math.PI)-Math.PI,v=(0,r.default)(g)),{latitude:(0,r.default)(f),longitude:v}}),"computeDestinationPoint");t.default=o})),d_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Rn(),i=h((function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=e.areaConversion[i];if(n)return t*n;throw new Error("Invalid unit used for area conversion.")}),"convertArea");t.default=i})),p_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Rn(),i=h((function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=e.distanceConversion[i];if(n)return t*n;throw new Error("Invalid unit used for distance conversion.")}),"convertDistance");t.default=i})),f_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Rn(),i=h((function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh";switch(i){case"kmh":return t*e.timeConversion.h*e.distanceConversion.km;case"mph":return t*e.timeConversion.h*e.distanceConversion.mi;default:return t}}),"convertSpeed");t.default=i})),y_=Xe((t=>{"use strict";function e(t,e){return a(t)||s(t,e)||n(t,e)||i()}function i(){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 n(t,e){if(t){if("string"==typeof t)return r(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return r(t,e)}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function s(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){r=!0,s=t}finally{try{!n&&null!=o.return&&o.return()}finally{if(r)throw s}}return i}}function a(t){if(Array.isArray(t))return t}P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,h(e,"_slicedToArray"),h(i,"_nonIterableRest"),h(n,"_unsupportedIterableToArray"),h(r,"_arrayLikeToArray"),h(s,"_iterableToArrayLimit"),h(a,"_arrayWithHoles");var o=h((function(t){var e=Math.pow(10,12);return Math.round(t*e)/e}),"imprecise"),l=h((function(t){var i=e(t.toString().split("."),2),n=i[0],r=i[1],s=Math.abs(Number(n)),a=o(60*Number("0."+(r||0))),l=Math.floor(a),h=o(60*(a%l||0));return s+"° "+Number(l.toFixed(6)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+"' "+Number(h.toFixed(4)).toString().split(".").map((function(t,e){return 0===e?t.padStart(2,"0"):t})).join(".")+'"'}),"decimal2sexagesimal");t.default=l})),m2=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=h((function(t){return t>1?1:t<-1?-1:t}),"robustAcos");t.default=e})),Ks=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ii()),i=a(Li()),n=a(gr()),r=a(m2()),s=Rn();function a(t){return t&&t.__esModule?t:{default:t}}h(a,"_interopRequireDefault");var o=h((function(t,a){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;o=void 0===o||isNaN(o)?1:o;var l=(0,e.default)(t),h=(0,i.default)(t),u=(0,e.default)(a),c=(0,i.default)(a),d=Math.acos((0,r.default)(Math.sin((0,n.default)(u))*Math.sin((0,n.default)(l))+Math.cos((0,n.default)(u))*Math.cos((0,n.default)(l))*Math.cos((0,n.default)(h)-(0,n.default)(c))))*s.earthRadius;return Math.round(d/o)*o}),"getDistance");t.default=o})),g2=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Ks());function i(t){return t&&t.__esModule?t:{default:t}}h(i,"_interopRequireDefault");var n=h((function(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default;return n="function"==typeof n?n:e.default,i.slice().sort((function(e,i){return n(t,e)-n(t,i)}))}),"orderByDistance");t.default=n})),b_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(g2());function i(t){return t&&t.__esModule?t:{default:t}}h(i,"_interopRequireDefault");var n=h((function(t,i){return(0,e.default)(t,i)[0]}),"findNearest");t.default=n})),T_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(gr()),i=s(Ii()),n=s(Li()),r=Rn();function s(t){return t&&t.__esModule?t:{default:t}}h(s,"_interopRequireDefault");var a=h((function(t){var s=0;if(t.length>2){for(var a,o,l,h=0;h<t.length;h++){h===t.length-2?(a=t.length-2,o=t.length-1,l=0):h===t.length-1?(a=t.length-1,o=0,l=1):(a=h,o=h+1,l=h+2);var u=(0,n.default)(t[a]),c=(0,i.default)(t[o]),d=(0,n.default)(t[l]);s+=((0,e.default)(d)-(0,e.default)(u))*Math.sin((0,e.default)(c))}s=s*r.earthRadius*r.earthRadius/2}return Math.abs(s)}),"getAreaOfPolygon");t.default=a})),x2=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Ii()),i=n(Li());function n(t){return t&&t.__esModule?t:{default:t}}h(n,"_interopRequireDefault");var r=h((function(t){if(!1===Array.isArray(t)||0===t.length)throw new Error("No points were given.");return t.reduce((function(t,n){var r=(0,e.default)(n),s=(0,i.default)(n);return{maxLat:Math.max(r,t.maxLat),minLat:Math.min(r,t.minLat),maxLng:Math.max(s,t.maxLng),minLng:Math.min(s,t.minLng)}}),{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})}),"getBounds");t.default=r})),S_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=a(Ii()),i=a(Li()),n=a(gr()),r=a(Ya()),s=Rn();function a(t){return t&&t.__esModule?t:{default:t}}h(a,"_interopRequireDefault");var o=h((function(t,a){var o,l,h=(0,e.default)(t),u=(0,i.default)(t),c=(0,n.default)(h),d=(0,n.default)(u),p=a/s.earthRadius,m=c-p,f=c+p,g=(0,n.default)(s.MAXLAT),v=(0,n.default)(s.MINLAT),y=(0,n.default)(s.MAXLON),_=(0,n.default)(s.MINLON);if(m>v&&f<g){var x=Math.asin(Math.sin(p)/Math.cos(c));(o=d-x)<_&&(o+=2*Math.PI),(l=d+x)>y&&(l-=2*Math.PI)}else m=Math.max(m,v),f=Math.min(f,g),o=_,l=y;return[{latitude:(0,r.default)(m),longitude:(0,r.default)(o)},{latitude:(0,r.default)(f),longitude:(0,r.default)(l)}]}),"getBoundsOfDistance");t.default=o})),P_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Ii()),i=s(Li()),n=s(gr()),r=s(Ya());function s(t){return t&&t.__esModule?t:{default:t}}h(s,"_interopRequireDefault");var a=h((function(t){if(!1===Array.isArray(t)||0===t.length)return!1;var s=t.length,a=t.reduce((function(t,r){var s=(0,n.default)((0,e.default)(r)),a=(0,n.default)((0,i.default)(r));return{X:t.X+Math.cos(s)*Math.cos(a),Y:t.Y+Math.cos(s)*Math.sin(a),Z:t.Z+Math.sin(s)}}),{X:0,Y:0,Z:0}),o=a.X/s,l=a.Y/s,h=a.Z/s;return{longitude:(0,r.default)(Math.atan2(l,o)),latitude:(0,r.default)(Math.atan2(h,Math.sqrt(o*o+l*l)))}}),"getCenter");t.default=a})),C_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(x2());function i(t){return t&&t.__esModule?t:{default:t}}h(i,"_interopRequireDefault");var n=h((function(t){var i=(0,e.default)(t),n=i.minLat+(i.maxLat-i.minLat)/2,r=i.minLng+(i.maxLng-i.minLng)/2;return{latitude:parseFloat(n.toFixed(6)),longitude:parseFloat(r.toFixed(6))}}),"getCenterOfBounds");t.default=n})),_2=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Ii()),i=s(Li()),n=s(gr()),r=s(Ya());function s(t){return t&&t.__esModule?t:{default:t}}h(s,"_interopRequireDefault");var a=h((function(t,s){var a=(0,n.default)((0,i.default)(s))-(0,n.default)((0,i.default)(t)),o=Math.log(Math.tan((0,n.default)((0,e.default)(s))/2+Math.PI/4)/Math.tan((0,n.default)((0,e.default)(t))/2+Math.PI/4));return Math.abs(a)>Math.PI&&(a=a>0?-1*(2*Math.PI-a):2*Math.PI+a),((0,r.default)(Math.atan2(a,o))+360)%360}),"getRhumbLineBearing");t.default=a})),R_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(_2());function i(t){return t&&t.__esModule?t:{default:t}}h(i,"_interopRequireDefault");var n=h((function(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default,r="function"==typeof n?n(t,i):(0,e.default)(t,i);if(isNaN(r))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(r/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}}),"getCompassDirection");t.default=n})),M2=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Ks()),i=n(m2());function n(t){return t&&t.__esModule?t:{default:t}}h(n,"_interopRequireDefault");var r=h((function(t,n,r){var s=(0,e.default)(n,t),a=(0,e.default)(t,r),o=(0,e.default)(n,r),l=Math.acos((0,i.default)((s*s+o*o-a*a)/(2*s*o))),h=Math.acos((0,i.default)((a*a+o*o-s*s)/(2*a*o)));return l>Math.PI/2?s:h>Math.PI/2?a:Math.sin(l)*s}),"getDistanceFromLine");t.default=r})),F_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Ii()),i=s(Li()),n=s(gr()),r=s(Ya());function s(t){return t&&t.__esModule?t:{default:t}}h(s,"_interopRequireDefault");var a=h((function(t,s){var a=(0,e.default)(s),o=(0,i.default)(s),l=(0,e.default)(t),h=(0,i.default)(t);return((0,r.default)(Math.atan2(Math.sin((0,n.default)(o)-(0,n.default)(h))*Math.cos((0,n.default)(a)),Math.cos((0,n.default)(l))*Math.sin((0,n.default)(a))-Math.sin((0,n.default)(l))*Math.cos((0,n.default)(a))*Math.cos((0,n.default)(o)-(0,n.default)(h))))+360)%360}),"getGreatCircleBearing");t.default=a})),z_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Ks());function i(t){return t&&t.__esModule?t:{default:t}}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?h((function(t){return typeof t}),"_typeof"):h((function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}),"_typeof"))(t)}h(i,"_interopRequireDefault"),h(n,"_typeof");var r=h((function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.default;return t.reduce((function(t,e){return"object"===n(t)&&null!==t.last&&(t.distance+=i(e,t.last)),t.last=e,t}),{last:null,distance:0}).distance}),"getPathLength");t.default=r})),G_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=s(Ii()),i=s(Li()),n=s(gr()),r=Rn();function s(t){return t&&t.__esModule?t:{default:t}}h(s,"_interopRequireDefault");var a=h((function(t,s){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;a=void 0===a||isNaN(a)?1:a;var o,l,h,u,c,d,p,m=(0,e.default)(t),f=(0,i.default)(t),g=(0,e.default)(s),v=(0,i.default)(s),y=6356752.314245,_=1/298.257223563,x=(0,n.default)(v-f),b=Math.atan((1-_)*Math.tan((0,n.default)(parseFloat(m)))),w=Math.atan((1-_)*Math.tan((0,n.default)(parseFloat(g)))),M=Math.sin(b),E=Math.cos(b),T=Math.sin(w),S=Math.cos(w),q=x,P=100;do{var A=Math.sin(q),C=Math.cos(q);if(0===(d=Math.sqrt(S*A*(S*A)+(E*T-M*S*C)*(E*T-M*S*C))))return 0;o=M*T+E*S*C,l=Math.atan2(d,o),c=o-2*M*T/(u=1-(h=E*S*A/d)*h),isNaN(c)&&(c=0);var L=_/16*u*(4+_*(4-3*u));p=q,q=x+(1-L)*_*h*(l+L*d*(c+L*o*(2*c*c-1)))}while(Math.abs(q-p)>1e-12&&--P>0);if(0===P)return NaN;var I=u*(r.earthRadius*r.earthRadius-y*y)/(y*y),R=1+I/16384*(4096+I*(I*(320-175*I)-768)),N=I/1024*(256+I*(I*(74-47*I)-128)),O=N*d*(c+N/4*(o*(2*c*c-1)-N/6*c*(4*d*d-3)*(4*c*c-3))),D=y*R*(l-O);return Math.round(D/a)*a}),"getDistance");t.default=a})),j_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=h((function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0}),"getRoughCompassDirection");t.default=e})),W_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Ks());function i(t){return t&&t.__esModule?t:{default:t}}h(i,"_interopRequireDefault");var n=h((function(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default,r=n(t,i),s=Number(i.time)-Number(t.time),a=r/s*1e3;return a}),"getSpeed");t.default=n})),X_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Ks());function i(t){return t&&t.__esModule?t:{default:t}}h(i,"_interopRequireDefault");var n=h((function(t,i,n){return(0,e.default)(i,t)+(0,e.default)(t,n)===(0,e.default)(i,n)}),"isPointInLine");t.default=n})),Z_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=n(Ii()),i=n(Li());function n(t){return t&&t.__esModule?t:{default:t}}h(n,"_interopRequireDefault");var r=h((function(t,n){for(var r=!1,s=n.length,a=-1,o=s-1;++a<s;o=a)((0,i.default)(n[a])<=(0,i.default)(t)&&(0,i.default)(t)<(0,i.default)(n[o])||(0,i.default)(n[o])<=(0,i.default)(t)&&(0,i.default)(t)<(0,i.default)(n[a]))&&(0,e.default)(t)<((0,e.default)(n[o])-(0,e.default)(n[a]))*((0,i.default)(t)-(0,i.default)(n[a]))/((0,i.default)(n[o])-(0,i.default)(n[a]))+(0,e.default)(n[a])&&(r=!r);return r}),"isPointInPolygon");t.default=r})),J_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(M2());function i(t){return t&&t.__esModule?t:{default:t}}h(i,"_interopRequireDefault");var n=h((function(t,i,n,r){return(0,e.default)(t,i,n)<r}),"isPointNearLine");t.default=n})),$_=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=i(Ks());function i(t){return t&&t.__esModule?t:{default:t}}h(i,"_interopRequireDefault");var n=h((function(t,i,n){return(0,e.default)(t,i)<n}),"isPointWithinRadius");t.default=n})),Q_=Xe((t=>{"use strict";function e(t,e){return a(t)||s(t,e)||n(t,e)||i()}function i(){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 n(t,e){if(t){if("string"==typeof t)return r(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return r(t,e)}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function s(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){r=!0,s=t}finally{try{!n&&null!=o.return&&o.return()}finally{if(r)throw s}}return i}}function a(t){if(Array.isArray(t))return t}P(),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,h(e,"_slicedToArray"),h(i,"_nonIterableRest"),h(n,"_unsupportedIterableToArray"),h(r,"_arrayLikeToArray"),h(s,"_iterableToArrayLimit"),h(a,"_arrayWithHoles");var o=h((function(t){if(!t.startsWith("POLYGON"))throw new Error("Invalid wkt.");return t.slice(t.indexOf("(")+2,t.indexOf(")")).split(", ").map((function(t){var i=e(t.split(" "),2),n=i[0],r=i[1];return{longitude:parseFloat(n),latitude:parseFloat(r)}}))}),"wktToPolygon");t.default=o})),t4=Xe((t=>{"use strict";P(),Object.defineProperty(t,"__esModule",{value:!0});var e={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(t,"computeDestinationPoint",{enumerable:!0,get:h((function(){return i.default}),"get")}),Object.defineProperty(t,"convertArea",{enumerable:!0,get:h((function(){return n.default}),"get")}),Object.defineProperty(t,"convertDistance",{enumerable:!0,get:h((function(){return r.default}),"get")}),Object.defineProperty(t,"convertSpeed",{enumerable:!0,get:h((function(){return s.default}),"get")}),Object.defineProperty(t,"decimalToSexagesimal",{enumerable:!0,get:h((function(){return a.default}),"get")}),Object.defineProperty(t,"findNearest",{enumerable:!0,get:h((function(){return o.default}),"get")}),Object.defineProperty(t,"getAreaOfPolygon",{enumerable:!0,get:h((function(){return l.default}),"get")}),Object.defineProperty(t,"getBounds",{enumerable:!0,get:h((function(){return u.default}),"get")}),Object.defineProperty(t,"getBoundsOfDistance",{enumerable:!0,get:h((function(){return c.default}),"get")}),Object.defineProperty(t,"getCenter",{enumerable:!0,get:h((function(){return d.default}),"get")}),Object.defineProperty(t,"getCenterOfBounds",{enumerable:!0,get:h((function(){return p.default}),"get")}),Object.defineProperty(t,"getCompassDirection",{enumerable:!0,get:h((function(){return m.default}),"get")}),Object.defineProperty(t,"getCoordinateKey",{enumerable:!0,get:h((function(){return f.default}),"get")}),Object.defineProperty(t,"getCoordinateKeys",{enumerable:!0,get:h((function(){return g.default}),"get")}),Object.defineProperty(t,"getDistance",{enumerable:!0,get:h((function(){return v.default}),"get")}),Object.defineProperty(t,"getDistanceFromLine",{enumerable:!0,get:h((function(){return y.default}),"get")}),Object.defineProperty(t,"getGreatCircleBearing",{enumerable:!0,get:h((function(){return _.default}),"get")}),Object.defineProperty(t,"getLatitude",{enumerable:!0,get:h((function(){return x.default}),"get")}),Object.defineProperty(t,"getLongitude",{enumerable:!0,get:h((function(){return b.default}),"get")}),Object.defineProperty(t,"getPathLength",{enumerable:!0,get:h((function(){return w.default}),"get")}),Object.defineProperty(t,"getPreciseDistance",{enumerable:!0,get:h((function(){return M.default}),"get")}),Object.defineProperty(t,"getRhumbLineBearing",{enumerable:!0,get:h((function(){return E.default}),"get")}),Object.defineProperty(t,"getRoughCompassDirection",{enumerable:!0,get:h((function(){return T.default}),"get")}),Object.defineProperty(t,"getSpeed",{enumerable:!0,get:h((function(){return S.default}),"get")}),Object.defineProperty(t,"isDecimal",{enumerable:!0,get:h((function(){return q.default}),"get")}),Object.defineProperty(t,"isPointInLine",{enumerable:!0,get:h((function(){return A.default}),"get")}),Object.defineProperty(t,"isPointInPolygon",{enumerable:!0,get:h((function(){return C.default}),"get")}),Object.defineProperty(t,"isPointNearLine",{enumerable:!0,get:h((function(){return L.default}),"get")}),Object.defineProperty(t,"isPointWithinRadius",{enumerable:!0,get:h((function(){return I.default}),"get")}),Object.defineProperty(t,"isSexagesimal",{enumerable:!0,get:h((function(){return R.default}),"get")}),Object.defineProperty(t,"isValidCoordinate",{enumerable:!0,get:h((function(){return N.default}),"get")}),Object.defineProperty(t,"isValidLatitude",{enumerable:!0,get:h((function(){return O.default}),"get")}),Object.defineProperty(t,"isValidLongitude",{enumerable:!0,get:h((function(){return D.default}),"get")}),Object.defineProperty(t,"orderByDistance",{enumerable:!0,get:h((function(){return B.default}),"get")}),Object.defineProperty(t,"sexagesimalToDecimal",{enumerable:!0,get:h((function(){return k.default}),"get")}),Object.defineProperty(t,"toDecimal",{enumerable:!0,get:h((function(){return F.default}),"get")}),Object.defineProperty(t,"toRad",{enumerable:!0,get:h((function(){return z.default}),"get")}),Object.defineProperty(t,"toDeg",{enumerable:!0,get:h((function(){return U.default}),"get")}),Object.defineProperty(t,"wktToPolygon",{enumerable:!0,get:h((function(){return H.default}),"get")});var i=G(h_()),n=G(d_()),r=G(p_()),s=G(f_()),a=G(y_()),o=G(b_()),l=G(T_()),u=G(x2()),c=G(S_()),d=G(P_()),p=G(C_()),m=G(R_()),f=G(Au()),g=G(Tf()),v=G(Ks()),y=G(M2()),_=G(F_()),x=G(Ii()),b=G(Li()),w=G(z_()),M=G(G_()),E=G(_2()),T=G(j_()),S=G(W_()),q=G(qu()),A=G(X_()),C=G(Z_()),L=G(J_()),I=G($_()),R=G(Pu()),N=G(u2()),O=G(a2()),D=G(l2()),B=G(g2()),k=G(Cu()),F=G(Pf()),z=G(gr()),U=G(Ya()),H=G(Q_()),V=Rn();function G(t){return t&&t.__esModule?t:{default:t}}Object.keys(V).forEach((function(i){"default"===i||"__esModule"===i||Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(t,i,{enumerable:!0,get:h((function(){return V[i]}),"get")})})),h(G,"_interopRequireDefault")})),io=Xe(((t,e)=>{P();var i=h((function(){this._tweens={},this._tweensAddedDuringUpdate={}}),"_Group");i.prototype={getAll:function(){return Object.keys(this._tweens).map(function(t){return this._tweens[t]}.bind(this))},removeAll:function(){this._tweens={}},add:function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},remove:function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},update:function(t,e){var i=Object.keys(this._tweens);if(0===i.length)return!1;for(t=void 0!==t?t:r.now();i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var s=this._tweens[i[n]];s&&!1===s.update(t)&&(s._isPlaying=!1,e||delete this._tweens[i[n]])}i=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var n,r=new i;r.Group=i,r._nextId=0,r.nextId=function(){return r._nextId++},"undefined"==typeof self&&void 0!==j&&j.hrtime?r.now=function(){var t=j.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?r.now=self.performance.now.bind(self.performance):void 0!==Date.now?r.now=Date.now:r.now=function(){return(new Date).getTime()},r.Tween=function(t,e){this._object=t,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=r.Easing.Linear.None,this._interpolationFunction=r.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=e||r,this._id=r.nextId()},r.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(t,e){return this._valuesEnd=t,void 0!==e&&(this._duration=e),this},duration:h((function(t){return this._duration=t,this}),"duration"),start:function(t){for(var e in this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==t?"string"==typeof t?r.now()+parseFloat(t):t:r.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[e]instanceof Array){if(0===this._valuesEnd[e].length)continue;this._valuesEnd[e]=[this._object[e]].concat(this._valuesEnd[e])}void 0!==this._object[e]&&(this._valuesStart[e]=this._object[e],this._valuesStart[e]instanceof Array||(this._valuesStart[e]*=1),this._valuesStartRepeat[e]=this._valuesStart[e]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(1/0),this},stopChainedTweens:function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop()},group:function(t){return this._group=t,this},delay:function(t){return this._delayTime=t,this},repeat:function(t){return this._repeat=t,this},repeatDelay:function(t){return this._repeatDelayTime=t,this},yoyo:function(t){return this._yoyo=t,this},easing:function(t){return this._easingFunction=t,this},interpolation:function(t){return this._interpolationFunction=t,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(t){return this._onStartCallback=t,this},onUpdate:function(t){return this._onUpdateCallback=t,this},onRepeat:h((function(t){return this._onRepeatCallback=t,this}),"onRepeat"),onComplete:function(t){return this._onCompleteCallback=t,this},onStop:function(t){return this._onStopCallback=t,this},update:function(t){var e,i,n;if(t<this._startTime)return!0;for(e in!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),i=(t-this._startTime)/this._duration,i=0===this._duration||i>1?1:i,n=this._easingFunction(i),this._valuesEnd)if(void 0!==this._valuesStart[e]){var r=this._valuesStart[e]||0,s=this._valuesEnd[e];s instanceof Array?this._object[e]=this._interpolationFunction(s,n):("string"==typeof s&&(s="+"===s.charAt(0)||"-"===s.charAt(0)?r+parseFloat(s):parseFloat(s)),"number"==typeof s&&(this._object[e]=r+(s-r)*n))}if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(this._repeat>0){for(e in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat){if("string"==typeof this._valuesEnd[e]&&(this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(this._valuesEnd[e])),this._yoyo){var a=this._valuesStartRepeat[e];this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=a}this._valuesStart[e]=this._valuesStartRepeat[e]}return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,null!==this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}null!==this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var o=0,l=this._chainedTweens.length;o<l;o++)this._chainedTweens[o].start(this._startTime+this._duration);return!1}return!0}},r.Easing={Linear:{None:function(t){return t}},Quadratic:{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:{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:{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:{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:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{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:{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:{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:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--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:{In:function(t){return 1-r.Easing.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*r.Easing.Bounce.In(2*t):.5*r.Easing.Bounce.Out(2*t-1)+.5}}},r.Interpolation={Linear:function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n),a=r.Interpolation.Utils.Linear;return e<0?a(t[0],t[1],n):e>1?a(t[i],t[i-1],i-n):a(t[s],t[s+1>i?i:s+1],n-s)},Bezier:function(t,e){for(var i=0,n=t.length-1,s=Math.pow,a=r.Interpolation.Utils.Bernstein,o=0;o<=n;o++)i+=s(1-e,n-o)*s(e,o)*t[o]*a(n,o);return i},CatmullRom:function(t,e){var i=t.length-1,n=i*e,s=Math.floor(n),a=r.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(s=Math.floor(n=i*(1+e))),a(t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i],n-s)):e<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):e>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):a(t[s?s-1:0],t[s],t[i<s+1?i:s+1],t[i<s+2?i:s+2],n-s)},Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var i=r.Interpolation.Utils.Factorial;return i(t)/i(e)/i(t-e)},Factorial:(n=[1],function(t){var e=1;if(n[t])return n[t];for(var i=t;i>1;i--)e*=i;return n[t]=e,e}),CatmullRom:function(t,e,i,n,r){var s=.5*(i-t),a=.5*(n-e),o=r*r;return(2*e-2*i+s+a)*(r*o)+(-3*e+3*i-2*s-a)*o+s*r+e}}},function(i){"function"==typeof define&&define.amd?define([],(function(){return r})):void 0!==e&&"object"==typeof t?e.exports=r:void 0!==i&&(i.TWEEN=r)}(t)})),p0=Xe(((t,e)=>{P();var i="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",s="[object Function]",a="[object Object]",o=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[r]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[s]=u["[object Map]"]=u["[object Number]"]=u[a]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,p=c||d||Function("return this")(),m="object"==typeof t&&t&&!t.nodeType&&t,f=m&&"object"==typeof e&&e&&!e.nodeType&&e,g=f&&f.exports===m,v=g&&c.process,y=function(){try{return f&&f.require&&f.require("util").types||v&&v.binding&&v.binding("util")}catch(t){}}(),_=y&&y.isTypedArray;function x(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}function b(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}function w(t){return function(e){return t(e)}}function M(t,e){return null==t?void 0:t[e]}function E(t,e){return function(i){return t(e(i))}}h(x,"apply"),h(b,"baseTimes"),h(w,"baseUnary"),h(M,"getValue"),h(E,"overArg");var T,S=Array.prototype,q=Function.prototype,A=Object.prototype,C=p["__core-js_shared__"],L=q.toString,I=A.hasOwnProperty,R=(T=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+T:"",N=A.toString,O=L.call(Object),D=RegExp("^"+L.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),B=g?p.Buffer:void 0,k=p.Symbol,F=p.Uint8Array,z=B?B.allocUnsafe:void 0,U=E(Object.getPrototypeOf,Object),H=Object.create,V=A.propertyIsEnumerable,G=S.splice,W=k?k.toStringTag:void 0,j=function(){try{var t=Xt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),X=B?B.isBuffer:void 0,Y=Math.max,Z=Date.now,J=Xt(p,"Map"),Q=Xt(Object,"create"),K=function(){function t(){}return h(t,"object"),function(e){if(!ge(e))return{};if(H)return H(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();function $(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function tt(){this.__data__=Q?Q(null):{},this.size=0}function et(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function it(t){var e=this.__data__;if(Q){var n=e[t];return n===i?void 0:n}return I.call(e,t)?e[t]:void 0}function nt(t){var e=this.__data__;return Q?void 0!==e[t]:I.call(e,t)}function rt(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Q&&void 0===e?i:e,this}function st(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function at(){this.__data__=[],this.size=0}function ot(t){var e=this.__data__,i=St(e,t);return!(i<0)&&(i==e.length-1?e.pop():G.call(e,i,1),--this.size,!0)}function lt(t){var e=this.__data__,i=St(e,t);return i<0?void 0:e[i][1]}function ht(t){return St(this.__data__,t)>-1}function ut(t,e){var i=this.__data__,n=St(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}function ct(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}function dt(){this.size=0,this.__data__={hash:new $,map:new(J||st),string:new $}}function pt(t){var e=jt(this,t).delete(t);return this.size-=e?1:0,e}function mt(t){return jt(this,t).get(t)}function ft(t){return jt(this,t).has(t)}function gt(t,e){var i=jt(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this}function vt(t){var e=this.__data__=new st(t);this.size=e.size}function yt(){this.__data__=new st,this.size=0}function _t(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}function xt(t){return this.__data__.get(t)}function bt(t){return this.__data__.has(t)}function wt(t,e){var i=this.__data__;if(i instanceof st){var n=i.__data__;if(!J||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new ct(n)}return i.set(t,e),this.size=i.size,this}function Mt(t,e){var i=ue(t),n=!i&&he(t),r=!i&&!n&&pe(t),s=!i&&!n&&!r&&_e(t),a=i||n||r||s,o=a?b(t.length,String):[],l=o.length;for(var h in t)(e||I.call(t,h))&&(!a||!("length"==h||r&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||Jt(h,l)))&&o.push(h);return o}function Et(t,e,i){(void 0!==i&&!le(t[e],i)||void 0===i&&!(e in t))&&qt(t,e,i)}function Tt(t,e,i){var n=t[e];(!I.call(t,e)||!le(n,i)||void 0===i&&!(e in t))&&qt(t,e,i)}function St(t,e){for(var i=t.length;i--;)if(le(t[i][0],e))return i;return-1}function qt(t,e,i){"__proto__"==e&&j?j(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}h($,"Hash"),h(tt,"hashClear"),h(et,"hashDelete"),h(it,"hashGet"),h(nt,"hashHas"),h(rt,"hashSet"),$.prototype.clear=tt,$.prototype.delete=et,$.prototype.get=it,$.prototype.has=nt,$.prototype.set=rt,h(st,"ListCache"),h(at,"listCacheClear"),h(ot,"listCacheDelete"),h(lt,"listCacheGet"),h(ht,"listCacheHas"),h(ut,"listCacheSet"),st.prototype.clear=at,st.prototype.delete=ot,st.prototype.get=lt,st.prototype.has=ht,st.prototype.set=ut,h(ct,"MapCache"),h(dt,"mapCacheClear"),h(pt,"mapCacheDelete"),h(mt,"mapCacheGet"),h(ft,"mapCacheHas"),h(gt,"mapCacheSet"),ct.prototype.clear=dt,ct.prototype.delete=pt,ct.prototype.get=mt,ct.prototype.has=ft,ct.prototype.set=gt,h(vt,"Stack"),h(yt,"stackClear"),h(_t,"stackDelete"),h(xt,"stackGet"),h(bt,"stackHas"),h(wt,"stackSet"),vt.prototype.clear=yt,vt.prototype.delete=_t,vt.prototype.get=xt,vt.prototype.has=bt,vt.prototype.set=wt,h(Mt,"arrayLikeKeys"),h(Et,"assignMergeValue"),h(Tt,"assignValue"),h(St,"assocIndexOf"),h(qt,"baseAssignValue");var Pt=Gt();function At(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":W&&W in Object(t)?Yt(t):ie(t)}function Ct(t){return ve(t)&&At(t)==r}function Lt(t){return!(!ge(t)||$t(t))&&(me(t)?D:o).test(oe(t))}function It(t){return ve(t)&&fe(t.length)&&!!u[At(t)]}function Rt(t){if(!ge(t))return ee(t);var e=te(t),i=[];for(var n in t)"constructor"==n&&(e||!I.call(t,n))||i.push(n);return i}function Nt(t,e,i,n,r){t!==e&&Pt(e,(function(s,a){if(r||(r=new vt),ge(s))Ot(t,e,a,i,Nt,n,r);else{var o=n?n(re(t,a),s,a+"",t,e,r):void 0;void 0===o&&(o=s),Et(t,a,o)}}),we)}function Ot(t,e,i,n,r,s,a){var o=re(t,i),l=re(e,i),h=a.get(l);if(h)Et(t,i,h);else{var u=s?s(o,l,i+"",t,e,a):void 0,c=void 0===u;if(c){var d=ue(l),p=!d&&pe(l),m=!d&&!p&&_e(l);u=l,d||p||m?ue(o)?u=o:de(o)?u=Ut(o):p?(c=!1,u=kt(l,!0)):m?(c=!1,u=zt(l,!0)):u=[]:ye(l)||he(l)?(u=o,he(o)?u=xe(o):(!ge(o)||me(o))&&(u=Zt(l))):c=!1}c&&(a.set(l,u),r(u,l,n,s,a),a.delete(l)),Et(t,i,u)}}function Dt(t,e){return se(ne(t,e,Te),t+"")}h(At,"baseGetTag"),h(Ct,"baseIsArguments"),h(Lt,"baseIsNative"),h(It,"baseIsTypedArray"),h(Rt,"baseKeysIn"),h(Nt,"baseMerge"),h(Ot,"baseMergeDeep"),h(Dt,"baseRest");var Bt=j?function(t,e){return j(t,"toString",{configurable:!0,enumerable:!1,value:Ee(e),writable:!0})}:Te;function kt(t,e){if(e)return t.slice();var i=t.length,n=z?z(i):new t.constructor(i);return t.copy(n),n}function Ft(t){var e=new t.constructor(t.byteLength);return new F(e).set(new F(t)),e}function zt(t,e){var i=e?Ft(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function Ut(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e}function Ht(t,e,i,n){var r=!i;i||(i={});for(var s=-1,a=e.length;++s<a;){var o=e[s],l=n?n(i[o],t[o],o,i,t):void 0;void 0===l&&(l=t[o]),r?qt(i,o,l):Tt(i,o,l)}return i}function Vt(t){return Dt((function(e,i){var n=-1,r=i.length,s=r>1?i[r-1]:void 0,a=r>2?i[2]:void 0;for(s=t.length>3&&"function"==typeof s?(r--,s):void 0,a&&Qt(i[0],i[1],a)&&(s=r<3?void 0:s,r=1),e=Object(e);++n<r;){var o=i[n];o&&t(e,o,n,s)}return e}))}function Gt(t){return function(e,i,n){for(var r=-1,s=Object(e),a=n(e),o=a.length;o--;){var l=a[t?o:++r];if(!1===i(s[l],l,s))break}return e}}function Wt(t,e,i,n,r,s){return ge(t)&&ge(e)&&(s.set(e,t),Nt(t,e,void 0,Wt,s),s.delete(e)),t}function jt(t,e){var i=t.__data__;return Kt(e)?i["string"==typeof e?"string":"hash"]:i.map}function Xt(t,e){var i=M(t,e);return Lt(i)?i:void 0}function Yt(t){var e=I.call(t,W),i=t[W];try{t[W]=void 0;var n=!0}catch(t){}var r=N.call(t);return n&&(e?t[W]=i:delete t[W]),r}function Zt(t){return"function"!=typeof t.constructor||te(t)?{}:K(U(t))}function Jt(t,e){var i=typeof t;return!!(e=null==e?n:e)&&("number"==i||"symbol"!=i&&l.test(t))&&t>-1&&t%1==0&&t<e}function Qt(t,e,i){if(!ge(i))return!1;var n=typeof e;return!!("number"==n?ce(i)&&Jt(e,i.length):"string"==n&&e in i)&&le(i[e],t)}function Kt(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function $t(t){return!!R&&R in t}function te(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||A)}function ee(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}function ie(t){return N.call(t)}function ne(t,e,i){return e=Y(void 0===e?t.length-1:e,0),function(){for(var n=arguments,r=-1,s=Y(n.length-e,0),a=Array(s);++r<s;)a[r]=n[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=n[r];return o[e]=i(a),x(t,this,o)}}function re(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}h(kt,"cloneBuffer"),h(Ft,"cloneArrayBuffer"),h(zt,"cloneTypedArray"),h(Ut,"copyArray"),h(Ht,"copyObject"),h(Vt,"createAssigner"),h(Gt,"createBaseFor"),h(Wt,"customDefaultsMerge"),h(jt,"getMapData"),h(Xt,"getNative"),h(Yt,"getRawTag"),h(Zt,"initCloneObject"),h(Jt,"isIndex"),h(Qt,"isIterateeCall"),h(Kt,"isKeyable"),h($t,"isMasked"),h(te,"isPrototype"),h(ee,"nativeKeysIn"),h(ie,"objectToString"),h(ne,"overRest"),h(re,"safeGet");var se=ae(Bt);function ae(t){var e=0,i=0;return function(){var n=Z(),r=16-(n-i);if(i=n,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function oe(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function le(t,e){return t===e||t!=t&&e!=e}h(ae,"shortOut"),h(oe,"toSource"),h(le,"eq");var he=Ct(function(){return arguments}())?Ct:function(t){return ve(t)&&I.call(t,"callee")&&!V.call(t,"callee")},ue=Array.isArray;function ce(t){return null!=t&&fe(t.length)&&!me(t)}function de(t){return ve(t)&&ce(t)}h(ce,"isArrayLike"),h(de,"isArrayLikeObject");var pe=X||Se;function me(t){if(!ge(t))return!1;var e=At(t);return e==s||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function fe(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function ge(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ve(t){return null!=t&&"object"==typeof t}function ye(t){if(!ve(t)||At(t)!=a)return!1;var e=U(t);if(null===e)return!0;var i=I.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&L.call(i)==O}h(me,"isFunction"),h(fe,"isLength"),h(ge,"isObject"),h(ve,"isObjectLike"),h(ye,"isPlainObject");var _e=_?w(_):It;function xe(t){return Ht(t,we(t))}h(xe,"toPlainObject");var be=Dt((function(t){return t.push(void 0,Wt),x(Me,void 0,t)}));function we(t){return ce(t)?Mt(t,!0):Rt(t)}h(we,"keysIn");var Me=Vt((function(t,e,i,n){Nt(t,e,i,n)}));function Ee(t){return function(){return t}}function Te(t){return t}function Se(){return!1}h(Ee,"constant"),h(Te,"identity"),h(Se,"stubFalse"),e.exports=be})),C5=Xe(((t,e)=>{P(),function(t){var i=/^\s+/,n=/\s+$/,r=0,s=t.round,a=t.min,o=t.max,l=t.random;function u(t,e){if(e=e||{},(t=t||"")instanceof u)return t;if(!(this instanceof u))return new u(t,e);var i=c(t);this._originalInput=t,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=s(100*this._a)/100,this._format=e.format||i.format,this._gradientType=e.gradientType,this._r<1&&(this._r=s(this._r)),this._g<1&&(this._g=s(this._g)),this._b<1&&(this._b=s(this._b)),this._ok=i.ok,this._tc_id=r++}function c(t){var e={r:0,g:0,b:0},i=1,n=null,r=null,s=null,l=!1,h=!1;return"string"==typeof t&&(t=Q(t)),"object"==typeof t&&(J(t.r)&&J(t.g)&&J(t.b)?(e=d(t.r,t.g,t.b),l=!0,h="%"===String(t.r).substr(-1)?"prgb":"rgb"):J(t.h)&&J(t.s)&&J(t.v)?(n=V(t.s),r=V(t.v),e=g(t.h,n,r),l=!0,h="hsv"):J(t.h)&&J(t.s)&&J(t.l)&&(n=V(t.s),s=V(t.l),e=m(t.h,n,s),l=!0,h="hsl"),t.hasOwnProperty("a")&&(i=t.a)),i=D(i),{ok:l,format:t.format||h,r:a(255,o(e.r,0)),g:a(255,o(e.g,0)),b:a(255,o(e.b,0)),a:i}}function d(t,e,i){return{r:255*B(t,255),g:255*B(e,255),b:255*B(i,255)}}function p(t,e,i){t=B(t,255),e=B(e,255),i=B(i,255);var n,r,s=o(t,e,i),l=a(t,e,i),h=(s+l)/2;if(s==l)n=r=0;else{var u=s-l;switch(r=h>.5?u/(2-s-l):u/(s+l),s){case t:n=(e-i)/u+(e<i?6:0);break;case e:n=(i-t)/u+2;break;case i:n=(t-e)/u+4}n/=6}return{h:n,s:r,l:h}}function m(t,e,i){var n,r,s;function a(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}if(t=B(t,360),e=B(e,100),i=B(i,100),h(a,"hue2rgb"),0===e)n=r=s=i;else{var o=i<.5?i*(1+e):i+e-i*e,l=2*i-o;n=a(l,o,t+1/3),r=a(l,o,t),s=a(l,o,t-1/3)}return{r:255*n,g:255*r,b:255*s}}function f(t,e,i){t=B(t,255),e=B(e,255),i=B(i,255);var n,r,s=o(t,e,i),l=a(t,e,i),h=s,u=s-l;if(r=0===s?0:u/s,s==l)n=0;else{switch(s){case t:n=(e-i)/u+(e<i?6:0);break;case e:n=(i-t)/u+2;break;case i:n=(t-e)/u+4}n/=6}return{h:n,s:r,v:h}}function g(e,i,n){e=6*B(e,360),i=B(i,100),n=B(n,100);var r=t.floor(e),s=e-r,a=n*(1-i),o=n*(1-s*i),l=n*(1-(1-s)*i),h=r%6;return{r:255*[n,o,a,a,l,n][h],g:255*[l,n,n,o,a,a][h],b:255*[a,a,l,n,n,o][h]}}function v(t,e,i,n){var r=[H(s(t).toString(16)),H(s(e).toString(16)),H(s(i).toString(16))];return n&&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 y(t,e,i,n,r){var a=[H(s(t).toString(16)),H(s(e).toString(16)),H(s(i).toString(16)),H(G(n))];return r&&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)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function _(t,e,i,n){return[H(G(n)),H(s(t).toString(16)),H(s(e).toString(16)),H(s(i).toString(16))].join("")}function x(t,e){e=0===e?0:e||10;var i=u(t).toHsl();return i.s-=e/100,i.s=k(i.s),u(i)}function b(t,e){e=0===e?0:e||10;var i=u(t).toHsl();return i.s+=e/100,i.s=k(i.s),u(i)}function w(t){return u(t).desaturate(100)}function M(t,e){e=0===e?0:e||10;var i=u(t).toHsl();return i.l+=e/100,i.l=k(i.l),u(i)}function E(t,e){e=0===e?0:e||10;var i=u(t).toRgb();return i.r=o(0,a(255,i.r-s(-e/100*255))),i.g=o(0,a(255,i.g-s(-e/100*255))),i.b=o(0,a(255,i.b-s(-e/100*255))),u(i)}function T(t,e){e=0===e?0:e||10;var i=u(t).toHsl();return i.l-=e/100,i.l=k(i.l),u(i)}function S(t,e){var i=u(t).toHsl(),n=(i.h+e)%360;return i.h=n<0?360+n:n,u(i)}function q(t){var e=u(t).toHsl();return e.h=(e.h+180)%360,u(e)}function P(t){var e=u(t).toHsl(),i=e.h;return[u(t),u({h:(i+120)%360,s:e.s,l:e.l}),u({h:(i+240)%360,s:e.s,l:e.l})]}function A(t){var e=u(t).toHsl(),i=e.h;return[u(t),u({h:(i+90)%360,s:e.s,l:e.l}),u({h:(i+180)%360,s:e.s,l:e.l}),u({h:(i+270)%360,s:e.s,l:e.l})]}function C(t){var e=u(t).toHsl(),i=e.h;return[u(t),u({h:(i+72)%360,s:e.s,l:e.l}),u({h:(i+216)%360,s:e.s,l:e.l})]}function L(t,e,i){e=e||6,i=i||30;var n=u(t).toHsl(),r=360/i,s=[u(t)];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,s.push(u(n));return s}function I(t,e){e=e||6;for(var i=u(t).toHsv(),n=i.h,r=i.s,s=i.v,a=[],o=1/e;e--;)a.push(u({h:n,s:r,v:s})),s=(s+o)%1;return a}h(u,"tinycolor"),u.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 e,i,n,r=this.toRgb();return e=r.r/255,i=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:t.pow((i+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=D(t),this._roundA=s(100*this._a)/100,this},toHsv:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=f(this._r,this._g,this._b),e=s(360*t.h),i=s(100*t.s),n=s(100*t.v);return 1==this._a?"hsv("+e+", "+i+"%, "+n+"%)":"hsva("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=s(360*t.h),i=s(100*t.s),n=s(100*t.l);return 1==this._a?"hsl("+e+", "+i+"%, "+n+"%)":"hsla("+e+", "+i+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return v(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return y(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:s(this._r),g:s(this._g),b:s(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+s(this._r)+", "+s(this._g)+", "+s(this._b)+")":"rgba("+s(this._r)+", "+s(this._g)+", "+s(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:s(100*B(this._r,255))+"%",g:s(100*B(this._g,255))+"%",b:s(100*B(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+s(100*B(this._r,255))+"%, "+s(100*B(this._g,255))+"%, "+s(100*B(this._b,255))+"%)":"rgba("+s(100*B(this._r,255))+"%, "+s(100*B(this._g,255))+"%, "+s(100*B(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(N[v(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+_(this._r,this._g,this._b,this._a),i=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var r=u(t);i="#"+_(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+i+")"},toString:function(t){var e=!!t;t=t||this._format;var i=!1,n=this._a<1&&this._a>=0;return!e&&n&&("hex"===t||"hex6"===t||"hex3"===t||"hex4"===t||"hex8"===t||"name"===t)?"name"===t&&0===this._a?this.toName():this.toRgbString():("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),("hex"===t||"hex6"===t)&&(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex4"===t&&(i=this.toHex8String(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),"hsv"===t&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return u(this.toString())},_applyModification:function(t,e){var i=t.apply(null,[this].concat([].slice.call(e)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(E,arguments)},darken:function(){return this._applyModification(T,arguments)},desaturate:function(){return this._applyModification(x,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(w,arguments)},spin:function(){return this._applyModification(S,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(q,arguments)},monochromatic:function(){return this._applyCombination(I,arguments)},splitcomplement:function(){return this._applyCombination(C,arguments)},triad:function(){return this._applyCombination(P,arguments)},tetrad:function(){return this._applyCombination(A,arguments)}},u.fromRatio=function(t,e){if("object"==typeof t){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]="a"===n?t[n]:V(t[n]));t=i}return u(t,e)},h(c,"inputToRGB"),h(d,"rgbToRgb"),h(p,"rgbToHsl"),h(m,"hslToRgb"),h(f,"rgbToHsv"),h(g,"hsvToRgb"),h(v,"rgbToHex"),h(y,"rgbaToHex"),h(_,"rgbaToArgbHex"),u.equals=function(t,e){return!(!t||!e)&&u(t).toRgbString()==u(e).toRgbString()},u.random=function(){return u.fromRatio({r:l(),g:l(),b:l()})},h(x,"desaturate"),h(b,"saturate"),h(w,"greyscale"),h(M,"lighten"),h(E,"brighten"),h(T,"darken"),h(S,"spin"),h(q,"complement"),h(P,"triad"),h(A,"tetrad"),h(C,"splitcomplement"),h(L,"analogous"),h(I,"monochromatic"),u.mix=function(t,e,i){i=0===i?0:i||50;var n=u(t).toRgb(),r=u(e).toRgb(),s=i/100;return u({r:(r.r-n.r)*s+n.r,g:(r.g-n.g)*s+n.g,b:(r.b-n.b)*s+n.b,a:(r.a-n.a)*s+n.a})},u.readability=function(e,i){var n=u(e),r=u(i);return(t.max(n.getLuminance(),r.getLuminance())+.05)/(t.min(n.getLuminance(),r.getLuminance())+.05)},u.isReadable=function(t,e,i){var n,r,s=u.readability(t,e);switch(r=!1,(n=K(i)).level+n.size){case"AAsmall":case"AAAlarge":r=s>=4.5;break;case"AAlarge":r=s>=3;break;case"AAAsmall":r=s>=7}return r},u.mostReadable=function(t,e,i){var n,r,s,a,o=null,l=0;r=(i=i||{}).includeFallbackColors,s=i.level,a=i.size;for(var h=0;h<e.length;h++)(n=u.readability(t,e[h]))>l&&(l=n,o=u(e[h]));return u.isReadable(t,o,{level:s,size:a})||!r?o:(i.includeFallbackColors=!1,u.mostReadable(t,["#fff","#000"],i))};var R=u.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"},N=u.hexNames=O(R);function O(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[t[i]]=i);return e}function D(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function B(e,i){z(e)&&(e="100%");var n=U(e);return e=a(i,o(0,parseFloat(e))),n&&(e=parseInt(e*i,10)/100),t.abs(e-i)<1e-6?1:e%i/parseFloat(i)}function k(t){return a(1,o(0,t))}function F(t){return parseInt(t,16)}function z(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function U(t){return"string"==typeof t&&-1!=t.indexOf("%")}function H(t){return 1==t.length?"0"+t:""+t}function V(t){return t<=1&&(t=100*t+"%"),t}function G(e){return t.round(255*parseFloat(e)).toString(16)}function W(t){return F(t)/255}h(O,"flip"),h(D,"boundAlpha"),h(B,"bound01"),h(k,"clamp01"),h(F,"parseIntFromHex"),h(z,"isOnePointZero"),h(U,"isPercentage"),h(H,"pad2"),h(V,"convertToPercentage"),h(G,"convertDecimalToHex"),h(W,"convertHexToDecimal");var j,X,Y,Z=(X="[\\s|\\(]+("+(j="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",Y="[\\s|\\(]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",{CSS_UNIT:new RegExp(j),rgb:new RegExp("rgb"+X),rgba:new RegExp("rgba"+Y),hsl:new RegExp("hsl"+X),hsla:new RegExp("hsla"+Y),hsv:new RegExp("hsv"+X),hsva:new RegExp("hsva"+Y),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 J(t){return!!Z.CSS_UNIT.exec(t)}function Q(t){t=t.replace(i,"").replace(n,"").toLowerCase();var e,r=!1;if(R[t])t=R[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=Z.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=Z.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=Z.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=Z.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=Z.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=Z.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=Z.hex8.exec(t))?{r:F(e[1]),g:F(e[2]),b:F(e[3]),a:W(e[4]),format:r?"name":"hex8"}:(e=Z.hex6.exec(t))?{r:F(e[1]),g:F(e[2]),b:F(e[3]),format:r?"name":"hex"}:(e=Z.hex4.exec(t))?{r:F(e[1]+""+e[1]),g:F(e[2]+""+e[2]),b:F(e[3]+""+e[3]),a:W(e[4]+""+e[4]),format:r?"name":"hex8"}:!!(e=Z.hex3.exec(t))&&{r:F(e[1]+""+e[1]),g:F(e[2]+""+e[2]),b:F(e[3]+""+e[3]),format:r?"name":"hex"}}function K(t){var e,i;return"AA"!==(e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==e&&(e="AA"),"small"!==(i=(t.size||"small").toLowerCase())&&"large"!==i&&(i="small"),{level:e,size:i}}h(J,"isValidCSSUnit"),h(Q,"stringInputToObject"),h(K,"validateWCAG2Parms"),void 0!==e&&e.exports?e.exports=u:"function"==typeof define&&define.amd?define((function(){return u})):window.tinycolor=u}(Math)})),W5=Xe(((t,e)=>{"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}P(),h(i,"_classCallCheck"),h(n,"_defineProperties"),h(r,"_createClass");var s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.R,r=void 0===n?1:n,s=e.Q,a=void 0===s?1:s,o=e.A,l=void 0===o?1:o,h=e.B,u=void 0===h?0:h,c=e.C,d=void 0===c?1:c;i(this,t),this.R=r,this.Q=a,this.A=l,this.C=d,this.B=u,this.cov=NaN,this.x=NaN}return h(t,"KalmanFilter"),r(t,[{key:"filter",value:h((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(isNaN(this.x))this.x=1/this.C*t,this.cov=1/this.C*this.Q*(1/this.C);else{var i=this.predict(e),n=this.uncertainty(),r=n*this.C*(1/(this.C*n*this.C+this.Q));this.x=i+r*(t-this.C*i),this.cov=n-r*this.C*n}return this.x}),"filter")},{key:"predict",value:h((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.A*this.x+this.B*t}),"predict")},{key:"uncertainty",value:h((function(){return this.A*this.cov*this.A+this.R}),"uncertainty")},{key:"lastMeasurement",value:h((function(){return this.x}),"lastMeasurement")},{key:"setMeasurementNoise",value:h((function(t){this.Q=t}),"setMeasurementNoise")},{key:"setProcessNoise",value:h((function(t){this.R=t}),"setProcessNoise")}]),t}();e.exports=s})),jb=Xe(((t,e)=>{P(),function(){"use strict";function t(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}function i(t,e,i){var n=e.x,r=e.y,s=i.x-n,a=i.y-r;if(0!==s||0!==a){var o=((t.x-n)*s+(t.y-r)*a)/(s*s+a*a);o>1?(n=i.x,r=i.y):o>0&&(n+=s*o,r+=a*o)}return(s=t.x-n)*s+(a=t.y-r)*a}function n(e,i){for(var n,r=e[0],s=[r],a=1,o=e.length;a<o;a++)t(n=e[a],r)>i&&(s.push(n),r=n);return r!==n&&s.push(n),s}function r(t,e,n,s,a){for(var o,l=s,h=e+1;h<n;h++){var u=i(t[h],t[e],t[n]);u>l&&(o=h,l=u)}l>s&&(o-e>1&&r(t,e,o,s,a),a.push(t[o]),n-o>1&&r(t,o,n,s,a))}function s(t,e){var i=t.length-1,n=[t[0]];return r(t,0,i,e,n),n.push(t[i]),n}function a(t,e,i){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=s(t=i?t:n(t,r),r)}h(t,"getSqDist"),h(i,"getSqSegDist"),h(n,"simplifyRadialDist"),h(r,"simplifyDPStep"),h(s,"simplifyDouglasPeucker"),h(a,"simplify"),"function"==typeof define&&define.amd?define((function(){return a})):void 0!==e?(e.exports=a,e.exports.default=a):"undefined"!=typeof self?self.simplify=a:window.simplify=a}()})),Qb=Xe(((t,e)=>{"use strict";P(),e.exports=h((function(t){if(!Array.isArray(t))throw new TypeError("array-unique expects an array.");for(var e=t.length,i=-1;i++<e;)for(var n=i+1;n<t.length;++n)t[i]===t[n]&&t.splice(n--,1);return t}),"unique"),e.exports.immutable=h((function(t){if(!Array.isArray(t))throw new TypeError("array-unique expects an array.");for(var i=t.length,n=new Array(i),r=0;r<i;r++)n[r]=t[r];return e.exports(n)}),"uniqueImmutable")})),qM=Xe(((t,e)=>{var i,n;P(),i=t,n=function(){var t=h((function(){function e(t){return r.appendChild(t.dom),t}function i(t){for(var e=0;e<r.children.length;e++)r.children[e].style.display=e===t?"block":"none";n=t}h(e,"e"),h(i,"u");var n=0,r=document.createElement("div");r.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",r.addEventListener("click",(function(t){t.preventDefault(),i(++n%r.children.length)}),!1);var s=(performance||Date).now(),a=s,o=0,l=e(new t.Panel("FPS","#0ff","#002")),u=e(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=e(new t.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:r,addPanel:e,showPanel:i,begin:function(){s=(performance||Date).now()},end:function(){o++;var t=(performance||Date).now();if(u.update(t-s,200),t>a+1e3&&(l.update(1e3*o/(t-a),100),a=t,o=0,c)){var e=performance.memory;c.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){s=this.end()},domElement:r,setMode:i}}),"f");return t.Panel=function(t,e,i){var n=1/0,r=0,s=Math.round,a=s(window.devicePixelRatio||1),o=80*a,l=48*a,h=3*a,u=2*a,c=3*a,d=15*a,p=74*a,m=30*a,f=document.createElement("canvas");f.width=o,f.height=l,f.style.cssText="width:80px;height:48px";var g=f.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=i,g.fillRect(0,0,o,l),g.fillStyle=e,g.fillText(t,h,u),g.fillRect(c,d,p,m),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(c,d,p,m),{dom:f,update:function(l,v){n=Math.min(n,l),r=Math.max(r,l),g.fillStyle=i,g.globalAlpha=1,g.fillRect(0,0,o,d),g.fillStyle=e,g.fillText(s(l)+" "+t+" ("+s(n)+"-"+s(r)+")",h,u),g.drawImage(f,c+a,d,p-a,m,c,d,p-a,m),g.fillRect(c+p-a,d,a,m),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(c+p-a,d,a,s((1-l/v)*m))}}},t},"object"==typeof t&&void 0!==e?e.exports=n():"function"==typeof define&&define.amd?define(n):i.Stats=n()})),zM=Xe(((t,e)=>{P();var i=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function r(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}function s(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n}h(r,"apply"),h(s,"baseTimes");var a=Object.prototype,o=a.hasOwnProperty,l=a.toString,u=a.propertyIsEnumerable,c=Math.max;function d(t,e){var i=T(t)||E(t)?s(t.length,String):[],n=i.length,r=!!n;for(var a in t)(e||o.call(t,a))&&(!r||"length"!=a&&!_(a,n))&&i.push(a);return i}function p(t,e,i,n){return void 0===t||M(t,a[i])&&!o.call(n,i)?e:t}function m(t,e,i){var n=t[e];(!o.call(t,e)||!M(n,i)||void 0===i&&!(e in t))&&(t[e]=i)}function f(t){if(!L(t))return w(t);var e=b(t),i=[];for(var n in t)"constructor"==n&&(e||!o.call(t,n))||i.push(n);return i}function g(t,e){return e=c(void 0===e?t.length-1:e,0),function(){for(var i=arguments,n=-1,s=c(i.length-e,0),a=Array(s);++n<s;)a[n]=i[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=i[n];return o[e]=a,r(t,this,o)}}function v(t,e,i,n){i||(i={});for(var r=-1,s=e.length;++r<s;){var a=e[r],o=n?n(i[a],t[a],a,i,t):void 0;m(i,a,void 0===o?t[a]:o)}return i}function y(t){return g((function(e,i){var n=-1,r=i.length,s=r>1?i[r-1]:void 0,a=r>2?i[2]:void 0;for(s=t.length>3&&"function"==typeof s?(r--,s):void 0,a&&x(i[0],i[1],a)&&(s=r<3?void 0:s,r=1),e=Object(e);++n<r;){var o=i[n];o&&t(e,o,n,s)}return e}))}function _(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||n.test(t))&&t>-1&&t%1==0&&t<e}function x(t,e,i){if(!L(i))return!1;var n=typeof e;return!!("number"==n?S(i)&&_(e,i.length):"string"==n&&e in i)&&M(i[e],t)}function b(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||a)}function w(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}function M(t,e){return t===e||t!=t&&e!=e}function E(t){return q(t)&&o.call(t,"callee")&&(!u.call(t,"callee")||"[object Arguments]"==l.call(t))}h(d,"arrayLikeKeys"),h(p,"assignInDefaults"),h(m,"assignValue"),h(f,"baseKeysIn"),h(g,"baseRest"),h(v,"copyObject"),h(y,"createAssigner"),h(_,"isIndex"),h(x,"isIterateeCall"),h(b,"isPrototype"),h(w,"nativeKeysIn"),h(M,"eq"),h(E,"isArguments");var T=Array.isArray;function S(t){return null!=t&&C(t.length)&&!A(t)}function q(t){return I(t)&&S(t)}function A(t){var e=L(t)?l.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}function C(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}function L(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function I(t){return!!t&&"object"==typeof t}h(S,"isArrayLike"),h(q,"isArrayLikeObject"),h(A,"isFunction"),h(C,"isLength"),h(L,"isObject"),h(I,"isObjectLike");var R=y((function(t,e,i,n){v(e,O(e),t,n)})),N=g((function(t){return t.push(void 0,p),r(R,void 0,t)}));function O(t){return S(t)?d(t,!0):f(t)}h(O,"keysIn"),e.exports=N})),JM=Xe(((t,e)=>{"use strict";P();var i,n={},r=!1;void 0!==e&&e.exports?(e.exports=n,r=!0):"undefined"!=typeof document?window.ClipperLib=n:self.ClipperLib=n,r?(s="chrome",i="Netscape"):(s=navigator.userAgent.toString().toLowerCase(),i=navigator.appName);var s,a={};-1!=s.indexOf("chrome")&&-1==s.indexOf("chromium")?a.chrome=1:a.chrome=0,-1!=s.indexOf("chromium")?a.chromium=1:a.chromium=0,-1!=s.indexOf("safari")&&-1==s.indexOf("chrome")&&-1==s.indexOf("chromium")?a.safari=1:a.safari=0,-1!=s.indexOf("firefox")?a.firefox=1:a.firefox=0,-1!=s.indexOf("firefox/17")?a.firefox17=1:a.firefox17=0,-1!=s.indexOf("firefox/15")?a.firefox15=1:a.firefox15=0,-1!=s.indexOf("firefox/3")?a.firefox3=1:a.firefox3=0,-1!=s.indexOf("opera")?a.opera=1:a.opera=0,-1!=s.indexOf("msie 10")?a.msie10=1:a.msie10=0,-1!=s.indexOf("msie 9")?a.msie9=1:a.msie9=0,-1!=s.indexOf("msie 8")?a.msie8=1:a.msie8=0,-1!=s.indexOf("msie 7")?a.msie7=1:a.msie7=0,-1!=s.indexOf("msie ")?a.msie=1:a.msie=0,n.biginteger_used=null;var o;function l(t,e,i){n.biginteger_used=1,null!=t&&("number"==typeof t&&void 0===e?this.fromInt(t):"number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function u(){return new l(null)}function c(t,e,i,n,r,s){for(;--s>=0;){var a=e*this[t++]+i[n]+r;r=Math.floor(a/67108864),i[n++]=67108863&a}return r}function d(t,e,i,n,r,s){for(var a=32767&e,o=e>>15;--s>=0;){var l=32767&this[t],h=this[t++]>>15,u=o*l+h*a;r=((l=a*l+((32767&u)<<15)+i[n]+(1073741823&r))>>>30)+(u>>>15)+o*h+(r>>>30),i[n++]=1073741823&l}return r}function p(t,e,i,n,r,s){for(var a=16383&e,o=e>>14;--s>=0;){var l=16383&this[t],h=this[t++]>>14,u=o*l+h*a;r=((l=a*l+((16383&u)<<14)+i[n]+r)>>28)+(u>>14)+o*h,i[n++]=268435455&l}return r}h(l,"BigInteger"),h(u,"nbi"),h(c,"am1"),h(d,"am2"),h(p,"am3"),"Microsoft Internet Explorer"==i?(l.prototype.am=d,o=30):"Netscape"!=i?(l.prototype.am=c,o=26):(l.prototype.am=p,o=28),l.prototype.DB=o,l.prototype.DM=(1<<o)-1,l.prototype.DV=1<<o;l.prototype.FV=Math.pow(2,52),l.prototype.F1=52-o,l.prototype.F2=2*o-52;var m,f,g=new Array;for(m="0".charCodeAt(0),f=0;f<=9;++f)g[m++]=f;for(m="a".charCodeAt(0),f=10;f<36;++f)g[m++]=f;for(m="A".charCodeAt(0),f=10;f<36;++f)g[m++]=f;function v(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function y(t,e){var i=g[t.charCodeAt(e)];return null==i?-1:i}function _(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function x(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function b(t){var e=u();return e.fromInt(t),e}function w(t,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void this.fromRadix(t,e);i=2}this.t=0,this.s=0;for(var n=t.length,r=!1,s=0;--n>=0;){var a=8==i?255&t[n]:y(t,n);a<0?"-"==t.charAt(n)&&(r=!0):(r=!1,0==s?this[this.t++]=a:s+i>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=i)>=this.DB&&(s-=this.DB))}8==i&&128&t[0]&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),r&&l.ZERO.subTo(this,this)}function M(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function E(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var i,n=(1<<e)-1,r=!1,s="",a=this.t,o=this.DB-a*this.DB%e;if(a-- >0)for(o<this.DB&&(i=this[a]>>o)>0&&(r=!0,s=v(i));a>=0;)o<e?(i=(this[a]&(1<<o)-1)<<e-o,i|=this[--a]>>(o+=this.DB-e)):(i=this[a]>>(o-=e)&n,o<=0&&(o+=this.DB,--a)),i>0&&(r=!0),r&&(s+=v(i));return r?s:"0"}function T(){var t=u();return l.ZERO.subTo(this,t),t}function S(){return this.s<0?this.negate():this}function q(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0}function A(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function C(){return this.t<=0?0:this.DB*(this.t-1)+A(this[this.t-1]^this.s&this.DM)}function L(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s}function I(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s}function R(t,e){var i,n=t%this.DB,r=this.DB-n,s=(1<<r)-1,a=Math.floor(t/this.DB),o=this.s<<n&this.DM;for(i=this.t-1;i>=0;--i)e[i+a+1]=this[i]>>r|o,o=(this[i]&s)<<n;for(i=a-1;i>=0;--i)e[i]=0;e[a]=o,e.t=this.t+a+1,e.s=this.s,e.clamp()}function N(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)e.t=0;else{var n=t%this.DB,r=this.DB-n,s=(1<<n)-1;e[0]=this[i]>>n;for(var a=i+1;a<this.t;++a)e[a-i-1]|=(this[a]&s)<<r,e[a-i]=this[a]>>n;n>0&&(e[this.t-i-1]|=(this.s&s)<<r),e.t=this.t-i,e.clamp()}}function O(t,e){for(var i=0,n=0,r=Math.min(t.t,this.t);i<r;)n+=this[i]-t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n-=t[i],e[i++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()}function D(t,e){var i=this.abs(),n=t.abs(),r=i.t;for(e.t=r+n.t;--r>=0;)e[r]=0;for(r=0;r<n.t;++r)e[r+i.t]=i.am(0,n[r],e,r,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&l.ZERO.subTo(e,e)}function B(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var n=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()}function k(t,e,i){var n=t.abs();if(!(n.t<=0)){var r=this.abs();if(r.t<n.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=u());var s=u(),a=this.s,o=t.s,h=this.DB-A(n[n.t-1]);h>0?(n.lShiftTo(h,s),r.lShiftTo(h,i)):(n.copyTo(s),r.copyTo(i));var c=s.t,d=s[c-1];if(0!=d){var p=d*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),m=this.FV/p,f=(1<<this.F1)/p,g=1<<this.F2,v=i.t,y=v-c,_=null==e?u():e;for(s.dlShiftTo(y,_),i.compareTo(_)>=0&&(i[i.t++]=1,i.subTo(_,i)),l.ONE.dlShiftTo(c,_),_.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--y>=0;){var x=i[--v]==d?this.DM:Math.floor(i[v]*m+(i[v-1]+g)*f);if((i[v]+=s.am(0,x,i,y,0,c))<x)for(s.dlShiftTo(y,_),i.subTo(_,i);i[v]<--x;)i.subTo(_,i)}null!=e&&(i.drShiftTo(c,e),a!=o&&l.ZERO.subTo(e,e)),i.t=c,i.clamp(),h>0&&i.rShiftTo(h,i),a<0&&l.ZERO.subTo(i,i)}}}function F(t){var e=u();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(l.ZERO)>0&&t.subTo(e,e),e}function z(t){this.m=t}function U(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function H(t){return t}function V(t){t.divRemTo(this.m,null,t)}function G(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function W(t,e){t.squareTo(e),this.reduce(e)}function j(){if(this.t<1)return 0;var t=this[0];if(!(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e}function X(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function Y(t){var e=u();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(l.ZERO)>0&&this.m.subTo(e,e),e}function Z(t){var e=u();return t.copyTo(e),this.reduce(e),e}function J(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],n=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function Q(t,e){t.squareTo(e),this.reduce(e)}function K(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function $(){return 0==(this.t>0?1&this[0]:this.s)}function tt(t,e){if(t>4294967295||t<1)return l.ONE;var i=u(),n=u(),r=e.convert(this),s=A(t)-1;for(r.copyTo(i);--s>=0;)if(e.sqrTo(i,n),(t&1<<s)>0)e.mulTo(n,r,i);else{var a=i;i=n,n=a}return e.revert(i)}function et(t,e){var i;return i=t<256||e.isEven()?new z(e):new X(e),this.exp(t,i)}function it(){var t=u();return this.copyTo(t),t}function nt(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function rt(){return 0==this.t?this.s:this[0]<<24>>24}function st(){return 0==this.t?this.s:this[0]<<16>>16}function at(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function ot(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function lt(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=b(i),r=u(),s=u(),a="";for(this.divRemTo(n,r,s);r.signum()>0;)a=(i+s.intValue()).toString(t).substr(1)+a,r.divRemTo(n,r,s);return s.intValue().toString(t)+a}function ht(t,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),r=!1,s=0,a=0,o=0;o<t.length;++o){var h=y(t,o);h<0?"-"==t.charAt(o)&&0==this.signum()&&(r=!0):(a=e*a+h,++s>=i&&(this.dMultiply(n),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),r&&l.ZERO.subTo(this,this)}function ut(t,e,i){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(l.ONE.shiftLeft(t-1),yt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(l.ONE.shiftLeft(t-1),this);else{var n=new Array,r=7&t;n.length=1+(t>>3),e.nextBytes(n),r>0?n[0]&=(1<<r)-1:n[0]=0,this.fromString(n,256)}}function ct(){var t=this.t,e=new Array;e[0]=this.s;var i,n=this.DB-t*this.DB%8,r=0;if(t-- >0)for(n<this.DB&&(i=this[t]>>n)!=(this.s&this.DM)>>n&&(e[r++]=i|this.s<<this.DB-n);t>=0;)n<8?(i=(this[t]&(1<<n)-1)<<8-n,i|=this[--t]>>(n+=this.DB-8)):(i=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),128&i&&(i|=-256),0==r&&(128&this.s)!=(128&i)&&++r,(r>0||i!=this.s)&&(e[r++]=i);return e}function dt(t){return 0==this.compareTo(t)}function pt(t){return this.compareTo(t)<0?this:t}function mt(t){return this.compareTo(t)>0?this:t}function ft(t,e,i){var n,r,s=Math.min(t.t,this.t);for(n=0;n<s;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(r=t.s&this.DM,n=s;n<this.t;++n)i[n]=e(this[n],r);i.t=this.t}else{for(r=this.s&this.DM,n=s;n<t.t;++n)i[n]=e(r,t[n]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()}function gt(t,e){return t&e}function vt(t){var e=u();return this.bitwiseTo(t,gt,e),e}function yt(t,e){return t|e}function _t(t){var e=u();return this.bitwiseTo(t,yt,e),e}function xt(t,e){return t^e}function bt(t){var e=u();return this.bitwiseTo(t,xt,e),e}function wt(t,e){return t&~e}function Mt(t){var e=u();return this.bitwiseTo(t,wt,e),e}function Et(){for(var t=u(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function Tt(t){var e=u();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function St(t){var e=u();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function qt(t){if(0==t)return-1;var e=0;return 65535&t||(t>>=16,e+=16),255&t||(t>>=8,e+=8),15&t||(t>>=4,e+=4),3&t||(t>>=2,e+=2),1&t||++e,e}function Pt(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+qt(this[t]);return this.s<0?this.t*this.DB:-1}function At(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function Ct(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=At(this[i]^e);return t}function Lt(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)}function It(t,e){var i=l.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i}function Rt(t){return this.changeBit(t,yt)}function Nt(t){return this.changeBit(t,wt)}function Ot(t){return this.changeBit(t,xt)}function Dt(t,e){for(var i=0,n=0,r=Math.min(t.t,this.t);i<r;)n+=this[i]+t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n+=t[i],e[i++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()}function Bt(t){var e=u();return this.addTo(t,e),e}function kt(t){var e=u();return this.subTo(t,e),e}function Ft(t){var e=u();return this.multiplyTo(t,e),e}function zt(){var t=u();return this.squareTo(t),t}function Ut(t){var e=u();return this.divRemTo(t,e,null),e}function Ht(t){var e=u();return this.divRemTo(t,null,e),e}function Vt(t){var e=u(),i=u();return this.divRemTo(t,e,i),new Array(e,i)}function Gt(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Wt(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function jt(){}function Xt(t){return t}function Yt(t,e,i){t.multiplyTo(e,i)}function Zt(t,e){t.squareTo(e)}function Jt(t){return this.exp(t,new jt)}function Qt(t,e,i){var n,r=Math.min(this.t+t.t,e);for(i.s=0,i.t=r;r>0;)i[--r]=0;for(n=i.t-this.t;r<n;++r)i[r+this.t]=this.am(0,t[r],i,r,0,this.t);for(n=Math.min(t.t,e);r<n;++r)this.am(0,t[r],i,r,0,e-r);i.clamp()}function Kt(t,e,i){--e;var n=i.t=this.t+t.t-e;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)i[this.t+n-e]=this.am(e-n,t[n],i,0,0,this.t+n-e);i.clamp(),i.drShiftTo(1,i)}function $t(t){this.r2=u(),this.q3=u(),l.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function te(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=u();return t.copyTo(e),this.reduce(e),e}function ee(t){return t}function ie(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ne(t,e){t.squareTo(e),this.reduce(e)}function re(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function se(t,e){var i,n,r=t.bitLength(),s=b(1);if(r<=0)return s;i=r<18?1:r<48?3:r<144?4:r<768?5:6,n=r<8?new z(e):e.isEven()?new $t(e):new X(e);var a=new Array,o=3,l=i-1,h=(1<<i)-1;if(a[1]=n.convert(this),i>1){var c=u();for(n.sqrTo(a[1],c);o<=h;)a[o]=u(),n.mulTo(c,a[o-2],a[o]),o+=2}var d,p,m=t.t-1,f=!0,g=u();for(r=A(t[m])-1;m>=0;){for(r>=l?d=t[m]>>r-l&h:(d=(t[m]&(1<<r+1)-1)<<l-r,m>0&&(d|=t[m-1]>>this.DB+r-l)),o=i;!(1&d);)d>>=1,--o;if((r-=o)<0&&(r+=this.DB,--m),f)a[d].copyTo(s),f=!1;else{for(;o>1;)n.sqrTo(s,g),n.sqrTo(g,s),o-=2;o>0?n.sqrTo(s,g):(p=s,s=g,g=p),n.mulTo(g,a[d],s)}for(;m>=0&&!(t[m]&1<<r);)n.sqrTo(s,g),p=s,s=g,g=p,--r<0&&(r=this.DB-1,--m)}return n.revert(s)}function ae(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var n=e;e=i,i=n}var r=e.getLowestSetBit(),s=i.getLowestSetBit();if(s<0)return e;for(r<s&&(s=r),s>0&&(e.rShiftTo(s,e),i.rShiftTo(s,i));e.signum()>0;)(r=e.getLowestSetBit())>0&&e.rShiftTo(r,e),(r=i.getLowestSetBit())>0&&i.rShiftTo(r,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return s>0&&i.lShiftTo(s,i),i}function oe(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(0==e)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i}function le(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return l.ZERO;for(var i=t.clone(),n=this.clone(),r=b(1),s=b(0),a=b(0),o=b(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),e?((!r.isEven()||!s.isEven())&&(r.addTo(this,r),s.subTo(t,s)),r.rShiftTo(1,r)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!a.isEven()||!o.isEven())&&(a.addTo(this,a),o.subTo(t,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);i.compareTo(n)>=0?(i.subTo(n,i),e&&r.subTo(a,r),s.subTo(o,s)):(n.subTo(i,n),e&&a.subTo(r,a),o.subTo(s,o))}return 0!=n.compareTo(l.ONE)?l.ZERO:o.compareTo(t)>=0?o.subtract(t):o.signum()<0?(o.addTo(t,o),o.signum()<0?o.add(t):o):o}h(v,"int2char"),h(y,"intAt"),h(_,"bnpCopyTo"),h(x,"bnpFromInt"),h(b,"nbv"),h(w,"bnpFromString"),h(M,"bnpClamp"),h(E,"bnToString"),h(T,"bnNegate"),h(S,"bnAbs"),h(q,"bnCompareTo"),h(A,"nbits"),h(C,"bnBitLength"),h(L,"bnpDLShiftTo"),h(I,"bnpDRShiftTo"),h(R,"bnpLShiftTo"),h(N,"bnpRShiftTo"),h(O,"bnpSubTo"),h(D,"bnpMultiplyTo"),h(B,"bnpSquareTo"),h(k,"bnpDivRemTo"),h(F,"bnMod"),h(z,"Classic"),h(U,"cConvert"),h(H,"cRevert"),h(V,"cReduce"),h(G,"cMulTo"),h(W,"cSqrTo"),z.prototype.convert=U,z.prototype.revert=H,z.prototype.reduce=V,z.prototype.mulTo=G,z.prototype.sqrTo=W,h(j,"bnpInvDigit"),h(X,"Montgomery"),h(Y,"montConvert"),h(Z,"montRevert"),h(J,"montReduce"),h(Q,"montSqrTo"),h(K,"montMulTo"),X.prototype.convert=Y,X.prototype.revert=Z,X.prototype.reduce=J,X.prototype.mulTo=K,X.prototype.sqrTo=Q,h($,"bnpIsEven"),h(tt,"bnpExp"),h(et,"bnModPowInt"),l.prototype.copyTo=_,l.prototype.fromInt=x,l.prototype.fromString=w,l.prototype.clamp=M,l.prototype.dlShiftTo=L,l.prototype.drShiftTo=I,l.prototype.lShiftTo=R,l.prototype.rShiftTo=N,l.prototype.subTo=O,l.prototype.multiplyTo=D,l.prototype.squareTo=B,l.prototype.divRemTo=k,l.prototype.invDigit=j,l.prototype.isEven=$,l.prototype.exp=tt,l.prototype.toString=E,l.prototype.negate=T,l.prototype.abs=S,l.prototype.compareTo=q,l.prototype.bitLength=C,l.prototype.mod=F,l.prototype.modPowInt=et,l.ZERO=b(0),l.ONE=b(1),h(it,"bnClone"),h(nt,"bnIntValue"),h(rt,"bnByteValue"),h(st,"bnShortValue"),h(at,"bnpChunkSize"),h(ot,"bnSigNum"),h(lt,"bnpToRadix"),h(ht,"bnpFromRadix"),h(ut,"bnpFromNumber"),h(ct,"bnToByteArray"),h(dt,"bnEquals"),h(pt,"bnMin"),h(mt,"bnMax"),h(ft,"bnpBitwiseTo"),h(gt,"op_and"),h(vt,"bnAnd"),h(yt,"op_or"),h(_t,"bnOr"),h(xt,"op_xor"),h(bt,"bnXor"),h(wt,"op_andnot"),h(Mt,"bnAndNot"),h(Et,"bnNot"),h(Tt,"bnShiftLeft"),h(St,"bnShiftRight"),h(qt,"lbit"),h(Pt,"bnGetLowestSetBit"),h(At,"cbit"),h(Ct,"bnBitCount"),h(Lt,"bnTestBit"),h(It,"bnpChangeBit"),h(Rt,"bnSetBit"),h(Nt,"bnClearBit"),h(Ot,"bnFlipBit"),h(Dt,"bnpAddTo"),h(Bt,"bnAdd"),h(kt,"bnSubtract"),h(Ft,"bnMultiply"),h(zt,"bnSquare"),h(Ut,"bnDivide"),h(Ht,"bnRemainder"),h(Vt,"bnDivideAndRemainder"),h(Gt,"bnpDMultiply"),h(Wt,"bnpDAddOffset"),h(jt,"NullExp"),h(Xt,"nNop"),h(Yt,"nMulTo"),h(Zt,"nSqrTo"),jt.prototype.convert=Xt,jt.prototype.revert=Xt,jt.prototype.mulTo=Yt,jt.prototype.sqrTo=Zt,h(Jt,"bnPow"),h(Qt,"bnpMultiplyLowerTo"),h(Kt,"bnpMultiplyUpperTo"),h($t,"Barrett"),h(te,"barrettConvert"),h(ee,"barrettRevert"),h(ie,"barrettReduce"),h(ne,"barrettSqrTo"),h(re,"barrettMulTo"),$t.prototype.convert=te,$t.prototype.revert=ee,$t.prototype.reduce=ie,$t.prototype.mulTo=re,$t.prototype.sqrTo=ne,h(se,"bnModPow"),h(ae,"bnGCD"),h(oe,"bnpModInt"),h(le,"bnModInverse");var he=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ue=(1<<26)/he[he.length-1];function ce(t){var e,i=this.abs();if(1==i.t&&i[0]<=he[he.length-1]){for(e=0;e<he.length;++e)if(i[0]==he[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<he.length;){for(var n=he[e],r=e+1;r<he.length&&n<ue;)n*=he[r++];for(n=i.modInt(n);e<r;)if(n%he[e++]==0)return!1}return i.millerRabin(t)}function de(t){var e=this.subtract(l.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var n=e.shiftRight(i);(t=t+1>>1)>he.length&&(t=he.length);for(var r=u(),s=0;s<t;++s){r.fromInt(he[Math.floor(Math.random()*he.length)]);var a=r.modPow(n,this);if(0!=a.compareTo(l.ONE)&&0!=a.compareTo(e)){for(var o=1;o++<i&&0!=a.compareTo(e);)if(0==(a=a.modPowInt(2,this)).compareTo(l.ONE))return!1;if(0!=a.compareTo(e))return!1}}return!0}h(ce,"bnIsProbablePrime"),h(de,"bnpMillerRabin"),l.prototype.chunkSize=at,l.prototype.toRadix=lt,l.prototype.fromRadix=ht,l.prototype.fromNumber=ut,l.prototype.bitwiseTo=ft,l.prototype.changeBit=It,l.prototype.addTo=Dt,l.prototype.dMultiply=Gt,l.prototype.dAddOffset=Wt,l.prototype.multiplyLowerTo=Qt,l.prototype.multiplyUpperTo=Kt,l.prototype.modInt=oe,l.prototype.millerRabin=de,l.prototype.clone=it,l.prototype.intValue=nt,l.prototype.byteValue=rt,l.prototype.shortValue=st,l.prototype.signum=ot,l.prototype.toByteArray=ct,l.prototype.equals=dt,l.prototype.min=pt,l.prototype.max=mt,l.prototype.and=vt,l.prototype.or=_t,l.prototype.xor=bt,l.prototype.andNot=Mt,l.prototype.not=Et,l.prototype.shiftLeft=Tt,l.prototype.shiftRight=St,l.prototype.getLowestSetBit=Pt,l.prototype.bitCount=Ct,l.prototype.testBit=Lt,l.prototype.setBit=Rt,l.prototype.clearBit=Nt,l.prototype.flipBit=Ot,l.prototype.add=Bt,l.prototype.subtract=kt,l.prototype.multiply=Ft,l.prototype.divide=Ut,l.prototype.remainder=Ht,l.prototype.divideAndRemainder=Vt,l.prototype.modPow=se,l.prototype.modInverse=le,l.prototype.pow=Jt,l.prototype.gcd=ae,l.prototype.isProbablePrime=ce,l.prototype.square=zt;var pe,me=l;me.prototype.IsNegative=function(){return-1==this.compareTo(me.ZERO)},me.op_Equality=function(t,e){return 0==t.compareTo(e)},me.op_Inequality=function(t,e){return 0!=t.compareTo(e)},me.op_GreaterThan=function(t,e){return t.compareTo(e)>0},me.op_LessThan=function(t,e){return t.compareTo(e)<0},me.op_Addition=function(t,e){return new me(t).add(new me(e))},me.op_Subtraction=function(t,e){return new me(t).subtract(new me(e))},me.Int128Mul=function(t,e){return new me(t).multiply(new me(e))},me.op_Division=function(t,e){return t.divide(e)},me.prototype.ToDouble=function(){return parseFloat(this.toString())},void 0===pe&&(pe=h((function(t,e){var i;if(void 0===Object.getOwnPropertyNames){for(i in e.prototype)(void 0===t.prototype[i]||t.prototype[i]==Object.prototype[i])&&(t.prototype[i]=e.prototype[i]);for(i in e)void 0===t[i]&&(t[i]=e[i]);t.$baseCtor=e}else{for(var n=Object.getOwnPropertyNames(e.prototype),r=0;r<n.length;r++)void 0===Object.getOwnPropertyDescriptor(t.prototype,n[r])&&Object.defineProperty(t.prototype,n[r],Object.getOwnPropertyDescriptor(e.prototype,n[r]));for(i in e)void 0===t[i]&&(t[i]=e[i]);t.$baseCtor=e}}),"Inherit")),n.Path=function(){return[]},n.Paths=function(){return[]},n.DoublePoint=function(){var t=arguments;this.X=0,this.Y=0,1==t.length?(this.X=t[0].X,this.Y=t[0].Y):2==t.length&&(this.X=t[0],this.Y=t[1])},n.DoublePoint0=function(){this.X=0,this.Y=0},n.DoublePoint1=function(t){this.X=t.X,this.Y=t.Y},n.DoublePoint2=function(t,e){this.X=t,this.Y=e},n.PolyNode=function(){this.m_Parent=null,this.m_polygon=new n.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1},n.PolyNode.prototype.IsHoleNode=function(){for(var t=!0,e=this.m_Parent;null!==e;)t=!t,e=e.m_Parent;return t},n.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length},n.PolyNode.prototype.Contour=function(){return this.m_polygon},n.PolyNode.prototype.AddChild=function(t){var e=this.m_Childs.length;this.m_Childs.push(t),t.m_Parent=this,t.m_Index=e},n.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()},n.PolyNode.prototype.GetNextSiblingUp=function(){return null===this.m_Parent?null:this.m_Index==this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]},n.PolyNode.prototype.Childs=function(){return this.m_Childs},n.PolyNode.prototype.Parent=function(){return this.m_Parent},n.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()},n.PolyTree=function(){this.m_AllPolys=[],n.PolyNode.call(this)},n.PolyTree.prototype.Clear=function(){for(var t=0,e=this.m_AllPolys.length;t<e;t++)this.m_AllPolys[t]=null;this.m_AllPolys.length=0,this.m_Childs.length=0},n.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null},n.PolyTree.prototype.Total=function(){return this.m_AllPolys.length},pe(n.PolyTree,n.PolyNode),n.Math_Abs_Int64=n.Math_Abs_Int32=n.Math_Abs_Double=function(t){return Math.abs(t)},n.Math_Max_Int32_Int32=function(t,e){return Math.max(t,e)},a.msie||a.opera||a.safari?n.Cast_Int32=function(t){return 0|t}:n.Cast_Int32=function(t){return~~t},a.chrome?n.Cast_Int64=function(t){return t<-2147483648||t>2147483647?t<0?Math.ceil(t):Math.floor(t):~~t}:a.firefox&&"function"==typeof Number.toInteger?n.Cast_Int64=function(t){return Number.toInteger(t)}:a.msie7||a.msie8?n.Cast_Int64=function(t){return parseInt(t,10)}:a.msie?n.Cast_Int64=function(t){return t<-2147483648||t>2147483647?t<0?Math.ceil(t):Math.floor(t):0|t}:n.Cast_Int64=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.Clear=function(t){t.length=0},n.PI=3.141592653589793,n.PI2=6.283185307179586,n.IntPoint=function(){var t=arguments,e=t.length;if(this.X=0,this.Y=0,2==e)this.X=t[0],this.Y=t[1];else if(1==e)if(t[0]instanceof n.DoublePoint){var i=t[0];this.X=n.Clipper.Round(i.X),this.Y=n.Clipper.Round(i.Y)}else{var r=t[0];this.X=r.X,this.Y=r.Y}else this.X=0,this.Y=0},n.IntPoint.op_Equality=function(t,e){return t.X==e.X&&t.Y==e.Y},n.IntPoint.op_Inequality=function(t,e){return t.X!=e.X||t.Y!=e.Y},n.IntPoint0=function(){this.X=0,this.Y=0},n.IntPoint1=function(t){this.X=t.X,this.Y=t.Y},n.IntPoint1dp=function(t){this.X=n.Clipper.Round(t.X),this.Y=n.Clipper.Round(t.Y)},n.IntPoint2=function(t,e){this.X=t,this.Y=e},n.IntRect=function(){var t=arguments,e=t.length;4==e?(this.left=t[0],this.top=t[1],this.right=t[2],this.bottom=t[3]):1==e?(this.left=ir.left,this.top=ir.top,this.right=ir.right,this.bottom=ir.bottom):(this.left=0,this.top=0,this.right=0,this.bottom=0)},n.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0},n.IntRect1=function(t){this.left=t.left,this.top=t.top,this.right=t.right,this.bottom=t.bottom},n.IntRect4=function(t,e,i,n){this.left=t,this.top=e,this.right=i,this.bottom=n},n.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3},n.PolyType={ptSubject:0,ptClip:1},n.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3},n.JoinType={jtSquare:0,jtRound:1,jtMiter:2},n.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4},n.EdgeSide={esLeft:0,esRight:1},n.Direction={dRightToLeft:0,dLeftToRight:1},n.TEdge=function(){this.Bot=new n.IntPoint,this.Curr=new n.IntPoint,this.Top=new n.IntPoint,this.Delta=new n.IntPoint,this.Dx=0,this.PolyTyp=n.PolyType.ptSubject,this.Side=n.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null},n.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new n.IntPoint},n.MyIntersectNodeSort=function(){},n.MyIntersectNodeSort.Compare=function(t,e){return e.Pt.Y-t.Pt.Y},n.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null},n.Scanbeam=function(){this.Y=0,this.Next=null},n.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null},n.OutPt=function(){this.Idx=0,this.Pt=new n.IntPoint,this.Next=null,this.Prev=null},n.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new n.IntPoint},n.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_MinimaList=null,this.m_CurrentLM=null,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1},n.ClipperBase.horizontal=-9007199254740992,n.ClipperBase.Skip=-2,n.ClipperBase.Unassigned=-1,n.ClipperBase.tolerance=1e-20,n.ClipperBase.loRange=47453132,n.ClipperBase.hiRange=0xfffffffffffff,n.ClipperBase.near_zero=function(t){return t>-n.ClipperBase.tolerance&&t<n.ClipperBase.tolerance},n.ClipperBase.IsHorizontal=function(t){return 0===t.Delta.Y},n.ClipperBase.prototype.PointIsVertex=function(t,e){var i=e;do{if(n.IntPoint.op_Equality(i.Pt,t))return!0;i=i.Next}while(i!=e);return!1},n.ClipperBase.prototype.PointOnLineSegment=function(t,e,i,n){return n?t.X==e.X&&t.Y==e.Y||t.X==i.X&&t.Y==i.Y||t.X>e.X==t.X<i.X&&t.Y>e.Y==t.Y<i.Y&&me.op_Equality(me.Int128Mul(t.X-e.X,i.Y-e.Y),me.Int128Mul(i.X-e.X,t.Y-e.Y)):t.X==e.X&&t.Y==e.Y||t.X==i.X&&t.Y==i.Y||t.X>e.X==t.X<i.X&&t.Y>e.Y==t.Y<i.Y&&(t.X-e.X)*(i.Y-e.Y)==(i.X-e.X)*(t.Y-e.Y)},n.ClipperBase.prototype.PointOnPolygon=function(t,e,i){for(var n=e;;){if(this.PointOnLineSegment(t,n.Pt,n.Next.Pt,i))return!0;if((n=n.Next)==e)break}return!1},n.ClipperBase.prototype.SlopesEqual=n.ClipperBase.SlopesEqual=function(){var t,e,i,r,s,a,o=arguments,l=o.length;return 3==l?(t=o[0],e=o[1],o[2]?me.op_Equality(me.Int128Mul(t.Delta.Y,e.Delta.X),me.Int128Mul(t.Delta.X,e.Delta.Y)):n.Cast_Int64(t.Delta.Y*e.Delta.X)==n.Cast_Int64(t.Delta.X*e.Delta.Y)):4==l?(i=o[0],r=o[1],s=o[2],o[3]?me.op_Equality(me.Int128Mul(i.Y-r.Y,r.X-s.X),me.Int128Mul(i.X-r.X,r.Y-s.Y)):n.Cast_Int64((i.Y-r.Y)*(r.X-s.X))-n.Cast_Int64((i.X-r.X)*(r.Y-s.Y))==0):(i=o[0],r=o[1],s=o[2],a=o[3],o[4]?me.op_Equality(me.Int128Mul(i.Y-r.Y,s.X-a.X),me.Int128Mul(i.X-r.X,s.Y-a.Y)):n.Cast_Int64((i.Y-r.Y)*(s.X-a.X))-n.Cast_Int64((i.X-r.X)*(s.Y-a.Y))==0)},n.ClipperBase.SlopesEqual3=function(t,e,i){return i?me.op_Equality(me.Int128Mul(t.Delta.Y,e.Delta.X),me.Int128Mul(t.Delta.X,e.Delta.Y)):n.Cast_Int64(t.Delta.Y*e.Delta.X)==n.Cast_Int64(t.Delta.X*e.Delta.Y)},n.ClipperBase.SlopesEqual4=function(t,e,i,r){return r?me.op_Equality(me.Int128Mul(t.Y-e.Y,e.X-i.X),me.Int128Mul(t.X-e.X,e.Y-i.Y)):n.Cast_Int64((t.Y-e.Y)*(e.X-i.X))-n.Cast_Int64((t.X-e.X)*(e.Y-i.Y))==0},n.ClipperBase.SlopesEqual5=function(t,e,i,r,s){return s?me.op_Equality(me.Int128Mul(t.Y-e.Y,i.X-r.X),me.Int128Mul(t.X-e.X,i.Y-r.Y)):n.Cast_Int64((t.Y-e.Y)*(i.X-r.X))-n.Cast_Int64((t.X-e.X)*(i.Y-r.Y))==0},n.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var t=0,e=this.m_edges.length;t<e;++t){for(var i=0,r=this.m_edges[t].length;i<r;++i)this.m_edges[t][i]=null;n.Clear(this.m_edges[t])}n.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1},n.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;null!==this.m_MinimaList;){var t=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=t}this.m_CurrentLM=null},n.ClipperBase.prototype.RangeTest=function(t,e){e.Value?(t.X>n.ClipperBase.hiRange||t.Y>n.ClipperBase.hiRange||-t.X>n.ClipperBase.hiRange||-t.Y>n.ClipperBase.hiRange)&&n.Error("Coordinate outside allowed range in RangeTest()."):(t.X>n.ClipperBase.loRange||t.Y>n.ClipperBase.loRange||-t.X>n.ClipperBase.loRange||-t.Y>n.ClipperBase.loRange)&&(e.Value=!0,this.RangeTest(t,e))},n.ClipperBase.prototype.InitEdge=function(t,e,i,n){t.Next=e,t.Prev=i,t.Curr.X=n.X,t.Curr.Y=n.Y,t.OutIdx=-1},n.ClipperBase.prototype.InitEdge2=function(t,e){t.Curr.Y>=t.Next.Curr.Y?(t.Bot.X=t.Curr.X,t.Bot.Y=t.Curr.Y,t.Top.X=t.Next.Curr.X,t.Top.Y=t.Next.Curr.Y):(t.Top.X=t.Curr.X,t.Top.Y=t.Curr.Y,t.Bot.X=t.Next.Curr.X,t.Bot.Y=t.Next.Curr.Y),this.SetDx(t),t.PolyTyp=e},n.ClipperBase.prototype.FindNextLocMin=function(t){for(var e;;){for(;n.IntPoint.op_Inequality(t.Bot,t.Prev.Bot)||n.IntPoint.op_Equality(t.Curr,t.Top);)t=t.Next;if(t.Dx!=n.ClipperBase.horizontal&&t.Prev.Dx!=n.ClipperBase.horizontal)break;for(;t.Prev.Dx==n.ClipperBase.horizontal;)t=t.Prev;for(e=t;t.Dx==n.ClipperBase.horizontal;)t=t.Next;if(t.Top.Y!=t.Prev.Bot.Y){e.Prev.Bot.X<t.Bot.X&&(t=e);break}}return t},n.ClipperBase.prototype.ProcessBound=function(t,e){var i,r,s=t,a=t;if(t.Dx==n.ClipperBase.horizontal&&(r=e?t.Prev.Bot.X:t.Next.Bot.X,t.Bot.X!=r&&this.ReverseHorizontal(t)),a.OutIdx!=n.ClipperBase.Skip)if(e){for(;a.Top.Y==a.Next.Bot.Y&&a.Next.OutIdx!=n.ClipperBase.Skip;)a=a.Next;if(a.Dx==n.ClipperBase.horizontal&&a.Next.OutIdx!=n.ClipperBase.Skip){for(i=a;i.Prev.Dx==n.ClipperBase.horizontal;)i=i.Prev;i.Prev.Top.X==a.Next.Top.X?e||(a=i.Prev):i.Prev.Top.X>a.Next.Top.X&&(a=i.Prev)}for(;t!=a;)t.NextInLML=t.Next,t.Dx==n.ClipperBase.horizontal&&t!=s&&t.Bot.X!=t.Prev.Top.X&&this.ReverseHorizontal(t),t=t.Next;t.Dx==n.ClipperBase.horizontal&&t!=s&&t.Bot.X!=t.Prev.Top.X&&this.ReverseHorizontal(t),a=a.Next}else{for(;a.Top.Y==a.Prev.Bot.Y&&a.Prev.OutIdx!=n.ClipperBase.Skip;)a=a.Prev;if(a.Dx==n.ClipperBase.horizontal&&a.Prev.OutIdx!=n.ClipperBase.Skip){for(i=a;i.Next.Dx==n.ClipperBase.horizontal;)i=i.Next;i.Next.Top.X==a.Prev.Top.X?e||(a=i.Next):i.Next.Top.X>a.Prev.Top.X&&(a=i.Next)}for(;t!=a;)t.NextInLML=t.Prev,t.Dx==n.ClipperBase.horizontal&&t!=s&&t.Bot.X!=t.Next.Top.X&&this.ReverseHorizontal(t),t=t.Prev;t.Dx==n.ClipperBase.horizontal&&t!=s&&t.Bot.X!=t.Next.Top.X&&this.ReverseHorizontal(t),a=a.Prev}if(a.OutIdx==n.ClipperBase.Skip){if(t=a,e){for(;t.Top.Y==t.Next.Bot.Y;)t=t.Next;for(;t!=a&&t.Dx==n.ClipperBase.horizontal;)t=t.Prev}else{for(;t.Top.Y==t.Prev.Bot.Y;)t=t.Prev;for(;t!=a&&t.Dx==n.ClipperBase.horizontal;)t=t.Next}if(t==a)a=e?t.Next:t.Prev;else{t=e?a.Next:a.Prev;var o=new n.LocalMinima;o.Next=null,o.Y=t.Bot.Y,o.LeftBound=null,o.RightBound=t,o.RightBound.WindDelta=0,a=this.ProcessBound(o.RightBound,e),this.InsertLocalMinima(o)}}return a},n.ClipperBase.prototype.AddPath=function(t,e,i){!i&&e==n.PolyType.ptClip&&n.Error("AddPath: Open paths must be subject.");var r=t.length-1;if(i)for(;r>0&&n.IntPoint.op_Equality(t[r],t[0]);)--r;for(;r>0&&n.IntPoint.op_Equality(t[r],t[r-1]);)--r;if(i&&r<2||!i&&r<1)return!1;for(var s=new Array,a=0;a<=r;a++)s.push(new n.TEdge);var o=!0;s[1].Curr.X=t[1].X,s[1].Curr.Y=t[1].Y;var l={Value:this.m_UseFullRange};this.RangeTest(t[0],l),this.m_UseFullRange=l.Value,l.Value=this.m_UseFullRange,this.RangeTest(t[r],l),this.m_UseFullRange=l.Value,this.InitEdge(s[0],s[1],s[r],t[0]),this.InitEdge(s[r],s[0],s[r-1],t[r]);for(a=r-1;a>=1;--a)l.Value=this.m_UseFullRange,this.RangeTest(t[a],l),this.m_UseFullRange=l.Value,this.InitEdge(s[a],s[a+1],s[a-1],t[a]);for(var h=s[0],u=h,c=h;;)if(n.IntPoint.op_Equality(u.Curr,u.Next.Curr)){if(u==u.Next)break;u==h&&(h=u.Next),c=u=this.RemoveEdge(u)}else{if(u.Prev==u.Next)break;if(!i||!n.ClipperBase.SlopesEqual(u.Prev.Curr,u.Curr,u.Next.Curr,this.m_UseFullRange)||this.PreserveCollinear&&this.Pt2IsBetweenPt1AndPt3(u.Prev.Curr,u.Curr,u.Next.Curr)){if((u=u.Next)==c)break}else u==h&&(h=u.Next),c=u=(u=this.RemoveEdge(u)).Prev}if(!i&&u==u.Next||i&&u.Prev==u.Next)return!1;i||(this.m_HasOpenPaths=!0,h.Prev.OutIdx=n.ClipperBase.Skip);u=h;do{this.InitEdge2(u,e),u=u.Next,o&&u.Curr.Y!=h.Curr.Y&&(o=!1)}while(u!=h);if(o){if(i)return!1;for(u.Prev.OutIdx=n.ClipperBase.Skip,u.Prev.Bot.X<u.Prev.Top.X&&this.ReverseHorizontal(u.Prev),(m=new n.LocalMinima).Next=null,m.Y=u.Bot.Y,m.LeftBound=null,m.RightBound=u,m.RightBound.Side=n.EdgeSide.esRight,m.RightBound.WindDelta=0;u.Next.OutIdx!=n.ClipperBase.Skip;)u.NextInLML=u.Next,u.Bot.X!=u.Prev.Top.X&&this.ReverseHorizontal(u),u=u.Next;return this.InsertLocalMinima(m),this.m_edges.push(s),!0}this.m_edges.push(s);for(var d,p=null;(u=this.FindNextLocMin(u))!=p;){var m;null==p&&(p=u),(m=new n.LocalMinima).Next=null,m.Y=u.Bot.Y,u.Dx<u.Prev.Dx?(m.LeftBound=u.Prev,m.RightBound=u,d=!1):(m.LeftBound=u,m.RightBound=u.Prev,d=!0),m.LeftBound.Side=n.EdgeSide.esLeft,m.RightBound.Side=n.EdgeSide.esRight,i?m.LeftBound.Next==m.RightBound?m.LeftBound.WindDelta=-1:m.LeftBound.WindDelta=1:m.LeftBound.WindDelta=0,m.RightBound.WindDelta=-m.LeftBound.WindDelta,u=this.ProcessBound(m.LeftBound,d);var f=this.ProcessBound(m.RightBound,!d);m.LeftBound.OutIdx==n.ClipperBase.Skip?m.LeftBound=null:m.RightBound.OutIdx==n.ClipperBase.Skip&&(m.RightBound=null),this.InsertLocalMinima(m),d||(u=f)}return!0},n.ClipperBase.prototype.AddPaths=function(t,e,i){for(var n=!1,r=0,s=t.length;r<s;++r)this.AddPath(t[r],e,i)&&(n=!0);return n},n.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(t,e,i){return!(n.IntPoint.op_Equality(t,i)||n.IntPoint.op_Equality(t,e)||n.IntPoint.op_Equality(i,e))&&(t.X!=i.X?e.X>t.X==e.X<i.X:e.Y>t.Y==e.Y<i.Y)},n.ClipperBase.prototype.RemoveEdge=function(t){t.Prev.Next=t.Next,t.Next.Prev=t.Prev;var e=t.Next;return t.Prev=null,e},n.ClipperBase.prototype.SetDx=function(t){t.Delta.X=t.Top.X-t.Bot.X,t.Delta.Y=t.Top.Y-t.Bot.Y,0===t.Delta.Y?t.Dx=n.ClipperBase.horizontal:t.Dx=t.Delta.X/t.Delta.Y},n.ClipperBase.prototype.InsertLocalMinima=function(t){if(null===this.m_MinimaList)this.m_MinimaList=t;else if(t.Y>=this.m_MinimaList.Y)t.Next=this.m_MinimaList,this.m_MinimaList=t;else{for(var e=this.m_MinimaList;null!==e.Next&&t.Y<e.Next.Y;)e=e.Next;t.Next=e.Next,e.Next=t}},n.ClipperBase.prototype.PopLocalMinima=function(){null!==this.m_CurrentLM&&(this.m_CurrentLM=this.m_CurrentLM.Next)},n.ClipperBase.prototype.ReverseHorizontal=function(t){var e=t.Top.X;t.Top.X=t.Bot.X,t.Bot.X=e},n.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,null!=this.m_CurrentLM)for(var t=this.m_MinimaList;null!=t;){var e=t.LeftBound;null!=e&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=n.EdgeSide.esLeft,e.OutIdx=n.ClipperBase.Unassigned),null!=(e=t.RightBound)&&(e.Curr.X=e.Bot.X,e.Curr.Y=e.Bot.Y,e.Side=n.EdgeSide.esRight,e.OutIdx=n.ClipperBase.Unassigned),t=t.Next}},n.Clipper=function(t){void 0===t&&(t=0),this.m_PolyOuts=null,this.m_ClipType=n.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=n.PolyFillType.pftEvenOdd,this.m_SubjFillType=n.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,n.ClipperBase.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=n.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=0!=(1&t),this.StrictlySimple=0!=(2&t),this.PreserveCollinear=0!=(4&t)},n.Clipper.ioReverseSolution=1,n.Clipper.ioStrictlySimple=2,n.Clipper.ioPreserveCollinear=4,n.Clipper.prototype.Clear=function(){0!==this.m_edges.length&&(this.DisposeAllPolyPts(),n.ClipperBase.prototype.Clear.call(this))},n.Clipper.prototype.DisposeScanbeamList=function(){for(;null!==this.m_Scanbeam;){var t=this.m_Scanbeam.Next;this.m_Scanbeam=null,this.m_Scanbeam=t}},n.Clipper.prototype.Reset=function(){n.ClipperBase.prototype.Reset.call(this),this.m_Scanbeam=null,this.m_ActiveEdges=null,this.m_SortedEdges=null;for(var t=this.m_MinimaList;null!==t;)this.InsertScanbeam(t.Y),t=t.Next},n.Clipper.prototype.InsertScanbeam=function(t){if(null===this.m_Scanbeam)this.m_Scanbeam=new n.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=t;else if(t>this.m_Scanbeam.Y){(i=new n.Scanbeam).Y=t,i.Next=this.m_Scanbeam,this.m_Scanbeam=i}else{for(var e=this.m_Scanbeam;null!==e.Next&&t<=e.Next.Y;)e=e.Next;if(t==e.Y)return;var i;(i=new n.Scanbeam).Y=t,i.Next=e.Next,e.Next=i}},n.Clipper.prototype.Execute=function(){var t=arguments,e=t.length,i=t[1]instanceof n.PolyTree;if(4==e&&!i){var r=t[0],s=t[1],a=t[2],o=t[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&n.Error("Error: PolyTree struct is need for open path clipping."),this.m_ExecuteLocked=!0,n.Clear(s),this.m_SubjFillType=a,this.m_ClipFillType=o,this.m_ClipType=r,this.m_UsingPolyTree=!1;try{(h=this.ExecuteInternal())&&this.BuildResult(s)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return h}if(4==e&&i){r=t[0];var l=t[1];a=t[2],o=t[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=a,this.m_ClipFillType=o,this.m_ClipType=r,this.m_UsingPolyTree=!0;try{var h;(h=this.ExecuteInternal())&&this.BuildResult2(l)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return h}if(2==e&&!i){r=t[0],s=t[1];return this.Execute(r,s,n.PolyFillType.pftEvenOdd,n.PolyFillType.pftEvenOdd)}if(2==e&&i){r=t[0],l=t[1];return this.Execute(r,l,n.PolyFillType.pftEvenOdd,n.PolyFillType.pftEvenOdd)}},n.Clipper.prototype.FixHoleLinkage=function(t){if(null!==t.FirstLeft&&(t.IsHole==t.FirstLeft.IsHole||null===t.FirstLeft.Pts)){for(var e=t.FirstLeft;null!==e&&(e.IsHole==t.IsHole||null===e.Pts);)e=e.FirstLeft;t.FirstLeft=e}},n.Clipper.prototype.ExecuteInternal=function(){try{if(this.Reset(),null===this.m_CurrentLM)return!1;var t=this.PopScanbeam();do{if(this.InsertLocalMinimaIntoAEL(t),n.Clear(this.m_GhostJoins),this.ProcessHorizontals(!1),null===this.m_Scanbeam)break;var e=this.PopScanbeam();if(!this.ProcessIntersections(t,e))return!1;this.ProcessEdgesAtTopOfScanbeam(e),t=e}while(null!==this.m_Scanbeam||null!==this.m_CurrentLM);for(var i=0,r=this.m_PolyOuts.length;i<r;i++){null===(s=this.m_PolyOuts[i]).Pts||s.IsOpen||(s.IsHole^this.ReverseSolution)==this.Area(s)>0&&this.ReversePolyPtLinks(s.Pts)}this.JoinCommonEdges();for(i=0,r=this.m_PolyOuts.length;i<r;i++){var s;null!==(s=this.m_PolyOuts[i]).Pts&&!s.IsOpen&&this.FixupOutPolygon(s)}return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{n.Clear(this.m_Joins),n.Clear(this.m_GhostJoins)}},n.Clipper.prototype.PopScanbeam=function(){var t=this.m_Scanbeam.Y;this.m_Scanbeam;return this.m_Scanbeam=this.m_Scanbeam.Next,null,t},n.Clipper.prototype.DisposeAllPolyPts=function(){for(var t=0,e=this.m_PolyOuts.length;t<e;++t)this.DisposeOutRec(t);n.Clear(this.m_PolyOuts)},n.Clipper.prototype.DisposeOutRec=function(t){var e=this.m_PolyOuts[t];null!==e.Pts&&this.DisposeOutPts(e.Pts),e=null,this.m_PolyOuts[t]=null},n.Clipper.prototype.DisposeOutPts=function(t){if(null!==t){for(t.Prev.Next=null;null!==t;)t,t=t.Next,null}},n.Clipper.prototype.AddJoin=function(t,e,i){var r=new n.Join;r.OutPt1=t,r.OutPt2=e,r.OffPt.X=i.X,r.OffPt.Y=i.Y,this.m_Joins.push(r)},n.Clipper.prototype.AddGhostJoin=function(t,e){var i=new n.Join;i.OutPt1=t,i.OffPt.X=e.X,i.OffPt.Y=e.Y,this.m_GhostJoins.push(i)},n.Clipper.prototype.InsertLocalMinimaIntoAEL=function(t){for(;null!==this.m_CurrentLM&&this.m_CurrentLM.Y==t;){var e=this.m_CurrentLM.LeftBound,i=this.m_CurrentLM.RightBound;this.PopLocalMinima();var r=null;if(null===e?(this.InsertEdgeIntoAEL(i,null),this.SetWindingCount(i),this.IsContributing(i)&&(r=this.AddOutPt(i,i.Bot))):null==i?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(r=this.AddOutPt(e,e.Bot)),this.InsertScanbeam(e.Top.Y)):(this.InsertEdgeIntoAEL(e,null),this.InsertEdgeIntoAEL(i,e),this.SetWindingCount(e),i.WindCnt=e.WindCnt,i.WindCnt2=e.WindCnt2,this.IsContributing(e)&&(r=this.AddLocalMinPoly(e,i,e.Bot)),this.InsertScanbeam(e.Top.Y)),null!=i&&(n.ClipperBase.IsHorizontal(i)?this.AddEdgeToSEL(i):this.InsertScanbeam(i.Top.Y)),null!=e&&null!=i){if(null!==r&&n.ClipperBase.IsHorizontal(i)&&this.m_GhostJoins.length>0&&0!==i.WindDelta)for(var s=0,a=this.m_GhostJoins.length;s<a;s++){var o=this.m_GhostJoins[s];this.HorzSegmentsOverlap(o.OutPt1.Pt,o.OffPt,i.Bot,i.Top)&&this.AddJoin(o.OutPt1,r,o.OffPt)}if(e.OutIdx>=0&&null!==e.PrevInAEL&&e.PrevInAEL.Curr.X==e.Bot.X&&e.PrevInAEL.OutIdx>=0&&n.ClipperBase.SlopesEqual(e.PrevInAEL,e,this.m_UseFullRange)&&0!==e.WindDelta&&0!==e.PrevInAEL.WindDelta){var l=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(r,l,e.Top)}if(e.NextInAEL!=i){if(i.OutIdx>=0&&i.PrevInAEL.OutIdx>=0&&n.ClipperBase.SlopesEqual(i.PrevInAEL,i,this.m_UseFullRange)&&0!==i.WindDelta&&0!==i.PrevInAEL.WindDelta){l=this.AddOutPt(i.PrevInAEL,i.Bot);this.AddJoin(r,l,i.Top)}var h=e.NextInAEL;if(null!==h)for(;h!=i;)this.IntersectEdges(i,h,e.Curr,!1),h=h.NextInAEL}}}},n.Clipper.prototype.InsertEdgeIntoAEL=function(t,e){if(null===this.m_ActiveEdges)t.PrevInAEL=null,t.NextInAEL=null,this.m_ActiveEdges=t;else if(null===e&&this.E2InsertsBeforeE1(this.m_ActiveEdges,t))t.PrevInAEL=null,t.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=t,this.m_ActiveEdges=t;else{for(null===e&&(e=this.m_ActiveEdges);null!==e.NextInAEL&&!this.E2InsertsBeforeE1(e.NextInAEL,t);)e=e.NextInAEL;t.NextInAEL=e.NextInAEL,null!==e.NextInAEL&&(e.NextInAEL.PrevInAEL=t),t.PrevInAEL=e,e.NextInAEL=t}},n.Clipper.prototype.E2InsertsBeforeE1=function(t,e){return e.Curr.X==t.Curr.X?e.Top.Y>t.Top.Y?e.Top.X<n.Clipper.TopX(t,e.Top.Y):t.Top.X>n.Clipper.TopX(e,t.Top.Y):e.Curr.X<t.Curr.X},n.Clipper.prototype.IsEvenOddFillType=function(t){return t.PolyTyp==n.PolyType.ptSubject?this.m_SubjFillType==n.PolyFillType.pftEvenOdd:this.m_ClipFillType==n.PolyFillType.pftEvenOdd},n.Clipper.prototype.IsEvenOddAltFillType=function(t){return t.PolyTyp==n.PolyType.ptSubject?this.m_ClipFillType==n.PolyFillType.pftEvenOdd:this.m_SubjFillType==n.PolyFillType.pftEvenOdd},n.Clipper.prototype.IsContributing=function(t){var e,i;switch(t.PolyTyp==n.PolyType.ptSubject?(e=this.m_SubjFillType,i=this.m_ClipFillType):(e=this.m_ClipFillType,i=this.m_SubjFillType),e){case n.PolyFillType.pftEvenOdd:if(0===t.WindDelta&&1!=t.WindCnt)return!1;break;case n.PolyFillType.pftNonZero:if(1!=Math.abs(t.WindCnt))return!1;break;case n.PolyFillType.pftPositive:if(1!=t.WindCnt)return!1;break;default:if(-1!=t.WindCnt)return!1}switch(this.m_ClipType){case n.ClipType.ctIntersection:switch(i){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return 0!==t.WindCnt2;case n.PolyFillType.pftPositive:return t.WindCnt2>0;default:return t.WindCnt2<0}case n.ClipType.ctUnion:switch(i){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return 0===t.WindCnt2;case n.PolyFillType.pftPositive:return t.WindCnt2<=0;default:return t.WindCnt2>=0}case n.ClipType.ctDifference:if(t.PolyTyp==n.PolyType.ptSubject)switch(i){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return 0===t.WindCnt2;case n.PolyFillType.pftPositive:return t.WindCnt2<=0;default:return t.WindCnt2>=0}else switch(i){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return 0!==t.WindCnt2;case n.PolyFillType.pftPositive:return t.WindCnt2>0;default:return t.WindCnt2<0}case n.ClipType.ctXor:if(0!==t.WindDelta)return!0;switch(i){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return 0===t.WindCnt2;case n.PolyFillType.pftPositive:return t.WindCnt2<=0;default:return t.WindCnt2>=0}}return!0},n.Clipper.prototype.SetWindingCount=function(t){for(var e=t.PrevInAEL;null!==e&&(e.PolyTyp!=t.PolyTyp||0===e.WindDelta);)e=e.PrevInAEL;if(null===e)t.WindCnt=0===t.WindDelta?1:t.WindDelta,t.WindCnt2=0,e=this.m_ActiveEdges;else if(0===t.WindDelta&&this.m_ClipType!=n.ClipType.ctUnion)t.WindCnt=1,t.WindCnt2=e.WindCnt2,e=e.NextInAEL;else if(this.IsEvenOddFillType(t)){if(0===t.WindDelta){for(var i=!0,r=e.PrevInAEL;null!==r;)r.PolyTyp==e.PolyTyp&&0!==r.WindDelta&&(i=!i),r=r.PrevInAEL;t.WindCnt=i?0:1}else t.WindCnt=t.WindDelta;t.WindCnt2=e.WindCnt2,e=e.NextInAEL}else e.WindCnt*e.WindDelta<0?Math.abs(e.WindCnt)>1?e.WindDelta*t.WindDelta<0?t.WindCnt=e.WindCnt:t.WindCnt=e.WindCnt+t.WindDelta:t.WindCnt=0===t.WindDelta?1:t.WindDelta:0===t.WindDelta?t.WindCnt=e.WindCnt<0?e.WindCnt-1:e.WindCnt+1:e.WindDelta*t.WindDelta<0?t.WindCnt=e.WindCnt:t.WindCnt=e.WindCnt+t.WindDelta,t.WindCnt2=e.WindCnt2,e=e.NextInAEL;if(this.IsEvenOddAltFillType(t))for(;e!=t;)0!==e.WindDelta&&(t.WindCnt2=0===t.WindCnt2?1:0),e=e.NextInAEL;else for(;e!=t;)t.WindCnt2+=e.WindDelta,e=e.NextInAEL},n.Clipper.prototype.AddEdgeToSEL=function(t){null===this.m_SortedEdges?(this.m_SortedEdges=t,t.PrevInSEL=null,t.NextInSEL=null):(t.NextInSEL=this.m_SortedEdges,t.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=t,this.m_SortedEdges=t)},n.Clipper.prototype.CopyAELToSEL=function(){var t=this.m_ActiveEdges;for(this.m_SortedEdges=t;null!==t;)t.PrevInSEL=t.PrevInAEL,t.NextInSEL=t.NextInAEL,t=t.NextInAEL},n.Clipper.prototype.SwapPositionsInAEL=function(t,e){if(t.NextInAEL!=t.PrevInAEL&&e.NextInAEL!=e.PrevInAEL){if(t.NextInAEL==e)null!==(i=e.NextInAEL)&&(i.PrevInAEL=t),null!==(n=t.PrevInAEL)&&(n.NextInAEL=e),e.PrevInAEL=n,e.NextInAEL=t,t.PrevInAEL=e,t.NextInAEL=i;else if(e.NextInAEL==t){null!==(i=t.NextInAEL)&&(i.PrevInAEL=e),null!==(n=e.PrevInAEL)&&(n.NextInAEL=t),t.PrevInAEL=n,t.NextInAEL=e,e.PrevInAEL=t,e.NextInAEL=i}else{var i=t.NextInAEL,n=t.PrevInAEL;t.NextInAEL=e.NextInAEL,null!==t.NextInAEL&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=e.PrevInAEL,null!==t.PrevInAEL&&(t.PrevInAEL.NextInAEL=t),e.NextInAEL=i,null!==e.NextInAEL&&(e.NextInAEL.PrevInAEL=e),e.PrevInAEL=n,null!==e.PrevInAEL&&(e.PrevInAEL.NextInAEL=e)}null===t.PrevInAEL?this.m_ActiveEdges=t:null===e.PrevInAEL&&(this.m_ActiveEdges=e)}},n.Clipper.prototype.SwapPositionsInSEL=function(t,e){if(!(null===t.NextInSEL&&null===t.PrevInSEL||null===e.NextInSEL&&null===e.PrevInSEL)){if(t.NextInSEL==e)null!==(i=e.NextInSEL)&&(i.PrevInSEL=t),null!==(n=t.PrevInSEL)&&(n.NextInSEL=e),e.PrevInSEL=n,e.NextInSEL=t,t.PrevInSEL=e,t.NextInSEL=i;else if(e.NextInSEL==t){null!==(i=t.NextInSEL)&&(i.PrevInSEL=e),null!==(n=e.PrevInSEL)&&(n.NextInSEL=t),t.PrevInSEL=n,t.NextInSEL=e,e.PrevInSEL=t,e.NextInSEL=i}else{var i=t.NextInSEL,n=t.PrevInSEL;t.NextInSEL=e.NextInSEL,null!==t.NextInSEL&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=e.PrevInSEL,null!==t.PrevInSEL&&(t.PrevInSEL.NextInSEL=t),e.NextInSEL=i,null!==e.NextInSEL&&(e.NextInSEL.PrevInSEL=e),e.PrevInSEL=n,null!==e.PrevInSEL&&(e.PrevInSEL.NextInSEL=e)}null===t.PrevInSEL?this.m_SortedEdges=t:null===e.PrevInSEL&&(this.m_SortedEdges=e)}},n.Clipper.prototype.AddLocalMaxPoly=function(t,e,i){this.AddOutPt(t,i),0==e.WindDelta&&this.AddOutPt(e,i),t.OutIdx==e.OutIdx?(t.OutIdx=-1,e.OutIdx=-1):t.OutIdx<e.OutIdx?this.AppendPolygon(t,e):this.AppendPolygon(e,t)},n.Clipper.prototype.AddLocalMinPoly=function(t,e,i){var r,s,a;if(n.ClipperBase.IsHorizontal(e)||t.Dx>e.Dx?(r=this.AddOutPt(t,i),e.OutIdx=t.OutIdx,t.Side=n.EdgeSide.esLeft,e.Side=n.EdgeSide.esRight,a=(s=t).PrevInAEL==e?e.PrevInAEL:s.PrevInAEL):(r=this.AddOutPt(e,i),t.OutIdx=e.OutIdx,t.Side=n.EdgeSide.esRight,e.Side=n.EdgeSide.esLeft,a=(s=e).PrevInAEL==t?t.PrevInAEL:s.PrevInAEL),null!==a&&a.OutIdx>=0&&n.Clipper.TopX(a,i.Y)==n.Clipper.TopX(s,i.Y)&&n.ClipperBase.SlopesEqual(s,a,this.m_UseFullRange)&&0!==s.WindDelta&&0!==a.WindDelta){var o=this.AddOutPt(a,i);this.AddJoin(r,o,s.Top)}return r},n.Clipper.prototype.CreateOutRec=function(){var t=new n.OutRec;return t.Idx=-1,t.IsHole=!1,t.IsOpen=!1,t.FirstLeft=null,t.Pts=null,t.BottomPt=null,t.PolyNode=null,this.m_PolyOuts.push(t),t.Idx=this.m_PolyOuts.length-1,t},n.Clipper.prototype.AddOutPt=function(t,e){var i=t.Side==n.EdgeSide.esLeft;if(t.OutIdx<0){(s=this.CreateOutRec()).IsOpen=0===t.WindDelta;var r=new n.OutPt;return s.Pts=r,r.Idx=s.Idx,r.Pt.X=e.X,r.Pt.Y=e.Y,r.Next=r,r.Prev=r,s.IsOpen||this.SetHoleState(t,s),t.OutIdx=s.Idx,r}var s,a=(s=this.m_PolyOuts[t.OutIdx]).Pts;return i&&n.IntPoint.op_Equality(e,a.Pt)?a:!i&&n.IntPoint.op_Equality(e,a.Prev.Pt)?a.Prev:((r=new n.OutPt).Idx=s.Idx,r.Pt.X=e.X,r.Pt.Y=e.Y,r.Next=a,r.Prev=a.Prev,r.Prev.Next=r,a.Prev=r,i&&(s.Pts=r),r)},n.Clipper.prototype.SwapPoints=function(t,e){var i=new n.IntPoint(t.Value);t.Value.X=e.Value.X,t.Value.Y=e.Value.Y,e.Value.X=i.X,e.Value.Y=i.Y},n.Clipper.prototype.HorzSegmentsOverlap=function(t,e,i,n){return t.X>i.X==t.X<n.X||e.X>i.X==e.X<n.X||i.X>t.X==i.X<e.X||n.X>t.X==n.X<e.X||t.X==i.X&&e.X==n.X||t.X==n.X&&e.X==i.X},n.Clipper.prototype.InsertPolyPtBetween=function(t,e,i){var r=new n.OutPt;return r.Pt.X=i.X,r.Pt.Y=i.Y,e==t.Next?(t.Next=r,e.Prev=r,r.Next=e,r.Prev=t):(e.Next=r,t.Prev=r,r.Next=t,r.Prev=e),r},n.Clipper.prototype.SetHoleState=function(t,e){for(var i=!1,n=t.PrevInAEL;null!==n;)n.OutIdx>=0&&0!=n.WindDelta&&(i=!i,null===e.FirstLeft&&(e.FirstLeft=this.m_PolyOuts[n.OutIdx])),n=n.PrevInAEL;i&&(e.IsHole=!0)},n.Clipper.prototype.GetDx=function(t,e){return t.Y==e.Y?n.ClipperBase.horizontal:(e.X-t.X)/(e.Y-t.Y)},n.Clipper.prototype.FirstIsBottomPt=function(t,e){for(var i=t.Prev;n.IntPoint.op_Equality(i.Pt,t.Pt)&&i!=t;)i=i.Prev;var r=Math.abs(this.GetDx(t.Pt,i.Pt));for(i=t.Next;n.IntPoint.op_Equality(i.Pt,t.Pt)&&i!=t;)i=i.Next;var s=Math.abs(this.GetDx(t.Pt,i.Pt));for(i=e.Prev;n.IntPoint.op_Equality(i.Pt,e.Pt)&&i!=e;)i=i.Prev;var a=Math.abs(this.GetDx(e.Pt,i.Pt));for(i=e.Next;n.IntPoint.op_Equality(i.Pt,e.Pt)&&i!=e;)i=i.Next;var o=Math.abs(this.GetDx(e.Pt,i.Pt));return r>=a&&r>=o||s>=a&&s>=o},n.Clipper.prototype.GetBottomPt=function(t){for(var e=null,i=t.Next;i!=t;)i.Pt.Y>t.Pt.Y?(t=i,e=null):i.Pt.Y==t.Pt.Y&&i.Pt.X<=t.Pt.X&&(i.Pt.X<t.Pt.X?(e=null,t=i):i.Next!=t&&i.Prev!=t&&(e=i)),i=i.Next;if(null!==e)for(;e!=i;)for(this.FirstIsBottomPt(i,e)||(t=e),e=e.Next;n.IntPoint.op_Inequality(e.Pt,t.Pt);)e=e.Next;return t},n.Clipper.prototype.GetLowermostRec=function(t,e){null===t.BottomPt&&(t.BottomPt=this.GetBottomPt(t.Pts)),null===e.BottomPt&&(e.BottomPt=this.GetBottomPt(e.Pts));var i=t.BottomPt,n=e.BottomPt;return i.Pt.Y>n.Pt.Y?t:i.Pt.Y<n.Pt.Y?e:i.Pt.X<n.Pt.X?t:i.Pt.X>n.Pt.X||i.Next==i?e:n.Next==n||this.FirstIsBottomPt(i,n)?t:e},n.Clipper.prototype.Param1RightOfParam2=function(t,e){do{if((t=t.FirstLeft)==e)return!0}while(null!==t);return!1},n.Clipper.prototype.GetOutRec=function(t){for(var e=this.m_PolyOuts[t];e!=this.m_PolyOuts[e.Idx];)e=this.m_PolyOuts[e.Idx];return e},n.Clipper.prototype.AppendPolygon=function(t,e){var i,r=this.m_PolyOuts[t.OutIdx],s=this.m_PolyOuts[e.OutIdx];i=this.Param1RightOfParam2(r,s)?s:this.Param1RightOfParam2(s,r)?r:this.GetLowermostRec(r,s);var a,o=r.Pts,l=o.Prev,h=s.Pts,u=h.Prev;t.Side==n.EdgeSide.esLeft?(e.Side==n.EdgeSide.esLeft?(this.ReversePolyPtLinks(h),h.Next=o,o.Prev=h,l.Next=u,u.Prev=l,r.Pts=u):(u.Next=o,o.Prev=u,h.Prev=l,l.Next=h,r.Pts=h),a=n.EdgeSide.esLeft):(e.Side==n.EdgeSide.esRight?(this.ReversePolyPtLinks(h),l.Next=u,u.Prev=l,h.Next=o,o.Prev=h):(l.Next=h,h.Prev=l,o.Prev=u,u.Next=o),a=n.EdgeSide.esRight),r.BottomPt=null,i==s&&(s.FirstLeft!=r&&(r.FirstLeft=s.FirstLeft),r.IsHole=s.IsHole),s.Pts=null,s.BottomPt=null,s.FirstLeft=r;var c=t.OutIdx,d=e.OutIdx;t.OutIdx=-1,e.OutIdx=-1;for(var p=this.m_ActiveEdges;null!==p;){if(p.OutIdx==d){p.OutIdx=c,p.Side=a;break}p=p.NextInAEL}s.Idx=r.Idx},n.Clipper.prototype.ReversePolyPtLinks=function(t){if(null!==t){var e,i;e=t;do{i=e.Next,e.Next=e.Prev,e.Prev=i,e=i}while(e!=t)}},n.Clipper.SwapSides=function(t,e){var i=t.Side;t.Side=e.Side,e.Side=i},n.Clipper.SwapPolyIndexes=function(t,e){var i=t.OutIdx;t.OutIdx=e.OutIdx,e.OutIdx=i},n.Clipper.prototype.IntersectEdges=function(t,e,i,r){var s,a,o,l,h,u,c=!r&&null===t.NextInLML&&t.Top.X==i.X&&t.Top.Y==i.Y,d=!r&&null===e.NextInLML&&e.Top.X==i.X&&e.Top.Y==i.Y,p=t.OutIdx>=0,m=e.OutIdx>=0;if(0===t.WindDelta||0===e.WindDelta)return 0===t.WindDelta&&0===e.WindDelta?(c||d)&&p&&m&&this.AddLocalMaxPoly(t,e,i):t.PolyTyp==e.PolyTyp&&t.WindDelta!=e.WindDelta&&this.m_ClipType==n.ClipType.ctUnion?0===t.WindDelta?m&&(this.AddOutPt(t,i),p&&(t.OutIdx=-1)):p&&(this.AddOutPt(e,i),m&&(e.OutIdx=-1)):t.PolyTyp!=e.PolyTyp&&(0!==t.WindDelta||1!=Math.abs(e.WindCnt)||this.m_ClipType==n.ClipType.ctUnion&&0!==e.WindCnt2?0===e.WindDelta&&1==Math.abs(t.WindCnt)&&(this.m_ClipType!=n.ClipType.ctUnion||0===t.WindCnt2)&&(this.AddOutPt(e,i),m&&(e.OutIdx=-1)):(this.AddOutPt(t,i),p&&(t.OutIdx=-1))),c&&(t.OutIdx<0?this.DeleteFromAEL(t):n.Error("Error intersecting polylines")),void(d&&(e.OutIdx<0?this.DeleteFromAEL(e):n.Error("Error intersecting polylines")));if(t.PolyTyp==e.PolyTyp)if(this.IsEvenOddFillType(t)){var f=t.WindCnt;t.WindCnt=e.WindCnt,e.WindCnt=f}else t.WindCnt+e.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt+=e.WindDelta,e.WindCnt-t.WindDelta==0?e.WindCnt=-e.WindCnt:e.WindCnt-=t.WindDelta;else this.IsEvenOddFillType(e)?t.WindCnt2=0===t.WindCnt2?1:0:t.WindCnt2+=e.WindDelta,this.IsEvenOddFillType(t)?e.WindCnt2=0===e.WindCnt2?1:0:e.WindCnt2-=t.WindDelta;switch(t.PolyTyp==n.PolyType.ptSubject?(s=this.m_SubjFillType,o=this.m_ClipFillType):(s=this.m_ClipFillType,o=this.m_SubjFillType),e.PolyTyp==n.PolyType.ptSubject?(a=this.m_SubjFillType,l=this.m_ClipFillType):(a=this.m_ClipFillType,l=this.m_SubjFillType),s){case n.PolyFillType.pftPositive:h=t.WindCnt;break;case n.PolyFillType.pftNegative:h=-t.WindCnt;break;default:h=Math.abs(t.WindCnt)}switch(a){case n.PolyFillType.pftPositive:u=e.WindCnt;break;case n.PolyFillType.pftNegative:u=-e.WindCnt;break;default:u=Math.abs(e.WindCnt)}if(p&&m)c||d||0!==h&&1!=h||0!==u&&1!=u||t.PolyTyp!=e.PolyTyp&&this.m_ClipType!=n.ClipType.ctXor?this.AddLocalMaxPoly(t,e,i):(this.AddOutPt(t,i),this.AddOutPt(e,i),n.Clipper.SwapSides(t,e),n.Clipper.SwapPolyIndexes(t,e));else if(p)(0===u||1==u)&&(this.AddOutPt(t,i),n.Clipper.SwapSides(t,e),n.Clipper.SwapPolyIndexes(t,e));else if(m)(0===h||1==h)&&(this.AddOutPt(e,i),n.Clipper.SwapSides(t,e),n.Clipper.SwapPolyIndexes(t,e));else if(!(0!==h&&1!=h||0!==u&&1!=u||c||d)){var g,v;switch(o){case n.PolyFillType.pftPositive:g=t.WindCnt2;break;case n.PolyFillType.pftNegative:g=-t.WindCnt2;break;default:g=Math.abs(t.WindCnt2)}switch(l){case n.PolyFillType.pftPositive:v=e.WindCnt2;break;case n.PolyFillType.pftNegative:v=-e.WindCnt2;break;default:v=Math.abs(e.WindCnt2)}if(t.PolyTyp!=e.PolyTyp)this.AddLocalMinPoly(t,e,i);else if(1==h&&1==u)switch(this.m_ClipType){case n.ClipType.ctIntersection:g>0&&v>0&&this.AddLocalMinPoly(t,e,i);break;case n.ClipType.ctUnion:g<=0&&v<=0&&this.AddLocalMinPoly(t,e,i);break;case n.ClipType.ctDifference:(t.PolyTyp==n.PolyType.ptClip&&g>0&&v>0||t.PolyTyp==n.PolyType.ptSubject&&g<=0&&v<=0)&&this.AddLocalMinPoly(t,e,i);break;case n.ClipType.ctXor:this.AddLocalMinPoly(t,e,i)}else n.Clipper.SwapSides(t,e)}c!=d&&(c&&t.OutIdx>=0||d&&e.OutIdx>=0)&&(n.Clipper.SwapSides(t,e),n.Clipper.SwapPolyIndexes(t,e)),c&&this.DeleteFromAEL(t),d&&this.DeleteFromAEL(e)},n.Clipper.prototype.DeleteFromAEL=function(t){var e=t.PrevInAEL,i=t.NextInAEL;null===e&&null===i&&t!=this.m_ActiveEdges||(null!==e?e.NextInAEL=i:this.m_ActiveEdges=i,null!==i&&(i.PrevInAEL=e),t.NextInAEL=null,t.PrevInAEL=null)},n.Clipper.prototype.DeleteFromSEL=function(t){var e=t.PrevInSEL,i=t.NextInSEL;null===e&&null===i&&t!=this.m_SortedEdges||(null!==e?e.NextInSEL=i:this.m_SortedEdges=i,null!==i&&(i.PrevInSEL=e),t.NextInSEL=null,t.PrevInSEL=null)},n.Clipper.prototype.UpdateEdgeIntoAEL=function(t){null===t.NextInLML&&n.Error("UpdateEdgeIntoAEL: invalid call");var e=t.PrevInAEL,i=t.NextInAEL;return t.NextInLML.OutIdx=t.OutIdx,null!==e?e.NextInAEL=t.NextInLML:this.m_ActiveEdges=t.NextInLML,null!==i&&(i.PrevInAEL=t.NextInLML),t.NextInLML.Side=t.Side,t.NextInLML.WindDelta=t.WindDelta,t.NextInLML.WindCnt=t.WindCnt,t.NextInLML.WindCnt2=t.WindCnt2,(t=t.NextInLML).Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.PrevInAEL=e,t.NextInAEL=i,n.ClipperBase.IsHorizontal(t)||this.InsertScanbeam(t.Top.Y),t},n.Clipper.prototype.ProcessHorizontals=function(t){for(var e=this.m_SortedEdges;null!==e;)this.DeleteFromSEL(e),this.ProcessHorizontal(e,t),e=this.m_SortedEdges},n.Clipper.prototype.GetHorzDirection=function(t,e){t.Bot.X<t.Top.X?(e.Left=t.Bot.X,e.Right=t.Top.X,e.Dir=n.Direction.dLeftToRight):(e.Left=t.Top.X,e.Right=t.Bot.X,e.Dir=n.Direction.dRightToLeft)},n.Clipper.prototype.PrepareHorzJoins=function(t,e){var i=this.m_PolyOuts[t.OutIdx].Pts;t.Side!=n.EdgeSide.esLeft&&(i=i.Prev),e&&(n.IntPoint.op_Equality(i.Pt,t.Top)?this.AddGhostJoin(i,t.Bot):this.AddGhostJoin(i,t.Top))},n.Clipper.prototype.ProcessHorizontal=function(t,e){var i={Dir:null,Left:null,Right:null};this.GetHorzDirection(t,i);for(var r=i.Dir,s=i.Left,a=i.Right,o=t,l=null;null!==o.NextInLML&&n.ClipperBase.IsHorizontal(o.NextInLML);)o=o.NextInLML;for(null===o.NextInLML&&(l=this.GetMaximaPair(o));;){for(var h=t==o,u=this.GetNextInAEL(t,r);null!==u&&!(u.Curr.X==t.Top.X&&null!==t.NextInLML&&u.Dx<t.NextInLML.Dx);){var c=this.GetNextInAEL(u,r);if(r==n.Direction.dLeftToRight&&u.Curr.X<=a||r==n.Direction.dRightToLeft&&u.Curr.X>=s){if(t.OutIdx>=0&&0!=t.WindDelta&&this.PrepareHorzJoins(t,e),u==l&&h)return r==n.Direction.dLeftToRight?this.IntersectEdges(t,u,u.Top,!1):this.IntersectEdges(u,t,u.Top,!1),void(l.OutIdx>=0&&n.Error("ProcessHorizontal error"));if(r==n.Direction.dLeftToRight){var d=new n.IntPoint(u.Curr.X,t.Curr.Y);this.IntersectEdges(t,u,d,!0)}else{d=new n.IntPoint(u.Curr.X,t.Curr.Y);this.IntersectEdges(u,t,d,!0)}this.SwapPositionsInAEL(t,u)}else if(r==n.Direction.dLeftToRight&&u.Curr.X>=a||r==n.Direction.dRightToLeft&&u.Curr.X<=s)break;u=c}if(t.OutIdx>=0&&0!==t.WindDelta&&this.PrepareHorzJoins(t,e),null===t.NextInLML||!n.ClipperBase.IsHorizontal(t.NextInLML))break;(t=this.UpdateEdgeIntoAEL(t)).OutIdx>=0&&this.AddOutPt(t,t.Bot);i={Dir:r,Left:s,Right:a};this.GetHorzDirection(t,i),r=i.Dir,s=i.Left,a=i.Right}if(null!==t.NextInLML)if(t.OutIdx>=0){var p=this.AddOutPt(t,t.Top);if(0===(t=this.UpdateEdgeIntoAEL(t)).WindDelta)return;var m=t.PrevInAEL;c=t.NextInAEL;if(null!==m&&m.Curr.X==t.Bot.X&&m.Curr.Y==t.Bot.Y&&0!==m.WindDelta&&m.OutIdx>=0&&m.Curr.Y>m.Top.Y&&n.ClipperBase.SlopesEqual(t,m,this.m_UseFullRange)){var f=this.AddOutPt(m,t.Bot);this.AddJoin(p,f,t.Top)}else if(null!==c&&c.Curr.X==t.Bot.X&&c.Curr.Y==t.Bot.Y&&0!==c.WindDelta&&c.OutIdx>=0&&c.Curr.Y>c.Top.Y&&n.ClipperBase.SlopesEqual(t,c,this.m_UseFullRange)){f=this.AddOutPt(c,t.Bot);this.AddJoin(p,f,t.Top)}}else t=this.UpdateEdgeIntoAEL(t);else null!==l?l.OutIdx>=0?(r==n.Direction.dLeftToRight?this.IntersectEdges(t,l,t.Top,!1):this.IntersectEdges(l,t,t.Top,!1),l.OutIdx>=0&&n.Error("ProcessHorizontal error")):(this.DeleteFromAEL(t),this.DeleteFromAEL(l)):(t.OutIdx>=0&&this.AddOutPt(t,t.Top),this.DeleteFromAEL(t))},n.Clipper.prototype.GetNextInAEL=function(t,e){return e==n.Direction.dLeftToRight?t.NextInAEL:t.PrevInAEL},n.Clipper.prototype.IsMinima=function(t){return null!==t&&t.Prev.NextInLML!=t&&t.Next.NextInLML!=t},n.Clipper.prototype.IsMaxima=function(t,e){return null!==t&&t.Top.Y==e&&null===t.NextInLML},n.Clipper.prototype.IsIntermediate=function(t,e){return t.Top.Y==e&&null!==t.NextInLML},n.Clipper.prototype.GetMaximaPair=function(t){var e=null;return n.IntPoint.op_Equality(t.Next.Top,t.Top)&&null===t.Next.NextInLML?e=t.Next:n.IntPoint.op_Equality(t.Prev.Top,t.Top)&&null===t.Prev.NextInLML&&(e=t.Prev),null===e||-2!=e.OutIdx&&(e.NextInAEL!=e.PrevInAEL||n.ClipperBase.IsHorizontal(e))?e:null},n.Clipper.prototype.ProcessIntersections=function(t,e){if(null==this.m_ActiveEdges)return!0;try{if(this.BuildIntersectList(t,e),0==this.m_IntersectList.length)return!0;if(1!=this.m_IntersectList.length&&!this.FixupIntersectionOrder())return!1;this.ProcessIntersectList()}catch(t){this.m_SortedEdges=null,this.m_IntersectList.length=0,n.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0},n.Clipper.prototype.BuildIntersectList=function(t,e){if(null!==this.m_ActiveEdges){var i=this.m_ActiveEdges;for(this.m_SortedEdges=i;null!==i;)i.PrevInSEL=i.PrevInAEL,i.NextInSEL=i.NextInAEL,i.Curr.X=n.Clipper.TopX(i,e),i=i.NextInAEL;for(var r=!0;r&&null!==this.m_SortedEdges;){for(r=!1,i=this.m_SortedEdges;null!==i.NextInSEL;){var s=i.NextInSEL,a=new n.IntPoint;if(i.Curr.X>s.Curr.X){!this.IntersectPoint(i,s,a)&&i.Curr.X>s.Curr.X+1&&n.Error("Intersection error"),a.Y>t&&(a.Y=t,Math.abs(i.Dx)>Math.abs(s.Dx)?a.X=n.Clipper.TopX(s,t):a.X=n.Clipper.TopX(i,t));var o=new n.IntersectNode;o.Edge1=i,o.Edge2=s,o.Pt.X=a.X,o.Pt.Y=a.Y,this.m_IntersectList.push(o),this.SwapPositionsInSEL(i,s),r=!0}else i=s}if(null===i.PrevInSEL)break;i.PrevInSEL.NextInSEL=null}this.m_SortedEdges=null}},n.Clipper.prototype.EdgesAdjacent=function(t){return t.Edge1.NextInSEL==t.Edge2||t.Edge1.PrevInSEL==t.Edge2},n.Clipper.IntersectNodeSort=function(t,e){return e.Pt.Y-t.Pt.Y},n.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var t=this.m_IntersectList.length,e=0;e<t;e++){if(!this.EdgesAdjacent(this.m_IntersectList[e])){for(var i=e+1;i<t&&!this.EdgesAdjacent(this.m_IntersectList[i]);)i++;if(i==t)return!1;var n=this.m_IntersectList[e];this.m_IntersectList[e]=this.m_IntersectList[i],this.m_IntersectList[i]=n}this.SwapPositionsInSEL(this.m_IntersectList[e].Edge1,this.m_IntersectList[e].Edge2)}return!0},n.Clipper.prototype.ProcessIntersectList=function(){for(var t=0,e=this.m_IntersectList.length;t<e;t++){var i=this.m_IntersectList[t];this.IntersectEdges(i.Edge1,i.Edge2,i.Pt,!0),this.SwapPositionsInAEL(i.Edge1,i.Edge2)}this.m_IntersectList.length=0};var fe=h((function(t){return t<0?Math.ceil(t-.5):Math.round(t)}),"R1"),ge=h((function(t){return t<0?Math.ceil(t-.5):Math.floor(t+.5)}),"R2"),ve=h((function(t){return t<0?-Math.round(Math.abs(t)):Math.round(t)}),"R3"),ye=h((function(t){return t<0?(t-=.5)<-2147483648?Math.ceil(t):0|t:(t+=.5)>2147483647?Math.floor(t):0|t}),"R4");a.msie?n.Clipper.Round=fe:a.chromium?n.Clipper.Round=ve:a.safari?n.Clipper.Round=ye:n.Clipper.Round=ge,n.Clipper.TopX=function(t,e){return e==t.Top.Y?t.Top.X:t.Bot.X+n.Clipper.Round(t.Dx*(e-t.Bot.Y))},n.Clipper.prototype.IntersectPoint=function(t,e,i){var r,s;if(i.X=0,i.Y=0,n.ClipperBase.SlopesEqual(t,e,this.m_UseFullRange)||t.Dx==e.Dx)return e.Bot.Y>t.Bot.Y?(i.X=e.Bot.X,i.Y=e.Bot.Y):(i.X=t.Bot.X,i.Y=t.Bot.Y),!1;if(0===t.Delta.X)i.X=t.Bot.X,n.ClipperBase.IsHorizontal(e)?i.Y=e.Bot.Y:(s=e.Bot.Y-e.Bot.X/e.Dx,i.Y=n.Clipper.Round(i.X/e.Dx+s));else if(0===e.Delta.X)i.X=e.Bot.X,n.ClipperBase.IsHorizontal(t)?i.Y=t.Bot.Y:(r=t.Bot.Y-t.Bot.X/t.Dx,i.Y=n.Clipper.Round(i.X/t.Dx+r));else{r=t.Bot.X-t.Bot.Y*t.Dx;var a=((s=e.Bot.X-e.Bot.Y*e.Dx)-r)/(t.Dx-e.Dx);i.Y=n.Clipper.Round(a),Math.abs(t.Dx)<Math.abs(e.Dx)?i.X=n.Clipper.Round(t.Dx*a+r):i.X=n.Clipper.Round(e.Dx*a+s)}if(i.Y<t.Top.Y||i.Y<e.Top.Y){if(t.Top.Y>e.Top.Y)return i.Y=t.Top.Y,i.X=n.Clipper.TopX(e,t.Top.Y),i.X<t.Top.X;i.Y=e.Top.Y,Math.abs(t.Dx)<Math.abs(e.Dx)?i.X=n.Clipper.TopX(t,i.Y):i.X=n.Clipper.TopX(e,i.Y)}return!0},n.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(t){for(var e=this.m_ActiveEdges;null!==e;){var i=this.IsMaxima(e,t);if(i){var r=this.GetMaximaPair(e);i=null===r||!n.ClipperBase.IsHorizontal(r)}if(i){var s=e.PrevInAEL;this.DoMaxima(e),e=null===s?this.m_ActiveEdges:s.NextInAEL}else{if(this.IsIntermediate(e,t)&&n.ClipperBase.IsHorizontal(e.NextInLML)?((e=this.UpdateEdgeIntoAEL(e)).OutIdx>=0&&this.AddOutPt(e,e.Bot),this.AddEdgeToSEL(e)):(e.Curr.X=n.Clipper.TopX(e,t),e.Curr.Y=t),this.StrictlySimple){s=e.PrevInAEL;if(e.OutIdx>=0&&0!==e.WindDelta&&null!==s&&s.OutIdx>=0&&s.Curr.X==e.Curr.X&&0!==s.WindDelta){var a=this.AddOutPt(s,e.Curr),o=this.AddOutPt(e,e.Curr);this.AddJoin(a,o,e.Curr)}}e=e.NextInAEL}}for(this.ProcessHorizontals(!0),e=this.m_ActiveEdges;null!==e;){if(this.IsIntermediate(e,t)){a=null;e.OutIdx>=0&&(a=this.AddOutPt(e,e.Top));s=(e=this.UpdateEdgeIntoAEL(e)).PrevInAEL;var l=e.NextInAEL;if(null!==s&&s.Curr.X==e.Bot.X&&s.Curr.Y==e.Bot.Y&&null!==a&&s.OutIdx>=0&&s.Curr.Y>s.Top.Y&&n.ClipperBase.SlopesEqual(e,s,this.m_UseFullRange)&&0!==e.WindDelta&&0!==s.WindDelta){o=this.AddOutPt(s,e.Bot);this.AddJoin(a,o,e.Top)}else if(null!==l&&l.Curr.X==e.Bot.X&&l.Curr.Y==e.Bot.Y&&null!==a&&l.OutIdx>=0&&l.Curr.Y>l.Top.Y&&n.ClipperBase.SlopesEqual(e,l,this.m_UseFullRange)&&0!==e.WindDelta&&0!==l.WindDelta){o=this.AddOutPt(l,e.Bot);this.AddJoin(a,o,e.Top)}}e=e.NextInAEL}},n.Clipper.prototype.DoMaxima=function(t){var e=this.GetMaximaPair(t);if(null===e)return t.OutIdx>=0&&this.AddOutPt(t,t.Top),void this.DeleteFromAEL(t);for(var i=t.NextInAEL;null!==i&&i!=e;)this.IntersectEdges(t,i,t.Top,!0),this.SwapPositionsInAEL(t,i),i=t.NextInAEL;-1==t.OutIdx&&-1==e.OutIdx?(this.DeleteFromAEL(t),this.DeleteFromAEL(e)):t.OutIdx>=0&&e.OutIdx>=0?this.IntersectEdges(t,e,t.Top,!1):0===t.WindDelta?(t.OutIdx>=0&&(this.AddOutPt(t,t.Top),t.OutIdx=-1),this.DeleteFromAEL(t),e.OutIdx>=0&&(this.AddOutPt(e,t.Top),e.OutIdx=-1),this.DeleteFromAEL(e)):n.Error("DoMaxima error")},n.Clipper.ReversePaths=function(t){for(var e=0,i=t.length;e<i;e++)t[e].reverse()},n.Clipper.Orientation=function(t){return n.Clipper.Area(t)>=0},n.Clipper.prototype.PointCount=function(t){if(null===t)return 0;var e=0,i=t;do{e++,i=i.Next}while(i!=t);return e},n.Clipper.prototype.BuildResult=function(t){n.Clear(t);for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var r=this.m_PolyOuts[e];if(null!==r.Pts){var s=r.Pts.Prev,a=this.PointCount(s);if(!(a<2)){for(var o=new Array(a),l=0;l<a;l++)o[l]=s.Pt,s=s.Prev;t.push(o)}}}},n.Clipper.prototype.BuildResult2=function(t){t.Clear();for(var e=0,i=this.m_PolyOuts.length;e<i;e++){var r=this.m_PolyOuts[e],s=this.PointCount(r.Pts);if(!(r.IsOpen&&s<2||!r.IsOpen&&s<3)){this.FixHoleLinkage(r);var a=new n.PolyNode;t.m_AllPolys.push(a),r.PolyNode=a,a.m_polygon.length=s;for(var o=r.Pts.Prev,l=0;l<s;l++)a.m_polygon[l]=o.Pt,o=o.Prev}}for(e=0,i=this.m_PolyOuts.length;e<i;e++){null!==(r=this.m_PolyOuts[e]).PolyNode&&(r.IsOpen?(r.PolyNode.IsOpen=!0,t.AddChild(r.PolyNode)):null!==r.FirstLeft&&null!=r.FirstLeft.PolyNode?r.FirstLeft.PolyNode.AddChild(r.PolyNode):t.AddChild(r.PolyNode))}},n.Clipper.prototype.FixupOutPolygon=function(t){var e=null;t.BottomPt=null;for(var i=t.Pts;;){if(i.Prev==i||i.Prev==i.Next)return this.DisposeOutPts(i),void(t.Pts=null);if(n.IntPoint.op_Equality(i.Pt,i.Next.Pt)||n.IntPoint.op_Equality(i.Pt,i.Prev.Pt)||n.ClipperBase.SlopesEqual(i.Prev.Pt,i.Pt,i.Next.Pt,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(i.Prev.Pt,i.Pt,i.Next.Pt))){e=null;i.Prev.Next=i.Next,i.Next.Prev=i.Prev,i=i.Prev,null}else{if(i==e)break;null===e&&(e=i),i=i.Next}}t.Pts=i},n.Clipper.prototype.DupOutPt=function(t,e){var i=new n.OutPt;return i.Pt.X=t.Pt.X,i.Pt.Y=t.Pt.Y,i.Idx=t.Idx,e?(i.Next=t.Next,i.Prev=t,t.Next.Prev=i,t.Next=i):(i.Prev=t.Prev,i.Next=t,t.Prev.Next=i,t.Prev=i),i},n.Clipper.prototype.GetOverlap=function(t,e,i,n,r){return t<e?i<n?(r.Left=Math.max(t,i),r.Right=Math.min(e,n)):(r.Left=Math.max(t,n),r.Right=Math.min(e,i)):i<n?(r.Left=Math.max(e,i),r.Right=Math.min(t,n)):(r.Left=Math.max(e,n),r.Right=Math.min(t,i)),r.Left<r.Right},n.Clipper.prototype.JoinHorz=function(t,e,i,r,s,a){var o=t.Pt.X>e.Pt.X?n.Direction.dRightToLeft:n.Direction.dLeftToRight,l=i.Pt.X>r.Pt.X?n.Direction.dRightToLeft:n.Direction.dLeftToRight;if(o==l)return!1;if(o==n.Direction.dLeftToRight){for(;t.Next.Pt.X<=s.X&&t.Next.Pt.X>=t.Pt.X&&t.Next.Pt.Y==s.Y;)t=t.Next;a&&t.Pt.X!=s.X&&(t=t.Next),e=this.DupOutPt(t,!a),n.IntPoint.op_Inequality(e.Pt,s)&&((t=e).Pt.X=s.X,t.Pt.Y=s.Y,e=this.DupOutPt(t,!a))}else{for(;t.Next.Pt.X>=s.X&&t.Next.Pt.X<=t.Pt.X&&t.Next.Pt.Y==s.Y;)t=t.Next;!a&&t.Pt.X!=s.X&&(t=t.Next),e=this.DupOutPt(t,a),n.IntPoint.op_Inequality(e.Pt,s)&&((t=e).Pt.X=s.X,t.Pt.Y=s.Y,e=this.DupOutPt(t,a))}if(l==n.Direction.dLeftToRight){for(;i.Next.Pt.X<=s.X&&i.Next.Pt.X>=i.Pt.X&&i.Next.Pt.Y==s.Y;)i=i.Next;a&&i.Pt.X!=s.X&&(i=i.Next),r=this.DupOutPt(i,!a),n.IntPoint.op_Inequality(r.Pt,s)&&((i=r).Pt.X=s.X,i.Pt.Y=s.Y,r=this.DupOutPt(i,!a))}else{for(;i.Next.Pt.X>=s.X&&i.Next.Pt.X<=i.Pt.X&&i.Next.Pt.Y==s.Y;)i=i.Next;!a&&i.Pt.X!=s.X&&(i=i.Next),r=this.DupOutPt(i,a),n.IntPoint.op_Inequality(r.Pt,s)&&((i=r).Pt.X=s.X,i.Pt.Y=s.Y,r=this.DupOutPt(i,a))}return o==n.Direction.dLeftToRight==a?(t.Prev=i,i.Next=t,e.Next=r,r.Prev=e):(t.Next=i,i.Prev=t,e.Prev=r,r.Next=e),!0},n.Clipper.prototype.JoinPoints=function(t,e,i){var r=t.OutPt1,s=new n.OutPt,a=t.OutPt2,o=new n.OutPt,l=t.OutPt1.Pt.Y==t.OffPt.Y;if(l&&n.IntPoint.op_Equality(t.OffPt,t.OutPt1.Pt)&&n.IntPoint.op_Equality(t.OffPt,t.OutPt2.Pt)){for(s=t.OutPt1.Next;s!=r&&n.IntPoint.op_Equality(s.Pt,t.OffPt);)s=s.Next;var h=s.Pt.Y>t.OffPt.Y;for(o=t.OutPt2.Next;o!=a&&n.IntPoint.op_Equality(o.Pt,t.OffPt);)o=o.Next;return h!=o.Pt.Y>t.OffPt.Y&&(h?(s=this.DupOutPt(r,!1),o=this.DupOutPt(a,!0),r.Prev=a,a.Next=r,s.Next=o,o.Prev=s,t.OutPt1=r,t.OutPt2=s,!0):(s=this.DupOutPt(r,!0),o=this.DupOutPt(a,!1),r.Next=a,a.Prev=r,s.Prev=o,o.Next=s,t.OutPt1=r,t.OutPt2=s,!0))}if(l){for(s=r;r.Prev.Pt.Y==r.Pt.Y&&r.Prev!=s&&r.Prev!=a;)r=r.Prev;for(;s.Next.Pt.Y==s.Pt.Y&&s.Next!=r&&s.Next!=a;)s=s.Next;if(s.Next==r||s.Next==a)return!1;for(o=a;a.Prev.Pt.Y==a.Pt.Y&&a.Prev!=o&&a.Prev!=s;)a=a.Prev;for(;o.Next.Pt.Y==o.Pt.Y&&o.Next!=a&&o.Next!=r;)o=o.Next;if(o.Next==a||o.Next==r)return!1;var u={Left:null,Right:null};if(!this.GetOverlap(r.Pt.X,s.Pt.X,a.Pt.X,o.Pt.X,u))return!1;var c,d=u.Left,p=u.Right,m=new n.IntPoint;return r.Pt.X>=d&&r.Pt.X<=p?(m.X=r.Pt.X,m.Y=r.Pt.Y,c=r.Pt.X>s.Pt.X):a.Pt.X>=d&&a.Pt.X<=p?(m.X=a.Pt.X,m.Y=a.Pt.Y,c=a.Pt.X>o.Pt.X):s.Pt.X>=d&&s.Pt.X<=p?(m.X=s.Pt.X,m.Y=s.Pt.Y,c=s.Pt.X>r.Pt.X):(m.X=o.Pt.X,m.Y=o.Pt.Y,c=o.Pt.X>a.Pt.X),t.OutPt1=r,t.OutPt2=a,this.JoinHorz(r,s,a,o,m,c)}for(s=r.Next;n.IntPoint.op_Equality(s.Pt,r.Pt)&&s!=r;)s=s.Next;var f=s.Pt.Y>r.Pt.Y||!n.ClipperBase.SlopesEqual(r.Pt,s.Pt,t.OffPt,this.m_UseFullRange);if(f){for(s=r.Prev;n.IntPoint.op_Equality(s.Pt,r.Pt)&&s!=r;)s=s.Prev;if(s.Pt.Y>r.Pt.Y||!n.ClipperBase.SlopesEqual(r.Pt,s.Pt,t.OffPt,this.m_UseFullRange))return!1}for(o=a.Next;n.IntPoint.op_Equality(o.Pt,a.Pt)&&o!=a;)o=o.Next;var g=o.Pt.Y>a.Pt.Y||!n.ClipperBase.SlopesEqual(a.Pt,o.Pt,t.OffPt,this.m_UseFullRange);if(g){for(o=a.Prev;n.IntPoint.op_Equality(o.Pt,a.Pt)&&o!=a;)o=o.Prev;if(o.Pt.Y>a.Pt.Y||!n.ClipperBase.SlopesEqual(a.Pt,o.Pt,t.OffPt,this.m_UseFullRange))return!1}return s!=r&&o!=a&&s!=o&&(e!=i||f!=g)&&(f?(s=this.DupOutPt(r,!1),o=this.DupOutPt(a,!0),r.Prev=a,a.Next=r,s.Next=o,o.Prev=s,t.OutPt1=r,t.OutPt2=s,!0):(s=this.DupOutPt(r,!0),o=this.DupOutPt(a,!1),r.Next=a,a.Prev=r,s.Prev=o,o.Next=s,t.OutPt1=r,t.OutPt2=s,!0))},n.Clipper.GetBounds=function(t){for(var e=0,i=t.length;e<i&&0==t[e].length;)e++;if(e==i)return new n.IntRect(0,0,0,0);var r=new n.IntRect;for(r.left=t[e][0].X,r.right=r.left,r.top=t[e][0].Y,r.bottom=r.top;e<i;e++)for(var s=0,a=t[e].length;s<a;s++)t[e][s].X<r.left?r.left=t[e][s].X:t[e][s].X>r.right&&(r.right=t[e][s].X),t[e][s].Y<r.top?r.top=t[e][s].Y:t[e][s].Y>r.bottom&&(r.bottom=t[e][s].Y);return r},n.Clipper.prototype.GetBounds2=function(t){var e=t,i=new n.IntRect;for(i.left=t.Pt.X,i.right=t.Pt.X,i.top=t.Pt.Y,i.bottom=t.Pt.Y,t=t.Next;t!=e;)t.Pt.X<i.left&&(i.left=t.Pt.X),t.Pt.X>i.right&&(i.right=t.Pt.X),t.Pt.Y<i.top&&(i.top=t.Pt.Y),t.Pt.Y>i.bottom&&(i.bottom=t.Pt.Y),t=t.Next;return i},n.Clipper.PointInPolygon=function(t,e){var i=0,n=e.length;if(n<3)return 0;for(var r=e[0],s=1;s<=n;++s){var a=s==n?e[0]:e[s];if(a.Y==t.Y&&(a.X==t.X||r.Y==t.Y&&a.X>t.X==r.X<t.X))return-1;if(r.Y<t.Y!=a.Y<t.Y)if(r.X>=t.X)if(a.X>t.X)i=1-i;else{if(0==(o=(r.X-t.X)*(a.Y-t.Y)-(a.X-t.X)*(r.Y-t.Y)))return-1;o>0==a.Y>r.Y&&(i=1-i)}else if(a.X>t.X){var o;if(0==(o=(r.X-t.X)*(a.Y-t.Y)-(a.X-t.X)*(r.Y-t.Y)))return-1;o>0==a.Y>r.Y&&(i=1-i)}r=a}return i},n.Clipper.prototype.PointInPolygon=function(t,e){for(var i=0,n=e;;){var r=e.Pt.X,s=e.Pt.Y,a=e.Next.Pt.X,o=e.Next.Pt.Y;if(o==t.Y&&(a==t.X||s==t.Y&&a>t.X==r<t.X))return-1;if(s<t.Y!=o<t.Y)if(r>=t.X)if(a>t.X)i=1-i;else{if(0==(l=(r-t.X)*(o-t.Y)-(a-t.X)*(s-t.Y)))return-1;l>0==o>s&&(i=1-i)}else if(a>t.X){var l;if(0==(l=(r-t.X)*(o-t.Y)-(a-t.X)*(s-t.Y)))return-1;l>0==o>s&&(i=1-i)}if(n==(e=e.Next))break}return i},n.Clipper.prototype.Poly2ContainsPoly1=function(t,e){var i=t;do{var n=this.PointInPolygon(i.Pt,e);if(n>=0)return 0!=n;i=i.Next}while(i!=t);return!0},n.Clipper.prototype.FixupFirstLefts1=function(t,e){for(var i=0,n=this.m_PolyOuts.length;i<n;i++){var r=this.m_PolyOuts[i];null!==r.Pts&&r.FirstLeft==t&&this.Poly2ContainsPoly1(r.Pts,e.Pts)&&(r.FirstLeft=e)}},n.Clipper.prototype.FixupFirstLefts2=function(t,e){for(var i=0,n=this.m_PolyOuts,r=n.length,s=n[i];i<r;s=n[++i])s.FirstLeft==t&&(s.FirstLeft=e)},n.Clipper.ParseFirstLeft=function(t){for(;null!=t&&null==t.Pts;)t=t.FirstLeft;return t},n.Clipper.prototype.JoinCommonEdges=function(){for(var t=0,e=this.m_Joins.length;t<e;t++){var i,r=this.m_Joins[t],s=this.GetOutRec(r.OutPt1.Idx),a=this.GetOutRec(r.OutPt2.Idx);if(null!=s.Pts&&null!=a.Pts)if(i=s==a?s:this.Param1RightOfParam2(s,a)?a:this.Param1RightOfParam2(a,s)?s:this.GetLowermostRec(s,a),this.JoinPoints(r,s,a))if(s==a){if(s.Pts=r.OutPt1,s.BottomPt=null,(a=this.CreateOutRec()).Pts=r.OutPt2,this.UpdateOutPtIdxs(a),this.m_UsingPolyTree)for(var o=0,l=this.m_PolyOuts.length;o<l-1;o++){var h=this.m_PolyOuts[o];null==h.Pts||n.Clipper.ParseFirstLeft(h.FirstLeft)!=s||h.IsHole==s.IsHole||this.Poly2ContainsPoly1(h.Pts,r.OutPt2)&&(h.FirstLeft=a)}this.Poly2ContainsPoly1(a.Pts,s.Pts)?(a.IsHole=!s.IsHole,a.FirstLeft=s,this.m_UsingPolyTree&&this.FixupFirstLefts2(a,s),(a.IsHole^this.ReverseSolution)==this.Area(a)>0&&this.ReversePolyPtLinks(a.Pts)):this.Poly2ContainsPoly1(s.Pts,a.Pts)?(a.IsHole=s.IsHole,s.IsHole=!a.IsHole,a.FirstLeft=s.FirstLeft,s.FirstLeft=a,this.m_UsingPolyTree&&this.FixupFirstLefts2(s,a),(s.IsHole^this.ReverseSolution)==this.Area(s)>0&&this.ReversePolyPtLinks(s.Pts)):(a.IsHole=s.IsHole,a.FirstLeft=s.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(s,a))}else a.Pts=null,a.BottomPt=null,a.Idx=s.Idx,s.IsHole=i.IsHole,i==a&&(s.FirstLeft=a.FirstLeft),a.FirstLeft=s,this.m_UsingPolyTree&&this.FixupFirstLefts2(a,s)}},n.Clipper.prototype.UpdateOutPtIdxs=function(t){var e=t.Pts;do{e.Idx=t.Idx,e=e.Prev}while(e!=t.Pts)},n.Clipper.prototype.DoSimplePolygons=function(){for(var t=0;t<this.m_PolyOuts.length;){var e=this.m_PolyOuts[t++],i=e.Pts;if(null!==i)do{for(var r=i.Next;r!=e.Pts;){if(n.IntPoint.op_Equality(i.Pt,r.Pt)&&r.Next!=i&&r.Prev!=i){var s=i.Prev,a=r.Prev;i.Prev=a,a.Next=i,r.Prev=s,s.Next=r,e.Pts=i;var o=this.CreateOutRec();o.Pts=r,this.UpdateOutPtIdxs(o),this.Poly2ContainsPoly1(o.Pts,e.Pts)?(o.IsHole=!e.IsHole,o.FirstLeft=e):this.Poly2ContainsPoly1(e.Pts,o.Pts)?(o.IsHole=e.IsHole,e.IsHole=!o.IsHole,o.FirstLeft=e.FirstLeft,e.FirstLeft=o):(o.IsHole=e.IsHole,o.FirstLeft=e.FirstLeft),r=i}r=r.Next}i=i.Next}while(i!=e.Pts)}},n.Clipper.Area=function(t){var e=t.length;if(e<3)return 0;for(var i=0,n=0,r=e-1;n<e;++n)i+=(t[r].X+t[n].X)*(t[r].Y-t[n].Y),r=n;return.5*-i},n.Clipper.prototype.Area=function(t){var e=t.Pts;if(null==e)return 0;var i=0;do{i+=(e.Prev.Pt.X+e.Pt.X)*(e.Prev.Pt.Y-e.Pt.Y),e=e.Next}while(e!=t.Pts);return.5*i},n.Clipper.SimplifyPolygon=function(t,e){var i=new Array,r=new n.Clipper(0);return r.StrictlySimple=!0,r.AddPath(t,n.PolyType.ptSubject,!0),r.Execute(n.ClipType.ctUnion,i,e,e),i},n.Clipper.SimplifyPolygons=function(t,e){void 0===e&&(e=n.PolyFillType.pftEvenOdd);var i=new Array,r=new n.Clipper(0);return r.StrictlySimple=!0,r.AddPaths(t,n.PolyType.ptSubject,!0),r.Execute(n.ClipType.ctUnion,i,e,e),i},n.Clipper.DistanceSqrd=function(t,e){var i=t.X-e.X,n=t.Y-e.Y;return i*i+n*n},n.Clipper.DistanceFromLineSqrd=function(t,e,i){var n=e.Y-i.Y,r=i.X-e.X,s=n*e.X+r*e.Y;return(s=n*t.X+r*t.Y-s)*s/(n*n+r*r)},n.Clipper.SlopesNearCollinear=function(t,e,i,r){return n.Clipper.DistanceFromLineSqrd(e,t,i)<r},n.Clipper.PointsAreClose=function(t,e,i){var n=t.X-e.X,r=t.Y-e.Y;return n*n+r*r<=i},n.Clipper.ExcludeOp=function(t){var e=t.Prev;return e.Next=t.Next,t.Next.Prev=e,e.Idx=0,e},n.Clipper.CleanPolygon=function(t,e){void 0===e&&(e=1.415);var i=t.length;if(0==i)return new Array;for(var r=new Array(i),s=0;s<i;++s)r[s]=new n.OutPt;for(s=0;s<i;++s)r[s].Pt=t[s],r[s].Next=r[(s+1)%i],r[s].Next.Prev=r[s],r[s].Idx=0;for(var a=e*e,o=r[0];0==o.Idx&&o.Next!=o.Prev;)n.Clipper.PointsAreClose(o.Pt,o.Prev.Pt,a)?(o=n.Clipper.ExcludeOp(o),i--):n.Clipper.PointsAreClose(o.Prev.Pt,o.Next.Pt,a)?(n.Clipper.ExcludeOp(o.Next),o=n.Clipper.ExcludeOp(o),i-=2):n.Clipper.SlopesNearCollinear(o.Prev.Pt,o.Pt,o.Next.Pt,a)?(o=n.Clipper.ExcludeOp(o),i--):(o.Idx=1,o=o.Next);i<3&&(i=0);var l=new Array(i);for(s=0;s<i;++s)l[s]=new n.IntPoint(o.Pt),o=o.Next;return r=null,l},n.Clipper.CleanPolygons=function(t,e){for(var i=new Array(t.length),r=0,s=t.length;r<s;r++)i[r]=n.Clipper.CleanPolygon(t[r],e);return i},n.Clipper.Minkowski=function(t,e,i,r){var s=r?1:0,a=t.length,o=e.length,l=new Array;if(i)for(var h=0;h<o;h++){for(var u=new Array(a),c=0,d=t.length,p=t[c];c<d;p=t[++c])u[c]=new n.IntPoint(e[h].X+p.X,e[h].Y+p.Y);l.push(u)}else for(h=0;h<o;h++){for(u=new Array(a),c=0,d=t.length,p=t[c];c<d;p=t[++c])u[c]=new n.IntPoint(e[h].X-p.X,e[h].Y-p.Y);l.push(u)}var m=new Array;for(h=0;h<o-1+s;h++)for(c=0;c<a;c++){var f=new Array;f.push(l[h%o][c%a]),f.push(l[(h+1)%o][c%a]),f.push(l[(h+1)%o][(c+1)%a]),f.push(l[h%o][(c+1)%a]),n.Clipper.Orientation(f)||f.reverse(),m.push(f)}var g=new n.Clipper(0);return g.AddPaths(m,n.PolyType.ptSubject,!0),g.Execute(n.ClipType.ctUnion,l,n.PolyFillType.pftNonZero,n.PolyFillType.pftNonZero),l},n.Clipper.MinkowskiSum=function(){var t=arguments,e=t.length;if(3==e){var i=t[0],r=t[1],s=t[2];return n.Clipper.Minkowski(i,r,!0,s)}if(4==e){i=t[0];for(var a=t[1],o=t[2],l=(s=t[3],new n.Clipper),h=0,u=a.length;h<u;++h){var c=n.Clipper.Minkowski(i,a[h],!0,s);l.AddPaths(c,n.PolyType.ptSubject,!0)}s&&l.AddPaths(a,n.PolyType.ptClip,!0);var d=new n.Paths;return l.Execute(n.ClipType.ctUnion,d,o,o),d}},n.Clipper.MinkowskiDiff=function(t,e,i){return n.Clipper.Minkowski(t,e,!1,i)},n.Clipper.PolyTreeToPaths=function(t){var e=new Array;return n.Clipper.AddPolyNodeToPaths(t,n.Clipper.NodeType.ntAny,e),e},n.Clipper.AddPolyNodeToPaths=function(t,e,i){var r=!0;switch(e){case n.Clipper.NodeType.ntOpen:return;case n.Clipper.NodeType.ntClosed:r=!t.IsOpen}t.m_polygon.length>0&&r&&i.push(t.m_polygon);for(var s=0,a=t.Childs(),o=a.length,l=a[s];s<o;l=a[++s])n.Clipper.AddPolyNodeToPaths(l,e,i)},n.Clipper.OpenPathsFromPolyTree=function(t){for(var e=new n.Paths,i=0,r=t.ChildCount();i<r;i++)t.Childs()[i].IsOpen&&e.push(t.Childs()[i].m_polygon);return e},n.Clipper.ClosedPathsFromPolyTree=function(t){var e=new n.Paths;return n.Clipper.AddPolyNodeToPaths(t,n.Clipper.NodeType.ntClosed,e),e},pe(n.Clipper,n.ClipperBase),n.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2},n.ClipperOffset=function(t,e){void 0===t&&(t=2),void 0===e&&(e=n.ClipperOffset.def_arc_tolerance),this.m_destPolys=new n.Paths,this.m_srcPoly=new n.Path,this.m_destPoly=new n.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new n.IntPoint,this.m_polyNodes=new n.PolyNode,this.MiterLimit=t,this.ArcTolerance=e,this.m_lowest.X=-1},n.ClipperOffset.two_pi=6.28318530717959,n.ClipperOffset.def_arc_tolerance=.25,n.ClipperOffset.prototype.Clear=function(){n.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1},n.ClipperOffset.Round=n.Clipper.Round,n.ClipperOffset.prototype.AddPath=function(t,e,i){var r=t.length-1;if(!(r<0)){var s=new n.PolyNode;if(s.m_jointype=e,s.m_endtype=i,i==n.EndType.etClosedLine||i==n.EndType.etClosedPolygon)for(;r>0&&n.IntPoint.op_Equality(t[0],t[r]);)r--;s.m_polygon.push(t[0]);for(var a=0,o=0,l=1;l<=r;l++)n.IntPoint.op_Inequality(s.m_polygon[a],t[l])&&(a++,s.m_polygon.push(t[l]),(t[l].Y>s.m_polygon[o].Y||t[l].Y==s.m_polygon[o].Y&&t[l].X<s.m_polygon[o].X)&&(o=a));if(!(i==n.EndType.etClosedPolygon&&a<2||i!=n.EndType.etClosedPolygon&&a<0)&&(this.m_polyNodes.AddChild(s),i==n.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new n.IntPoint(0,o);else{var h=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(s.m_polygon[o].Y>h.Y||s.m_polygon[o].Y==h.Y&&s.m_polygon[o].X<h.X)&&(this.m_lowest=new n.IntPoint(this.m_polyNodes.ChildCount()-1,o))}}},n.ClipperOffset.prototype.AddPaths=function(t,e,i){for(var n=0,r=t.length;n<r;n++)this.AddPath(t[n],e,i)},n.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!n.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var t=0;t<this.m_polyNodes.ChildCount();t++){((e=this.m_polyNodes.Childs()[t]).m_endtype==n.EndType.etClosedPolygon||e.m_endtype==n.EndType.etClosedLine&&n.Clipper.Orientation(e.m_polygon))&&e.m_polygon.reverse()}else for(t=0;t<this.m_polyNodes.ChildCount();t++){var e;(e=this.m_polyNodes.Childs()[t]).m_endtype==n.EndType.etClosedLine&&!n.Clipper.Orientation(e.m_polygon)&&e.m_polygon.reverse()}},n.ClipperOffset.GetUnitNormal=function(t,e){var i=e.X-t.X,r=e.Y-t.Y;if(0==i&&0==r)return new n.DoublePoint(0,0);var s=1/Math.sqrt(i*i+r*r);return i*=s,r*=s,new n.DoublePoint(r,-i)},n.ClipperOffset.prototype.DoOffset=function(t){if(this.m_destPolys=new Array,this.m_delta=t,n.ClipperBase.near_zero(t))for(var e=0;e<this.m_polyNodes.ChildCount();e++){(s=this.m_polyNodes.Childs()[e]).m_endtype==n.EndType.etClosedPolygon&&this.m_destPolys.push(s.m_polygon)}else{var i;this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5,i=this.ArcTolerance<=0?n.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(t)*n.ClipperOffset.def_arc_tolerance?Math.abs(t)*n.ClipperOffset.def_arc_tolerance:this.ArcTolerance;var r=3.14159265358979/Math.acos(1-i/Math.abs(t));this.m_sin=Math.sin(n.ClipperOffset.two_pi/r),this.m_cos=Math.cos(n.ClipperOffset.two_pi/r),this.m_StepsPerRad=r/n.ClipperOffset.two_pi,t<0&&(this.m_sin=-this.m_sin);for(e=0;e<this.m_polyNodes.ChildCount();e++){var s=this.m_polyNodes.Childs()[e];this.m_srcPoly=s.m_polygon;var a=this.m_srcPoly.length;if(!(0==a||t<=0&&(a<3||s.m_endtype!=n.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,1==a){if(s.m_jointype==n.JoinType.jtRound)for(var o=1,l=0,h=1;h<=r;h++){this.m_destPoly.push(new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[0].X+o*t),n.ClipperOffset.Round(this.m_srcPoly[0].Y+l*t)));var u=o;o=o*this.m_cos-this.m_sin*l,l=u*this.m_sin+l*this.m_cos}else for(o=-1,l=-1,h=0;h<4;++h)this.m_destPoly.push(new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[0].X+o*t),n.ClipperOffset.Round(this.m_srcPoly[0].Y+l*t))),o<0?o=1:l<0?l=1:o=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(h=0;h<a-1;h++)this.m_normals.push(n.ClipperOffset.GetUnitNormal(this.m_srcPoly[h],this.m_srcPoly[h+1]));if(s.m_endtype==n.EndType.etClosedLine||s.m_endtype==n.EndType.etClosedPolygon?this.m_normals.push(n.ClipperOffset.GetUnitNormal(this.m_srcPoly[a-1],this.m_srcPoly[0])):this.m_normals.push(new n.DoublePoint(this.m_normals[a-2])),s.m_endtype==n.EndType.etClosedPolygon){var c=a-1;for(h=0;h<a;h++)c=this.OffsetPoint(h,c,s.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(s.m_endtype==n.EndType.etClosedLine){for(c=a-1,h=0;h<a;h++)c=this.OffsetPoint(h,c,s.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;var d=this.m_normals[a-1];for(h=a-1;h>0;h--)this.m_normals[h]=new n.DoublePoint(-this.m_normals[h-1].X,-this.m_normals[h-1].Y);this.m_normals[0]=new n.DoublePoint(-d.X,-d.Y),c=0;for(h=a-1;h>=0;h--)c=this.OffsetPoint(h,c,s.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(c=0,h=1;h<a-1;++h)c=this.OffsetPoint(h,c,s.m_jointype);var p;if(s.m_endtype==n.EndType.etOpenButt){h=a-1;p=new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[h].X+this.m_normals[h].X*t),n.ClipperOffset.Round(this.m_srcPoly[h].Y+this.m_normals[h].Y*t)),this.m_destPoly.push(p),p=new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[h].X-this.m_normals[h].X*t),n.ClipperOffset.Round(this.m_srcPoly[h].Y-this.m_normals[h].Y*t)),this.m_destPoly.push(p)}else{h=a-1;c=a-2,this.m_sinA=0,this.m_normals[h]=new n.DoublePoint(-this.m_normals[h].X,-this.m_normals[h].Y),s.m_endtype==n.EndType.etOpenSquare?this.DoSquare(h,c):this.DoRound(h,c)}for(h=a-1;h>0;h--)this.m_normals[h]=new n.DoublePoint(-this.m_normals[h-1].X,-this.m_normals[h-1].Y);this.m_normals[0]=new n.DoublePoint(-this.m_normals[1].X,-this.m_normals[1].Y);for(h=(c=a-1)-1;h>0;--h)c=this.OffsetPoint(h,c,s.m_jointype);s.m_endtype==n.EndType.etOpenButt?(p=new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*t),n.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*t)),this.m_destPoly.push(p),p=new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*t),n.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*t)),this.m_destPoly.push(p)):(c=1,this.m_sinA=0,s.m_endtype==n.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}}},n.ClipperOffset.prototype.Execute=function(){var t=arguments,e=t[0]instanceof n.PolyTree;if(e){var i=t[0],r=t[1];if(i.Clear(),this.FixOrientations(),this.DoOffset(r),(l=new n.Clipper(0)).AddPaths(this.m_destPolys,n.PolyType.ptSubject,!0),r>0)l.Execute(n.ClipType.ctUnion,i,n.PolyFillType.pftPositive,n.PolyFillType.pftPositive);else{var s=n.Clipper.GetBounds(this.m_destPolys);if((h=new n.Path).push(new n.IntPoint(s.left-10,s.bottom+10)),h.push(new n.IntPoint(s.right+10,s.bottom+10)),h.push(new n.IntPoint(s.right+10,s.top-10)),h.push(new n.IntPoint(s.left-10,s.top-10)),l.AddPath(h,n.PolyType.ptSubject,!0),l.ReverseSolution=!0,l.Execute(n.ClipType.ctUnion,i,n.PolyFillType.pftNegative,n.PolyFillType.pftNegative),1==i.ChildCount()&&i.Childs()[0].ChildCount()>0){var a=i.Childs()[0];i.Childs()[0]=a.Childs()[0];for(var o=1;o<a.ChildCount();o++)i.AddChild(a.Childs()[o])}else i.Clear()}}else{var l;i=t[0],r=t[1];if(n.Clear(i),this.FixOrientations(),this.DoOffset(r),(l=new n.Clipper(0)).AddPaths(this.m_destPolys,n.PolyType.ptSubject,!0),r>0)l.Execute(n.ClipType.ctUnion,i,n.PolyFillType.pftPositive,n.PolyFillType.pftPositive);else{var h;s=n.Clipper.GetBounds(this.m_destPolys);(h=new n.Path).push(new n.IntPoint(s.left-10,s.bottom+10)),h.push(new n.IntPoint(s.right+10,s.bottom+10)),h.push(new n.IntPoint(s.right+10,s.top-10)),h.push(new n.IntPoint(s.left-10,s.top-10)),l.AddPath(h,n.PolyType.ptSubject,!0),l.ReverseSolution=!0,l.Execute(n.ClipType.ctUnion,i,n.PolyFillType.pftNegative,n.PolyFillType.pftNegative),i.length>0&&i.splice(0,1)}}},n.ClipperOffset.prototype.OffsetPoint=function(t,e,i){if(this.m_sinA=this.m_normals[e].X*this.m_normals[t].Y-this.m_normals[t].X*this.m_normals[e].Y,this.m_sinA<5e-5&&this.m_sinA>-5e-5)return e;if(this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1),this.m_sinA*this.m_delta<0)this.m_destPoly.push(new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[e].X*this.m_delta),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[e].Y*this.m_delta))),this.m_destPoly.push(new n.IntPoint(this.m_srcPoly[t])),this.m_destPoly.push(new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[t].X*this.m_delta),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[t].Y*this.m_delta)));else switch(i){case n.JoinType.jtMiter:var r=this.m_normals[t].X*this.m_normals[e].X+this.m_normals[t].Y*this.m_normals[e].Y+1;r>=this.m_miterLim?this.DoMiter(t,e,r):this.DoSquare(t,e);break;case n.JoinType.jtSquare:this.DoSquare(t,e);break;case n.JoinType.jtRound:this.DoRound(t,e)}return e=t},n.ClipperOffset.prototype.DoSquare=function(t,e){var i=Math.tan(Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y)/4);this.m_destPoly.push(new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_delta*(this.m_normals[e].X-this.m_normals[e].Y*i)),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_delta*(this.m_normals[e].Y+this.m_normals[e].X*i)))),this.m_destPoly.push(new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_delta*(this.m_normals[t].X+this.m_normals[t].Y*i)),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_delta*(this.m_normals[t].Y-this.m_normals[t].X*i))))},n.ClipperOffset.prototype.DoMiter=function(t,e,i){var r=this.m_delta/i;this.m_destPoly.push(new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[t].X+(this.m_normals[e].X+this.m_normals[t].X)*r),n.ClipperOffset.Round(this.m_srcPoly[t].Y+(this.m_normals[e].Y+this.m_normals[t].Y)*r)))},n.ClipperOffset.prototype.DoRound=function(t,e){for(var i,r=Math.atan2(this.m_sinA,this.m_normals[e].X*this.m_normals[t].X+this.m_normals[e].Y*this.m_normals[t].Y),s=n.Cast_Int32(n.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(r))),a=this.m_normals[e].X,o=this.m_normals[e].Y,l=0;l<s;++l)this.m_destPoly.push(new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[t].X+a*this.m_delta),n.ClipperOffset.Round(this.m_srcPoly[t].Y+o*this.m_delta))),i=a,a=a*this.m_cos-this.m_sin*o,o=i*this.m_sin+o*this.m_cos;this.m_destPoly.push(new n.IntPoint(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[t].X*this.m_delta),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[t].Y*this.m_delta)))},n.Error=function(t){try{throw new Error(t)}catch(t){alert(t.message)}},n.JS={},n.JS.AreaOfPolygon=function(t,e){return e||(e=1),n.Clipper.Area(t)/(e*e)},n.JS.AreaOfPolygons=function(t,e){e||(e=1);for(var i=0,r=0;r<t.length;r++)i+=n.Clipper.Area(t[r]);return i/(e*e)},n.JS.BoundsOfPath=function(t,e){return n.JS.BoundsOfPaths([t],e)},n.JS.BoundsOfPaths=function(t,e){e||(e=1);var i=n.Clipper.GetBounds(t);return i.left/=e,i.bottom/=e,i.right/=e,i.top/=e,i},n.JS.Clean=function(t,e){if(!(t instanceof Array))return[];var i=t[0]instanceof Array;t=n.JS.Clone(t);if("number"!=typeof e||null===e)return n.Error("Delta is not a number in Clean()."),t;if(0===t.length||1==t.length&&0===t[0].length||e<0)return t;i||(t=[t]);for(var r,s,a,o,l,h,u,c=t.length,d=[],p=0;p<c;p++)if(0!==(r=(s=t[p]).length)){if(r<3){a=s,d.push(a);continue}for(a=s,o=e*e,l=s[0],h=1,u=1;u<r;u++)(s[u].X-l.X)*(s[u].X-l.X)+(s[u].Y-l.Y)*(s[u].Y-l.Y)<=o||(a[h]=s[u],l=s[u],h++);l=s[h-1],(s[0].X-l.X)*(s[0].X-l.X)+(s[0].Y-l.Y)*(s[0].Y-l.Y)<=o&&h--,h<r&&a.splice(h,r-h),a.length&&d.push(a)}return!i&&d.length?d=d[0]:i||0!==d.length?i&&0===d.length&&(d=[[]]):d=[],d},n.JS.Clone=function(t){if(!(t instanceof Array))return[];if(0===t.length)return[];if(1==t.length&&0===t[0].length)return[[]];var e=t[0]instanceof Array;e||(t=[t]);var i,n,r,s,a=t.length,o=new Array(a);for(n=0;n<a;n++){for(i=t[n].length,s=new Array(i),r=0;r<i;r++)s[r]={X:t[n][r].X,Y:t[n][r].Y};o[n]=s}return e||(o=o[0]),o},n.JS.Lighten=function(t,e){if(!(t instanceof Array))return[];if("number"!=typeof e||null===e)return n.Error("Tolerance is not a number in Lighten()."),n.JS.Clone(t);if(0===t.length||1==t.length&&0===t[0].length||e<0)return n.JS.Clone(t);t[0]instanceof Array||(t=[t]);var i,r,s,a,o,l,h,u,c,d,p,m,f,g,v,y,_=t.length,x=e*e,b=[];for(i=0;i<_;i++)if(0!=(l=(s=t[i]).length)){for(a=0;a<1e6;a++){for(o=[],s[(l=s.length)-1].X!=s[0].X||s[l-1].Y!=s[0].Y?(p=1,s.push({X:s[0].X,Y:s[0].Y}),l=s.length):p=0,d=[],r=0;r<l-2;r++)h=s[r],c=s[r+1],u=s[r+2],v=h.X,y=h.Y,m=u.X-v,f=u.Y-y,(0!==m||0!==f)&&((g=((c.X-v)*m+(c.Y-y)*f)/(m*m+f*f))>1?(v=u.X,y=u.Y):g>0&&(v+=m*g,y+=f*g)),(m=c.X-v)*m+(f=c.Y-y)*f<=x&&(d[r+1]=1,r++);for(o.push({X:s[0].X,Y:s[0].Y}),r=1;r<l-1;r++)d[r]||o.push({X:s[r].X,Y:s[r].Y});if(o.push({X:s[l-1].X,Y:s[l-1].Y}),p&&s.pop(),!d.length)break;s=o}o[(l=o.length)-1].X==o[0].X&&o[l-1].Y==o[0].Y&&o.pop(),o.length>2&&b.push(o)}return!t[0]instanceof Array&&(b=b[0]),void 0===b&&(b=[[]]),b},n.JS.PerimeterOfPath=function(t,e,i){if(void 0===t)return 0;var n,r,s=Math.sqrt,a=0,o=0,l=0,h=0,u=0,c=t.length;if(c<2)return 0;for(e&&(t[c]=t[0],c++);--c;)o=(n=t[c]).X,l=n.Y,a+=s((o-(h=(r=t[c-1]).X))*(o-h)+(l-(u=r.Y))*(l-u));return e&&t.pop(),a/i},n.JS.PerimeterOfPaths=function(t,e,i){i||(i=1);for(var r=0,s=0;s<t.length;s++)r+=n.JS.PerimeterOfPath(t[s],e,i);return r},n.JS.ScaleDownPath=function(t,e){var i,n;for(e||(e=1),i=t.length;i--;)(n=t[i]).X=n.X/e,n.Y=n.Y/e},n.JS.ScaleDownPaths=function(t,e){var i,n,r;Math.round;for(e||(e=1),i=t.length;i--;)for(n=t[i].length;n--;)(r=t[i][n]).X=r.X/e,r.Y=r.Y/e},n.JS.ScaleUpPath=function(t,e){var i,n,r=Math.round;for(e||(e=1),i=t.length;i--;)(n=t[i]).X=r(n.X*e),n.Y=r(n.Y*e)},n.JS.ScaleUpPaths=function(t,e){var i,n,r,s=Math.round;for(e||(e=1),i=t.length;i--;)for(n=t[i].length;n--;)(r=t[i][n]).X=s(r.X*e),r.Y=s(r.Y*e)},n.ExPolygons=function(){return[]},n.ExPolygon=function(){this.outer=null,this.holes=null},n.JS.AddOuterPolyNodeToExPolygons=function(t,e){var i=new n.ExPolygon;i.outer=t.Contour();var r,s,a,o,l,h,u=t.Childs(),c=u.length;for(i.holes=new Array(c),a=0;a<c;a++)for(r=u[a],i.holes[a]=r.Contour(),o=0,h=(l=r.Childs()).length;o<h;o++)s=l[o],n.JS.AddOuterPolyNodeToExPolygons(s,e);e.push(i)},n.JS.ExPolygonsToPaths=function(t){var e,i,r,s,a=new n.Paths;for(e=0,r=t.length;e<r;e++)for(a.push(t[e].outer),i=0,s=t[e].holes.length;i<s;i++)a.push(t[e].holes[i]);return a},n.JS.PolyTreeToExPolygons=function(t){var e,i,r,s,a=new n.ExPolygons;for(i=0,s=(r=t.Childs()).length;i<s;i++)e=r[i],n.JS.AddOuterPolyNodeToExPolygons(e,a);return a},e.exports=n}));P(),P(),P(),P();var Ug="138",cf={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},L6=0,_3=1,O6=2,tx=1,R6=2,Uc=3,Xs=0,yn=1,pr=2,nx=1,Fs=0,tl=1,b3=2,M3=3,rf=4,N6=5,Jo=100,k6=101,D6=102,w3=103,T3=104,B6=200,F6=201,z6=202,U6=203,ix=204,rx=205,V6=206,H6=207,G6=208,j6=209,W6=210,X6=0,Y6=1,Z6=2,Pg=3,J6=4,$6=5,K6=6,Q6=7,uf=0,ew=1,tw=2,zs=0,nw=1,iw=2,rw=3,sw=4,aw=5,Tu=300,Cl=301,Il=302,Cg=303,Ig=304,hf=306,Vg=307,Ji=1e3,ji=1001,Lg=1002,Ut=1003,E3=1004,S3=1005,Vn=1006,ow=1007,df=1008,Ga=1009,lw=1010,cw=1011,vu=1012,uw=1013,Us=1014,qa=1015,nl=1016,hw=1017,dw=1018,il=1020,pw=1021,fw=1022,Sn=1023,mw=1024,gw=1025,Pa=1026,fr=1027,yw=1028,vw=1029,xw=1030,_w=1031,bw=1033,G1=33776,j1=33777,W1=33778,X1=33779,A3=35840,q3=35841,P3=35842,C3=35843,Mw=36196,I3=37492,L3=37496,O3=37808,R3=37809,N3=37810,k3=37811,D3=37812,B3=37813,F3=37814,z3=37815,U3=37816,V3=37817,H3=37818,G3=37819,j3=37820,W3=37821,X3=36492,ww=2200,Tw=2201,Ew=2202,sf=2300,af=2301,Y1=2302,$o=2400,Ko=2401,of=2402,Hg=2500,sx=2501,ax=0,Ys=3e3,Gt=3001,Sw=3200,Aw=3201,Rl=0,qw=1,Xr=7680,ox=7681,lx=514,Gg=519,xu=35044,lf=35048,Y3="300 es",Og=1035,Ei=class{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;let i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;let i=this._listeners[t];if(void 0!==i){let t=i.indexOf(e);-1!==t&&i.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;let e=this._listeners[t.type];if(void 0!==e){t.target=this;let i=e.slice(0);for(let e=0,n=i.length;e<n;e++)i[e].call(this,t);t.target=null}}};h(Ei,"EventDispatcher");var In=[];for(let t=0;t<256;t++)In[t]=(t<16?"0":"")+t.toString(16);var Z1=Math.PI/180,Rg=180/Math.PI;function Wi(){let t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(In[255&t]+In[t>>8&255]+In[t>>16&255]+In[t>>24&255]+"-"+In[255&e]+In[e>>8&255]+"-"+In[e>>16&15|64]+In[e>>24&255]+"-"+In[63&i|128]+In[i>>8&255]+"-"+In[i>>16&255]+In[i>>24&255]+In[255&n]+In[n>>8&255]+In[n>>16&255]+In[n>>24&255]).toUpperCase()}function ai(t,e,i){return Math.max(e,Math.min(i,t))}function Pw(t,e){return(t%e+e)%e}function J1(t,e,i){return(1-i)*t+i*e}function Z3(t){return 0==(t&t-1)&&0!==t}function Ng(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}h(Wi,"generateUUID"),h(ai,"clamp"),h(Pw,"euclideanModulo"),h(J1,"lerp"),h(Z3,"isPowerOfTwo"),h(Ng,"floorPowerOfTwo");var de=class{constructor(t=0,e=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,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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){let e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[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){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(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}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y;return e*e+i*i}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,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,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,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*i-s*n+t.x,this.y=r*n+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};h(de,"Vector2"),de.prototype.isVector2=!0;var hn=class{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,a,o,l){let h=this.elements;return h[0]=t,h[1]=n,h[2]=a,h[3]=e,h[4]=r,h[5]=o,h[6]=i,h[7]=s,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let 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){let i=t.elements,n=e.elements,r=this.elements,s=i[0],a=i[3],o=i[6],l=i[1],h=i[4],u=i[7],c=i[2],d=i[5],p=i[8],m=n[0],f=n[3],g=n[6],v=n[1],y=n[4],_=n[7],x=n[2],b=n[5],w=n[8];return r[0]=s*m+a*v+o*x,r[3]=s*f+a*y+o*b,r[6]=s*g+a*_+o*w,r[1]=l*m+h*v+u*x,r[4]=l*f+h*y+u*b,r[7]=l*g+h*_+u*w,r[2]=c*m+d*v+p*x,r[5]=c*f+d*y+p*b,r[8]=c*g+d*_+p*w,this}multiplyScalar(t){let 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(){let t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],h=t[8];return e*s*h-e*a*l-i*r*h+i*a*o+n*r*l-n*s*o}invert(){let t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],h=t[8],u=h*s-a*l,c=a*o-h*r,d=l*r-s*o,p=e*u+i*c+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return t[0]=u*m,t[1]=(n*l-h*i)*m,t[2]=(a*i-n*s)*m,t[3]=c*m,t[4]=(h*e-n*o)*m,t[5]=(n*r-a*e)*m,t[6]=d*m,t[7]=(i*o-l*e)*m,t[8]=(s*e-i*r)*m,this}transpose(){let t,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){let 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,i,n,r,s,a){let o=Math.cos(r),l=Math.sin(r);return this.set(i*o,i*l,-i*(o*s+l*a)+s+t,-n*l,n*o,-n*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){let i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){let e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],s=n[3],a=n[6],o=n[1],l=n[4],h=n[7];return n[0]=e*r+i*o,n[3]=e*s+i*l,n[6]=e*a+i*h,n[1]=-i*r+e*o,n[4]=-i*s+e*l,n[7]=-i*a+e*h,this}translate(t,e){let i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}};function cx(t){for(let e=t.length-1;e>=0;--e)if(t[e]>65535)return!0;return!1}function _u(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}h(hn,"Matrix3"),hn.prototype.isMatrix3=!0,h(cx,"arrayNeedsUint32"),h(_u,"createElementNS");var ux={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},Vi={h:0,s:0,l:0},Nd={h:0,s:0,l:0};function $1(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function rl(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function K1(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}h($1,"hue2rgb"),h(rl,"SRGBToLinear"),h(K1,"LinearToSRGB");var Ee=class{constructor(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,i){return this.r=t,this.g=e,this.b=i,this}setHSL(t,e,i){if(t=Pw(t,1),e=ai(e,0,1),i=ai(i,0,1),0===e)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=$1(r,n,t+1/3),this.g=$1(r,n,t),this.b=$1(r,n,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(h(e,"handleAlpha"),i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t,n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){let i=parseFloat(t[1])/360,n=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(i,n,r)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let t=i[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){let e=ux[t.toLowerCase()];return void 0!==e?this.setHex(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=rl(t.r),this.g=rl(t.g),this.b=rl(t.b),this}copyLinearToSRGB(t){return this.r=K1(t.r),this.g=K1(t.g),this.b=K1(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){let e,i,n=this.r,r=this.g,s=this.b,a=Math.max(n,r,s),o=Math.min(n,r,s),l=(o+a)/2;if(o===a)e=0,i=0;else{let t=a-o;switch(i=l<=.5?t/(a+o):t/(2-a-o),a){case n:e=(r-s)/t+(r<s?6:0);break;case r:e=(s-n)/t+2;break;case s:e=(n-r)/t+4}e/=6}return t.h=e,t.s=i,t.l=l,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,i){return this.getHSL(Vi),Vi.h+=t,Vi.s+=e,Vi.l+=i,this.setHSL(Vi.h,Vi.s,Vi.l),this}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,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(Vi),t.getHSL(Nd);let i=J1(Vi.h,Nd.h,e),n=J1(Vi.s,Nd.s,e),r=J1(Vi.l,Nd.l,e);return this.setHSL(i,n,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),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}};h(Ee,"Color"),Ee.NAMES=ux,Ee.prototype.isColor=!0,Ee.prototype.r=1,Ee.prototype.g=1,Ee.prototype.b=1;var Lo,ur=class{static getDataURL(t){if(/^data:/i.test(t.src)||"undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Lo&&(Lo=_u("canvas")),Lo.width=t.width,Lo.height=t.height;let i=Lo.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Lo}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){let e=_u("canvas");e.width=t.width,e.height=t.height;let i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);let n=i.getImageData(0,0,t.width,t.height),r=n.data;for(let t=0;t<r.length;t++)r[t]=255*rl(r[t]/255);return i.putImageData(n,0,0),e}if(t.data){let e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*rl(e[t]/255)):e[t]=rl(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}};h(ur,"ImageUtils");var Hc=class{constructor(t=null){this.uuid=Wi(),this.data=t,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];let i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let t;if(Array.isArray(n)){t=[];for(let e=0,i=n.length;e<i;e++)n[e].isDataTexture?t.push(Q1(n[e].image)):t.push(Q1(n[e]))}else t=Q1(n);i.url=t}return e||(t.images[this.uuid]=i),i}};function Q1(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?ur.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}h(Hc,"Source"),h(Q1,"serializeImage"),Hc.prototype.isSource=!0;var Cw=0,ln=class extends Ei{constructor(t=ln.DEFAULT_IMAGE,e=ln.DEFAULT_MAPPING,i=ji,n=ji,r=Vn,s=df,a=Sn,o=Ga,l=1,h=Ys){super(),Object.defineProperty(this,"id",{value:Cw++}),this.uuid=Wi(),this.name="",this.source=new Hc(t),this.mipmaps=[],this.mapping=e,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new de(0,0),this.repeat=new de(1,1),this.center=new de(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new hn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t){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.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.encoding=t.encoding,this.userData=JSON.parse(JSON.stringify(t.userData)),this}toJSON(t){let e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];let i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,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,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Tu)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Ji:t.x=t.x-Math.floor(t.x);break;case ji:t.x=t.x<0?0:1;break;case Lg: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 Ji:t.y=t.y-Math.floor(t.y);break;case ji:t.y=t.y<0?0:1;break;case Lg: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)}};h(ln,"Texture"),ln.DEFAULT_IMAGE=null,ln.DEFAULT_MAPPING=Tu,ln.prototype.isTexture=!0;var Ct=class{constructor(t=0,e=0,i=0,n=1){this.x=t,this.y=e,this.z=i,this.w=n}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,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,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,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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){let e=this.x,i=this.y,n=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let 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,i,n,r,s=t.elements,a=s[0],o=s[4],l=s[8],h=s[1],u=s[5],c=s[9],d=s[2],p=s[6],m=s[10];if(Math.abs(o-h)<.01&&Math.abs(l-d)<.01&&Math.abs(c-p)<.01){if(Math.abs(o+h)<.1&&Math.abs(l+d)<.1&&Math.abs(c+p)<.1&&Math.abs(a+u+m-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let t=(a+1)/2,s=(u+1)/2,f=(m+1)/2,g=(o+h)/4,v=(l+d)/4,y=(c+p)/4;return t>s&&t>f?t<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=g/i,r=v/i):s>f?s<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(s),i=g/n,r=y/n):f<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(f),i=v/r,n=y/r),this.set(i,n,r,e),this}let f=Math.sqrt((p-c)*(p-c)+(l-d)*(l-d)+(h-o)*(h-o));return Math.abs(f)<.001&&(f=1),this.x=(p-c)/f,this.y=(l-d)/f,this.z=(h-o)/f,this.w=Math.acos((a+u+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){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(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,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,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,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),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}};h(Ct,"Vector4"),Ct.prototype.isVector4=!0;var dn=class extends Ei{constructor(t,e,i={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Ct(0,0,t,e),this.scissorTest=!1,this.viewport=new Ct(0,0,t,e);let n={width:t,height:e,depth:1};this.texture=new ln(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:Vn,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null,this.samples=void 0!==i.samples?i.samples:0}setSize(t,e,i=1){(this.width!==t||this.height!==e||this.depth!==i)&&(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,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){return this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.image=Object.assign({},t.texture.image),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"})}};h(dn,"WebGLRenderTarget"),dn.prototype.isWebGLRenderTarget=!0;var Ca=class extends ln{constructor(t=null,e=1,i=1,n=1){super(null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=Ut,this.minFilter=Ut,this.wrapR=ji,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};h(Ca,"DataArrayTexture"),Ca.prototype.isDataArrayTexture=!0;var pp=class extends dn{constructor(t,e,i){super(t,e),this.depth=i,this.texture=new Ca(null,t,e,i),this.texture.isRenderTargetTexture=!0}};h(pp,"WebGLArrayRenderTarget"),pp.prototype.isWebGLArrayRenderTarget=!0;var sl=class extends ln{constructor(t=null,e=1,i=1,n=1){super(null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=Ut,this.minFilter=Ut,this.wrapR=ji,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};h(sl,"Data3DTexture"),sl.prototype.isData3DTexture=!0;var fp=class extends dn{constructor(t,e,i){super(t,e),this.depth=i,this.texture=new sl(null,t,e,i),this.texture.isRenderTargetTexture=!0}};h(fp,"WebGL3DRenderTarget"),fp.prototype.isWebGL3DRenderTarget=!0;var mp=class extends dn{constructor(t,e,i,n={}){super(t,e,n);let r=this.texture;this.texture=[];for(let t=0;t<i;t++)this.texture[t]=r.clone()}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=t,this.texture[n].image.height=e,this.texture[n].image.depth=i;this.dispose()}return this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e),this}copy(t){this.dispose(),this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this.texture.length=0;for(let e=0,i=t.texture.length;e<i;e++)this.texture[e]=t.texture[e].clone();return this}};h(mp,"WebGLMultipleRenderTargets"),mp.prototype.isWebGLMultipleRenderTargets=!0;var Ln=class{constructor(t=0,e=0,i=0,n=1){this._x=t,this._y=e,this._z=i,this._w=n}static slerp(t,e,i,n){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),i.slerpQuaternions(t,e,n)}static slerpFlat(t,e,i,n,r,s,a){let o=i[n+0],l=i[n+1],h=i[n+2],u=i[n+3],c=r[s+0],d=r[s+1],p=r[s+2],m=r[s+3];if(0===a)return t[e+0]=o,t[e+1]=l,t[e+2]=h,void(t[e+3]=u);if(1===a)return t[e+0]=c,t[e+1]=d,t[e+2]=p,void(t[e+3]=m);if(u!==m||o!==c||l!==d||h!==p){let t=1-a,e=o*c+l*d+h*p+u*m,i=e>=0?1:-1,n=1-e*e;if(n>Number.EPSILON){let r=Math.sqrt(n),s=Math.atan2(r,e*i);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}let r=a*i;if(o=o*t+c*r,l=l*t+d*r,h=h*t+p*r,u=u*t+m*r,t===1-a){let t=1/Math.sqrt(o*o+l*l+h*h+u*u);o*=t,l*=t,h*=t,u*=t}}t[e]=o,t[e+1]=l,t[e+2]=h,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,n,r,s){let a=i[n],o=i[n+1],l=i[n+2],h=i[n+3],u=r[s],c=r[s+1],d=r[s+2],p=r[s+3];return t[e]=a*p+h*u+o*d-l*c,t[e+1]=o*p+h*c+l*u-a*d,t[e+2]=l*p+h*d+a*c-o*u,t[e+3]=h*p-a*u-o*c-l*d,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,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,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){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");let i=t._x,n=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(i/2),h=a(n/2),u=a(r/2),c=o(i/2),d=o(n/2),p=o(r/2);switch(s){case"XYZ":this._x=c*h*u+l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u-c*d*p;break;case"YXZ":this._x=c*h*u+l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u+c*d*p;break;case"ZXY":this._x=c*h*u-l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u-c*d*p;break;case"ZYX":this._x=c*h*u-l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u+c*d*p;break;case"YZX":this._x=c*h*u+l*d*p,this._y=l*d*u+c*h*p,this._z=l*h*p-c*d*u,this._w=l*h*u-c*d*p;break;case"XZY":this._x=c*h*u-l*d*p,this._y=l*d*u-c*h*p,this._z=l*h*p+c*d*u,this._w=l*h*u+c*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,i=e[0],n=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],h=e[6],u=e[10],c=i+a+u;if(c>0){let t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(h-o)*t,this._y=(r-l)*t,this._z=(s-n)*t}else if(i>a&&i>u){let t=2*Math.sqrt(1+i-a-u);this._w=(h-o)/t,this._x=.25*t,this._y=(n+s)/t,this._z=(r+l)/t}else if(a>u){let t=2*Math.sqrt(1+a-i-u);this._w=(r-l)/t,this._x=(n+s)/t,this._y=.25*t,this._z=(o+h)/t}else{let t=2*Math.sqrt(1+u-i-a);this._w=(s-n)/t,this._x=(r+l)/t,this._y=(o+h)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(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=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ai(this.dot(t),-1,1)))}rotateTowards(t,e){let i=this.angleTo(t);if(0===i)return this;let n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(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,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let i=t._x,n=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,h=e._w;return this._x=i*h+s*a+n*l-r*o,this._y=n*h+s*o+r*a-i*l,this._z=r*h+s*l+i*o-n*a,this._w=s*h-i*a-n*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);let i=this._x,n=this._y,r=this._z,s=this._w,a=s*t._w+i*t._x+n*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=i,this._y=n,this._z=r,this;let o=1-a*a;if(o<=Number.EPSILON){let t=1-e;return this._w=t*s+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}let l=Math.sqrt(o),h=Math.atan2(l,a),u=Math.sin((1-e)*h)/l,c=Math.sin(e*h)/l;return this._w=s*u+this._w*c,this._x=i*u+this._x*c,this._y=n*u+this._y*c,this._z=r*u+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){let t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(n),i*Math.sin(r),i*Math.cos(r),e*Math.sin(n))}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}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}};h(Ln,"Quaternion"),Ln.prototype.isQuaternion=!0;var I=class{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,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,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(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 t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(J3.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(J3.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,i=this.y,n=this.z,r=t.elements,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(t){let e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=o*e+s*n-a*i,h=o*i+a*e-r*n,u=o*n+r*i-s*e,c=-r*e-s*i-a*n;return this.x=l*o+c*-r+h*-a-u*-s,this.y=h*o+c*-s+u*-r-l*-a,this.z=u*o+c*-a+l*-s-h*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,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){let i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(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,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){let i=t.x,n=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this}projectOnVector(t){let e=t.lengthSq();if(0===e)return this.set(0,0,0);let i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return eg.copy(this).projectOnVector(t),this.sub(eg)}reflect(t){return this.sub(eg.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;let i=this.dot(t)/e;return Math.acos(ai(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}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,i){let n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,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}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,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),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(){let t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,i=Math.sqrt(1-zt(t,2));return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};h(I,"Vector3"),I.prototype.isVector3=!0;var eg=new I,J3=new Ln,At=class{constructor(t=new I(1/0,1/0,1/0),e=new I(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,a=-1/0;for(let o=0,l=t.length;o<l;o+=3){let l=t[o],h=t[o+1],u=t[o+2];l<e&&(e=l),h<i&&(i=h),u<n&&(n=u),l>r&&(r=l),h>s&&(s=h),u>a&&(a=u)}return this.min.set(e,i,n),this.max.set(r,s,a),this}setFromBufferAttribute(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,a=-1/0;for(let o=0,l=t.count;o<l;o++){let l=t.getX(o),h=t.getY(o),u=t.getZ(o);l<e&&(e=l),h<i&&(i=h),u<n&&(n=u),l>r&&(r=l),h>s&&(s=h),u>a&&(a=u)}return this.min.set(e,i,n),this.max.set(r,s,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let i=wa.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),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);let i=t.geometry;if(void 0!==i)if(e&&null!=i.attributes&&void 0!==i.attributes.position){let e=i.attributes.position;for(let i=0,n=e.count;i<n;i++)wa.fromBufferAttribute(e,i).applyMatrix4(t.matrixWorld),this.expandByPoint(wa)}else null===i.boundingBox&&i.computeBoundingBox(),tg.copy(i.boundingBox),tg.applyMatrix4(t.matrixWorld),this.union(tg);let n=t.children;for(let t=0,i=n.length;t<i;t++)this.expandByObject(n[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,wa),wa.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Oc),kd.subVectors(this.max,Oc),Oo.subVectors(t.a,Oc),Ro.subVectors(t.b,Oc),No.subVectors(t.c,Oc),Is.subVectors(Ro,Oo),Ls.subVectors(No,Ro),Ta.subVectors(Oo,No);let e=[0,-Is.z,Is.y,0,-Ls.z,Ls.y,0,-Ta.z,Ta.y,Is.z,0,-Is.x,Ls.z,0,-Ls.x,Ta.z,0,-Ta.x,-Is.y,Is.x,0,-Ls.y,Ls.x,0,-Ta.y,Ta.x,0];return!(!ng(e,Oo,Ro,No,kd)||(e=[1,0,0,0,1,0,0,0,1],!ng(e,Oo,Ro,No,kd)))&&(Dd.crossVectors(Is,Ls),e=[Dd.x,Dd.y,Dd.z],ng(e,Oo,Ro,No,kd))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return wa.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(wa).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()||(Ur[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ur[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ur[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ur[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ur[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ur[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ur[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ur[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ur)),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)}};h(At,"Box3"),At.prototype.isBox3=!0;var Ur=[new I,new I,new I,new I,new I,new I,new I,new I],wa=new I,tg=new At,Oo=new I,Ro=new I,No=new I,Is=new I,Ls=new I,Ta=new I,Oc=new I,kd=new I,Dd=new I,Ea=new I;function ng(t,e,i,n,r){for(let s=0,a=t.length-3;s<=a;s+=3){Ea.fromArray(t,s);let a=r.x*Math.abs(Ea.x)+r.y*Math.abs(Ea.y)+r.z*Math.abs(Ea.z),o=e.dot(Ea),l=i.dot(Ea),h=n.dot(Ea);if(Math.max(-Math.max(o,l,h),Math.min(o,l,h))>a)return!1}return!0}h(ng,"satForAxes");var Iw=new At,$3=new I,Bd=new I,ig=new I,Yr=class{constructor(t=new I,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let i=this.center;void 0!==e?i.copy(e):Iw.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;e<r;e++)n=Math.max(n,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(n),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){let 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){let i=this.center.distanceToSquared(t);return e.copy(t),i>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){ig.subVectors(t,this.center);let e=ig.lengthSq();if(e>this.radius*this.radius){let t=Math.sqrt(e),i=.5*(t-this.radius);this.center.add(ig.multiplyScalar(i/t)),this.radius+=i}return this}union(t){return!0===this.center.equals(t.center)?Bd.set(0,0,1).multiplyScalar(t.radius):Bd.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint($3.copy(t.center).add(Bd)),this.expandByPoint($3.copy(t.center).sub(Bd)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}};h(Yr,"Sphere");var Vr=new I,rg=new I,Fd=new I,Os=new I,sg=new I,zd=new I,ag=new I,hr=class{constructor(t=new I,e=new I(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.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Vr)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=Vr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Vr.copy(this.direction).multiplyScalar(e).add(this.origin),Vr.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){rg.copy(t).add(e).multiplyScalar(.5),Fd.copy(e).sub(t).normalize(),Os.copy(this.origin).sub(rg);let r,s,a,o,l=.5*t.distanceTo(e),h=-this.direction.dot(Fd),u=Os.dot(this.direction),c=-Os.dot(Fd),d=Os.lengthSq(),p=Math.abs(1-h*h);if(p>0)if(r=h*c-u,s=h*u-c,o=l*p,r>=0)if(s>=-o)if(s<=o){let t=1/p;r*=t,s*=t,a=r*(r+h*s+2*u)+s*(h*r+s+2*c)+d}else s=l,r=Math.max(0,-(h*s+u)),a=-r*r+s*(s+2*c)+d;else s=-l,r=Math.max(0,-(h*s+u)),a=-r*r+s*(s+2*c)+d;else s<=-o?(r=Math.max(0,-(-h*l+u)),s=r>0?-l:Math.min(Math.max(-l,-c),l),a=-r*r+s*(s+2*c)+d):s<=o?(r=0,s=Math.min(Math.max(-l,-c),l),a=s*(s+2*c)+d):(r=Math.max(0,-(h*l+u)),s=r>0?l:Math.min(Math.max(-l,-c),l),a=-r*r+s*(s+2*c)+d);else s=h>0?-l:l,r=Math.max(0,-(h*s+u)),a=-r*r+s*(s+2*c)+d;return i&&i.copy(this.direction).multiplyScalar(r).add(this.origin),n&&n.copy(Fd).multiplyScalar(s).add(rg),a}intersectSphere(t,e){Vr.subVectors(t.center,this.origin);let i=Vr.dot(this.direction),n=Vr.dot(Vr)-i*i,r=t.radius*t.radius;if(n>r)return null;let s=Math.sqrt(r-n),a=i-s,o=i+s;return a<0&&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){let e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){let i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,s,a,o,l=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,c=this.origin;return l>=0?(i=(t.min.x-c.x)*l,n=(t.max.x-c.x)*l):(i=(t.max.x-c.x)*l,n=(t.min.x-c.x)*l),h>=0?(r=(t.min.y-c.y)*h,s=(t.max.y-c.y)*h):(r=(t.max.y-c.y)*h,s=(t.min.y-c.y)*h),i>s||r>n||((r>i||i!=i)&&(i=r),(s<n||n!=n)&&(n=s),u>=0?(a=(t.min.z-c.z)*u,o=(t.max.z-c.z)*u):(a=(t.max.z-c.z)*u,o=(t.min.z-c.z)*u),i>o||a>n)||((a>i||i!=i)&&(i=a),(o<n||n!=n)&&(n=o),n<0)?null:this.at(i>=0?i:n,e)}intersectsBox(t){return null!==this.intersectBox(t,Vr)}intersectTriangle(t,e,i,n,r){sg.subVectors(e,t),zd.subVectors(i,t),ag.crossVectors(sg,zd);let s,a=this.direction.dot(ag);if(a>0){if(n)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Os.subVectors(this.origin,t);let o=s*this.direction.dot(zd.crossVectors(Os,zd));if(o<0)return null;let l=s*this.direction.dot(sg.cross(Os));if(l<0||o+l>a)return null;let h=-s*Os.dot(ag);return h<0?null:this.at(h/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)}};h(hr,"Ray");var We=class{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,a,o,l,h,u,c,d,p,m,f){let g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=h,g[10]=u,g[14]=c,g[3]=d,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new We).fromArray(this.elements)}copy(t){let e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){let e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){let 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,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,i=t.elements,n=1/ko.setFromMatrixColumn(t,0).length(),r=1/ko.setFromMatrixColumn(t,1).length(),s=1/ko.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");let e=this.elements,i=t.x,n=t.y,r=t.z,s=Math.cos(i),a=Math.sin(i),o=Math.cos(n),l=Math.sin(n),h=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){let t=s*h,i=s*u,n=a*h,r=a*u;e[0]=o*h,e[4]=-o*u,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=n+i*l,e[10]=s*o}else if("YXZ"===t.order){let t=o*h,i=o*u,n=l*h,r=l*u;e[0]=t+r*a,e[4]=n*a-i,e[8]=s*l,e[1]=s*u,e[5]=s*h,e[9]=-a,e[2]=i*a-n,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){let t=o*h,i=o*u,n=l*h,r=l*u;e[0]=t-r*a,e[4]=-s*u,e[8]=n+i*a,e[1]=i+n*a,e[5]=s*h,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){let t=s*h,i=s*u,n=a*h,r=a*u;e[0]=o*h,e[4]=n*l-i,e[8]=t*l+r,e[1]=o*u,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){let t=s*o,i=s*l,n=a*o,r=a*l;e[0]=o*h,e[4]=r-t*u,e[8]=n*u+i,e[1]=u,e[5]=s*h,e[9]=-a*h,e[2]=-l*h,e[6]=i*u+n,e[10]=t-r*u}else if("XZY"===t.order){let t=s*o,i=s*l,n=a*o,r=a*l;e[0]=o*h,e[4]=-u,e[8]=l*h,e[1]=t*u+r,e[5]=s*h,e[9]=i*u-n,e[2]=n*u-i,e[6]=a*h,e[10]=r*u+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(Lw,t,Ow)}lookAt(t,e,i){let n=this.elements;return mi.subVectors(t,e),0===mi.lengthSq()&&(mi.z=1),mi.normalize(),Rs.crossVectors(i,mi),0===Rs.lengthSq()&&(1===Math.abs(i.z)?mi.x+=1e-4:mi.z+=1e-4,mi.normalize(),Rs.crossVectors(i,mi)),Rs.normalize(),Ud.crossVectors(mi,Rs),n[0]=Rs.x,n[4]=Ud.x,n[8]=mi.x,n[1]=Rs.y,n[5]=Ud.y,n[9]=mi.y,n[2]=Rs.z,n[6]=Ud.z,n[10]=mi.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let i=t.elements,n=e.elements,r=this.elements,s=i[0],a=i[4],o=i[8],l=i[12],h=i[1],u=i[5],c=i[9],d=i[13],p=i[2],m=i[6],f=i[10],g=i[14],v=i[3],y=i[7],_=i[11],x=i[15],b=n[0],w=n[4],M=n[8],E=n[12],T=n[1],S=n[5],q=n[9],P=n[13],A=n[2],C=n[6],L=n[10],I=n[14],R=n[3],N=n[7],O=n[11],D=n[15];return r[0]=s*b+a*T+o*A+l*R,r[4]=s*w+a*S+o*C+l*N,r[8]=s*M+a*q+o*L+l*O,r[12]=s*E+a*P+o*I+l*D,r[1]=h*b+u*T+c*A+d*R,r[5]=h*w+u*S+c*C+d*N,r[9]=h*M+u*q+c*L+d*O,r[13]=h*E+u*P+c*I+d*D,r[2]=p*b+m*T+f*A+g*R,r[6]=p*w+m*S+f*C+g*N,r[10]=p*M+m*q+f*L+g*O,r[14]=p*E+m*P+f*I+g*D,r[3]=v*b+y*T+_*A+x*R,r[7]=v*w+y*S+_*C+x*N,r[11]=v*M+y*q+_*L+x*O,r[15]=v*E+y*P+_*I+x*D,this}multiplyScalar(t){let 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(){let t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],h=t[2],u=t[6],c=t[10],d=t[14];return t[3]*(+r*o*u-n*l*u-r*a*c+i*l*c+n*a*d-i*o*d)+t[7]*(+e*o*d-e*l*c+r*s*c-n*s*d+n*l*h-r*o*h)+t[11]*(+e*l*u-e*a*d-r*s*u+i*s*d+r*a*h-i*l*h)+t[15]*(-n*a*h-e*o*u+e*a*c+n*s*u-i*s*c+i*o*h)}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(t,e,i){let n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){let t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],h=t[8],u=t[9],c=t[10],d=t[11],p=t[12],m=t[13],f=t[14],g=t[15],v=u*f*l-m*c*l+m*o*d-a*f*d-u*o*g+a*c*g,y=p*c*l-h*f*l-p*o*d+s*f*d+h*o*g-s*c*g,_=h*m*l-p*u*l+p*a*d-s*m*d-h*a*g+s*u*g,x=p*u*o-h*m*o-p*a*c+s*m*c+h*a*f-s*u*f,b=e*v+i*y+n*_+r*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/b;return t[0]=v*w,t[1]=(m*c*r-u*f*r-m*n*d+i*f*d+u*n*g-i*c*g)*w,t[2]=(a*f*r-m*o*r+m*n*l-i*f*l-a*n*g+i*o*g)*w,t[3]=(u*o*r-a*c*r-u*n*l+i*c*l+a*n*d-i*o*d)*w,t[4]=y*w,t[5]=(h*f*r-p*c*r+p*n*d-e*f*d-h*n*g+e*c*g)*w,t[6]=(p*o*r-s*f*r-p*n*l+e*f*l+s*n*g-e*o*g)*w,t[7]=(s*c*r-h*o*r+h*n*l-e*c*l-s*n*d+e*o*d)*w,t[8]=_*w,t[9]=(p*u*r-h*m*r-p*i*d+e*m*d+h*i*g-e*u*g)*w,t[10]=(s*m*r-p*a*r+p*i*l-e*m*l-s*i*g+e*a*g)*w,t[11]=(h*a*r-s*u*r-h*i*l+e*u*l+s*i*d-e*a*d)*w,t[12]=x*w,t[13]=(h*m*n-p*u*n+p*i*c-e*m*c-h*i*f+e*u*f)*w,t[14]=(p*a*n-s*m*n-p*i*o+e*m*o+s*i*f-e*a*f)*w,t[15]=(s*u*n-h*a*n+h*i*o-e*u*o-s*i*c+e*a*c)*w,this}scale(t){let e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,a=t.y,o=t.z,l=r*s,h=r*a;return this.set(l*s+i,l*a-n*o,l*o+n*a,0,l*a+n*o,h*a+i,h*o-n*s,0,l*o-n*a,h*o+n*s,r*o*o+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,n,r,s){return this.set(1,i,r,0,t,1,s,0,e,n,1,0,0,0,0,1),this}compose(t,e,i){let n=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,h=s+s,u=a+a,c=r*l,d=r*h,p=r*u,m=s*h,f=s*u,g=a*u,v=o*l,y=o*h,_=o*u,x=i.x,b=i.y,w=i.z;return n[0]=(1-(m+g))*x,n[1]=(d+_)*x,n[2]=(p-y)*x,n[3]=0,n[4]=(d-_)*b,n[5]=(1-(c+g))*b,n[6]=(f+v)*b,n[7]=0,n[8]=(p+y)*w,n[9]=(f-v)*w,n[10]=(1-(c+m))*w,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){let n=this.elements,r=ko.set(n[0],n[1],n[2]).length(),s=ko.set(n[4],n[5],n[6]).length(),a=ko.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],Hi.copy(this);let o=1/r,l=1/s,h=1/a;return Hi.elements[0]*=o,Hi.elements[1]*=o,Hi.elements[2]*=o,Hi.elements[4]*=l,Hi.elements[5]*=l,Hi.elements[6]*=l,Hi.elements[8]*=h,Hi.elements[9]*=h,Hi.elements[10]*=h,e.setFromRotationMatrix(Hi),i.x=r,i.y=s,i.z=a,this}makePerspective(t,e,i,n,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");let a=this.elements,o=2*r/(e-t),l=2*r/(i-n),h=(e+t)/(e-t),u=(i+n)/(i-n),c=-(s+r)/(s-r),d=-2*s*r/(s-r);return a[0]=o,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=c,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,i,n,r,s){let a=this.elements,o=1/(e-t),l=1/(i-n),h=1/(s-r),u=(e+t)*o,c=(i+n)*l,d=(s+r)*h;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-c,a[2]=0,a[6]=0,a[10]=-2*h,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){let e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){let i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}};h(We,"Matrix4"),We.prototype.isMatrix4=!0;var ko=new I,Hi=new We,Lw=new I(0,0,0),Ow=new I(1,1,1),Rs=new I,Ud=new I,mi=new I,K3=new We,Q3=new Ln,Si=class{constructor(t=0,e=0,i=0,n=Si.DefaultOrder){this._x=t,this._y=e,this._z=i,this._order=n}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,i,n=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,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,i=!0){let n=t.elements,r=n[0],s=n[4],a=n[8],o=n[1],l=n[5],h=n[9],u=n[2],c=n[6],d=n[10];switch(e){case"XYZ":this._y=Math.asin(ai(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(c,l),this._z=0);break;case"YXZ":this._x=Math.asin(-ai(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(ai(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-ai(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(c,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(ai(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-ai(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(c,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return K3.makeRotationFromQuaternion(t),this.setFromRotationMatrix(K3,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Q3.setFromEuler(this),this.setFromQuaternion(Q3,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(){}};h(Si,"Euler"),Si.prototype.isEuler=!0,Si.DefaultOrder="XYZ",Si.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];var al=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!=(this.mask&t.mask)}isEnabled(t){return 0!=(this.mask&(1<<t|0))}};h(al,"Layers");var Rw=0,ev=new I,Do=new Ln,Hr=new We,Vd=new I,Rc=new I,Nw=new I,kw=new Ln,tv=new I(1,0,0),nv=new I(0,1,0),iv=new I(0,0,1),Dw={type:"added"},rv={type:"removed"},rt=class extends Ei{constructor(){super(),Object.defineProperty(this,"id",{value:Rw++}),this.uuid=Wi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=rt.DefaultUp.clone();let t=new I,e=new Si,i=new Ln,n=new I(1,1,1);function r(){i.setFromEuler(e,!1)}function s(){e.setFromQuaternion(i,void 0,!1)}h(r,"onRotationChange"),h(s,"onQuaternionChange"),e._onChange(r),i._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new We},normalMatrix:{value:new hn}}),this.matrix=new We,this.matrixWorld=new We,this.matrixAutoUpdate=rt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new al,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}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 Do.setFromAxisAngle(t,e),this.quaternion.multiply(Do),this}rotateOnWorldAxis(t,e){return Do.setFromAxisAngle(t,e),this.quaternion.premultiply(Do),this}rotateX(t){return this.rotateOnAxis(tv,t)}rotateY(t){return this.rotateOnAxis(nv,t)}rotateZ(t){return this.rotateOnAxis(iv,t)}translateOnAxis(t,e){return ev.copy(t).applyQuaternion(this.quaternion),this.position.add(ev.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(tv,t)}translateY(t){return this.translateOnAxis(nv,t)}translateZ(t){return this.translateOnAxis(iv,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(Hr.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?Vd.copy(t):Vd.set(t,e,i);let n=this.parent;this.updateWorldMatrix(!0,!1),Rc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Hr.lookAt(Rc,Vd,this.up):Hr.lookAt(Vd,Rc,this.up),this.quaternion.setFromRotationMatrix(Hr),n&&(Hr.extractRotation(n.matrixWorld),Do.setFromRotationMatrix(Hr),this.quaternion.premultiply(Do.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(Dw)):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}let e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(rv)),this}removeFromParent(){let t=this.parent;return null!==t&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){let e=this.children[t];e.parent=null,e.dispatchEvent(rv)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),Hr.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Hr.multiply(t.parent.matrixWorld)),t.applyMatrix4(Hr),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 i=0,n=this.children.length;i<n;i++){let n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Rc,t,Nw),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Rc,kw,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);let e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}traverseAncestors(t){let 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);let e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){let i=this.parent;if(!0===t&&null!==i&&i.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){let t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}toJSON(t){let e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let n={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),h(r,"serialize"),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(t.geometries,this.geometry);let e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){let i=e.shapes;if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){let n=i[e];r(t.shapes,n)}else r(t.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let e=[];for(let i=0,n=this.material.length;i<n;i++)e.push(r(t.materials,this.material[i]));n.material=e}else n.material=r(t.materials,this.material);if(this.children.length>0){n.children=[];for(let e=0;e<this.children.length;e++)n.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let e=0;e<this.animations.length;e++){let i=this.animations[e];n.animations.push(r(t.animations,i))}}if(e){let e=s(t.geometries),n=s(t.materials),r=s(t.textures),a=s(t.images),o=s(t.shapes),l=s(t.skeletons),h=s(t.animations),u=s(t.nodes);e.length>0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),h.length>0&&(i.animations=h),u.length>0&&(i.nodes=u)}return i.object=n,i;function s(t){let e=[];for(let i in t){let n=t[i];delete n.metadata,e.push(n)}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.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.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){let i=t.children[e];this.add(i.clone())}return this}};h(rt,"Object3D"),rt.DefaultUp=new I(0,1,0),rt.DefaultMatrixAutoUpdate=!0,rt.prototype.isObject3D=!0;var Gi=new I,Gr=new I,og=new I,jr=new I,Bo=new I,Fo=new I,sv=new I,lg=new I,cg=new I,ug=new I,Xt=class{constructor(t=new I,e=new I,i=new I){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,n){n.subVectors(i,e),Gi.subVectors(t,e),n.cross(Gi);let r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(t,e,i,n,r){Gi.subVectors(n,e),Gr.subVectors(i,e),og.subVectors(t,e);let s=Gi.dot(Gi),a=Gi.dot(Gr),o=Gi.dot(og),l=Gr.dot(Gr),h=Gr.dot(og),u=s*l-a*a;if(0===u)return r.set(-2,-1,-1);let c=1/u,d=(l*o-a*h)*c,p=(s*h-a*o)*c;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,jr),jr.x>=0&&jr.y>=0&&jr.x+jr.y<=1}static getUV(t,e,i,n,r,s,a,o){return this.getBarycoord(t,e,i,n,jr),o.set(0,0),o.addScaledVector(r,jr.x),o.addScaledVector(s,jr.y),o.addScaledVector(a,jr.z),o}static isFrontFacing(t,e,i,n){return Gi.subVectors(i,e),Gr.subVectors(t,e),Gi.cross(Gr).dot(n)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}setFromAttributeAndIndices(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,n),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 Gi.subVectors(this.c,this.b),Gr.subVectors(this.a,this.b),.5*Gi.cross(Gr).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Xt.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Xt.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return Xt.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return Xt.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Xt.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let i,n,r=this.a,s=this.b,a=this.c;Bo.subVectors(s,r),Fo.subVectors(a,r),lg.subVectors(t,r);let o=Bo.dot(lg),l=Fo.dot(lg);if(o<=0&&l<=0)return e.copy(r);cg.subVectors(t,s);let h=Bo.dot(cg),u=Fo.dot(cg);if(h>=0&&u<=h)return e.copy(s);let c=o*u-h*l;if(c<=0&&o>=0&&h<=0)return i=o/(o-h),e.copy(r).addScaledVector(Bo,i);ug.subVectors(t,a);let d=Bo.dot(ug),p=Fo.dot(ug);if(p>=0&&d<=p)return e.copy(a);let m=d*l-o*p;if(m<=0&&l>=0&&p<=0)return n=l/(l-p),e.copy(r).addScaledVector(Fo,n);let f=h*p-d*u;if(f<=0&&u-h>=0&&d-p>=0)return sv.subVectors(a,s),n=(u-h)/(u-h+(d-p)),e.copy(s).addScaledVector(sv,n);let g=1/(f+m+c);return i=m*g,n=c*g,e.copy(r).addScaledVector(Bo,i).addScaledVector(Fo,n)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}};h(Xt,"Triangle");var Bw=0,nn=class extends Ei{constructor(){super(),Object.defineProperty(this,"id",{value:Bw++}),this.uuid=Wi(),this.name="",this.type="Material",this.fog=!0,this.blending=tl,this.side=Xs,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=ix,this.blendDst=rx,this.blendEquation=Jo,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Pg,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Gg,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Xr,this.stencilZFail=Xr,this.stencilZPass=Xr,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.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(let e in t){let i=t[e];if(void 0===i){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===nx;continue}let n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}}toJSON(t){let e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});let i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){let e=[];for(let i in t){let n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==tl&&(i.blending=this.blending),this.side!==Xs&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),h(n,"extractFromCache"),e){let e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.fog=t.fog,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.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;let e=t.clippingPlanes,i=null;if(null!==e){let t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,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.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,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++}};h(nn,"Material"),nn.prototype.isMaterial=!0,nn.fromType=function(){return null};var Hn=class extends nn{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new Ee(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.combine=uf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",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.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}};h(Hn,"MeshBasicMaterial"),Hn.prototype.isMeshBasicMaterial=!0;var Bt=new I,Hd=new de,qt=class{constructor(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=xu,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}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}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){let e=this.array,i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),r=new Ee),e[i++]=r.r,e[i++]=r.g,e[i++]=r.b}return this}copyVector2sArray(t){let e=this.array,i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),r=new de),e[i++]=r.x,e[i++]=r.y}return this}copyVector3sArray(t){let e=this.array,i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),r=new I),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z}return this}copyVector4sArray(t){let e=this.array,i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),r=new Ct),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z,e[i++]=r.w}return this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)Hd.fromBufferAttribute(this,e),Hd.applyMatrix3(t),this.setXY(e,Hd.x,Hd.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)Bt.fromBufferAttribute(this,e),Bt.applyMatrix3(t),this.setXYZ(e,Bt.x,Bt.y,Bt.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)Bt.x=this.getX(e),Bt.y=this.getY(e),Bt.z=this.getZ(e),Bt.applyMatrix4(t),this.setXYZ(e,Bt.x,Bt.y,Bt.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Bt.x=this.getX(e),Bt.y=this.getY(e),Bt.z=this.getZ(e),Bt.applyNormalMatrix(t),this.setXYZ(e,Bt.x,Bt.y,Bt.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Bt.x=this.getX(e),Bt.y=this.getY(e),Bt.z=this.getZ(e),Bt.transformDirection(t),this.setXYZ(e,Bt.x,Bt.y,Bt.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){return this.array[t*this.itemSize]}setX(t,e){return this.array[t*this.itemSize]=e,this}getY(t){return this.array[t*this.itemSize+1]}setY(t,e){return this.array[t*this.itemSize+1]=e,this}getZ(t){return this.array[t*this.itemSize+2]}setZ(t,e){return this.array[t*this.itemSize+2]=e,this}getW(t){return this.array[t*this.itemSize+3]}setW(t,e){return this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this}setXYZW(t,e,i,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,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(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==xu&&(t.usage=this.usage),(0!==this.updateRange.offset||-1!==this.updateRange.count)&&(t.updateRange=this.updateRange),t}};h(qt,"BufferAttribute"),qt.prototype.isBufferAttribute=!0;var Gc=class extends qt{constructor(t,e,i){super(new Uint16Array(t),e,i)}};h(Gc,"Uint16BufferAttribute");var jc=class extends qt{constructor(t,e,i){super(new Uint32Array(t),e,i)}};h(jc,"Uint32BufferAttribute");var gp=class extends qt{constructor(t,e,i){super(new Uint16Array(t),e,i)}};h(gp,"Float16BufferAttribute"),gp.prototype.isFloat16BufferAttribute=!0;var It=class extends qt{constructor(t,e,i){super(new Float32Array(t),e,i)}};h(It,"Float32BufferAttribute");var Fw=0,wi=new We,hg=new rt,zo=new I,gi=new At,Nc=new At,En=new I,wt=class extends Ei{constructor(){super(),Object.defineProperty(this,"id",{value:Fw++}),this.uuid=Wi(),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(cx(t)?jc:Gc)(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,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let e=(new hn).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}let n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return wi.makeRotationFromQuaternion(t),this.applyMatrix4(wi),this}rotateX(t){return wi.makeRotationX(t),this.applyMatrix4(wi),this}rotateY(t){return wi.makeRotationY(t),this.applyMatrix4(wi),this}rotateZ(t){return wi.makeRotationZ(t),this.applyMatrix4(wi),this}translate(t,e,i){return wi.makeTranslation(t,e,i),this.applyMatrix4(wi),this}scale(t,e,i){return wi.makeScale(t,e,i),this.applyMatrix4(wi),this}lookAt(t){return hg.lookAt(t),hg.updateMatrix(),this.applyMatrix4(hg.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(zo).negate(),this.translate(zo.x,zo.y,zo.z),this}setFromPoints(t){let e=[];for(let i=0,n=t.length;i<n;i++){let n=t[i];e.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new It(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new At);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new I(-1/0,-1/0,-1/0),new I(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];gi.setFromBufferAttribute(i),this.morphTargetsRelative?(En.addVectors(this.boundingBox.min,gi.min),this.boundingBox.expandByPoint(En),En.addVectors(this.boundingBox.max,gi.max),this.boundingBox.expandByPoint(En)):(this.boundingBox.expandByPoint(gi.min),this.boundingBox.expandByPoint(gi.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 Yr);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new I,1/0);if(t){let i=this.boundingSphere.center;if(gi.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){let i=e[t];Nc.setFromBufferAttribute(i),this.morphTargetsRelative?(En.addVectors(gi.min,Nc.min),gi.expandByPoint(En),En.addVectors(gi.max,Nc.max),gi.expandByPoint(En)):(gi.expandByPoint(Nc.min),gi.expandByPoint(Nc.max))}gi.getCenter(i);let n=0;for(let e=0,r=t.count;e<r;e++)En.fromBufferAttribute(t,e),n=Math.max(n,i.distanceToSquared(En));if(e)for(let r=0,s=e.length;r<s;r++){let s=e[r],a=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++)En.fromBufferAttribute(s,e),a&&(zo.fromBufferAttribute(t,e),En.add(zo)),n=Math.max(n,i.distanceToSquared(En))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let 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)");let i=t.array,n=e.position.array,r=e.normal.array,s=e.uv.array,a=n.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new qt(new Float32Array(4*a),4));let o=this.getAttribute("tangent").array,l=[],u=[];for(let t=0;t<a;t++)l[t]=new I,u[t]=new I;let c=new I,d=new I,p=new I,m=new de,f=new de,g=new de,v=new I,y=new I;function _(t,e,i){c.fromArray(n,3*t),d.fromArray(n,3*e),p.fromArray(n,3*i),m.fromArray(s,2*t),f.fromArray(s,2*e),g.fromArray(s,2*i),d.sub(c),p.sub(c),f.sub(m),g.sub(m);let r=1/(f.x*g.y-g.x*f.y);isFinite(r)&&(v.copy(d).multiplyScalar(g.y).addScaledVector(p,-f.y).multiplyScalar(r),y.copy(p).multiplyScalar(f.x).addScaledVector(d,-g.x).multiplyScalar(r),l[t].add(v),l[e].add(v),l[i].add(v),u[t].add(y),u[e].add(y),u[i].add(y))}h(_,"handleTriangle");let x=this.groups;0===x.length&&(x=[{start:0,count:i.length}]);for(let t=0,e=x.length;t<e;++t){let e=x[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)_(i[t+0],i[t+1],i[t+2])}let b=new I,w=new I,M=new I,E=new I;function T(t){M.fromArray(r,3*t),E.copy(M);let e=l[t];b.copy(e),b.sub(M.multiplyScalar(M.dot(e))).normalize(),w.crossVectors(E,e);let i=w.dot(u[t])<0?-1:1;o[4*t]=b.x,o[4*t+1]=b.y,o[4*t+2]=b.z,o[4*t+3]=i}h(T,"handleVertex");for(let t=0,e=x.length;t<e;++t){let e=x[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)T(i[t+0]),T(i[t+1]),T(i[t+2])}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new qt(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);let n=new I,r=new I,s=new I,a=new I,o=new I,l=new I,h=new I,u=new I;if(t)for(let c=0,d=t.count;c<d;c+=3){let d=t.getX(c+0),p=t.getX(c+1),m=t.getX(c+2);n.fromBufferAttribute(e,d),r.fromBufferAttribute(e,p),s.fromBufferAttribute(e,m),h.subVectors(s,r),u.subVectors(n,r),h.cross(u),a.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),l.fromBufferAttribute(i,m),a.add(h),o.add(h),l.add(h),i.setXYZ(d,a.x,a.y,a.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(m,l.x,l.y,l.z)}else for(let t=0,a=e.count;t<a;t+=3)n.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),h.subVectors(s,r),u.subVectors(n,r),h.cross(u),i.setXYZ(t+0,h.x,h.y,h.z),i.setXYZ(t+1,h.x,h.y,h.z),i.setXYZ(t+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));let i=this.attributes;for(let n in i){if(void 0===t.attributes[n])continue;let r=i[n].array,s=t.attributes[n],a=s.array,o=s.itemSize*e,l=Math.min(a.length,r.length-o);for(let t=0,e=o;t<l;t++,e++)r[e]=a[t]}return this}normalizeNormals(){let t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)En.fromBufferAttribute(t,e),En.normalize(),t.setXYZ(e,En.x,En.y,En.z)}toNonIndexed(){function t(t,e){let i=t.array,n=t.itemSize,r=t.normalized,s=new i.constructor(e.length*n),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]*n;for(let t=0;t<n;t++)s[o++]=i[a++]}return new qt(s,n,r)}if(h(t,"convertBufferAttribute"),null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new wt,i=this.index.array,n=this.attributes;for(let r in n){let s=t(n[r],i);e.setAttribute(r,s)}let r=this.morphAttributes;for(let n in r){let s=[],a=r[n];for(let e=0,n=a.length;e<n;e++){let n=t(a[e],i);s.push(n)}e.morphAttributes[n]=s}e.morphTargetsRelative=this.morphTargetsRelative;let s=this.groups;for(let t=0,i=s.length;t<i;t++){let i=s[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){let t={metadata:{version:4.5,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){let e=this.parameters;for(let i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};let e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let i=this.attributes;for(let e in i){let n=i[e];t.data.attributes[e]=n.toJSON(t.data)}let n={},r=!1;for(let e in this.morphAttributes){let i=this.morphAttributes[e],s=[];for(let e=0,n=i.length;e<n;e++){let n=i[e];s.push(n.toJSON(t.data))}s.length>0&&(n[e]=s,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));let 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;let e={};this.name=t.name;let i=t.index;null!==i&&this.setIndex(i.clone(e));let n=t.attributes;for(let t in n){let i=n[t];this.setAttribute(t,i.clone(e))}let r=t.morphAttributes;for(let t in r){let i=[],n=r[t];for(let t=0,r=n.length;t<r;t++)i.push(n[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;let s=t.groups;for(let t=0,e=s.length;t<e;t++){let e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}let a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());let 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,void 0!==t.parameters&&(this.parameters=Object.assign({},t.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}};h(wt,"BufferGeometry"),wt.prototype.isBufferGeometry=!0;var av=new We,Uo=new hr,dg=new Yr,Ns=new I,ks=new I,Ds=new I,pg=new I,fg=new I,mg=new I,Gd=new I,jd=new I,Wd=new I,Xd=new de,Yd=new de,Zd=new de,gg=new I,Jd=new I,lt=class extends rt{constructor(t=new wt,e=new Hn){super(),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){let t=this.geometry;if(t.isBufferGeometry){let e=t.morphAttributes,i=Object.keys(e);if(i.length>0){let t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){let i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{let e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(t,e){let i,n=this.geometry,r=this.material,s=this.matrixWorld;if(void 0!==r&&(null===n.boundingSphere&&n.computeBoundingSphere(),dg.copy(n.boundingSphere),dg.applyMatrix4(s),!1!==t.ray.intersectsSphere(dg))&&(av.copy(s).invert(),Uo.copy(t.ray).applyMatrix4(av),null===n.boundingBox||!1!==Uo.intersectsBox(n.boundingBox)))if(n.isBufferGeometry){let s=n.index,a=n.attributes.position,o=n.morphAttributes.position,l=n.morphTargetsRelative,h=n.attributes.uv,u=n.attributes.uv2,c=n.groups,d=n.drawRange;if(null!==s)if(Array.isArray(r))for(let n=0,p=c.length;n<p;n++){let p=c[n],m=r[p.materialIndex];for(let n=Math.max(p.start,d.start),r=Math.min(s.count,Math.min(p.start+p.count,d.start+d.count));n<r;n+=3){let r=s.getX(n),c=s.getX(n+1),d=s.getX(n+2);i=$d(this,m,t,Uo,a,o,l,h,u,r,c,d),i&&(i.faceIndex=Math.floor(n/3),i.face.materialIndex=p.materialIndex,e.push(i))}}else{for(let n=Math.max(0,d.start),c=Math.min(s.count,d.start+d.count);n<c;n+=3){let c=s.getX(n),d=s.getX(n+1),p=s.getX(n+2);i=$d(this,r,t,Uo,a,o,l,h,u,c,d,p),i&&(i.faceIndex=Math.floor(n/3),e.push(i))}}else if(void 0!==a)if(Array.isArray(r))for(let n=0,s=c.length;n<s;n++){let s=c[n],p=r[s.materialIndex];for(let n=Math.max(s.start,d.start),r=Math.min(a.count,Math.min(s.start+s.count,d.start+d.count));n<r;n+=3){i=$d(this,p,t,Uo,a,o,l,h,u,n,n+1,n+2),i&&(i.faceIndex=Math.floor(n/3),i.face.materialIndex=s.materialIndex,e.push(i))}}else{for(let n=Math.max(0,d.start),s=Math.min(a.count,d.start+d.count);n<s;n+=3){i=$d(this,r,t,Uo,a,o,l,h,u,n,n+1,n+2),i&&(i.faceIndex=Math.floor(n/3),e.push(i))}}}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}};function zw(t,e,i,n,r,s,a,o){let l;if(l=e.side===yn?n.intersectTriangle(a,s,r,!0,o):n.intersectTriangle(r,s,a,e.side!==pr,o),null===l)return null;Jd.copy(o),Jd.applyMatrix4(t.matrixWorld);let h=i.ray.origin.distanceTo(Jd);return h<i.near||h>i.far?null:{distance:h,point:Jd.clone(),object:t}}function $d(t,e,i,n,r,s,a,o,l,h,u,c){Ns.fromBufferAttribute(r,h),ks.fromBufferAttribute(r,u),Ds.fromBufferAttribute(r,c);let d=t.morphTargetInfluences;if(s&&d){Gd.set(0,0,0),jd.set(0,0,0),Wd.set(0,0,0);for(let t=0,e=s.length;t<e;t++){let e=d[t],i=s[t];0!==e&&(pg.fromBufferAttribute(i,h),fg.fromBufferAttribute(i,u),mg.fromBufferAttribute(i,c),a?(Gd.addScaledVector(pg,e),jd.addScaledVector(fg,e),Wd.addScaledVector(mg,e)):(Gd.addScaledVector(pg.sub(Ns),e),jd.addScaledVector(fg.sub(ks),e),Wd.addScaledVector(mg.sub(Ds),e)))}Ns.add(Gd),ks.add(jd),Ds.add(Wd)}t.isSkinnedMesh&&(t.boneTransform(h,Ns),t.boneTransform(u,ks),t.boneTransform(c,Ds));let p=zw(t,e,i,n,Ns,ks,Ds,gg);if(p){o&&(Xd.fromBufferAttribute(o,h),Yd.fromBufferAttribute(o,u),Zd.fromBufferAttribute(o,c),p.uv=Xt.getUV(gg,Ns,ks,Ds,Xd,Yd,Zd,new de)),l&&(Xd.fromBufferAttribute(l,h),Yd.fromBufferAttribute(l,u),Zd.fromBufferAttribute(l,c),p.uv2=Xt.getUV(gg,Ns,ks,Ds,Xd,Yd,Zd,new de));let t={a:h,b:u,c:c,normal:new I,materialIndex:0};Xt.getNormal(Ns,ks,Ds,t.normal),p.face=t}return p}h(lt,"Mesh"),lt.prototype.isMesh=!0,h(zw,"checkIntersection"),h($d,"checkBufferGeometryIntersection");var dr=class extends wt{constructor(t=1,e=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};let a=this;n=Math.floor(n),r=Math.floor(r),s=Math.floor(s);let o=[],l=[],u=[],c=[],d=0,p=0;function m(t,e,i,n,r,s,h,m,f,g,v){let y=s/f,_=h/g,x=s/2,b=h/2,w=m/2,M=f+1,E=g+1,T=0,S=0,q=new I;for(let s=0;s<E;s++){let a=s*_-b;for(let o=0;o<M;o++){let h=o*y-x;q[t]=h*n,q[e]=a*r,q[i]=w,l.push(q.x,q.y,q.z),q[t]=0,q[e]=0,q[i]=m>0?1:-1,u.push(q.x,q.y,q.z),c.push(o/f),c.push(1-s/g),T+=1}}for(let t=0;t<g;t++)for(let e=0;e<f;e++){let i=d+e+M*t,n=d+e+M*(t+1),r=d+(e+1)+M*(t+1),s=d+(e+1)+M*t;o.push(i,n,s),o.push(n,r,s),S+=6}a.addGroup(p,S,v),p+=S,d+=T}m("z","y","x",-1,-1,i,e,t,s,r,0),m("z","y","x",1,-1,i,e,-t,s,r,1),m("x","z","y",1,1,t,i,e,n,s,2),m("x","z","y",1,-1,t,i,-e,n,s,3),m("x","y","z",1,-1,t,e,i,n,r,4),m("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(o),this.setAttribute("position",new It(l,3)),this.setAttribute("normal",new It(u,3)),this.setAttribute("uv",new It(c,2)),h(m,"buildPlane")}static fromJSON(t){return new dr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function Ll(t){let e={};for(let i in t){e[i]={};for(let n in t[i]){let r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}}return e}function Un(t){let e={};for(let i=0;i<t.length;i++){let n=Ll(t[i]);for(let t in n)e[t]=n[t]}return e}h(dr,"BoxGeometry"),h(Ll,"cloneUniforms"),h(Un,"mergeUniforms");var Uw={clone:Ll,merge:Un},Vw="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",Hw="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",pn=class extends nn{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Vw,this.fragmentShader=Hw,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Ll(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let n=this.uniforms[i].value;n&&n.isTexture?e.uniforms[i]={type:"t",value:n.toJSON(t).uuid}:n&&n.isColor?e.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?e.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?e.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?e.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?e.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?e.uniforms[i]={type:"m4",value:n.toArray()}:e.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;let i={};for(let t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}};h(pn,"ShaderMaterial"),pn.prototype.isShaderMaterial=!0;var ol=class extends rt{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new We,this.projectionMatrix=new We,this.projectionMatrixInverse=new We}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}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)}};h(ol,"Camera"),ol.prototype.isCamera=!0;var vn=class extends ol{constructor(t=50,e=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=n,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){let e=.5*this.getFilmHeight()/t;this.fov=2*Rg*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(.5*Z1*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Rg*Math.atan(Math.tan(.5*Z1*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,i,n,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=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(.5*Z1*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n,s=this.view;if(null!==this.view&&this.view.enabled){let t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*n/t,e-=s.offsetY*i/a,n*=s.width/t,i*=s.height/a}let a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let 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}};h(vn,"PerspectiveCamera"),vn.prototype.isPerspectiveCamera=!0;var Vo=90,Ho=1,ll=class extends rt{constructor(t,e,i){if(super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;let n=new vn(Vo,Ho,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new I(1,0,0)),this.add(n);let r=new vn(Vo,Ho,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new I(-1,0,0)),this.add(r);let s=new vn(Vo,Ho,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new I(0,1,0)),this.add(s);let a=new vn(Vo,Ho,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new I(0,-1,0)),this.add(a);let o=new vn(Vo,Ho,t,e);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new I(0,0,1)),this.add(o);let l=new vn(Vo,Ho,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new I(0,0,-1)),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();let i=this.renderTarget,[n,r,s,a,o,l]=this.children,h=t.xr.enabled,u=t.getRenderTarget();t.xr.enabled=!1;let c=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,a),t.setRenderTarget(i,4),t.render(e,o),i.texture.generateMipmaps=c,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(u),t.xr.enabled=h,i.texture.needsPMREMUpdate=!0}};h(ll,"CubeCamera");var Ia=class extends ln{constructor(t,e,i,n,r,s,a,o,l,h){super(t=void 0!==t?t:[],e=void 0!==e?e:Cl,i,n,r,s,a,o,l,h),this.flipY=!1}get images(){return this.image}set images(t){this.image=t}};h(Ia,"CubeTexture"),Ia.prototype.isCubeTexture=!0;var Wc=class extends dn{constructor(t,e={}){super(t,t,e);let i={width:t,height:t,depth:1},n=[i,i,i,i,i,i];this.texture=new Ia(n,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:Vn}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=Sn,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new dr(5,5,5),r=new pn({name:"CubemapFromEquirect",uniforms:Ll(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:yn,blending:Fs});r.uniforms.tEquirect.value=e;let s=new lt(n,r),a=e.minFilter;return e.minFilter===df&&(e.minFilter=Vn),new ll(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,i,n){let r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,n);t.setRenderTarget(r)}};h(Wc,"WebGLCubeRenderTarget"),Wc.prototype.isWebGLCubeRenderTarget=!0;var yg=new I,Gw=new I,jw=new hn,Ti=class{constructor(t=new I(1,0,0),e=0){this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){let n=yg.subVectors(i,e).cross(Gw.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let 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(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){let i=t.delta(yg),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;let r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){let e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<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){let i=e||jw.getNormalMatrix(t),n=this.coplanarPoint(yg).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.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)}};h(Ti,"Plane"),Ti.prototype.isPlane=!0;var Go=new Yr,Kd=new I,La=class{constructor(t=new Ti,e=new Ti,i=new Ti,n=new Ti,r=new Ti,s=new Ti){this.planes=[t,e,i,n,r,s]}set(t,e,i,n,r,s){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(n),a[4].copy(r),a[5].copy(s),this}copy(t){let e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){let e=this.planes,i=t.elements,n=i[0],r=i[1],s=i[2],a=i[3],o=i[4],l=i[5],h=i[6],u=i[7],c=i[8],d=i[9],p=i[10],m=i[11],f=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(a-n,u-o,m-c,y-f).normalize(),e[1].setComponents(a+n,u+o,m+c,y+f).normalize(),e[2].setComponents(a+r,u+l,m+d,y+g).normalize(),e[3].setComponents(a-r,u-l,m-d,y-g).normalize(),e[4].setComponents(a-s,u-h,m-p,y-v).normalize(),e[5].setComponents(a+s,u+h,m+p,y+v).normalize(),this}intersectsObject(t){let e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Go.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Go)}intersectsSprite(t){return Go.center.set(0,0,0),Go.radius=.7071067811865476,Go.applyMatrix4(t.matrixWorld),this.intersectsSphere(Go)}intersectsSphere(t){let e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(i)<n)return!1;return!0}intersectsBox(t){let e=this.planes;for(let i=0;i<6;i++){let n=e[i];if(Kd.x=n.normal.x>0?t.max.x:t.min.x,Kd.y=n.normal.y>0?t.max.y:t.min.y,Kd.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Kd)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}};function hx(){let t=null,e=!1,i=null,n=null;function r(e,s){i(e,s),n=t.requestAnimationFrame(r)}return h(r,"onAnimationFrame"),{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function Ww(t,e){let i=e.isWebGL2,n=new WeakMap;function r(e,n){let r,s=e.array,a=e.usage,o=t.createBuffer();if(t.bindBuffer(n,o),t.bufferData(n,s,a),e.onUploadCallback(),s instanceof Float32Array)r=5126;else if(s instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!i)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");r=5131}else r=5123;else if(s instanceof Int16Array)r=5122;else if(s instanceof Uint32Array)r=5125;else if(s instanceof Int32Array)r=5124;else if(s instanceof Int8Array)r=5120;else if(s instanceof Uint8Array)r=5121;else{if(!(s instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+s);r=5121}return{buffer:o,type:r,bytesPerElement:s.BYTES_PER_ELEMENT,version:e.version}}function s(e,n,r){let s=n.array,a=n.updateRange;t.bindBuffer(r,e),-1===a.count?t.bufferSubData(r,0,s):(i?t.bufferSubData(r,a.offset*s.BYTES_PER_ELEMENT,s,a.offset,a.count):t.bufferSubData(r,a.offset*s.BYTES_PER_ELEMENT,s.subarray(a.offset,a.offset+a.count)),a.count=-1)}function a(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)}function o(e){e.isInterleavedBufferAttribute&&(e=e.data);let i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))}function l(t,e){if(t.isGLBufferAttribute){let e=n.get(t);return void((!e||e.version<t.version)&&n.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);let i=n.get(t);void 0===i?n.set(t,r(t,e)):i.version<t.version&&(s(i.buffer,t,e),i.version=t.version)}return h(r,"createBuffer"),h(s,"updateBuffer"),h(a,"get"),h(o,"remove"),h(l,"update"),{get:a,remove:o,update:l}}h(La,"Frustum"),h(hx,"WebGLAnimation"),h(Ww,"WebGLAttributes");var xn=class extends wt{constructor(t=1,e=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n};let r=t/2,s=e/2,a=Math.floor(i),o=Math.floor(n),l=a+1,h=o+1,u=t/a,c=e/o,d=[],p=[],m=[],f=[];for(let t=0;t<h;t++){let e=t*c-s;for(let i=0;i<l;i++){let n=i*u-r;p.push(n,-e,0),m.push(0,0,1),f.push(i/a),f.push(1-t/o)}}for(let t=0;t<o;t++)for(let e=0;e<a;e++){let i=e+l*t,n=e+l*(t+1),r=e+1+l*(t+1),s=e+1+l*t;d.push(i,n,s),d.push(n,r,s)}this.setIndex(d),this.setAttribute("position",new It(p,3)),this.setAttribute("normal",new It(m,3)),this.setAttribute("uv",new It(f,2))}static fromJSON(t){return new xn(t.width,t.height,t.widthSegments,t.heightSegments)}};h(xn,"PlaneGeometry");var Xw="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",Yw="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",Zw="#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",Jw="#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",$w="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",Kw="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",Qw="vec3 transformed = vec3( position );",e7="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",t7="vec3 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 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}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float 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\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\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}\nfloat 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}\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",n7="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + 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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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",i7="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",r7="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",s7="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",a7="#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",o7="#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",l7="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",c7="#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",u7="#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",h7="#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; }\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 color ) { return dot( color, vec3( 0.3333 ) ); }\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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\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 linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.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}",d7="#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\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\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 r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + 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 ), 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",p7="vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",f7="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",m7="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",g7="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",y7="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",v7="gl_FragColor = linearToOutputTexel( gl_FragColor );",x7="vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( 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}",_7="#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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\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",b7="#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\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",M7="#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\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",w7="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\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",T7="#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",E7="#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",S7="#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",A7="#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",q7="#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",P7="#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\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",C7="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",I7="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",L7="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",O7="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\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 ( PHYSICALLY_CORRECT_LIGHTS )\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#else\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#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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\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 GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\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",R7="#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, 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#endif",N7="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",k7="varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",D7="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",B7="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 GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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\n#define Material_LightProbeLOD( material )\t(0)",F7="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\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\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\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( ( ior - 1.0 ) / ( 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, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).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_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",z7="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_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\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}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\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}",U7="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( 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, geometry, 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\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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( 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, geometry, 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, geometry, 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\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\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 ], geometry.normal );\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",V7="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",H7="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",G7="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",j7="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",W7="#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",X7="#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",Y7="#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\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#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",Z7="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",J7="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\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",$7="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",K7="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",Q7="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",eT="#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",tT="#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",nT="#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tfloat texelIndex = float( vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV );\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",iT="#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",rT="float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",sT="#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).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( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",aT="#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",oT="#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",lT="#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",cT="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.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 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",uT="#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",hT="#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",dT="#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",pT="#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",fT="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}\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 linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( 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 invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",mT="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",gT="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",yT="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",vT="#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",xT="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",_T="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",bT="#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\tvarying vec4 vSpotShadowCoord[ 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\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\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",MT="#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\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ 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 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",wT="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",TT="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, vSpotShadowCoord[ 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}",ET="#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",ST="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",AT="#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",qT="#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",PT="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",CT="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",IT="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",LT="#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn 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}\nvec3 CustomToneMapping( vec3 color ) { return color; }",OT="#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",RT="#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\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 framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\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 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",NT="#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",kT="#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",DT="#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",BT="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",FT="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",zT="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",UT="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",VT="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}",HT="uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",GT="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}",jT="#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",WT="#include <common>\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 <skinbase_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}",XT="#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 <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\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 <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}",YT="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\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 <skinbase_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}",ZT="#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 <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",JT="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",$T="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 <encodings_fragment>\n}",KT="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\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>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_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}",QT="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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",e8="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",t8="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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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 <cube_uv_reflection_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity;\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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",n8="#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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 <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 <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",i8="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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 <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",r8="#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\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 <morphcolor_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}",s8="#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 <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",a8="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\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 <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#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",o8="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\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\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 ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",l8="#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",c8="#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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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 <cube_uv_reflection_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",u8="#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",h8="#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define 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 SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\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 <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",d8="#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",p8="#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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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 <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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",f8="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>\nvoid main() {\n\t#include <color_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}",m8="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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",g8="#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\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 <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",y8="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 <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",v8="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}",x8="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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",xt={alphamap_fragment:Xw,alphamap_pars_fragment:Yw,alphatest_fragment:Zw,alphatest_pars_fragment:Jw,aomap_fragment:$w,aomap_pars_fragment:Kw,begin_vertex:Qw,beginnormal_vertex:e7,bsdfs:t7,bumpmap_pars_fragment:n7,clipping_planes_fragment:i7,clipping_planes_pars_fragment:r7,clipping_planes_pars_vertex:s7,clipping_planes_vertex:a7,color_fragment:o7,color_pars_fragment:l7,color_pars_vertex:c7,color_vertex:u7,common:h7,cube_uv_reflection_fragment:d7,defaultnormal_vertex:p7,displacementmap_pars_vertex:f7,displacementmap_vertex:m7,emissivemap_fragment:g7,emissivemap_pars_fragment:y7,encodings_fragment:v7,encodings_pars_fragment:x7,envmap_fragment:_7,envmap_common_pars_fragment:b7,envmap_pars_fragment:M7,envmap_pars_vertex:w7,envmap_physical_pars_fragment:R7,envmap_vertex:T7,fog_vertex:E7,fog_pars_vertex:S7,fog_fragment:A7,fog_pars_fragment:q7,gradientmap_pars_fragment:P7,lightmap_fragment:C7,lightmap_pars_fragment:I7,lights_lambert_vertex:L7,lights_pars_begin:O7,lights_toon_fragment:N7,lights_toon_pars_fragment:k7,lights_phong_fragment:D7,lights_phong_pars_fragment:B7,lights_physical_fragment:F7,lights_physical_pars_fragment:z7,lights_fragment_begin:U7,lights_fragment_maps:V7,lights_fragment_end:H7,logdepthbuf_fragment:G7,logdepthbuf_pars_fragment:j7,logdepthbuf_pars_vertex:W7,logdepthbuf_vertex:X7,map_fragment:Y7,map_pars_fragment:Z7,map_particle_fragment:J7,map_particle_pars_fragment:$7,metalnessmap_fragment:K7,metalnessmap_pars_fragment:Q7,morphcolor_vertex:eT,morphnormal_vertex:tT,morphtarget_pars_vertex:nT,morphtarget_vertex:iT,normal_fragment_begin:rT,normal_fragment_maps:sT,normal_pars_fragment:aT,normal_pars_vertex:oT,normal_vertex:lT,normalmap_pars_fragment:cT,clearcoat_normal_fragment_begin:uT,clearcoat_normal_fragment_maps:hT,clearcoat_pars_fragment:dT,output_fragment:pT,packing:fT,premultiplied_alpha_fragment:mT,project_vertex:gT,dithering_fragment:yT,dithering_pars_fragment:vT,roughnessmap_fragment:xT,roughnessmap_pars_fragment:_T,shadowmap_pars_fragment:bT,shadowmap_pars_vertex:MT,shadowmap_vertex:wT,shadowmask_pars_fragment:TT,skinbase_vertex:ET,skinning_pars_vertex:ST,skinning_vertex:AT,skinnormal_vertex:qT,specularmap_fragment:PT,specularmap_pars_fragment:CT,tonemapping_fragment:IT,tonemapping_pars_fragment:LT,transmission_fragment:OT,transmission_pars_fragment:RT,uv_pars_fragment:NT,uv_pars_vertex:kT,uv_vertex:DT,uv2_pars_fragment:BT,uv2_pars_vertex:FT,uv2_vertex:zT,worldpos_vertex:UT,background_vert:VT,background_frag:HT,cube_vert:GT,cube_frag:jT,depth_vert:WT,depth_frag:XT,distanceRGBA_vert:YT,distanceRGBA_frag:ZT,equirect_vert:JT,equirect_frag:$T,linedashed_vert:KT,linedashed_frag:QT,meshbasic_vert:e8,meshbasic_frag:t8,meshlambert_vert:n8,meshlambert_frag:i8,meshmatcap_vert:r8,meshmatcap_frag:s8,meshnormal_vert:a8,meshnormal_frag:o8,meshphong_vert:l8,meshphong_frag:c8,meshphysical_vert:u8,meshphysical_frag:h8,meshtoon_vert:d8,meshtoon_frag:p8,points_vert:f8,points_frag:m8,shadow_vert:g8,shadow_frag:y8,sprite_vert:v8,sprite_frag:x8},Le={common:{diffuse:{value:new Ee(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new hn},uv2Transform:{value:new hn},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new de(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ee(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:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{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 Ee(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new hn}},sprite:{diffuse:{value:new Ee(16777215)},opacity:{value:1},center:{value:new de(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new hn}}},lr={basic:{uniforms:Un([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.fog]),vertexShader:xt.meshbasic_vert,fragmentShader:xt.meshbasic_frag},lambert:{uniforms:Un([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.fog,Le.lights,{emissive:{value:new Ee(0)}}]),vertexShader:xt.meshlambert_vert,fragmentShader:xt.meshlambert_frag},phong:{uniforms:Un([Le.common,Le.specularmap,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,Le.lights,{emissive:{value:new Ee(0)},specular:{value:new Ee(1118481)},shininess:{value:30}}]),vertexShader:xt.meshphong_vert,fragmentShader:xt.meshphong_frag},standard:{uniforms:Un([Le.common,Le.envmap,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.roughnessmap,Le.metalnessmap,Le.fog,Le.lights,{emissive:{value:new Ee(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:xt.meshphysical_vert,fragmentShader:xt.meshphysical_frag},toon:{uniforms:Un([Le.common,Le.aomap,Le.lightmap,Le.emissivemap,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.gradientmap,Le.fog,Le.lights,{emissive:{value:new Ee(0)}}]),vertexShader:xt.meshtoon_vert,fragmentShader:xt.meshtoon_frag},matcap:{uniforms:Un([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,Le.fog,{matcap:{value:null}}]),vertexShader:xt.meshmatcap_vert,fragmentShader:xt.meshmatcap_frag},points:{uniforms:Un([Le.points,Le.fog]),vertexShader:xt.points_vert,fragmentShader:xt.points_frag},dashed:{uniforms:Un([Le.common,Le.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:xt.linedashed_vert,fragmentShader:xt.linedashed_frag},depth:{uniforms:Un([Le.common,Le.displacementmap]),vertexShader:xt.depth_vert,fragmentShader:xt.depth_frag},normal:{uniforms:Un([Le.common,Le.bumpmap,Le.normalmap,Le.displacementmap,{opacity:{value:1}}]),vertexShader:xt.meshnormal_vert,fragmentShader:xt.meshnormal_frag},sprite:{uniforms:Un([Le.sprite,Le.fog]),vertexShader:xt.sprite_vert,fragmentShader:xt.sprite_frag},background:{uniforms:{uvTransform:{value:new hn},t2D:{value:null}},vertexShader:xt.background_vert,fragmentShader:xt.background_frag},cube:{uniforms:Un([Le.envmap,{opacity:{value:1}}]),vertexShader:xt.cube_vert,fragmentShader:xt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:xt.equirect_vert,fragmentShader:xt.equirect_frag},distanceRGBA:{uniforms:Un([Le.common,Le.displacementmap,{referencePosition:{value:new I},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:xt.distanceRGBA_vert,fragmentShader:xt.distanceRGBA_frag},shadow:{uniforms:Un([Le.lights,Le.fog,{color:{value:new Ee(0)},opacity:{value:1}}]),vertexShader:xt.shadow_vert,fragmentShader:xt.shadow_frag}};function _8(t,e,i,n,r,s){let a,o,l=new Ee(0),u=!0===r?0:1,c=null,d=0,p=null;function m(i,r){let s=!1,h=!0===r.isScene?r.background:null;h&&h.isTexture&&(h=e.get(h));let m=t.xr,g=m.getSession&&m.getSession();g&&"additive"===g.environmentBlendMode&&(h=null),null===h?f(l,u):h&&h.isColor&&(f(h,1),s=!0),(t.autoClear||s)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),h&&(h.isCubeTexture||h.mapping===hf)?(void 0===o&&(o=new lt(new dr(1,1,1),new pn({name:"BackgroundCubeMaterial",uniforms:Ll(lr.cube.uniforms),vertexShader:lr.cube.vertexShader,fragmentShader:lr.cube.fragmentShader,side:yn,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o)),o.material.uniforms.envMap.value=h,o.material.uniforms.flipEnvMap.value=h.isCubeTexture&&!1===h.isRenderTargetTexture?-1:1,(c!==h||d!==h.version||p!==t.toneMapping)&&(o.material.needsUpdate=!0,c=h,d=h.version,p=t.toneMapping),i.unshift(o,o.geometry,o.material,0,0,null)):h&&h.isTexture&&(void 0===a&&(a=new lt(new xn(2,2),new pn({name:"BackgroundMaterial",uniforms:Ll(lr.background.uniforms),vertexShader:lr.background.vertexShader,fragmentShader:lr.background.fragmentShader,side:Xs,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=h,!0===h.matrixAutoUpdate&&h.updateMatrix(),a.material.uniforms.uvTransform.value.copy(h.matrix),(c!==h||d!==h.version||p!==t.toneMapping)&&(a.material.needsUpdate=!0,c=h,d=h.version,p=t.toneMapping),i.unshift(a,a.geometry,a.material,0,0,null))}function f(t,e){i.buffers.color.setClear(t.r,t.g,t.b,e,s)}return h(m,"render"),h(f,"setClear"),{getClearColor:function(){return l},setClearColor:function(t,e=1){l.set(t),u=e,f(l,u)},getClearAlpha:function(){return u},setClearAlpha:function(t){u=t,f(l,u)},render:m}}function b8(t,e,i,n){let r=t.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),a=n.isWebGL2||null!==s,o={},l=g(null),u=l;function c(e,n,r,s,o){let l=!1;if(a){let t=f(s,r,n);u!==t&&(u=t,p(u.object)),l=v(s,o),l&&y(s,o)}else{let t=!0===n.wireframe;(u.geometry!==s.id||u.program!==r.id||u.wireframe!==t)&&(u.geometry=s.id,u.program=r.id,u.wireframe=t,l=!0)}!0===e.isInstancedMesh&&(l=!0),null!==o&&i.update(o,34963),l&&(E(e,n,r,s),null!==o&&t.bindBuffer(34963,i.get(o).buffer))}function d(){return n.isWebGL2?t.createVertexArray():s.createVertexArrayOES()}function p(e){return n.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function m(e){return n.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function f(t,e,i){let n=!0===i.wireframe,r=o[t.id];void 0===r&&(r={},o[t.id]=r);let s=r[e.id];void 0===s&&(s={},r[e.id]=s);let a=s[n];return void 0===a&&(a=g(d()),s[n]=a),a}function g(t){let e=[],i=[],n=[];for(let t=0;t<r;t++)e[t]=0,i[t]=0,n[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:n,object:t,attributes:{},index:null}}function v(t,e){let i=u.attributes,n=t.attributes,r=0;for(let t in n){let e=i[t],s=n[t];if(void 0===e||e.attribute!==s||e.data!==s.data)return!0;r++}return u.attributesNum!==r||u.index!==e}function y(t,e){let i={},n=t.attributes,r=0;for(let t in n){let e=n[t],s={};s.attribute=e,e.data&&(s.data=e.data),i[t]=s,r++}u.attributes=i,u.attributesNum=r,u.index=e}function _(){let t=u.newAttributes;for(let e=0,i=t.length;e<i;e++)t[e]=0}function x(t){b(t,0)}function b(i,r){let s=u.newAttributes,a=u.enabledAttributes,o=u.attributeDivisors;s[i]=1,0===a[i]&&(t.enableVertexAttribArray(i),a[i]=1),o[i]!==r&&((n.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),o[i]=r)}function w(){let e=u.newAttributes,i=u.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==e[n]&&(t.disableVertexAttribArray(n),i[n]=0)}function M(e,i,r,s,a,o){!0!==n.isWebGL2||5124!==r&&5125!==r?t.vertexAttribPointer(e,i,r,s,a,o):t.vertexAttribIPointer(e,i,r,a,o)}function E(r,s,a,o){if(!1===n.isWebGL2&&(r.isInstancedMesh||o.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;_();let l=o.attributes,h=a.getAttributes(),u=s.defaultAttributeValues;for(let e in h){let n=h[e];if(n.location>=0){let s=l[e];if(void 0===s&&("instanceMatrix"===e&&r.instanceMatrix&&(s=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(s=r.instanceColor)),void 0!==s){let e=s.normalized,a=s.itemSize,l=i.get(s);if(void 0===l)continue;let h=l.buffer,u=l.type,c=l.bytesPerElement;if(s.isInterleavedBufferAttribute){let i=s.data,l=i.stride,d=s.offset;if(i.isInstancedInterleavedBuffer){for(let t=0;t<n.locationSize;t++)b(n.location+t,i.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let t=0;t<n.locationSize;t++)x(n.location+t);t.bindBuffer(34962,h);for(let t=0;t<n.locationSize;t++)M(n.location+t,a/n.locationSize,u,e,l*c,(d+a/n.locationSize*t)*c)}else{if(s.isInstancedBufferAttribute){for(let t=0;t<n.locationSize;t++)b(n.location+t,s.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let t=0;t<n.locationSize;t++)x(n.location+t);t.bindBuffer(34962,h);for(let t=0;t<n.locationSize;t++)M(n.location+t,a/n.locationSize,u,e,a*c,a/n.locationSize*t*c)}}else if(void 0!==u){let i=u[e];if(void 0!==i)switch(i.length){case 2:t.vertexAttrib2fv(n.location,i);break;case 3:t.vertexAttrib3fv(n.location,i);break;case 4:t.vertexAttrib4fv(n.location,i);break;default:t.vertexAttrib1fv(n.location,i)}}}}w()}function T(){P();for(let t in o){let e=o[t];for(let t in e){let i=e[t];for(let t in i)m(i[t].object),delete i[t];delete e[t]}delete o[t]}}function S(t){if(void 0===o[t.id])return;let e=o[t.id];for(let t in e){let i=e[t];for(let t in i)m(i[t].object),delete i[t];delete e[t]}delete o[t.id]}function q(t){for(let e in o){let i=o[e];if(void 0===i[t.id])continue;let n=i[t.id];for(let t in n)m(n[t].object),delete n[t];delete i[t.id]}}function P(){A(),u!==l&&(u=l,p(u.object))}function A(){l.geometry=null,l.program=null,l.wireframe=!1}return h(c,"setup"),h(d,"createVertexArrayObject"),h(p,"bindVertexArrayObject"),h(m,"deleteVertexArrayObject"),h(f,"getBindingState"),h(g,"createBindingState"),h(v,"needsUpdate"),h(y,"saveCache"),h(_,"initAttributes"),h(x,"enableAttribute"),h(b,"enableAttributeAndDivisor"),h(w,"disableUnusedAttributes"),h(M,"vertexAttribPointer"),h(E,"setupVertexAttributes"),h(T,"dispose"),h(S,"releaseStatesOfGeometry"),h(q,"releaseStatesOfProgram"),h(P,"reset"),h(A,"resetDefaultState"),{setup:c,reset:P,resetDefaultState:A,dispose:T,releaseStatesOfGeometry:S,releaseStatesOfProgram:q,initAttributes:_,enableAttribute:x,disableUnusedAttributes:w}}function M8(t,e,i,n){let r,s=n.isWebGL2;function a(t){r=t}function o(e,n){t.drawArrays(r,e,n),i.update(n,r,1)}function l(n,a,o){if(0===o)return;let l,h;if(s)l=t,h="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[h](r,n,a,o),i.update(a,r,o)}h(a,"setMode"),h(o,"render"),h(l,"renderInstances"),this.setMode=a,this.render=o,this.renderInstances=l}function w8(t,e,i){let n;function r(){if(void 0!==n)return n;if(!0===e.has("EXT_texture_filter_anisotropic")){let i=e.get("EXT_texture_filter_anisotropic");n=t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}h(r,"getMaxAnisotropy"),h(s,"getMaxPrecision");let a="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,o=void 0!==i.precision?i.precision:"highp",l=s(o);l!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);let u=a||e.has("WEBGL_draw_buffers"),c=!0===i.logarithmicDepthBuffer,d=t.getParameter(34930),p=t.getParameter(35660),m=t.getParameter(3379),f=t.getParameter(34076),g=t.getParameter(34921),v=t.getParameter(36347),y=t.getParameter(36348),_=t.getParameter(36349),x=p>0,b=a||e.has("OES_texture_float");return{isWebGL2:a,drawBuffers:u,getMaxAnisotropy:r,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:c,maxTextures:d,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:f,maxAttributes:g,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:_,vertexTextures:x,floatFragmentTextures:b,floatVertexTextures:x&&b,maxSamples:a?t.getParameter(36183):0}}function T8(t){let e=this,i=null,n=0,r=!1,s=!1,a=new Ti,o=new hn,l={value:null,needsUpdate:!1};function u(){l.value!==i&&(l.value=i,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(t,i,n,r){let s=null!==t?t.length:0,h=null;if(0!==s){if(h=l.value,!0!==r||null===h){let e=n+4*s,r=i.matrixWorldInverse;o.getNormalMatrix(r),(null===h||h.length<e)&&(h=new Float32Array(e));for(let e=0,i=n;e!==s;++e,i+=4)a.copy(t[e]).applyMatrix4(r,o),a.normal.toArray(h,i),h[i+3]=a.constant}l.value=h,l.needsUpdate=!0}return e.numPlanes=s,e.numIntersection=0,h}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,s){let a=0!==t.length||e||0!==n||r;return r=e,i=c(t,s,0),n=t.length,a},this.beginShadows=function(){s=!0,c(null)},this.endShadows=function(){s=!1,u()},this.setState=function(e,a,o){let h=e.clippingPlanes,d=e.clipIntersection,p=e.clipShadows,m=t.get(e);if(!r||null===h||0===h.length||s&&!p)s?c(null):u();else{let t=s?0:n,e=4*t,r=m.clippingState||null;l.value=r,r=c(h,a,e,o);for(let t=0;t!==e;++t)r[t]=i[t];m.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}},h(u,"resetGlobalState"),h(c,"projectPlanes")}function E8(t){let e=new WeakMap;function i(t,e){return e===Cg?t.mapping=Cl:e===Ig&&(t.mapping=Il),t}function n(n){if(n&&n.isTexture&&!1===n.isRenderTargetTexture){let s=n.mapping;if(s===Cg||s===Ig){if(e.has(n)){return i(e.get(n).texture,n.mapping)}{let s=n.image;if(s&&s.height>0){let a=new Wc(s.height/2);return a.fromEquirectangularTexture(t,n),e.set(n,a),n.addEventListener("dispose",r),i(a.texture,n.mapping)}return null}}}return n}function r(t){let i=t.target;i.removeEventListener("dispose",r);let n=e.get(i);void 0!==n&&(e.delete(i),n.dispose())}function s(){e=new WeakMap}return h(i,"mapTextureMapping"),h(n,"get"),h(r,"onTextureDispose"),h(s,"dispose"),{get:n,dispose:s}}lr.physical={uniforms:Un([lr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new de(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Ee(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new de},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ee(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Ee(1,1,1)},specularColorMap:{value:null}}]),vertexShader:xt.meshphysical_vert,fragmentShader:xt.meshphysical_frag},h(_8,"WebGLBackground"),h(b8,"WebGLBindingStates"),h(M8,"WebGLBufferRenderer"),h(w8,"WebGLCapabilities"),h(T8,"WebGLClipping"),h(E8,"WebGLCubeMaps");var Vs=class extends ol{constructor(t=-1,e=1,i=1,n=-1,r=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,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,i,n,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=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,r=i-t,s=i+t,a=n+e,o=n-e;if(null!==this.view&&this.view.enabled){let 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.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let 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}};h(Vs,"OrthographicCamera"),Vs.prototype.isOrthographicCamera=!0;var Qo=4,ov=[.125,.215,.35,.446,.526,.582],Aa=20,vg=new Vs,lv=new Ee,xg=null,Sa=(1+Math.sqrt(5))/2,jo=1/Sa,cv=[new I(1,1,1),new I(-1,1,1),new I(1,1,-1),new I(-1,1,-1),new I(0,Sa,jo),new I(0,Sa,-jo),new I(jo,0,Sa),new I(-jo,0,Sa),new I(Sa,jo,0),new I(-Sa,jo,0)],Xc=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,i=.1,n=100){xg=this._renderer.getRenderTarget(),this._setSize(256);let r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,i,n,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=dv(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=hv(),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(){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(xg),t.scissorTest=!1,Qd(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Cl||t.mapping===Il?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),xg=this._renderer.getRenderTarget();let i=e||this._allocateTargets();return this._textureToCubeUV(t,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize-32,i={magFilter:Vn,minFilter:Vn,generateMipmaps:!1,type:nl,format:Sn,encoding:Ys,depthBuffer:!1},n=uv(t,e,i);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=uv(t,e,i);let{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=S8(n)),this._blurMaterial=A8(n,t,e)}return n}_compileMaterial(t){let e=new lt(this._lodPlanes[0],t);this._renderer.compile(e,vg)}_sceneToCubeUV(t,e,i,n){let r=new vn(90,1,e,i),s=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,h=o.toneMapping;o.getClearColor(lv),o.toneMapping=zs,o.autoClear=!1;let u=new Hn({name:"PMREM.Background",side:yn,depthWrite:!1,depthTest:!1}),c=new lt(new dr,u),d=!1,p=t.background;p?p.isColor&&(u.color.copy(p),t.background=null,d=!0):(u.color.copy(lv),d=!0);for(let e=0;e<6;e++){let i=e%3;0===i?(r.up.set(0,s[e],0),r.lookAt(a[e],0,0)):1===i?(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]));let l=this._cubeSize;Qd(n,i*l,e>2?l:0,l,l),o.setRenderTarget(n),d&&o.render(c,r),o.render(t,r)}c.geometry.dispose(),c.material.dispose(),o.toneMapping=h,o.autoClear=l,t.background=p}_textureToCubeUV(t,e){let i=this._renderer,n=t.mapping===Cl||t.mapping===Il;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=dv()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=hv());let r=n?this._cubemapMaterial:this._equirectMaterial,s=new lt(this._lodPlanes[0],r);r.uniforms.envMap.value=t;let a=this._cubeSize;Qd(e,0,0,3*a,2*a),i.setRenderTarget(e),i.render(s,vg)}_applyPMREM(t){let e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){let i=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),n=cv[(e-1)%cv.length];this._blur(t,e-1,e,i,n)}e.autoClear=i}_blur(t,e,i,n,r){let s=this._pingPongRenderTarget;this._halfBlur(t,s,e,i,n,"latitudinal",r),this._halfBlur(s,t,i,i,n,"longitudinal",r)}_halfBlur(t,e,i,n,r,s,a){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");let h=new lt(this._lodPlanes[n],l),u=l.uniforms,c=this._sizeLods[i]-1,d=isFinite(r)?Math.PI/(2*c):2*Math.PI/(2*Aa-1),p=r/d,m=isFinite(r)?1+Math.floor(3*p):Aa;m>Aa&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Aa}`);let f=[],g=0;for(let t=0;t<Aa;++t){let e=t/p,i=Math.exp(-e*e/2);f.push(i),0===t?g+=i:t<m&&(g+=2*i)}for(let t=0;t<f.length;t++)f[t]=f[t]/g;u.envMap.value=t.texture,u.samples.value=m,u.weights.value=f,u.latitudinal.value="latitudinal"===s,a&&(u.poleAxis.value=a);let{_lodMax:v}=this;u.dTheta.value=d,u.mipInt.value=v-i;let y=this._sizeLods[n];Qd(e,3*y*(n>v-Qo?n-v+Qo:0),4*(this._cubeSize-y),3*y,2*y),o.setRenderTarget(e),o.render(h,vg)}};function S8(t){let e=[],i=[],n=[],r=t,s=t-Qo+1+ov.length;for(let a=0;a<s;a++){let s=Math.pow(2,r);i.push(s);let o=1/s;a>t-Qo?o=ov[a-t+Qo-1]:0===a&&(o=0),n.push(o);let l=1/(s-1),h=-l/2,u=1+l/2,c=[h,h,u,h,u,u,h,h,u,u,h,u],d=6,p=6,m=3,f=2,g=1,v=new Float32Array(m*p*d),y=new Float32Array(f*p*d),_=new Float32Array(g*p*d);for(let t=0;t<d;t++){let e=t%3*2/3-1,i=t>2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];v.set(n,m*p*t),y.set(c,f*p*t);let r=[t,t,t,t,t,t];_.set(r,g*p*t)}let x=new wt;x.setAttribute("position",new qt(v,m)),x.setAttribute("uv",new qt(y,f)),x.setAttribute("faceIndex",new qt(_,g)),e.push(x),r>Qo&&r--}return{lodPlanes:e,sizeLods:i,sigmas:n}}function uv(t,e,i){let n=new dn(t,e,i);return n.texture.mapping=hf,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Qd(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function A8(t,e,i){let n=new Float32Array(Aa),r=new I(0,1,0);return new pn({name:"SphericalGaussianBlur",defines:{n:Aa,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:jg(),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:Fs,depthTest:!1,depthWrite:!1})}function hv(){return new pn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:jg(),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:Fs,depthTest:!1,depthWrite:!1})}function dv(){return new pn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:jg(),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:Fs,depthTest:!1,depthWrite:!1})}function jg(){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 q8(t){let e=new WeakMap,i=null;function n(n){if(n&&n.isTexture){let a=n.mapping,o=a===Cg||a===Ig,l=a===Cl||a===Il;if(o||l){if(n.isRenderTargetTexture&&!0===n.needsPMREMUpdate){n.needsPMREMUpdate=!1;let r=e.get(n);return null===i&&(i=new Xc(t)),r=o?i.fromEquirectangular(n,r):i.fromCubemap(n,r),e.set(n,r),r.texture}if(e.has(n))return e.get(n).texture;{let a=n.image;if(o&&a&&a.height>0||l&&a&&r(a)){null===i&&(i=new Xc(t));let r=o?i.fromEquirectangular(n):i.fromCubemap(n);return e.set(n,r),n.addEventListener("dispose",s),r.texture}return null}}}return n}function r(t){let e=0;for(let i=0;i<6;i++)void 0!==t[i]&&e++;return 6===e}function s(t){let i=t.target;i.removeEventListener("dispose",s);let n=e.get(i);void 0!==n&&(e.delete(i),n.dispose())}function a(){e=new WeakMap,null!==i&&(i.dispose(),i=null)}return h(n,"get"),h(r,"isCubeTextureComplete"),h(s,"onTextureDispose"),h(a,"dispose"),{get:n,dispose:a}}function P8(t){let e={};function i(i){if(void 0!==e[i])return e[i];let n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=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":n=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":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return e[i]=n,n}return h(i,"getExtension"),{has:function(t){return null!==i(t)},init:function(t){t.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture")},get:function(t){let e=i(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function C8(t,e,i,n){let r={},s=new WeakMap;function a(t){let o=t.target;null!==o.index&&e.remove(o.index);for(let t in o.attributes)e.remove(o.attributes[t]);o.removeEventListener("dispose",a),delete r[o.id];let l=s.get(o);l&&(e.remove(l),s.delete(o)),n.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,i.memory.geometries--}function o(t,e){return!0===r[e.id]||(e.addEventListener("dispose",a),r[e.id]=!0,i.memory.geometries++),e}function l(t){let i=t.attributes;for(let t in i)e.update(i[t],34962);let n=t.morphAttributes;for(let t in n){let i=n[t];for(let t=0,n=i.length;t<n;t++)e.update(i[t],34962)}}function u(t){let i=[],n=t.index,r=t.attributes.position,a=0;if(null!==n){let t=n.array;a=n.version;for(let e=0,n=t.length;e<n;e+=3){let n=t[e+0],r=t[e+1],s=t[e+2];i.push(n,r,r,s,s,n)}}else{let t=r.array;a=r.version;for(let e=0,n=t.length/3-1;e<n;e+=3){let t=e+0,n=e+1,r=e+2;i.push(t,n,n,r,r,t)}}let o=new(cx(i)?jc:Gc)(i,1);o.version=a;let l=s.get(t);l&&e.remove(l),s.set(t,o)}function c(t){let e=s.get(t);if(e){let i=t.index;null!==i&&e.version<i.version&&u(t)}else u(t);return s.get(t)}return h(a,"onGeometryDispose"),h(o,"get"),h(l,"update"),h(u,"updateWireframeAttribute"),h(c,"getWireframeAttribute"),{get:o,update:l,getWireframeAttribute:c}}function I8(t,e,i,n){let r,s,a,o=n.isWebGL2;function l(t){r=t}function u(t){s=t.type,a=t.bytesPerElement}function c(e,n){t.drawElements(r,n,s,e*a),i.update(n,r,1)}function d(n,l,h){if(0===h)return;let u,c;if(o)u=t,c="drawElementsInstanced";else if(u=e.get("ANGLE_instanced_arrays"),c="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[c](r,l,s,n*a,h),i.update(l,r,h)}h(l,"setMode"),h(u,"setIndex"),h(c,"render"),h(d,"renderInstances"),this.setMode=l,this.setIndex=u,this.render=c,this.renderInstances=d}function L8(t){let e={frame:0,calls:0,triangles:0,points:0,lines:0};function i(t,i,n){switch(e.calls++,i){case 4:e.triangles+=n*(t/3);break;case 1:e.lines+=n*(t/2);break;case 3:e.lines+=n*(t-1);break;case 2:e.lines+=n*t;break;case 0:e.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}function n(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0}return h(i,"update"),h(n,"reset"),{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:n,update:i}}function O8(t,e){return t[0]-e[0]}function R8(t,e){return Math.abs(e[1])-Math.abs(t[1])}function _g(t,e){let i=1,n=e.isInterleavedBufferAttribute?e.data.array:e.array;n instanceof Int8Array?i=127:n instanceof Int16Array?i=32767:n instanceof Int32Array?i=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",n),t.divideScalar(i)}function N8(t,e,i){let n={},r=new Float32Array(8),s=new WeakMap,a=new Ct,o=[];for(let t=0;t<8;t++)o[t]=[t,0];function l(l,u,c,d){let p=l.morphTargetInfluences;if(!0===e.isWebGL2){let n=u.morphAttributes.position||u.morphAttributes.normal||u.morphAttributes.color,r=void 0!==n?n.length:0,o=s.get(u);if(void 0===o||o.count!==r){let t=function(){y.dispose(),s.delete(u),u.removeEventListener("dispose",t)};h(t,"disposeTexture"),void 0!==o&&o.texture.dispose();let i=void 0!==u.morphAttributes.position,n=void 0!==u.morphAttributes.normal,l=void 0!==u.morphAttributes.color,c=u.morphAttributes.position||[],d=u.morphAttributes.normal||[],p=u.morphAttributes.color||[],m=0;!0===i&&(m=1),!0===n&&(m=2),!0===l&&(m=3);let f=u.attributes.position.count*m,g=1;f>e.maxTextureSize&&(g=Math.ceil(f/e.maxTextureSize),f=e.maxTextureSize);let v=new Float32Array(f*g*4*r),y=new Ca(v,f,g,r);y.format=Sn,y.type=qa,y.needsUpdate=!0;let _=4*m;for(let t=0;t<r;t++){let e=c[t],r=d[t],s=p[t],o=f*g*4*t;for(let t=0;t<e.count;t++){let h=t*_;!0===i&&(a.fromBufferAttribute(e,t),!0===e.normalized&&_g(a,e),v[o+h+0]=a.x,v[o+h+1]=a.y,v[o+h+2]=a.z,v[o+h+3]=0),!0===n&&(a.fromBufferAttribute(r,t),!0===r.normalized&&_g(a,r),v[o+h+4]=a.x,v[o+h+5]=a.y,v[o+h+6]=a.z,v[o+h+7]=0),!0===l&&(a.fromBufferAttribute(s,t),!0===s.normalized&&_g(a,r),v[o+h+8]=a.x,v[o+h+9]=a.y,v[o+h+10]=a.z,v[o+h+11]=4===s.itemSize?a.w:1)}}o={count:r,texture:y,size:new de(f,g)},s.set(u,o),u.addEventListener("dispose",t)}let l=0;for(let t=0;t<p.length;t++)l+=p[t];let c=u.morphTargetsRelative?1:1-l;d.getUniforms().setValue(t,"morphTargetBaseInfluence",c),d.getUniforms().setValue(t,"morphTargetInfluences",p),d.getUniforms().setValue(t,"morphTargetsTexture",o.texture,i),d.getUniforms().setValue(t,"morphTargetsTextureSize",o.size)}else{let e=void 0===p?0:p.length,i=n[u.id];if(void 0===i||i.length!==e){i=[];for(let t=0;t<e;t++)i[t]=[t,0];n[u.id]=i}for(let t=0;t<e;t++){let e=i[t];e[0]=t,e[1]=p[t]}i.sort(R8);for(let t=0;t<8;t++)t<e&&i[t][1]?(o[t][0]=i[t][0],o[t][1]=i[t][1]):(o[t][0]=Number.MAX_SAFE_INTEGER,o[t][1]=0);o.sort(O8);let s=u.morphAttributes.position,a=u.morphAttributes.normal,l=0;for(let t=0;t<8;t++){let e=o[t],i=e[0],n=e[1];i!==Number.MAX_SAFE_INTEGER&&n?(s&&u.getAttribute("morphTarget"+t)!==s[i]&&u.setAttribute("morphTarget"+t,s[i]),a&&u.getAttribute("morphNormal"+t)!==a[i]&&u.setAttribute("morphNormal"+t,a[i]),r[t]=n,l+=n):(s&&!0===u.hasAttribute("morphTarget"+t)&&u.deleteAttribute("morphTarget"+t),a&&!0===u.hasAttribute("morphNormal"+t)&&u.deleteAttribute("morphNormal"+t),r[t]=0)}let h=u.morphTargetsRelative?1:1-l;d.getUniforms().setValue(t,"morphTargetBaseInfluence",h),d.getUniforms().setValue(t,"morphTargetInfluences",r)}}return h(l,"update"),{update:l}}function k8(t,e,i,n){let r=new WeakMap;function s(t){let s=n.render.frame,a=t.geometry,l=e.get(t,a);return r.get(l)!==s&&(e.update(l),r.set(l,s)),t.isInstancedMesh&&(!1===t.hasEventListener("dispose",o)&&t.addEventListener("dispose",o),i.update(t.instanceMatrix,34962),null!==t.instanceColor&&i.update(t.instanceColor,34962)),l}function a(){r=new WeakMap}function o(t){let e=t.target;e.removeEventListener("dispose",o),i.remove(e.instanceMatrix),null!==e.instanceColor&&i.remove(e.instanceColor)}return h(s,"update"),h(a,"dispose"),h(o,"onInstancedMeshDispose"),{update:s,dispose:a}}h(Xc,"PMREMGenerator"),h(S8,"_createPlanes"),h(uv,"_createRenderTarget"),h(Qd,"_setViewport"),h(A8,"_getBlurShader"),h(hv,"_getEquirectMaterial"),h(dv,"_getCubemapMaterial"),h(jg,"_getCommonVertexShader"),h(q8,"WebGLCubeUVMaps"),h(P8,"WebGLExtensions"),h(C8,"WebGLGeometries"),h(I8,"WebGLIndexedBufferRenderer"),h(L8,"WebGLInfo"),h(O8,"numericalSort"),h(R8,"absNumericalSort"),h(_g,"denormalize"),h(N8,"WebGLMorphtargets"),h(k8,"WebGLObjects");var dx=new ln,px=new Ca,fx=new sl,mx=new Ia,pv=[],fv=[],mv=new Float32Array(16),gv=new Float32Array(9),yv=new Float32Array(4);function Nl(t,e,i){let n=t[0];if(n<=0||n>0)return t;let r=e*i,s=pv[r];if(void 0===s&&(s=new Float32Array(r),pv[r]=s),0!==e){n.toArray(s,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(s,r)}return s}function ei(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}function Wn(t,e){for(let i=0,n=e.length;i<n;i++)t[i]=e[i]}function pf(t,e){let i=fv[e];void 0===i&&(i=new Int32Array(e),fv[e]=i);for(let n=0;n!==e;++n)i[n]=t.allocateTextureUnit();return i}function D8(t,e){let i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function B8(t,e){let i=this.cache;if(void 0!==e.x)(i[0]!==e.x||i[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(ei(i,e))return;t.uniform2fv(this.addr,e),Wn(i,e)}}function F8(t,e){let i=this.cache;if(void 0!==e.x)(i[0]!==e.x||i[1]!==e.y||i[2]!==e.z)&&(t.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(void 0!==e.r)(i[0]!==e.r||i[1]!==e.g||i[2]!==e.b)&&(t.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(ei(i,e))return;t.uniform3fv(this.addr,e),Wn(i,e)}}function z8(t,e){let i=this.cache;if(void 0!==e.x)(i[0]!==e.x||i[1]!==e.y||i[2]!==e.z||i[3]!==e.w)&&(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(ei(i,e))return;t.uniform4fv(this.addr,e),Wn(i,e)}}function U8(t,e){let i=this.cache,n=e.elements;if(void 0===n){if(ei(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),Wn(i,e)}else{if(ei(i,n))return;yv.set(n),t.uniformMatrix2fv(this.addr,!1,yv),Wn(i,n)}}function V8(t,e){let i=this.cache,n=e.elements;if(void 0===n){if(ei(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),Wn(i,e)}else{if(ei(i,n))return;gv.set(n),t.uniformMatrix3fv(this.addr,!1,gv),Wn(i,n)}}function H8(t,e){let i=this.cache,n=e.elements;if(void 0===n){if(ei(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),Wn(i,e)}else{if(ei(i,n))return;mv.set(n),t.uniformMatrix4fv(this.addr,!1,mv),Wn(i,n)}}function G8(t,e){let i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function j8(t,e){let i=this.cache;ei(i,e)||(t.uniform2iv(this.addr,e),Wn(i,e))}function W8(t,e){let i=this.cache;ei(i,e)||(t.uniform3iv(this.addr,e),Wn(i,e))}function X8(t,e){let i=this.cache;ei(i,e)||(t.uniform4iv(this.addr,e),Wn(i,e))}function Y8(t,e){let i=this.cache;i[0]!==e&&(t.uniform1ui(this.addr,e),i[0]=e)}function Z8(t,e){let i=this.cache;ei(i,e)||(t.uniform2uiv(this.addr,e),Wn(i,e))}function J8(t,e){let i=this.cache;ei(i,e)||(t.uniform3uiv(this.addr,e),Wn(i,e))}function $8(t,e){let i=this.cache;ei(i,e)||(t.uniform4uiv(this.addr,e),Wn(i,e))}function K8(t,e,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2D(e||dx,r)}function Q8(t,e,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(e||fx,r)}function e9(t,e,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTextureCube(e||mx,r)}function t9(t,e,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(e||px,r)}function n9(t){switch(t){case 5126:return D8;case 35664:return B8;case 35665:return F8;case 35666:return z8;case 35674:return U8;case 35675:return V8;case 35676:return H8;case 5124:case 35670:return G8;case 35667:case 35671:return j8;case 35668:case 35672:return W8;case 35669:case 35673:return X8;case 5125:return Y8;case 36294:return Z8;case 36295:return J8;case 36296:return $8;case 35678:case 36198:case 36298:case 36306:case 35682:return K8;case 35679:case 36299:case 36307:return Q8;case 35680:case 36300:case 36308:case 36293:return e9;case 36289:case 36303:case 36311:case 36292:return t9}}function i9(t,e){t.uniform1fv(this.addr,e)}function r9(t,e){let i=Nl(e,this.size,2);t.uniform2fv(this.addr,i)}function s9(t,e){let i=Nl(e,this.size,3);t.uniform3fv(this.addr,i)}function a9(t,e){let i=Nl(e,this.size,4);t.uniform4fv(this.addr,i)}function o9(t,e){let i=Nl(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,i)}function l9(t,e){let i=Nl(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,i)}function c9(t,e){let i=Nl(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,i)}function u9(t,e){t.uniform1iv(this.addr,e)}function h9(t,e){t.uniform2iv(this.addr,e)}function d9(t,e){t.uniform3iv(this.addr,e)}function p9(t,e){t.uniform4iv(this.addr,e)}function f9(t,e){t.uniform1uiv(this.addr,e)}function m9(t,e){t.uniform2uiv(this.addr,e)}function g9(t,e){t.uniform3uiv(this.addr,e)}function y9(t,e){t.uniform4uiv(this.addr,e)}function v9(t,e,i){let n=e.length,r=pf(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.setTexture2D(e[t]||dx,r[t])}function x9(t,e,i){let n=e.length,r=pf(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.setTexture3D(e[t]||fx,r[t])}function _9(t,e,i){let n=e.length,r=pf(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.setTextureCube(e[t]||mx,r[t])}function b9(t,e,i){let n=e.length,r=pf(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.setTexture2DArray(e[t]||px,r[t])}function M9(t){switch(t){case 5126:return i9;case 35664:return r9;case 35665:return s9;case 35666:return a9;case 35674:return o9;case 35675:return l9;case 35676:return c9;case 5124:case 35670:return u9;case 35667:case 35671:return h9;case 35668:case 35672:return d9;case 35669:case 35673:return p9;case 5125:return f9;case 36294:return m9;case 36295:return g9;case 36296:return y9;case 35678:case 36198:case 36298:case 36306:case 35682:return v9;case 35679:case 36299:case 36307:return x9;case 35680:case 36300:case 36308:case 36293:return _9;case 36289:case 36303:case 36311:case 36292:return b9}}function w9(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=n9(e.type)}function gx(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=M9(e.type)}function yx(t){this.id=t,this.seq=[],this.map={}}h(Nl,"flatten"),h(ei,"arraysEqual"),h(Wn,"copyArray"),h(pf,"allocTexUnits"),h(D8,"setValueV1f"),h(B8,"setValueV2f"),h(F8,"setValueV3f"),h(z8,"setValueV4f"),h(U8,"setValueM2"),h(V8,"setValueM3"),h(H8,"setValueM4"),h(G8,"setValueV1i"),h(j8,"setValueV2i"),h(W8,"setValueV3i"),h(X8,"setValueV4i"),h(Y8,"setValueV1ui"),h(Z8,"setValueV2ui"),h(J8,"setValueV3ui"),h($8,"setValueV4ui"),h(K8,"setValueT1"),h(Q8,"setValueT3D1"),h(e9,"setValueT6"),h(t9,"setValueT2DArray1"),h(n9,"getSingularSetter"),h(i9,"setValueV1fArray"),h(r9,"setValueV2fArray"),h(s9,"setValueV3fArray"),h(a9,"setValueV4fArray"),h(o9,"setValueM2Array"),h(l9,"setValueM3Array"),h(c9,"setValueM4Array"),h(u9,"setValueV1iArray"),h(h9,"setValueV2iArray"),h(d9,"setValueV3iArray"),h(p9,"setValueV4iArray"),h(f9,"setValueV1uiArray"),h(m9,"setValueV2uiArray"),h(g9,"setValueV3uiArray"),h(y9,"setValueV4uiArray"),h(v9,"setValueT1Array"),h(x9,"setValueT3DArray"),h(_9,"setValueT6Array"),h(b9,"setValueT2DArrayArray"),h(M9,"getPureArraySetter"),h(w9,"SingleUniform"),h(gx,"PureArrayUniform"),gx.prototype.updateCache=function(t){let e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Wn(e,t)},h(yx,"StructuredUniform"),yx.prototype.setValue=function(t,e,i){let n=this.seq;for(let r=0,s=n.length;r!==s;++r){let s=n[r];s.setValue(t,e[s.id],i)}};var bg=/(\w+)(\])?(\[|\.)?/g;function vv(t,e){t.seq.push(e),t.map[e.id]=e}function T9(t,e,i){let n=t.name,r=n.length;for(bg.lastIndex=0;;){let s=bg.exec(n),a=bg.lastIndex,o=s[1],l="]"===s[2],h=s[3];if(l&&(o|=0),void 0===h||"["===h&&a+2===r){vv(i,void 0===h?new w9(o,t,e):new gx(o,t,e));break}{let t=i.map[o];void 0===t&&(t=new yx(o),vv(i,t)),i=t}}}function Hs(t,e){this.seq=[],this.map={};let i=t.getProgramParameter(e,35718);for(let n=0;n<i;++n){let i=t.getActiveUniform(e,n);T9(i,t.getUniformLocation(e,i.name),this)}}function xv(t,e,i){let n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}h(vv,"addUniform"),h(T9,"parseUniform"),h(Hs,"WebGLUniforms"),Hs.prototype.setValue=function(t,e,i,n){let r=this.map[e];void 0!==r&&r.setValue(t,i,n)},Hs.prototype.setOptional=function(t,e,i){let n=e[i];void 0!==n&&this.setValue(t,i,n)},Hs.upload=function(t,e,i,n){for(let r=0,s=e.length;r!==s;++r){let s=e[r],a=i[s.id];!1!==a.needsUpdate&&s.setValue(t,a.value,n)}},Hs.seqWithValue=function(t,e){let i=[];for(let n=0,r=t.length;n!==r;++n){let r=t[n];r.id in e&&i.push(r)}return i},h(xv,"WebGLShader");var E9=0;function S9(t){let e=t.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}function A9(t){switch(t){case Ys:return["Linear","( value )"];case Gt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function _v(t,e,i){let n=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();return n&&""===r?"":i.toUpperCase()+"\n\n"+r+"\n\n"+S9(t.getShaderSource(e))}function q9(t,e){let i=A9(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function P9(t,e){let i;switch(e){case nw:i="Linear";break;case iw:i="Reinhard";break;case rw:i="OptimizedCineon";break;case sw:i="ACESFilmic";break;case aw:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),i="Linear"}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function C9(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"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(Vc).join("\n")}function I9(t){let e=[];for(let i in t){let n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}function L9(t,e){let i={},n=t.getProgramParameter(e,35721);for(let r=0;r<n;r++){let n=t.getActiveAttrib(e,r),s=n.name,a=1;35674===n.type&&(a=2),35675===n.type&&(a=3),35676===n.type&&(a=4),i[s]={type:n.type,location:t.getAttribLocation(e,s),locationSize:a}}return i}function Vc(t){return""!==t}function bv(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).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/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Mv(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}h(S9,"addLineNumbers"),h(A9,"getEncodingComponents"),h(_v,"getShaderErrors"),h(q9,"getTexelEncodingFunction"),h(P9,"getToneMappingFunction"),h(C9,"generateExtensions"),h(I9,"generateDefines"),h(L9,"fetchAttributeLocations"),h(Vc,"filterEmptyLine"),h(bv,"replaceLightNums"),h(Mv,"replaceClippingPlaneNums");var O9=/^[ \t]*#include +<([\w\d./]+)>/gm;function kg(t){return t.replace(O9,R9)}function R9(t,e){let i=xt[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return kg(i)}h(kg,"resolveIncludes"),h(R9,"includeReplacer");var N9=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,k9=/#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 wv(t){return t.replace(k9,vx).replace(N9,D9)}function D9(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),vx(t,e,i,n)}function vx(t,e,i,n){let r="";for(let t=parseInt(e);t<parseInt(i);t++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return r}function Tv(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";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 B9(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===tx?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===R6?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===Uc&&(e="SHADOWMAP_TYPE_VSM"),e}function F9(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case Cl:case Il:e="ENVMAP_TYPE_CUBE";break;case hf:case Vg:e="ENVMAP_TYPE_CUBE_UV"}return e}function z9(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case Il:case Vg:e="ENVMAP_MODE_REFRACTION"}return e}function U9(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case uf:e="ENVMAP_BLENDING_MULTIPLY";break;case ew:e="ENVMAP_BLENDING_MIX";break;case tw:e="ENVMAP_BLENDING_ADD"}return e}function V9(t){let e=t.envMapCubeUVHeight;if(null===e)return null;let i=Math.log2(e/32+1)+3,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:n,maxMip:i}}function H9(t,e,i,n){let r,s,a=t.getContext(),o=i.defines,l=i.vertexShader,h=i.fragmentShader,u=B9(i),c=F9(i),d=z9(i),p=U9(i),m=V9(i),f=i.isWebGL2?"":C9(i),g=I9(o),v=a.createProgram(),y=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(r=[g].filter(Vc).join("\n"),r.length>0&&(r+="\n"),s=[f,g].filter(Vc).join("\n"),s.length>0&&(s+="\n")):(r=[Tv(i),"#define SHADER_NAME "+i.shaderName,g,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+d:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.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","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#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(Vc).join("\n"),s=[f,Tv(i),"#define SHADER_NAME "+i.shaderName,g,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+d:"",i.envMap?"#define "+p:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+u:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==zs?"#define TONE_MAPPING":"",i.toneMapping!==zs?xt.tonemapping_pars_fragment:"",i.toneMapping!==zs?P9("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",xt.encodings_pars_fragment,q9("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Vc).join("\n")),l=kg(l),l=bv(l,i),l=Mv(l,i),h=kg(h),h=bv(h,i),h=Mv(h,i),l=wv(l),h=wv(h),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(y="#version 300 es\n",r=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,s=["#define varying in",i.glslVersion===Y3?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===Y3?"":"#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"+s);let _,x,b=y+s+h,w=xv(a,35633,y+r+l),M=xv(a,35632,b);if(a.attachShader(v,w),a.attachShader(v,M),void 0!==i.index0AttributeName?a.bindAttribLocation(v,0,i.index0AttributeName):!0===i.morphTargets&&a.bindAttribLocation(v,0,"position"),a.linkProgram(v),t.debug.checkShaderErrors){let t=a.getProgramInfoLog(v).trim(),e=a.getShaderInfoLog(w).trim(),i=a.getShaderInfoLog(M).trim(),n=!0,o=!0;if(!1===a.getProgramParameter(v,35714)){n=!1;let e=_v(a,w,"vertex"),i=_v(a,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(v,35715)+"\n\nProgram Info Log: "+t+"\n"+e+"\n"+i)}else""!==t?console.warn("THREE.WebGLProgram: Program Info Log:",t):(""===e||""===i)&&(o=!1);o&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:r},fragmentShader:{log:i,prefix:s}})}return a.deleteShader(w),a.deleteShader(M),this.getUniforms=function(){return void 0===_&&(_=new Hs(a,v)),_},this.getAttributes=function(){return void 0===x&&(x=L9(a,v)),x},this.destroy=function(){n.releaseStatesOfProgram(this),a.deleteProgram(v),this.program=void 0},this.name=i.shaderName,this.id=E9++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=w,this.fragmentShader=M,this}h(wv,"unrollLoops"),h(D9,"deprecatedLoopReplacer"),h(vx,"loopReplacer"),h(Tv,"generatePrecision"),h(B9,"generateShadowMapTypeDefine"),h(F9,"generateEnvMapTypeDefine"),h(z9,"generateEnvMapModeDefine"),h(U9,"generateEnvMapBlendingDefine"),h(V9,"generateCubeUVSize"),h(H9,"WebGLProgram");var G9=0,yp=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,i=t.fragmentShader,n=this._getShaderStage(e),r=this._getShaderStage(i),s=this._getShaderCacheForMaterial(t);return!1===s.has(n)&&(s.add(n),n.usedTimes++),!1===s.has(r)&&(s.add(r),r.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t);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){let e=this.materialCache;return!1===e.has(t)&&e.set(t,new Set),e.get(t)}_getShaderStage(t){let e=this.shaderCache;if(!1===e.has(t)){let i=new vp;e.set(t,i)}return e.get(t)}};h(yp,"WebGLShaderCache");var vp=class{constructor(){this.id=G9++,this.usedTimes=0}};function j9(t,e,i,n,r,s,a){let o=new al,l=new yp,u=[],c=r.isWebGL2,d=r.logarithmicDepthBuffer,p=r.floatVertexTextures,m=r.maxVertexUniforms,f=r.vertexTextures,g=r.precision,v={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 y(t){let e=t.skeleton.bones;if(p)return 1024;{let t=Math.floor((m-20)/4),i=Math.min(t,e.length);return i<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+i+"."),0):i}}function _(s,o,h,u,m){let _=u.fog,x=m.geometry,b=s.isMeshStandardMaterial?u.environment:null,w=(s.isMeshStandardMaterial?i:e).get(s.envMap||b),M=!w||w.mapping!==hf&&w.mapping!==Vg?null:w.image.height,E=v[s.type],T=m.isSkinnedMesh?y(m):0;null!==s.precision&&(g=r.getMaxPrecision(s.precision),g!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",g,"instead."));let S,q,P,A,C=x.morphAttributes.position||x.morphAttributes.normal||x.morphAttributes.color,L=void 0!==C?C.length:0,I=0;if(void 0!==x.morphAttributes.position&&(I=1),void 0!==x.morphAttributes.normal&&(I=2),void 0!==x.morphAttributes.color&&(I=3),E){let t=lr[E];S=t.vertexShader,q=t.fragmentShader}else S=s.vertexShader,q=s.fragmentShader,l.update(s),P=l.getVertexShaderID(s),A=l.getFragmentShaderID(s);let R=t.getRenderTarget(),N=s.alphaTest>0,O=s.clearcoat>0;return{isWebGL2:c,shaderID:E,shaderName:s.type,vertexShader:S,fragmentShader:q,defines:s.defines,customVertexShaderID:P,customFragmentShaderID:A,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:g,instancing:!0===m.isInstancedMesh,instancingColor:!0===m.isInstancedMesh&&null!==m.instanceColor,supportsVertexTextures:f,outputEncoding:null===R?t.outputEncoding:!0===R.isXRRenderTarget?R.texture.encoding:Ys,map:!!s.map,matcap:!!s.matcap,envMap:!!w,envMapMode:w&&w.mapping,envMapCubeUVHeight:M,lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:s.normalMapType===qw,tangentSpaceNormalMap:s.normalMapType===Rl,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&s.map.encoding===Gt,clearcoat:O,clearcoatMap:O&&!!s.clearcoatMap,clearcoatRoughnessMap:O&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:O&&!!s.clearcoatNormalMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,opaque:!1===s.transparent&&s.blending===tl,alphaMap:!!s.alphaMap,alphaTest:N,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!x.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,vertexUvs:!!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!_,useFog:s.fog,fogExp2:_&&_.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:d,skinning:!0===m.isSkinnedMesh&&T>0,maxBones:T,useVertexTexture:p,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:L,morphTextureStride:I,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:zs,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===pr,flipSided:s.side===yn,depthPacking:void 0!==s.depthPacking&&s.depthPacking,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:c||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||n.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}}function x(e){let i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.customVertexShaderID),i.push(e.customFragmentShaderID)),void 0!==e.defines)for(let t in e.defines)i.push(t),i.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(b(i,e),w(i,e),i.push(t.outputEncoding)),i.push(e.customProgramCacheKey),i.join()}function b(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.maxBones),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection)}function w(t,e){o.disableAll(),e.isWebGL2&&o.enable(0),e.supportsVertexTextures&&o.enable(1),e.instancing&&o.enable(2),e.instancingColor&&o.enable(3),e.map&&o.enable(4),e.matcap&&o.enable(5),e.envMap&&o.enable(6),e.lightMap&&o.enable(7),e.aoMap&&o.enable(8),e.emissiveMap&&o.enable(9),e.bumpMap&&o.enable(10),e.normalMap&&o.enable(11),e.objectSpaceNormalMap&&o.enable(12),e.tangentSpaceNormalMap&&o.enable(13),e.clearcoat&&o.enable(14),e.clearcoatMap&&o.enable(15),e.clearcoatRoughnessMap&&o.enable(16),e.clearcoatNormalMap&&o.enable(17),e.displacementMap&&o.enable(18),e.specularMap&&o.enable(19),e.roughnessMap&&o.enable(20),e.metalnessMap&&o.enable(21),e.gradientMap&&o.enable(22),e.alphaMap&&o.enable(23),e.alphaTest&&o.enable(24),e.vertexColors&&o.enable(25),e.vertexAlphas&&o.enable(26),e.vertexUvs&&o.enable(27),e.vertexTangents&&o.enable(28),e.uvsVertexOnly&&o.enable(29),e.fog&&o.enable(30),t.push(o.mask),o.disableAll(),e.useFog&&o.enable(0),e.flatShading&&o.enable(1),e.logarithmicDepthBuffer&&o.enable(2),e.skinning&&o.enable(3),e.useVertexTexture&&o.enable(4),e.morphTargets&&o.enable(5),e.morphNormals&&o.enable(6),e.morphColors&&o.enable(7),e.premultipliedAlpha&&o.enable(8),e.shadowMapEnabled&&o.enable(9),e.physicallyCorrectLights&&o.enable(10),e.doubleSided&&o.enable(11),e.flipSided&&o.enable(12),e.depthPacking&&o.enable(13),e.dithering&&o.enable(14),e.specularIntensityMap&&o.enable(15),e.specularColorMap&&o.enable(16),e.transmission&&o.enable(17),e.transmissionMap&&o.enable(18),e.thicknessMap&&o.enable(19),e.sheen&&o.enable(20),e.sheenColorMap&&o.enable(21),e.sheenRoughnessMap&&o.enable(22),e.decodeVideoTexture&&o.enable(23),e.opaque&&o.enable(24),t.push(o.mask)}function M(t){let e,i=v[t.type];if(i){let t=lr[i];e=Uw.clone(t.uniforms)}else e=t.uniforms;return e}function E(e,i){let n;for(let t=0,e=u.length;t<e;t++){let e=u[t];if(e.cacheKey===i){n=e,++n.usedTimes;break}}return void 0===n&&(n=new H9(t,i,e,s),u.push(n)),n}function T(t){if(0==--t.usedTimes){let e=u.indexOf(t);u[e]=u[u.length-1],u.pop(),t.destroy()}}function S(t){l.remove(t)}function q(){l.dispose()}return h(y,"getMaxBones"),h(_,"getParameters"),h(x,"getProgramCacheKey"),h(b,"getProgramCacheKeyParameters"),h(w,"getProgramCacheKeyBooleans"),h(M,"getUniforms"),h(E,"acquireProgram"),h(T,"releaseProgram"),h(S,"releaseShaderCache"),h(q,"dispose"),{getParameters:_,getProgramCacheKey:x,getUniforms:M,acquireProgram:E,releaseProgram:T,releaseShaderCache:S,programs:u,dispose:q}}function W9(){let t=new WeakMap;function e(e){let i=t.get(e);return void 0===i&&(i={},t.set(e,i)),i}function i(e){t.delete(e)}function n(e,i,n){t.get(e)[i]=n}function r(){t=new WeakMap}return h(e,"get"),h(i,"remove"),h(n,"update"),h(r,"dispose"),{get:e,remove:i,update:n,dispose:r}}function X9(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 Ev(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 Sv(){let t=[],e=0,i=[],n=[],r=[];function s(){e=0,i.length=0,n.length=0,r.length=0}function a(i,n,r,s,a,o){let l=t[e];return void 0===l?(l={id:i.id,object:i,geometry:n,material:r,groupOrder:s,renderOrder:i.renderOrder,z:a,group:o},t[e]=l):(l.id=i.id,l.object=i,l.geometry=n,l.material=r,l.groupOrder=s,l.renderOrder=i.renderOrder,l.z=a,l.group=o),e++,l}function o(t,e,s,o,l,h){let u=a(t,e,s,o,l,h);s.transmission>0?n.push(u):!0===s.transparent?r.push(u):i.push(u)}function l(t,e,s,o,l,h){let u=a(t,e,s,o,l,h);s.transmission>0?n.unshift(u):!0===s.transparent?r.unshift(u):i.unshift(u)}function u(t,e){i.length>1&&i.sort(t||X9),n.length>1&&n.sort(e||Ev),r.length>1&&r.sort(e||Ev)}function c(){for(let i=e,n=t.length;i<n;i++){let e=t[i];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}}return h(s,"init"),h(a,"getNextRenderItem"),h(o,"push"),h(l,"unshift"),h(u,"sort"),h(c,"finish"),{opaque:i,transmissive:n,transparent:r,init:s,push:o,unshift:l,finish:c,sort:u}}function Y9(){let t=new WeakMap;function e(e,i){let n;return!1===t.has(e)?(n=new Sv,t.set(e,[n])):i>=t.get(e).length?(n=new Sv,t.get(e).push(n)):n=t.get(e)[i],n}function i(){t=new WeakMap}return h(e,"get"),h(i,"dispose"),{get:e,dispose:i}}function Z9(){let t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new I,color:new Ee};break;case"SpotLight":i={position:new I,direction:new I,color:new Ee,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new I,color:new Ee,distance:0,decay:0};break;case"HemisphereLight":i={direction:new I,skyColor:new Ee,groundColor:new Ee};break;case"RectAreaLight":i={color:new Ee,position:new I,halfWidth:new I,halfHeight:new I}}return t[e.id]=i,i}}}function J9(){let t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}h(vp,"WebGLShaderStage"),h(j9,"WebGLPrograms"),h(W9,"WebGLProperties"),h(X9,"painterSortStable"),h(Ev,"reversePainterSortStable"),h(Sv,"WebGLRenderList"),h(Y9,"WebGLRenderLists"),h(Z9,"UniformsCache"),h(J9,"ShadowUniformsCache");var $9=0;function K9(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Q9(t,e){let i=new Z9,n=J9(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new I);let s=new I,a=new We,o=new We;function l(s,a){let o=0,l=0,h=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let u=0,c=0,d=0,p=0,m=0,f=0,g=0,v=0;s.sort(K9);let y=!0!==a?Math.PI:1;for(let t=0,e=s.length;t<e;t++){let e=s[t],a=e.color,_=e.intensity,x=e.distance,b=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)o+=a.r*_*y,l+=a.g*_*y,h+=a.b*_*y;else if(e.isLightProbe)for(let t=0;t<9;t++)r.probe[t].addScaledVector(e.sh.coefficients[t],_);else if(e.isDirectionalLight){let t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*y),e.castShadow){let t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,r.directionalShadow[u]=i,r.directionalShadowMap[u]=b,r.directionalShadowMatrix[u]=e.shadow.matrix,f++}r.directional[u]=t,u++}else if(e.isSpotLight){let t=i.get(e);if(t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(a).multiplyScalar(_*y),t.distance=x,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,e.castShadow){let t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,r.spotShadow[d]=i,r.spotShadowMap[d]=b,r.spotShadowMatrix[d]=e.shadow.matrix,v++}r.spot[d]=t,d++}else if(e.isRectAreaLight){let t=i.get(e);t.color.copy(a).multiplyScalar(_),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),r.rectArea[p]=t,p++}else if(e.isPointLight){let t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*y),t.distance=e.distance,t.decay=e.decay,e.castShadow){let t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,i.shadowCameraNear=t.camera.near,i.shadowCameraFar=t.camera.far,r.pointShadow[c]=i,r.pointShadowMap[c]=b,r.pointShadowMatrix[c]=e.shadow.matrix,g++}r.point[c]=t,c++}else if(e.isHemisphereLight){let t=i.get(e);t.skyColor.copy(e.color).multiplyScalar(_*y),t.groundColor.copy(e.groundColor).multiplyScalar(_*y),r.hemi[m]=t,m++}}p>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=Le.LTC_FLOAT_1,r.rectAreaLTC2=Le.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Le.LTC_HALF_1,r.rectAreaLTC2=Le.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=l,r.ambient[2]=h;let _=r.hash;(_.directionalLength!==u||_.pointLength!==c||_.spotLength!==d||_.rectAreaLength!==p||_.hemiLength!==m||_.numDirectionalShadows!==f||_.numPointShadows!==g||_.numSpotShadows!==v)&&(r.directional.length=u,r.spot.length=d,r.rectArea.length=p,r.point.length=c,r.hemi.length=m,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=g,r.spotShadowMatrix.length=v,_.directionalLength=u,_.pointLength=c,_.spotLength=d,_.rectAreaLength=p,_.hemiLength=m,_.numDirectionalShadows=f,_.numPointShadows=g,_.numSpotShadows=v,r.version=$9++)}function u(t,e){let i=0,n=0,l=0,h=0,u=0,c=e.matrixWorldInverse;for(let e=0,d=t.length;e<d;e++){let d=t[e];if(d.isDirectionalLight){let t=r.directional[i];t.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(s),t.direction.transformDirection(c),i++}else if(d.isSpotLight){let t=r.spot[l];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(c),t.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(s),t.direction.transformDirection(c),l++}else if(d.isRectAreaLight){let t=r.rectArea[h];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(c),o.identity(),a.copy(d.matrixWorld),a.premultiply(c),o.extractRotation(a),t.halfWidth.set(.5*d.width,0,0),t.halfHeight.set(0,.5*d.height,0),t.halfWidth.applyMatrix4(o),t.halfHeight.applyMatrix4(o),h++}else if(d.isPointLight){let t=r.point[n];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(c),n++}else if(d.isHemisphereLight){let t=r.hemi[u];t.direction.setFromMatrixPosition(d.matrixWorld),t.direction.transformDirection(c),t.direction.normalize(),u++}}}return h(l,"setup"),h(u,"setupView"),{setup:l,setupView:u,state:r}}function Av(t,e){let i=new Q9(t,e),n=[],r=[];function s(){n.length=0,r.length=0}function a(t){n.push(t)}function o(t){r.push(t)}function l(t){i.setup(n,t)}function u(t){i.setupView(n,t)}return h(s,"init"),h(a,"pushLight"),h(o,"pushShadow"),h(l,"setupLights"),h(u,"setupLightsView"),{init:s,state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:l,setupLightsView:u,pushLight:a,pushShadow:o}}function eE(t,e){let i=new WeakMap;function n(n,r=0){let s;return!1===i.has(n)?(s=new Av(t,e),i.set(n,[s])):r>=i.get(n).length?(s=new Av(t,e),i.get(n).push(s)):s=i.get(n)[r],s}function r(){i=new WeakMap}return h(n,"get"),h(r,"dispose"),{get:n,dispose:r}}h(K9,"shadowCastingLightsFirst"),h(Q9,"WebGLLights"),h(Av,"WebGLRenderState"),h(eE,"WebGLRenderStates");var cl=class extends nn{constructor(t){super(),this.type="MeshDepthMaterial",this.depthPacking=Sw,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!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}};h(cl,"MeshDepthMaterial"),cl.prototype.isMeshDepthMaterial=!0;var ul=class extends nn{constructor(t){super(),this.type="MeshDistanceMaterial",this.referencePosition=new I,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}};h(ul,"MeshDistanceMaterial"),ul.prototype.isMeshDistanceMaterial=!0;var tE="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",nE="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}";function xx(t,e,i){let n=new La,r=new de,s=new de,a=new Ct,o=new cl({depthPacking:Aw}),l=new ul,u={},c=i.maxTextureSize,d={0:yn,1:Xs,2:pr},p=new pn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new de},radius:{value:4}},vertexShader:tE,fragmentShader:nE}),m=p.clone();m.defines.HORIZONTAL_PASS=1;let f=new wt;f.setAttribute("position",new qt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new lt(f,p),v=this;function y(i,n){let r=e.update(g);p.defines.VSM_SAMPLES!==i.blurSamples&&(p.defines.VSM_SAMPLES=i.blurSamples,m.defines.VSM_SAMPLES=i.blurSamples,p.needsUpdate=!0,m.needsUpdate=!0),p.uniforms.shadow_pass.value=i.map.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,p,g,null),m.uniforms.shadow_pass.value=i.mapPass.texture,m.uniforms.resolution.value=i.mapSize,m.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,m,g,null)}function _(e,i,n,r,s,a){let h=null,c=!0===n.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(h=void 0!==c?c:!0===n.isPointLight?l:o,t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0){let t=h.uuid,e=i.uuid,n=u[t];void 0===n&&(n={},u[t]=n);let r=n[e];void 0===r&&(r=h.clone(),n[e]=r),h=r}return h.visible=i.visible,h.wireframe=i.wireframe,h.side=a===Uc?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:d[i.side],h.alphaMap=i.alphaMap,h.alphaTest=i.alphaTest,h.clipShadows=i.clipShadows,h.clippingPlanes=i.clippingPlanes,h.clipIntersection=i.clipIntersection,h.displacementMap=i.displacementMap,h.displacementScale=i.displacementScale,h.displacementBias=i.displacementBias,h.wireframeLinewidth=i.wireframeLinewidth,h.linewidth=i.linewidth,!0===n.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(n.matrixWorld),h.nearDistance=r,h.farDistance=s),h}function x(i,r,s,a,o){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&o===Uc)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);let n=e.update(i),r=i.material;if(Array.isArray(r)){let e=n.groups;for(let l=0,h=e.length;l<h;l++){let h=e[l],u=r[h.materialIndex];if(u&&u.visible){let e=_(i,u,a,s.near,s.far,o);t.renderBufferDirect(s,null,n,e,i,h)}}}else if(r.visible){let e=_(i,r,a,s.near,s.far,o);t.renderBufferDirect(s,null,n,e,i,null)}}let l=i.children;for(let t=0,e=l.length;t<e;t++)x(l[t],r,s,a,o)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=tx,this.render=function(e,i,o){if(!1===v.enabled||!1===v.autoUpdate&&!1===v.needsUpdate||0===e.length)return;let l=t.getRenderTarget(),h=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),d=t.state;d.setBlending(Fs),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let l=0,h=e.length;l<h;l++){let h=e[l],u=h.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",h,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;r.copy(u.mapSize);let p=u.getFrameExtents();if(r.multiply(p),s.copy(u.mapSize),(r.x>c||r.y>c)&&(r.x>c&&(s.x=Math.floor(c/p.x),r.x=s.x*p.x,u.mapSize.x=s.x),r.y>c&&(s.y=Math.floor(c/p.y),r.y=s.y*p.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&this.type===Uc){let t={minFilter:Vn,magFilter:Vn,format:Sn};u.map=new dn(r.x,r.y,t),u.map.texture.name=h.name+".shadowMap",u.mapPass=new dn(r.x,r.y,t),u.camera.updateProjectionMatrix()}if(null===u.map){let t={minFilter:Ut,magFilter:Ut,format:Sn};u.map=new dn(r.x,r.y,t),u.map.texture.name=h.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();let m=u.getViewportCount();for(let t=0;t<m;t++){let e=u.getViewport(t);a.set(s.x*e.x,s.y*e.y,s.x*e.z,s.y*e.w),d.viewport(a),u.updateMatrices(h,t),n=u.getFrustum(),x(i,o,u.camera,h,this.type)}!u.isPointLightShadow&&this.type===Uc&&y(u,o),u.needsUpdate=!1}v.needsUpdate=!1,t.setRenderTarget(l,h,u)},h(y,"VSMPass"),h(_,"getDepthMaterial"),h(x,"renderObject")}function iE(t,e,i){let n=i.isWebGL2;function r(){let e=!1,i=new Ct,n=null,r=new Ct(0,0,0,0);return{setMask:function(i){n!==i&&!e&&(t.colorMask(i,i,i,i),n=i)},setLocked:function(t){e=t},setClear:function(e,n,s,a,o){!0===o&&(e*=a,n*=a,s*=a),i.set(e,n,s,a),!1===r.equals(i)&&(t.clearColor(e,n,s,a),r.copy(i))},reset:function(){e=!1,n=null,r.set(-1,0,0,0)}}}function s(){let e=!1,i=null,n=null,r=null;return{setTest:function(t){t?H(2929):V(2929)},setMask:function(n){i!==n&&!e&&(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case X6:t.depthFunc(512);break;case Y6:t.depthFunc(519);break;case Z6:t.depthFunc(513);break;case Pg:t.depthFunc(515);break;case J6:t.depthFunc(514);break;case $6:t.depthFunc(518);break;case K6:t.depthFunc(516);break;case Q6:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);n=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,i=null,n=null,r=null}}}function a(){let e=!1,i=null,n=null,r=null,s=null,a=null,o=null,l=null,h=null;return{setTest:function(t){e||(t?H(2960):V(2960))},setMask:function(n){i!==n&&!e&&(t.stencilMask(n),i=n)},setFunc:function(e,i,a){(n!==e||r!==i||s!==a)&&(t.stencilFunc(e,i,a),n=e,r=i,s=a)},setOp:function(e,i,n){(a!==e||o!==i||l!==n)&&(t.stencilOp(e,i,n),a=e,o=i,l=n)},setLocked:function(t){e=t},setClear:function(e){h!==e&&(t.clearStencil(e),h=e)},reset:function(){e=!1,i=null,n=null,r=null,s=null,a=null,o=null,l=null,h=null}}}h(r,"ColorBuffer"),h(s,"DepthBuffer"),h(a,"StencilBuffer");let o=new r,l=new s,u=new a,c={},d={},p=new WeakMap,m=[],f=null,g=!1,v=null,y=null,_=null,x=null,b=null,w=null,M=null,E=!1,T=null,S=null,q=null,P=null,A=null,C=t.getParameter(35661),L=!1,I=0,R=t.getParameter(7938);-1!==R.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(R)[1]),L=I>=1):-1!==R.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(R)[1]),L=I>=2);let N=null,O={},D=t.getParameter(3088),B=t.getParameter(2978),k=(new Ct).fromArray(D),F=(new Ct).fromArray(B);function z(e,i,n){let r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;e<n;e++)t.texImage2D(i+e,0,6408,1,1,0,6408,5121,r);return s}h(z,"createTexture");let U={};function H(e){!0!==c[e]&&(t.enable(e),c[e]=!0)}function V(e){!1!==c[e]&&(t.disable(e),c[e]=!1)}function G(e,i){return d[e]!==i&&(t.bindFramebuffer(e,i),d[e]=i,n&&(36009===e&&(d[36160]=i),36160===e&&(d[36009]=i)),!0)}function W(n,r){let s=m,a=!1;if(n)if(s=p.get(r),void 0===s&&(s=[],p.set(r,s)),n.isWebGLMultipleRenderTargets){let t=n.texture;if(s.length!==t.length||36064!==s[0]){for(let e=0,i=t.length;e<i;e++)s[e]=36064+e;s.length=t.length,a=!0}}else 36064!==s[0]&&(s[0]=36064,a=!0);else 1029!==s[0]&&(s[0]=1029,a=!0);a&&(i.isWebGL2?t.drawBuffers(s):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(s))}function j(e){return f!==e&&(t.useProgram(e),f=e,!0)}U[3553]=z(3553,3553,1),U[34067]=z(34067,34069,6),o.setClear(0,0,0,1),l.setClear(1),u.setClear(0),H(2929),l.setFunc(Pg),Q(!1),K(_3),H(2884),Z(Fs),h(H,"enable"),h(V,"disable"),h(G,"bindFramebuffer"),h(W,"drawBuffers"),h(j,"useProgram");let X={[Jo]:32774,[k6]:32778,[D6]:32779};if(n)X[w3]=32775,X[T3]=32776;else{let t=e.get("EXT_blend_minmax");null!==t&&(X[w3]=t.MIN_EXT,X[T3]=t.MAX_EXT)}let Y={[B6]:0,[F6]:1,[z6]:768,[ix]:770,[W6]:776,[G6]:774,[V6]:772,[U6]:769,[rx]:771,[j6]:775,[H6]:773};function Z(e,i,n,r,s,a,o,l){if(e!==Fs){if(!1===g&&(H(3042),g=!0),e===N6)s=s||i,a=a||n,o=o||r,(i!==y||s!==b)&&(t.blendEquationSeparate(X[i],X[s]),y=i,b=s),(n!==_||r!==x||a!==w||o!==M)&&(t.blendFuncSeparate(Y[n],Y[r],Y[a],Y[o]),_=n,x=r,w=a,M=o),v=e,E=null;else if(e!==v||l!==E){if((y!==Jo||b!==Jo)&&(t.blendEquation(32774),y=Jo,b=Jo),l)switch(e){case tl:t.blendFuncSeparate(1,771,1,771);break;case b3:t.blendFunc(1,1);break;case M3:t.blendFuncSeparate(0,769,0,1);break;case rf:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case tl:t.blendFuncSeparate(770,771,1,771);break;case b3:t.blendFunc(770,1);break;case M3:t.blendFuncSeparate(0,769,0,1);break;case rf:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}_=null,x=null,w=null,M=null,v=e,E=l}}else!0===g&&(V(3042),g=!1)}function J(t,e){t.side===pr?V(2884):H(2884);let i=t.side===yn;e&&(i=!i),Q(i),t.blending===tl&&!1===t.transparent?Z(Fs):Z(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),l.setFunc(t.depthFunc),l.setTest(t.depthTest),l.setMask(t.depthWrite),o.setMask(t.colorWrite);let n=t.stencilWrite;u.setTest(n),n&&(u.setMask(t.stencilWriteMask),u.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),u.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),tt(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?H(32926):V(32926)}function Q(e){T!==e&&(e?t.frontFace(2304):t.frontFace(2305),T=e)}function K(e){e!==L6?(H(2884),e!==S&&(e===_3?t.cullFace(1029):e===O6?t.cullFace(1028):t.cullFace(1032))):V(2884),S=e}function $(e){e!==q&&(L&&t.lineWidth(e),q=e)}function tt(e,i,n){e?(H(32823),(P!==i||A!==n)&&(t.polygonOffset(i,n),P=i,A=n)):V(32823)}function et(t){t?H(3089):V(3089)}function it(e){void 0===e&&(e=33984+C-1),N!==e&&(t.activeTexture(e),N=e)}function nt(e,i){null===N&&it();let n=O[N];void 0===n&&(n={type:void 0,texture:void 0},O[N]=n),(n.type!==e||n.texture!==i)&&(t.bindTexture(e,i||U[e]),n.type=e,n.texture=i)}function rt(){let e=O[N];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)}function st(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function at(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function ot(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function lt(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function ht(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function ut(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function ct(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function dt(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function pt(e){!1===k.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),k.copy(e))}function mt(e){!1===F.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),F.copy(e))}function ft(){t.disable(3042),t.disable(2884),t.disable(2929),t.disable(32823),t.disable(3089),t.disable(2960),t.disable(32926),t.blendEquation(32774),t.blendFunc(1,0),t.blendFuncSeparate(1,0,1,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(513),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(519,0,4294967295),t.stencilOp(7680,7680,7680),t.clearStencil(0),t.cullFace(1029),t.frontFace(2305),t.polygonOffset(0,0),t.activeTexture(33984),t.bindFramebuffer(36160,null),!0===n&&(t.bindFramebuffer(36009,null),t.bindFramebuffer(36008,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),c={},N=null,O={},d={},p=new WeakMap,m=[],f=null,g=!1,v=null,y=null,_=null,x=null,b=null,w=null,M=null,E=!1,T=null,S=null,q=null,P=null,A=null,k.set(0,0,t.canvas.width,t.canvas.height),F.set(0,0,t.canvas.width,t.canvas.height),o.reset(),l.reset(),u.reset()}return h(Z,"setBlending"),h(J,"setMaterial"),h(Q,"setFlipSided"),h(K,"setCullFace"),h($,"setLineWidth"),h(tt,"setPolygonOffset"),h(et,"setScissorTest"),h(it,"activeTexture"),h(nt,"bindTexture"),h(rt,"unbindTexture"),h(st,"compressedTexImage2D"),h(at,"texSubImage2D"),h(ot,"texSubImage3D"),h(lt,"compressedTexSubImage2D"),h(ht,"texStorage2D"),h(ut,"texStorage3D"),h(ct,"texImage2D"),h(dt,"texImage3D"),h(pt,"scissor"),h(mt,"viewport"),h(ft,"reset"),{buffers:{color:o,depth:l,stencil:u},enable:H,disable:V,bindFramebuffer:G,drawBuffers:W,useProgram:j,setBlending:Z,setMaterial:J,setFlipSided:Q,setCullFace:K,setLineWidth:$,setPolygonOffset:tt,setScissorTest:et,activeTexture:it,bindTexture:nt,unbindTexture:rt,compressedTexImage2D:st,texImage2D:ct,texImage3D:dt,texStorage2D:ht,texStorage3D:ut,texSubImage2D:at,texSubImage3D:ot,compressedTexSubImage2D:lt,scissor:pt,viewport:mt,reset:ft}}function rE(t,e,i,n,r,s,a){let o,l=r.isWebGL2,u=r.maxTextures,c=r.maxCubemapSize,d=r.maxTextureSize,p=r.maxSamples,m=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,f=new WeakMap,g=new WeakMap,v=!1;try{v="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function y(t,e){return v?new OffscreenCanvas(t,e):_u("canvas")}function _(t,e,i,n){let r=1;if((t.width>n||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){let n=e?Ng:Math.floor,s=n(r*t.width),a=n(r*t.height);void 0===o&&(o=y(s,a));let l=i?y(s,a):o;return l.width=s,l.height=a,l.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+")."),l}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return Z3(t.width)&&Z3(t.height)}function b(t){return!l&&(t.wrapS!==ji||t.wrapT!==ji||t.minFilter!==Ut&&t.minFilter!==Vn)}function w(t,e){return t.generateMipmaps&&e&&t.minFilter!==Ut&&t.minFilter!==Vn}function M(e){t.generateMipmap(e)}function E(i,n,r,s,a=!1){if(!1===l)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let o=n;return 6403===n&&(5126===r&&(o=33326),5131===r&&(o=33325),5121===r&&(o=33321)),33319===n&&(5126===r&&(o=33328),5131===r&&(o=33327),5121===r&&(o=33323)),6408===n&&(5126===r&&(o=34836),5131===r&&(o=34842),5121===r&&(o=s===Gt&&!1===a?35907:32856),32819===r&&(o=32854),32820===r&&(o=32855)),(33325===o||33326===o||33327===o||33328===o||34842===o||34836===o)&&e.get("EXT_color_buffer_float"),o}function T(t,e,i){return!0===w(t,i)||t.isFramebufferTexture&&t.minFilter!==Ut&&t.minFilter!==Vn?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 S(t){return t===Ut||t===E3||t===S3?9728:9729}function q(t){let e=t.target;e.removeEventListener("dispose",q),A(e),e.isVideoTexture&&f.delete(e)}function P(t){let e=t.target;e.removeEventListener("dispose",P),L(e)}function A(t){let e=n.get(t);if(void 0===e.__webglInit)return;let i=t.source,r=g.get(i);if(r){let n=r[e.__cacheKey];n.usedTimes--,0===n.usedTimes&&C(t),0===Object.keys(r).length&&g.delete(i)}n.remove(t)}function C(e){let i=n.get(e);t.deleteTexture(i.__webglTexture);let r=e.source;delete g.get(r)[i.__cacheKey],a.memory.textures--}function L(e){let i=e.texture,r=n.get(e),s=n.get(i);if(void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),a.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(let e=0,r=i.length;e<r;e++){let r=n.get(i[e]);r.__webglTexture&&(t.deleteTexture(r.__webglTexture),a.memory.textures--),n.remove(i[e])}n.remove(i),n.remove(e)}h(y,"createCanvas"),h(_,"resizeImage"),h(x,"isPowerOfTwo$1"),h(b,"textureNeedsPowerOfTwo"),h(w,"textureNeedsGenerateMipmaps"),h(M,"generateMipmap"),h(E,"getInternalFormat"),h(T,"getMipLevels"),h(S,"filterFallback"),h(q,"onTextureDispose"),h(P,"onRenderTargetDispose"),h(A,"deallocateTexture"),h(C,"deleteTexture"),h(L,"deallocateRenderTarget");let I=0;function R(){I=0}function N(){let t=I;return t>=u&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+u),I+=1,t}function O(t){let e=[];return e.push(t.wrapS),e.push(t.wrapT),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.encoding),e.join()}function D(t,e){let r=n.get(t);if(t.isVideoTexture&&it(t),t.version>0&&r.__version!==t.version){let i=t.image;if(null===i)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==i.complete)return void G(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function B(t,e){let r=n.get(t);t.version>0&&r.__version!==t.version?G(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))}function k(t,e){let r=n.get(t);t.version>0&&r.__version!==t.version?G(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))}function F(t,e){let r=n.get(t);t.version>0&&r.__version!==t.version?W(r,t,e):(i.activeTexture(33984+e),i.bindTexture(34067,r.__webglTexture))}h(R,"resetTextureUnits"),h(N,"allocateTextureUnit"),h(O,"getTextureCacheKey"),h(D,"setTexture2D"),h(B,"setTexture2DArray"),h(k,"setTexture3D"),h(F,"setTextureCube");let z={[Ji]:10497,[ji]:33071,[Lg]:33648},U={[Ut]:9728,[E3]:9984,[S3]:9986,[Vn]:9729,[ow]:9985,[df]:9987};function H(i,s,a){if(a?(t.texParameteri(i,10242,z[s.wrapS]),t.texParameteri(i,10243,z[s.wrapT]),(32879===i||35866===i)&&t.texParameteri(i,32882,z[s.wrapR]),t.texParameteri(i,10240,U[s.magFilter]),t.texParameteri(i,10241,U[s.minFilter])):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),(32879===i||35866===i)&&t.texParameteri(i,32882,33071),(s.wrapS!==ji||s.wrapT!==ji)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(i,10240,S(s.magFilter)),t.texParameteri(i,10241,S(s.minFilter)),s.minFilter!==Ut&&s.minFilter!==Vn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===e.has("EXT_texture_filter_anisotropic")){let a=e.get("EXT_texture_filter_anisotropic");if(s.type===qa&&!1===e.has("OES_texture_float_linear")||!1===l&&s.type===nl&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function V(e,i){let n=!1;void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",q));let r=i.source,s=g.get(r);void 0===s&&(s={},g.set(r,s));let o=O(i);if(o!==e.__cacheKey){void 0===s[o]&&(s[o]={texture:t.createTexture(),usedTimes:0},a.memory.textures++,n=!0),s[o].usedTimes++;let r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&C(i)),e.__cacheKey=o,e.__webglTexture=s[o].texture}return n}function G(e,n,r){let a=3553;n.isDataArrayTexture&&(a=35866),n.isData3DTexture&&(a=32879);let o=V(e,n),h=n.source;if(i.activeTexture(33984+r),i.bindTexture(a,e.__webglTexture),h.version!==h.__currentVersion||!0===o){t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);let r=b(n)&&!1===x(n.image),o=_(n.image,r,!1,d);o=nt(n,o);let u=x(o)||l,c=s.convert(n.format,n.encoding),p=s.convert(n.type),m=E(n.internalFormat,c,p,n.encoding,n.isVideoTexture);H(a,n,u);let f,g=n.mipmaps,v=l&&!0!==n.isVideoTexture,y=void 0===e.__version,S=T(n,o,u);if(n.isDepthTexture)m=6402,l?m=n.type===qa?36012:n.type===Us?33190:n.type===il?35056:33189:n.type===qa&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===Pa&&6402===m&&n.type!==vu&&n.type!==Us&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=vu,p=s.convert(n.type)),n.format===fr&&6402===m&&(m=34041,n.type!==il&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=il,p=s.convert(n.type))),v&&y?i.texStorage2D(3553,1,m,o.width,o.height):i.texImage2D(3553,0,m,o.width,o.height,0,c,p,null);else if(n.isDataTexture)if(g.length>0&&u){v&&y&&i.texStorage2D(3553,S,m,g[0].width,g[0].height);for(let t=0,e=g.length;t<e;t++)f=g[t],v?i.texSubImage2D(3553,t,0,0,f.width,f.height,c,p,f.data):i.texImage2D(3553,t,m,f.width,f.height,0,c,p,f.data);n.generateMipmaps=!1}else v?(y&&i.texStorage2D(3553,S,m,o.width,o.height),i.texSubImage2D(3553,0,0,0,o.width,o.height,c,p,o.data)):i.texImage2D(3553,0,m,o.width,o.height,0,c,p,o.data);else if(n.isCompressedTexture){v&&y&&i.texStorage2D(3553,S,m,g[0].width,g[0].height);for(let t=0,e=g.length;t<e;t++)f=g[t],n.format!==Sn?null!==c?v?i.compressedTexSubImage2D(3553,t,0,0,f.width,f.height,c,f.data):i.compressedTexImage2D(3553,t,m,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):v?i.texSubImage2D(3553,t,0,0,f.width,f.height,c,p,f.data):i.texImage2D(3553,t,m,f.width,f.height,0,c,p,f.data)}else if(n.isDataArrayTexture)v?(y&&i.texStorage3D(35866,S,m,o.width,o.height,o.depth),i.texSubImage3D(35866,0,0,0,0,o.width,o.height,o.depth,c,p,o.data)):i.texImage3D(35866,0,m,o.width,o.height,o.depth,0,c,p,o.data);else if(n.isData3DTexture)v?(y&&i.texStorage3D(32879,S,m,o.width,o.height,o.depth),i.texSubImage3D(32879,0,0,0,0,o.width,o.height,o.depth,c,p,o.data)):i.texImage3D(32879,0,m,o.width,o.height,o.depth,0,c,p,o.data);else if(n.isFramebufferTexture)v&&y?i.texStorage2D(3553,S,m,o.width,o.height):i.texImage2D(3553,0,m,o.width,o.height,0,c,p,null);else if(g.length>0&&u){v&&y&&i.texStorage2D(3553,S,m,g[0].width,g[0].height);for(let t=0,e=g.length;t<e;t++)f=g[t],v?i.texSubImage2D(3553,t,0,0,c,p,f):i.texImage2D(3553,t,m,c,p,f);n.generateMipmaps=!1}else v?(y&&i.texStorage2D(3553,S,m,o.width,o.height),i.texSubImage2D(3553,0,0,0,c,p,o)):i.texImage2D(3553,0,m,c,p,o);w(n,u)&&M(a),h.__currentVersion=h.version,n.onUpdate&&n.onUpdate(n)}e.__version=n.version}function W(e,n,r){if(6!==n.image.length)return;let a=V(e,n),o=n.source;if(i.activeTexture(33984+r),i.bindTexture(34067,e.__webglTexture),o.version!==o.__currentVersion||!0===a){t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);let r=n.isCompressedTexture||n.image[0].isCompressedTexture,a=n.image[0]&&n.image[0].isDataTexture,h=[];for(let t=0;t<6;t++)h[t]=r||a?a?n.image[t].image:n.image[t]:_(n.image[t],!1,!0,c),h[t]=nt(n,h[t]);let u,d=h[0],p=x(d)||l,m=s.convert(n.format,n.encoding),f=s.convert(n.type),g=E(n.internalFormat,m,f,n.encoding),v=l&&!0!==n.isVideoTexture,y=void 0===e.__version,b=T(n,d,p);if(H(34067,n,p),r){v&&y&&i.texStorage2D(34067,b,g,d.width,d.height);for(let t=0;t<6;t++){u=h[t].mipmaps;for(let e=0;e<u.length;e++){let r=u[e];n.format!==Sn?null!==m?v?i.compressedTexSubImage2D(34069+t,e,0,0,r.width,r.height,m,r.data):i.compressedTexImage2D(34069+t,e,g,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):v?i.texSubImage2D(34069+t,e,0,0,r.width,r.height,m,f,r.data):i.texImage2D(34069+t,e,g,r.width,r.height,0,m,f,r.data)}}}else{u=n.mipmaps,v&&y&&(u.length>0&&b++,i.texStorage2D(34067,b,g,h[0].width,h[0].height));for(let t=0;t<6;t++)if(a){v?i.texSubImage2D(34069+t,0,0,0,h[t].width,h[t].height,m,f,h[t].data):i.texImage2D(34069+t,0,g,h[t].width,h[t].height,0,m,f,h[t].data);for(let e=0;e<u.length;e++){let n=u[e].image[t].image;v?i.texSubImage2D(34069+t,e+1,0,0,n.width,n.height,m,f,n.data):i.texImage2D(34069+t,e+1,g,n.width,n.height,0,m,f,n.data)}}else{v?i.texSubImage2D(34069+t,0,0,0,m,f,h[t]):i.texImage2D(34069+t,0,g,m,f,h[t]);for(let e=0;e<u.length;e++){let n=u[e];v?i.texSubImage2D(34069+t,e+1,0,0,m,f,n.image[t]):i.texImage2D(34069+t,e+1,g,m,f,n.image[t])}}}w(n,p)&&M(34067),o.__currentVersion=o.version,n.onUpdate&&n.onUpdate(n)}e.__version=n.version}function j(e,r,a,o,l){let h=s.convert(a.format,a.encoding),u=s.convert(a.type),c=E(a.internalFormat,h,u,a.encoding);n.get(r).__hasExternalTextures||(32879===l||35866===l?i.texImage3D(l,0,c,r.width,r.height,r.depth,0,h,u,null):i.texImage2D(l,0,c,r.width,r.height,0,h,u,null)),i.bindFramebuffer(36160,e),et(r)?m.framebufferTexture2DMultisampleEXT(36160,o,l,n.get(a).__webglTexture,0,tt(r)):t.framebufferTexture2D(36160,o,l,n.get(a).__webglTexture,0),i.bindFramebuffer(36160,null)}function X(e,i,n){if(t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n||et(i)){let e=i.depthTexture;e&&e.isDepthTexture&&(e.type===qa?r=36012:e.type===Us&&(r=33190));let n=tt(i);et(i)?m.renderbufferStorageMultisampleEXT(36161,n,r,i.width,i.height):t.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else t.renderbufferStorage(36161,r,i.width,i.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(i.depthBuffer&&i.stencilBuffer){let r=tt(i);n&&!1===et(i)?t.renderbufferStorageMultisample(36161,r,35056,i.width,i.height):et(i)?m.renderbufferStorageMultisampleEXT(36161,r,35056,i.width,i.height):t.renderbufferStorage(36161,34041,i.width,i.height),t.framebufferRenderbuffer(36160,33306,36161,e)}else{let e=!0===i.isWebGLMultipleRenderTargets?i.texture[0]:i.texture,r=s.convert(e.format,e.encoding),a=s.convert(e.type),o=E(e.internalFormat,r,a,e.encoding),l=tt(i);n&&!1===et(i)?t.renderbufferStorageMultisample(36161,l,o,i.width,i.height):et(i)?m.renderbufferStorageMultisampleEXT(36161,l,o,i.width,i.height):t.renderbufferStorage(36161,o,i.width,i.height)}t.bindRenderbuffer(36161,null)}function Y(e,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(36160,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.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),D(r.depthTexture,0);let s=n.get(r.depthTexture).__webglTexture,a=tt(r);if(r.depthTexture.format===Pa)et(r)?m.framebufferTexture2DMultisampleEXT(36160,36096,3553,s,0,a):t.framebufferTexture2D(36160,36096,3553,s,0);else{if(r.depthTexture.format!==fr)throw new Error("Unknown depthTexture format");et(r)?m.framebufferTexture2DMultisampleEXT(36160,33306,3553,s,0,a):t.framebufferTexture2D(36160,33306,3553,s,0)}}function Z(e){let r=n.get(e),s=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");Y(r.__webglFramebuffer,e)}else if(s){r.__webglDepthbuffer=[];for(let n=0;n<6;n++)i.bindFramebuffer(36160,r.__webglFramebuffer[n]),r.__webglDepthbuffer[n]=t.createRenderbuffer(),X(r.__webglDepthbuffer[n],e,!1)}else i.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),X(r.__webglDepthbuffer,e,!1);i.bindFramebuffer(36160,null)}function J(t,e,i){let r=n.get(t);void 0!==e&&j(r.__webglFramebuffer,t,t.texture,36064,3553),void 0!==i&&Z(t)}function Q(e){let o=e.texture,h=n.get(e),u=n.get(o);e.addEventListener("dispose",P),!0!==e.isWebGLMultipleRenderTargets&&(void 0===u.__webglTexture&&(u.__webglTexture=t.createTexture()),u.__version=o.version,a.memory.textures++);let c=!0===e.isWebGLCubeRenderTarget,d=!0===e.isWebGLMultipleRenderTargets,p=x(e)||l;if(c){h.__webglFramebuffer=[];for(let e=0;e<6;e++)h.__webglFramebuffer[e]=t.createFramebuffer()}else if(h.__webglFramebuffer=t.createFramebuffer(),d)if(r.drawBuffers){let i=e.texture;for(let e=0,r=i.length;e<r;e++){let r=n.get(i[e]);void 0===r.__webglTexture&&(r.__webglTexture=t.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(l&&e.samples>0&&!1===et(e)){h.__webglMultisampledFramebuffer=t.createFramebuffer(),h.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,h.__webglColorRenderbuffer);let n=s.convert(o.format,o.encoding),r=s.convert(o.type),a=E(o.internalFormat,n,r,o.encoding),l=tt(e);t.renderbufferStorageMultisample(36161,l,a,e.width,e.height),i.bindFramebuffer(36160,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,h.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(h.__webglDepthRenderbuffer=t.createRenderbuffer(),X(h.__webglDepthRenderbuffer,e,!0)),i.bindFramebuffer(36160,null)}if(c){i.bindTexture(34067,u.__webglTexture),H(34067,o,p);for(let t=0;t<6;t++)j(h.__webglFramebuffer[t],e,o,36064,34069+t);w(o,p)&&M(34067),i.unbindTexture()}else if(d){let t=e.texture;for(let r=0,s=t.length;r<s;r++){let s=t[r],a=n.get(s);i.bindTexture(3553,a.__webglTexture),H(3553,s,p),j(h.__webglFramebuffer,e,s,36064+r,3553),w(s,p)&&M(3553)}i.unbindTexture()}else{let t=3553;(e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(l?t=e.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),i.bindTexture(t,u.__webglTexture),H(t,o,p),j(h.__webglFramebuffer,e,o,36064,t),w(o,p)&&M(t),i.unbindTexture()}e.depthBuffer&&Z(e)}function K(t){let e=x(t)||l,r=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let s=0,a=r.length;s<a;s++){let a=r[s];if(w(a,e)){let e=t.isWebGLCubeRenderTarget?34067:3553,r=n.get(a).__webglTexture;i.bindTexture(e,r),M(e),i.unbindTexture()}}}function $(e){if(l&&e.samples>0&&!1===et(e)){let r=e.width,s=e.height,a=16384,o=[36064],l=e.stencilBuffer?33306:36096;e.depthBuffer&&o.push(l);let h=n.get(e),u=void 0===h.__ignoreDepthValues||h.__ignoreDepthValues;!1===u&&(e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024)),i.bindFramebuffer(36008,h.__webglMultisampledFramebuffer),i.bindFramebuffer(36009,h.__webglFramebuffer),!0===u&&(t.invalidateFramebuffer(36008,[l]),t.invalidateFramebuffer(36009,[l])),t.blitFramebuffer(0,0,r,s,0,0,r,s,a,9728),t.invalidateFramebuffer(36008,o),i.bindFramebuffer(36008,null),i.bindFramebuffer(36009,h.__webglMultisampledFramebuffer)}}function tt(t){return Math.min(p,t.samples)}function et(t){let i=n.get(t);return l&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function it(t){let e=a.render.frame;f.get(t)!==e&&(f.set(t,e),t.update())}function nt(t,i){let n=t.encoding,r=t.format,s=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===Og||n!==Ys&&(n===Gt?!1===l?!0===e.has("EXT_sRGB")&&r===Sn?(t.format=Og,t.minFilter=Vn,t.generateMipmaps=!1):i=ur.sRGBToLinear(i):(r!==Sn||s!==Ga)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",n)),i}h(H,"setTextureParameters"),h(V,"initTexture"),h(G,"uploadTexture"),h(W,"uploadCubeTexture"),h(j,"setupFrameBufferTexture"),h(X,"setupRenderBufferStorage"),h(Y,"setupDepthTexture"),h(Z,"setupDepthRenderbuffer"),h(J,"rebindTextures"),h(Q,"setupRenderTarget"),h(K,"updateRenderTargetMipmap"),h($,"updateMultisampleRenderTarget"),h(tt,"getRenderTargetSamples"),h(et,"useMultisampledRTT"),h(it,"updateVideoTexture"),h(nt,"verifyColorSpace"),this.allocateTextureUnit=N,this.resetTextureUnits=R,this.setTexture2D=D,this.setTexture2DArray=B,this.setTexture3D=k,this.setTextureCube=F,this.rebindTextures=J,this.setupRenderTarget=Q,this.updateRenderTargetMipmap=K,this.updateMultisampleRenderTarget=$,this.setupDepthRenderbuffer=Z,this.setupFrameBufferTexture=j,this.useMultisampledRTT=et}function sE(t,e,i){let n=i.isWebGL2;function r(t,i=null){let r;if(t===Ga)return 5121;if(t===hw)return 32819;if(t===dw)return 32820;if(t===lw)return 5120;if(t===cw)return 5122;if(t===vu)return 5123;if(t===uw)return 5124;if(t===Us)return 5125;if(t===qa)return 5126;if(t===nl)return n?5131:(r=e.get("OES_texture_half_float"),null!==r?r.HALF_FLOAT_OES:null);if(t===pw)return 6406;if(t===Sn)return 6408;if(t===mw)return 6409;if(t===gw)return 6410;if(t===Pa)return 6402;if(t===fr)return 34041;if(t===yw)return 6403;if(t===fw)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(t===Og)return r=e.get("EXT_sRGB"),null!==r?r.SRGB_ALPHA_EXT:null;if(t===vw)return 36244;if(t===xw)return 33319;if(t===_w)return 33320;if(t===bw)return 36249;if(t===G1||t===j1||t===W1||t===X1)if(i===Gt){if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===r)return null;if(t===G1)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(t===j1)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(t===W1)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(t===X1)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(r=e.get("WEBGL_compressed_texture_s3tc"),null===r)return null;if(t===G1)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===j1)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===W1)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===X1)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===A3||t===q3||t===P3||t===C3){if(r=e.get("WEBGL_compressed_texture_pvrtc"),null===r)return null;if(t===A3)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===q3)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===P3)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===C3)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===Mw)return r=e.get("WEBGL_compressed_texture_etc1"),null!==r?r.COMPRESSED_RGB_ETC1_WEBGL:null;if(t===I3||t===L3){if(r=e.get("WEBGL_compressed_texture_etc"),null===r)return null;if(t===I3)return i===Gt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(t===L3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(t===O3||t===R3||t===N3||t===k3||t===D3||t===B3||t===F3||t===z3||t===U3||t===V3||t===H3||t===G3||t===j3||t===W3){if(r=e.get("WEBGL_compressed_texture_astc"),null===r)return null;if(t===O3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(t===R3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(t===N3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(t===k3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(t===D3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(t===B3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(t===F3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(t===z3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(t===U3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(t===V3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(t===H3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(t===G3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(t===j3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(t===W3)return i===Gt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(t===X3){if(r=e.get("EXT_texture_compression_bptc"),null===r)return null;if(t===X3)return i===Gt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT}return t===il?n?34042:(r=e.get("WEBGL_depth_texture"),null!==r?r.UNSIGNED_INT_24_8_WEBGL:null):void 0}return h(r,"convert"),{convert:r}}h(xx,"WebGLShadowMap"),h(iE,"WebGLState"),h(rE,"WebGLTextures"),h(sE,"WebGLUtils");var Yc=class extends vn{constructor(t=[]){super(),this.cameras=t}};h(Yc,"ArrayCamera"),Yc.prototype.isArrayCamera=!0;var cr=class extends rt{constructor(){super(),this.type="Group"}};h(cr,"Group"),cr.prototype.isGroup=!0;var aE={type:"move"},hl=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new cr,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 cr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new I,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new I),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new cr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new I,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new I),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}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,i){let n=null,r=null,s=null,a=this._targetRay,o=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(null!==a&&(n=e.getPose(t.targetRaySpace,i),null!==n&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(aE))),l&&t.hand){s=!0;for(let n of t.hand.values()){let t=e.getJointPose(n,i);if(void 0===l.joints[n.jointName]){let t=new cr;t.matrixAutoUpdate=!1,t.visible=!1,l.joints[n.jointName]=t,l.add(t)}let r=l.joints[n.jointName];null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=t.radius),r.visible=null!==t}let n=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],a=n.position.distanceTo(r.position),o=.02,h=.005;l.inputState.pinching&&a>o+h?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-h&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),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));return null!==a&&(a.visible=null!==n),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}};h(hl,"WebXRController");var Zr=class extends ln{constructor(t,e,i,n,r,s,a,o,l,h){if((h=void 0!==h?h:Pa)!==Pa&&h!==fr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&h===Pa&&(i=vu),void 0===i&&h===fr&&(i=il),super(null,n,r,s,a,o,h,i,l),this.image={width:t,height:e},this.magFilter=void 0!==a?a:Ut,this.minFilter=void 0!==o?o:Ut,this.flipY=!1,this.generateMipmaps=!1}};h(Zr,"DepthTexture"),Zr.prototype.isDepthTexture=!0;var xp=class extends Ei{constructor(t,e){super();let i=this,n=null,r=1,s=null,a="local-floor",o=null,l=null,u=null,c=null,d=null,p=e.getContextAttributes(),m=null,f=null,g=[],v=new Map,y=new vn;y.layers.enable(1),y.viewport=new Ct;let _=new vn;_.layers.enable(2),_.viewport=new Ct;let x=[y,_],b=new Yc;b.layers.enable(1),b.layers.enable(2);let w=null,M=null;function E(t){let e=v.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function T(){v.forEach((function(t,e){t.disconnect(e)})),v.clear(),w=null,M=null,t.setRenderTarget(m),c=null,u=null,l=null,n=null,f=null,N.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function S(t){let e=n.inputSources;for(let t=0;t<g.length;t++)v.set(e[t],g[t]);for(let e=0;e<t.removed.length;e++){let i=t.removed[e],n=v.get(i);n&&(n.dispatchEvent({type:"disconnected",data:i}),v.delete(i))}for(let e=0;e<t.added.length;e++){let i=t.added[e],n=v.get(i);n&&n.dispatchEvent({type:"connected",data:i})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=g[t];return void 0===e&&(e=new hl,g[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=g[t];return void 0===e&&(e=new hl,g[t]=e),e.getGripSpace()},this.getHand=function(t){let e=g[t];return void 0===e&&(e=new hl,g[t]=e),e.getHandSpace()},h(E,"onSessionEvent"),h(T,"onSessionEnd"),this.setFramebufferScaleFactor=function(t){r=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s},this.getBaseLayer=function(){return null!==u?u:c},this.getBinding=function(){return l},this.getFrame=function(){return d},this.getSession=function(){return n},this.setSession=function(o){return Ge(this,null,(function*(){if(n=o,null!==n){if(m=t.getRenderTarget(),n.addEventListener("select",E),n.addEventListener("selectstart",E),n.addEventListener("selectend",E),n.addEventListener("squeeze",E),n.addEventListener("squeezestart",E),n.addEventListener("squeezeend",E),n.addEventListener("end",T),n.addEventListener("inputsourceschange",S),!0!==p.xrCompatible&&(yield e.makeXRCompatible()),void 0===n.renderState.layers||!1===t.capabilities.isWebGL2){let i={antialias:void 0!==n.renderState.layers||p.antialias,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:r};c=new XRWebGLLayer(n,e,i),n.updateRenderState({baseLayer:c}),f=new dn(c.framebufferWidth,c.framebufferHeight,{format:Sn,type:Ga,encoding:t.outputEncoding})}else{let i=null,s=null,a=null;p.depth&&(a=p.stencil?35056:33190,i=p.stencil?fr:Pa,s=p.stencil?il:vu);let o={colorFormat:t.outputEncoding===Gt?35907:32856,depthFormat:a,scaleFactor:r};l=new XRWebGLBinding(n,e),u=l.createProjectionLayer(o),n.updateRenderState({layers:[u]}),f=new dn(u.textureWidth,u.textureHeight,{format:Sn,type:Ga,depthTexture:new Zr(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:p.stencil,encoding:t.outputEncoding,samples:p.antialias?4:0}),t.properties.get(f).__ignoreDepthValues=u.ignoreDepthValues}f.isXRRenderTarget=!0,this.setFoveation(1),s=yield n.requestReferenceSpace(a),N.setContext(n),N.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}}))},h(S,"onInputSourcesChange");let q=new I,P=new I;function A(t,e,i){q.setFromMatrixPosition(e.matrixWorld),P.setFromMatrixPosition(i.matrixWorld);let n=q.distanceTo(P),r=e.projectionMatrix.elements,s=i.projectionMatrix.elements,a=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],h=(r[9]-1)/r[5],u=(r[8]-1)/r[0],c=(s[8]+1)/s[0],d=a*u,p=a*c,m=n/(-u+c),f=m*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(f),t.translateZ(m),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();let g=a+m,v=o+m,y=d-f,_=p+(n-f),x=l*o/v*g,b=h*o/v*g;t.projectionMatrix.makePerspective(y,_,x,b,g,v)}function C(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}h(A,"setProjectionFromUnion"),h(C,"updateCamera"),this.updateCamera=function(t){if(null===n)return;b.near=_.near=y.near=t.near,b.far=_.far=y.far=t.far,(w!==b.near||M!==b.far)&&(n.updateRenderState({depthNear:b.near,depthFar:b.far}),w=b.near,M=b.far);let e=t.parent,i=b.cameras;C(b,e);for(let t=0;t<i.length;t++)C(i[t],e);b.matrixWorld.decompose(b.position,b.quaternion,b.scale),t.position.copy(b.position),t.quaternion.copy(b.quaternion),t.scale.copy(b.scale),t.matrix.copy(b.matrix),t.matrixWorld.copy(b.matrixWorld);let r=t.children;for(let t=0,e=r.length;t<e;t++)r[t].updateMatrixWorld(!0);2===i.length?A(b,y,_):b.projectionMatrix.copy(y.projectionMatrix)},this.getCamera=function(){return b},this.getFoveation=function(){return null!==u?u.fixedFoveation:null!==c?c.fixedFoveation:void 0},this.setFoveation=function(t){null!==u&&(u.fixedFoveation=t),null!==c&&void 0!==c.fixedFoveation&&(c.fixedFoveation=t)};let L=null;function R(e,i){if(o=i.getViewerPose(s),d=i,null!==o){let e=o.views;null!==c&&(t.setRenderTargetFramebuffer(f,c.framebuffer),t.setRenderTarget(f));let i=!1;e.length!==b.cameras.length&&(b.cameras.length=0,i=!0);for(let n=0;n<e.length;n++){let r=e[n],s=null;if(null!==c)s=c.getViewport(r);else{let e=l.getViewSubImage(u,r);s=e.viewport,0===n&&(t.setRenderTargetTextures(f,e.colorTexture,u.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(f))}let a=x[n];a.matrix.fromArray(r.transform.matrix),a.projectionMatrix.fromArray(r.projectionMatrix),a.viewport.set(s.x,s.y,s.width,s.height),0===n&&b.matrix.copy(a.matrix),!0===i&&b.cameras.push(a)}}let r=n.inputSources;for(let t=0;t<g.length;t++){let e=g[t],n=r[t];e.update(n,i,s)}L&&L(e,i),d=null}h(R,"onAnimationFrame");let N=new hx;N.setAnimationLoop(R),this.setAnimationLoop=function(t){L=t},this.dispose=function(){}}};function oE(t){function e(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function i(t,e,i,h,y){e.isMeshBasicMaterial?n(t,e):e.isMeshLambertMaterial?(n(t,e),l(t,e)):e.isMeshToonMaterial?(n(t,e),c(t,e)):e.isMeshPhongMaterial?(n(t,e),u(t,e)):e.isMeshStandardMaterial?(n(t,e),e.isMeshPhysicalMaterial?p(t,e,y):d(t,e)):e.isMeshMatcapMaterial?(n(t,e),m(t,e)):e.isMeshDepthMaterial?(n(t,e),f(t,e)):e.isMeshDistanceMaterial?(n(t,e),g(t,e)):e.isMeshNormalMaterial?(n(t,e),v(t,e)):e.isLineBasicMaterial?(r(t,e),e.isLineDashedMaterial&&s(t,e)):e.isPointsMaterial?a(t,e,i,h):e.isSpriteMaterial?o(t,e):e.isShadowMaterial?(t.color.value.copy(e.color),t.opacity.value=e.opacity):e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)}function n(e,i){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map),i.alphaMap&&(e.alphaMap.value=i.alphaMap),i.specularMap&&(e.specularMap.value=i.specularMap),i.alphaTest>0&&(e.alphaTest.value=i.alphaTest);let n,r,s=t.get(i).envMap;s&&(e.envMap.value=s,e.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity),i.map?n=i.map:i.specularMap?n=i.specularMap:i.displacementMap?n=i.displacementMap:i.normalMap?n=i.normalMap:i.bumpMap?n=i.bumpMap:i.roughnessMap?n=i.roughnessMap:i.metalnessMap?n=i.metalnessMap:i.alphaMap?n=i.alphaMap:i.emissiveMap?n=i.emissiveMap:i.clearcoatMap?n=i.clearcoatMap:i.clearcoatNormalMap?n=i.clearcoatNormalMap:i.clearcoatRoughnessMap?n=i.clearcoatRoughnessMap:i.specularIntensityMap?n=i.specularIntensityMap:i.specularColorMap?n=i.specularColorMap:i.transmissionMap?n=i.transmissionMap:i.thicknessMap?n=i.thicknessMap:i.sheenColorMap?n=i.sheenColorMap:i.sheenRoughnessMap&&(n=i.sheenRoughnessMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix)),i.aoMap?r=i.aoMap:i.lightMap&&(r=i.lightMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uv2Transform.value.copy(r.matrix))}function r(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}function s(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function a(t,e,i,n){let r;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?r=e.map:e.alphaMap&&(r=e.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}function o(t,e){let i;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest),e.map?i=e.map:e.alphaMap&&(i=e.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}function l(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function u(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===yn&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===yn&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function c(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===yn&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===yn&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function d(e,i){e.roughness.value=i.roughness,e.metalness.value=i.metalness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,i.side===yn&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),i.side===yn&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias),t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}function p(t,e,i){d(t,e),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),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap)),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===yn&&t.clearcoatNormalScale.value.negate())),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),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor)),t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}function m(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===yn&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===yn&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function f(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function g(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}function v(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===yn&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===yn&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}return h(e,"refreshFogUniforms"),h(i,"refreshMaterialUniforms"),h(n,"refreshUniformsCommon"),h(r,"refreshUniformsLine"),h(s,"refreshUniformsDash"),h(a,"refreshUniformsPoints"),h(o,"refreshUniformsSprites"),h(l,"refreshUniformsLambert"),h(u,"refreshUniformsPhong"),h(c,"refreshUniformsToon"),h(d,"refreshUniformsStandard"),h(p,"refreshUniformsPhysical"),h(m,"refreshUniformsMatcap"),h(f,"refreshUniformsDepth"),h(g,"refreshUniformsDistance"),h(v,"refreshUniformsNormal"),{refreshFogUniforms:e,refreshMaterialUniforms:i}}function lE(){let t=_u("canvas");return t.style.display="block",t}function Rt(t={}){let e,i=void 0!==t.canvas?t.canvas:lE(),n=void 0!==t.context?t.context:null,r=void 0===t.depth||t.depth,s=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,o=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;e=void 0!==t.context?n.getContextAttributes().alpha:void 0!==t.alpha&&t.alpha;let d=null,p=null,m=[],f=[];this.domElement=i,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Ys,this.physicallyCorrectLights=!1,this.toneMapping=zs,this.toneMappingExposure=1;let g=this,v=!1,y=0,_=0,x=null,b=-1,w=null,M=new Ct,E=new Ct,T=null,S=i.width,q=i.height,P=1,A=null,C=null,L=new Ct(0,0,S,q),R=new Ct(0,0,S,q),N=!1,O=new La,D=!1,B=!1,k=null,F=new We,z=new de,U=new I,H={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function V(){return null===x?P:1}h(V,"getTargetPixelRatio");let G,W,j,X,Y,Z,J,Q,K,$,tt,et,it,nt,rt,st,at,ot,lt,ht,ut,ct,dt,pt=n;function mt(t,e){for(let n=0;n<t.length;n++){let r=t[n],s=i.getContext(r,e);if(null!==s)return s}return null}h(mt,"getContext");try{let t={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:o,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:c};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${Ug}`),i.addEventListener("webglcontextlost",vt,!1),i.addEventListener("webglcontextrestored",yt,!1),null===pt){let e=["webgl2","webgl","experimental-webgl"];if(!0===g.isWebGL1Renderer&&e.shift(),pt=mt(e,t),null===pt)throw mt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===pt.getShaderPrecisionFormat&&(pt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function ft(){G=new P8(pt),W=new w8(pt,G,t),G.init(W),ct=new sE(pt,G,W),j=new iE(pt,G,W),X=new L8(pt),Y=new W9,Z=new rE(pt,G,j,Y,W,ct,X),J=new E8(g),Q=new q8(g),K=new Ww(pt,W),dt=new b8(pt,G,K,W),$=new C8(pt,K,X,dt),tt=new k8(pt,$,K,X),lt=new N8(pt,W,Z),st=new T8(Y),et=new j9(g,J,Q,G,W,dt,st),it=new oE(Y),nt=new Y9,rt=new eE(G,W),ot=new _8(g,J,j,tt,e,o),at=new xx(g,tt,W),ht=new M8(pt,G,X,W),ut=new I8(pt,G,X,W),X.programs=et.programs,g.capabilities=W,g.extensions=G,g.properties=Y,g.renderLists=nt,g.shadowMap=at,g.state=j,g.info=X}h(ft,"initGLContext"),ft();let gt=new xp(g,pt);function vt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),v=!0}function yt(){console.log("THREE.WebGLRenderer: Context Restored."),v=!1;let t=X.autoReset,e=at.enabled,i=at.autoUpdate,n=at.needsUpdate,r=at.type;ft(),X.autoReset=t,at.enabled=e,at.autoUpdate=i,at.needsUpdate=n,at.type=r}function _t(t){let e=t.target;e.removeEventListener("dispose",_t),xt(e)}function xt(t){bt(t),Y.remove(t)}function bt(t){let e=Y.get(t).programs;void 0!==e&&(e.forEach((function(t){et.releaseProgram(t)})),t.isShaderMaterial&&et.releaseShaderCache(t))}this.xr=gt,this.getContext=function(){return pt},this.getContextAttributes=function(){return pt.getContextAttributes()},this.forceContextLoss=function(){let t=G.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){let t=G.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return P},this.setPixelRatio=function(t){void 0!==t&&(P=t,this.setSize(S,q,!1))},this.getSize=function(t){return t.set(S,q)},this.setSize=function(t,e,n){gt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(S=t,q=e,i.width=Math.floor(t*P),i.height=Math.floor(e*P),!1!==n&&(i.style.width=t+"px",i.style.height=e+"px"),this.setViewport(0,0,t,e))},this.getDrawingBufferSize=function(t){return t.set(S*P,q*P).floor()},this.setDrawingBufferSize=function(t,e,n){S=t,q=e,P=n,i.width=Math.floor(t*n),i.height=Math.floor(e*n),this.setViewport(0,0,t,e)},this.getCurrentViewport=function(t){return t.copy(M)},this.getViewport=function(t){return t.copy(L)},this.setViewport=function(t,e,i,n){t.isVector4?L.set(t.x,t.y,t.z,t.w):L.set(t,e,i,n),j.viewport(M.copy(L).multiplyScalar(P).floor())},this.getScissor=function(t){return t.copy(R)},this.setScissor=function(t,e,i,n){t.isVector4?R.set(t.x,t.y,t.z,t.w):R.set(t,e,i,n),j.scissor(E.copy(R).multiplyScalar(P).floor())},this.getScissorTest=function(){return N},this.setScissorTest=function(t){j.setScissorTest(N=t)},this.setOpaqueSort=function(t){A=t},this.setTransparentSort=function(t){C=t},this.getClearColor=function(t){return t.copy(ot.getClearColor())},this.setClearColor=function(){ot.setClearColor.apply(ot,arguments)},this.getClearAlpha=function(){return ot.getClearAlpha()},this.setClearAlpha=function(){ot.setClearAlpha.apply(ot,arguments)},this.clear=function(t=!0,e=!0,i=!0){let n=0;t&&(n|=16384),e&&(n|=256),i&&(n|=1024),pt.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){i.removeEventListener("webglcontextlost",vt,!1),i.removeEventListener("webglcontextrestored",yt,!1),nt.dispose(),rt.dispose(),Y.dispose(),J.dispose(),Q.dispose(),tt.dispose(),dt.dispose(),et.dispose(),gt.dispose(),gt.removeEventListener("sessionstart",Et),gt.removeEventListener("sessionend",Tt),k&&(k.dispose(),k=null),St.stop()},h(vt,"onContextLost"),h(yt,"onContextRestore"),h(_t,"onMaterialDispose"),h(xt,"deallocateMaterial"),h(bt,"releaseMaterialProgramReferences"),this.renderBufferDirect=function(t,e,i,n,r,s){null===e&&(e=H);let a=r.isMesh&&r.matrixWorld.determinant()<0,o=Ot(t,e,i,n,r);j.setMaterial(n,a);let l=i.index,h=i.attributes.position;if(null===l){if(void 0===h||0===h.count)return}else if(0===l.count)return;let u=1;!0===n.wireframe&&(l=$.getWireframeAttribute(i),u=2),dt.setup(r,n,o,i,l);let c,d=ht;null!==l&&(c=K.get(l),d=ut,d.setIndex(c));let p=null!==l?l.count:h.count,m=i.drawRange.start*u,f=i.drawRange.count*u,g=null!==s?s.start*u:0,v=null!==s?s.count*u:1/0,y=Math.max(m,g),_=Math.min(p,m+f,g+v)-1,x=Math.max(0,_-y+1);if(0!==x){if(r.isMesh)!0===n.wireframe?(j.setLineWidth(n.wireframeLinewidth*V()),d.setMode(1)):d.setMode(4);else if(r.isLine){let t=n.linewidth;void 0===t&&(t=1),j.setLineWidth(t*V()),r.isLineSegments?d.setMode(1):r.isLineLoop?d.setMode(2):d.setMode(3)}else r.isPoints?d.setMode(0):r.isSprite&&d.setMode(4);if(r.isInstancedMesh)d.renderInstances(y,x,r.count);else if(i.isInstancedBufferGeometry){let t=Math.min(i.instanceCount,i._maxInstanceCount);d.renderInstances(y,x,t)}else d.render(y,x)}},this.compile=function(t,e){p=rt.get(t),p.init(),f.push(p),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(p.pushLight(t),t.castShadow&&p.pushShadow(t))})),p.setupLights(g.physicallyCorrectLights),t.traverse((function(e){let i=e.material;if(i)if(Array.isArray(i))for(let n=0;n<i.length;n++){Rt(i[n],t,e)}else Rt(i,t,e)})),f.pop(),p=null};let wt=null;function Mt(t){wt&&wt(t)}function Et(){St.stop()}function Tt(){St.start()}h(Mt,"onAnimationFrame"),h(Et,"onXRSessionStart"),h(Tt,"onXRSessionEnd");let St=new hx;function qt(t,e,i,n){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)i=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)p.pushLight(t),t.castShadow&&p.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||O.intersectsSprite(t)){n&&U.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F);let e=tt.update(t),r=t.material;r.visible&&d.push(t,e,r,i,U.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==X.render.frame&&(t.skeleton.update(),t.skeleton.frame=X.render.frame),!t.frustumCulled||O.intersectsObject(t))){n&&U.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F);let e=tt.update(t),r=t.material;if(Array.isArray(r)){let n=e.groups;for(let s=0,a=n.length;s<a;s++){let a=n[s],o=r[a.materialIndex];o&&o.visible&&d.push(t,e,o,i,U.z,a)}}else r.visible&&d.push(t,e,r,i,U.z,null)}let r=t.children;for(let t=0,s=r.length;t<s;t++)qt(r[t],e,i,n)}function Pt(t,e,i,n){let r=t.opaque,s=t.transmissive,a=t.transparent;p.setupLightsView(i),s.length>0&&At(r,e,i),n&&j.viewport(M.copy(n)),r.length>0&&Lt(r,e,i),s.length>0&&Lt(s,e,i),a.length>0&&Lt(a,e,i),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1)}function At(t,e,i){let n=W.isWebGL2;null===k&&(k=new dn(1,1,{generateMipmaps:!0,type:null!==ct.convert(nl)?nl:Ga,minFilter:df,samples:n&&!0===a?4:0})),g.getDrawingBufferSize(z),n?k.setSize(z.x,z.y):k.setSize(Ng(z.x),Ng(z.y));let r=g.getRenderTarget();g.setRenderTarget(k),g.clear();let s=g.toneMapping;g.toneMapping=zs,Lt(t,e,i),g.toneMapping=s,Z.updateMultisampleRenderTarget(k),Z.updateRenderTargetMipmap(k),g.setRenderTarget(r)}function Lt(t,e,i){let n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r<s;r++){let s=t[r],a=s.object,o=s.geometry,l=null===n?s.material:n,h=s.group;a.layers.test(i.layers)&&It(a,e,i,o,l,h)}}function It(t,e,i,n,r,s){t.onBeforeRender(g,e,i,n,r,s),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),r.onBeforeRender(g,e,i,n,t,s),!0===r.transparent&&r.side===pr?(r.side=yn,r.needsUpdate=!0,g.renderBufferDirect(i,e,n,r,t,s),r.side=Xs,r.needsUpdate=!0,g.renderBufferDirect(i,e,n,r,t,s),r.side=pr):g.renderBufferDirect(i,e,n,r,t,s),t.onAfterRender(g,e,i,n,r,s)}function Rt(t,e,i){!0!==e.isScene&&(e=H);let n=Y.get(t),r=p.state.lights,s=p.state.shadowsArray,a=r.state.version,o=et.getParameters(t,r.state,s,e,i),l=et.getProgramCacheKey(o),h=n.programs;n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.envMap=(t.isMeshStandardMaterial?Q:J).get(t.envMap||n.environment),void 0===h&&(t.addEventListener("dispose",_t),h=new Map,n.programs=h);let u=h.get(l);if(void 0!==u){if(n.currentProgram===u&&n.lightsStateVersion===a)return Nt(t,o),u}else o.uniforms=et.getUniforms(t),t.onBuild(i,o,g),t.onBeforeCompile(o,g),u=et.acquireProgram(o,l),h.set(l,u),n.uniforms=o.uniforms;let c=n.uniforms;(!t.isShaderMaterial&&!t.isRawShaderMaterial||!0===t.clipping)&&(c.clippingPlanes=st.uniform),Nt(t,o),n.needsLights=Bt(t),n.lightsStateVersion=a,n.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.spotShadowMatrix.value=r.state.spotShadowMatrix,c.pointShadowMap.value=r.state.pointShadowMap,c.pointShadowMatrix.value=r.state.pointShadowMatrix);let d=u.getUniforms(),m=Hs.seqWithValue(d.seq,c);return n.currentProgram=u,n.uniformsList=m,u}function Nt(t,e){let i=Y.get(t);i.outputEncoding=e.outputEncoding,i.instancing=e.instancing,i.skinning=e.skinning,i.morphTargets=e.morphTargets,i.morphNormals=e.morphNormals,i.morphColors=e.morphColors,i.morphTargetsCount=e.morphTargetsCount,i.numClippingPlanes=e.numClippingPlanes,i.numIntersection=e.numClipIntersection,i.vertexAlphas=e.vertexAlphas,i.vertexTangents=e.vertexTangents,i.toneMapping=e.toneMapping}function Ot(t,e,i,n,r){!0!==e.isScene&&(e=H),Z.resetTextureUnits();let s=e.fog,a=n.isMeshStandardMaterial?e.environment:null,o=null===x?g.outputEncoding:!0===x.isXRRenderTarget?x.texture.encoding:Ys,l=(n.isMeshStandardMaterial?Q:J).get(n.envMap||a),h=!0===n.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,u=!!n.normalMap&&!!i.attributes.tangent,c=!!i.morphAttributes.position,d=!!i.morphAttributes.normal,m=!!i.morphAttributes.color,f=n.toneMapped?g.toneMapping:zs,v=i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color,y=void 0!==v?v.length:0,_=Y.get(n),M=p.state.lights;if(!0===D&&(!0===B||t!==w)){let e=t===w&&n.id===b;st.setState(n,t,e)}let E=!1;n.version===_.__version?(_.needsLights&&_.lightsStateVersion!==M.state.version||_.outputEncoding!==o||r.isInstancedMesh&&!1===_.instancing||!r.isInstancedMesh&&!0===_.instancing||r.isSkinnedMesh&&!1===_.skinning||!r.isSkinnedMesh&&!0===_.skinning||_.envMap!==l||n.fog&&_.fog!==s||void 0!==_.numClippingPlanes&&(_.numClippingPlanes!==st.numPlanes||_.numIntersection!==st.numIntersection)||_.vertexAlphas!==h||_.vertexTangents!==u||_.morphTargets!==c||_.morphNormals!==d||_.morphColors!==m||_.toneMapping!==f||!0===W.isWebGL2&&_.morphTargetsCount!==y)&&(E=!0):(E=!0,_.__version=n.version);let T=_.currentProgram;!0===E&&(T=Rt(n,e,r));let S=!1,A=!1,C=!1,L=T.getUniforms(),I=_.uniforms;if(j.useProgram(T.program)&&(S=!0,A=!0,C=!0),n.id!==b&&(b=n.id,A=!0),S||w!==t){if(L.setValue(pt,"projectionMatrix",t.projectionMatrix),W.logarithmicDepthBuffer&&L.setValue(pt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),w!==t&&(w=t,A=!0,C=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){let e=L.map.cameraPosition;void 0!==e&&e.setValue(pt,U.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&L.setValue(pt,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||r.isSkinnedMesh)&&L.setValue(pt,"viewMatrix",t.matrixWorldInverse)}if(r.isSkinnedMesh){L.setOptional(pt,r,"bindMatrix"),L.setOptional(pt,r,"bindMatrixInverse");let t=r.skeleton;t&&(W.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),L.setValue(pt,"boneTexture",t.boneTexture,Z),L.setValue(pt,"boneTextureSize",t.boneTextureSize)):L.setOptional(pt,t,"boneMatrices"))}let R=i.morphAttributes;return(void 0!==R.position||void 0!==R.normal||void 0!==R.color&&!0===W.isWebGL2)&&lt.update(r,i,n,T),(A||_.receiveShadow!==r.receiveShadow)&&(_.receiveShadow=r.receiveShadow,L.setValue(pt,"receiveShadow",r.receiveShadow)),A&&(L.setValue(pt,"toneMappingExposure",g.toneMappingExposure),_.needsLights&&Dt(I,C),s&&n.fog&&it.refreshFogUniforms(I,s),it.refreshMaterialUniforms(I,n,P,q,k),Hs.upload(pt,_.uniformsList,I,Z)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Hs.upload(pt,_.uniformsList,I,Z),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&L.setValue(pt,"center",r.center),L.setValue(pt,"modelViewMatrix",r.modelViewMatrix),L.setValue(pt,"normalMatrix",r.normalMatrix),L.setValue(pt,"modelMatrix",r.matrixWorld),T}function Dt(t,e){t.ambientLightColor.needsUpdate=e,t.lightProbe.needsUpdate=e,t.directionalLights.needsUpdate=e,t.directionalLightShadows.needsUpdate=e,t.pointLights.needsUpdate=e,t.pointLightShadows.needsUpdate=e,t.spotLights.needsUpdate=e,t.spotLightShadows.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e,t.directionalShadowMap.needsUpdate=e,t.directionalShadowMatrix.needsUpdate=e,t.spotShadowMap.needsUpdate=e,t.spotShadowMatrix.needsUpdate=e,t.pointShadowMap.needsUpdate=e,t.pointShadowMatrix.needsUpdate=e}function Bt(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}St.setAnimationLoop(Mt),"undefined"!=typeof window&&St.setContext(window),this.setAnimationLoop=function(t){wt=t,gt.setAnimationLoop(t),null===t?St.stop():St.start()},gt.addEventListener("sessionstart",Et),gt.addEventListener("sessionend",Tt),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===v)return;!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===gt.enabled&&!0===gt.isPresenting&&(!0===gt.cameraAutoUpdate&&gt.updateCamera(e),e=gt.getCamera()),!0===t.isScene&&t.onBeforeRender(g,t,e,x),p=rt.get(t,f.length),p.init(),f.push(p),F.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),O.setFromProjectionMatrix(F),B=this.localClippingEnabled,D=st.init(this.clippingPlanes,B,e),d=nt.get(t,m.length),d.init(),m.push(d),qt(t,e,0,g.sortObjects),d.finish(),!0===g.sortObjects&&d.sort(A,C),!0===D&&st.beginShadows();let i=p.state.shadowsArray;if(at.render(i,t,e),!0===D&&st.endShadows(),!0===this.info.autoReset&&this.info.reset(),ot.render(d,t),p.setupLights(g.physicallyCorrectLights),e.isArrayCamera){let i=e.cameras;for(let e=0,n=i.length;e<n;e++){let n=i[e];Pt(d,t,n,n.viewport)}}else Pt(d,t,e);null!==x&&(Z.updateMultisampleRenderTarget(x),Z.updateRenderTargetMipmap(x)),!0===t.isScene&&t.onAfterRender(g,t,e),dt.resetDefaultState(),b=-1,w=null,f.pop(),p=f.length>0?f[f.length-1]:null,m.pop(),d=m.length>0?m[m.length-1]:null},h(qt,"projectObject"),h(Pt,"renderScene"),h(At,"renderTransmissionPass"),h(Lt,"renderObjects"),h(It,"renderObject"),h(Rt,"getProgram"),h(Nt,"updateCommonMaterialProperties"),h(Ot,"setProgram"),h(Dt,"markUniformsLightsNeedsUpdate"),h(Bt,"materialNeedsLights"),this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return _},this.getRenderTarget=function(){return x},this.setRenderTargetTextures=function(t,e,i){Y.get(t.texture).__webglTexture=e,Y.get(t.depthTexture).__webglTexture=i;let n=Y.get(t);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||!0===G.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),t.useRenderToTexture=!1,t.useRenderbuffer=!0))},this.setRenderTargetFramebuffer=function(t,e){let i=Y.get(t);i.__webglFramebuffer=e,i.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,i=0){x=t,y=e,_=i;let n=!0;if(t){let e=Y.get(t);void 0!==e.__useDefaultFramebuffer?(j.bindFramebuffer(36160,null),n=!1):void 0===e.__webglFramebuffer?Z.setupRenderTarget(t):e.__hasExternalTextures&&Z.rebindTextures(t,Y.get(t.texture).__webglTexture,Y.get(t.depthTexture).__webglTexture)}let r=null,s=!1,a=!1;if(t){let i=t.texture;(i.isData3DTexture||i.isDataArrayTexture)&&(a=!0);let n=Y.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=n[e],s=!0):r=W.isWebGL2&&t.samples>0&&!1===Z.useMultisampledRTT(t)?Y.get(t).__webglMultisampledFramebuffer:n,M.copy(t.viewport),E.copy(t.scissor),T=t.scissorTest}else M.copy(L).multiplyScalar(P).floor(),E.copy(R).multiplyScalar(P).floor(),T=N;if(j.bindFramebuffer(36160,r)&&W.drawBuffers&&n&&j.drawBuffers(t,r),j.viewport(M),j.scissor(E),j.setScissorTest(T),s){let n=Y.get(t.texture);pt.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}else if(a){let n=Y.get(t.texture),r=e||0;pt.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}b=-1},this.readRenderTargetPixels=function(t,e,i,n,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=Y.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){j.bindFramebuffer(36160,o);try{let a=t.texture,o=a.format,l=a.type;if(o!==Sn&&ct.convert(o)!==pt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");let h=l===nl&&(G.has("EXT_color_buffer_half_float")||W.isWebGL2&&G.has("EXT_color_buffer_float"));if(!(l===Ga||ct.convert(l)===pt.getParameter(35738)||l===qa&&(W.isWebGL2||G.has("OES_texture_float")||G.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===pt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&pt.readPixels(e,i,n,r,ct.convert(o),ct.convert(l),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{let t=null!==x?Y.get(x).__webglFramebuffer:null;j.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,i=0){if(!0!==e.isFramebufferTexture)return void console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");let n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n);Z.setTexture2D(e,0),pt.copyTexSubImage2D(3553,i,0,0,t.x,t.y,r,s),j.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){let r=e.image.width,s=e.image.height,a=ct.convert(i.format),o=ct.convert(i.type);Z.setTexture2D(i,0),pt.pixelStorei(37440,i.flipY),pt.pixelStorei(37441,i.premultiplyAlpha),pt.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?pt.texSubImage2D(3553,n,t.x,t.y,r,s,a,o,e.image.data):e.isCompressedTexture?pt.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):pt.texSubImage2D(3553,n,t.x,t.y,a,o,e.image),0===n&&i.generateMipmaps&&pt.generateMipmap(3553),j.unbindTexture()},this.copyTextureToTexture3D=function(t,e,i,n,r=0){if(g.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");let s,a=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,l=t.max.z-t.min.z+1,h=ct.convert(n.format),u=ct.convert(n.type);if(n.isData3DTexture)Z.setTexture3D(n,0),s=32879;else{if(!n.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Z.setTexture2DArray(n,0),s=35866}pt.pixelStorei(37440,n.flipY),pt.pixelStorei(37441,n.premultiplyAlpha),pt.pixelStorei(3317,n.unpackAlignment);let c=pt.getParameter(3314),d=pt.getParameter(32878),p=pt.getParameter(3316),m=pt.getParameter(3315),f=pt.getParameter(32877),v=i.isCompressedTexture?i.mipmaps[0]:i.image;pt.pixelStorei(3314,v.width),pt.pixelStorei(32878,v.height),pt.pixelStorei(3316,t.min.x),pt.pixelStorei(3315,t.min.y),pt.pixelStorei(32877,t.min.z),i.isDataTexture||i.isData3DTexture?pt.texSubImage3D(s,r,e.x,e.y,e.z,a,o,l,h,u,v.data):i.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),pt.compressedTexSubImage3D(s,r,e.x,e.y,e.z,a,o,l,h,v.data)):pt.texSubImage3D(s,r,e.x,e.y,e.z,a,o,l,h,u,v),pt.pixelStorei(3314,c),pt.pixelStorei(32878,d),pt.pixelStorei(3316,p),pt.pixelStorei(3315,m),pt.pixelStorei(32877,f),0===r&&n.generateMipmaps&&pt.generateMipmap(s),j.unbindTexture()},this.initTexture=function(t){Z.setTexture2D(t,0),j.unbindTexture()},this.resetState=function(){y=0,_=0,x=null,j.reset(),dt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}h(xp,"WebXRManager"),h(oE,"WebGLMaterials"),h(lE,"createCanvasElement"),h(Rt,"WebGLRenderer"),Rt.prototype.isWebGLRenderer=!0;var Oa=class extends Rt{};h(Oa,"WebGL1Renderer"),Oa.prototype.isWebGL1Renderer=!0;var dl=class{constructor(t,e=25e-5){this.name="",this.color=new Ee(t),this.density=e}clone(){return new dl(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}};h(dl,"FogExp2"),dl.prototype.isFogExp2=!0;var pl=class{constructor(t,e=1,i=1e3){this.name="",this.color=new Ee(t),this.near=e,this.far=i}clone(){return new pl(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}};h(pl,"Fog"),pl.prototype.isFog=!0;var Jr=class extends rt{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"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()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}};h(Jr,"Scene"),Jr.prototype.isScene=!0;var $r=class{constructor(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=xu,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Wi()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}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,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];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=Wi()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}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=Wi()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}};h($r,"InterleavedBuffer"),$r.prototype.isInterleavedBuffer=!0;var on=new I,Kr=class{constructor(t,e,i,n=!1){this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}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,i=this.data.count;e<i;e++)on.x=this.getX(e),on.y=this.getY(e),on.z=this.getZ(e),on.applyMatrix4(t),this.setXYZ(e,on.x,on.y,on.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)on.x=this.getX(e),on.y=this.getY(e),on.z=this.getZ(e),on.applyNormalMatrix(t),this.setXYZ(e,on.x,on.y,on.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)on.x=this.getX(e),on.y=this.getY(e),on.z=this.getZ(e),on.transformDirection(t),this.setXYZ(e,on.x,on.y,on.z);return this}setX(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){return this.data.array[t*this.data.stride+this.offset]}getY(t){return this.data.array[t*this.data.stride+this.offset+1]}getZ(t){return this.data.array[t*this.data.stride+this.offset+2]}getW(t){return this.data.array[t*this.data.stride+this.offset+3]}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this}setXYZW(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new qt(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 Kr(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");let t=[];for(let e=0;e<this.count;e++){let i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+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}}};h(Kr,"InterleavedBufferAttribute"),Kr.prototype.isInterleavedBufferAttribute=!0;var fl=class extends nn{constructor(t){super(),this.type="SpriteMaterial",this.color=new Ee(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!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}};h(fl,"SpriteMaterial"),fl.prototype.isSpriteMaterial=!0;var Wo,kc=new I,Xo=new I,Yo=new I,Zo=new de,Dc=new de,_x=new We,ep=new I,Bc=new I,tp=new I,qv=new de,Mg=new de,Pv=new de,_p=class extends rt{constructor(t){if(super(),this.type="Sprite",void 0===Wo){Wo=new wt;let t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),e=new $r(t,5);Wo.setIndex([0,1,2,0,2,3]),Wo.setAttribute("position",new Kr(e,3,0,!1)),Wo.setAttribute("uv",new Kr(e,2,3,!1))}this.geometry=Wo,this.material=void 0!==t?t:new fl,this.center=new de(.5,.5)}raycast(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Xo.setFromMatrixScale(this.matrixWorld),_x.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Yo.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Xo.multiplyScalar(-Yo.z);let i,n,r=this.material.rotation;0!==r&&(n=Math.cos(r),i=Math.sin(r));let s=this.center;np(ep.set(-.5,-.5,0),Yo,s,Xo,i,n),np(Bc.set(.5,-.5,0),Yo,s,Xo,i,n),np(tp.set(.5,.5,0),Yo,s,Xo,i,n),qv.set(0,0),Mg.set(1,0),Pv.set(1,1);let a=t.ray.intersectTriangle(ep,Bc,tp,!1,kc);if(null===a&&(np(Bc.set(-.5,.5,0),Yo,s,Xo,i,n),Mg.set(0,1),a=t.ray.intersectTriangle(ep,tp,Bc,!1,kc),null===a))return;let o=t.ray.origin.distanceTo(kc);o<t.near||o>t.far||e.push({distance:o,point:kc.clone(),uv:Xt.getUV(kc,ep,Bc,tp,qv,Mg,Pv,new de),face:null,object:this})}copy(t){return super.copy(t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}};function np(t,e,i,n,r,s){Zo.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(Dc.x=s*Zo.x-r*Zo.y,Dc.y=r*Zo.x+s*Zo.y):Dc.copy(Zo),t.copy(e),t.x+=Dc.x,t.y+=Dc.y,t.applyMatrix4(_x)}h(_p,"Sprite"),_p.prototype.isSprite=!0,h(np,"transformVertex");var Cv=new I,Iv=new Ct,Lv=new Ct,cE=new I,Ov=new We,Zc=class extends lt{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new We,this.bindMatrixInverse=new We}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let t=new Ct,e=this.geometry.attributes.skinWeight;for(let i=0,n=e.count;i<n;i++){t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.w=e.getW(i);let n=1/t.manhattanLength();n!==1/0?t.multiplyScalar(n):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(t,e){let i=this.skeleton,n=this.geometry;Iv.fromBufferAttribute(n.attributes.skinIndex,t),Lv.fromBufferAttribute(n.attributes.skinWeight,t),Cv.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){let n=Lv.getComponent(t);if(0!==n){let r=Iv.getComponent(t);Ov.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),e.addScaledVector(cE.copy(Cv).applyMatrix4(Ov),n)}}return e.applyMatrix4(this.bindMatrixInverse)}};h(Zc,"SkinnedMesh"),Zc.prototype.isSkinnedMesh=!0;var bp=class extends rt{constructor(){super(),this.type="Bone"}};h(bp,"Bone"),bp.prototype.isBone=!0;var Mp=class extends ln{constructor(t=null,e=1,i=1,n,r,s,a,o,l=Ut,h=Ut,u,c){super(null,s,a,o,l,h,n,r,u,c),this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};h(Mp,"DataTexture"),Mp.prototype.isDataTexture=!0;var Ai=class extends qt{constructor(t,e,i,n=1){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(t,e,i),this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){let t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}};h(Ai,"InstancedBufferAttribute"),Ai.prototype.isInstancedBufferAttribute=!0;var Rv=new We,Nv=new We,ip=[],Fc=new lt,wp=class extends lt{constructor(t,e,i){super(t,e),this.instanceMatrix=new Ai(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(t){return super.copy(t),this.instanceMatrix.copy(t.instanceMatrix),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}raycast(t,e){let i=this.matrixWorld,n=this.count;if(Fc.geometry=this.geometry,Fc.material=this.material,void 0!==Fc.material)for(let r=0;r<n;r++){this.getMatrixAt(r,Rv),Nv.multiplyMatrices(i,Rv),Fc.matrixWorld=Nv,Fc.raycast(t,ip);for(let t=0,i=ip.length;t<i;t++){let i=ip[t];i.instanceId=r,i.object=this,e.push(i)}ip.length=0}}setColorAt(t,e){null===this.instanceColor&&(this.instanceColor=new Ai(new Float32Array(3*this.instanceMatrix.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}};h(wp,"InstancedMesh"),wp.prototype.isInstancedMesh=!0;var Xi=class extends nn{constructor(t){super(),this.type="LineBasicMaterial",this.color=new Ee(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this}};h(Xi,"LineBasicMaterial"),Xi.prototype.isLineBasicMaterial=!0;var kv=new I,Dv=new I,Bv=new We,wg=new hr,rp=new Yr,ml=class extends rt{constructor(t=new wt,e=new Xi){super(),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(t.isBufferGeometry)if(null===t.index){let e=t.attributes.position,i=[0];for(let t=1,n=e.count;t<n;t++)kv.fromBufferAttribute(e,t-1),Dv.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=kv.distanceTo(Dv);t.setAttribute("lineDistance",new It(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(t,e){let i=this.geometry,n=this.matrixWorld,r=t.params.Line.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),rp.copy(i.boundingSphere),rp.applyMatrix4(n),rp.radius+=r,!1===t.ray.intersectsSphere(rp))return;Bv.copy(n).invert(),wg.copy(t.ray).applyMatrix4(Bv);let a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=new I,h=new I,u=new I,c=new I,d=this.isLineSegments?2:1;if(i.isBufferGeometry){let n=i.index,r=i.attributes.position;if(null!==n){for(let i=Math.max(0,s.start),a=Math.min(n.count,s.start+s.count)-1;i<a;i+=d){let s=n.getX(i),a=n.getX(i+1);if(l.fromBufferAttribute(r,s),h.fromBufferAttribute(r,a),wg.distanceSqToSegment(l,h,c,u)>o)continue;c.applyMatrix4(this.matrixWorld);let d=t.ray.origin.distanceTo(c);d<t.near||d>t.far||e.push({distance:d,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,s.start),n=Math.min(r.count,s.start+s.count)-1;i<n;i+=d){if(l.fromBufferAttribute(r,i),h.fromBufferAttribute(r,i+1),wg.distanceSqToSegment(l,h,c,u)>o)continue;c.applyMatrix4(this.matrixWorld);let n=t.ray.origin.distanceTo(c);n<t.near||n>t.far||e.push({distance:n,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let t=this.geometry;if(t.isBufferGeometry){let e=t.morphAttributes,i=Object.keys(e);if(i.length>0){let t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){let i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{let e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};h(ml,"Line"),ml.prototype.isLine=!0;var Fv=new I,zv=new I,Gs=class extends ml{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(t.isBufferGeometry)if(null===t.index){let e=t.attributes.position,i=[];for(let t=0,n=e.count;t<n;t+=2)Fv.fromBufferAttribute(e,t),zv.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+Fv.distanceTo(zv);t.setAttribute("lineDistance",new It(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}};h(Gs,"LineSegments"),Gs.prototype.isLineSegments=!0;var Tp=class extends ml{constructor(t,e){super(t,e),this.type="LineLoop"}};h(Tp,"LineLoop"),Tp.prototype.isLineLoop=!0;var gl=class extends nn{constructor(t){super(),this.type="PointsMaterial",this.color=new Ee(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!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}};h(gl,"PointsMaterial"),gl.prototype.isPointsMaterial=!0;var Uv=new We,Dg=new hr,sp=new Yr,ap=new I,Ep=class extends rt{constructor(t=new wt,e=new gl){super(),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){let i=this.geometry,n=this.matrixWorld,r=t.params.Points.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),sp.copy(i.boundingSphere),sp.applyMatrix4(n),sp.radius+=r,!1===t.ray.intersectsSphere(sp))return;Uv.copy(n).invert(),Dg.copy(t.ray).applyMatrix4(Uv);let a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(i.isBufferGeometry){let r=i.index,a=i.attributes.position;if(null!==r){for(let i=Math.max(0,s.start),l=Math.min(r.count,s.start+s.count);i<l;i++){let s=r.getX(i);ap.fromBufferAttribute(a,s),Vv(ap,s,o,n,t,e,this)}}else{for(let i=Math.max(0,s.start),r=Math.min(a.count,s.start+s.count);i<r;i++)ap.fromBufferAttribute(a,i),Vv(ap,i,o,n,t,e,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){let t=this.geometry;if(t.isBufferGeometry){let e=t.morphAttributes,i=Object.keys(e);if(i.length>0){let t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){let i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{let e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}};function Vv(t,e,i,n,r,s,a){let o=Dg.distanceSqToPoint(t);if(o<i){let i=new I;Dg.closestPointToPoint(t,i),i.applyMatrix4(n);let l=r.ray.origin.distanceTo(i);if(l<r.near||l>r.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:i,index:e,face:null,object:a})}}h(Ep,"Points"),Ep.prototype.isPoints=!0,h(Vv,"testPoint");var Sp=class extends ln{constructor(t,e,i,n,r,s,a,o,l){super(t,e,i,n,r,s,a,o,l),this.minFilter=void 0!==s?s:Vn,this.magFilter=void 0!==r?r:Vn,this.generateMipmaps=!1;let u=this;function c(){u.needsUpdate=!0,t.requestVideoFrameCallback(c)}h(c,"updateVideo"),"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(c)}clone(){return new this.constructor(this.image).copy(this)}update(){let t=this.image;"requestVideoFrameCallback"in t==!1&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}};h(Sp,"VideoTexture"),Sp.prototype.isVideoTexture=!0;var Ap=class extends ln{constructor(t,e,i){super({width:t,height:e}),this.format=i,this.magFilter=Ut,this.minFilter=Ut,this.generateMipmaps=!1,this.needsUpdate=!0}};h(Ap,"FramebufferTexture"),Ap.prototype.isFramebufferTexture=!0;var qp=class extends ln{constructor(t,e,i,n,r,s,a,o,l,h,u,c){super(null,s,a,o,l,h,n,r,u,c),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}};h(qp,"CompressedTexture"),qp.prototype.isCompressedTexture=!0;var Ra=class extends ln{constructor(t,e,i,n,r,s,a,o,l){super(t,e,i,n,r,s,a,o,l),this.needsUpdate=!0}};h(Ra,"CanvasTexture"),Ra.prototype.isCanvasTexture=!0;var Na=class extends wt{constructor(t=1,e=1,i=1,n=8,r=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:s,thetaStart:a,thetaLength:o};let l=this;n=Math.floor(n),r=Math.floor(r);let u=[],c=[],d=[],p=[],m=0,f=[],g=i/2,v=0;function y(){let s=new I,h=new I,y=0,_=(e-t)/i;for(let l=0;l<=r;l++){let u=[],v=l/r,y=v*(e-t)+t;for(let t=0;t<=n;t++){let e=t/n,r=e*o+a,l=Math.sin(r),f=Math.cos(r);h.x=y*l,h.y=-v*i+g,h.z=y*f,c.push(h.x,h.y,h.z),s.set(l,_,f).normalize(),d.push(s.x,s.y,s.z),p.push(e,1-v),u.push(m++)}f.push(u)}for(let t=0;t<n;t++)for(let e=0;e<r;e++){let i=f[e][t],n=f[e+1][t],r=f[e+1][t+1],s=f[e][t+1];u.push(i,n,s),u.push(n,r,s),y+=6}l.addGroup(v,y,0),v+=y}function _(i){let r=m,s=new de,h=new I,f=0,y=!0===i?t:e,_=!0===i?1:-1;for(let t=1;t<=n;t++)c.push(0,g*_,0),d.push(0,_,0),p.push(.5,.5),m++;let x=m;for(let t=0;t<=n;t++){let e=t/n*o+a,i=Math.cos(e),r=Math.sin(e);h.x=y*r,h.y=g*_,h.z=y*i,c.push(h.x,h.y,h.z),d.push(0,_,0),s.x=.5*i+.5,s.y=.5*r*_+.5,p.push(s.x,s.y),m++}for(let t=0;t<n;t++){let e=r+t,n=x+t;!0===i?u.push(n,n+1,e):u.push(n+1,n,e),f+=3}l.addGroup(v,f,!0===i?1:2),v+=f}y(),!1===s&&(t>0&&_(!0),e>0&&_(!1)),this.setIndex(u),this.setAttribute("position",new It(c,3)),this.setAttribute("normal",new It(d,3)),this.setAttribute("uv",new It(p,2)),h(y,"generateTorso"),h(_,"generateCap")}static fromJSON(t){return new Na(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}};h(Na,"CylinderGeometry");var sD=new I,aD=new I,oD=new I,lD=new Xt,Qn=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){let i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){let e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){let 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;let e,i=[],n=this.getPoint(0),r=0;i.push(0);for(let s=1;s<=t;s++)e=this.getPoint(s/t),r+=e.distanceTo(n),i.push(r),n=e;return this.cacheArcLengths=i,i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){let i,n=this.getLengths(),r=0,s=n.length;i=e||t*n[s-1];let a,o=0,l=s-1;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),a=n[r]-i,a<0)o=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(r=l,n[r]===i)return r/(s-1);let h=n[r];return(r+(i-h)/(n[r+1]-h))/(s-1)}getTangent(t,e){let i=t-1e-4,n=t+1e-4;i<0&&(i=0),n>1&&(n=1);let r=this.getPoint(i),s=this.getPoint(n),a=e||(r.isVector2?new de:new I);return a.copy(s).sub(r).normalize(),a}getTangentAt(t,e){let i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){let i=new I,n=[],r=[],s=[],a=new I,o=new We;for(let e=0;e<=t;e++){let i=e/t;n[e]=this.getTangentAt(i,new I)}r[0]=new I,s[0]=new I;let l=Number.MAX_VALUE,h=Math.abs(n[0].x),u=Math.abs(n[0].y),c=Math.abs(n[0].z);h<=l&&(l=h,i.set(1,0,0)),u<=l&&(l=u,i.set(0,1,0)),c<=l&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],a),s[0].crossVectors(n[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(n[e-1],n[e]),a.length()>Number.EPSILON){a.normalize();let t=Math.acos(ai(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(n[e],r[e])}if(!0===e){let e=Math.acos(ai(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(o.makeRotationAxis(n[i],e*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}};h(Qn,"Curve");var ka=class extends Qn{constructor(t=0,e=0,i=1,n=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e){let i=e||new de,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,s=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=s?0:n),!0===this.aClockwise&&!s&&(r===n?r=-n:r-=n);let a=this.aStartAngle+t*r,o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){let t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=o-this.aX,n=l-this.aY;o=i*t-n*e+this.aX,l=i*e+n*t+this.aY}return i.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(){let 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}};h(ka,"EllipseCurve"),ka.prototype.isEllipseCurve=!0;var Jc=class extends ka{constructor(t,e,i,n,r,s){super(t,e,i,i,n,r,s),this.type="ArcCurve"}};function Wg(){let t=0,e=0,i=0,n=0;function r(r,s,a,o){t=r,e=a,i=-3*r+3*s-2*a-o,n=2*r-2*s+a+o}return h(r,"init"),{initCatmullRom:function(t,e,i,n,s){r(e,i,s*(i-t),s*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,s,a,o){let l=(e-t)/s-(i-t)/(s+a)+(i-e)/a,h=(i-e)/a-(n-e)/(a+o)+(n-i)/o;l*=a,h*=a,r(e,i,l,h)},calc:function(r){let s=r*r;return t+e*r+i*s+n*(s*r)}}}h(Jc,"ArcCurve"),Jc.prototype.isArcCurve=!0,h(Wg,"CubicPoly");var op=new I,Tg=new Wg,Eg=new Wg,Sg=new Wg,Da=class extends Qn{constructor(t=[],e=!1,i="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=n}getPoint(t,e=new I){let i,n,r=e,s=this.points,a=s.length,o=(a-(this.closed?0:1))*t,l=Math.floor(o),h=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/a)+1)*a:0===h&&l===a-1&&(l=a-2,h=1),this.closed||l>0?i=s[(l-1)%a]:(op.subVectors(s[0],s[1]).add(s[0]),i=op);let u=s[l%a],c=s[(l+1)%a];if(this.closed||l+2<a?n=s[(l+2)%a]:(op.subVectors(s[a-1],s[a-2]).add(s[a-1]),n=op),"centripetal"===this.curveType||"chordal"===this.curveType){let t="chordal"===this.curveType?.5:.25,e=Math.pow(i.distanceToSquared(u),t),r=Math.pow(u.distanceToSquared(c),t),s=Math.pow(c.distanceToSquared(n),t);r<1e-4&&(r=1),e<1e-4&&(e=r),s<1e-4&&(s=r),Tg.initNonuniformCatmullRom(i.x,u.x,c.x,n.x,e,r,s),Eg.initNonuniformCatmullRom(i.y,u.y,c.y,n.y,e,r,s),Sg.initNonuniformCatmullRom(i.z,u.z,c.z,n.z,e,r,s)}else"catmullrom"===this.curveType&&(Tg.initCatmullRom(i.x,u.x,c.x,n.x,this.tension),Eg.initCatmullRom(i.y,u.y,c.y,n.y,this.tension),Sg.initCatmullRom(i.z,u.z,c.z,n.z,this.tension));return r.set(Tg.calc(h),Eg.calc(h),Sg.calc(h)),r}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.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,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push((new I).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}};function Hv(t,e,i,n,r){let s=.5*(n-e),a=.5*(r-i),o=t*t;return(2*i-2*n+s+a)*(t*o)+(-3*i+3*n-2*s-a)*o+s*t+i}function uE(t,e){let i=1-t;return i*i*e}function hE(t,e){return 2*(1-t)*t*e}function dE(t,e){return t*t*e}function $c(t,e,i,n){return uE(t,e)+hE(t,i)+dE(t,n)}function pE(t,e){let i=1-t;return i*i*i*e}function fE(t,e){let i=1-t;return 3*i*i*t*e}function mE(t,e){return 3*(1-t)*t*t*e}function gE(t,e){return t*t*t*e}function Kc(t,e,i,n,r){return pE(t,e)+fE(t,i)+mE(t,n)+gE(t,r)}h(Da,"CatmullRomCurve3"),Da.prototype.isCatmullRomCurve3=!0,h(Hv,"CatmullRom"),h(uE,"QuadraticBezierP0"),h(hE,"QuadraticBezierP1"),h(dE,"QuadraticBezierP2"),h($c,"QuadraticBezier"),h(pE,"CubicBezierP0"),h(fE,"CubicBezierP1"),h(mE,"CubicBezierP2"),h(gE,"CubicBezierP3"),h(Kc,"CubicBezier");var yl=class extends Qn{constructor(t=new de,e=new de,i=new de,n=new de){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new de){let i=e,n=this.v0,r=this.v1,s=this.v2,a=this.v3;return i.set(Kc(t,n.x,r.x,s.x,a.x),Kc(t,n.y,r.y,s.y,a.y)),i}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(){let 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}};h(yl,"CubicBezierCurve"),yl.prototype.isCubicBezierCurve=!0;var Qc=class extends Qn{constructor(t=new I,e=new I,i=new I,n=new I){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new I){let i=e,n=this.v0,r=this.v1,s=this.v2,a=this.v3;return i.set(Kc(t,n.x,r.x,s.x,a.x),Kc(t,n.y,r.y,s.y,a.y),Kc(t,n.z,r.z,s.z,a.z)),i}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(){let 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}};h(Qc,"CubicBezierCurve3"),Qc.prototype.isCubicBezierCurve3=!0;var Ba=class extends Qn{constructor(t=new de,e=new de){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new de){let i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){let i=e||new de;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let 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}};h(Ba,"LineCurve"),Ba.prototype.isLineCurve=!0;var Pp=class extends Qn{constructor(t=new I,e=new I){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=t,this.v2=e}getPoint(t,e=new I){let i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let 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}};h(Pp,"LineCurve3");var vl=class extends Qn{constructor(t=new de,e=new de,i=new de){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new de){let i=e,n=this.v0,r=this.v1,s=this.v2;return i.set($c(t,n.x,r.x,s.x),$c(t,n.y,r.y,s.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let 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}};h(vl,"QuadraticBezierCurve"),vl.prototype.isQuadraticBezierCurve=!0;var xl=class extends Qn{constructor(t=new I,e=new I,i=new I){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new I){let i=e,n=this.v0,r=this.v1,s=this.v2;return i.set($c(t,n.x,r.x,s.x),$c(t,n.y,r.y,s.y),$c(t,n.z,r.z,s.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let 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}};h(xl,"QuadraticBezierCurve3"),xl.prototype.isQuadraticBezierCurve3=!0;var _l=class extends Qn{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new de){let i=e,n=this.points,r=(n.length-1)*t,s=Math.floor(r),a=r-s,o=n[0===s?s:s-1],l=n[s],h=n[s>n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return i.set(Hv(a,o.x,l.x,h.x,u.x),Hv(a,o.y,l.y,h.y,u.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push(i.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){let i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){let i=t.points[e];this.points.push((new de).fromArray(i))}return this}};h(_l,"SplineCurve"),_l.prototype.isSplineCurve=!0;var Xg=Object.freeze({__proto__:null,ArcCurve:Jc,CatmullRomCurve3:Da,CubicBezierCurve:yl,CubicBezierCurve3:Qc,EllipseCurve:ka,LineCurve:Ba,LineCurve3:Pp,QuadraticBezierCurve:vl,QuadraticBezierCurve3:xl,SplineCurve:_l}),Cp=class extends Qn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Ba(e,t))}getPoint(t,e){let i=t*this.getLength(),n=this.getCurveLengths(),r=0;for(;r<n.length;){if(n[r]>=i){let t=n[r]-i,s=this.curves[r],a=s.getLength(),o=0===a?0:1-t/a;return s.getPointAt(o,e)}r++}return null}getLength(){let 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;let t=[],e=0;for(let i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){let e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){let e,i=[];for(let n=0,r=this.curves;n<r.length;n++){let s=r[n],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++){let n=o[t];e&&e.equals(n)||(i.push(n),e=n)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){let i=this.curves[e];t.curves.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){let i=t.curves[e];this.curves.push((new Xg[i.type]).fromJSON(i))}return this}};h(Cp,"CurvePath");var Qr=class extends Cp{constructor(t){super(),this.type="Path",this.currentPoint=new de,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){let i=new Ba(this.currentPoint.clone(),new de(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,n){let r=new vl(this.currentPoint.clone(),new de(t,e),new de(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this}bezierCurveTo(t,e,i,n,r,s){let a=new yl(this.currentPoint.clone(),new de(t,e),new de(i,n),new de(r,s));return this.curves.push(a),this.currentPoint.set(r,s),this}splineThru(t){let e=[this.currentPoint.clone()].concat(t),i=new _l(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,n,r,s){let a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(t+a,e+o,i,n,r,s),this}absarc(t,e,i,n,r,s){return this.absellipse(t,e,i,i,n,r,s),this}ellipse(t,e,i,n,r,s,a,o){let l=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(t+l,e+h,i,n,r,s,a,o),this}absellipse(t,e,i,n,r,s,a,o){let l=new ka(t,e,i,n,r,s,a,o);if(this.curves.length>0){let t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);let h=l.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};h(Qr,"Path");var Gn=class extends Qr{constructor(t){super(t),this.uuid=Wi(),this.type="Shape",this.holes=[]}getPointsHoles(t){let e=[];for(let i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].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,i=t.holes.length;e<i;e++){let i=t.holes[e];this.holes.push(i.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){let i=this.holes[e];t.holes.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){let i=t.holes[e];this.holes.push((new Qr).fromJSON(i))}return this}};h(Gn,"Shape");var yE={triangulate:function(t,e,i=2){let n,r,s,a,o,l,h,u=e&&e.length,c=u?e[0]*i:t.length,d=bx(t,0,c,i,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=ME(t,e,d,i)),t.length>80*i){n=s=t[0],r=a=t[1];for(let e=i;e<c;e+=i)o=t[e],l=t[e+1],o<n&&(n=o),l<r&&(r=l),o>s&&(s=o),l>a&&(a=l);h=Math.max(s-n,a-r),h=0!==h?1/h:0}return bu(d,p,i,n,r,h),p}};function bx(t,e,i,n,r){let s,a;if(r===OE(t,e,i,n)>0)for(s=e;s<i;s+=n)a=Gv(s,t[s],t[s+1],a);else for(s=i-n;s>=e;s-=n)a=Gv(s,t[s],t[s+1],a);return a&&ff(a,a.next)&&(wu(a),a=a.next),a}function Zs(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!ff(n,n.next)&&0!==Yt(n.prev,n,n.next))n=n.next;else{if(wu(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function bu(t,e,i,n,r,s,a){if(!t)return;!a&&s&&AE(t,n,r,s);let o,l,h=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?xE(t,n,r,s):vE(t))e.push(o.i/i),e.push(t.i/i),e.push(l.i/i),wu(t),t=l.next,h=l.next;else if((t=l)===h){a?1===a?bu(t=_E(Zs(t),e,i),e,i,n,r,s,2):2===a&&bE(t,e,i,n,r,s):bu(Zs(t),e,i,n,r,s,1);break}}function vE(t){let e=t.prev,i=t,n=t.next;if(Yt(e,i,n)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(el(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Yt(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function xE(t,e,i,n){let r=t.prev,s=t,a=t.next;if(Yt(r,s,a)>=0)return!1;let o=r.x<s.x?r.x<a.x?r.x:a.x:s.x<a.x?s.x:a.x,l=r.y<s.y?r.y<a.y?r.y:a.y:s.y<a.y?s.y:a.y,h=r.x>s.x?r.x>a.x?r.x:a.x:s.x>a.x?s.x:a.x,u=r.y>s.y?r.y>a.y?r.y:a.y:s.y>a.y?s.y:a.y,c=Bg(o,l,e,i,n),d=Bg(h,u,e,i,n),p=t.prevZ,m=t.nextZ;for(;p&&p.z>=c&&m&&m.z<=d;){if(p!==t.prev&&p!==t.next&&el(r.x,r.y,s.x,s.y,a.x,a.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0||(p=p.prevZ,m!==t.prev&&m!==t.next&&el(r.x,r.y,s.x,s.y,a.x,a.y,m.x,m.y)&&Yt(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&el(r.x,r.y,s.x,s.y,a.x,a.y,p.x,p.y)&&Yt(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==t.prev&&m!==t.next&&el(r.x,r.y,s.x,s.y,a.x,a.y,m.x,m.y)&&Yt(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function _E(t,e,i){let n=t;do{let r=n.prev,s=n.next.next;!ff(r,s)&&Mx(r,n,n.next,s)&&Mu(r,s)&&Mu(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),wu(n),wu(n.next),n=t=s),n=n.next}while(n!==t);return Zs(n)}function bE(t,e,i,n,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&CE(a,t)){let o=wx(a,t);return a=Zs(a,a.next),o=Zs(o,o.next),bu(a,e,i,n,r,s),void bu(o,e,i,n,r,s)}t=t.next}a=a.next}while(a!==t)}function ME(t,e,i,n){let r,s,a,o,l,h=[];for(r=0,s=e.length;r<s;r++)a=e[r]*n,o=r<s-1?e[r+1]*n:t.length,l=bx(t,a,o,n,!1),l===l.next&&(l.steiner=!0),h.push(PE(l));for(h.sort(wE),r=0;r<h.length;r++)TE(h[r],i),i=Zs(i,i.next);return i}function wE(t,e){return t.x-e.x}function TE(t,e){if(e=EE(t,e)){let i=wx(e,t);Zs(e,e.next),Zs(i,i.next)}}function EE(t,e){let i,n=e,r=t.x,s=t.y,a=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){let t=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>a){if(a=t,t===r){if(s===n.y)return n;if(s===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===a)return i;let o,l=i,h=i.x,u=i.y,c=1/0;n=i;do{r>=n.x&&n.x>=h&&r!==n.x&&el(s<u?r:a,s,h,u,s<u?a:r,s,n.x,n.y)&&(o=Math.abs(s-n.y)/(r-n.x),Mu(n,t)&&(o<c||o===c&&(n.x>i.x||n.x===i.x&&SE(i,n)))&&(i=n,c=o)),n=n.next}while(n!==l);return i}function SE(t,e){return Yt(t.prev,t,e.prev)<0&&Yt(e.next,t,t.next)<0}function AE(t,e,i,n){let r=t;do{null===r.z&&(r.z=Bg(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,qE(r)}function qE(t){let e,i,n,r,s,a,o,l,h=1;do{for(i=t,t=null,s=null,a=0;i;){for(a++,n=i,o=0,e=0;e<h&&(o++,n=n.nextZ,n);e++);for(l=h;o>0||l>0&&n;)0!==o&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,o--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,h*=2}while(a>1);return t}function Bg(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function PE(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function el(t,e,i,n,r,s,a,o){return(r-a)*(e-o)-(t-a)*(s-o)>=0&&(t-a)*(n-o)-(i-a)*(e-o)>=0&&(i-a)*(s-o)-(r-a)*(n-o)>=0}function CE(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!IE(t,e)&&(Mu(t,e)&&Mu(e,t)&&LE(t,e)&&(Yt(t.prev,t,e.prev)||Yt(t,e.prev,e))||ff(t,e)&&Yt(t.prev,t,t.next)>0&&Yt(e.prev,e,e.next)>0)}function Yt(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function ff(t,e){return t.x===e.x&&t.y===e.y}function Mx(t,e,i,n){let r=cp(Yt(t,e,i)),s=cp(Yt(t,e,n)),a=cp(Yt(i,n,t)),o=cp(Yt(i,n,e));return!!(r!==s&&a!==o||0===r&&lp(t,i,e)||0===s&&lp(t,n,e)||0===a&&lp(i,t,n)||0===o&&lp(i,e,n))}function lp(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function cp(t){return t>0?1:t<0?-1:0}function IE(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Mx(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function Mu(t,e){return Yt(t.prev,t,t.next)<0?Yt(t,e,t.next)>=0&&Yt(t,t.prev,e)>=0:Yt(t,e,t.prev)<0||Yt(t,t.next,e)<0}function LE(t,e){let i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}function wx(t,e){let i=new Fg(t.i,t.x,t.y),n=new Fg(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function Gv(t,e,i,n){let r=new Fg(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function wu(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 Fg(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function OE(t,e,i,n){let r=0;for(let s=e,a=i-n;s<i;s+=n)r+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return r}h(bx,"linkedList"),h(Zs,"filterPoints"),h(bu,"earcutLinked"),h(vE,"isEar"),h(xE,"isEarHashed"),h(_E,"cureLocalIntersections"),h(bE,"splitEarcut"),h(ME,"eliminateHoles"),h(wE,"compareX"),h(TE,"eliminateHole"),h(EE,"findHoleBridge"),h(SE,"sectorContainsSector"),h(AE,"indexCurve"),h(qE,"sortLinked"),h(Bg,"zOrder"),h(PE,"getLeftmost"),h(el,"pointInTriangle"),h(CE,"isValidDiagonal"),h(Yt,"area"),h(ff,"equals"),h(Mx,"intersects"),h(lp,"onSegment"),h(cp,"sign"),h(IE,"intersectsPolygon"),h(Mu,"locallyInside"),h(LE,"middleInside"),h(wx,"splitPolygon"),h(Gv,"insertNode"),h(wu,"removeNode"),h(Fg,"Node"),h(OE,"signedArea");var qi=class{static area(t){let e=t.length,i=0;for(let n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i}static isClockWise(t){return qi.area(t)<0}static triangulateShape(t,e){let i=[],n=[],r=[];jv(t),Wv(i,t);let s=t.length;e.forEach(jv);for(let t=0;t<e.length;t++)n.push(s),s+=e[t].length,Wv(i,e[t]);let a=yE.triangulate(i,n);for(let t=0;t<a.length;t+=3)r.push(a.slice(t,t+3));return r}};function jv(t){let e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Wv(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}h(qi,"ShapeUtils"),h(jv,"removeDupEndPts"),h(Wv,"addContour");var jn=class extends wt{constructor(t=new Gn([new de(.5,.5),new de(-.5,.5),new de(-.5,-.5),new de(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];let i=this,n=[],r=[];for(let e=0,i=t.length;e<i;e++){s(t[e])}function s(t){let 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,u=void 0===e.bevelEnabled||e.bevelEnabled,c=void 0!==e.bevelThickness?e.bevelThickness:.2,d=void 0!==e.bevelSize?e.bevelSize:c-.1,p=void 0!==e.bevelOffset?e.bevelOffset:0,m=void 0!==e.bevelSegments?e.bevelSegments:3,f=e.extrudePath,g=void 0!==e.UVGenerator?e.UVGenerator:RE;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=e.amount);let v,y,_,x,b,w=!1;f&&(v=f.getSpacedPoints(o),w=!0,u=!1,y=f.computeFrenetFrames(o,!1),_=new I,x=new I,b=new I),u||(m=0,c=0,d=0,p=0);let M=t.extractPoints(a),E=M.shape,T=M.holes;if(!qi.isClockWise(E)){E=E.reverse();for(let t=0,e=T.length;t<e;t++){let e=T[t];qi.isClockWise(e)&&(T[t]=e.reverse())}}let S=qi.triangulateShape(E,T),q=E;for(let t=0,e=T.length;t<e;t++){let e=T[t];E=E.concat(e)}function P(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}h(P,"scalePt2");let A=E.length,C=S.length;function L(t,e,i){let n,r,s,a=t.x-e.x,o=t.y-e.y,l=i.x-t.x,h=i.y-t.y,u=a*a+o*o,c=a*h-o*l;if(Math.abs(c)>Number.EPSILON){let c=Math.sqrt(u),d=Math.sqrt(l*l+h*h),p=e.x-o/c,m=e.y+a/c,f=((i.x-h/d-p)*h-(i.y+l/d-m)*l)/(a*h-o*l);n=p+a*f-t.x,r=m+o*f-t.y;let g=n*n+r*r;if(g<=2)return new de(n,r);s=Math.sqrt(g/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(h)&&(t=!0),t?(n=-o,r=a,s=Math.sqrt(u)):(n=a,r=o,s=Math.sqrt(u/2))}return new de(n/s,r/s)}h(L,"getBevelVec");let R=[];for(let t=0,e=q.length,i=e-1,n=t+1;t<e;t++,i++,n++)i===e&&(i=0),n===e&&(n=0),R[t]=L(q[t],q[i],q[n]);let N,O=[],D=R.concat();for(let t=0,e=T.length;t<e;t++){let e=T[t];N=[];for(let t=0,i=e.length,n=i-1,r=t+1;t<i;t++,n++,r++)n===i&&(n=0),r===i&&(r=0),N[t]=L(e[t],e[n],e[r]);O.push(N),D=D.concat(N)}for(let t=0;t<m;t++){let e=t/m,i=c*Math.cos(e*Math.PI/2),n=d*Math.sin(e*Math.PI/2)+p;for(let t=0,e=q.length;t<e;t++){let e=P(q[t],R[t],n);U(e.x,e.y,-i)}for(let t=0,e=T.length;t<e;t++){let e=T[t];N=O[t];for(let t=0,r=e.length;t<r;t++){let r=P(e[t],N[t],n);U(r.x,r.y,-i)}}}let B=d+p;for(let t=0;t<A;t++){let e=u?P(E[t],D[t],B):E[t];w?(x.copy(y.normals[0]).multiplyScalar(e.x),_.copy(y.binormals[0]).multiplyScalar(e.y),b.copy(v[0]).add(x).add(_),U(b.x,b.y,b.z)):U(e.x,e.y,0)}for(let t=1;t<=o;t++)for(let e=0;e<A;e++){let i=u?P(E[e],D[e],B):E[e];w?(x.copy(y.normals[t]).multiplyScalar(i.x),_.copy(y.binormals[t]).multiplyScalar(i.y),b.copy(v[t]).add(x).add(_),U(b.x,b.y,b.z)):U(i.x,i.y,l/o*t)}for(let t=m-1;t>=0;t--){let e=t/m,i=c*Math.cos(e*Math.PI/2),n=d*Math.sin(e*Math.PI/2)+p;for(let t=0,e=q.length;t<e;t++){let e=P(q[t],R[t],n);U(e.x,e.y,l+i)}for(let t=0,e=T.length;t<e;t++){let e=T[t];N=O[t];for(let t=0,r=e.length;t<r;t++){let r=P(e[t],N[t],n);w?U(r.x,r.y+v[o-1].y,v[o-1].x+i):U(r.x,r.y,l+i)}}}function k(){let t=n.length/3;if(u){let t=0,e=A*t;for(let t=0;t<C;t++){let i=S[t];H(i[2]+e,i[1]+e,i[0]+e)}t=o+2*m,e=A*t;for(let t=0;t<C;t++){let i=S[t];H(i[0]+e,i[1]+e,i[2]+e)}}else{for(let t=0;t<C;t++){let e=S[t];H(e[2],e[1],e[0])}for(let t=0;t<C;t++){let e=S[t];H(e[0]+A*o,e[1]+A*o,e[2]+A*o)}}i.addGroup(t,n.length/3-t,0)}function F(){let t=n.length/3,e=0;z(q,e),e+=q.length;for(let t=0,i=T.length;t<i;t++){let i=T[t];z(i,e),e+=i.length}i.addGroup(t,n.length/3-t,1)}function z(t,e){let i=t.length;for(;--i>=0;){let n=i,r=i-1;r<0&&(r=t.length-1);for(let t=0,i=o+2*m;t<i;t++){let i=A*t,s=A*(t+1);V(e+n+i,e+r+i,e+r+s,e+n+s)}}}function U(t,e,i){s.push(t),s.push(e),s.push(i)}function H(t,e,r){G(t),G(e),G(r);let s=n.length/3,a=g.generateTopUV(i,n,s-3,s-2,s-1);W(a[0]),W(a[1]),W(a[2])}function V(t,e,r,s){G(t),G(e),G(s),G(e),G(r),G(s);let a=n.length/3,o=g.generateSideWallUV(i,n,a-6,a-3,a-2,a-1);W(o[0]),W(o[1]),W(o[3]),W(o[1]),W(o[2]),W(o[3])}function G(t){n.push(s[3*t+0]),n.push(s[3*t+1]),n.push(s[3*t+2])}function W(t){r.push(t.x),r.push(t.y)}k(),F(),h(k,"buildLidFaces"),h(F,"buildSideFaces"),h(z,"sidewalls"),h(U,"v"),h(H,"f3"),h(V,"f4"),h(G,"addVertex"),h(W,"addUV")}this.setAttribute("position",new It(n,3)),this.setAttribute("uv",new It(r,2)),this.computeVertexNormals(),h(s,"addShape")}toJSON(){let t=super.toJSON();return NE(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){let i=[];for(let n=0,r=t.shapes.length;n<r;n++){let r=e[t.shapes[n]];i.push(r)}let n=t.options.extrudePath;return void 0!==n&&(t.options.extrudePath=(new Xg[n.type]).fromJSON(n)),new jn(i,t.options)}};h(jn,"ExtrudeGeometry");var RE={generateTopUV:function(t,e,i,n,r){let s=e[3*i],a=e[3*i+1],o=e[3*n],l=e[3*n+1],h=e[3*r],u=e[3*r+1];return[new de(s,a),new de(o,l),new de(h,u)]},generateSideWallUV:function(t,e,i,n,r,s){let a=e[3*i],o=e[3*i+1],l=e[3*i+2],h=e[3*n],u=e[3*n+1],c=e[3*n+2],d=e[3*r],p=e[3*r+1],m=e[3*r+2],f=e[3*s],g=e[3*s+1],v=e[3*s+2];return Math.abs(o-u)<Math.abs(a-h)?[new de(a,1-l),new de(h,1-c),new de(d,1-m),new de(f,1-v)]:[new de(o,1-l),new de(u,1-c),new de(p,1-m),new de(g,1-v)]}};function NE(t,e,i){if(i.shapes=[],Array.isArray(t))for(let e=0,n=t.length;e<n;e++){let n=t[e];i.shapes.push(n.uuid)}else i.shapes.push(t.uuid);return void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}h(NE,"toJSON$1");var bl=class extends wt{constructor(t=new Gn([new de(0,.5),new de(-.5,-.5),new de(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};let i=[],n=[],r=[],s=[],a=0,o=0;if(!1===Array.isArray(t))l(t);else for(let e=0;e<t.length;e++)l(t[e]),this.addGroup(a,o,e),a+=o,o=0;function l(t){let a=n.length/3,l=t.extractPoints(e),h=l.shape,u=l.holes;!1===qi.isClockWise(h)&&(h=h.reverse());for(let t=0,e=u.length;t<e;t++){let e=u[t];!0===qi.isClockWise(e)&&(u[t]=e.reverse())}let c=qi.triangulateShape(h,u);for(let t=0,e=u.length;t<e;t++){let e=u[t];h=h.concat(e)}for(let t=0,e=h.length;t<e;t++){let e=h[t];n.push(e.x,e.y,0),r.push(0,0,1),s.push(e.x,e.y)}for(let t=0,e=c.length;t<e;t++){let e=c[t],n=e[0]+a,r=e[1]+a,s=e[2]+a;i.push(n,r,s),o+=3}}this.setIndex(i),this.setAttribute("position",new It(n,3)),this.setAttribute("normal",new It(r,3)),this.setAttribute("uv",new It(s,2)),h(l,"addShape")}toJSON(){let t=super.toJSON();return kE(this.parameters.shapes,t)}static fromJSON(t,e){let i=[];for(let n=0,r=t.shapes.length;n<r;n++){let r=e[t.shapes[n]];i.push(r)}return new bl(i,t.curveSegments)}};function kE(t,e){if(e.shapes=[],Array.isArray(t))for(let i=0,n=t.length;i<n;i++){let n=t[i];e.shapes.push(n.uuid)}else e.shapes.push(t.uuid);return e}h(bl,"ShapeGeometry"),h(kE,"toJSON");var Fa=class extends wt{constructor(t=new xl(new I(-1,-1,0),new I(-1,1,0),new I(1,1,0)),e=64,i=1,n=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r};let s=t.computeFrenetFrames(e,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;let a=new I,o=new I,l=new de,u=new I,c=[],d=[],p=[],m=[];function f(){for(let t=0;t<e;t++)g(t);g(!1===r?e:0),y(),v()}function g(r){u=t.getPointAt(r/e,u);let l=s.normals[r],h=s.binormals[r];for(let t=0;t<=n;t++){let e=t/n*Math.PI*2,r=Math.sin(e),s=-Math.cos(e);o.x=s*l.x+r*h.x,o.y=s*l.y+r*h.y,o.z=s*l.z+r*h.z,o.normalize(),d.push(o.x,o.y,o.z),a.x=u.x+i*o.x,a.y=u.y+i*o.y,a.z=u.z+i*o.z,c.push(a.x,a.y,a.z)}}function v(){for(let t=1;t<=e;t++)for(let e=1;e<=n;e++){let i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),s=(n+1)*t+e,a=(n+1)*(t-1)+e;m.push(i,r,a),m.push(r,s,a)}}function y(){for(let t=0;t<=e;t++)for(let i=0;i<=n;i++)l.x=t/e,l.y=i/n,p.push(l.x,l.y)}f(),this.setIndex(m),this.setAttribute("position",new It(c,3)),this.setAttribute("normal",new It(d,3)),this.setAttribute("uv",new It(p,2)),h(f,"generateBufferData"),h(g,"generateSegment"),h(v,"generateIndices"),h(y,"generateUVs")}toJSON(){let t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Fa((new Xg[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}};h(Fa,"TubeGeometry");var eu=class extends nn{constructor(t){super(),this.type="ShadowMaterial",this.color=new Ee(0),this.transparent=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this}};h(eu,"ShadowMaterial"),eu.prototype.isShadowMaterial=!0;var za=class extends pn{constructor(t){super(t),this.type="RawShaderMaterial"}};h(za,"RawShaderMaterial"),za.prototype.isRawShaderMaterial=!0;var Ml=class extends nn{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ee(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 Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Rl,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,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.envMapIntensity=t.envMapIntensity,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}};h(Ml,"MeshStandardMaterial"),Ml.prototype.isMeshStandardMaterial=!0;var tu=class extends Ml{constructor(t){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new de(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ai(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new Ee(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Ee(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ee(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(t)}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=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.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.ior=t.ior,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}};h(tu,"MeshPhysicalMaterial"),tu.prototype.isMeshPhysicalMaterial=!0;var nu=class extends nn{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new Ee(16777215),this.specular=new Ee(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Rl,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=uf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,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.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}};h(nu,"MeshPhongMaterial"),nu.prototype.isMeshPhongMaterial=!0;var iu=class extends nn{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ee(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Rl,this.normalScale=new de(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.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}};h(iu,"MeshToonMaterial"),iu.prototype.isMeshToonMaterial=!0;var ru=class extends nn{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Rl,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!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}};h(ru,"MeshNormalMaterial"),ru.prototype.isMeshNormalMaterial=!0;var yi=class extends nn{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new Ee(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=uf,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",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.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,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}};h(yi,"MeshLambertMaterial"),yi.prototype.isMeshLambertMaterial=!0;var su=class extends nn{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ee(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Rl,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,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}};h(su,"MeshMatcapMaterial"),su.prototype.isMeshMatcapMaterial=!0;var au=class extends Xi{constructor(t){super(),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}};h(au,"LineDashedMaterial"),au.prototype.isLineDashedMaterial=!0;var DE={ShadowMaterial:eu,SpriteMaterial:fl,RawShaderMaterial:za,ShaderMaterial:pn,PointsMaterial:gl,MeshPhysicalMaterial:tu,MeshStandardMaterial:Ml,MeshPhongMaterial:nu,MeshToonMaterial:iu,MeshNormalMaterial:ru,MeshLambertMaterial:yi,MeshDepthMaterial:cl,MeshDistanceMaterial:ul,MeshBasicMaterial:Hn,MeshMatcapMaterial:su,LineDashedMaterial:au,LineBasicMaterial:Xi,Material:nn};nn.fromType=function(t){return new DE[t]};var jt={arraySlice:function(t,e,i){return jt.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,i){return t[e]-t[i]}h(e,"compareTime");let i=t.length,n=new Array(i);for(let t=0;t!==i;++t)n[t]=t;return n.sort(e),n},sortedArray:function(t,e,i){let n=t.length,r=new t.constructor(n);for(let s=0,a=0;a!==n;++s){let n=i[s]*e;for(let i=0;i!==e;++i)r[a++]=t[n+i]}return r},flattenJSON:function(t,e,i,n){let r=1,s=t[0];for(;void 0!==s&&void 0===s[n];)s=t[r++];if(void 0===s)return;let a=s[n];if(void 0!==a)if(Array.isArray(a))do{a=s[n],void 0!==a&&(e.push(s.time),i.push.apply(i,a)),s=t[r++]}while(void 0!==s);else if(void 0!==a.toArray)do{a=s[n],void 0!==a&&(e.push(s.time),a.toArray(i,i.length)),s=t[r++]}while(void 0!==s);else do{a=s[n],void 0!==a&&(e.push(s.time),i.push(a)),s=t[r++]}while(void 0!==s)},subclip:function(t,e,i,n,r=30){let s=t.clone();s.name=e;let a=[];for(let t=0;t<s.tracks.length;++t){let e=s.tracks[t],o=e.getValueSize(),l=[],h=[];for(let t=0;t<e.times.length;++t){let s=e.times[t]*r;if(!(s<i||s>=n)){l.push(e.times[t]);for(let i=0;i<o;++i)h.push(e.values[t*o+i])}}0!==l.length&&(e.times=jt.convertArray(l,e.times.constructor),e.values=jt.convertArray(h,e.values.constructor),a.push(e))}s.tracks=a;let o=1/0;for(let t=0;t<s.tracks.length;++t)o>s.tracks[t].times[0]&&(o=s.tracks[t].times[0]);for(let t=0;t<s.tracks.length;++t)s.tracks[t].shift(-1*o);return s.resetDuration(),s},makeClipAdditive:function(t,e=0,i=t,n=30){n<=0&&(n=30);let r=i.tracks.length,s=e/n;for(let e=0;e<r;++e){let n=i.tracks[e],r=n.ValueTypeName;if("bool"===r||"string"===r)continue;let a=t.tracks.find((function(t){return t.name===n.name&&t.ValueTypeName===r}));if(void 0===a)continue;let o=0,l=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(o=l/3);let h=0,u=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=u/3);let c,d=n.times.length-1;if(s<=n.times[0]){let t=o,e=l-o;c=jt.arraySlice(n.values,t,e)}else if(s>=n.times[d]){let t=d*l+o,e=t+l-o;c=jt.arraySlice(n.values,t,e)}else{let t=n.createInterpolant(),e=o,i=l-o;t.evaluate(s),c=jt.arraySlice(t.resultBuffer,e,i)}"quaternion"===r&&(new Ln).fromArray(c).normalize().conjugate().toArray(c);let p=a.times.length;for(let t=0;t<p;++t){let e=t*u+h;if("quaternion"===r)Ln.multiplyQuaternionsFlat(a.values,e,c,0,a.values,e);else{let t=u-2*h;for(let i=0;i<t;++i)a.values[e+i]-=c[i]}}}return t.blendMode=sx,t}},Yi=class{constructor(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{let s;i:{n:if(!(t<n)){for(let s=i+2;;){if(void 0===n){if(t<r)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,r)}if(i===s)break;if(r=n,n=e[++i],t<n)break e}s=e.length;break i}if(t>=r)break t;{let a=e[1];t<a&&(i=2,r=a);for(let s=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===s)break;if(n=r,r=e[--i-1],t>=r)break e}s=i,i=0}}for(;i<s;){let n=i+s>>>1;t<e[n]?s=n:i=n+1}if(n=e[i],r=e[i-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,r,t)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n;for(let t=0;t!==n;++t)e[t]=i[r+t];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}};h(Yi,"Interpolant"),Yi.prototype.beforeStart_=Yi.prototype.copySampleValue_,Yi.prototype.afterEnd_=Yi.prototype.copySampleValue_;var Ip=class extends Yi{constructor(t,e,i,n){super(t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:$o,endingEnd:$o}}intervalChanged_(t,e,i){let n=this.parameterPositions,r=t-2,s=t+1,a=n[r],o=n[s];if(void 0===a)switch(this.getSettings_().endingStart){case Ko:r=t,a=2*e-i;break;case of:r=n.length-2,a=e+n[r]-n[r+1];break;default:r=t,a=i}if(void 0===o)switch(this.getSettings_().endingEnd){case Ko:s=t,o=2*i-e;break;case of:s=1,o=i+n[1]-n[0];break;default:s=t-1,o=e}let l=.5*(i-e),h=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(o-i),this._offsetPrev=r*h,this._offsetNext=s*h}interpolate_(t,e,i,n){let r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=t*a,l=o-a,h=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),m=p*p,f=m*p,g=-c*f+2*c*m-c*p,v=(1+c)*f+(-1.5-2*c)*m+(-.5+c)*p+1,y=(-1-d)*f+(1.5+d)*m+.5*p,_=d*f-d*m;for(let t=0;t!==a;++t)r[t]=g*s[h+t]+v*s[l+t]+y*s[o+t]+_*s[u+t];return r}};h(Ip,"CubicInterpolant");var ou=class extends Yi{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){let r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=t*a,l=o-a,h=(i-e)/(n-e),u=1-h;for(let t=0;t!==a;++t)r[t]=s[l+t]*u+s[o+t]*h;return r}};h(ou,"LinearInterpolant");var Lp=class extends Yi{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t){return this.copySampleValue_(t-1)}};h(Lp,"DiscreteInterpolant");var vi=class{constructor(t,e,i,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=jt.convertArray(e,this.TimeBufferType),this.values=jt.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){let e,i=t.constructor;if(i.toJSON!==this.toJSON)e=i.toJSON(t);else{e={name:t.name,times:jt.convertArray(t.times,Array),values:jt.convertArray(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}InterpolantFactoryMethodDiscrete(t){return new Lp(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new ou(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Ip(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case sf:e=this.InterpolantFactoryMethodDiscrete;break;case af:e=this.InterpolantFactoryMethodLinear;break;case Y1:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){let e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return sf;case this.InterpolantFactoryMethodLinear:return af;case this.InterpolantFactoryMethodSmooth:return Y1}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){let e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this}scale(t){if(1!==t){let e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this}trim(t,e){let i=this.times,n=i.length,r=0,s=n-1;for(;r!==n&&i[r]<t;)++r;for(;-1!==s&&i[s]>e;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);let t=this.getValueSize();this.times=jt.arraySlice(i,r,s),this.values=jt.arraySlice(this.values,r*t,s*t)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){let n=i[e];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==n&&jt.isTypedArray(n))for(let e=0,i=n.length;e!==i;++e){let i=n[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){let t=jt.arraySlice(this.times),e=jt.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===Y1,r=t.length-1,s=1;for(let a=1;a<r;++a){let r=!1,o=t[a];if(o!==t[a+1]&&(1!==a||o!==t[0]))if(n)r=!0;else{let t=a*i,n=t-i,s=t+i;for(let a=0;a!==i;++a){let i=e[t+a];if(i!==e[n+a]||i!==e[s+a]){r=!0;break}}}if(r){if(a!==s){t[s]=t[a];let n=a*i,r=s*i;for(let t=0;t!==i;++t)e[r+t]=e[n+t]}++s}}if(r>0){t[s]=t[r];for(let t=r*i,n=s*i,a=0;a!==i;++a)e[n+a]=e[t+a];++s}return s!==t.length?(this.times=jt.arraySlice(t,0,s),this.values=jt.arraySlice(e,0,s*i)):(this.times=t,this.values=e),this}clone(){let t=jt.arraySlice(this.times,0),e=jt.arraySlice(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};h(vi,"KeyframeTrack"),vi.prototype.TimeBufferType=Float32Array,vi.prototype.ValueBufferType=Float32Array,vi.prototype.DefaultInterpolation=af;var es=class extends vi{};h(es,"BooleanKeyframeTrack"),es.prototype.ValueTypeName="bool",es.prototype.ValueBufferType=Array,es.prototype.DefaultInterpolation=sf,es.prototype.InterpolantFactoryMethodLinear=void 0,es.prototype.InterpolantFactoryMethodSmooth=void 0;var lu=class extends vi{};h(lu,"ColorKeyframeTrack"),lu.prototype.ValueTypeName="color";var Ua=class extends vi{};h(Ua,"NumberKeyframeTrack"),Ua.prototype.ValueTypeName="number";var Op=class extends Yi{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){let r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(i-e)/(n-e),l=t*a;for(let t=l+a;l!==t;l+=4)Ln.slerpFlat(r,0,s,l-a,s,l,o);return r}};h(Op,"QuaternionLinearInterpolant");var js=class extends vi{InterpolantFactoryMethodLinear(t){return new Op(this.times,this.values,this.getValueSize(),t)}};h(js,"QuaternionKeyframeTrack"),js.prototype.ValueTypeName="quaternion",js.prototype.DefaultInterpolation=af,js.prototype.InterpolantFactoryMethodSmooth=void 0;var ts=class extends vi{};h(ts,"StringKeyframeTrack"),ts.prototype.ValueTypeName="string",ts.prototype.ValueBufferType=Array,ts.prototype.DefaultInterpolation=sf,ts.prototype.InterpolantFactoryMethodLinear=void 0,ts.prototype.InterpolantFactoryMethodSmooth=void 0;var Va=class extends vi{};h(Va,"VectorKeyframeTrack"),Va.prototype.ValueTypeName="vector";var cu=class{constructor(t,e=-1,i,n=Hg){this.name=t,this.tracks=i,this.duration=e,this.blendMode=n,this.uuid=Wi(),this.duration<0&&this.resetDuration()}static parse(t){let e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(FE(i[t]).scale(n));let r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){let e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(vi.toJSON(i[t]));return n}static CreateFromMorphTargetSequence(t,e,i,n){let r=e.length,s=[];for(let t=0;t<r;t++){let a=[],o=[];a.push((t+r-1)%r,t,(t+1)%r),o.push(0,1,0);let l=jt.getKeyframeOrder(a);a=jt.sortedArray(a,1,l),o=jt.sortedArray(o,1,l),!n&&0===a[0]&&(a.push(r),o.push(o[0])),s.push(new Ua(".morphTargetInfluences["+e[t].name+"]",a,o).scale(1/i))}return new this(t,-1,s)}static findByName(t,e){let i=t;if(!Array.isArray(t)){let e=t;i=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null}static CreateClipsFromMorphTargetSequences(t,e,i){let n={},r=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){let i=t[e],s=i.name.match(r);if(s&&s.length>1){let t=s[1],e=n[t];e||(n[t]=e=[]),e.push(i)}}let s=[];for(let t in n)s.push(this.CreateFromMorphTargetSequence(t,n[t],e,i));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=h((function(t,e,i,n,r){if(0!==i.length){let s=[],a=[];jt.flattenJSON(i,s,a,n),0!==s.length&&r.push(new t(e,s,a))}}),"addNonemptyTrack"),n=[],r=t.name||"default",s=t.fps||30,a=t.blendMode,o=t.length||-1,l=t.hierarchy||[];for(let t=0;t<l.length;t++){let r=l[t].keys;if(r&&0!==r.length)if(r[0].morphTargets){let t,e={};for(t=0;t<r.length;t++)if(r[t].morphTargets)for(let i=0;i<r[t].morphTargets.length;i++)e[r[t].morphTargets[i]]=-1;for(let i in e){let e=[],s=[];for(let n=0;n!==r[t].morphTargets.length;++n){let n=r[t];e.push(n.time),s.push(n.morphTarget===i?1:0)}n.push(new Ua(".morphTargetInfluence["+i+"]",e,s))}o=e.length*s}else{let s=".bones["+e[t].name+"]";i(Va,s+".position",r,"pos",n),i(js,s+".quaternion",r,"rot",n),i(Va,s+".scale",r,"scl",n)}}return 0===n.length?null:new this(r,o,n,a)}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){let i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){let t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}};function BE(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ua;case"vector":case"vector2":case"vector3":case"vector4":return Va;case"color":return lu;case"quaternion":return js;case"bool":case"boolean":return es;case"string":return ts}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function FE(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let e=BE(t.type);if(void 0===t.times){let e=[],i=[];jt.flattenJSON(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}h(cu,"AnimationClip"),h(BE,"getTrackTypeForValueTypeName"),h(FE,"parseKeyframeTrack");var Ol={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={}}},Rp=class{constructor(t,e,i){let n,r=this,s=!1,a=0,o=0,l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,!1===s&&void 0!==r.onStart&&r.onStart(t,a,o),s=!0},this.itemEnd=function(t){a++,void 0!==r.onProgress&&r.onProgress(t,a,o),a===o&&(s=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return n?n(t):t},this.setURLModifier=function(t){return n=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){let e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=l.length;e<i;e+=2){let i=l[e],n=l[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}}};h(Rp,"LoadingManager");var zE=new Rp,Pi=class{constructor(t){this.manager=void 0!==t?t:zE,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let i=this;return new Promise((function(n,r){i.load(t,n,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}};h(Pi,"Loader");var Wr={},uu=class extends Pi{constructor(t){super(t)}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let r=Ol.get(t);if(void 0!==r)return this.manager.itemStart(t),setTimeout((()=>{e&&e(r),this.manager.itemEnd(t)}),0),r;if(void 0!==Wr[t])return void Wr[t].push({onLoad:e,onProgress:i,onError:n});Wr[t]=[],Wr[t].push({onLoad:e,onProgress:i,onError:n});let s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;let i=Wr[t],n=e.body.getReader(),r=e.headers.get("Content-Length"),s=r?parseInt(r):0,a=0!==s,o=0,l=new ReadableStream({start(t){function e(){n.read().then((({done:n,value:r})=>{if(n)t.close();else{o+=r.byteLength;let n=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:s});for(let t=0,e=i.length;t<e;t++){let e=i[t];e.onProgress&&e.onProgress(n)}t.enqueue(r),e()}}))}e(),h(e,"readData")}});return new Response(l)}throw Error(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`)})).then((t=>{switch(o){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,a)));case"json":return t.json();default:if(void 0===a)return t.text();{let e=/charset="?([^;"\s]*)"?/i.exec(a),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then((t=>n.decode(t)))}}})).then((e=>{Ol.add(t,e);let i=Wr[t];delete Wr[t];for(let t=0,n=i.length;t<n;t++){let n=i[t];n.onLoad&&n.onLoad(e)}})).catch((e=>{let i=Wr[t];if(void 0===i)throw this.manager.itemError(t),e;delete Wr[t];for(let t=0,n=i.length;t<n;t++){let n=i[t];n.onError&&n.onError(e)}this.manager.itemError(t)})).finally((()=>{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}};h(uu,"FileLoader");var hu=class extends Pi{constructor(t){super(t)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let r=this,s=Ol.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;let a=_u("img");function o(){u(),Ol.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){u(),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}function u(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return h(o,"onImageLoad"),h(l,"onImageError"),h(u,"removeEventListeners"),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}};h(hu,"ImageLoader");var Np=class extends Pi{constructor(t){super(t)}load(t,e,i,n){let r=new Ia,s=new hu(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;function o(i){s.load(t[i],(function(t){r.images[i]=t,a++,6===a&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}h(o,"loadTexture");for(let e=0;e<t.length;++e)o(e);return r}};h(Np,"CubeTextureLoader");var Ci=class extends Pi{constructor(t){super(t)}load(t,e,i,n){let r=new ln,s=new hu(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)}),i,n),r}};h(Ci,"TextureLoader");var xi=class extends rt{constructor(t,e=1){super(),this.type="Light",this.color=new Ee(t),this.intensity=e}dispose(){}copy(t){return super.copy(t),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let 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}};h(xi,"Light"),xi.prototype.isLight=!0;var wl=class extends xi{constructor(t,e,i){super(t,i),this.type="HemisphereLight",this.position.copy(rt.DefaultUp),this.updateMatrix(),this.groundColor=new Ee(e)}copy(t){return xi.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}};h(wl,"HemisphereLight"),wl.prototype.isHemisphereLight=!0;var Xv=new We,Yv=new I,Zv=new I,Tl=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new de(512,512),this.map=null,this.mapPass=null,this.matrix=new We,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new La,this._frameExtents=new de(1,1),this._viewportCount=1,this._viewports=[new Ct(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,i=this.matrix;Yv.setFromMatrixPosition(t.matrixWorld),e.position.copy(Yv),Zv.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Zv),e.updateMatrixWorld(),Xv.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Xv),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(e.projectionMatrix),i.multiply(e.matrixWorldInverse)}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(){let 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}};h(Tl,"LightShadow");var du=class extends Tl{constructor(){super(new vn(50,1,.5,500)),this.focus=1}updateMatrices(t){let e=this.camera,i=2*Rg*t.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;(i!==e.fov||n!==e.aspect||r!==e.far)&&(e.fov=i,e.aspect=n,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}};h(du,"SpotLightShadow"),du.prototype.isSpotLightShadow=!0;var kp=class extends xi{constructor(t,e,i=0,n=Math.PI/3,r=0,s=1){super(t,e),this.type="SpotLight",this.position.copy(rt.DefaultUp),this.updateMatrix(),this.target=new rt,this.distance=i,this.angle=n,this.penumbra=r,this.decay=s,this.shadow=new du}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),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}};h(kp,"SpotLight"),kp.prototype.isSpotLight=!0;var Jv=new We,zc=new I,Ag=new I,pu=class extends Tl{constructor(){super(new vn(90,1,.5,500)),this._frameExtents=new de(4,2),this._viewportCount=6,this._viewports=[new Ct(2,1,1,1),new Ct(0,1,1,1),new Ct(3,1,1,1),new Ct(1,1,1,1),new Ct(3,0,1,1),new Ct(1,0,1,1)],this._cubeDirections=[new I(1,0,0),new I(-1,0,0),new I(0,0,1),new I(0,0,-1),new I(0,1,0),new I(0,-1,0)],this._cubeUps=[new I(0,1,0),new I(0,1,0),new I(0,1,0),new I(0,1,0),new I(0,0,1),new I(0,0,-1)]}updateMatrices(t,e=0){let i=this.camera,n=this.matrix,r=t.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),zc.setFromMatrixPosition(t.matrixWorld),i.position.copy(zc),Ag.copy(i.position),Ag.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(Ag),i.updateMatrixWorld(),n.makeTranslation(-zc.x,-zc.y,-zc.z),Jv.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Jv)}};h(pu,"PointLightShadow"),pu.prototype.isPointLightShadow=!0;var Dp=class extends xi{constructor(t,e,i=0,n=1){super(t,e),this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new pu}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}};h(Dp,"PointLight"),Dp.prototype.isPointLight=!0;var fu=class extends Tl{constructor(){super(new Vs(-5,5,5,-5,.5,500))}};h(fu,"DirectionalLightShadow"),fu.prototype.isDirectionalLightShadow=!0;var El=class extends xi{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(rt.DefaultUp),this.updateMatrix(),this.target=new rt,this.shadow=new fu}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}};h(El,"DirectionalLight"),El.prototype.isDirectionalLight=!0;var Bp=class extends xi{constructor(t,e){super(t,e),this.type="AmbientLight"}};h(Bp,"AmbientLight"),Bp.prototype.isAmbientLight=!0;var Fp=class extends xi{constructor(t,e,i=10,n=10){super(t,e),this.type="RectAreaLight",this.width=i,this.height=n}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){let e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}};h(Fp,"RectAreaLight"),Fp.prototype.isRectAreaLight=!0;var mu=class{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new I)}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){let i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*n),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*i),e.addScaledVector(s[4],i*n*1.092548),e.addScaledVector(s[5],n*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],i*r*1.092548),e.addScaledVector(s[8],.546274*(i*i-n*n)),e}getIrradianceAt(t,e){let i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*n),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*i),e.addScaledVector(s[4],.858086*i*n),e.addScaledVector(s[5],.858086*n*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*i*r),e.addScaledVector(s[8],.429043*(i*i-n*n)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],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){let i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(t,e+3*n);return this}toArray(t=[],e=0){let i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(t,e+3*n);return t}static getBasisAt(t,e){let i=t.x,n=t.y,r=t.z;e[0]=.282095,e[1]=.488603*n,e[2]=.488603*r,e[3]=.488603*i,e[4]=1.092548*i*n,e[5]=1.092548*n*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*i*r,e[8]=.546274*(i*i-n*n)}};h(mu,"SphericalHarmonics3"),mu.prototype.isSphericalHarmonics3=!0;var Sl=class extends xi{constructor(t=new mu,e=1){super(void 0,e),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){let e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}};h(Sl,"LightProbe"),Sl.prototype.isLightProbe=!0;var zp=class{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let i=0,n=t.length;i<n;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch(t){return e}}static extractUrlBase(t){let e=t.lastIndexOf("/");return-1===e?"./":t.slice(0,e+1)}static resolveURL(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}};h(zp,"LoaderUtils");var Al=class extends wt{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){let t=super.toJSON(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}};h(Al,"InstancedBufferGeometry"),Al.prototype.isInstancedBufferGeometry=!0;var Up=class extends Pi{constructor(t){super(t),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);let r=this,s=Ol.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;let a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(t,a).then((function(t){return t.blob()})).then((function(t){return createImageBitmap(t,Object.assign(r.options,{colorSpaceConversion:"none"}))})).then((function(i){Ol.add(t,i),e&&e(i),r.manager.itemEnd(t)})).catch((function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)})),r.manager.itemStart(t)}};h(Up,"ImageBitmapLoader"),Up.prototype.isImageBitmapLoader=!0;var up,UE={getContext:function(){return void 0===up&&(up=new(window.AudioContext||window.webkitAudioContext)),up},setContext:function(t){up=t}},Vp=class extends Pi{constructor(t){super(t)}load(t,e,i,n){let r=this,s=new uu(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(i){try{let t=i.slice(0);UE.getContext().decodeAudioData(t,(function(t){e(t)}))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)}};h(Vp,"AudioLoader");var Hp=class extends Sl{constructor(t,e,i=1){super(void 0,i);let n=(new Ee).set(t),r=(new Ee).set(e),s=new I(n.r,n.g,n.b),a=new I(r.r,r.g,r.b),o=Math.sqrt(Math.PI),l=o*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(a).multiplyScalar(o),this.sh.coefficients[1].copy(s).sub(a).multiplyScalar(l)}};h(Hp,"HemisphereLightProbe"),Hp.prototype.isHemisphereLightProbe=!0;var Gp=class extends Sl{constructor(t,e=1){super(void 0,e);let i=(new Ee).set(t);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}};h(Gp,"AmbientLightProbe"),Gp.prototype.isAmbientLightProbe=!0;var gu=class{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=$v(),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){let e=$v();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}};function $v(){return("undefined"==typeof performance?Date:performance).now()}h(gu,"Clock"),h($v,"now");var jp=class extends rt{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;let e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}};h(jp,"Audio");var Wp=class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0,e=this.getFrequencyData();for(let i=0;i<e.length;i++)t+=e[i];return t/e.length}};h(Wp,"AudioAnalyser");var Xp=class{constructor(t,e,i){let n,r,s;switch(this.binding=t,this.valueSize=i,e){case"quaternion":n=this._slerp,r=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){let i=this.buffer,n=this.valueSize,r=t*n+n,s=this.cumulativeWeight;if(0===s){for(let t=0;t!==n;++t)i[r+t]=i[t];s=e}else{s+=e;let t=e/s;this._mixBufferRegion(i,r,0,t,n)}this.cumulativeWeight=s}accumulateAdditive(t){let e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){let e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){let t=e*this._origIndex;this._mixBufferRegion(i,n,t,1-r,e)}s>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){a.setValue(i,n);break}}saveOriginalState(){let t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,r=n;t!==r;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){let t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,n,r){if(n>=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]}_slerp(t,e,i,n){Ln.slerpFlat(t,e,t,e,t,i,n)}_slerpAdditive(t,e,i,n,r){let s=this._workIndex*r;Ln.multiplyQuaternionsFlat(t,s,t,e,t,i),Ln.slerpFlat(t,e,t,e,t,s,n)}_lerp(t,e,i,n,r){let s=1-n;for(let a=0;a!==r;++a){let r=e+a;t[r]=t[r]*s+t[i+a]*n}}_lerpAdditive(t,e,i,n,r){for(let s=0;s!==r;++s){let r=e+s;t[r]=t[r]+t[i+s]*n}}};h(Xp,"PropertyMixer");var Yg="\\[\\]\\.:\\/",VE=new RegExp("["+Yg+"]","g"),Zg="[^"+Yg+"]",HE="[^"+Yg.replace("\\.","")+"]",GE=/((?:WC+[\/:])*)/.source.replace("WC",Zg),jE=/(WCOD+)?/.source.replace("WCOD",HE),WE=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Zg),XE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Zg),YE=new RegExp("^"+GE+jE+WE+XE+"$"),ZE=["material","materials","bones"],Yp=class{constructor(t,e,i){let n=i||Mt.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}getValue(t,e){this.bind();let i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}setValue(t,e){let i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}};h(Yp,"Composite");var Mt=class{constructor(t,e,i){this.path=e,this.parsedPath=i||Mt.parseTrackName(e),this.node=Mt.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new Mt.Composite(t,e,i):new Mt(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(VE,"")}static parseTrackName(t){let e=YE.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){let t=i.nodeName.substring(n+1);-1!==ZE.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){let i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){let i=h((function(t){for(let n=0;n<t.length;n++){let r=t[n];if(r.name===e||r.uuid===e)return r;let s=i(r.children);if(s)return s}return null}),"searchNodeSubtree"),n=i(t.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)t[e++]=i[n]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,r=e.propertyIndex;if(t||(t=Mt.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let n=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===n){n=e;break}break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==n){if(void 0===t[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[n]}}let s=t[n];if(void 0===s){let i=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+n+" but it wasn't found.",t)}let a=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(o=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};h(Mt,"PropertyBinding"),Mt.Composite=Yp,Mt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Mt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Mt.prototype.GetterByBindingType=[Mt.prototype._getValue_direct,Mt.prototype._getValue_array,Mt.prototype._getValue_arrayElement,Mt.prototype._getValue_toArray],Mt.prototype.SetterByBindingTypeAndVersioning=[[Mt.prototype._setValue_direct,Mt.prototype._setValue_direct_setNeedsUpdate,Mt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Mt.prototype._setValue_array,Mt.prototype._setValue_array_setNeedsUpdate,Mt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Mt.prototype._setValue_arrayElement,Mt.prototype._setValue_arrayElement_setNeedsUpdate,Mt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Mt.prototype._setValue_fromArray,Mt.prototype._setValue_fromArray_setNeedsUpdate,Mt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Zp=class{constructor(){this.uuid=Wi(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let t={};this._indicesByUUID=t;for(let e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}add(){let t,e=this._objects,i=this._indicesByUUID,n=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length,o=e.length,l=this.nCachedObjects_;for(let h=0,u=arguments.length;h!==u;++h){let u=arguments[h],c=u.uuid,d=i[c];if(void 0===d){d=o++,i[c]=d,e.push(u);for(let t=0,e=a;t!==e;++t)s[t].push(new Mt(u,n[t],r[t]))}else if(d<l){t=e[d];let o=--l,h=e[o];i[h.uuid]=d,e[d]=h,i[c]=o,e[o]=u;for(let t=0,e=a;t!==e;++t){let e=s[t],i=e[o],a=e[d];e[d]=i,void 0===a&&(a=new Mt(u,n[t],r[t])),e[o]=a}}else e[d]!==t&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){let t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length,r=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){let a=arguments[s],o=a.uuid,l=e[o];if(void 0!==l&&l>=r){let s=r++,h=t[s];e[h.uuid]=l,t[l]=h,e[o]=s,t[s]=a;for(let t=0,e=n;t!==e;++t){let e=i[t],n=e[s],r=e[l];e[l]=n,e[s]=r}}}this.nCachedObjects_=r}uncache(){let t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length,r=this.nCachedObjects_,s=t.length;for(let a=0,o=arguments.length;a!==o;++a){let o=arguments[a].uuid,l=e[o];if(void 0!==l)if(delete e[o],l<r){let a=--r,o=t[a],h=--s,u=t[h];e[o.uuid]=l,t[l]=o,e[u.uuid]=a,t[a]=u,t.pop();for(let t=0,e=n;t!==e;++t){let e=i[t],n=e[a],r=e[h];e[l]=n,e[a]=r,e.pop()}}else{let r=--s,a=t[r];r>0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0,e=n;t!==e;++t){let e=i[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){let i=this._bindingsIndicesByPath,n=i[t],r=this._bindings;if(void 0!==n)return r[n];let s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,h=this.nCachedObjects_,u=new Array(l);n=r.length,i[t]=n,s.push(t),a.push(e),r.push(u);for(let i=h,n=o.length;i!==n;++i){let n=o[i];u[i]=new Mt(n,t,e)}return u}unsubscribe_(t){let e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){let n=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];e[t[a]]=i,s[i]=o,s.pop(),r[i]=r[a],r.pop(),n[i]=n[a],n.pop()}}};h(Zp,"AnimationObjectGroup"),Zp.prototype.isAnimationObjectGroup=!0;var Jp=class{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;let r=e.tracks,s=r.length,a=new Array(s),o={endingStart:$o,endingEnd:$o};for(let t=0;t!==s;++t){let e=r[t].createInterpolant(null);a[t]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Tw,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){let i=this._clip.duration,n=t._clip.duration,r=n/i,s=i/n;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){let t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){let n=this._mixer,r=n.time,s=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);let o=a.parameterPositions,l=a.sampleValues;return o[0]=r,o[1]=r+i,l[0]=t/s,l[1]=e/s,this}stopWarping(){let t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);let r=this._startTime;if(null!==r){let n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);let s=this._updateTime(e),a=this._updateWeight(t);if(a>0){let t=this._interpolants,e=this._propertyBindings;if(this.blendMode===sx)for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(a);else for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,a)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;let i=this._weightInterpolant;if(null!==i){let n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;let i=this._timeScaleInterpolant;if(null!==i){e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){let e=this._clip.duration,i=this.loop,n=this.time+t,r=this._loopCount,s=i===Ew;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(i===ww){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){let i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);let a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){let e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return e-n}return n}_setEndings(t,e,i){let n=this._interpolantSettings;i?(n.endingStart=Ko,n.endingEnd=Ko):(n.endingStart=t?this.zeroSlopeAtStart?Ko:$o:of,n.endingEnd=e?this.zeroSlopeAtEnd?Ko:$o:of)}_scheduleFading(t,e,i){let n=this._mixer,r=n.time,s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);let a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=i,this}};h(Jp,"AnimationAction");var $p=class extends Ei{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){let i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,s=t._propertyBindings,a=t._interpolants,o=i.uuid,l=this._bindingsByRootAndName,h=l[o];void 0===h&&(h={},l[o]=h);for(let t=0;t!==r;++t){let r=n[t],l=r.name,u=h[l];if(void 0!==u)++u.referenceCount,s[t]=u;else{if(u=s[t],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,o,l));continue}let n=e&&e._propertyBindings[t].binding.parsedPath;u=new Xp(Mt.create(i,l,n),r.ValueTypeName,r.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,o,l),s[t]=u}a[t].resultBuffer=u.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){let e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){let e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,i){let n=this._actions,r=this._actionsByClip,s=r[e];if(void 0===s)s={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=s;else{let e=s.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=n.length,n.push(t),s.actionByRoot[i]=t}_removeInactiveAction(t){let e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;let r=t._clip.uuid,s=this._actionsByClip,a=s[r],o=a.knownActions,l=o[o.length-1],h=t._byClipCacheIndex;l._byClipCacheIndex=h,o[h]=l,o.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===o.length&&delete s[r],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){let e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){let i=e[t];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){let e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_takeBackAction(t){let e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_addInactiveBinding(t,e,i){let n=this._bindingsByRootAndName,r=this._bindings,s=n[e];void 0===s&&(s={},n[e]=s),s[i]=t,t._cacheIndex=r.length,r.push(t)}_removeInactiveBinding(t){let e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,s=this._bindingsByRootAndName,a=s[n],o=e[e.length-1],l=t._cacheIndex;o._cacheIndex=l,e[l]=o,e.pop(),delete a[r],0===Object.keys(a).length&&delete s[n]}_lendBinding(t){let e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_takeBackBinding(t){let e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_lendControlInterpolant(){let t=this._controlInterpolants,e=this._nActiveControlInterpolants++,i=t[e];return void 0===i&&(i=new ou(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){let e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r}clipAction(t,e,i){let n=e||this._root,r=n.uuid,s="string"==typeof t?cu.findByName(n,t):t,a=null!==s?s.uuid:t,o=this._actionsByClip[a],l=null;if(void 0===i&&(i=null!==s?s.blendMode:Hg),void 0!==o){let t=o.actionByRoot[r];if(void 0!==t&&t.blendMode===i)return t;l=o.knownActions[0],null===s&&(s=l._clip)}if(null===s)return null;let h=new Jp(this,s,e,i);return this._bindAction(h,l),this._addInactiveAction(h,a,r),h}existingAction(t,e){let i=e||this._root,n=i.uuid,r="string"==typeof t?cu.findByName(i,t):t,s=r?r.uuid:t,a=this._actionsByClip[s];return void 0!==a&&a.actionByRoot[n]||null}stopAllAction(){let t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;let e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==i;++a)e[a]._update(n,t,r,s);let a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){let e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){let t=r.knownActions;for(let i=0,n=t.length;i!==n;++i){let n=t[i];this._deactivateAction(n);let r=n._cacheIndex,s=e[e.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,s._cacheIndex=r,e[r]=s,e.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(t){let e=t.uuid,i=this._actionsByClip;for(let t in i){let n=i[t].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}let n=this._bindingsByRootAndName[e];if(void 0!==n)for(let t in n){let e=n[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){let i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}};h($p,"AnimationMixer"),$p.prototype._controlInterpolantsResultBuffer=new Float32Array(1);var ql=class{constructor(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}clone(){return new ql(void 0===this.value.clone?this.value:this.value.clone())}};h(ql,"Uniform");var Kp=class extends $r{constructor(t,e,i=1){super(t,e),this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){let e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){let e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}};h(Kp,"InstancedInterleavedBuffer"),Kp.prototype.isInstancedInterleavedBuffer=!0;var Qp=class{constructor(t,e,i,n,r){this.buffer=t,this.type=e,this.itemSize=i,this.elementSize=n,this.count=r,this.version=0}set needsUpdate(t){!0===t&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}};h(Qp,"GLBufferAttribute"),Qp.prototype.isGLBufferAttribute=!0;var Zi=class{constructor(t,e,i=0,n=1/0){this.ray=new hr(t,e),this.near=i,this.far=n,this.camera=null,this.layers=new al,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)}intersectObject(t,e=!0,i=[]){return zg(t,this,i,e),i.sort(Kv),i}intersectObjects(t,e=!0,i=[]){for(let n=0,r=t.length;n<r;n++)zg(t[n],this,i,e);return i.sort(Kv),i}};function Kv(t,e){return t.distance-e.distance}function zg(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n){let n=t.children;for(let t=0,r=n.length;t<r;t++)zg(n[t],e,i,!0)}}h(Zi,"Raycaster"),h(Kv,"ascSort"),h(zg,"intersectObject");var Qv=new de,Ws=class{constructor(t=new de(1/0,1/0),e=new de(-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let i=Qv.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}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=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(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}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}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}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))}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)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Qv.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),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)}};h(Ws,"Box2"),Ws.prototype.isBox2=!0;var ex=new I,hp=new I,ef=class{constructor(t=new I,e=new I){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){ex.subVectors(t,this.start),hp.subVectors(this.end,this.start);let i=hp.dot(hp),n=hp.dot(ex)/i;return e&&(n=ai(n,0,1)),n}closestPointToPoint(t,e,i){let n=this.closestPointToPointParameter(t,e);return this.delta(i).multiplyScalar(n).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)}};h(ef,"Line3");var Bs=new I,dp=new We,qg=new We,tf=class extends Gs{constructor(t){let e=Tx(t),i=new wt,n=[],r=[],s=new Ee(0,0,1),a=new Ee(0,1,0);for(let t=0;t<e.length;t++){let i=e[t];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(s.r,s.g,s.b),r.push(a.r,a.g,a.b))}i.setAttribute("position",new It(n,3)),i.setAttribute("color",new It(r,3)),super(i,new Xi({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){let e=this.bones,i=this.geometry,n=i.getAttribute("position");qg.copy(this.root.matrixWorld).invert();for(let t=0,i=0;t<e.length;t++){let r=e[t];r.parent&&r.parent.isBone&&(dp.multiplyMatrices(qg,r.matrixWorld),Bs.setFromMatrixPosition(dp),n.setXYZ(i,Bs.x,Bs.y,Bs.z),dp.multiplyMatrices(qg,r.parent.matrixWorld),Bs.setFromMatrixPosition(dp),n.setXYZ(i+1,Bs.x,Bs.y,Bs.z),i+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}};function Tx(t){let e=[];!0===t.isBone&&e.push(t);for(let i=0;i<t.children.length;i++)e.push.apply(e,Tx(t.children[i]));return e}h(tf,"SkeletonHelper"),h(Tx,"getBoneList");var nf=class extends Gs{constructor(t=10,e=10,i=4473924,n=8947848){i=new Ee(i),n=new Ee(n);let r=e/2,s=t/e,a=t/2,o=[],l=[];for(let t=0,h=0,u=-a;t<=e;t++,u+=s){o.push(-a,0,u,a,0,u),o.push(u,0,-a,u,0,a);let e=t===r?i:n;e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3}let h=new wt;h.setAttribute("position",new It(o,3)),h.setAttribute("color",new It(l,3)),super(h,new Xi({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}};h(nf,"GridHelper");var Ha=class extends Gs{constructor(t,e=16776960){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new wt;n.setIndex(new qt(i,1)),n.setAttribute("position",new It([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new Xi({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){let e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}};h(Ha,"Box3Helper");var Pl=class extends Gs{constructor(t=1){let e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new wt;i.setAttribute("position",new It(e,3)),i.setAttribute("color",new It([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(i,new Xi({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,i){let n=new Ee,r=this.geometry.attributes.color.array;return n.set(t),n.toArray(r,0),n.toArray(r,3),n.set(e),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}};h(Pl,"AxesHelper");var yu=class{constructor(){this.type="ShapePath",this.color=new Ee,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Qr,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.currentPath.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.currentPath.bezierCurveTo(t,e,i,n,r,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t,e){function i(t){let e=[];for(let i=0,n=t.length;i<n;i++){let n=t[i],r=new Gn;r.curves=n.curves,e.push(r)}return e}function n(t,e){let i=e.length,n=!1;for(let r=i-1,s=0;s<i;r=s++){let i=e[r],a=e[s],o=a.x-i.x,l=a.y-i.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(i=e[s],o=-o,a=e[r],l=-l),t.y<i.y||t.y>a.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{let e=l*(t.x-i.x)-o*(t.y-i.y);if(0===e)return!0;if(e<0)continue;n=!n}}else{if(t.y!==i.y)continue;if(a.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=a.x)return!0}}return n}h(i,"toShapesNoHoles"),h(n,"isPointInsidePolygon");let r=qi.isClockWise,s=this.subPaths;if(0===s.length)return[];if(!0===e)return i(s);let a,o,l,u=[];if(1===s.length)return o=s[0],l=new Gn,l.curves=o.curves,u.push(l),u;let c=!r(s[0].getPoints());c=t?!c:c;let d,p,m=[],f=[],g=[],v=0;f[v]=void 0,g[v]=[];for(let e=0,i=s.length;e<i;e++)o=s[e],d=o.getPoints(),a=r(d),a=t?!a:a,a?(!c&&f[v]&&v++,f[v]={s:new Gn,p:d},f[v].s.curves=o.curves,c&&v++,g[v]=[]):g[v].push({h:o,p:d[0]});if(!f[0])return i(s);if(f.length>1){let t=!1,e=0;for(let t=0,e=f.length;t<e;t++)m[t]=[];for(let i=0,r=f.length;i<r;i++){let r=g[i];for(let s=0;s<r.length;s++){let a=r[s],o=!0;for(let r=0;r<f.length;r++)n(a.p,f[r].p)&&(i!==r&&e++,o?(o=!1,m[r].push(a)):t=!0);o&&m[i].push(a)}}e>0&&!1===t&&(g=m)}for(let t=0,e=f.length;t<e;t++){l=f[t].s,u.push(l),p=g[t];for(let t=0,e=p.length;t<e;t++)l.holes.push(p[t].h)}return u}};h(yu,"ShapePath");var JE=new Float32Array(1),cD=new Int32Array(JE.buffer);Qn.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Qn.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Qr.prototype.fromPoints=function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)},nf.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},tf.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Pi.prototype.extractUrlBase=function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),zp.extractUrlBase(t)},Pi.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Ws.prototype.center=function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},Ws.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Ws.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},Ws.prototype.size=function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)},At.prototype.center=function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},At.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},At.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},At.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},At.prototype.size=function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)},Si.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")},Yr.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},La.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},ef.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},hn.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},hn.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},hn.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},hn.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},hn.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},hn.prototype.getInverse=function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()},We.prototype.extractPosition=function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},We.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},We.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new I).setFromMatrixColumn(this,3)},We.prototype.setRotationFromQuaternion=function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},We.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},We.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},We.prototype.multiplyVector4=function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},We.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},We.prototype.rotateAxis=function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},We.prototype.crossVector=function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},We.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},We.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},We.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},We.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},We.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},We.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},We.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},We.prototype.makeFrustum=function(t,e,i,n,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,i,r,s)},We.prototype.getInverse=function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()},Ti.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Ln.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Ln.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},hr.prototype.isIntersectionBox=function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},hr.prototype.isIntersectionPlane=function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},hr.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},Xt.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Xt.prototype.barycoordFromPoint=function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},Xt.prototype.midpoint=function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},Xt.prototypenormal=function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},Xt.prototype.plane=function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)},Xt.barycoordFromPoint=function(t,e,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Xt.getBarycoord(t,e,i,n,r)},Xt.normal=function(t,e,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Xt.getNormal(t,e,i,n)},Gn.prototype.extractAllPoints=function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},Gn.prototype.extrude=function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new jn(this,t)},Gn.prototype.makeGeometry=function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new bl(this,t)},de.prototype.fromAttribute=function(t,e,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},de.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},de.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},I.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},I.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},I.prototype.getPositionFromMatrix=function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},I.prototype.getScaleFromMatrix=function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},I.prototype.getColumnFromMatrix=function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},I.prototype.applyProjection=function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},I.prototype.fromAttribute=function(t,e,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},I.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},I.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Ct.prototype.fromAttribute=function(t,e,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},Ct.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},rt.prototype.getChildByName=function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},rt.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},rt.prototype.translate=function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},rt.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},rt.prototype.applyMatrix=function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(rt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),lt.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(lt.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),ax},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Zc.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},vn.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(xi.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(qt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===lf},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(lf)}}}),qt.prototype.setDynamic=function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?lf:xu),this},qt.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},qt.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},wt.prototype.addIndex=function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},wt.prototype.addAttribute=function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new qt(arguments[1],arguments[2])))},wt.prototype.addDrawCall=function(t,e,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},wt.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},wt.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},wt.prototype.removeAttribute=function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},wt.prototype.applyMatrix=function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(wt.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),$r.prototype.setDynamic=function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?lf:xu),this},$r.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},jn.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},jn.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},jn.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},Jr.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},ql.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(nn.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ee}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===nx}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(pn.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Rt.prototype.clearTarget=function(t,e,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,i,n)},Rt.prototype.animate=function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},Rt.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},Rt.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},Rt.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},Rt.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},Rt.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},Rt.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},Rt.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},Rt.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},Rt.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},Rt.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},Rt.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},Rt.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},Rt.prototype.enableScissorTest=function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},Rt.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},Rt.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},Rt.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},Rt.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},Rt.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},Rt.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},Rt.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},Rt.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},Rt.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},Rt.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(Rt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?Gt:Ys}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}}),Object.defineProperties(xx.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(dn.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),jp.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");let e=this;return(new Vp).load(t,(function(t){e.setBuffer(t)})),this},Wp.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},ll.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},ll.prototype.clear=function(t,e,i,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(t,e,i,n)},ur.crossOrigin=void 0,ur.loadTexture=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");let r=new Ci;r.setCrossOrigin(this.crossOrigin);let s=r.load(t,i,void 0,n);return e&&(s.mapping=e),s},ur.loadTextureCube=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");let r=new Np;r.setCrossOrigin(this.crossOrigin);let s=r.load(t,i,void 0,n);return e&&(s.mapping=e),s},ur.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},ur.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ug}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Ug),P(),P();var Ex=" ",On=class{static get separator(){return Ex}static set separator(t){Ex=t}static parse(t){if(!isNaN(parseFloat(t))&&isFinite(t))return Number(t);let e=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==e[e.length-1]&&e.splice(e.length-1),""==e)return NaN;let i=null;switch(e.length){case 3:i=e[0]/1+e[1]/60+e[2]/3600;break;case 2:i=e[0]/1+e[1]/60;break;case 1:i=e[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(i=-i),Number(i)}static toDms(t,e="d",i){if(isNaN(t)||"string"==typeof t&&""==t.trim()||"boolean"==typeof t||t==1/0||null==t)return null;if(void 0===i)switch(e){case"d":case"deg":i=4;break;case"dm":case"deg+min":i=2;break;case"dms":case"deg+min+sec":i=0;break;default:e="d",i=4}t=Math.abs(t);let n=null,r=null,s=null,a=null;switch(e){default:case"d":case"deg":r=t.toFixed(i),r<100&&(r="0"+r),r<10&&(r="0"+r),n=r+"°";break;case"dm":case"deg+min":r=Math.floor(t),s=(60*t%60).toFixed(i),60==s&&(s=(0).toFixed(i),r++),r=("000"+r).slice(-3),s<10&&(s="0"+s),n=r+"°"+On.separator+s+"′";break;case"dms":case"deg+min+sec":r=Math.floor(t),s=Math.floor(3600*t/60)%60,a=(3600*t%60).toFixed(i),60==a&&(a=(0).toFixed(i),s++),60==s&&(s=0,r++),r=("000"+r).slice(-3),s=("00"+s).slice(-2),a<10&&(a="0"+a),n=r+"°"+On.separator+s+"′"+On.separator+a+"″"}return n}static toLat(t,e,i){let n=On.toDms(On.wrap90(t),e,i);return null===n?"–":n.slice(1)+On.separator+(t<0?"S":"N")}static toLon(t,e,i){let n=On.toDms(On.wrap180(t),e,i);return null===n?"–":n+On.separator+(t<0?"W":"E")}static toBrng(t,e,i){let n=On.toDms(On.wrap360(t),e,i);return null===n?"–":n.replace("360","0")}static fromLocale(t){let e=123456.789.toLocaleString(),i={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(i.thousands,"⁜").replace(i.decimal,".").replace("⁜",",")}static toLocale(t){let e=123456.789.toLocaleString(),i={thousands:e.slice(3,4),decimal:e.slice(7,8)};return t.replace(/,([0-9])/,"⁜$1").replace(".",i.decimal).replace("⁜",i.thousands)}static compassPoint(t,e=3){if(![1,2,3].includes(Number(e)))throw new RangeError(`invalid precision ‘${e}’`);t=On.wrap360(t);let i=4*zt(2,e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*i/360)%i*16/i]}static wrap360(t){return 0<=t&&t<360?t:(t%360+360)%360}static wrap180(t){return-180<t&&t<=180?t:(t+540)%360-180}static wrap90(t){return-90<=t&&t<=90?t:Math.abs((t%360+270)%360-180)-90}};h(On,"Dms"),Number.prototype.toRadians=function(){return this*Math.PI/180},Number.prototype.toDegrees=function(){return 180*this/Math.PI};var _t=On,Zt=Math.PI,Be=class{constructor(t,e){if(isNaN(t))throw new TypeError(`invalid lat ‘${t}’`);if(isNaN(e))throw new TypeError(`invalid lon ‘${e}’`);this._lat=_t.wrap90(Number(t)),this._lon=_t.wrap180(Number(e))}get lat(){return this._lat}get latitude(){return this._lat}set lat(t){if(this._lat=isNaN(t)?_t.wrap90(_t.parse(t)):_t.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid lat ‘${t}’`)}set latitude(t){if(this._lat=isNaN(t)?_t.wrap90(_t.parse(t)):_t.wrap90(Number(t)),isNaN(this._lat))throw new TypeError(`invalid latitude ‘${t}’`)}get lon(){return this._lon}get lng(){return this._lon}get longitude(){return this._lon}set lon(t){if(this._lon=isNaN(t)?_t.wrap180(_t.parse(t)):_t.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lon ‘${t}’`)}set lng(t){if(this._lon=isNaN(t)?_t.wrap180(_t.parse(t)):_t.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid lng ‘${t}’`)}set longitude(t){if(this._lon=isNaN(t)?_t.wrap180(_t.parse(t)):_t.wrap180(Number(t)),isNaN(this._lon))throw new TypeError(`invalid longitude ‘${t}’`)}static get metresToKm(){return.001}static get metresToMiles(){return 1/1609.344}static get metresToNauticalMiles(){return 1/1852}static parse(...t){if(0==t.length)throw new TypeError("invalid (empty) point");if(null===t[0]||null===t[1])throw new TypeError("invalid (null) point");let e,i;if(2==t.length&&([e,i]=t,e=_t.wrap90(_t.parse(e)),i=_t.wrap180(_t.parse(i)),isNaN(e)||isNaN(i)))throw new TypeError(`invalid point ‘${t.toString()}’`);if(1==t.length&&"string"==typeof t[0]&&([e,i]=t[0].split(","),e=_t.wrap90(_t.parse(e)),i=_t.wrap180(_t.parse(i)),isNaN(e)||isNaN(i)))throw new TypeError(`invalid point ‘${t[0]}’`);if(1==t.length&&"object"==typeof t[0]){let n=t[0];if("Point"==n.type&&Array.isArray(n.coordinates)?[i,e]=n.coordinates:(null!=n.latitude&&(e=n.latitude),null!=n.lat&&(e=n.lat),null!=n.longitude&&(i=n.longitude),null!=n.lng&&(i=n.lng),null!=n.lon&&(i=n.lon),e=_t.wrap90(_t.parse(e)),i=_t.wrap180(_t.parse(i))),isNaN(e)||isNaN(i))throw new TypeError(`invalid point ‘${JSON.stringify(t[0])}’`)}if(isNaN(e)||isNaN(i))throw new TypeError(`invalid point ‘${t.toString()}’`);return new Be(e,i)}distanceTo(t,e=6371e3){if(t instanceof Be||(t=Be.parse(t)),isNaN(e))throw new TypeError(`invalid radius ‘${e}’`);let i=e,n=this.lat.toRadians(),r=this.lon.toRadians(),s=t.lat.toRadians(),a=s-n,o=t.lon.toRadians()-r,l=Math.sin(a/2)*Math.sin(a/2)+Math.cos(n)*Math.cos(s)*Math.sin(o/2)*Math.sin(o/2);return i*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))}initialBearingTo(t){if(t instanceof Be||(t=Be.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),i=t.lat.toRadians(),n=(t.lon-this.lon).toRadians(),r=Math.cos(e)*Math.sin(i)-Math.sin(e)*Math.cos(i)*Math.cos(n),s=Math.sin(n)*Math.cos(i),a=Math.atan2(s,r).toDegrees();return _t.wrap360(a)}finalBearingTo(t){t instanceof Be||(t=Be.parse(t));let e=t.initialBearingTo(this)+180;return _t.wrap360(e)}midpointTo(t){t instanceof Be||(t=Be.parse(t));let e=this.lat.toRadians(),i=this.lon.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),s=Math.cos(e),a=0,o=Math.sin(e),l={x:s+Math.cos(n)*Math.cos(r),y:a+Math.cos(n)*Math.sin(r),z:o+Math.sin(n)},h=Math.atan2(l.z,Math.sqrt(l.x*l.x+l.y*l.y)),u=i+Math.atan2(l.y,l.x),c=h.toDegrees(),d=u.toDegrees();return new Be(c,d)}intermediatePointTo(t,e){if(t instanceof Be||(t=Be.parse(t)),this.equals(t))return new Be(this.lat,this.lon);let i=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),s=t.lon.toRadians(),a=r-i,o=s-n,l=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i)*Math.cos(r)*Math.sin(o/2)*Math.sin(o/2),h=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),u=Math.sin((1-e)*h)/Math.sin(h),c=Math.sin(e*h)/Math.sin(h),d=u*Math.cos(i)*Math.cos(n)+c*Math.cos(r)*Math.cos(s),p=u*Math.cos(i)*Math.sin(n)+c*Math.cos(r)*Math.sin(s),m=u*Math.sin(i)+c*Math.sin(r),f=Math.atan2(m,Math.sqrt(d*d+p*p)),g=Math.atan2(p,d),v=f.toDegrees(),y=g.toDegrees();return new Be(v,y)}destinationPoint(t,e,i=6371e3){let n=t/i,r=Number(e).toRadians(),s=this.lat.toRadians(),a=this.lon.toRadians(),o=Math.sin(s)*Math.cos(n)+Math.cos(s)*Math.sin(n)*Math.cos(r),l=Math.asin(o),h=Math.sin(r)*Math.sin(n)*Math.cos(s),u=Math.cos(n)-Math.sin(s)*o,c=a+Math.atan2(h,u),d=l.toDegrees(),p=c.toDegrees();return new Be(d,p)}static intersection(t,e,i,n){if(t instanceof Be||(t=Be.parse(t)),i instanceof Be||(i=Be.parse(i)),isNaN(e))throw new TypeError(`invalid brng1 ‘${e}’`);if(isNaN(n))throw new TypeError(`invalid brng2 ‘${n}’`);let r=t.lat.toRadians(),s=t.lon.toRadians(),a=i.lat.toRadians(),o=i.lon.toRadians(),l=Number(e).toRadians(),h=Number(n).toRadians(),u=a-r,c=o-s,d=2*Math.asin(Math.sqrt(Math.sin(u/2)*Math.sin(u/2)+Math.cos(r)*Math.cos(a)*Math.sin(c/2)*Math.sin(c/2)));if(Math.abs(d)<Number.EPSILON)return new Be(t.lat,t.lon);let p=(Math.sin(a)-Math.sin(r)*Math.cos(d))/(Math.sin(d)*Math.cos(r)),m=(Math.sin(r)-Math.sin(a)*Math.cos(d))/(Math.sin(d)*Math.cos(a)),f=Math.acos(Math.min(Math.max(p,-1),1)),g=Math.acos(Math.min(Math.max(m,-1),1)),v=l-(Math.sin(o-s)>0?f:2*Zt-f),y=(Math.sin(o-s)>0?2*Zt-g:g)-h;if(0==Math.sin(v)&&0==Math.sin(y)||Math.sin(v)*Math.sin(y)<0)return null;let _=-Math.cos(v)*Math.cos(y)+Math.sin(v)*Math.sin(y)*Math.cos(d),x=Math.atan2(Math.sin(d)*Math.sin(v)*Math.sin(y),Math.cos(y)+Math.cos(v)*_),b=Math.asin(Math.min(Math.max(Math.sin(r)*Math.cos(x)+Math.cos(r)*Math.sin(x)*Math.cos(l),-1),1)),w=s+Math.atan2(Math.sin(l)*Math.sin(x)*Math.cos(r),Math.cos(x)-Math.sin(r)*Math.sin(b)),M=b.toDegrees(),E=w.toDegrees();return new Be(M,E)}crossTrackDistanceTo(t,e,i=6371e3){t instanceof Be||(t=Be.parse(t)),e instanceof Be||(e=Be.parse(e));let n=i;if(this.equals(t))return 0;let r=t.distanceTo(this,n)/n,s=t.initialBearingTo(this).toRadians(),a=t.initialBearingTo(e).toRadians();return Math.asin(Math.sin(r)*Math.sin(s-a))*n}alongTrackDistanceTo(t,e,i=6371e3){t instanceof Be||(t=Be.parse(t)),e instanceof Be||(e=Be.parse(e));let n=i;if(this.equals(t))return 0;let r=t.distanceTo(this,n)/n,s=t.initialBearingTo(this).toRadians(),a=t.initialBearingTo(e).toRadians(),o=Math.asin(Math.sin(r)*Math.sin(s-a));return Math.acos(Math.cos(r)/Math.abs(Math.cos(o)))*Math.sign(Math.cos(a-s))*n}maxLatitude(t){let e=Number(t).toRadians(),i=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(i))).toDegrees()}static crossingParallels(t,e,i){if(t.equals(e))return null;let n=Number(i).toRadians(),r=t.lat.toRadians(),s=t.lon.toRadians(),a=e.lat.toRadians(),o=e.lon.toRadians()-s,l=Math.sin(r)*Math.cos(a)*Math.cos(n)*Math.sin(o),h=Math.sin(r)*Math.cos(a)*Math.cos(n)*Math.cos(o)-Math.cos(r)*Math.sin(a)*Math.cos(n),u=Math.cos(r)*Math.cos(a)*Math.sin(n)*Math.sin(o);if(u*u>l*l+h*h)return null;let c=Math.atan2(-h,l),d=Math.acos(u/Math.sqrt(l*l+h*h)),p=s+c+d,m=(s+c-d).toDegrees(),f=p.toDegrees();return{lon1:_t.wrap180(m),lon2:_t.wrap180(f)}}rhumbDistanceTo(t,e=6371e3){t instanceof Be||(t=Be.parse(t));let i=e,n=this.lat.toRadians(),r=t.lat.toRadians(),s=r-n,a=Math.abs(t.lon-this.lon).toRadians();Math.abs(a)>Zt&&(a=a>0?-(2*Zt-a):2*Zt+a);let o=Math.log(Math.tan(r/2+Zt/4)/Math.tan(n/2+Zt/4)),l=Math.abs(o)>1e-11?s/o:Math.cos(n);return Math.sqrt(s*s+l*l*a*a)*i}rhumbBearingTo(t){if(t instanceof Be||(t=Be.parse(t)),this.equals(t))return NaN;let e=this.lat.toRadians(),i=t.lat.toRadians(),n=(t.lon-this.lon).toRadians();Math.abs(n)>Zt&&(n=n>0?-(2*Zt-n):2*Zt+n);let r=Math.log(Math.tan(i/2+Zt/4)/Math.tan(e/2+Zt/4)),s=Math.atan2(n,r).toDegrees();return _t.wrap360(s)}rhumbDestinationPoint(t,e,i=6371e3){let n=this.lat.toRadians(),r=this.lon.toRadians(),s=Number(e).toRadians(),a=t/i,o=a*Math.cos(s),l=n+o;Math.abs(l)>Zt/2&&(l=l>0?Zt-l:-Zt-l);let h=Math.log(Math.tan(l/2+Zt/4)/Math.tan(n/2+Zt/4)),u=Math.abs(h)>1e-11?o/h:Math.cos(n),c=r+a*Math.sin(s)/u,d=l.toDegrees(),p=c.toDegrees();return new Be(d,p)}rhumbMidpointTo(t){t instanceof Be||(t=Be.parse(t));let e=this.lat.toRadians(),i=this.lon.toRadians(),n=t.lat.toRadians(),r=t.lon.toRadians();Math.abs(r-i)>Zt&&(i+=2*Zt);let s=(e+n)/2,a=Math.tan(Zt/4+e/2),o=Math.tan(Zt/4+n/2),l=Math.tan(Zt/4+s/2),h=((r-i)*Math.log(l)+i*Math.log(o)-r*Math.log(a))/Math.log(o/a);isFinite(h)||(h=(i+r)/2);let u=s.toDegrees(),c=h.toDegrees();return new Be(u,c)}static areaOf(t,e=6371e3){let i=e,n=t[0].equals(t[t.length-1]);n||t.push(t[0]);let r=t.length-1,s=0;for(let e=0;e<r;e++){let i=t[e].lat.toRadians(),n=t[e+1].lat.toRadians(),r=(t[e+1].lon-t[e].lon).toRadians();s+=2*Math.atan2(Math.tan(r/2)*(Math.tan(i/2)+Math.tan(n/2)),1+Math.tan(i/2)*Math.tan(n/2))}o(t)&&(s=Math.abs(s)-2*Zt);let a=Math.abs(s*i*i);return n||t.pop(),a;function o(t){let e=0,i=t[0].initialBearingTo(t[1]);for(let n=0;n<t.length-1;n++){let r=t[n].initialBearingTo(t[n+1]),s=t[n].finalBearingTo(t[n+1]);e+=(r-i+540)%360-180,e+=(s-r+540)%360-180,i=s}return e+=(t[0].initialBearingTo(t[1])-i+540)%360-180,Math.abs(e)<90}}equals(t){return t instanceof Be||(t=Be.parse(t)),!(Math.abs(this.lat-t.lat)>Number.EPSILON||Math.abs(this.lon-t.lon)>Number.EPSILON)}toGeoJSON(){return{type:"Point",coordinates:[this.lon,this.lat]}}toString(t="d",e){if(!["d","dm","dms","n"].includes(t))throw new RangeError(`invalid format ‘${t}’`);if("n"==t)return null==e&&(e=4),`${this.lat.toFixed(e)},${this.lon.toFixed(e)}`;return`${_t.toLat(this.lat,t,e)}, ${_t.toLon(this.lon,t,e)}`}};h(Be,"LatLonSpherical"),P();var Jg="mi-debug",$E={loggingEnabled(){var t;return"development"===j.env.NODE_ENV||"dev"===j.env.NODE_ENV||"test"===j.env.NODE_ENV||"true"===(null==(t=globalThis.sessionStorage)?void 0:t.getItem(Jg))},log(...t){this.loggingEnabled()&&console.log("[MappedInJS]",...t)},warn(...t){this.loggingEnabled()&&console.warn("[MappedInJS]",...t)},error(...t){this.loggingEnabled()&&console.error("[MappedInJS]",...t)},assert(...t){this.loggingEnabled()&&console.assert(...t)},time(t){this.loggingEnabled()&&console.time(t)},timeEnd(t){this.loggingEnabled()&&console.timeEnd(t)}},ge=$E;P(),P();var Wa,$i,Ki,$g=[0,4,6,8,10],Xn=h((()=>{let t=new Array(16).fill(0),e=4294967296*Math.random();for(let i=0;i<t.length;i++)i>0&&!(3&i)&&(e=4294967296*Math.random()),t[i]=e>>>((3&i)<<3)&255;let i=t.map((t=>t.toString(16).padStart(2,"0")));return i[6]="4"+i[6][1],i[8]=["8","9","a","b"].includes(i[7][0])?i[7]:"a"+i[7][1],$g.map(((t,e)=>i.slice(t,e===$g.length-1?void 0:$g[e+1]).join(""))).join("-")}),"randomId"),Sx="mi-session-data",Ax="mi-local-data",Kg=class{constructor(){H(this,$i,void 0),H(this,Ki,void 0);try{let t=sessionStorage.getItem(Sx);G(this,$i,t?JSON.parse(t):{id:Xn()})}catch(t){G(this,$i,{id:Xn()})}try{let t=localStorage.getItem(Ax);G(this,Ki,t?JSON.parse(t):{deviceId:Xn()})}catch(t){G(this,Ki,{deviceId:Xn()})}_(this,$i).id||(_(this,$i).id=Xn()),_(this,Ki).deviceId||(_(this,Ki).deviceId=Xn())}static getInstance(){return _(this,Wa)||G(this,Wa,new Kg),_(this,Wa)}static ___clearInstance(){G(this,Wa,void 0)}saveSessionData(t,e){_(this,$i)[t]=e;try{return sessionStorage.setItem(Sx,JSON.stringify(_(this,$i))),!0}catch(t){return!1}}loadSessionData(t){let e=_(this,$i)[t];if(null!=e)return e}saveLocalData(t,e){_(this,Ki)[t]=e;try{return localStorage.setItem(Ax,JSON.stringify(_(this,Ki))),!0}catch(t){return!1}}loadLocalData(t){let e=_(this,Ki)[t];if(null!=e)return e}},ja=Kg;function qx(t){return/^[\da-f]{24}$/i.test(t)}function KE(t){let e=new At;return t.forEach((t=>{let i=new At;i.setFromObject(t),e.union(i)})),e}function Eu(t,e){let i=KE(t.map((t=>t.object)));return e&&(i.max.add(new I(0,0,e)),i.min.sub(new I(0,0,e))),i}function Js(t){t&&(t.map&&(t.map.dispose(),t.map=void 0),t.dispose())}function Px(){return ja.getInstance().loadLocalData("deviceId")}function Cx(){return ja.getInstance().loadSessionData("id")}function Jt(t){return"string"==typeof t?t:t.id}function mr(t,e){return null==e?t:"string"==typeof t?e.find((function(e){return e.id==t})):t}function Xa(t){return(new At).setFromObject(t)}function mf(t){let{min:e,max:i}=t;return[new I(e.x,e.y,e.z),new I(i.x,e.y,e.z),new I(e.x,i.y,e.z),new I(i.x,i.y,e.z),new I(e.x,e.y,i.z),new I(i.x,e.y,i.z),new I(e.x,i.y,i.z),new I(i.x,i.y,i.z)]}function gf(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let i=t.georeference[0],n=t.georeference[2],r=new Be(i.target.x,i.target.y),s=new Be(n.target.x,n.target.y),a=r.distanceTo(s),o=i.control.x-n.control.x,l=i.control.y-n.control.y;e=Math.sqrt(o*o+l*l)/a}catch(i){e=1,ge.warn(i),ge.warn("Couldn't georeference "+(t.name||t.shortName||t.id)+". Probably not enough geocoordinates.")}return e}function Ix(t){let e;try{let i=t.georeference[0],n=t.georeference[2],r=new Be(i.target.x,i.target.y),s=new Be(n.target.x,n.target.y);e=-((r.finalBearingTo(s)+0)*Math.PI/180-Math.atan2(n.control.y-i.control.y,n.control.x-i.control.x)-Math.PI/2)}catch(i){e=0,ge.warn(i),ge.warn("Couldn't georeference "+(t.name||t.shortName||t.id)+". Probably not enough geocoordinates.")}return e}function yf(t,e,i){let n,r,s,a=null,o=0;i||(i={});let l=h((function(){o=!1===i.leading?0:Date.now(),a=null,s=t.apply(n,r),a||(n=r=null)}),"later");return function(){let h=Date.now();!o&&!1===i.leading&&(o=h);let u=e-(h-o);return n=this,r=arguments,u<=0||u>e?(a&&(clearTimeout(a),a=null),o=h,s=t.apply(n,r),a||(n=r=null)):!a&&!1!==i.trailing&&(a=setTimeout(l,u)),s}}function $s(t,e,i){let n;return function(){let r=this,s=arguments,a=h((function(){n=null,i||t.apply(r,s)}),"later"),o=i&&!n;clearTimeout(n),n=setTimeout(a,e),o&&t.apply(r,s)}}function Qg(t,e,i){let n=t*(Math.PI/180)/2,r=e/2;return i*Math.tan(n)/r}function e2(t,e,i){let n=t.max.y,r=e/2,s=i/2*Math.PI/180;return r/Math.tan(s)+n}function Lx({maps:t,width:e,height:i,camera:n}){return t.map((t=>{let r=1/0,s=1/0,a=-1/0,o=-1/0,l=mf(Xa(t.object));for(let t=0;t<l.length;t++){let h=l[t];h=h.project(n);let u={x:(h.x+1)/2*e,y:(1-h.y)/2*i};r=Math.min(u.x,r),s=Math.min(u.y,s),a=Math.max(u.x,a),o=Math.max(u.y,o)}return{min:{x:r,y:s},max:{x:a,y:o}}}))}function Ox(t,e,i){let n=[t],r=(e.x-t.x)/i,s=(e.y-t.y)/i,a=(e.z-t.z)/i;for(let e=1;e<i;e++){let i=t.clone(),o=new I(e*r,e*s,e*a);i.add(o),n.push(i)}return n.push(e),n}h(ja,"SafeStorage"),Wa=new WeakMap,$i=new WeakMap,Ki=new WeakMap,H(ja,Wa,void 0),h(qx,"isGatewayKey"),h(KE,"getCombinedBoundingBox"),h(Eu,"getMapsBoundingBox"),h(Js,"scrubMaterial"),h(Px,"getDeviceID"),h(Cx,"getSessionID"),h(Jt,"getObjectId"),h(mr,"getObject"),h(Xa,"getBoundingBox"),h(mf,"unpackBoundingBox"),h(gf,"getMapScale"),h(Ix,"getNorth"),h(yf,"throttle"),h($s,"debounce"),h(Qg,"getProjectionScaleFactor"),h(e2,"getZoom"),h(Lx,"calculateTwoDProjections"),h(Ox,"splitLine");var kl=h(((t,e)=>{if("string"==typeof t){if(null==e||!Array.isArray(e.polygons))return null;t=e.polygons.find((function(e){return e.id==t}))}let i=null;if(null!=t&&null!=t.locations&&t.locations.length>0){i=t.locations[0];for(let e=0,n=t.locations.length;e<n;e++){let n=t.locations[e];for(;null!=n.parent;)n=n.parent,n.polygons.includes(t)&&(i=n);if(null==n.parent&&n.polygons.includes(t))return n}}return i}),"getPrimaryLocationForPolygon"),Rx=h(((t,e)=>{let i,n=t.venue.defaultMap;if(e&&e.firstMap&&(n=Jt(e.firstMap)),n)for(let e=0,r=t.maps.length;e<r;++e)if(t.maps[e].id===n){i=t.maps[e].id;break}if(!i){let e=t.maps[0];for(let i of t.maps.slice(1))e=Math.abs(i.elevation)===Math.abs(e.elevation)?i.elevation>e.elevation?i:e:Math.abs(i.elevation)<Math.abs(e.elevation)?i:e;i=e}return i}),"determineStartingMap"),z4=gn(Qx(),1);P();var N4=gn(e_(),1);P(),P(),P();var n4=gn(t4(),1);P();var vm=class{constructor({origin:t,destination:e,vortex:i,elevationDelta:n=0,distance:r=0,angle:s=0}){let a,o;if(w(this,"origin"),w(this,"destination"),w(this,"vortex"),w(this,"distance"),w(this,"angle"),w(this,"weight"),this.origin=t,this.destination=e,this.vortex=i,this.distance=r,this.angle=s,i?(this.distance=0,this.angle=0,a=void 0!==i.weight&&i.weight>0?i.weight:"elevator"===i.type?2e3:1e3,o=i.multiplier&&i.multiplier>=1?i.multiplier:1,this.weight=n*o+a):(a=e.weight&&e.weight>=0?e.weight:0,o=e.multiplier&&e.multiplier>=1?e.multiplier:1,this.weight=this.distance*o+a),isNaN(this.angle))throw new Error("nan angle")}};h(vm,"Edge");var xm=vm;function FP(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale||1);try{if(!t.georeference)throw new Error(`map ${t.name||t.shortName||t.id} does not have a georeference field`);if(t.georeference.length<3)throw new Error(`map ${t.name||t.shortName||t.id} has less than 3 georeference points, we require at least 3 for proper map scaling`);let e=t.georeference[0],i=t.georeference[2],n=(0,n4.getDistance)({latitude:e.target.x,longitude:e.target.y},{latitude:i.target.x,longitude:i.target.y}),r=e.control.x-i.control.x,s=e.control.y-i.control.y;return Math.sqrt(r*r+s*s)/n}catch(t){return ge.error(t),1}}function zP(t,e){let i=t.x-e.x,n=t.y-e.y;return(Math.atan2(n,i)+2.5*Math.PI)%(2*Math.PI)}h(FP,"getMapScale"),h(zP,"getAngle");var _m=class{constructor({nodes:t,vortexes:e,maps:i,showVortexNames:n=!1}){w(this,"edges"),w(this,"nodesById"),w(this,"mapsById"),this.edges={},this.mapsById=i.map((t=>Ue(be({},t),{_scale:FP(t)}))).reduce(((t,e)=>(t[e.id]=e,t)),{});let r=t.filter((t=>!!this.mapsById[t.map])).map((t=>Ue(be({},t),{paths:t.paths?t.paths.filter((({map:e})=>e===t.map)):[]})));this.nodesById=r.reduce(((t,e)=>(t[e.id]=e,t)),{});for(let t in this.nodesById)this.nodesById.hasOwnProperty(t)&&(this.nodesById[t].paths=this.nodesById[t].paths.filter((({node:t})=>!!this.nodesById[t])));let s=e.map((t=>Ue(be({},t),{name:n?t.name:t.type,nodes:t.nodes?t.nodes.filter((t=>!!this.nodesById[t])):[]})));r.forEach((t=>{this.edges[t.id]=t.paths.map((({node:e})=>{let i=this.nodesById[e];return new xm({angle:zP(t,i),destination:i,distance:this.getDistance(t,i),origin:t})}))})),s.forEach((t=>{if(null==t.nodes||0===t.nodes.length)return;let e=0;for(;e<t.nodes.length-1;){let i=this.nodesById[t.nodes[e]];if(e++,null==i)continue;let n=e;for(;n<t.nodes.length;){let e=this.nodesById[t.nodes[n]];if(n++,null==e)continue;let r=this.mapsById[i.map].elevation||0,s=this.mapsById[e.map].elevation||0,a=Math.abs(r-s);this.edges[i.id].push(new xm({destination:e,elevationDelta:a,origin:i,vortex:t})),this.edges[e.id].push(new xm({destination:i,elevationDelta:a,origin:e,vortex:t}))}}}))}aStar(t,e,i){let n=t.map((t=>this.nodesById[t])).filter((t=>t)),r=e.map((t=>this.nodesById[t])).filter((t=>t));if(0===n.length||0===r.length)return[];let s=[],a={},o={};for(n.forEach((t=>{let e=this.getShortestEuclideanDistance(t,r);s.push({origin:t,priority:e}),a[t.id]=null,o[t.id]=0})),s.sort(((t,e)=>t.priority-e.priority));s.length>0;){let t=s[0];if(r.includes(t.origin)){let e=[],i=a[t.origin.id];for(;null!=i;){e.push(i);let t=a[i.origin.id];i=null!=t?t:null}return e.reverse()}for(let e of this.edges[t.origin.id]){let n=e.vortex&&!1===e.vortex.accessible;if(i&&(n||!1===e.origin.accessible||!1===e.destination.accessible))continue;let l=o[t.origin.id]+e.weight;if(null==o[e.destination.id]||l<o[e.destination.id]){o[e.destination.id]=l;let t=l+this.getShortestEuclideanDistance(e.destination,r);s.push({origin:e.destination,priority:t}),a[e.destination.id]=e}}s.splice(0,1),s.sort(((t,e)=>t.priority-e.priority))}return[]}getDistance(t,e){let i,n=t.x-e.x,r=t.y-e.y,s=n*n+r*r;return i=null==this.mapsById[t.map]?1:this.mapsById[t.map]._scale,Math.sqrt(s)/i}getShortestEuclideanDistance(t,e){return e.reduce(((e,i)=>{let n=this.getDistance(t,i);return Math.min(e,n)}),Number.MAX_VALUE)}};h(_m,"NavigationGraph");var S2=_m;P(),P();var Za=(t=>(t.DEPARTURE="Departure",t.TAKEVORTEX="TakeVortex",t.EXITVORTEX="ExitVortex",t.TURN="Turn",t.ARRIVAL="Arrival",t))(Za||{}),Ou=(t=>(t.STRAIGHT="Straight",t.RIGHT="Right",t.SLIGHTRIGHT="SlightRight",t.LEFT="Left",t.SLIGHTLEFT="SlightLeft",t))(Ou||{});function UP(t){switch(t){case"down":case"up":return`${t} `;default:return""}}h(UP,"vortexDirectionTest");var bm=class{constructor({origin:t,action:e,distance:i,atLocation:n,instruction:r}){w(this,"node"),w(this,"instruction"),w(this,"action"),w(this,"atLocation"),w(this,"type"),w(this,"distance",0),this.node=t,this.action=e,this.distance=i||0,this.atLocation=n,this.instruction="",r?this.instruction=r:(null!=e&&"Departure"===e.type?this.instruction=null!=n?`Depart from ${n.name}`:"Depart from current location":null!=e&&"Arrival"===e.type?this.instruction=null!=n?`Arrive at ${n.name}`:"Arrive at destination":null!=e&&"TakeVortex"===e.type?this.instruction=`Take ${n&&n.name} ${UP(e.direction)}to ${e.toMap.name}`:null!=e&&"ExitVortex"===e.type?this.instruction=`Exit ${n&&n.name} at ${e.toMap.name}`:null!=e&&"Right"===e.bearing?this.instruction="Turn right":null!=e&&"SlightRight"===e.bearing?this.instruction="Turn slightly right":null!=e&&"Straight"===e.bearing?this.instruction="Head straight":null!=e&&"SlightLeft"===e.bearing?this.instruction="Turn slightly left":null!=e&&"Left"===e.bearing&&(this.instruction="Turn left"),null!=e&&"Turn"===e.type&&n&&(this.instruction+=` at ${n.name}`))}};h(bm,"Directive");var Qs=bm,Mm=.1*Math.PI;function wm(t,e){return((e-t+Math.PI)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)-Math.PI}h(wm,"differenceBetweenAngles");var Tm=class{constructor({locations:t,nodes:e,vortexes:i,maps:n,showVortexNames:r}){w(this,"graph"),w(this,"locationsByNodeId"),this.graph=new S2({maps:n,nodes:e,showVortexNames:r,vortexes:i}),this.locationsByNodeId=t.reduce(((t,e)=>(e.nodes&&e.nodes.forEach((i=>{t[i.node]=e})),e.polygons&&e.polygons.forEach((i=>{i.entrances&&i.entrances.forEach((i=>{t[i]=e}))})),t)),{})}getClosestLocationInRay(t,e=.5*Math.PI,i=10){let n=0,r=0,s=t;for(;Math.abs(n)<e&&r<i;){let t=this.graph.edges[s.destination.id],a=null,o=0;for(let e of t)if(e.distance>0)if(null!=a){let t=-wm(s.angle,e.angle);Math.abs(t)<Math.abs(o)&&(a=e,o=t)}else a=e,o=-wm(s.angle,e.angle);if(null==a)return null;{if(Math.abs(o)>=e||(n+=o,r+=a.distance,Math.abs(n)>=e||r>i))return null;let t=this.locationsByNodeId[a.destination.id];if(null!=t)return t;s=a}}return null}getDirections({originIds:t,destinationNodeIds:e,accessible:i,departFrom:n,arriveAt:r}){let s=this.graph.aStar(t,e,i);if(0===s.length)return{distance:0,instructions:[new Qs({distance:0,instruction:"No Valid Path Available"})],path:[]};let a=0,o=new Array(s.length+1);for(let t=0;t<s.length;t++)o[t]=s[t].origin;o[s.length]=s[s.length-1].destination;let l=[],h=null,u=null,c=0,d=0;for(let t=0;t<s.length;t++){let e=s[t],i=e.origin,o=e.destination;if(a+=e.distance,c+=(null==u?void 0:u.distance)||0,0===t&&l.push(new Qs({action:{type:"Departure"},atLocation:n,distance:0,origin:i})),null!=e.vortex){let t=this.graph.mapsById[i.map],n=this.graph.mapsById[o.map],r="none";if(null!=t.elevation&&null!=n.elevation){let e=t.elevation-n.elevation;e>0?r="down":e<0&&(r="up")}l.push(new Qs({action:{direction:r,fromMap:t,toMap:n,type:"TakeVortex"},atLocation:e.vortex,distance:c,origin:i})),d+=c,c=0}else if(null!=h&&null!=u)if(null!=u.vortex){let t=this.graph.mapsById[h.map],e=this.graph.mapsById[u.destination.map];l.push(new Qs({action:{fromMap:t,toMap:e,type:"ExitVortex"},atLocation:u.vortex,distance:c,origin:i})),d+=c,c=0}else{let t=this.graph.edges[i.id].filter((t=>t.destination!==h&&t.destination!==e.destination));if(t.length>0){let n=-wm(u.angle,e.angle),r=t.reduce(((t,i)=>{let n=-wm(e.angle,i.angle);return Math.min(t,Math.abs(n))}),Math.PI);if(Math.abs(n)>=Mm||Math.abs(r)<=Mm){let t;t=n<=-Math.PI/4?"Right":n<=-Mm?"SlightRight":n<=Mm?"Straight":n<=Math.PI/4?"SlightLeft":"Left";let e=this.locationsByNodeId[i.id];if(e||(e=this.getClosestLocationInRay(u,.5*Math.PI,10)),null!=e){let n=new Qs({action:{bearing:t,referencePosition:"At",type:"Turn"},atLocation:e,distance:c,origin:i});n.type=t,l.push(n)}else l.push(new Qs({action:{bearing:t,referencePosition:"At",type:"Turn"},distance:c,origin:i}));d+=c,c=0}}}t===s.length-1&&(l.push(new Qs({action:{type:"Arrival"},atLocation:r,distance:a-d<0?0:a-d,origin:e.destination})),d+=c,c=0),h=i,u=e}let p=[],m=null;for(let t=l.length-1;t>=0;t--){let e=l[t],{action:i}=e;i&&"TakeVortex"===i.type?(m=e.node,p.unshift(e)):i&&"Turn"===i.type&&null!=m?this.graph.getDistance(e.node,m)>5&&p.unshift(e):p.unshift(e)}return{distance:a,instructions:p,path:o}}};h(Tm,"Navigator");var A2=Tm;function q2(t){let e=+this._x.call(null,t),i=+this._y.call(null,t);return i4(this.cover(e,i),e,i,t)}function i4(t,e,i,n){if(isNaN(e)||isNaN(i))return t;var r,s,a,o,l,h,u,c,d,p=t._root,m={data:n},f=t._x0,g=t._y0,v=t._x1,y=t._y1;if(!p)return t._root=m,t;for(;p.length;)if((h=e>=(s=(f+v)/2))?f=s:v=s,(u=i>=(a=(g+y)/2))?g=a:y=a,r=p,!(p=p[c=u<<1|h]))return r[c]=m,t;if(o=+t._x.call(null,p.data),l=+t._y.call(null,p.data),e===o&&i===l)return m.next=p,r?r[c]=m:t._root=m,t;do{r=r?r[c]=new Array(4):t._root=new Array(4),(h=e>=(s=(f+v)/2))?f=s:v=s,(u=i>=(a=(g+y)/2))?g=a:y=a}while((c=u<<1|h)==(d=(l>=a)<<1|o>=s));return r[d]=p,r[c]=m,t}function r4(t){var e,i,n,r,s=t.length,a=new Array(s),o=new Array(s),l=1/0,h=1/0,u=-1/0,c=-1/0;for(i=0;i<s;++i)isNaN(n=+this._x.call(null,e=t[i]))||isNaN(r=+this._y.call(null,e))||(a[i]=n,o[i]=r,n<l&&(l=n),n>u&&(u=n),r<h&&(h=r),r>c&&(c=r));if(l>u||h>c)return this;for(this.cover(l,h).cover(u,c),i=0;i<s;++i)i4(this,a[i],o[i],t[i]);return this}function P2(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var i=this._x0,n=this._y0,r=this._x1,s=this._y1;if(isNaN(i))r=(i=Math.floor(t))+1,s=(n=Math.floor(e))+1;else{for(var a,o,l=r-i||1,h=this._root;i>t||t>=r||n>e||e>=s;)switch(o=(e<n)<<1|t<i,a=new Array(4),a[o]=h,h=a,l*=2,o){case 0:r=i+l,s=n+l;break;case 1:i=r-l,s=n+l;break;case 2:r=i+l,n=s-l;break;case 3:i=r-l,n=s-l}this._root&&this._root.length&&(this._root=h)}return this._x0=i,this._y0=n,this._x1=r,this._y1=s,this}function C2(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}function I2(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function _n(t,e,i,n,r){this.node=t,this.x0=e,this.y0=i,this.x1=n,this.y1=r}function L2(t,e,i){var n,r,s,a,o,l,h,u=this._x0,c=this._y0,d=this._x1,p=this._y1,m=[],f=this._root;for(f&&m.push(new _n(f,u,c,d,p)),null==i?i=1/0:(u=t-i,c=e-i,d=t+i,p=e+i,i*=i);l=m.pop();)if(!(!(f=l.node)||(r=l.x0)>d||(s=l.y0)>p||(a=l.x1)<u||(o=l.y1)<c))if(f.length){var g=(r+a)/2,v=(s+o)/2;m.push(new _n(f[3],g,v,a,o),new _n(f[2],r,v,g,o),new _n(f[1],g,s,a,v),new _n(f[0],r,s,g,v)),(h=(e>=v)<<1|t>=g)&&(l=m[m.length-1],m[m.length-1]=m[m.length-1-h],m[m.length-1-h]=l)}else{var y=t-+this._x.call(null,f.data),_=e-+this._y.call(null,f.data),x=y*y+_*_;if(x<i){var b=Math.sqrt(i=x);u=t-b,c=e-b,d=t+b,p=e+b,n=f.data}}return n}function O2(t){if(isNaN(s=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,i,n,r,s,a,o,l,h,u,c,d,p=this._root,m=this._x0,f=this._y0,g=this._x1,v=this._y1;if(!p)return this;if(p.length)for(;;){if((h=s>=(o=(m+g)/2))?m=o:g=o,(u=a>=(l=(f+v)/2))?f=l:v=l,e=p,!(p=p[c=u<<1|h]))return this;if(!p.length)break;(e[c+1&3]||e[c+2&3]||e[c+3&3])&&(i=e,d=c)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(r=p.next)&&delete p.next,n?(r?n.next=r:delete n.next,this):e?(r?e[c]=r:delete e[c],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(i?i[d]=p:this._root=p),this):(this._root=r,this)}function s4(t){for(var e=0,i=t.length;e<i;++e)this.remove(t[e]);return this}function R2(){return this._root}function N2(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}function k2(t){var e,i,n,r,s,a,o=[],l=this._root;for(l&&o.push(new _n(l,this._x0,this._y0,this._x1,this._y1));e=o.pop();)if(!t(l=e.node,n=e.x0,r=e.y0,s=e.x1,a=e.y1)&&l.length){var h=(n+s)/2,u=(r+a)/2;(i=l[3])&&o.push(new _n(i,h,u,s,a)),(i=l[2])&&o.push(new _n(i,n,u,h,a)),(i=l[1])&&o.push(new _n(i,h,r,s,u)),(i=l[0])&&o.push(new _n(i,n,r,h,u))}return this}function D2(t){var e,i=[],n=[];for(this._root&&i.push(new _n(this._root,this._x0,this._y0,this._x1,this._y1));e=i.pop();){var r=e.node;if(r.length){var s,a=e.x0,o=e.y0,l=e.x1,h=e.y1,u=(a+l)/2,c=(o+h)/2;(s=r[0])&&i.push(new _n(s,a,o,u,c)),(s=r[1])&&i.push(new _n(s,u,o,l,c)),(s=r[2])&&i.push(new _n(s,a,c,u,h)),(s=r[3])&&i.push(new _n(s,u,c,l,h))}n.push(e)}for(;e=n.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}function a4(t){return t[0]}function B2(t){return arguments.length?(this._x=t,this):this._x}function o4(t){return t[1]}function F2(t){return arguments.length?(this._y=t,this):this._y}function Ru(t,e,i){var n=new z2(null==e?a4:e,null==i?o4:i,NaN,NaN,NaN,NaN);return null==t?n:n.addAll(t)}function z2(t,e,i,n,r,s){this._x=t,this._y=e,this._x0=i,this._y0=n,this._x1=r,this._y1=s,this._root=void 0}function l4(t){for(var e={data:t.data},i=e;t=t.next;)i=i.next={data:t.data};return e}P(),P(),P(),P(),h(q2,"default"),h(i4,"add"),h(r4,"addAll"),P(),h(P2,"default"),P(),h(C2,"default"),P(),h(I2,"default"),P(),P(),h(_n,"default"),h(L2,"default"),P(),h(O2,"default"),h(s4,"removeAll"),P(),h(R2,"default"),P(),h(N2,"default"),P(),h(k2,"default"),P(),h(D2,"default"),P(),h(a4,"defaultX"),h(B2,"default"),P(),h(o4,"defaultY"),h(F2,"default"),h(Ru,"quadtree"),h(z2,"Quadtree"),h(l4,"leaf_copy");var ti=Ru.prototype=z2.prototype;ti.copy=function(){var t,e,i=new z2(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return i;if(!n.length)return i._root=l4(n),i;for(t=[{source:n,target:i._root=new Array(4)}];n=t.pop();)for(var r=0;r<4;++r)(e=n.source[r])&&(e.length?t.push({source:e,target:n.target[r]=new Array(4)}):n.target[r]=l4(e));return i},ti.add=q2,ti.addAll=r4,ti.cover=P2,ti.data=C2,ti.extent=I2,ti.find=L2,ti.remove=O2,ti.removeAll=s4,ti.root=R2,ti.size=N2,ti.visit=k2,ti.visitAfter=D2,ti.x=B2,ti.y=F2;var yr,fn,Ja=class{constructor(t){H(this,yr,void 0),w(this,"categories"),w(this,"locations"),w(this,"vortexes"),w(this,"maps"),w(this,"nodes"),w(this,"polygons"),w(this,"events"),w(this,"mapGroups"),w(this,"locationStates"),w(this,"rankings"),H(this,fn,{}),G(this,yr,t)}get polygonsByMapId(){if(_(this,fn).polygonsByMapId)return _(this,fn).polygonsByMapId;let t,e={};for(let i=0,n=_(this,yr).polygons.length;i<n;++i)t=_(this,yr).polygons[i],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let i=Object.entries(e).reduce(((t,[e,i])=>(t.set(e,i),t)),new Map);return _(this,fn).polygonsByMapId=i,_(this,fn).polygonsByMapId}get nodesByMapId(){if(_(this,fn).nodesByMapId)return _(this,fn).nodesByMapId;let t,e={};for(let i=0,n=_(this,yr).nodes.length;i<n;++i)t=_(this,yr).nodes[i],e[t.map.id]||(e[t.map.id]=[]),e[t.map.id].push(t);let i=Object.entries(e).reduce(((t,[e,i])=>(t.set(e,i),t)),new Map);return _(this,fn).nodesByMapId=i,_(this,fn).nodesByMapId}findNearestNodeOnMap(t,e){var i;if(_(this,fn).nodeTreesByMap||(_(this,fn).nodeTreesByMap=new Map),!_(this,fn).nodeTreesByMap.has(t)){let e=null!=(i=this.nodesByMapId.get(t))?i:[],n=Ru();n.x((t=>t.x)),n.y((t=>t.y)),n.addAll(e),_(this,fn).nodeTreesByMap.set(t,n)}return _(this,fn).nodeTreesByMap.get(t).find(e.x,e.y)}get locationsByMapId(){if(_(this,fn).locationsByMapId)return _(this,fn).locationsByMapId;let t,e={};for(let i=0,n=_(this,yr).locations.length;i<n;++i){t=_(this,yr).locations[i];for(let i=0,n=t.polygons.length;i<n;++i)e[t.polygons[i].map.id]||(e[t.polygons[i].map.id]=[]),e[t.polygons[i].map.id].push(t)}let i=Object.entries(e).reduce(((t,[e,i])=>(t.set(e,i),t)),new Map);return _(this,fn).locationsByMapId=i,_(this,fn).locationsByMapId}static create(t){return Ja.instances.has(t)||Ja.instances.set(t,new Ja(t)),Ja.instances.get(t)}static clear(){Ja.instances.clear()}},Nu=Ja;h(Nu,"MappedinCache"),yr=new WeakMap,fn=new WeakMap,w(Nu,"instances",new Map);var _i=Nu;P(),P(),P(),P(),P();var ea=class{constructor(t){w(this,"destinations",[]),this.destinations=t}};h(ea,"MappedinDestinationSet"),P();var ku,rs,ss=class{constructor(t,e){H(this,ku,void 0),H(this,rs,void 0),w(this,"distance",0),w(this,"path",[]),w(this,"instructions",[]),G(this,rs,t),G(this,ku,e),this.distance=e.distance,this.instructions=e.instructions.map((t=>{var e,i,n,r,s,a,o,l,h,u,c,d;let p=Ue(be({},t),{action:be({},t.action),atLocation:null!=(e=t.atLocation)&&e.id?null==(n=null==(i=_(this,rs))?void 0:i._vortexesById)?void 0:n[t.atLocation.id]:void 0,node:null!=(r=t.node)&&r.id?null==(a=null==(s=_(this,rs))?void 0:s._nodesById)?void 0:a[t.node.id]:void 0});return("TakeVortex"===(null==(o=p.action)?void 0:o.type)||"ExitVortex"===(null==(l=p.action)?void 0:l.type))&&(p.action.fromMap=null==(u=_(this,rs)._mapsById)?void 0:u[null==(h=p.action)?void 0:h.fromMap.id],p.action.toMap=null==(d=_(this,rs)._mapsById)?void 0:d[null==(c=p.action)?void 0:c.toMap.id]),p})),this.path=e.path.map((t=>{var e,i;return null==(i=null==(e=_(this,rs))?void 0:e._nodesById)?void 0:i[t.id]}))}toJSON(){return _(this,ku)}};h(ss,"MappedinDirections"),ku=new WeakMap,rs=new WeakMap;var ta,Ri=class{constructor(t){H(this,ta,void 0),G(this,ta,t)}directionsTo(t,e){if(t instanceof ea){let i=[],n=this;for(let r=0;r<t.destinations.length;r++){let s=t.destinations[r],a=Du(n),o=Du(s),l=_(this,ta).navigator.getDirections({originIds:a,destinationNodeIds:o,accessible:(null==e?void 0:e.accessible)||!1}),h=new ss(_(this,ta),l);i.push(h),n=s}return i}{let i=Du(this),n=Du(t),r=_(this,ta).navigator.getDirections({originIds:i,destinationNodeIds:n,accessible:(null==e?void 0:e.accessible)||!1});return new ss(_(this,ta),r)}}distanceTo(t,e){let i=this.directionsTo(t,e);return(null==i?void 0:i.distance)||0}};h(Ri,"MappedinNavigatable"),ta=new WeakMap;var VP=0,HP="9999-12-31T00:00:00.000Z";function GP(t,e,i=new Date){if(!t.states)return;let n=i||new Date,r=t.states.find((t=>{let e=new Date(t.start||VP),i=new Date(t.end||HP);return e<n&&i>n}));return r?e.find((t=>t.value===r.type)):void 0}h(GP,"getCurrentLocationState");var vr,na,bi,Fu,zu,Uu,Bu=class extends Ri{constructor(t,e){super(t),H(this,vr,void 0),H(this,na,void 0),H(this,bi,{}),w(this,"states"),w(this,"id",""),w(this,"name",""),w(this,"type",""),w(this,"description"),w(this,"sortOrder"),w(this,"logo"),w(this,"phone"),w(this,"social"),w(this,"color"),w(this,"shortName"),w(this,"detailsUrl"),w(this,"tags"),w(this,"externalId"),w(this,"showLabelWhenImagePresent"),w(this,"picture"),w(this,"operationHours"),w(this,"siblingGroups"),w(this,"gallery"),H(this,Fu,void 0),H(this,zu,[]),H(this,Uu,void 0),G(this,vr,t),G(this,na,e);let i=Object.assign({},e);delete i.categories,Object.assign(this,i)}get polygons(){let t=_(this,bi).polygons;if(void 0!==t)return t;let e=[],i=_(this,Fu),n=_(this,vr)._polygonsById;if(Array.isArray(i))for(let t=0,r=i.length;t<r;++t){let r=n[i[t].id];null!=r&&r.geometry.visible&&e.push(r)}return _(this,bi).polygons=e,e}set polygons(t){G(this,Fu,t)}get nodes(){let t=_(this,bi).nodes;if(void 0!==t)return t;let e=[],i=_(this,zu),n=_(this,vr)._nodesById;if(i)for(let t=0,r=i.length;t<r;++t){let r=n[i[t].node];null!=r&&e.push(r)}return _(this,bi).nodes=e,e}set nodes(t){G(this,zu,t)}get parent(){let t=_(this,bi).parent;if(void 0!==t)return t;let e,i=_(this,vr)._locationsById,n=_(this,Uu);return void 0!==n&&(e=i[n]),_(this,bi).parent=e,e}set parent(t){G(this,Uu,t)}get categories(){let t=_(this,bi).categories;if(void 0!==t)return t;let e=[];return _(this,na).categories.forEach((t=>{let i=_(this,vr).getCollectionItemById("categories",t);i&&e.push(i)})),_(this,bi).categories=e,e}get state(){return GP(this,_(this,vr).locationStates)}clone(){return new Bu(_(this,vr),_(this,na))}get nodeOperationHours(){let t=_(this,bi).nodeOperationHours;if(void 0!==t)return t;if(null==this.nodes)return{};let e=_(this,na).nodes.reduce(((t,e)=>(null!=e.operationHours&&(t[e.node]=e.operationHours),t)),{});return _(this,bi).nodeOperationHours=e,e}static hydrate(t,e){return t.map((t=>new Bu(e,t)))}static fetch(t){return Ge(this,null,(function*(){let e=t.options.things.locations.slice();t.options.things.categories&&rn(e,"categories"),t.options.things.nodes&&rn(e,"nodes"),t.options.things.polygons&&rn(e,"polygons"),t.options.things.locationStates&&rn(e,"states");let i={fields:e,venue:t.options.venue};try{let e=yield sn(t.options,"location",i);return t.options.includeHidden||(e=e.filter((t=>!t.hidden))),e.map((e=>new Bu(t,e)))}catch(t){return ge.error("Fetch Locations:",t),[]}}))}toJSON(){let t=_(this,na);return delete t.color,t}},Ni=Bu;h(Ni,"MappedinLocation"),vr=new WeakMap,na=new WeakMap,bi=new WeakMap,Fu=new WeakMap,zu=new WeakMap,Uu=new WeakMap,P();var ia,Fl,ki,Vu,Em=class extends Ri{constructor(t,e){super(t),H(this,ia,void 0),H(this,Fl,void 0),H(this,ki,{}),w(this,"geometry"),w(this,"perspectives"),w(this,"image"),w(this,"holes"),w(this,"textures"),w(this,"material"),w(this,"label"),w(this,"id",""),w(this,"layer"),w(this,"layerId"),w(this,"name"),w(this,"externalId"),w(this,"vertexes"),w(this,"canvasBounds"),H(this,Vu,void 0),G(this,ia,t),G(this,Fl,e);let i=Object.assign({},e);delete i.map,Object.assign(this,i)}get map(){let t=_(this,ki).map;if(void 0!==t)return t;let e=_(this,ia).getCollectionItemById("maps",_(this,Fl).map);return _(this,ki).map=e,e}get locations(){var t,e;let i=_(this,ki).locations;if(void 0!==i)return i;let n=[],r=null!=(e=null==(t=_i.instances.get(_(this,ia)))?void 0:t.locationsByMapId.get(this.map.id))?e:[],{id:s}=this;for(let t=0,e=r.length;t<e;++t){let e=r[t],i=e.polygons;if(Array.isArray(i))for(let t=0,r=i.length;t<r;++t)if(i[t].id===s){n.push(e);break}}return _(this,ki).locations=n,n}get entrances(){let t=_(this,ki).entrances;if(void 0!==t)return t;let e=[],i=_(this,Vu),n=_(this,ia)._nodesById;if(Array.isArray(i)){for(let t=0,r=i.length;t<r;++t){let r=n[i[t].id];null!=r&&e.push(r)}return _(this,ki).entrances=e,e}return[]}set entrances(t){G(this,Vu,t)}get rank(){let t=_(this,ki).rank;if(void 0!==t)return t;let{rankings:e}=_(this,ia);if(!e||!e.polygons)return null;let i=e.polygons.find((t=>t.polygonId===this.id));return i?(_(this,ki).rank={score:i.score,node:i.entranceNodeId},{score:i.score,node:i.entranceNodeId}):(_(this,ki).rank=null,null)}static hydrate(t,e){return t.map((t=>new Em(e,t)))}static fetch(t){return Ge(this,null,(function*(){let e=t.options.things.polygons.slice();t.options.things.maps&&rn(e,"map"),t.options.things.nodes&&rn(e,"entrances");let i={fields:e,venue:t.options.venue};try{return(yield sn(t.options,"polygon",i)).filter((t=>t.geometry.visible)).map((e=>new Em(t,e)))}catch(t){return ge.error("Fetch Polygons:",t),[]}}))}toJSON(){return _(this,Fl)}},xr=Em;function u4(t){return/^[\da-f]{24}$/i.test(t)}function c4(t,e=!1){let i="";if(null!=t){let n="?",r=e?Object.keys(t).filter((t=>!["slug","venue"].includes(t))):Object.keys(t);for(let e=0,s=r.length;e<s;++e){let s=r[e],a=t[s];null!=a&&(i+=`${n+encodeURIComponent(s)}=${encodeURIComponent(a)}`,n="&")}}return i}function jP(t,e,i,n=!1){var r,s;return n?`${t.supplementaryUrl}${e}?venue=${i.venue||i.slug}`:null!=(r=t.baseUrl)&&r.includes("gateway")?`${t.baseUrl}${e}/${i.venue||i.slug}${c4(i,null==(s=t.baseUrl)?void 0:s.includes("gateway"))}`:t.baseUrl+e+c4(i)}function sn(t,e,i,n=!1){return Ge(this,null,(function*(){return U2(t,e,i,n,!0)}))}function U2(t,e,i,n=!1,r=!1){return Ge(this,null,(function*(){let s=jP(t,e,i,n),a=yield Sm(t,s,n);if(!r&&Array.isArray(a)){if(1===a.length)return a[0];throw new Error("Invalid response object")}return a}))}function Sm(t,e,i=!1){return Ge(this,null,(function*(){let n={language:t.language,clientId:t.clientId,clientSecret:t.clientSecret};i&&delete n.language,n.language&&(e+=`&lang=${encodeURIComponent(n.language)}`);let{headers:r}=t;r["Content-Type"]="text/json",t.authorization&&(r.Authorization=t.authorization),n.language&&(r["Accept-Language"]=n.language);let s={method:"GET",headers:r},a=yield _r()(e,s);if(!a.ok)throw new Error(`${a.status} ${a.statusText}`);return a.json()}))}function rn(t,e){t.indexOf(e)<0&&t.push(e)}function h4([t,e],[i,n]){let r=new Be(t,e),s=new Be(i,n);return r.distanceTo(s)}function d4(t){if(t.scale||t.x_scale)return 1/(t.scale||t.x_scale);let e;try{let i=t.georeference[0],n=t.georeference[2],r=new Be(i.target.x,i.target.y),s=new Be(n.target.x,n.target.y),a=r.distanceTo(s),o=i.control.x-n.control.x,l=i.control.y-n.control.y;e=Math.sqrt(o*o+l*l)/a}catch(i){e=1,ge.warn(i),ge.warn(`Couldn't georeference ${t.name||t.shortName||t.id}. Probably not enough geocoordinates.`)}return e}function Du(t){var e;return t instanceof xr?t.entrances.map((t=>t.id)):t instanceof Ni?(null==(e=t.nodes)?void 0:e.map((t=>t.id)))||[]:[t.id]}function p4(t){return Ge(this,null,(function*(){let e={},{maps:i,images:n,scenes:r,polygons:s}=t;if(null!=n)try{let t=Object.keys(n).map((t=>fetch(`data:image/png;base64,${n[t]}`).then((t=>t.blob())).then((i=>{e[t]=i})).catch((t=>{ge.error(t)}))));yield Promise.all(t)}catch(t){ge.error(t)}return i.forEach((t=>{var i;(null!=(i=t.scene)&&i.polygons||r[t.id])&&(null!=r&&r[t.id]&&(t.scene||(t.scene={}),Object.defineProperty(t.scene,"polygons",{get:()=>r[t.id]})),null!=n&&(t.scene.images=t.scene.images.map((({filename:t})=>({filename:t,url:e[t]}))),t.scene.polygons.forEach((t=>{var i,n;if(null!=(i=null==t?void 0:t.image)&&i.url&&null!=(n=null==t?void 0:t.image)&&n.url){let i=t.image.url.split("/"),n=e[i[i.length-1]];n&&(t.image.url=n)}}))))})),null!=n&&s.forEach((t=>{var i;if(null!=(i=null==t?void 0:t.image)&&i.url){let i=t.image.url.split("/"),n=e[i[i.length-1]];n&&(t.image.url=n)}})),null!=t.images&&delete t.images,null!=t.scenes&&delete t.scenes,t}))}function V2(t,e,i){let n;return function(){let r=this,s=arguments,a=h((function(){n=null,i||t.apply(r,s)}),"later"),o=i&&!n;clearTimeout(n),n=setTimeout(a,e),o&&t.apply(r,s)}}h(xr,"MappedinPolygon"),ia=new WeakMap,Fl=new WeakMap,ki=new WeakMap,Vu=new WeakMap,h(u4,"isGatewayKey"),h(c4,"stringifyQuery"),h(jP,"buildUrl"),h(sn,"getArray"),h(U2,"getObject"),h(Sm,"generateAPIRequest"),h(rn,"addToSet"),h(h4,"getDistanceBetweenLatLon"),h(d4,"getMapScale"),h(Du,"getNodesForNavigatable"),h(p4,"populateBundledImagesAsBlobs"),h(V2,"debounce");var Hu,Gu,ju,Am=class{constructor(t,e){H(this,Hu,void 0),H(this,Gu,{}),H(this,ju,void 0),w(this,"name"),w(this,"externalId"),w(this,"parents"),w(this,"id"),w(this,"icon"),this.id=e.id,G(this,ju,e),G(this,Hu,t),Object.assign(this,e)}get locations(){var t;let e=_(this,Gu).locations;if(void 0!==e)return e;let i=[],{locations:n}=_(this,Hu),{id:r}=this;for(let e=0,s=n.length;e<s;++e){let s=n[e],a=s.categories;if(Array.isArray(a))for(let e=0,n=a.length;e<n;++e)if((null==(t=a[e])?void 0:t.id)===r){i.push(s);break}}return _(this,Gu).locations=i,i}static hydrate(t,e){return t.map((t=>new Am(e,t)))}static fetch(t){return Ge(this,null,(function*(){let e={fields:t.options.things.categories,venue:t.options.venue};try{return(yield sn(t.options,"category",e)).map((e=>new Am(t,e)))}catch(t){return ge.error("Fetch Categories:",t),[]}}))}toJSON(){return _(this,ju)}},br=Am;h(br,"MappedinCategory"),Hu=new WeakMap,Gu=new WeakMap,ju=new WeakMap,P();var Wu,zl,Xu,qm=class{constructor(t,e){H(this,Wu,void 0),H(this,zl,void 0),H(this,Xu,{}),w(this,"id",""),w(this,"type",""),w(this,"name",""),w(this,"description"),w(this,"image"),w(this,"startDate"),w(this,"endDate"),w(this,"showDate"),G(this,zl,e),G(this,Wu,t),Object.assign(this,e)}location(){let t=_(this,Xu).location;if(void 0!==t)return t;let e,i=_(this,Wu)._locationsById,n=_(this,zl).location;if(null!=n){let t=i[n];null!=t&&(e=t)}return _(this,Xu).location=e,e}static hydrate(t,e){return t.map((t=>new qm(e,t)))}static fetch(t){return Ge(this,null,(function*(){let e=t.options.things.events.slice();t.options.things.locations&&rn(e,"location");let i={fields:e,venue:t.options.venue,activeAtOrAfter:Date.now()};try{return(yield sn(t.options,"event",i)).map((e=>new qm(t,e)))}catch(t){return ge.error("Fetch Events:",t),[]}}))}toJSON(){return _(this,zl)}},ra=qm;h(ra,"MappedinEvent"),Wu=new WeakMap,zl=new WeakMap,Xu=new WeakMap,P();var Zu,Pm=class{constructor(t){H(this,Zu,void 0),w(this,"id",""),w(this,"name",""),w(this,"value",""),G(this,Zu,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Pm(t)))}static fetch(t){return Ge(this,null,(function*(){let e={fields:t.options.things.locationStates.slice(),venue:t.options.venue};try{return(yield sn(t.options,"location-state",e)).map((t=>new Pm(t)))}catch(t){return ge.error("Fetch Location States:",t),[]}}))}toJSON(){return _(this,Zu)}},Yu=Pm;h(Yu,"MappedinLocationState"),Zu=new WeakMap,P(),P();var Ju,H2,$u,G2,Ku,Qu,Cm,f4,Im,m4,Mr,wr,Tr,Er,os=class{constructor(t){H(this,Ju),H(this,$u),H(this,Cm),H(this,Im),w(this,"map"),H(this,Ku,{}),H(this,Qu,void 0),H(this,Mr,void 0),H(this,wr,void 0),H(this,Tr,void 0),H(this,Er,void 0);let{map:e,mappedin:i}=t;null!=t.lat&&null!=t.lon&&(G(this,Mr,t.lat),G(this,wr,t.lon)),null!=t.x&&null!=t.y&&(G(this,Tr,t.x),G(this,Er,t.y)),this.map=e,G(this,Qu,i)}get x(){return at(this,$u,G2).call(this,"x")}get y(){return at(this,$u,G2).call(this,"y")}get lat(){return at(this,Ju,H2).call(this,"lat")}get lon(){return at(this,Ju,H2).call(this,"lon")}absoluteDistanceTo(t){return h4([t.lat,t.lon],[this.lat,this.lon])}get nearestNode(){let t=_(this,Ku).nearestNode;if(void 0!==t)return t;let e=_i.instances.get(_(this,Qu)).findNearestNodeOnMap(this.map.id,this);return _(this,Ku).nearestNode=e,e}toJSON(){return{x:this.x,y:this.y,map:this.map,lat:this.lat,lon:this.lon}}};h(os,"MappedinCoordinate"),Ju=new WeakSet,H2=h((function(t){if(_(this,Mr)&&_(this,wr))return _(this,"lat"===t?Mr:wr);if(null!=_(this,Tr)&&null!=_(this,Er)){let[e,i]=at(this,Im,m4).call(this,_(this,Tr),_(this,Er));return G(this,Mr,e),G(this,wr,i),_(this,"lat"===t?Mr:wr)}throw Error("MappedinCoordinate is missing x and y")}),"#getLatLon"),$u=new WeakSet,G2=h((function(t){if(_(this,Tr)&&_(this,Er))return _(this,"x"===t?Tr:Er);if(null!=_(this,Mr)&&null!=_(this,wr)){let[e,i]=at(this,Cm,f4).call(this,_(this,Mr),_(this,wr));return G(this,Tr,e),G(this,Er,i),_(this,"x"===t?Tr:Er)}throw Error("MappedinCoordinate is missing lat and lon")}),"#getXY"),Ku=new WeakMap,Qu=new WeakMap,Cm=new WeakSet,f4=h((function(t,e){let i=this.map.georeference[0],n=new Be(i.target.x,i.target.y),r=new Be(t,e),s=n.distanceTo(r),a=(n.finalBearingTo(r)+360)%360*Math.PI/180||0,o=s*(1/this.map.scale),l=a+this.map.getNorth(),h=Math.sin(l)*o,u=Math.cos(l)*o;return[i.control.x+h,i.control.y-u]}),"#latLonToXY"),Im=new WeakSet,m4=h((function(t,e){let i,n=this.map.georeference[0],r=new Be(n.target.x,n.target.y),s=t-n.control.x,a=n.control.y-e,o=Math.atan2(s,a);i=0===s&&0===a?0:0===s?a:s/Math.sin(o);let l=o-this.map.getNorth(),h=i/this.map._scale,u=r.destinationPoint(h,180*l/Math.PI);return[u.lat,u.lon]}),"#xyToLatLon"),Mr=new WeakMap,wr=new WeakMap,Tr=new WeakMap,Er=new WeakMap;var Sr,eh,th,Lm=class{constructor(t,e){H(this,Sr,void 0),H(this,eh,{}),H(this,th,void 0),w(this,"id",""),w(this,"group",""),w(this,"name",""),w(this,"shortName",""),w(this,"elevation",0),w(this,"scale",0),w(this,"layers"),w(this,"x_scale"),w(this,"perspectiveId"),w(this,"scene"),w(this,"width",0),w(this,"height",0),w(this,"georeference",[]),w(this,"_scale",0),G(this,Sr,t),G(this,th,e),Object.assign(this,e),this._scale=d4(this),this.scale=this.x_scale||1/this._scale}get polygons(){var t,e,i;return null!=(i=null==(e=null==(t=_i.instances.get(_(this,Sr)))?void 0:t.polygonsByMapId)?void 0:e.get(this.id))?i:[]}get locations(){var t,e,i;return null!=(i=null==(e=null==(t=_i.instances.get(_(this,Sr)))?void 0:t.locationsByMapId)?void 0:e.get(this.id))?i:[]}get nodes(){var t,e,i;return null!=(i=null==(e=null==(t=_i.instances.get(_(this,Sr)))?void 0:t.nodesByMapId)?void 0:e.get(this.id))?i:[]}get mapGroup(){let t=_(this,eh).mapGroup;if(void 0!==t)return t;let e=this.group,i=e&&_(this,Sr)._mapGroupsById[e]||null;return _(this,eh).mapGroup=i,i}createCoordinateByXY(t,e){return new os({x:t,y:e,map:this,mappedin:_(this,Sr)})}createCoordinate(t,e){return new os({lat:t,lon:e,map:this,mappedin:_(this,Sr)})}getNorth(){let t;try{let e=this.georeference[0],i=this.georeference[2],n=new Be(e.target.x,e.target.y),r=new Be(i.target.x,i.target.y);t=-((n.finalBearingTo(r)+0)*Math.PI/180-Math.atan2(i.control.y-e.control.y,i.control.x-e.control.x)-Math.PI/2)}catch(e){t=0,ge.warn(e),ge.warn(`Couldn't georeference ${this.name||this.shortName||this.id}. Probably not enough geocoordinates.`)}return t}static hydrate(t,e){return t.map((t=>new Lm(e,t)))}static fetch(t){return Ge(this,null,(function*(){let e=t.options.things.maps.slice();t.options.perspective&&rn(e,"perspectives"),t.options.things.mapGroups&&rn(e,"group"),rn(e,"elevation"),rn(e,"x_scale"),rn(e,"scale"),rn(e,"georeference");let i={fields:e,perspective:t.options.perspective,venue:t.options.venue};try{let r=yield sn(t.options,"map",i),s=h((t=>{let e=n.layers.find((e=>e.id===t));e?e.visible=!0:n.layers.push({id:t,visible:!0})}),"setVisibleLayer");for(let i=0,a=r.length;i<a;++i){var n=r[i];if(n){let t=n.perspective;null!=t&&(n.perspectiveId=t.id,e.indexOf("scene")>-1&&(n.scene=t.scene),t.layers?(n.layers.forEach((t=>{t.visible=!1})),t.layers.forEach(s)):n.layers.forEach((t=>{t.visible=!0}))),delete n.perspective}r[i]=new Lm(t,n)}return r}catch(t){return ge.error("Fetch Maps:",t),[]}}))}toJSON(){return _(this,th)}},sa=Lm;h(sa,"MappedinMap"),Sr=new WeakMap,eh=new WeakMap,th=new WeakMap,P();var nh,Ul,ih,Om=class{constructor(t,e){H(this,nh,void 0),H(this,Ul,void 0),H(this,ih,{}),w(this,"id",""),w(this,"name",""),G(this,Ul,e),G(this,nh,t),Object.assign(this,e)}get maps(){let t=_(this,ih).maps;if(void 0!==t)return t;let e=[],{maps:i}=_(this,nh),{id:n}=_(this,Ul);for(let t=0,r=i.length;t<r;++t){let r=i[t];r.group===n&&e.push(r)}return _(this,ih).maps=e,e}static hydrate(t,e){return t.map((t=>new Om(e,t)))}static fetch(t){return Ge(this,null,(function*(){let e={fields:t.options.things.mapGroups.slice(),venue:t.options.venue};try{return(yield sn(t.options,"map-group",e)).map((e=>new Om(t,e)))}catch(t){return ge.error("Fetch Map Groups:",t),[]}}))}toJSON(){return _(this,Ul)}},aa=Om;h(aa,"MappedinMapGroup"),nh=new WeakMap,Ul=new WeakMap,ih=new WeakMap,P();var Ar,Vl,Nn,rh,Rm=class extends Ri{constructor(t,e){super(t),H(this,Ar,void 0),H(this,Vl,void 0),H(this,Nn,{}),w(this,"id",""),w(this,"x",0),w(this,"y",0),w(this,"operationHours"),w(this,"externalId"),H(this,rh,void 0),G(this,Ar,t),G(this,Vl,e);let i=Object.assign({},e);delete i.map,Object.assign(this,i)}get map(){let t=_(this,Nn).map;if(void 0!==t)return t;let e=_(this,Ar).getCollectionItemById("maps",_(this,Vl).map);return _(this,Nn).map=e,e}get lat(){var t;let e=_(this,Nn).cachedLatLon;if(null!=e)return e.lat;let i=null==(t=_(this,Ar)._mapsById)?void 0:t[this.map.id];if(null==i)throw new Error("Map not found");return _(this,Nn).cachedLatLon=i.createCoordinateByXY(this.x,this.y),_(this,Nn).cachedLatLon.lat}get lon(){var t;let e=_(this,Nn).cachedLatLon;if(null!=e)return e.lon;let i=null==(t=_(this,Ar)._mapsById)?void 0:t[this.map.id];if(null==i)throw new Error("Map not found");return _(this,Nn).cachedLatLon=i.createCoordinateByXY(this.x,this.y),_(this,Nn).cachedLatLon.lon}get paths(){let t=_(this,Nn).paths;if(void 0!==t)return t;let e=[],i=_(this,Ar)._nodesById,n=_(this,rh);if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=i[n[t].node];null!=r&&e.push(r)}return _(this,Nn).paths=e,e}set paths(t){G(this,rh,t)}get locations(){var t,e,i;let n=_(this,Nn).locations;if(void 0!==n)return n;let r=[],s=null!=(i=null==(e=null==(t=_i.instances.get(_(this,Ar)))?void 0:t.locationsByMapId)?void 0:e.get(this.map.id))?i:[],a=this.id;for(let t=0,e=s.length;t<e;++t){let e=s[t],i=e.nodes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;++t)if(i[t].id===a){r.push(e);break}}return _(this,Nn).locations=r,r}get polygon(){var t,e,i;let n=_(this,Nn).polygon;if(void 0!==n)return n;let r,s=null!=(i=null==(e=null==(t=_i.instances.get(_(this,Ar)))?void 0:t.polygonsByMapId)?void 0:e.get(this.map.id))?i:[],a=this.id;for(let t=0,e=s.length;t<e;++t){let e=s[t];e.entrances.map((t=>t.id)).includes(a)&&(r=e)}return _(this,Nn).polygon=r,r}static hydrate(t,e){return t.map((t=>new Rm(e,t)))}static fetch(t){return Ge(this,null,(function*(){let e=t.options.things.nodes.slice();t.options.things.maps&&rn(e,"map"),["weight","multiplier","accessible"].forEach((function(t){rn(e,t)}));let i={fields:e,venue:t.options.venue};try{return(yield sn(t.options,"node",i)).map((e=>new Rm(t,e)))}catch(t){return ge.error("Fetch Nodes:",t),[]}}))}toJSON(){return _(this,Vl)}},Di=Rm;h(Di,"MappedinNode"),Ar=new WeakMap,Vl=new WeakMap,Nn=new WeakMap,rh=new WeakMap,P();var sh,Nm=class{constructor(t){H(this,sh,void 0),w(this,"polygons",[]),G(this,sh,t),Object.assign(this,t)}static hydrate(t){return new Nm(t)}static fetch(t){return Ge(this,null,(function*(){try{let e=yield U2(t.options,"smart-labels/polygon-label-ranking",{venue:t.options.venue},!0);return new Nm(e)}catch(t){return ge.error("Fetch Rankings:",t),null}}))}toJSON(){return _(this,sh)}},$a=Nm;h($a,"MappedinRankings"),sh=new WeakMap,P();var oh,km=class{constructor(t){w(this,"id",""),H(this,oh,void 0),G(this,oh,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new km(t)))}static fetch(t){return Ge(this,null,(function*(){let e={fields:t.options.things.themes.slice(),venue:t.options.venue};try{return(yield sn(t.options,"apollo-theme",e)).map((t=>new km(t)))}catch(t){return ge.error("Fetch Theme:",t),[]}}))}toJSON(){return _(this,oh)}},ah=km;h(ah,"MappedinTheme"),oh=new WeakMap,P();var lh,ch,Hl,Dm=class{constructor(t,e){H(this,lh,void 0),H(this,ch,void 0),H(this,Hl,{}),w(this,"defaultMap",""),w(this,"address",""),w(this,"city",""),w(this,"countrycode",""),w(this,"externalId",""),w(this,"id",""),w(this,"latitude"),w(this,"logo"),w(this,"longitude"),w(this,"metadata"),w(this,"name",""),w(this,"operationHours"),w(this,"postal",""),w(this,"slug",""),w(this,"state",""),w(this,"telephone",""),w(this,"tzid",""),w(this,"tzidOverride",""),w(this,"utcOffset",""),w(this,"website",""),G(this,ch,t),G(this,lh,e),Object.assign(this,e)}static hydrate(t,e){return new Dm(e,t)}static fetch(t){return Ge(this,null,(function*(){let e={fields:t.options.things.venue,slug:t.options.venue,limit:1};try{let i=yield sn(t.options,"venue",e);return new Dm(t,i[0])}catch(t){return ge.error("Fetch Venue:",t),{}}}))}get isMultiBuilding(){if(null==_(this,Hl).isMultiBuilding){let t=_(this,ch).maps,e=t.reduce(((t,e)=>t.add(e.elevation)),new Set),i=t.length!==e.size;_(this,Hl).isMultiBuilding=i}return _(this,Hl).isMultiBuilding}toJSON(){return _(this,lh)}},oa=Dm;h(oa,"MappedinVenue"),lh=new WeakMap,ch=new WeakMap,Hl=new WeakMap,P();var uh,Bm=class{constructor(t){w(this,"id",""),H(this,uh,void 0),w(this,"name"),w(this,"type"),w(this,"weight"),w(this,"multiplier"),G(this,uh,t),Object.assign(this,t)}static hydrate(t){return t.map((t=>new Bm(t)))}static fetch(t){return Ge(this,null,(function*(){let e=t.options.things.vortexes.slice();["name","type","accessible","weight","multiplier","nodes"].forEach((function(t){rn(e,t)}));let i={fields:e,venue:t.options.venue};try{return(yield sn(t.options,"vortex",i)).map((t=>new Bm(t)))}catch(t){return ge.error("Fetch Vortexes:",t),[]}}))}toJSON(){return _(this,uh)}},la=Bm;function WP(t,e){let i=[];return t.features.forEach((t=>{var n,r;let s=[];null==(n=t.properties.spaces)||n.forEach((t=>{if("id"in t){let i;i=e.get(t.id),i&&s.push(...i)}else null==s||s.push({id:t.node,level:""})}));let a=s.map((t=>({node:"n_"+t.id,map:t.level}))),o=null==(r=t.properties.spaces)?void 0:r.filter((t=>"id"in t)),l=(t.properties.hours||[]).map((t=>Ue(be({},t),{"@type":"OpeningHoursSpecification",dayOfWeek:[t.dayOfWeek.replace("http://schema.org/","")]}))),h=Ue(be({},t.properties),{polygons:o||[],nodes:a||[],description:t.properties.description||"",logo:t.properties.logo||{},picture:t.properties.picture||{},phone:t.properties.phone||{},social:t.properties.social||{},externalId:t.properties.externalId||"",states:t.properties.states||[],siblingGroups:t.properties.siblingGroups||[],operationHours:l});delete h.spaces,i.push(h)})),i}function XP(t){let e=new Set;return t.features.forEach((t=>{var i;null==(i=t.properties.states)||i.forEach((t=>{e.add(t.type)}))})),Array.from(e).map((t=>({id:t,name:t,value:t})))}function YP(t){let e=[];return t.features.forEach((t=>{let i=Ue(be({},t.properties),{icon:t.properties.picture});delete i.picture,e.push(i)})),e}function ZP(t){let e=1/0,i=1/0,n=-1/0,r=-1/0;return t.features.forEach((t=>{let s;s="MultiPolygon"===t.geometry.type?t.geometry.coordinates[0].flat():t.geometry.coordinates[0],s.forEach((t=>{e=Math.min(e,t[1]),n=Math.max(n,t[1]),i=Math.min(i,t[0]),r=Math.max(r,t[0])}))})),{id:t.features[0].properties.id,minLat:e,minLong:i,maxLat:n,maxLong:r}}function JP(t,e,i){let n=i.createGeoreferences(),r=[];return t.features.forEach((t=>{let s=new Set;e.forEach((t=>{t.layer&&s.add(t.layer)}));let a=[...s].map((t=>({id:t,visible:!0}))),o=1/i.mapScale,l=Ue(be({},t.properties),{georeference:n,shortName:t.properties.abbreviation||"",scene:{polygons:e},scale:o,x_scale:o,group:t.properties.building,layers:a,width:i.widthInMapUnits,height:i.heightInMapUnits});r.push(l)})),r}h(la,"MappedinVortex"),uh=new WeakMap,P(),h(WP,"convertLocations"),h(XP,"convertLocationStates"),h(YP,"convertCategories"),h(ZP,"getMapExtent"),h(JP,"convertMaps");var Fm=class{constructor(t){w(this,"mapExtent"),w(this,"stretchRatio"),w(this,"midLat"),w(this,"midLong"),w(this,"mapUnitRatio",1e6),w(this,"latDistance"),w(this,"longDistance"),w(this,"mapScale"),w(this,"widthInMapUnits"),w(this,"heightInMapUnits"),this.mapExtent=t;let{minLat:e,minLong:i,maxLat:n,maxLong:r}=t,s=(e+n)/2,a=(i+r)/2,o=new Be(s,r),l=new Be(s,i),h=new Be(e,a),u=new Be(n,a);this.latDistance=h.distanceTo(u),this.longDistance=o.distanceTo(l);let c=this.latDistance/this.longDistance,d=(n-e)/(r-i);this.stretchRatio=c/d,this.midLat=s,this.midLong=a,this.widthInMapUnits=(r-i)*this.mapUnitRatio,this.heightInMapUnits=(n-e)*this.mapUnitRatio*this.stretchRatio,this.mapScale=this.widthInMapUnits/this.longDistance}convert(t){let e=t[1];return{x:(t[0]-this.midLong)*this.mapUnitRatio,y:(this.midLat-e)*this.mapUnitRatio*this.stretchRatio}}createGeoreferences(){let{minLat:t,minLong:e,maxLat:i,maxLong:n}=this.mapExtent;return[[t,e],[t,n],[i,n],[i,e]].map((t=>({target:{x:t[0],y:t[1]},control:this.convert([t[1],t[0]])})))}};function $P(t,e){let i=[];return t.features.forEach((t=>{let n=e.convert(t.geometry.coordinates),r=(t.properties.neighbors||[]).map((e=>({node:e,map:t.properties.level}))),s=t.properties.level,a=Ue(be({},t.properties),{x:n.x,y:n.y,paths:r,map:s,externalId:t.properties.externalId||""});i.push(a)})),i}h(Fm,"CoordinateConverter"),h($P,"convertNodes");var g4=h(((t,e,i,n,r)=>{let s=[];return t.features.forEach((t=>{if(!t.geometry.coordinates[0].forEach)return;let a=[];"entrances"in t.properties&&(a=t.properties.entrances.map((t=>({id:"n_"+t.id,node:"n_"+t.id,map:t.level}))));let o,l=i[t.properties.id],h=e.find((t=>t.id===l)),u=t.geometry.coordinates[0].map((t=>r.convert(t))),c=n.find((e=>e.polygonId===t.properties.id)),d=Math.max(r.widthInMapUnits,r.heightInMapUnits)/1e3;if(c){let t=r.convert([c.position[0],c.position[1]]),e=c.size.x,i=c.size.y,n=r.mapScale,s=i*n,a=e*n/d/c.viewBox.width,l=s/d/c.viewBox.height;o={url:null==h?void 0:h.image,visible:!(null==h||!h.image),viewBox:c.viewBox,scale:{x:a,y:l},position:{x:t.x,y:t.y},rotation:c.rotation,useLocalScaling:!1,_isAbsolutelyPositioned:!0}}let p=Ue(be({},t.properties),{entrances:a,map:t.properties.level,externalId:t.properties.externalId||"",geometry:{visible:!0,position:{x:0,y:0,z:((null==h?void 0:h.altitude)||0)*r.mapScale/d},scale:{x:1,y:1,z:((null==h?void 0:h.height)||1)*r.mapScale/d}},material:{color:(null==h?void 0:h.color)||"#000000"},image:o,vertexes:u});s.push(p)})),s}),"generateMappedinPolygons");function KP(t,e,i,n,r,s){let a=g4(t,i,n,r,s),o=g4(e,i,n,r,s);return a.concat(o)}function QP(t){let e=new Map;return t.forEach((t=>{t.features.forEach((t=>{let{destinations:i}=t.properties;if(0===i.length)return;let n=i[0].split("-")[0],r=e.get(n),s=i.map((t=>t.split("-")[1])).map((t=>"n_"+t));if(r)r.nodes.push(...s);else{let{name:i,type:r,weight:a,multiplier:o,accessible:l}=t.properties,h={id:n,nodes:s,name:i,type:r,weight:a,multiplier:o,accessible:l};e.set(n,h)}}))})),Array.from(e.values())}function eC(t){let e=[];return t.features.forEach((t=>{let i=be({},t.properties);e.push(i)})),e}function y4(t){let e=Array.from(t.connection.values()),i=Array.from(t.level.values()),n=t.building,r=t.category,s=t.style,a=t.location,o=t.imageInstance,l=t.polygonStyle,h={},u=[],c=new Map;i.forEach((e=>{let i=e.features[0].properties.id,n=ZP(e),r=new Fm(n);c.set(i,r);let a=t.obstruction.get(i),d=t.space.get(i),p=o.get(i),m=l.get(i);h[i]=KP(d,a,s,m,p,r);let f=t.node.get(i);u.push(...$P(f,r))}));let d=Object.values(h).flat(),p=QP(e),m=i.map((t=>{let e=t.features[0].properties.id,i=c.get(e);return JP(t,h[e],i)})).flat(),f=new Map;Array.from(t.space.values()).forEach((t=>{t.features.forEach((t=>{f.set(t.properties.id,t.properties.entrances)}))}));let g=eC(n),v=WP(a,f),y=YP(r),_=XP(a),x=t.manifest.features[0].properties.name,b=t.manifest.features[0].geometry.coordinates[0],w=t.manifest.features[0].geometry.coordinates[1],M=t.imageBinaries;return{locations:v,categories:y,nodes:u,maps:m,polygons:d,vortexes:p,mapGroups:g,locationStates:_,themes:[],venue:{name:x,latitude:w,longitude:b},imageBinaries:M}}h(KP,"convertPolygons"),h(QP,"convertVortexes"),h(eC,"convertMapGroups"),h(y4,"convertMVFToMappedin");var ca,jl,j2={supplementaryUrl:"https://api-gateway.mappedin.com/analytics/",headers:{},accessToken:"",clientId:"",noAuth:!1,includeHidden:!0,clientSecret:"",apiGateway:"",authorization:"",perspective:"Website",language:"",things:{},venue:""},as=(t=>(t.CATEGORY="categories",t.EVENT="events",t.LOCATION="locations",t.MAPGROUP="mapGroups",t.MAP="maps",t.NODE="nodes",t.POLYGON="polygons",t.VORTEX="vortexes",t))(as||{}),Gl={categories:br,locations:Ni,vortexes:la,maps:sa,nodes:Di,polygons:xr,venue:oa,events:ra,mapGroups:aa,themes:ah,locationStates:Yu,rankings:$a},qr=class{constructor(t){w(this,"perspective"),w(this,"things"),w(this,"options"),H(this,ca,void 0),H(this,jl,""),w(this,"updatedAt"),w(this,"categories",[]),w(this,"locations",[]),w(this,"vortexes",[]),w(this,"maps",[]),w(this,"nodes",[]),w(this,"polygons",[]),w(this,"venue",{}),w(this,"events",[]),w(this,"mapGroups",[]),w(this,"themes",[]),w(this,"locationStates",[]),w(this,"rankings"),w(this,"_categoriesById"),w(this,"_locationsById"),w(this,"_vortexesById"),w(this,"_mapsById"),w(this,"_nodesById"),w(this,"_polygonsById"),w(this,"_eventsById"),w(this,"_mapGroupsById"),w(this,"_locationStatesById"),w(this,"_locationRankingsById"),w(this,"_rankingsById"),w(this,"_categoriesByExternalId"),w(this,"_locationsByExternalId"),w(this,"_vortexesByExternalId"),w(this,"_mapsByExternalId"),w(this,"_nodesByExternalId"),w(this,"_polygonsByExternalId"),w(this,"_eventsByExternalId"),w(this,"_mapGroupsByExternalId"),w(this,"_locationStatesByExternalId"),w(this,"_locationRankingsByExternalId"),w(this,"_rankingsByExternalId"),w(this,"images"),w(this,"imageBinaries"),w(this,"scenes"),w(this,"analytics"),w(this,"navigator"),this.options=t,G(this,ca,_i.create(this));let e=new Pr(Ue(be({},t),{testMode:!(null!=t&&t.emitAnalyticsEvents)}));this.analytics={locationSelected:e.locationSelected,categorySelected:e.categorySelected,getDirections:e.getDirections},globalThis.MappedinDebug||(globalThis.MappedinDebug={enable(){globalThis.sessionStorage.setItem(Jg,"true")}})}generateGetters(t){try{for(let e=0,i=t.length;e<i;++e){let i=t[e];Array.isArray(this[i])&&(Object.defineProperty(this,`_${i}ByExternalId`,{get(){let t=_(this,ca)[i];if(null!=t)return t;let e={};return this[i].forEach((t=>e[t.externalId]=t)),_(this,ca)[i]=e,e}}),Object.defineProperty(this,`_${i}ById`,{get(){let t=_(this,ca)[i];if(null!=t)return t;let e={};return this[i].forEach((t=>e[t.id]=t)),_(this,ca)[i]=e,e}}))}return this}catch(t){throw new Error(t)}}getCollectionItemById(t,e){let i=`_${t}ByExternalId`,n=this[`_${t}ById`];return null!=n&&null!=n[e]||(n=this[i],null!=n&&null!=n[e])?n[e]:null}hydrateFromMVF(t){return Ge(this,null,(function*(){let e=y4(t);return this.hydrate(e)}))}hydrate(t,e){return Ge(this,null,(function*(){let i;if("string"==typeof t)try{G(this,jl,t),i=JSON.parse(t)}catch(t){return void ge.error("Unable to parse JSON",t)}else i=t,G(this,jl,JSON.stringify(i));let n=Object.keys(i);for(let t=0,e=n.length;t<e;++t){let e=n[t],r=i[e];null!=Gl[e]&&"function"==typeof Gl[e].hydrate&&(this[e]=Gl[e].hydrate(r,this))}e&&(yield p4(i));let{images:r,scenes:s,imageBinaries:a}=i;this.images=r,this.scenes=s,this.imageBinaries=a,this.generateGetters(n),this.initNavigator()}))}fetch(){return Ge(this,null,(function*(){"vortexes"in this.options.things||(this.options.things.vortexes=["name","type","accessible","weight","multiplier","nodes"]),"locationStates"in this.options.things||(this.options.things.locationStates=["name","id","value"]),u4(this.options.clientId)||this.options.things.rankings&&delete this.options.things.rankings;let{things:t}=this.options,e=[],i=Object.keys(t);for(let t=0,n=i.length;t<n;++t){let n=i[t];Gl[n]&&e.push(Gl[n].fetch(this).then((t=>(this[n]=t,Promise.resolve()))))}return this.generateGetters(i),Promise.all(e).then((()=>{this.initNavigator()}))}))}initNavigator(){this.navigator=new A2({locations:this.locations.map((t=>t.toJSON())),nodes:this.nodes.map((t=>t.toJSON())),vortexes:this.vortexes.map((t=>t.toJSON())),maps:this.maps.map((t=>t.toJSON()))})}toJSON(){var t;let e={};for(let t in Gl)Array.isArray(this[t])&&(e[t]=this[t].map((t=>t.toJSON())));let i=Ue(be({},e),{venue:this.venue.toJSON()});return null!=this.rankings&&(i.rankings=null==(t=this.rankings)?void 0:t.toJSON()),delete i.locationRankings,i}toString(){return _(this,jl)||JSON.stringify(this.toJSON())}};h(qr,"Mappedin"),ca=new WeakMap,jl=new WeakMap,P();var v4={venue:["slug","name","defaultMap","metadata","countrycode","tzid","logo","externalId"],nodes:["externalId","x","y","paths","accessible","operationHours"],vortexes:["externalId","nodes","types","accessible"],polygons:["vertexes","geometry","canvasBounds","layer","externalId","entrances"],locations:["externalId","name","type","picture","description","icon","logo","sortOrder","phone","operationHours","social","color","toMap","tags","shortName","detailsUrl","locationState","metadata","siblingGroups","gallery"],categories:["name","color","sortOrder","parents"],maps:["name","elevation","height","width","layers","shortName","scene","group","x_scale"],mapGroups:["name"],themes:["name","themeData"],rankings:["polygons"]};P(),P();var mn=h((function(){return mn=Object.assign||h((function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}),"__assign"),mn.apply(this,arguments)}),"__assign");function Pt(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function kn(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,s=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return a}h(Pt,"__values"),h(kn,"__read");var hh,tC="ENTRIES",E4="KEYS",S4="VALUES",Dn="",W2=function(){function t(t,e){var i=t._tree,n=Array.from(i.keys());this.set=t,this._type=e,this._path=n.length>0?[{node:i,keys:n}]:[]}return h(t,"TreeIterator"),t.prototype.next=function(){var t=this.dive();return this.backtrack(),t},t.prototype.dive=function(){if(0===this._path.length)return{done:!0,value:void 0};var t=Wl(this._path),e=t.node,i=t.keys;if(Wl(i)===Dn)return{done:!1,value:this.result()};var n=e.get(Wl(i));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()},t.prototype.backtrack=function(){if(0!==this._path.length){var t=Wl(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}},t.prototype.key=function(){return this.set._prefix+this._path.map((function(t){var e=t.keys;return Wl(e)})).filter((function(t){return t!==Dn})).join("")},t.prototype.value=function(){return Wl(this._path).node.get(Dn)},t.prototype.result=function(){switch(this._type){case S4:return this.value();case E4:return this.key();default:return[this.key(),this.value()]}},t.prototype[Symbol.iterator]=function(){return this},t}(),Wl=h((function(t){return t[t.length-1]}),"last$1"),nC=h((function(t,e,i){var n=new Map;if(void 0===e)return n;for(var r=e.length+1,s=r+i,a=new Uint8Array(s*r).fill(i+1),o=0;o<r;++o)a[o]=o;for(var l=1;l<s;++l)a[l*r]=l;return A4(t,e,i,n,a,1,r,""),n}),"fuzzySearch"),A4=h((function(t,e,i,n,r,s,a,o){var l,h,u=s*a;try{t:for(var c=Pt(t.keys()),d=c.next();!d.done;d=c.next()){var p=d.value;if(p===Dn){var m=r[u-1];m<=i&&n.set(o,[t.get(p),m])}else{for(var f=s,g=0;g<p.length;++g,++f){for(var v=p[g],y=a*f,_=y-a,x=r[y],b=Math.max(0,f-i-1),w=Math.min(a-1,f+i),M=b;M<w;++M){var E=v!==e[M],T=r[_+M]+ +E,S=r[_+M+1]+1,q=r[y+M]+1,P=r[y+M+1]=Math.min(T,S,q);P<x&&(x=P)}if(x>i)continue t}A4(t.get(p),e,i,n,r,f,a,o+p)}}}catch(t){l={error:t}}finally{try{d&&!d.done&&(h=c.return)&&h.call(c)}finally{if(l)throw l.error}}}),"recurse"),X2=function(){function t(t,e){void 0===t&&(t=new Map),void 0===e&&(e=""),this._size=void 0,this._tree=t,this._prefix=e}return h(t,"SearchableMap"),t.prototype.atPrefix=function(e){var i,n;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=kn(Um(this._tree,e.slice(this._prefix.length)),2),s=r[0],a=r[1];if(void 0===s){var o=kn(K2(a),2),l=o[0],h=o[1];try{for(var u=Pt(l.keys()),c=u.next();!c.done;c=u.next()){var d=c.value;if(d!==Dn&&d.startsWith(h)){var p=new Map;return p.set(d.slice(h.length),l.get(d)),new t(p,e)}}}catch(t){i={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(i)throw i.error}}}return new t(s,e)},t.prototype.clear=function(){this._size=void 0,this._tree.clear()},t.prototype.delete=function(t){return this._size=void 0,iC(this._tree,t)},t.prototype.entries=function(){return new W2(this,tC)},t.prototype.forEach=function(t){var e,i;try{for(var n=Pt(this),r=n.next();!r.done;r=n.next()){var s=kn(r.value,2);t(s[0],s[1],this)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}},t.prototype.fuzzyGet=function(t,e){return nC(this._tree,t,e)},t.prototype.get=function(t){var e=$2(this._tree,t);return void 0!==e?e.get(Dn):void 0},t.prototype.has=function(t){var e=$2(this._tree,t);return void 0!==e&&e.has(Dn)},t.prototype.keys=function(){return new W2(this,E4)},t.prototype.set=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");return this._size=void 0,Y2(this._tree,t).set(Dn,e),this},Object.defineProperty(t.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var t=this.entries();!t.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),t.prototype.update=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var i=Y2(this._tree,t);return i.set(Dn,e(i.get(Dn))),this},t.prototype.fetch=function(t,e){if("string"!=typeof t)throw new Error("key must be a string");this._size=void 0;var i=Y2(this._tree,t),n=i.get(Dn);return void 0===n&&i.set(Dn,n=e()),n},t.prototype.values=function(){return new W2(this,S4)},t.prototype[Symbol.iterator]=function(){return this.entries()},t.from=function(e){var i,n,r=new t;try{for(var s=Pt(e),a=s.next();!a.done;a=s.next()){var o=kn(a.value,2),l=o[0],h=o[1];r.set(l,h)}}catch(t){i={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return r},t.fromObject=function(e){return t.from(Object.entries(e))},t}(),Um=h((function(t,e,i){var n,r;if(void 0===i&&(i=[]),0===e.length||null==t)return[t,i];try{for(var s=Pt(t.keys()),a=s.next();!a.done;a=s.next()){var o=a.value;if(o!==Dn&&e.startsWith(o))return i.push([t,o]),Um(t.get(o),e.slice(o.length),i)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i.push([t,e]),Um(void 0,"",i)}),"trackDown"),$2=h((function(t,e){var i,n;if(0===e.length||null==t)return t;try{for(var r=Pt(t.keys()),s=r.next();!s.done;s=r.next()){var a=s.value;if(a!==Dn&&e.startsWith(a))return $2(t.get(a),e.slice(a.length))}}catch(t){i={error:t}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}}),"lookup"),Y2=h((function(t,e){var i,n,r=e.length;t:for(var s=0;t&&s<r;){try{for(var a=(i=void 0,Pt(t.keys())),o=a.next();!o.done;o=a.next()){var l=o.value;if(l!==Dn&&e[s]===l[0]){for(var h=Math.min(r-s,l.length),u=1;u<h&&e[s+u]===l[u];)++u;var c=t.get(l);if(u===l.length)t=c;else{var d=new Map;d.set(l.slice(u),c),t.set(e.slice(s,s+u),d),t.delete(l),t=d}s+=u;continue t}}}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}var p=new Map;return t.set(e.slice(s),p),p}return t}),"createPath"),iC=h((function(t,e){var i=kn(Um(t,e),2),n=i[0],r=i[1];if(void 0!==n)if(n.delete(Dn),0===n.size)q4(r);else if(1===n.size){var s=kn(n.entries().next().value,2),a=s[0],o=s[1];P4(r,a,o)}}),"remove"),q4=h((function(t){if(0!==t.length){var e=kn(K2(t),2),i=e[0],n=e[1];if(i.delete(n),0===i.size)q4(t.slice(0,-1));else if(1===i.size){var r=kn(i.entries().next().value,2),s=r[0],a=r[1];s!==Dn&&P4(t.slice(0,-1),s,a)}}}),"cleanup"),P4=h((function(t,e,i){if(0!==t.length){var n=kn(K2(t),2),r=n[0],s=n[1];r.set(s+e,i),r.delete(s)}}),"merge"),K2=h((function(t){return t[t.length-1]}),"last"),Q2="or",rC="and",sC="and_not",Ka=function(){function t(t){if(null==(null==t?void 0:t.fields))throw new Error('MiniSearch: option "fields" must be provided');this._options=mn(mn(mn({},J2),t),{searchOptions:mn(mn({},b4),t.searchOptions||{})}),this._index=new X2,this._documentCount=0,this._documentIds=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this.addFields(this._options.fields)}return h(t,"MiniSearch"),t.prototype.add=function(t){var e,i,n,r,s=this._options,a=s.extractField,o=s.tokenize,l=s.processTerm,h=s.fields,u=s.idField,c=a(t,u);if(null==c)throw new Error('MiniSearch: document does not have ID field "'.concat(u,'"'));var d=this.addDocumentId(c);this.saveStoredFields(d,t);try{for(var p=Pt(h),m=p.next();!m.done;m=p.next()){var f=m.value,g=a(t,f);if(null!=g){var v=o(g.toString(),f),y=this._fieldIds[f],_=new Set(v).size;this.addFieldLength(d,y,this._documentCount-1,_);try{for(var x=(n=void 0,Pt(v)),b=x.next();!b.done;b=x.next()){var w=l(b.value,f);w&&this.addTerm(y,d,w)}}catch(t){n={error:t}}finally{try{b&&!b.done&&(r=x.return)&&r.call(x)}finally{if(n)throw n.error}}}}}catch(t){e={error:t}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(e)throw e.error}}},t.prototype.addAll=function(t){var e,i;try{for(var n=Pt(t),r=n.next();!r.done;r=n.next()){var s=r.value;this.add(s)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}},t.prototype.addAllAsync=function(t,e){var i=this;void 0===e&&(e={});var n=e.chunkSize,r=void 0===n?10:n,s={chunk:[],promise:Promise.resolve()},a=t.reduce((function(t,e,n){var s=t.chunk,a=t.promise;return s.push(e),(n+1)%r==0?{chunk:[],promise:a.then((function(){return new Promise((function(t){return setTimeout(t,0)}))})).then((function(){return i.addAll(s)}))}:{chunk:s,promise:a}}),s),o=a.chunk;return a.promise.then((function(){return i.addAll(o)}))},t.prototype.remove=function(t){var e,i,n,r,s,a,o=this._options,l=o.tokenize,h=o.processTerm,u=o.extractField,c=o.fields,d=o.idField,p=u(t,d);if(null==p)throw new Error('MiniSearch: document does not have ID field "'.concat(d,'"'));try{for(var m=Pt(this._documentIds),f=m.next();!f.done;f=m.next()){var g=kn(f.value,2),v=g[0];if(p===g[1]){try{for(var y=(n=void 0,Pt(c)),_=y.next();!_.done;_=y.next()){var x=_.value,b=u(t,x);if(null!=b){var w=l(b.toString(),x),M=this._fieldIds[x],E=new Set(w).size;this.removeFieldLength(v,M,this._documentCount,E);try{for(var T=(s=void 0,Pt(w)),S=T.next();!S.done;S=T.next()){var q=h(S.value,x);q&&this.removeTerm(M,v,q)}}catch(t){s={error:t}}finally{try{S&&!S.done&&(a=T.return)&&a.call(T)}finally{if(s)throw s.error}}}}}catch(t){n={error:t}}finally{try{_&&!_.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}return this._storedFields.delete(v),this._documentIds.delete(v),this._fieldLength.delete(v),void(this._documentCount-=1)}}}catch(t){e={error:t}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(e)throw e.error}}throw new Error("MiniSearch: cannot remove document with ID ".concat(p,": it is not in the index"))},t.prototype.removeAll=function(t){var e,i;if(t)try{for(var n=Pt(t),r=n.next();!r.done;r=n.next()){var s=r.value;this.remove(s)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new X2,this._documentCount=0,this._documentIds=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},t.prototype.search=function(t,e){var i,n;void 0===e&&(e={});var r=this.executeQuery(t,e),s=[];try{for(var a=Pt(r),o=a.next();!o.done;o=a.next()){var l=kn(o.value,2),h=l[0],u=l[1],c=u.score,d=u.terms,p=u.match,m=d.length,f={id:this._documentIds.get(h),score:c*m,terms:Object.keys(p),match:p};Object.assign(f,this._storedFields.get(h)),(null==e.filter||e.filter(f))&&s.push(f)}}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s.sort(w4),s},t.prototype.autoSuggest=function(t,e){var i,n,r,s;void 0===e&&(e={}),e=mn(mn({},uC),e);var a=new Map;try{for(var o=Pt(this.search(t,e)),l=o.next();!l.done;l=o.next()){var h=l.value,u=h.score,c=(y=h.terms).join(" ");null!=(g=a.get(c))?(g.score+=u,g.count+=1):a.set(c,{score:u,terms:y,count:1})}}catch(t){i={error:t}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}var d=[];try{for(var p=Pt(a),m=p.next();!m.done;m=p.next()){var f=kn(m.value,2),g=f[0],v=f[1],y=(u=v.score,v.terms),_=v.count;d.push({suggestion:g,terms:y,score:u/_})}}catch(t){r={error:t}}finally{try{m&&!m.done&&(s=p.return)&&s.call(p)}finally{if(r)throw r.error}}return d.sort(w4),d},Object.defineProperty(t.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),t.loadJSON=function(e,i){if(null==i)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return t.loadJS(JSON.parse(e),i)},t.getDefault=function(t){if(J2.hasOwnProperty(t))return Z2(J2,t);throw new Error('MiniSearch: unknown option "'.concat(t,'"'))},t.loadJS=function(e,i){var n,r,s,a,o=e.index,l=e.documentCount,h=e.nextId,u=e.documentIds,c=e.fieldIds,d=e.fieldLength,p=e.averageFieldLength,m=e.storedFields,f=e.serializationVersion;if(1!==f&&2!==f)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var g=new t(i);g._documentCount=l,g._nextId=h,g._documentIds=zm(u),g._fieldIds=c,g._fieldLength=zm(d),g._avgFieldLength=p,g._storedFields=zm(m),g._index=new X2;try{for(var v=Pt(o),y=v.next();!y.done;y=v.next()){var _=kn(y.value,2),x=_[0],b=_[1],w=new Map;try{for(var M=(s=void 0,Pt(Object.keys(b))),E=M.next();!E.done;E=M.next()){var T=E.value,S=b[T];1===f&&(S=S.ds),w.set(parseInt(T,10),zm(S))}}catch(t){s={error:t}}finally{try{E&&!E.done&&(a=M.return)&&a.call(M)}finally{if(s)throw s.error}}g._index.set(x,w)}}catch(t){n={error:t}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}return g},t.prototype.executeQuery=function(t,e){var i=this;if(void 0===e&&(e={}),"string"!=typeof t){var n=mn(mn(mn({},e),t),{queries:void 0}),r=t.queries.map((function(t){return i.executeQuery(t,n)}));return this.combineResults(r,t.combineWith)}var s=this._options,a=s.tokenize,o=s.processTerm,l=s.searchOptions,h=mn(mn({tokenize:a,processTerm:o},l),e),u=h.tokenize,c=h.processTerm,d=u(t).map((function(t){return c(t)})).filter((function(t){return!!t})).map(cC(h)).map((function(t){return i.executeQuerySpec(t,h)}));return this.combineResults(d,h.combineWith)},t.prototype.executeQuerySpec=function(t,e){var i,n,r,s,a,o,l=mn(mn({},this._options.searchOptions),e),h=(l.fields||this._options.fields).reduce((function(t,e){var i;return mn(mn({},t),((i={})[e]=Z2(t,e)||1,i))}),l.boost||{}),u=l.boostDocument,c=l.weights,d=l.maxFuzzy,p=mn(mn({},b4.weights),c),m=p.fuzzy,f=p.prefix,g=this._index.get(t.term),v=this.termResults(t.term,t.term,1,g,h,u);if(t.prefix&&(a=this._index.atPrefix(t.term)),t.fuzzy){var y=!0===t.fuzzy?.2:t.fuzzy,_=y<1?Math.min(d,Math.round(t.term.length*y)):y;_&&(o=this._index.fuzzyGet(t.term,_))}if(a)try{for(var x=Pt(a),b=x.next();!b.done;b=x.next()){var w=kn(b.value,2),M=w[0],E=w[1];if(P=M.length-t.term.length){null==o||o.delete(M);var T=f*M.length/(M.length+.3*P);this.termResults(t.term,M,T,E,h,u,v)}}}catch(t){i={error:t}}finally{try{b&&!b.done&&(n=x.return)&&n.call(x)}finally{if(i)throw i.error}}if(o)try{for(var S=Pt(o.keys()),q=S.next();!q.done;q=S.next()){M=q.value;var P,A=kn(o.get(M),2),C=A[0];if(P=A[1]){T=m*M.length/(M.length+P);this.termResults(t.term,M,T,C,h,u,v)}}}catch(t){r={error:t}}finally{try{q&&!q.done&&(s=S.return)&&s.call(S)}finally{if(r)throw r.error}}return v},t.prototype.combineResults=function(t,e){if(void 0===e&&(e=Q2),0===t.length)return new Map;var i=e.toLowerCase();return t.reduce(aC[i])||new Map},t.prototype.toJSON=function(){var t,e,i,n,r=[];try{for(var s=Pt(this._index),a=s.next();!a.done;a=s.next()){var o=kn(a.value,2),l=o[0],h=o[1],u={};try{for(var c=(i=void 0,Pt(h)),d=c.next();!d.done;d=c.next()){var p=kn(d.value,2),m=p[0],f=p[1];u[m]=Object.fromEntries(f)}}catch(t){i={error:t}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}r.push([l,u])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),index:r,serializationVersion:2}},t.prototype.termResults=function(t,e,i,n,r,s,a){var o,l,h,u,c;if(void 0===a&&(a=new Map),null==n)return a;try{for(var d=Pt(Object.keys(r)),p=d.next();!p.done;p=d.next()){var m=p.value,f=r[m],g=this._fieldIds[m],v=n.get(g);if(null!=v){var y=v.size,_=this._avgFieldLength[g];try{for(var x=(h=void 0,Pt(v.keys())),b=x.next();!b.done;b=x.next()){var w=b.value,M=s?s(this._documentIds.get(w),e):1;if(M){var E=v.get(w),T=this._fieldLength.get(w)[g],S=i*f*M*lC(E,y,this._documentCount,T,_),q=a.get(w);if(q){q.score+=S,hC(q.terms,t);var P=Z2(q.match,e);P?P.push(m):q.match[e]=[m]}else a.set(w,{score:S,terms:[t],match:(c={},c[e]=[m],c)})}}}catch(t){h={error:t}}finally{try{b&&!b.done&&(u=x.return)&&u.call(x)}finally{if(h)throw h.error}}}}}catch(t){o={error:t}}finally{try{p&&!p.done&&(l=d.return)&&l.call(d)}finally{if(o)throw o.error}}return a},t.prototype.addTerm=function(t,e,i){var n=this._index.fetch(i,T4),r=n.get(t);if(null==r)(r=new Map).set(e,1),n.set(t,r);else{var s=r.get(e);r.set(e,(s||0)+1)}},t.prototype.removeTerm=function(t,e,i){if(this._index.has(i)){var n=this._index.fetch(i,T4),r=n.get(t);null==r||null==r.get(e)?this.warnDocumentChanged(e,t,i):r.get(e)<=1?r.size<=1?n.delete(t):r.delete(e):r.set(e,r.get(e)-1),0===this._index.get(i).size&&this._index.delete(i)}else this.warnDocumentChanged(e,t,i)},t.prototype.warnDocumentChanged=function(t,e,i){var n,r;if(null!=console&&null!=console.warn)try{for(var s=Pt(Object.keys(this._fieldIds)),a=s.next();!a.done;a=s.next()){var o=a.value;if(this._fieldIds[o]===e)return void console.warn("MiniSearch: document with ID ".concat(this._documentIds.get(t),' has changed before removal: term "').concat(i,'" was not present in field "').concat(o,'". Removing a document after it has changed can corrupt the index!'))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},t.prototype.addDocumentId=function(t){var e=this._nextId;return this._documentIds.set(e,t),this._documentCount+=1,this._nextId+=1,e},t.prototype.addFields=function(t){for(var e=0;e<t.length;e++)this._fieldIds[t[e]]=e},t.prototype.addFieldLength=function(t,e,i,n){var r=this._fieldLength.get(t);null==r&&this._fieldLength.set(t,r=[]),r[e]=n;var s=(this._avgFieldLength[e]||0)*i+n;this._avgFieldLength[e]=s/(i+1)},t.prototype.removeFieldLength=function(t,e,i,n){var r=this._avgFieldLength[e]*i-n;this._avgFieldLength[e]=r/(i-1)},t.prototype.saveStoredFields=function(t,e){var i,n,r=this._options,s=r.storeFields,a=r.extractField;if(null!=s&&0!==s.length){var o=this._storedFields.get(t);null==o&&this._storedFields.set(t,o={});try{for(var l=Pt(s),h=l.next();!h.done;h=l.next()){var u=h.value,c=a(e,u);void 0!==c&&(o[u]=c)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}}},t}(),Z2=h((function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}),"getOwnProperty"),aC=((hh={})[Q2]=function(t,e){var i,n;try{for(var r=Pt(e.keys()),s=r.next();!s.done;s=r.next()){var a=s.value,o=t.get(a);if(null==o)t.set(a,e.get(a));else{var l=e.get(a),h=l.score,u=l.terms,c=l.match;o.score=o.score+h,o.match=Object.assign(o.match,c),M4(o.terms,u)}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return t},hh[rC]=function(t,e){var i,n,r=new Map;try{for(var s=Pt(e.keys()),a=s.next();!a.done;a=s.next()){var o=a.value,l=t.get(o);if(null!=l){var h=e.get(o),u=h.score,c=h.terms,d=h.match;M4(l.terms,c),r.set(o,{score:l.score+u,terms:l.terms,match:Object.assign(l.match,d)})}}}catch(t){i={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return r},hh[sC]=function(t,e){var i,n;try{for(var r=Pt(e.keys()),s=r.next();!s.done;s=r.next()){var a=s.value;t.delete(a)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return t},hh),x4=1.2,_4=.7,oC=.5,lC=h((function(t,e,i,n,r){return Math.log(1+(i-e+.5)/(e+.5))*(oC+t*(x4+1)/(t+x4*(1-_4+_4*n/r)))}),"calcBM25Score"),cC=h((function(t){return function(e,i,n){return{term:e,fuzzy:"function"==typeof t.fuzzy?t.fuzzy(e,i,n):t.fuzzy||!1,prefix:"function"==typeof t.prefix?t.prefix(e,i,n):!0===t.prefix}}}),"termToQuerySpec"),J2={idField:"id",extractField:function(t,e){return t[e]},tokenize:function(t,e){return t.split(dC)},processTerm:function(t,e){return t.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[]},b4={combineWith:Q2,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375}},uC={prefix:function(t,e,i){return e===i.length-1}},hC=h((function(t,e){t.includes(e)||t.push(e)}),"assignUniqueTerm"),M4=h((function(t,e){var i,n;try{for(var r=Pt(e),s=r.next();!s.done;s=r.next()){var a=s.value;t.includes(a)||t.push(a)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}}),"assignUniqueTerms"),w4=h((function(t,e){var i=t.score;return e.score-i}),"byScore"),T4=h((function(){return new Map}),"createMap"),zm=h((function(t){var e,i,n=new Map;try{for(var r=Pt(Object.keys(t)),s=r.next();!s.done;s=r.next()){var a=s.value;n.set(parseInt(a,10),t[a])}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return n}),"objectToNumericMap"),dC=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;P();var pC=["0","1","2","3","4","5","6","7","8","9"],fC=["۱","۲","۳","۴","۵","۶","۷","۸","۹","۰"],mC=["0","1","2","3","4","5","6","7","8","9"],gC=["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],yG=[...pC,...fC,...mC,...gC],C4=["about","after","all","also","am","an","and","another","any","are","as","at","be","because","been","before","being","between","both","but","by","came","can","come","could","did","do","each","for","from","get","got","has","had","he","have","her","here","him","himself","his","how","if","in","into","is","it","like","make","many","me","might","more","most","much","must","my","never","now","of","on","only","or","other","our","out","over","said","same","should","since","some","still","such","take","than","that","the","their","them","then","there","these","they","this","those","through","to","too","under","up","very","was","way","we","well","were","what","where","which","while","who","with","would","you","your","a","i"];P();var yC=32,li=!1,vC=120,ey=0,Zn=class{constructor(t){w(this,"_callback"),w(this,"_frameCount"),w(this,"_ordering"),w(this,"_supersededBy"),w(this,"name"),w(this,"_remainingFrameCount"),w(this,"_lastFrameTime"),w(this,"userdata"),this._callback=t.callback,this._frameCount=null!=t.frameCount?t.frameCount:1,this._ordering=null!=t.ordering?t.ordering:0,this._supersededBy=null!=t.supersededBy?new Set(t.supersededBy):new Set,this.name=t.name,this.userdata=t.userdata,this._remainingFrameCount=this._frameCount,this._lastFrameTime=0,li&&ge.log("update instantiated",this.name)}getLastFrameTime(){return this._lastFrameTime}};h(Zn,"FrameUpdate");var Yn=class{constructor(t){if(w(this,"_postponed"),w(this,"userdata"),w(this,"_priority"),w(this,"_group"),w(this,"name"),w(this,"_lastFrameTime"),w(this,"_callback"),w(this,"_complete"),w(this,"_scheduled"),w(this,"_cancelled"),null!=t.group&&null!=t.priority)throw new Error("cannot specify task priority individually within group");if(null!=t.group&&null!=t.postponeOnAdd)throw new Error("cannot specify task postpone individually within group");this._callback=t.callback,this._group=null!=t.group?t.group:null,this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._complete=!1,this._scheduled=!1,this._cancelled=!1,this._lastFrameTime=0,li&&ge.log("task instantiated",this.name)}isComplete(){return this._complete}getLastFrameTime(){return this._lastFrameTime}};h(Yn,"FrameTask");var Cr=class{constructor(t){w(this,"_postponed"),w(this,"_onComplete"),w(this,"_priority"),w(this,"userdata"),w(this,"name"),w(this,"_tasks"),w(this,"_scheduledTasks"),w(this,"_scheduled"),w(this,"_cancelled"),this._onComplete=null!=t.onComplete?t.onComplete:()=>{},this._priority=null!=t.priority?t.priority:0,this._postponed=null!=t.postponeOnAdd&&t.postponeOnAdd,this.name=t.name,this.userdata=t.userdata,this._tasks=new Set,this._scheduledTasks=new Set,this._scheduled=!1,this._cancelled=!1,li&&ge.log("task group instantiated",this.name)}isComplete(){return 0===this._scheduledTasks.size}getTasks(){return Array.from(this._tasks.values())}clear(){this._tasks.clear(),this._scheduledTasks.clear()}_popTask(){for(let t of this._scheduledTasks)return this._scheduledTasks.delete(t),t}};h(Cr,"FrameTaskGroup");var Vm=class{constructor(t){w(this,"_maxMillisecondsPerFrame"),w(this,"_time"),this._maxMillisecondsPerFrame=null!=(null==t?void 0:t.maxMillisecondsPerFrame)?t.maxMillisecondsPerFrame:yC,this._time=0}beginFrame(){this._time=performance.now()+this._maxMillisecondsPerFrame}hasTimeRemaining(){return performance.now()<=this._time}};h(Vm,"RealTimeTimer");var eo=class{constructor(t){var e;w(this,"_raf"),w(this,"_timer"),w(this,"_performance"),w(this,"_scheduledUpdatesByOrdering"),w(this,"_scheduledTasksByPriority"),w(this,"_postponedTasks"),w(this,"_requestAnimationFrameHandle"),w(this,"_updatesToRunThisFrame"),w(this,"_lastFrameTime",0),w(this,"_updatesRunLastFrame"),this._timer=null!=(null==t?void 0:t.timer)?t.timer:new Vm,this._performance=null!=(null==t?void 0:t.performance)&&t.performance,this._scheduledUpdatesByOrdering=new Qa,this._scheduledTasksByPriority=new Qa,this._postponedTasks=new Set,this._requestAnimationFrameHandle=null,this._updatesToRunThisFrame=[],this._lastFrameTime=0,this._updatesRunLastFrame=new Set,this.update=this.update.bind(this),li&&ge.log("task scheduler instantiated"),null!=(e=globalThis.MappedinDebug)&&e.TEST_IOS&&(this._raf=t=>setTimeout(t,16))}clear(){for(let t of this._scheduledTasksByPriority.values())t._cancelled=!0;for(let t of this._postponedTasks.values())t._cancelled=!0;this._scheduledUpdatesByOrdering=new Qa,this._scheduledTasksByPriority=new Qa,this._postponedTasks=new Set,this._lastFrameTime=0,this._updatesRunLastFrame.clear(),li&&ge.log("task scheduler cleared")}destroy(){this.clear()}requestAnimationFrame(){null==this._requestAnimationFrameHandle&&(this._requestAnimationFrameHandle="function"==typeof this._raf?this._raf(this.update):requestAnimationFrame(this.update))}update(t){let e;this._timer.beginFrame(),this._performance&&(e=performance.now());let i=!1;li&&(0===ey&&(i=!0),++ey,ey%=vC);let n=this._scheduledUpdatesByOrdering.keys();for(let t=n.length-1;t>=0;--t){let e=n[t];for(let t of this._scheduledUpdatesByOrdering.get(e).values())this._updatesToRunThisFrame.push(t),i&&ge.log("update scheduled to run this frame",t.name)}for(let t of this._updatesToRunThisFrame){--t._remainingFrameCount,t._remainingFrameCount<=0&&this._scheduledUpdatesByOrdering.delete(t._ordering,t),t._superseded=!1;for(let e of this._updatesToRunThisFrame)t._supersededBy.has(e)&&(t._superseded=!0,i&&ge.log("update superseded",t.name,e.name))}for(let t=0;t<this._updatesToRunThisFrame.length;++t)this._updatesToRunThisFrame[t]._superseded&&(this._updatesToRunThisFrame.splice(t,1),--t);for(let e of this._updatesToRunThisFrame){let n;this._performance&&(n=performance.now()),e._callback(t),this._performance&&(e._lastFrameTime=performance.now()-n),i&&ge.log("update completed",e.name)}this._updatesRunLastFrame.clear();for(let t of this._updatesToRunThisFrame)this._updatesRunLastFrame.add(t);if(this._updatesToRunThisFrame.splice(0,this._updatesToRunThisFrame.length),this._scheduledTasksByPriority.size>0)do{this._executeOneTask(t)}while(this._timer.hasTimeRemaining()&&this._scheduledTasksByPriority.size>0);this._performance&&(this._lastFrameTime=performance.now()-e),this._requestAnimationFrameHandle=null,(this._scheduledUpdatesByOrdering.size>0||this._scheduledTasksByPriority.size>0)&&this.requestAnimationFrame()}flushTasks(){for(;this._scheduledTasksByPriority.size>0;)this._executeOneTask(performance.now())}getLastFrameTime(){return this._lastFrameTime}getUpdatesRunLastFrame(){return this._updatesRunLastFrame}_executeOneTask(t){let e,i=this._scheduledTasksByPriority.popFromMaxKey(),n=null;ge.assert(void 0!==i),Object.getPrototypeOf(i)===Cr.prototype&&(n=i,i=n._popTask()),ge.assert(void 0!==i),ge.assert(Object.getPrototypeOf(i)===Yn.prototype),this._performance&&(e=performance.now()),i._callback(t),i._complete=!0,this._performance&&(i._lastFrameTime=performance.now()-e),li&&ge.log("task completed",i.name),null!=n&&(n.isComplete()?(n.clear(),n._onComplete(),li&&ge.log("group completed",n.name)):this._scheduledTasksByPriority.insert(n._priority,n))}scheduleUpdate(t){t._remainingFrameCount=t._frameCount,this._scheduledUpdatesByOrdering.insert(t._ordering,t),this.requestAnimationFrame()}scheduleTask(t){if(Object.getPrototypeOf(t)===Cr)throw new Error("frame task groups are automatically scheduled when a task is added to them and cannot be manually scheduled: "+t.name);if(t._scheduled)throw new Error("cannot schedule already scheduled task: "+t.name);if(t._cancelled)throw new Error("cannot schedule cancelled task: "+t.name);let e=t;"_group"in t&&null!=t._group&&(t._group._tasks.add(t),t._group._scheduledTasks.add(t),e=t._group),e._postponed?this._postponedTasks.add(e):this._scheduledTasksByPriority.insert(e._priority,e),t._scheduled=!0,e._scheduled=!0,li&&ge.log("task scheduled",t.name),this.requestAnimationFrame()}cancelUpdate(t){this._scheduledUpdatesByOrdering.delete(t._ordering,t),li&&ge.log("update cancelled",t.name)}cancelTask(t){if(!t._scheduled)throw new Error("cannot cancel task that has not been scheduled: "+t.name);if(t._cancelled)throw new Error("cannot cancel task that has already been cancelled: "+t.name);if("_group"in t&&null!=t._group){let e=t._group.isComplete();t._group._tasks.delete(t),t._group._scheduledTasks.delete(t),t._group.isComplete()&&(this._scheduledTasksByPriority.delete(t._group._priority,t._group),e||t._group._onComplete())}else this._scheduledTasksByPriority.delete(t._priority,t),this._postponedTasks.delete(t);Object.getPrototypeOf(t)===Yn.prototype?t._cancelled=!0:"clear"in t&&t.clear(),li&&ge.log("task cancelled",t.name)}postponeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot postpone individual tasks in group: "+t.name);if(t._cancelled)throw new Error("cannot postpone cancelled task: "+t.name);if(!t._postponed){if(Object.getPrototypeOf(t)===Yn.prototype){if("_complete"in t)return;if(!t._scheduled)throw new Error("cannot postpone task that has not been scheduled: "+t.name)}this._scheduledTasksByPriority.delete(t._priority,t),(Object.getPrototypeOf(t)===Yn.prototype||!t.isComplete())&&this._postponedTasks.add(t),t._postponed=!0,li&&ge.log("task postponed",t.name)}}resumeTask(t){if("_group"in t&&null!=t._group)throw new Error("cannot resume individual tasks in groups");if(t._cancelled)throw new Error("cannot resume cancelled task");if(t._postponed){if(Object.getPrototypeOf(t)===Yn.prototype){if("_complete"in t&&t._complete)return;if(!t._scheduled)throw new Error("cannot resume unscheduled task")}this._postponedTasks.delete(t),(Object.getPrototypeOf(t)===Yn.prototype||!t.isComplete())&&this._scheduledTasksByPriority.insert(t._priority,t),t._postponed=!1,this.requestAnimationFrame(),li&&ge.log("task resumed",t.name)}}setTaskPriority(t,e){if(Object.getPrototypeOf(t)===Yn.prototype&&!t._scheduled)throw new Error("task must be scheduled to be reprioritized");this._scheduledTasksByPriority.has(t._priority,t)&&(this._scheduledTasksByPriority.delete(t._priority,t),this._scheduledTasksByPriority.insert(e,t)),t._priority=e,li&&ge.log("task priority changed",t.name,e)}};h(eo,"TaskScheduler");var Qa=class{constructor(){w(this,"_map"),w(this,"_size"),w(this,"_sortedKeys"),this._map=new Map,this._size=0,this._sortedKeys=[]}has(t,e){return null!=this._map.get(t)&&this._map.get(t).has(e)}get(t){return this._map.get(t)}insert(t,e){if(ge.assert("number"==typeof t&&Number.isFinite(t)),null==this._map.get(t)){this._map.set(t,new Set);for(let e=0;e<=this._sortedKeys.length;++e)if(e===this._sortedKeys.length||t<this._sortedKeys[e]){this._sortedKeys.splice(e,0,t);break}}this._map.get(t).has(e)||(this._map.get(t).add(e),++this._size)}delete(t,e){null!=this._map.get(t)&&this._map.get(t).has(e)&&(this._map.get(t).delete(e),--this._size,0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)))}pop(t){if(null!=this._map.get(t)){let e;for(e of this._map.get(t).values()){this._map.get(t).delete(e),--this._size;break}return 0===this._map.get(t).size&&(this._map.delete(t),this._sortedKeys.splice(this._sortedKeys.indexOf(t),1)),e}}popFromMaxKey(){if(this._sortedKeys.length>0)return this.pop(this._sortedKeys[this._sortedKeys.length-1])}values(){let t=this._map.keys(),e=null,i={[Symbol.iterator]:()=>i,next:()=>{if(null==e){let i=t.next();if(i.done)return i;e=this._map.get(i.value).values()}let i=e.next();for(;i.done;){let n=t.next();if(n.done)return n;e=this._map.get(n.value).values(),i=e.next()}return i}};return i}keys(){return this._sortedKeys}get size(){let t=0;for(let e of this._map.values())t+=e.size;return ge.assert(t===this._size),t}};h(Qa,"Multimap");var to,Bi,ua,Ir,Bn,dh,ph,Zl,fh,Jl,cs,Hm,Gm,ha,mh,jm,Wm,Xm,L4,gh,yh,ls=h((t=>t.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()),"removeAccents"),Xl="",xC=.09,_C=1,bC=.025,MC=.5,wC=5e-4,TC=5e-4,EC=.01,SC=.05,I4=1,AC=.01,qC=.2,PC={MappedinCategory:"categories",MappedinLocation:"locations"},CC={searchDescriptions:!0,searchTags:!0,searchTagsInCategories:!1,searchDescriptionsInCategories:!1,stopWords:C4,jsonIndex:void 0,useLocationRank:!0,emitAnalyticsEvents:"production"===j.env.NODE_ENV,constants:{PRIMARY_INDEX_FUZZYNESS:xC,PRIMARY_INDEX_WEIGHT:_C,SECONDARY_INDEX_WEIGHT:bC,CATEGORY_NAME_WEIGHT:MC,LOCATION_NAME_WEIGHT:I4,CATEGORY_LOCATION_DESCRIPTION_WEIGHT:wC,CATEGORY_LOCATION_TAGS_WEIGHT:TC,CATEGORY_LOCATION_NAME_WEIGHT:EC,PRIMARY_INDEX_TAGS_NAME_WEIGHT:SC,LOCATION_DEFAULT_RANK:I4,RATIO_OF_FUZZY_TO_EXACT:AC,RATIO_OF_PREFIX_TO_EXACT:qC}},Yl=class{constructor(t,e){var i,n,r;H(this,Xm),H(this,to,void 0),H(this,Bi,void 0),H(this,ua,void 0),H(this,Ir,void 0),H(this,Bn,void 0),H(this,dh,new eo({performance:!0})),H(this,ph,void 0),H(this,Zl,void 0),H(this,fh,new Map),H(this,Jl,0),H(this,cs,h((t=>{H1(this,Jl)._++,_(this,dh).scheduleUpdate(new Zn({name:"updateIndex",ordering:0,frameCount:1,callback:()=>{t(),H1(this,Jl)._--,0===_(this,Jl)&&_(this,mh).call(this)}}))}),"#addTask")),H(this,Hm,h((t=>{var e,i,n;let{SECONDARY_INDEX_WEIGHT:r,LOCATION_DEFAULT_RANK:s,PRIMARY_INDEX_TAGS_NAME_WEIGHT:a}=_(this,Bn).constants,o=s;null!=(e=_(this,Bn))&&e.useLocationRank&&(o=Array.isArray(t.polygons)?Math.max(...t.polygons.map((t=>{var e,i;return null!=(e=t.rank)&&e.score?null==(i=t.rank)?void 0:i.score:s})),s):s),_(this,cs).call(this,(()=>{_(this,Bi).add({name:ls(t.name),tags:"",id:"MappedinLocation_"+t.id,weight:s,rank:o})})),null!=(i=_(this,Bn))&&i.searchTags&&Array.isArray(t.tags)&&t.tags.forEach((e=>{_(this,Bi).add({name:"",tag:ls(e),id:"MappedinLocation_"+t.id,weight:a,rank:o})})),null!=(n=_(this,Bn))&&n.searchDescriptions&&_(this,cs).call(this,(()=>_(this,ua).add({description:ls(t.description||""),id:"MappedinLocation_"+t.id,weight:r,rank:o})))}),"#processLocation")),H(this,Gm,h((t=>{var e,i;let{CATEGORY_LOCATION_DESCRIPTION_WEIGHT:n,CATEGORY_LOCATION_TAGS_WEIGHT:r,CATEGORY_LOCATION_NAME_WEIGHT:s,CATEGORY_NAME_WEIGHT:a}=_(this,Bn).constants;_(this,cs).call(this,(()=>_(this,Bi).add({name:ls(t.name||""),description:"",id:"MappedinCategory_"+t.id,weight:a})));let o=t.locations.reduce(((t,e)=>t+` ${Xl} `+e.name),"")+` ${Xl}`;if(null!=(e=_(this,Bn))&&e.searchDescriptionsInCategories&&t.locations.forEach((e=>{null!=e.description&&_(this,cs).call(this,(()=>_(this,Ir).add({id:"MappedinCategory_"+t.id,"category.locations.description":ls(e.description),ref:e.name,weight:n})))})),null!=(i=_(this,Bn))&&i.searchTagsInCategories){let e=t.locations.reduce(((t,e)=>{var i;return t+(null==(i=e.tags)?void 0:i.reduce(((t,e)=>t+` ${Xl} `+e),""))+` ${Xl}`}),"");_(this,cs).call(this,(()=>_(this,Ir).add({"category.locations.tags":ls(e),id:"MappedinCategory_"+t.id,weight:r})))}_(this,cs).call(this,(()=>_(this,Ir).add({"category.locations.name":ls(o),id:"MappedinCategory_"+t.id,weight:s})))}),"#processCategory")),H(this,ha,void 0),H(this,mh,void 0),H(this,jm,h((t=>{var e;let i=t.score,{object:n,id:r,weight:s,rank:a}=t,[o,l]=r.split("_"),h=n||_(this,to).getCollectionItemById(PC[o],l);return a&&null!=(e=_(this,Bn))&&e.useLocationRank&&(i+=a),s&&(i*=s),{score:i,type:o,object:h}}),"#processSearchResult")),H(this,Wm,h(((t,e)=>{for(let i in t.match)t.match[i].forEach((n=>{let r=t.ref||t[n]||e.object[n];if("category.locations.tags"===n||"category.locations.name"===n){let e=new RegExp(`[^${Xl}]* `+i+` [^${Xl}]*`,"ig").exec(t[n]);null!=e&&(r=e[0].slice(1,-1))}e.matches.push({term:i,weight:t.weight,matchesOn:n,value:r})}))}),"#addMatches")),H(this,gh,void 0),H(this,yh,void 0),G(this,Zl,new Pr(Ue(be({},t.options),{testMode:!1===(null==e?void 0:e.emitAnalyticsEvents)}))),G(this,Bn,be(be({},CC),e)),G(this,to,t),G(this,ph,new Set(null==(i=_(this,Bn))?void 0:i.stopWords));let{PRIMARY_INDEX_FUZZYNESS:s,PRIMARY_INDEX_WEIGHT:a,CATEGORY_NAME_WEIGHT:o,RATIO_OF_FUZZY_TO_EXACT:l,RATIO_OF_PREFIX_TO_EXACT:u,PRIMARY_INDEX_TAGS_NAME_WEIGHT:c}=_(this,Bn).constants,d=["object","query","weight","tag","rank"],p={fields:["query","name","tag"],storeFields:d,searchOptions:{combineWith:"OR",prefix:!0,fuzzy:s},boost:{name:a,query:a,tag:c},weights:{fuzzy:l,prefix:u},boostDocument:t=>t.includes("MappedinLocation")?a:t.includes("MappedinCategory")?o:a},m={fields:["description"],storeFields:d,searchOptions:{combineWith:"AND",prefix:!0,fuzzy:.1},processTerm:(t,e)=>{var i;return null!=(i=_(this,ph))&&i.has(t.toLowerCase())?null:t.toLowerCase()}},f={fields:["category.locations.description","category.locations.tags","category.locations.name"],storeFields:[...d,"ref","category.locations.tags","category.locations.name","category.locations.description"],searchOptions:{combineWith:"AND",prefix:!0,fuzzy:!1}};if(G(this,ha,new Promise((t=>{G(this,mh,t)}))),null!=(n=_(this,Bn))&&n.jsonIndex){let{primary:t,secondary:e,extra:i}=JSON.parse(null==(r=_(this,Bn))?void 0:r.jsonIndex);G(this,Bi,Ka.loadJS(t,p)),G(this,ua,Ka.loadJS(e,m)),G(this,Ir,Ka.loadJS(i,f))}else G(this,Bi,new Ka(p)),G(this,ua,new Ka(m)),G(this,Ir,new Ka(f)),_(this,to).locations.forEach(_(this,Hm)),_(this,to).categories.forEach(_(this,Gm));_(this,dh).update(performance.now()),G(this,gh,V2(((t,e)=>{_(this,Zl).trackSearchSuggest({query:t,hits:e})}),300)),G(this,yh,V2(((t,e)=>{_(this,Zl).trackSearch({query:t,hits:e})}),300))}suggest(t){return Ge(this,null,(function*(){yield _(this,ha);let{PRIMARY_INDEX_FUZZYNESS:e,PRIMARY_INDEX_WEIGHT:i,PRIMARY_INDEX_TAGS_NAME_WEIGHT:n,RATIO_OF_FUZZY_TO_EXACT:r,RATIO_OF_PREFIX_TO_EXACT:s}=_(this,Bn).constants,a=_(this,Bi).autoSuggest(t,{fields:["name","tag","query"],combineWith:"AND",prefix:!0,fuzzy:e,boost:{name:i,query:i,tag:n},weights:{fuzzy:r,prefix:s}});return _(this,gh).call(this,t,a.length),{total:a.length,hits:a.map((t=>({text:t.suggestion})))}}))}search(t){return Ge(this,null,(function*(){yield _(this,ha);let e=at(this,Xm,L4).call(this,t);return _(this,yh).call(this,t,e.length),e}))}toJSON(){return Ge(this,null,(function*(){return yield _(this,ha),JSON.stringify({primary:_(this,Bi),secondary:_(this,ua),extra:_(this,Ir)})}))}addQuery(t){return Ge(this,null,(function*(){let e,i,{query:n,object:r,weight:s=1}=t;yield _(this,ha),e=r instanceof Ni?"MappedinLocation":r instanceof br?"MappedinCategory":"Custom","MappedinLocation"===e||"MappedinCategory"===e?i=e+"_"+r.id:"string"==typeof r.id?i="Custom_"+r.id:(i=_(this,fh).get(r),i||(i="Custom_"+Xn(),_(this,fh).set(r,i))),_(this,Bi).add({id:i,weight:s,object:r,query:ls(n)})}))}};h(Yl,"OfflineSearch"),to=new WeakMap,Bi=new WeakMap,ua=new WeakMap,Ir=new WeakMap,Bn=new WeakMap,dh=new WeakMap,ph=new WeakMap,Zl=new WeakMap,fh=new WeakMap,Jl=new WeakMap,cs=new WeakMap,Hm=new WeakMap,Gm=new WeakMap,ha=new WeakMap,mh=new WeakMap,jm=new WeakMap,Wm=new WeakMap,Xm=new WeakSet,L4=h((function(t){let e=[],i=ls(t);e=[..._(this,Bi).search(i),..._(this,ua).search(i),..._(this,Ir).search(i)].sort(((t,e)=>e.score-t.score));let n={};for(let t of e){let e=_(this,jm).call(this,t);n[t.id]?n[t.id].score+=e.score:n[t.id]=Ue(be({},e),{matches:[]}),_(this,Wm).call(this,t,n[t.id])}return Object.keys(n).map((t=>Ue(be({},n[t]),{matches:n[t].matches.sort(((t,e)=>e.weight-t.weight))}))).sort(((t,e)=>e.score-t.score))}),"#doSearch"),gh=new WeakMap,yh=new WeakMap,P();var us=(t=>(t.MULTI_GEOMETRY="MULTI_GEOMETRY",t.SINGLE_GEOMETRY="SINGLE_GEOMETRY",t))(us||{}),ty=globalThis.fetch;function _r(){if(null==ty)throw new Error("fetch is not available in your environment. Pass your own function into `setFetch` (node-fetch, etc)");return ty}function IC(t){ty=t}h(_r,"isomorphicFetch"),h(IC,"setFetchFn");var R4,LC=null==(R4=null==j?void 0:j.env)?void 0:R4.npm_package_version;globalThis.btoa||(globalThis.btoa=N4.encode);var OC=["ar"];function vh(t){let e=be(Ue(be({},j2),{things:v4}),t);return e.headers=Ue(be({},e.headers),{"mappedin-sdk-version":LC}),t.platformString&&(e.headers=Ue(be({},e.headers),{"mappedin-platform-version":t.platformString})),e.noAuth||(e.accessToken?e.authorization=`Bearer ${e.accessToken}`:e.clientId&&e.clientSecret&&(e.authorization=`Basic ${globalThis.btoa(`${e.clientId}:${e.clientSecret}`)}`)),e}function k4(t){return Ge(this,null,(function*(){let e=be(be({},{emitAnalyticsEvents:!0}),t),i=vh(be({baseUrl:"https://api-gateway.mappedin.com/"},e)),n="public/1/"+(i.useDraftData?"draft/":""),r=new qr(Ue(be({},i),{baseUrl:i.baseUrl+n}));return yield r.fetch(),r}))}h(vh,"parseOptions"),h(k4,"getVenue");var ny={shouldPopulateBundledImagesAsBlobs:!(void 0!==globalThis.navigator&&"ReactNative"==globalThis.navigator.product)};function D4(t){return Ge(this,null,(function*(){let e=vh(be(be({baseUrl:"https://api-gateway.mappedin.com/"},ny),t)),{url:i,updated_at:n}=yield B4(t),r=yield _r()(i,{mode:"cors"}),{data:s,format:a="jsonstring"}=yield r.json();if("jsonstring"!==a)throw new Error(`Unrecognized format ${a}`);let o=new qr(e);return yield o.hydrate(s,e.shouldPopulateBundledImagesAsBlobs),o.updatedAt=n,o}))}function B4(t){return Ge(this,null,(function*(){let e=vh(be(be({baseUrl:"https://api-gateway.mappedin.com/"},ny),t)),{version:i,venue:n}=t,r=`${t.bundleBaseUri||e.baseUrl+`exports/legacy${null!=e.language&&OC.includes(e.language)?"-"+e.language:""}/1/bundle`}?venue=${n}&version=1.0.0`;return e.language=void 0,yield Sm(e,r)}))}function RC(t,e){return Ge(this,arguments,(function*(t,{url:e,updated_at:i}){let n=vh(be(be({baseUrl:"https://api-gateway.mappedin.com/"},ny),t)),r=yield _r()(e,{mode:"cors"}),{data:s,format:a="jsonstring"}=yield r.json();if("jsonstring"!==a)throw new Error(`Unrecognized format${a}`);let o=new qr(n);return yield o.hydrate(s,n.shouldPopulateBundledImagesAsBlobs),o.updatedAt=i,o}))}function O4(t){return Ge(this,null,(function*(){let e=vh(be(be({baseUrl:"https://api-gateway.mappedin.com/"},j2),t)),{version:i,venue:n}=t,r=`${t.bundleBaseUri||e.baseUrl+"exports/mvf/1/bundle"}?venue=${n}&version=1.0.0`;return e.language=void 0,yield Sm(e,r)}))}function NC(t,e=!1){return Ge(this,null,(function*(){return new Promise(((i,n)=>Ge(this,null,(function*(){try{let r=new TextDecoder,s=r.decode.bind(r),a=yield import("./browser-BW4IT6LG.js");if(e){let e=new Blob(['var enc = new TextDecoder();\n\t\t\t\tvar currentTaskName;\n\t\t\t\tself.onmessage = async function({ data }) {\n\t\t\t\t\tif (data[0] === "task") {\n\t\t\t\t\t\tcurrentTaskName = data[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tpostMessage([\n\t\t\t\t\t\t\t "finished",\n\t\t\t\t\t\t [currentTaskName, JSON.parse(enc.decode(data))]\n\t\t\t\t\t\t]);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t postMessage(["error", e.toString()]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t currentTaskName = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t'],{type:"text/javascript"}),{url:r}=yield O4(t),o=new Uint8Array(yield _r()(r).then((t=>t.arrayBuffer()))),l=a.unzipSync(o),u=Object.keys(l),c=Math.min(u.length,Math.min(4,navigator.hardwareConcurrency)||4),d=[],p=u.map((t=>[t,l[t].buffer])),m=1e6,f=[],g=[];for(let t=0;t<p.length;t++){let[,e]=p[t];e.byteLength>=m?f.push(p[t]):e.byteLength<m&&g.push(p[t])}let v={};if(0===g.length)p.forEach((([t])=>{v[t]=JSON.parse(s(l[t]))})),i(v);else{let t=function({data:t}){let e=this;if("finished"===t[0]){let i=g[a];if(null!=i){let[t,n]=i;e.postMessage(["task",t]),e.postMessage(n,[n]),a++}let[n,r]=t[1];v[n]=r,o++}else if("error"===t[0]){let[,e]=t;d.forEach((t=>t.terminate())),n(e)}o===u.length&&(i(v),d.forEach((t=>t.terminate())))};h(t,"handleMessage");let r=URL.createObjectURL(e);for(let t=0;t<Math.min(c,g.length);t++)d.push(new Worker(r));let a=0,o=0;d.forEach((e=>{if(e.onmessage=t,null!=g[a]){let[t,i]=g[a];e.postMessage(["task",t]),e.postMessage(i,[i]),a++}})),f.forEach((([t])=>{v[t]=JSON.parse(s(l[t])),o++}))}}else{let{url:e}=yield O4(t),n=new Uint8Array(yield _r()(e).then((t=>t.arrayBuffer()))),r=a.unzipSync(n),o=Object.keys(r),l={};for(let t=0;t<o.length;t++){let e=o[t];if(0===e.indexOf("image/")&&-1===e.indexOf("__MACOSX"))l[e]=r[e].buffer;else if("/"!==e.slice(-1))try{l[e]=JSON.parse(s(r[e]))}catch(t){ge.warn("bad file",e)}}i(l)}}catch(t){n(t)}}))))}))}h(D4,"getVenueBundle"),h(B4,"getVenueBundleURL"),h(RC,"downloadBundle"),h(O4,"getVenueMVFURL"),h(NC,"downloadVenueBundleMVF");var F4,_h,$l,Kl,bh,Ql,ec,tc,no,Mh,nc,ic,wh,kC=null==(F4=null==j?void 0:j.env)?void 0:F4.npm_package_version,iy=["websdk","web","webv2"],ry="websdk",sy=class{constructor(t){var e;H(this,_h,void 0),H(this,$l,void 0),H(this,Kl,void 0),H(this,bh,void 0),H(this,Ql,void 0),H(this,ec,void 0),H(this,tc,void 0),H(this,no,void 0),H(this,Mh,void 0),H(this,nc,void 0),H(this,ic,void 0),H(this,wh,void 0),G(this,no,t.clientId),G(this,Mh,t.clientSecret),G(this,nc,t.accessToken),G(this,tc,t.noAuth||!1);let i="https://api-gateway.mappedin.com/track-analytics/a/";!_(this,tc)&&_(this,no)&&!qx(_(this,no))&&(i="https://web-proxy.mappedin.com/a/"),G(this,Kl,i),G(this,Kl,_(this,Kl)+(t.venue+"/")),G(this,$l,!1),G(this,_h,"boolean"==typeof t.testMode?t.testMode:"true"===(null==(e=t.testMode)?void 0:e.toLowerCase())),G(this,bh,iy.find((e=>e===t.context))||iy[0]),G(this,Ql,Px()),G(this,ec,Cx()),G(this,ic,new Set),G(this,wh,t.platformString||""),this.locationSelected=this.locationSelected.bind(this),this.categorySelected=this.categorySelected.bind(this),this.getDirections=this.getDirections.bind(this)}track(t,e){if(_(this,_h))return;let i=Ue(be({},e),{g:_(this,$l)}),n=_(this,Kl)+t+"?"+z4.default.stringify(i),r={"mi-context":ry||_(this,bh),"mi-session":_(this,ec),"mi-device":_(this,Ql),"mappedin-sdk-version":kC,"mappedin-platform-version":_(this,wh)};_(this,nc)?r.Authorization=`Bearer ${_(this,nc)}`:_(this,tc)||(r.Authorization=`Basic ${btoa(`${_(this,no)}:${_(this,Mh)}`)}`),_r()(n,{method:"GET",mode:"cors",headers:r})}locationSelected(t){let e=t.id||t;this.track("select-location",{id:e})}categorySelected(t){let e=t.id||t;this.track("select-category",{id:e})}mapViewLoaded(t,e,i,n){this.track("load-mapview",{type:t,force:e,benchmark:i||-1,reason:n||"success"})}getDirections(t,e){let i={start:t.id,end:e.id,type:"location_to_location"};this.track("query-directions",i)}getSessionID(){return _(this,ec)}getDeviceID(){return _(this,Ql)}setGeolocationMode(t){G(this,$l,t)}trackBlueDotEvent(t){t&&Object.values(sy.BLUEDOT_EVENT).includes(t)&&!_(this,ic).has(t)?(this.track(t),_(this,ic).add(t)):ge.warn(`Ignored unsupported blue dot event: "${t}".`)}trackSearch(t){null!=t&&this.track("query-search",t)}trackSearchSuggest(t){null!=t&&this.track("query-suggest",t)}static setContext(t){let e=iy.find((e=>e===t));e&&(ry=e)}static clearContext(){ry=void 0}},xh=sy;h(xh,"Analytics"),_h=new WeakMap,$l=new WeakMap,Kl=new WeakMap,bh=new WeakMap,Ql=new WeakMap,ec=new WeakMap,tc=new WeakMap,no=new WeakMap,Mh=new WeakMap,nc=new WeakMap,ic=new WeakMap,wh=new WeakMap,w(xh,"BLUEDOT_EVENT",{ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"});var Pr=xh;P(),P();var Th=gn(io(),1),ro=(t=>(t[t.OPTIONAL_MINIMUM=0]="OPTIONAL_MINIMUM",t[t.OPTIONAL_MAXIMUM=1]="OPTIONAL_MAXIMUM",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=3]="HIGH",t[t.ALWAYS_VISIBLE=4]="ALWAYS_VISIBLE",t))(ro||{}),Ym=(t=>(t[t.OUTSIDE_MAP=0]="OUTSIDE_MAP",t[t.NO_POSITIONS_PROVIDED=1]="NO_POSITIONS_PROVIDED",t[t.GEOLOCATION_PROVIDER_ERROR=2]="GEOLOCATION_PROVIDER_ERROR",t[t.CUSTOM_GEOLOCATION_PROVIDER_ERROR=3]="CUSTOM_GEOLOCATION_PROVIDER_ERROR",t))(Ym||{}),rc=(t=>(t[t.NOT_LISTENING=0]="NOT_LISTENING",t[t.LISTENING=1]="LISTENING",t[t.HAS_POSITION=2]="HAS_POSITION",t[t.HAS_INDOOR_POSITION=3]="HAS_INDOOR_POSITION",t[t.LOCATION_UNCERTAIN=4]="LOCATION_UNCERTAIN",t))(rc||{}),Zm=(t=>(t[t.HIDDEN=0]="HIDDEN",t[t.GHOST=1]="GHOST",t[t.NORMAL=2]="NORMAL",t[t.UNCERTAIN=3]="UNCERTAIN",t))(Zm||{}),Eh=(t=>(t.EXPLORE="explore",t.FOLLOW="follow",t))(Eh||{}),Jm=(t=>(t.CLICK="CLICK",t.STATE_CHANGE="STATE_CHANGE",t.POLYGON_CLICKED="POLYGON_CLICKED",t.NOTHING_CLICKED="NOTHING_CLICKED",t.MAP_CHANGED="MAP_CHANGED",t))(Jm||{}),$m=(t=>(t.POSITION_UPDATE="POSITION_UPDATE",t.STATE_CHANGE="STATE_CHANGE",t))($m||{}),Km=(t=>(t.USER_INTERACTION_START="USER_INTERACTION_START",t.USER_INTERACTION_END="USER_INTERACTION_END",t.ZOOM_CHANGED="ZOOM_CHANGED",t.ROTATION_CHANGED="ROTATION_CHANGED",t.TILT_CHANGED="TILT_CHANGED",t.POSITION_CHANGED="POSITION_CHANGED",t.CHANGED="CHANGED",t))(Km||{}),Qm=(t=>(t.UP="up",t.DOWN="down",t.LEFT="left",t.RIGHT="right",t))(Qm||{}),cy=(t=>(t.PIXELS="pixels",t.PORTIONS="portions",t))(cy||{}),Sh={linear:Th.default.Easing.Linear.None,"ease-in":Th.default.Easing.Quadratic.In,"ease-out":Th.default.Easing.Quadratic.Out,"ease-in-out":Th.default.Easing.Quadratic.InOut},uy=(t=>(t.LINEAR="linear",t.EASE_IN="ease-in",t.EASE_OUT="ease-out",t.EASE_IN_OUT="ease-in-out",t))(uy||{});P(),P(),P();var U4=h((function(t){let e,i,n=this,r=document.createElement("div");r.style.display="none!important",r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.pointerEvents="none",this.hovering=!1,t.appendChild(r),this.show=function(t){n.hovering||n.setPosition(e,i),n.hovering=!0,r.style.removeProperty("display"),r.textContent=t.toString(),r.className=t.hoverLabelClass},this.hide=function(){n.hovering&&(n.hovering=!1,r.style.setProperty("display","none","important"),r.textContent="")},this.setZIndex=function(t){r.style.zIndex=t},this.setPosition=function(s,a){e=s,i=a,n.hovering&&(a-r.clientHeight>0?(a-=r.clientHeight,s+r.clientWidth>t.clientWidth&&(s-=r.clientWidth)):s=s-r.clientWidth-10,r.style.transform="translate("+s+"px, "+a+"px)")},this.destroy=function(){t.removeChild(r)}}),"HoverLabel");U4.MODES={NONE:1,NO_TEXT_LABEL_ONLY:2,ALL:3};var hs=U4,V4="precision mediump float;\n\nuniform sampler2D textureLabel;\n\nvarying vec2 vUV;\nvarying vec3 vColor;\n\nvoid main() {\n\tgl_FragColor = texture2D(textureLabel, vUV);\n\tgl_FragColor.rgb = vColor;\n}",H4="attribute vec2 position;\nattribute vec3 origin;\nattribute vec2 size;\nattribute float rotation;\nattribute vec4 uv;\nattribute vec3 color;\n\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat4 modelMatrix;\n\nvarying vec2 vUV;\nvarying vec3 vColor;\n\nvoid main() {\n\tvec4 mapDirectionVector = vec4(0, 1, 0, 0) * viewMatrix * modelMatrix;\n\tfloat mapDirection = atan(mapDirectionVector.y, mapDirectionVector.x);\n\n\tfloat cosRotation = cos(rotation);\n\tfloat sinRotation = sin(rotation);\n\n\tmat4 rotationMatrix = mat4(\n\t\tvec4(cosRotation, -sinRotation, 0.0, 0.0),\n\t\tvec4(sinRotation, cosRotation, 0.0, 0.0),\n\t\tvec4(0.0, 0.0, 1.0, 0.0),\n\t\tvec4(0.0, 0.0, 0.0, 1.0)\n\t);\n\n\tmat4 translate = mat4(\n\t\tvec4(1, 0, 0, 0),\n\t\tvec4(0, 1, 0, 0),\n\t\tvec4(0, 0, 1, 0),\n\t\tvec4(origin, 1)\n\t);\n\n\tgl_Position = projectionMatrix *\n\t viewMatrix *\n\t modelMatrix *\n\t translate *\n\t rotationMatrix *\n\t (vec4(position * size - vec2(0, size.y / 2.0), 0, 1));\n\n\n\tvec2 uvStart = uv.xy;\n\tvec2 uvSize = uv.zw;\n\n\tif (sin(mapDirection + rotation) > 0.0) {\n\t\tvUV = position * uvSize + vec2(uvStart.x, uvStart.y - uvSize.y);\n\t} else {\n\t\tvUV = (vec2(1, 1) - position) * uvSize + vec2(uvStart.x, uvStart.y - uvSize.y);\t\t\n\t}\n\n\tvColor = color;\n} ",hy={MARGIN:2,HEIGHT_MARGIN:.5,SIZE:1.2},dy=56,FC=dy/hy.SIZE,W4=dy/2,zC=1/W4,UC=64,G4=16,n0=4,e0=class{constructor(){this.x=0,this.y=0,this.width=0,this.height=0,this.layer=null,this.index=null}layout(t,e,i,n,r,s){let a,o=this.canvasBounds.rotation*Math.PI/180,l=this.width*this.pixelsPerMu,h=this.height*this.pixelsPerMu;"left"==this.canvasBounds.align?a=this.margin:"right"==this.canvasBounds.align?a=this.canvasBounds.maxWidth-l-this.margin:"center"==this.canvasBounds.align&&(a=(this.canvasBounds.maxWidth-l-this.margin)/2);let u=a*Math.cos(o),c=-a*Math.sin(o),d=this.index;e.setXYZ(d,this.canvasBounds.x-t.width/2+u,-this.canvasBounds.y+t.height/2+c,this.z+.1),i.setXY(d,l,h),n.setX(d,o);let p=this.layer.canvas;r.setXYZW(d,this.x/p.width,1-this.y/p.height,this.width/p.width,this.height/p.height),s.setXYZ(d,this.color.r,this.color.g,this.color.b),e.needsUpdate=!0,i.needsUpdate=!0,n.needsUpdate=!0,r.needsUpdate=!0,s.needsUpdate=!0}};h(e0,"Label");var Lr=class{constructor(t,e,i,n){this.x=t,this.y=e,this.width=i,this.height=n}leftOverSpace(t){return this.width<t.width||this.height<t.height?null:this.height*(this.width-t.width)+this.width*(this.height-t.height)}split(t,e,i){t.x=this.x,t.y=this.y,this.width-t.height<G4&&this.height-t.height<G4?e.splice(i,1):this.width===t.width?e.splice(i,1,new Lr(this.x,this.y+t.height,this.width,this.height-t.height)):this.height===t.height?e.splice(i,1,new Lr(this.x+t.width,this.y,this.width-t.width,this.height)):e.splice(i,1,new Lr(this.x+t.width,this.y,this.width-t.width,t.height),new Lr(this.x,this.y+t.height,this.width,this.height-t.height))}};h(Lr,"Slot");var t0=class{constructor(t,e,i,n){let r=5;for(;Math.pow(2,r)<n;)r+=1;for(n=Math.pow(2,r),r=10;Math.pow(2,r)<i;)r+=1;i=Math.pow(2,r),this.atlas=t,this.map=e,this.canvasWidth=i,this.canvasHeight=n,this.canvas=document.createElement("canvas"),this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.context=this.canvas.getContext("2d"),this.context.textBaseline="bottom",this.spaces=[new Lr(0,0,this.canvas.width,this.canvas.height)],this.free=[],this.labels=[],this.count=UC;let s=new Float32Array(3*this.count),a=new Float32Array(2*this.count),o=new Float32Array(this.count),l=new Float32Array(4*this.count),h=new Float32Array(3*this.count);this.uv=new Ai(l,4,!1,1),this.uv.set(l),this.uv.needsUpdate=!0,this.origin=new Ai(s,3,!1,1),this.origin.set(s),this.origin.needsUpdate=!0,this.size=new Ai(a,2,!1,1),this.size.set(a),this.size.needsUpdate=!0,this.rotation=new Ai(o,1,!1,1),this.rotation.set(o),this.rotation.needsUpdate=!0,this.color=new Ai(h,3,!0,1),this.color.set(h),this.color.needsUpdate=!0;for(let t=0;t<this.count;t++)this.zero(t);let u=new Float32Array([0,0,0,0,1,0,1,1,0,1,0,0]);this.geometry=new Al,this.geometry.setIndex([0,3,1,3,2,1]),this.geometry.setAttribute("position",new qt(u,3)),this.geometry.setAttribute("size",this.size),this.geometry.setAttribute("origin",this.origin),this.geometry.setAttribute("rotation",this.rotation),this.geometry.setAttribute("uv",this.uv),this.geometry.setAttribute("color",this.color),this.texture=new Ra(this.canvas),this.texture.anisotropy=16,this.material=new za,this.material.vertexShader=H4,this.material.fragmentShader=V4,this.material.uniforms={textureLabel:{value:this.texture}},this.material.transparent=!0,this.mesh=new lt(this.geometry,this.material),this.obj=new rt,this.obj.add(this.mesh),this.obj.frustumCulled=!1,this.mesh.frustumCulled=!1,this.map.add(this.obj)}space(){return this.spaces.map((t=>t.width*t.height)).reduce(((t,e)=>t+e))}zero(t){this.origin.array[3*t+0]=0,this.origin.array[3*t+1]=0,this.origin.array[3*t+2]=0,this.size.array[2*t+0]=0,this.size.array[2*t+1]=0,this.rotation.array[t]=0,this.uv.array[4*t+0]=0,this.uv.array[4*t+1]=0,this.uv.array[4*t+2]=0,this.uv.array[4*t+3]=0,this.color.array[3*t+0]=0,this.color.array[3*t+1]=0,this.color.array[3*t+2]=0,this.origin.needsUpdate=!0,this.size.needsUpdate=!0,this.rotation.needsUpdate=!0,this.uv.needsUpdate=!0,this.color.needsUpdate=!0}findSpace(t){if(0!=this.free.length&&this.labels.length==this.count)return!1;let e=-1;for(let i=0;i<this.spaces.length;i++){let n=this.spaces[i].leftOverSpace(t);null!==n&&(-1===e||this.spaces[i].leftOverSpace(t)<n)&&(e=i)}return-1!==e&&(this.spaces[e].split(t,this.spaces,e),t.layer=this,0===this.free.length?(t.index=this.labels.length,this.labels.push(t)):(t.index=this.free.pop(),this.labels[t.index]=t)),-1!=e}remove(t){if(void 0===t.index)return;this.zero(t.index),this.context.clearRect(t.x,t.y,t.width,t.height),this.spaces.push(new Lr(t.x,t.y,t.width,t.height)),this.free.push(t.index),this.labels[t.index]=null;let e=!0;for(let t of this.labels)if(e=e&&null!=t,!e)break;e&&this.atlas.removeLayer(this)}render(t){this.context.save(),this.context.rect(t.x+1,t.y+1,t.width-2,t.height-2),this.context.clip(),this.context.font=t.size+"px "+t.font;for(let e of t.lines)this.context.fillText(e.text,e.x+t.x+n0,e.y+t.y+e.height+n0);this.texture.needsUpdate=!0,this.context.restore()}onWebGLContextRestored(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.context=this.canvas.getContext("2d"),this.context.textBaseline="bottom",this.texture=new Ra(this.canvas),this.texture.anisotropy=16,this.material.uniforms.textureLabel.value=this.texture;for(let t of this.labels)null!=t&&this.render(t)}dispose(){this.geometry.dispose(),this.material.dispose(),this.texture.dispose()}};h(t0,"AtlasLayer");var so=class{constructor(){this.layers=[],this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}addLabel(t,e,i,n,r,s){let a=0,o=0;for(let t of e)o=Math.max(Math.ceil(t.width+t.x),o),a=Math.max(Math.ceil(t.height+t.y),a);let l,h=new e0;h.map=t,h.width=o+2*n0,h.height=a+2*n0,h.lines=e,h.font=i,h.size=n,h.canvasBounds=r.canvasBounds,h.margin=r.margin,h.heightMargin=r.heightMargin,h.pixelsPerMu=s,h.z=r.height,h.view=r,h.color=r.color;for(let e of this.layers)if(l=e,l.map===t){if(l.findSpace(h))break;l=null}else l=null;if(null==l){if(l=new t0(this,t,h.width,h.height),this.layers.push(l),!l.findSpace(h))return;this.layers.sort(((t,e)=>e.space()-t.space()))}return l.render(h),h.layout(t.mapClass,l.origin,l.size,l.rotation,l.uv,l.color),h.layer=l,h}removeLayer(t){let e=this.layers.indexOf(t);-1!=e&&this.layers.splice(e,1)}measure(t,e,i){return this.context.font=i+"px "+e,this.context.measureText(t)}onWebGLContextRestored(){for(let t of this.layers)t.onWebGLContextRestored()}dispose(){for(let t of this.layers)t.dispose()}};h(so,"Atlas");var Ah=class{constructor(t,e,i,n,r,s,a,o,l){let h=mr(t.polygon,e.polygons);this.id=h.id,this.text=(t.shortText||t.text).trim(),this.stateText=t.stateText?" ("+t.stateText+")":"",this.fullText=this.stateText?this.text+this.stateText:this.text,this.font=t.font||n,this.atlas=l,this.canvasBounds=t.canvasBounds||h.canvasBounds,this.mapScale=i.getMapScale()||1,this.margin=(t.margin||hy.MARGIN)*this.mapScale,this.heightMargin=(t.heightMargin||hy.HEIGHT_MARGIN)*this.mapScale,this.scaleMin=t.scaleMin||.25,this.scaleStep=t.scaleStep>0?t.scaleStep:.25,this.multiline=null==t.multiline||t.multiline,this.height=Number(t.height)||null,this.polygonMeshesById=r,this.polyId=t.polygonId||Jt(t.polygon,e.polygons),this.map=i,this.color=new Ee(t.color||o.colors.text||"#000000"),this.baseColor=this.color,this.hideOnCreate=!1,this.hoverLabelText=t.text.trim(),this.fontSize=t.fontSize*this.mapScale||t.size*FC||dy,this.hoverLabelMode=t.hoverLabelMode3D||hs.MODES.ALL,this.hoverLabelClass=t.hoverLabelClass||"mMapviewHoverLabel",this.showHoverLabel=this.hoverLabelMode==hs.MODES.ALL||this.hoverLabelMode==hs.MODES.NO_TEXT_LABEL_ONLY,this.hoverIfLabelFails=this.hoverLabelMode==hs.MODES.ALL||this.hoverLabelMode==hs.MODES.NO_TEXT_LABEL_ONLY,this.textLabelsByPolygonId=s,this.map.textObjects.push(this)}create(){let t=this;if(this.doNotCreate)return;if(null==t.canvasBounds)return t.invalid=!0,t.message="No Canvas Bounds. Can't draw text '"+t.text+"'",void(t.showHoverLabel=t.hoverIfLabelFails);t.showHoverLabel=this.hoverLabelMode==hs.MODES.ALL;let e=zC*this.mapScale,i=W4/this.mapScale,n=[this.text];this.stateText.length&&n.unshift(this.fullText);for(let e of n){let n=e.split(" ").map((function(e){return{width:t.atlas.measure(e,t.font,t.fontSize).width,word:e}})),o=(this.canvasBounds.maxWidth-2*this.margin)*i,l=(this.canvasBounds.maxHeight-2*this.heightMargin)*i,h=(1-this.scaleMin)/this.scaleStep,u=0,c=this.atlas.measure(" ",this.font,this.fontSize).width,d=VC(this.fontSize+"px "+this.font);for(let t=0,e=n.length;t<e;t++){let e=n[t].width,i=Math.ceil((e-o)/(e*this.scaleStep));u=Math.max(i,u)}if(null==this.height)if(this.polygonMeshesById[this.polyId]){let t=this.polygonMeshesById[this.polyId];t.geometry.boundingBox||t.geometry.computeBoundingBox(),this.height=t.geometry.boundingBox.max.z+t.position.z}else this.height=0;var r,s,a;let p=this.scaleStep;t:for(s=u;s<=h;s++){a=1-s*p;let t=n[0].width*a;r=[{text:n[0].word,width:t,height:d*a,x:0,y:0}];for(let e=1;e<n.length;e++){let i=n[e],s=(i.width+c)*a;if(t+s<o)r[r.length-1].text+=" "+i.word,r[r.length-1].width+=s,t+=s;else{if(!this.multiline)continue t;r[r.length-1].width=t,t=i.width*a,r.push({text:i.word,width:t,height:d*a,x:0,y:r[r.length-1].height+r[r.length-1].y})}}if(r.length*d*a<=l){this.invalid=!1;break}}if(0==this.invalid)break}if(0==this.invalid){let t=r.map((t=>Math.ceil(t.width))).reduce(((t,e)=>Math.max(t,e)));for(let e of r)e.x=(t-e.width)/2;this.label=this.atlas.addLabel(this.map,r,this.font,this.fontSize*a,this,e)}this.created=!0}flipIfNeeded(t){}removeSelf(t){this.created?(null!=this.label&&(this.label.layer.remove(this.label),this.label=null),t||(this.map.textObjects=this.map.textObjects.filter((t=>t!=this)),Object.keys(this.textLabelsByPolygonId).forEach((t=>{this.textLabelsByPolygonId[t]==this&&delete this.textLabelsByPolygonId[t]})))):this.doNotCreate=!0}setColor(t){this.color=new Ee(t),null!=this.label&&null!=this.label.layer&&(this.label.color=this.color,this.label.layout(this.map.mapClass,this.label.layer.origin,this.label.layer.size,this.label.layer.rotation,this.label.layer.uv,this.label.layer.color))}clearColor(){this.setColor(this.baseColor)}hide(){this.label?this.label.layer.zero(this.label.index):this.hideOnCreate=!0}show(){if(this.label){let t=this.label.layer,e=this.map;this.label.layout(e.mapClass,t.origin,t.size,t.rotation,t.uv,t.color)}else this.hideOnCreate=!1}toString(){return this.hoverLabelText}};h(Ah,"FlatLabel");var j4=new Map,VC=h((function(t){let e=j4[t];if(null!=e)return e;let i=document.createElement("span");i.textContent="Hg",i.style.font=t;let n=document.createElement("div");n.style.cssText="display: inline-block; width: 1px; height: 0px;";let r=document.createElement("div");r.appendChild(i),r.appendChild(n),document.body.appendChild(r);try{var s=i.getBoundingClientRect()}finally{r.remove()}return null!=s.height&&(j4[t]=s.height,e=s.height),e}),"getTextHeight");P(),P();var i0=h((t=>t.image&&t.image.visible&&(t.image.url||t.image.original)),"imageVisible");function X4(t,e,i,n){let r=(null==n?void 0:n.excludeTypes)||[],s=null==n?void 0:n.sortFunction,a=((null==n?void 0:n.locations)||[]).filter((t=>-1===r.indexOf(t.type))),o=a;null!=s&&(o=a.sort(s));let l={};for(let r=0,s=o.length;r<s;++r){let s=o[r],a=s.polygons;for(let r=0,o=a.length;r<o;++r){let o=a[r];if(i0(o)||!o.geometry.visible)continue;let h=HC(a[r],s,i,t,e,n);null!=h&&(l[o.id]=h)}}return Object.values(l)}function HC(t,e,i,n,r,s){var a,o,l;let h=null==s?void 0:s.sortFunction,u=(null==s?void 0:s.translationMap)||{},c=i[t.id];if(!0===c)return null;{let d=t.canvasBounds;i[t.id]=!0;let p=r,m=0;if(d){let t=d.x-p.width/2,e=-d.y+p.height/2;m=Math.sqrt(Math.pow(t,2)+Math.pow(e,2))}let f=e;if(h?i[t.id]=!0:!1===c?(f=kl(t,n.venue),i[t.id]=!0):i[t.id]=!1,null==f)return null;let g=f.name,v=f.shortName,y=t.rank,_="";return f.states&&f.states.length>0&&(_=(null==(a=f.state)?void 0:a.id)&&u[null==(o=f.state)?void 0:o.id]||(null==(l=f.state)?void 0:l.name)||""),Ue(be({},null==s?void 0:s.appearance),{polygon:t,text:g,shortText:v,stateText:_,distance:m,rank:y,createDispiteImage:f.showLabelWhenImagePresent})}}h(X4,"createLabelObjects"),h(HC,"createLabelOptionsObject"),P(),P();var Mi,ci,cc,lo,uc,Oh,Ty,Rh,Ey,sc={margin:0,text:{numLines:2,lineHeight:1.2,size:14,maxWidth:300,foregroundColor:"white",backgroundColor:"#333"},marker:{size:6,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},r0={lightOnDark:Ue(be({},sc),{text:Ue(be({},sc.text),{foregroundColor:"white",backgroundColor:"#333"}),marker:Ue(be({},sc.marker),{foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}})}),darkOnLight:Ue(be({},sc),{text:Ue(be({},sc.text),{foregroundColor:"#333",backgroundColor:"white"}),marker:Ue(be({},sc.marker),{foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}})})},T5=gn(p0(),1),kL="Sans-Serif",DL=new so,BL={},f0=class{constructor(t,e){H(this,Oh),H(this,Rh),H(this,Mi,void 0),H(this,ci,void 0),H(this,cc,!1),H(this,lo,{}),H(this,uc,{}),w(this,"flatLabels",{}),w(this,"labeledPolygons",{}),G(this,Mi,t),G(this,ci,e),e.mapManager.on("set-map",(()=>{let t=_(this,Mi).currentMap;!_(this,lo)[t.id]&&!0===_(this,cc)&&at(this,Oh,Ty).call(this,t)}))}labelAllLocations(t){G(this,cc,!0);let e=_(this,Mi).currentMap;return null!=t&&G(this,uc,be(be({},t),null==t?void 0:t.appearance)),_(this,lo)[e.id]?[]:at(this,Oh,Ty).call(this,e)}labelPolygon(t,e,i){let n="string"==typeof t?_(this,Mi).venue.getCollectionItemById("polygons",t):t,r=be(be({polygon:n,showLabelWhenImagePresent:!0,text:e},i),null==i?void 0:i.appearance);return at(this,Rh,Ey).call(this,r)}removeLabel(t){let e="string"==typeof t?_(this,Mi).venue.getCollectionItemById("polygons",t):t,i=_(this,ci).textLabelsByPolygonId[e.id];i.removeSelf();let{textObjects:n}=_(this,ci).mapObjects.get(i.map.mapClass.id);n.splice(n.indexOf(i),1),delete _(this,ci).textLabelsByPolygonId[e.id],delete this.flatLabels[e.id]}setAppearance(t,e){let i=this.flatLabels[t.id];if(i)if(1===Object.keys(e).length&&null!=e.color)i.setColor(e.color);else{let n=i.fullText;this.removeLabel(t),this.labelPolygon(t,n,{appearance:(0,T5.default)(e,{height:i.height,margin:i.margin/i.mapScale,color:i.color,fontSize:i.fontSize/i.mapScale,font:i.font,scaleMin:i.scaleMin,scaleStep:i.scaleStep})})}}removeAllLabels(){G(this,cc,!1),Array.from(_(this,ci).mapObjects.values()).forEach((t=>{t.textObjects.forEach((t=>t.removeSelf())),t.labels.clear(),t.textObjects=[]})),_(this,ci).textLabelsByPolygonId={},this.flatLabels={},G(this,lo,{}),_(this,Mi).tryRendering()}};h(f0,"FlatLabelController"),Mi=new WeakMap,ci=new WeakMap,cc=new WeakMap,lo=new WeakMap,uc=new WeakMap,Oh=new WeakSet,Ty=h((function(t){var e;let i=[],n=X4(_(this,Mi).venue,t,this.labeledPolygons,Ue(be({},_(this,uc)),{locations:(null==(e=_(this,uc))?void 0:e.locations)||_(this,Mi).venue.getCollectionItemById("maps",t.id).locations}));for(let t=0,e=n.length;t<e;++t){let e=n[t];i.push(at(this,Rh,Ey).call(this,e))}return _(this,lo)[t.id]=!0,i}),"#processLabelsForMap"),Rh=new WeakSet,Ey=h((function(t){let e=_(this,ci).mapObjects.get(t.polygon.map.id),i=new Ah(t,_(this,Mi).venue,e,kL,_(this,ci).polygonMeshesById,_(this,ci).textLabelsByPolygonId,BL,_(this,ci),DL);return this.flatLabels[t.polygon.id]=i,e.addPendingLowPriorityTask("createLabel",(()=>{i.create(),_(this,Mi).tryRendering()})),_(this,ci).textLabelsByPolygonId[t.polygon.id]=i,i}),"#renderLabel");var E5=f0;P(),P(),P();var m0=class{constructor(t){w(this,"__engine"),w(this,"_initialRank",0),w(this,"screenPosition",[0,0]),w(this,"enabled",!1),w(this,"options",{}),w(this,"mapId",""),w(this,"id","0"),w(this,"action",0),w(this,"getBoundingBoxForCurrentStrategy"),w(this,"rank",0),w(this,"visible",!1),w(this,"offscreen",!1),w(this,"position",new I(0,0,0)),w(this,"dimensions",{width:0,height:0});let{rank:e}=t;this._initialRank=e,this.rank=e}flipIfNeeded(){}setPriority(t){this.rank=t,null!=this.__engine&&this.__engine.update()}setAction(t){this.action=t}resetPriority(){this.rank!==this._initialRank&&(this.setPriority(this._initialRank),null!=this.__engine&&this.__engine.update())}promote(){}demote(){}get strategies(){return[]}removeSelf(){this.__engine=null}enable(){this.enabled=!0}disable(){this.enabled=!1}colliderDidUpdatePosition(t){this.screenPosition=t}colliderDidNotFindAHome(){this.visible=!1}colliderDidMount(){this.dimensions={width:0,height:0}}colliderDidUpdateVisiblity(){}};h(m0,"BaseCollider");var hc=m0;P(),P();var g0=2*devicePixelRatio;function FL(t,e){return e.x+e.w<t.x+t.w&&e.x>t.x&&e.y>t.y&&e.y+e.h<t.y+t.h}function Sy(t,e){let i=e.x,n=e.y,r=e.x+e.w,s=e.y+e.h,a=t.x,o=t.y,l=t.x+t.w,h=t.y+t.h;return i<l&&a<r&&n<h&&o<s}h(FL,"contains"),h(Sy,"intersects");var Fi=class{constructor(t,e,i,n,r){w(this,"x"),w(this,"y"),w(this,"w"),w(this,"h"),w(this,"userData"),this.userData=r,this.x=t,this.y=e,this.w=i,this.h=n}contains(t){return t!==this&&FL(this,t)}intersects(t){return Sy(this,t)}draw(t){t.fillStyle="rgba(123,222,26, 0.5)",t.fillRect(this.x,this.y,this.w,this.h)}};h(Fi,"Rectangle");var y0,S5,dc=class{constructor(t,e){H(this,y0),w(this,"boundary"),w(this,"capacity",4),w(this,"objects",[]),w(this,"topLeft"),w(this,"topRight"),w(this,"bottomLeft"),w(this,"bottomRight"),w(this,"divided",!1),w(this,"parent"),this.parent=e,this.boundary=t}getSize(){return this.divided?this.objects.length+this.topLeft.getSize()+this.topRight.getSize()+this.bottomLeft.getSize()+this.bottomRight.getSize():this.objects.length}subdivide(){let{x:t,y:e,w:i,h:n}=this.boundary;this.topLeft=new dc(new Fi(t,e,i/2,n/2),this),this.topRight=new dc(new Fi(t+i/2,e,i/2,n/2),this),this.bottomLeft=new dc(new Fi(t,e+n/2,i/2,n/2),this),this.bottomRight=new dc(new Fi(t+i/2,e+n/2,i/2,n/2),this),this.divided=!0}query(t){let e=[];return this.boundary.intersects(t)?(e.push(...this.objects),this.divided&&(e.push(...this.topLeft.query(t)),e.push(...this.topRight.query(t)),e.push(...this.bottomLeft.query(t)),e.push(...this.bottomRight.query(t))),e):[]}insert(t){return at(this,y0,S5).call(this,t),!!this.boundary.contains(t)&&(this.objects.length<this.capacity?(this.objects.push(t),!0):(this.divided||this.subdivide(),!1===(this.topLeft.insert(t)||this.topRight.insert(t)||this.bottomLeft.insert(t)||this.bottomRight.insert(t))&&this.objects.push(t),!0))}drawObjects(t){this.objects.forEach((e=>e.draw(t))),this.divided&&(this.topLeft.drawObjects(t),this.topRight.drawObjects(t),this.bottomLeft.drawObjects(t),this.bottomRight.drawObjects(t))}draw(t){this.parent,t.rect(this.boundary.x,this.boundary.y,this.boundary.w,this.boundary.h),this.divided&&(this.topLeft.draw(t),this.topRight.draw(t),this.bottomLeft.draw(t),this.bottomRight.draw(t)),t.strokeStyle="black",t.lineWidth=4,t.stroke()}},Nh=dc;h(Nh,"QuadTree"),y0=new WeakSet,S5=h((function(t){t.x-=g0,t.y-=g0,t.h+=2*g0,t.w+=2*g0}),"#addPadding");var Ay=!1,v0=10*devicePixelRatio,x0=100,A5="LOW_PRIORITY",_0=class extends hc{get strategies(){let t=h((()=>{}),"noop");return[{name:"left",getBoundingBox:h((t=>[0,t.totalHeight,-v0,5]),"leftBoundingBox"),onStrategySelected:t},{name:"top",getBoundingBox:h((t=>[-v0,5,0,t.totalWidth]),"topBoundingBox"),onStrategySelected:t},{name:"right",getBoundingBox:h((t=>[0,t.totalHeight,t.totalWidth-5,t.totalWidth+v0]),"rightBoundingBox"),onStrategySelected:t},{name:"bottom",getBoundingBox:h((t=>[t.totalHeight-5,t.totalHeight+v0,0,t.totalWidth]),"bottomBoundingBox"),onStrategySelected:t}]}};h(_0,"OffscreenCollider");var qn,zL=h(((t,e)=>e.length?(e.splice(qy(t,e),0,t),e):(e.push(t),e)),"insertOne"),UL=h(((t,e)=>(e.length&&e.splice(e.indexOf(t),1),e)),"removeOne"),qy=h(((t,e,i,n)=>{let r=i||0,s=n||e.length,a=Math.floor(r+(s-r)/2);return e[a].rank===t.rank?a:s-r<=1?e[a].rank<t.rank?a:a+1:e[a].rank>t.rank?qy(t,e,a,n):qy(t,e,i,a)}),"locationOf"),b0=class{constructor(t,e){w(this,"colliderCanvas"),w(this,"debugCanvas"),w(this,"colliderCanvasContext"),w(this,"debugCanvasContext"),w(this,"collisionEngineContainerEl"),w(this,"stepsX"),w(this,"stepsY"),w(this,"totalWidth"),w(this,"totalHeight"),w(this,"project"),w(this,"colliders",new Map),w(this,"offscreenRanges",[]),H(this,qn,{}),w(this,"initialized",!1),w(this,"mapView"),w(this,"core"),w(this,"screen"),w(this,"init",h(((t,e)=>{this.project=e,t.appendChild(this.collisionEngineContainerEl),t.appendChild(this.colliderCanvas),this.totalWidth=t.clientWidth,this.totalHeight=t.clientHeight,this.screen=new Fi(0,0,this.totalWidth,this.totalHeight),this.colliderCanvas.width=this.totalWidth*devicePixelRatio,this.colliderCanvas.height=this.totalHeight*devicePixelRatio,this.colliderCanvas.style.width=this.totalWidth+"px",this.colliderCanvas.style.height=this.totalHeight+"px",Ay&&(this.debugCanvasContext=this.debugCanvas.getContext("2d"),t.appendChild(this.debugCanvas),this.debugCanvas.width=this.totalWidth,this.debugCanvas.height=this.totalHeight,this.debugCanvas.style.width=this.totalWidth+"px",this.debugCanvas.style.height=this.totalHeight+"px",this.debugCanvas.style.opacity="0.4");let i=new _0({rank:999});this.offscreenRanges=i.strategies.map((({getBoundingBox:t})=>t({x:0,y:0,totalHeight:this.totalHeight,totalWidth:this.totalWidth}).map((t=>Math.round(t))))),this.initialized=!0,this.core.controls.dispatcher.addEventListener(this.core.controls.CAMERA_EVENTS.ROTATE_START_EVENT.type,(()=>{this.colliderCanvas.classList.add("interacting")})),this.core.controls.dispatcher.addEventListener(this.core.controls.CAMERA_EVENTS.MULTI_START_EVENT.type,(()=>{this.colliderCanvas.classList.add("interacting")})),this.core.controls.dispatcher.addEventListener(this.core.controls.CAMERA_EVENTS.MULTI_END_EVENT.type,(()=>{this.update()})),this.core.controls.dispatcher.addEventListener(this.core.controls.CAMERA_EVENTS.ROTATE_END_EVENT.type,(()=>{this.update()})),this.core.controls.dispatcher.addEventListener(this.core.controls.CAMERA_EVENTS.ZOOM_START_EVENT.type,(()=>{this.colliderCanvas.classList.add("interacting")})),this.core.controls.dispatcher.addEventListener(this.core.controls.CAMERA_EVENTS.ZOOM_END_EVENT.type,(()=>{this.update()})),this.core.mapManager.on("set-map",(()=>{this.update()}))}),"init")),w(this,"qtree"),w(this,"recompute",h((()=>{if(!this.initialized)return;let t,e,i,[n,r,s,a]=[1/0,1/0,-1/0,-1/0],o=this.offscreenRanges.map((t=>{let e=t[3]-t[2],i=t[1]-t[0];return n=Math.min(n,t[2]),s=Math.max(s,t[3]),r=Math.min(r,t[0]),a=Math.max(a,t[1]),new Fi(Math.round(t[2]*devicePixelRatio),Math.round(t[0]*devicePixelRatio),Math.round(e*devicePixelRatio),Math.round(i*devicePixelRatio))}));for(let o of this.sortedColliders)t=o.position,e=o.mapId,o.getBoundingBoxForCurrentStrategy=void 0,o.enabled&&(i=this.project(t,e),"function"==typeof o.colliderDidUpdatePosition&&o.colliderDidUpdatePosition([i.x,i.y]),o._bboxes=o.strategies.map((({name:t,getBoundingBox:e,onStrategySelected:l})=>{let h=e({x:i.x,y:i.y}),u=h[3]-h[2],c=h[1]-h[0];return n=Math.min(n,h[2]),s=Math.max(s,h[3]),r=Math.min(r,h[0]),a=Math.max(a,h[1]),null==o._bboxes&&(o._bboxes=[]),[t,new Fi(Math.round(h[2]*devicePixelRatio),Math.round(h[0]*devicePixelRatio),Math.round(u*devicePixelRatio),Math.round(c*devicePixelRatio),{collider:o}),l,e]})));let l,h=new Fi(Math.round(n*devicePixelRatio)-x0,Math.round(r*devicePixelRatio)-x0,Math.round(s*devicePixelRatio-n*devicePixelRatio)+2*x0,Math.round(a*devicePixelRatio-r*devicePixelRatio)+2*x0);this.qtree=new Nh(h),o.forEach((t=>{this.qtree.insert(t)}));for(let t=0;t<this.sortedColliders.length;t++){let e=!1;if(l=this.sortedColliders[t],null==l._bboxes)continue;let[i,n]=[1/0,null];for(let[,t,r,s]of l._bboxes){let a=this.qtree.query(t).filter((e=>t.intersects(e)));if(a.length<=i&&(n=[t,r,s]),0===a.length){this.qtree.insert(t),l.getBoundingBoxForCurrentStrategy=s,e=!0,l.setAction(1),r(l);break}}if(4===l.rank&&null!=n){let[t,i,r]=n;this.qtree.insert(t),l.getBoundingBoxForCurrentStrategy=r,e=!0,l.setAction(1),i(l)}!e&&"function"==typeof l.colliderDidNotFindAHome&&l.colliderDidNotFindAHome(),"function"==typeof l.colliderDidUpdateVisiblity&&l.colliderDidUpdateVisiblity()}this.draw(),this.colliderCanvas.classList.remove("interacting")}),"recompute")),w(this,"draw",h((()=>{this.colliderCanvasContext.clearRect(0,0,this.totalWidth*devicePixelRatio,this.totalHeight*devicePixelRatio);for(let t of this.sortedColliders)t.offscreen||t instanceof ms&&t.draw(this.colliderCanvasContext);Ay&&this.qtree&&(this.colliderCanvasContext.beginPath(),this.qtree.draw(this.colliderCanvasContext),this.qtree.drawObjects(this.colliderCanvasContext))}),"draw")),w(this,"reposition",h((()=>{if(!this.initialized)return;let t,e,i;for(let n of this.sortedColliders)if(t=n.position,e=n.mapId,i=this.project(t,e),n.enabled){if("function"==typeof n.getBoundingBoxForCurrentStrategy){let[t,e,r,s]=n.getBoundingBoxForCurrentStrategy({x:i.x,y:i.y});Sy(this.screen,{x:r,y:t,w:s-r,h:e-t})?n.offscreen=!1:n.offscreen=!0}"function"==typeof n.colliderDidUpdatePosition&&n.colliderDidUpdatePosition([i.x,i.y])}this.draw()}),"reposition")),w(this,"add",h(((t,e)=>{e.__engine=this,"function"==typeof e.colliderDidMount&&e.colliderDidMount(),this.colliders.set(t,e),null==_(this,qn)[e.mapId]&&(_(this,qn)[e.mapId]={needsSort:!1,colliders:[]}),zL(e,_(this,qn)[e.mapId].colliders)}),"add")),w(this,"remove",h((t=>{let e=this.colliders.get(t);null!=e&&(e.disable(),e.__engine=void 0,this.colliders.delete(t),UL(e,_(this,qn)[e.mapId].colliders))}),"remove")),w(this,"update",h((()=>{this.initialized&&(_(this,qn)[this.mapView.currentMap.id]&&(_(this,qn)[this.mapView.currentMap.id].needsSort=!0),requestAnimationFrame((()=>{this.recompute()})),this.reposition())}),"update")),w(this,"resize",h((t=>{this.initialized&&(this.init(t,this.project),this.update())}),"resize")),w(this,"destroy",h((()=>{for(let t of Array.from(this.colliders.values()))this.remove(t.id)}),"destroy")),this.mapView=t,this.core=e,this.colliderCanvas=document.createElement("canvas"),this.collisionEngineContainerEl=document.createElement("div"),Ay&&(this.debugCanvas=document.createElement("canvas"),this.debugCanvas.classList.add("mappedin__smart-collision-engine-debug__container")),this.colliderCanvas.classList.add("mappedin__smart-collision-engine-debug__container"),this.collisionEngineContainerEl.classList.add("mappedin__smart-collision-engine__container"),this.colliderCanvasContext=this.colliderCanvas.getContext("2d")}get sortedColliders(){var t;if(!this.initialized)return[];let e=this.mapView.currentMap.id;return _(this,qn)[e]&&(null==(t=_(this,qn)[e].colliders)?void 0:t.length)>0&&!1===_(this,qn)[e].needsSort?_(this,qn)[e].colliders:(null==_(this,qn)[e]&&(_(this,qn)[e]={needsSort:!0,colliders:[]}),_(this,qn)[e].colliders=Array.from(this.colliders.values()).filter((t=>t.mapId===e)).sort(((t,e)=>e.rank-t.rank)),_(this,qn)[e].needsSort=!1,[..._(this,qn)[e].colliders])}};h(b0,"SmartCollisionEngine"),qn=new WeakMap;var q5=b0;P();var kh=document.createElement("canvas");kh.width=500*devicePixelRatio,kh.height=500*devicePixelRatio,kh.style.width="500px",kh.style.height="500px";var Dh,gs,Bh,Ly,Fh,zh,Cy=kh.getContext("2d"),P5=h(((t,e,i,n=2,r=1.2,s={strokeText:!0})=>{let a=`bold ${e*devicePixelRatio}px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif`;Cy.font=a;let o=[],l=t.split(" "),h=0,u=0,c=0;for(;u<l.length;){let t=l[u];if(h===n&&h>0){o[h-1]+="...";break}if(null==o[h]&&(o[h]=t,u++),1===l.length){o[h]=t;break}if(null==l[u])break;let{width:e}=Cy.measureText(o[h]+" "+l[u]);e<=i?(o[h]+=" "+l[u],u++):h++}o.forEach((t=>{let{width:e}=Cy.measureText(t);c=Math.max(e,c)}));let d=e*devicePixelRatio*r,p=o.length*d;return{maxWidth:c,maxHeight:p,lines:o.length,draw:(t,e,i)=>{1===o.length?(s.strokeText&&t.strokeText(o[0],e,i),t.fillText(o[0],e,i)):(s.strokeText&&(t.strokeText(o[0],e,i-d/2),t.strokeText(o[1],e,i+d/2)),t.fillText(o[0],e,i-d/2),t.fillText(o[1],e,i+d/2))}}}),"shaveText"),Iy=gn(C5(),1),I5=gn(p0(),1),ni=h((t=>t*devicePixelRatio),"dp"),co=4*devicePixelRatio,VL={heightAbovePolygon:0,scale:devicePixelRatio,appearance:r0.darkOnLight},HL="Smart Labels do not support setting and clearing colors. Re-label the polygon with desired colors instead",ii=class extends hc{constructor(t,e){if(super(t),H(this,Bh),w(this,"lines",0),w(this,"contextConfigured",!1),w(this,"fillText"),w(this,"newStyle",{}),w(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"}),w(this,"setColor",h((()=>{ge.warn(HL)}),"setColor")),w(this,"clearColor",h((()=>{}),"clearColor")),w(this,"zoomProportion",0),w(this,"_cache",{}),w(this,"appearance"),w(this,"mapView"),H(this,Dh,void 0),H(this,Fh,void 0),H(this,zh,void 0),null==_(ii,gs)&&G(ii,gs,{}),this.id=t.id,this.mapView=e,this.options=(0,I5.default)({},{text:t.shortText||t.text||""},t,VL),null!=t.rank&&t.rank>0)this.rank=t.rank,this._initialRank=t.rank;else{let t="test"===j.env.NODE_ENV?ii.testId:Math.random();ii.testId++,this.rank=t,this._initialRank=t}let{position:i,polygon:n,scale:r,heightAbovePolygon:s,polygonHeight:a}=this.options;t.stateText&&(this.options.text+=` (${t.stateText})`),this.appearance={margin:this.options.appearance.margin/r,text:{lineHeight:this.options.appearance.lineHeight,numLines:this.options.appearance.text.numLines,size:this.options.appearance.text.size,maxWidth:this.options.appearance.text.maxWidth/r,foregroundColor:this.options.appearance.text.foregroundColor,backgroundColor:this.options.appearance.text.backgroundColor},marker:{size:this.options.appearance.marker.size/r,foregroundColor:{active:this.options.appearance.marker.foregroundColor.active,inactive:this.options.appearance.marker.foregroundColor.inactive||(0,Iy.default)(this.options.appearance.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:this.options.appearance.marker.backgroundColor.active,inactive:this.options.appearance.marker.backgroundColor.inactive||(0,Iy.default)(this.options.appearance.marker.backgroundColor.active).setAlpha(.5).toRgbString()}}};let o=a+s;i.setZ(o),this.position=i,this.mapId=n.map.id}enable(t=!0){super.enable(),t&&this.__engine.update()}get strategies(){let{width:t,height:e}=this.dimensions,{margin:i}=this.appearance,n=this.appearance.marker.size*devicePixelRatio*(1+zt(1-this.zoomProportion,3)),r=8*devicePixelRatio,s=t+2*co-r,a=e+2*co-r;return[{name:"RIGHT",getBoundingBox:({x:t,y:e})=>[e-a/2-i,e+a/2+i,t-n/2-i,t+n/2+s+i],onStrategySelected:t=>{this.newStyle=Object.assign({},t.style,{textAlign:"left",pinVisibility:1,top:-a/2-r/2,left:n/2,textLabelVisible:!0,cachedSymbol:this.getCachedSymbol("RIGHT","left",co)})}},{name:"LEFT",getBoundingBox:({x:t,y:e})=>[e-a/2-i,e+a/2+i,t-n/2-s-r/2-i,t+n/2+i],onStrategySelected:t=>{this.newStyle=Object.assign({},t.style,{textAlign:"right",pinVisibility:1,top:-a/2-r/2,left:-n/2-s-r/2,textLabelVisible:!0,cachedSymbol:this.getCachedSymbol("LEFT","right",s*devicePixelRatio-2*co+r)})}},{name:"TOP",getBoundingBox:({x:t,y:e})=>[e-a-n/2-i,e+n/2+i,t-s/2-i,t+s/2+i],onStrategySelected:t=>{this.newStyle=Object.assign({},t.style,{pinVisibility:1,textAlign:"center",textLabelVisible:!0,top:-a-n/2-r/2,left:-s/2,cachedSymbol:this.getCachedSymbol("TOP","center",s*devicePixelRatio/2)})}},{name:A5,getBoundingBox:({x:t,y:e})=>[e-n/4,e+n/4,t-n/4,t+n/4],onStrategySelected:t=>{this.newStyle=Object.assign({},t.style,{pinVisibility:.5,textLabelVisible:!1})}}]}getCachedSymbol(t,e,i){let{width:n,height:r}=this.dimensions;if(null==this._cache[t]){let s,a=n+2*co,o=r+2*co;null!=window.OffscreenCanvas?s=new OffscreenCanvas(a*devicePixelRatio,o*devicePixelRatio):(s=document.createElement("canvas"),s.width=a*devicePixelRatio,s.height=o*devicePixelRatio,s.style.width=a+"px",s.style.height=o+"px");let l=s.getContext("2d"),{size:h}=this.options.appearance.text;l.textAlign=e,l.font=`bold ${h*devicePixelRatio}px 'InterUI-Regular', Helvetica Neue, Arial, sans-serif`,l.textBaseline="middle",l.lineJoin="miter",l.miterLimit=2,l.strokeStyle="white",l.lineWidth=co,l.fillStyle=this.appearance.text.foregroundColor,l.strokeStyle=this.appearance.text.backgroundColor,this.fillText&&"function"==typeof this.fillText&&this.fillText(l,i,o*devicePixelRatio/2),this._cache[t]=s}return this._cache[t]}colliderDidMount(){let{size:t,maxWidth:e,numLines:i,lineHeight:n}=this.appearance.text,r=this.options.text||"",{draw:s,lines:a,maxWidth:o,maxHeight:l}=P5(r,t,e,i,n);this.fillText=s,this.lines=a,this.dimensions={width:o/devicePixelRatio,height:l/devicePixelRatio}}colliderDidUpdatePosition(t){this.screenPosition=t}setPriority(t){super.setPriority(t),null!=this.__engine&&this.__engine.update()}colliderDidUpdateVisiblity(){1===this.action?this.visible=!0:this.visible=!1,this.action=0,this.style=this.newStyle}colliderDidGoOutsideGrid(){}colliderDidNotFindAHome(){this.action=2}disable(t=!0){super.disable(),this.visible=!1,t&&this.__engine.update()}draw(t){if(!this.visible)return;let e,[i,n]=this.screenPosition,{pinVisibility:r,textLabelVisible:s,top:a,left:o,textAlign:l,cachedSymbol:h}=this.style,u=ni(i),c=ni(n);if(_(this,Fh)!==this.mapView.currentScale){let t=1+zt(1-this.mapView.currentScale,3),e=this.appearance.marker.size*devicePixelRatio*t;G(this,zh,Math.floor(e)),G(this,Fh,this.mapView.currentScale)}e=_(this,zh);let d=ni(4);if(_(ii,gs)[e]){let i=1===r?_(ii,gs)[e][0]:_(ii,gs)[e][1];t.drawImage(i,u-ni(e/2)-d,c-ni(e/2)-d)}else{t.lineWidth=4*devicePixelRatio;let i=at(this,Bh,Ly).call(this,e,ni(e/4),this.appearance.marker.backgroundColor.active,this.appearance.marker.foregroundColor.active,d),n=at(this,Bh,Ly).call(this,e,ni(e/6),this.appearance.marker.backgroundColor.inactive,this.appearance.marker.foregroundColor.active,d);_(ii,gs)[e]=[i,n]}_(this,Dh)!==l&&(t.textAlign=l,G(this,Dh,l)),s&&null!=h&&(t.shadowColor="transparent",t.drawImage(h,u+ni(o),c+ni(a)))}static clone(t,e){if(void 0===ii.original)return ii.original=new ii(t,e),ii.original;{let e=Object.create(ii.original);if(e.id=t.polygon.id,e.options.text=t.text,null!=t.rank&&t.rank>0)e.rank=t.rank,e._initialRank=t.rank;else{let t=Math.random();e.rank=t,e._initialRank=t}e.position=t.position;let i=t.polygonHeight;return e.position.setZ(i),e.mapId=t.polygon.map.id,t.stateText&&(e.options.text+=` (${t.stateText})`),e}}},uo=ii;h(uo,"FloatingLabel"),Dh=new WeakMap,gs=new WeakMap,Bh=new WeakSet,Ly=h((function(t,e,i,n,r){let s,a=t+r;null!=window.OffscreenCanvas?s=new OffscreenCanvas(a*devicePixelRatio,a*devicePixelRatio):(s=document.createElement("canvas"),s.width=a*devicePixelRatio,s.height=a*devicePixelRatio,s.style.width=a+"px",s.style.height=a+"px");let o=s.getContext("2d");return o.lineWidth=4*devicePixelRatio,o.shadowColor="rgba(0,0,0,0.4)",o.shadowOffsetY=2*devicePixelRatio,o.shadowBlur=5*devicePixelRatio,o.beginPath(),o.arc(ni(a)/2,ni(a)/2,e+ni(3),0,2*Math.PI),o.fillStyle=i,o.fill(),o.beginPath(),o.arc(ni(a)/2,ni(a)/2,e+ni(.2),0,2*Math.PI),o.shadowColor="transparent",o.fillStyle=n,o.fill(),s}),"#createPinCanvas"),Fh=new WeakMap,zh=new WeakMap,w(uo,"testId",0),H(uo,gs,void 0),w(uo,"original");var ms=uo;function L5(t,e,i,n){let r=[],s=(null==i?void 0:i.locations)||t.locations;for(let a of t.polygons){let o,[l]=a.entrances;if(!(!l||null!=n&&n.id&&n.id!==l.map.id||i0(a))&&a.geometry.visible&&(o=kl(a,t))){if(!s.includes(o))continue;let t=o.showLabelWhenImagePresent;if(e[a.id+"_image"]&&!t)continue;let n=(null==i?void 0:i.excludeTypes)||[];if(n.length>0&&n.includes(o.type))continue;let h=GL(a,l,o,i||{});null!=h&&r.push(h)}}return r}function GL(t,e,i,n){var r,s,a,o,l;let h="test"===j.env.NODE_ENV?ms.testId:Math.random();ms.testId++;let u,c=i.name,d=i.shortName;return i.states&&i.states.length>0&&(u=(null==(r=i.state)?void 0:r.id)&&(null==(a=null==n?void 0:n.translationMap)?void 0:a[null==(s=i.state)?void 0:s.id])||(null==(o=i.state)?void 0:o.name)||null),{polygon:t,rank:(null==(l=t.rank)?void 0:l.score)||h,entranceNode:e,text:null==u?d||c:(d||c)+` (${u})`,appearance:n.appearance,createDespiteImage:i.showLabelWhenImagePresent}}P(),h(L5,"createLabelObjects"),h(GL,"createLabelOptionsObject");var ui,bn,pc,ho,Uh,Oy,fc,T0,S0,R5,mc,E0,A0,N5,Vh,Ry,q0,k5,Hh,Ny,P0,D5,C0,B5,Gh,ky,jh,Wh,Dy,I0,F5,O5=gn(p0(),1),w0=class{constructor(t,e){H(this,Uh),H(this,fc),H(this,S0),H(this,mc),H(this,A0),H(this,Vh),H(this,q0),H(this,Hh),H(this,P0),H(this,C0),H(this,Gh),H(this,Wh),H(this,I0),H(this,ui,void 0),H(this,bn,void 0),H(this,pc,!1),H(this,ho,{}),H(this,jh,{}),w(this,"floatingLabels",{}),G(this,ui,t),G(this,bn,e),e.mapManager.on("set-map",(()=>{let t=_(this,ui).currentMap;!_(this,ho)[t.id]&&_(this,pc)&&at(this,Uh,Oy).call(this,t)}))}addLabel(t,e,i){return null!=_(this,ui).venue.getCollectionItemById("nodes",t.id)?at(this,fc,T0).call(this,t,e,i):at(this,S0,R5).call(this,t,e,i)}removeLabel(t,e=!1){null!=_(this,ui).venue.getCollectionItemById("nodes",t.id)?at(this,mc,E0).call(this,t,e):at(this,A0,N5).call(this,t,e)}setPriority(t,e){null!=_(this,ui).venue.getCollectionItemById("nodes",t.id)?at(this,Vh,Ry).call(this,t,e):at(this,q0,k5).call(this,t,e)}resetPriority(t){null!=_(this,ui).venue.getCollectionItemById("nodes",t.id)?at(this,Hh,Ny).call(this,t):at(this,P0,D5).call(this,t)}removeAllLabels(){G(this,pc,!1);for(let t in this.floatingLabels)at(this,C0,B5).call(this,t,!0);Array.from(_(this,bn).mapObjects.values()).forEach((t=>{t.labels.clear()})),this.floatingLabels={},G(this,ho,{}),_(this,bn).smartCollisionEngine.update(),_(this,bn).renderer.disposeOfRenderLists(),_(this,ui).tryRendering()}setAppearance(t,e){null!=_(this,ui).venue.getCollectionItemById("nodes",t.id)?at(this,Wh,Dy).call(this,t,e):at(this,I0,F5).call(this,t,e)}labelAllLocations(t){G(this,pc,!0);let e=_(this,ui).currentMap;return null!=t&&G(this,jh,t),_(this,ho)[e.id]?[]:at(this,Uh,Oy).call(this,e)}};h(w0,"FloatingLabelController"),ui=new WeakMap,bn=new WeakMap,pc=new WeakMap,ho=new WeakMap,Uh=new WeakSet,Oy=h((function(t){let e=L5(_(this,ui).venue,_(this,bn).polygonMeshesById,_(this,jh),t);if(null==e)return[];let i=e.map((t=>at(this,Gh,ky).call(this,t,!0)));return _(this,ho)[t.id]=!0,_(this,bn).determineNewLabelSize(),_(this,bn).smartCollisionEngine.update(),i}),"#processLabelsForMap"),fc=new WeakSet,T0=h((function(t,e,i){var n;this.floatingLabels[t.id]&&at(this,mc,E0).call(this,t);let r="test"===j.env.NODE_ENV?ms.testId:Math.random();ms.testId++;let s=be({polygon:t.polygon,rank:(null==(n=t.polygon.rank)?void 0:n.score)||r,entranceNode:t,text:e,appearance:null==i?void 0:i.appearance,createDespiteImage:!0},i||{});return at(this,Gh,ky).call(this,s)}),"#labelNode"),S0=new WeakSet,R5=h((function(t,e,i){var n,r;let s=[];for(let a of t.entrances)null!=(null==(n=t.rank)?void 0:n.node)&&(null==(r=t.rank)?void 0:r.node)!=a.id||s.push(at(this,fc,T0).call(this,a,e,i));return 0===s.length?(ge.warn("No entrances found on this polygon. Skipping."),null):s}),"#labelPolygon"),mc=new WeakSet,E0=h((function(t,e=!1){_(this,bn).smartCollisionEngine.remove(t.id),e||(delete this.floatingLabels[t.id],_(this,bn).smartCollisionEngine.update())}),"#removeLabelNode"),A0=new WeakSet,N5=h((function(t,e=!1){t.entrances.forEach((t=>at(this,mc,E0).call(this,t,e)))}),"#removeLabelPolygon"),Vh=new WeakSet,Ry=h((function(t,e){t.id in this.floatingLabels&&this.floatingLabels[t.id].setPriority(e)}),"#setPriorityNode"),q0=new WeakSet,k5=h((function(t,e){t.entrances.forEach((t=>at(this,Vh,Ry).call(this,t,e)))}),"#setPriorityPolygon"),Hh=new WeakSet,Ny=h((function(t){t.id in this.floatingLabels&&this.floatingLabels[t.id].resetPriority()}),"#resetPriorityNode"),P0=new WeakSet,D5=h((function(t){t.entrances.forEach((t=>at(this,Hh,Ny).call(this,t)))}),"#resetPriorityPolygon"),C0=new WeakSet,B5=h((function(t,e=!1){_(this,bn).smartCollisionEngine.remove(t),e||delete this.floatingLabels[t]}),"#removeLabelByNode"),Gh=new WeakSet,ky=h((function(t,e=!1){let i=t.polygon,n=_(this,bn).mapObjects.get(i.map.id),r=i.geometry.scale.z*Math.max(n.mapClass.width,n.mapClass.height)/1e3,s=_(this,bn).getPositionNode(t.entranceNode),a=new ms(Ue(be({id:t.entranceNode.id,polygonHeight:r},t),{position:s}),_(this,bn));return this.floatingLabels[t.entranceNode.id]=a,_(this,bn).smartCollisionEngine.add(t.entranceNode.id,a),n.labels.add(a),a.enable(!1),n.addPendingLowPriorityTask("createTextObject",(()=>{e||(_(this,bn).determineNewLabelSize(),_(this,bn).smartCollisionEngine.update())})),e||_(this,ui).tryRendering(),a}),"#renderLabel"),jh=new WeakMap,Wh=new WeakSet,Dy=h((function(t,e){let i=this.floatingLabels[t.id];if(!i)return void ge.warn("No label found for this node. Skipping...");this.removeLabel(t);let n={appearance:(0,O5.default)(e,i.appearance)};at(this,fc,T0).call(this,t,i.options.text,n)}),"#setNodeAppearance"),I0=new WeakSet,F5=h((function(t,e){for(let i of t.entrances)at(this,Wh,Dy).call(this,i,e)}),"#setPolygonAppearance");var z5=w0;P(),P();var er=class{constructor(){w(this,"_subscribers",{})}publish(t,e){!this._subscribers||!this._subscribers[t]||this._subscribers[t].forEach((function(t){"function"==typeof t&&t(e)}))}on(t,e){this._subscribers||(this._subscribers={}),this._subscribers[t]=this._subscribers[t]||[],this._subscribers[t].push(e)}off(t,e){if(!this._subscribers||null==this._subscribers[t])return;let i=this._subscribers[t].indexOf(e);-1!==i&&this._subscribers[t].splice(i,1)}destroy(){this._subscribers={}}};h(er,"PubSub"),P();var L0=2*Math.PI,Xh=Math.PI/2,By=1.5*Math.PI;P();var U5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAkklEQVRoge3awQ3AIAxD0VAMYf+F0yUixbL8JshXuLSwIqJCwDc9QBeZEOy9p2doAQDTM7TQ2cg5Z3qGFjpHS2YjDiGDe+/0DC0cwkYpJKdnaIFMkY1kymzEIVQcwsYhbPDem56hhc5GHELGIWwcwsYhbJS+2R1CxSFsdH5iO4SMr97Y6FxPqxytVVV+HcTEIWx+9mcIqHSOm9QAAAAASUVORK5CYII=";P();var WL={STATIC:0,ANIMATED:1,ALWAYS_ON_TOP:2},hi=WL;P(),P();var O0=class{constructor(t){this.active=!1,this.positions=[],this.positionIndex=0,this.timerList=[],this.timeElapsed=0,this.startTime=void 0,this.startPos=0,this.endPos=0,this.smoothingType=void 0,this.isActive=this.isActive.bind(this),this.setCallbacks=this.setCallbacks.bind(this),this.watchPosition=this.watchPosition.bind(this),this.sendPositionResponse=this.sendPositionResponse.bind(this),this.start=this.start.bind(this),this.pause=this.pause.bind(this),this.speed=t.speed||10,window.positions&&this.setPositions(window.positions)}isActive(){return this.active}setPositions(t){this.reset(),this.positions=t,this.endPos=t.length-1}setCallbacks(t,e,i){this.successCallback=t,this.errorCallback=e,this.options=i}clearWatch(){this.reset()}watchPosition(t,e,i){this.setCallbacks(t,e,i),this.start()}sendPositionResponse(t){switch(this.timeElapsed=Date.now()-this.startTime,t.type){case"ERROR":this.errorCallback({code:t.code,message:t.message,timestamp:Date.now()});break;case"ANNOTATION":ge.log(`Annotation Update: ${t.annotation}`);break;default:this.successCallback({coords:t.coords,timestamp:t.timestamp,positionIndex:this.positionIndex})}this.positionIndex===this.endPos?this.reset():this.positionIndex+=1}start(){let t=0;this.positions[this.positionIndex-1]?t=this.positions[this.positionIndex-1].timestamp:this.positions[0].timestamp>1e6&&(t=this.positions[0].timestamp),this.startTime=Date.now(),this.positions.slice(this.positionIndex,this.endPos+1).forEach((e=>{let{timestamp:i}=e;this.timerList.push(setTimeout((()=>this.sendPositionResponse(e)),(i-t)/this.speed))})),this.active=!0}pause(){this.timerList.forEach((t=>{clearTimeout(t)})),this.timerList=[],this.active=!1}reset(){this.pause(),this.positionIndex=this.startPos}};h(O0,"FakeGeolocation");var V5=O0;P(),P();var di=class{constructor(){w(this,"_subscribers",{})}publish(t,e){!this._subscribers||!this._subscribers[t]||this._subscribers[t].forEach((function(t){"function"==typeof t&&t(e)}))}on(t,e){this._subscribers||(this._subscribers={}),this._subscribers[t]=this._subscribers[t]||[],this._subscribers[t].push(e)}off(t,e){if(!this._subscribers||null==this._subscribers[t])return;let i=this._subscribers[t].indexOf(e);-1!==i&&this._subscribers[t].splice(i,1)}destroy(){this._subscribers={}}};h(di,"PubSub");var XL=h((function(){}),"PubSubLegacy");function da(t){let e=new di;Object.assign(e,t);for(let i in t)if(null!=i){let n=t[i];if("function"==typeof n)continue;e[`_${i}`]=n,Object.defineProperty(e,i,{get:()=>e[`_${i}`],set(t){let n=e[`_${i}`];e[`_${i}`]=t,e.publish(`${i}Changed`,{oldValue:n,newValue:e[i]})}})}return e}Object.assign(XL.prototype,{publish:function(t,e){!this._subscribers||!this._subscribers[t]||this._subscribers[t].forEach((function(t){"function"==typeof t&&t(e)}))},on:function(t,e){this._subscribers||(this._subscribers={}),this._subscribers[t]=this._subscribers[t]||[],this._subscribers[t].push(e)},off:function(t,e){if(!this._subscribers||null==this._subscribers[t])return;let i=this._subscribers[t].indexOf(e);-1!==i&&this._subscribers[t].splice(i,1)},destroy:function(){this._subscribers={}}}),h(da,"tinyObservable");var Fy={0:{actions:{5:1}},1:{actions:{0:2,1:3,3:4,4:0},markerState:0},2:{actions:{1:3,3:4,2:1,4:0},markerState:1},3:{actions:{0:2,3:4,2:1,4:0},markerState:2},4:{actions:{0:2,1:3,3:4,2:1,4:0},markerState:3}},YL=h((()=>{let t=da({state:0,markerState:0,transition:e=>{if(null==Fy[t.state])return;let i=Fy[t.state].actions[e];null!=i&&t.state!==i&&(t.state=i,t.markerState=Fy[t.state].markerState)},reset:()=>{t.state=0}});return t}),"StateMachine"),H5=YL;P();var zy=h(((t,e,i,n=1.5)=>{let r=!1;return(i?[i]:e).forEach((e=>{Math.abs(t.x)<e.width*n&&Math.abs(t.y)<e.height*n&&(r=!0)})),!r}),"isOutsideMap");P();var Hy=gn(W5(),1);function Uy(t){return null===t||"number"==typeof t}P(),h(Uy,"isValidLevel");var R0=class{constructor(t=2){this.nextLevel=void 0,this.inertia=t,this.levelConfirmations=0}_resetConfirmations(){this.levelConfirmations=0,this.nextLevel=void 0}_resetFilter(){this._resetConfirmations(),this.previousLevel=void 0}filter(t){let e=null,i=void 0===t?null:t;if(!Uy(i))throw new TypeError("The argument given to filter() must be null, undefined, or a number");return null===i?this._resetFilter():(Uy(this.previousLevel)&&i!==this.previousLevel?Uy(this.nextLevel)&&i===this.nextLevel?this.levelConfirmations>=this.inertia?(this._resetConfirmations(),e=i):(this.levelConfirmations++,e=this.previousLevel):(this.levelConfirmations++,this.nextLevel=i,e=this.previousLevel):e=i,this.previousLevel=e),e}};h(R0,"LevelFilter");var N0=R0,KL=1.4,Vy={NONE:"none",KALMAN:"kalman"},QL=h((t=>({floorLevel:t.coords.floorLevel,timestamp:t.timestamp,latitude:t.coords.latitude,longitude:t.coords.longitude,accuracy:t.coords.accuracy,speed:-1,type:t.type})),"parseLocation"),k0=class{constructor(t){this.smooth=this.smooth.bind(this),this.smoothingType=window.mappedin&&window.mappedin.smoothingType||Vy.KALMAN,this.lastLocation=null,this.levelFilter=t}formatLocation(t){return{type:"SUCCESS",timestamp:t.timestamp,coords:{latitude:t.latitude,longitude:t.longitude,accuracy:t.accuracy,floorLevel:this.levelFilter.filter(t.floorLevel)}}}kalman(t,e){if(e){let i=t.timestamp-e.timestamp,n=KL*i/1e3;this.latitudeKF.setProcessNoise(n),this.longitudeKF.setProcessNoise(n),this.latitudeKF.setMeasurementNoise(t.accuracy),this.longitudeKF.setMeasurementNoise(t.accuracy)}else this.latitudeKF=new Hy.default({R:1,Q:t.accuracy}),this.longitudeKF=new Hy.default({R:1,Q:t.accuracy});return Ue(be({},t),{latitude:this.latitudeKF.filter(t.latitude),longitude:this.longitudeKF.filter(t.longitude)})}setSmoothingType(t){this.smoothingType=t}smooth(t){let e;switch(this.smoothingType){case Vy.KALMAN:return e=this.kalman(QL(t),this.lastLocation),this.lastLocation=e,this.formatLocation(e);case Vy.NONE:default:return t}}reset(){this.lastLocation=null,this.levelFilter=new N0(this.levelFilter.inertia)}};h(k0,"PositionSmoothing");var X5=k0;P();var D0=h((t=>t*Math.PI/180),"toRadians"),eO=h((t=>180*t/Math.PI),"toDegrees"),tO=h((function(){let t,e=da({bearingExpired:!1,previousLat:null,previousLong:null,calculateHeading(t,i,n){e.previousLat||(e.previousLat=t),e.previousLong||(e.previousLong=i);let r=e.previousLat-t,s=e.previousLong-i,a=zt(zt(r,2)+zt(s,2),.5),o=n&&n.coords.accuracy<20,l=parseFloat(a.toFixed(5))>0;if(o&&l){e.resetBearingExpirationTimer();let n=e.getBearing([e.previousLat,e.previousLong],[t,i]);return e.previousLat=t,e.previousLong=i,n}return!1},getBearing([t,e],[i,n]){let r=D0(t),s=D0(e),a=D0(i),o=D0(n),l=Math.sin(o-s)*Math.cos(a),h=Math.cos(r)*Math.sin(a)-Math.sin(r)*Math.cos(a)*Math.cos(o-s),u=Math.atan2(l,h);return u=eO(u),(u+360)%360},resetBearingExpirationTimer(){null!==t&&e.clearBearingExpirationTimer(),t=setTimeout((()=>{e.bearingExpired=!0,e.clearBearingExpirationTimer()}),5e3)},clearBearingExpirationTimer(){null!==t&&(clearTimeout(t),t=null)}});return e}),"BlueDotBearing"),Y5=tO,F0="#2266ff",Yh=class extends di{constructor(){super(...arguments),w(this,"update",h((t=>{this.publish(0,t)}),"update")),w(this,"throwError",h((t=>{this.publish(1,t)}),"throwError"))}};h(Yh,"PositionUpdater");var Zh,Z5={showBearing:!1,allowImplicitFloorLevel:!1,smoothing:!0,positionUpdater:void 0,baseColor:F0,useRotationMode:!1},B0=class extends Yh{constructor(){super(...arguments),H(this,Zh,-1)}start(t){G(this,Zh,globalThis.navigator.geolocation.watchPosition(this.update,this.throwError,t))}stop(){globalThis.navigator.geolocation.clearWatch(_(this,Zh))}};h(B0,"GeolocationUpdater"),Zh=new WeakMap;var nO=3e4,iO=1e4,J5=h((({data:t,mapView:e,core:i})=>{let n,r,s,{maps:a,venue:o}=t,l={enableHighAccuracy:!0},u=H5(),c=h((()=>{null!=n&&(clearTimeout(n),n=null)}),"clearFallbackToGPSTimer"),d=a.length>1,p=!1,m=Y5();m.on("bearingExpiredChanged",(t=>{t.newValue&&(b.bearing=null,g(b.userPosition,null))}));let f=h(((t,e,i)=>{"string"==typeof t&&(y(e,i),b.stateMachine.transition(2),g(null,null))}),"setError"),g=h(((t,i,n)=>{if(b.userPosition=t,null!=i){b.userMap=i;let r=(b.userMap||e.currentMap).createCoordinate(t.coords.latitude,t.coords.longitude);b.nearestNode=n||r.nearestNode}b.userData={state:u.state,position:b.userPosition,map:b.userMap,bearing:b.bearing,nearestNode:b.nearestNode},e.BlueDot.publish("POSITION_UPDATE",{nearestNode:b.nearestNode,bearing:b.bearing,map:b.userMap,position:b.userPosition})}),"updateInternalState"),v=h((t=>{f("position-error",t.code,t.message),ge.warn(`ERROR(${t.code}): ${t.message}`)}),"onPositionError");function y(t,i){b.state={reason:t,message:i,markerVisibility:u.markerState,name:u.state},e.BlueDot.publish("STATE_CHANGE",b.state)}h(y,"setReason");let _=h(((t,e)=>{let i=a,n=t.coords.latitude,r=t.coords.longitude;null!=e&&(i=a.filter((t=>t.elevation===e)));let s=i.reduce(((t,e)=>{let i=e.createCoordinate(n,r),s=i.nearestNode,a=e.createCoordinateByXY(s.x,s.y).absoluteDistanceTo(i);return a<t[1]?[e,a,s]:t}),[i[0],1/0,null]);return{targetMap:s[0],nearestNode:s[2]}}),"determineCurrentMapFromCoordinates"),x=h((t=>{var e;{let l=t.coords.floorLevel;void 0!==window.floorLevel&&(l=window.floorLevel);let h={timestamp:t.timestamp,type:t.type,coords:{accuracy:t.coords.accuracy,latitude:t.coords.latitude,longitude:t.coords.longitude,floorLevel:l}};null!=l&&(p=!0),window.mappedin&&(Array.isArray(window.mappedin.bluedotCaptureData)?window.mappedin.bluedotCaptureData.push(h):window.mappedin.bluedotCaptureData=[h]),s&&clearTimeout(s),s=setTimeout((()=>{u.transition(3),y(),b.positionSmoothing.reset(),g(b.userPosition,null)}),b.locationUncertainTimeoutPeriod);let f=i.getPositionLatLon(h.coords.latitude,h.coords.longitude),v=zy(f,a);if(null==h.coords.latitude||null==h.coords.longitude)return b.positionSmoothing.reset(),void y(1);if(v)return b.positionSmoothing.reset(),b.stateMachine.transition(2),y(0),void(b.userData={state:u.state,position:null,map:null,bearing:null,nearestNode:null});let x=b.positionSmoothing.smooth(h);l=x.coords.floorLevel;let w=x.coords.latitude,M=x.coords.longitude;if(null!=(e=b.enableBlueDotOptions)&&e.showBearing){let t=m.calculateHeading(w,M,x);!1!==t&&(b.bearing=t)}let E=null,T=null,S=o.isMultiBuilding;if(S&&"hudson-yards"!==o.slug&&null!=l){let t=_(x,l);E=t.targetMap,T=t.nearestNode}if("hudson-yards"===o.slug){let t=b.userMap;if(null==l&&zy(f,a,t,.55)&&(E=a.filter((t=>"5b5f5becadd5444692000001"===t.id))[0]),null!=l){let t=a.filter((t=>t.elevation===l));t.length>1&&(t=t.filter((t=>"5b5f20e3f3ea231068000000"===t.group))),E=t[0]}}if(!E&&null!=l){let t=a.filter((t=>t.elevation===l));1===t.length&&(E=t[0])}if(b.forceBlueDot&&b.userMap&&!p?E=b.userMap:d||(E=a[0]),E||b.forceBlueDot&&3!==u.state)u.transition(1),c();else{if(3===u.state)return r=be({},x),void(null==n&&(n=setTimeout((()=>{if(u.transition(0),S){let t=_(r);E=t.targetMap,T=t.nearestNode}g(r,E,T),n=null}),b.fallbackToGPSTimeoutPeriod)));u.transition(0)}y(),g(x,E)}}),"onPositionReceived"),b=da({bearing:null,state:{reason:void 0,message:void 0,markerVisibility:u.markerState,name:u.state},positionUpdater:null,positionSmoothing:new X5(new N0),locationUncertainTimeoutPeriod:nO,fallbackToGPSTimeoutPeriod:iO,userMap:a.find((t=>t.id===o.defaultMap)),userPosition:null,nearestNode:null,forceBlueDot:!1,userData:null,stateMachine:u,enableBlueDotOptions:Z5,enableBlueDot:t=>{var e,i,n,r,s,a;b.enableBlueDotOptions=be(be({},Z5),t),b.enableBlueDotOptions&&b.enableBlueDotOptions.allowImplicitFloorLevel&&(b.forceBlueDot=b.enableBlueDotOptions.allowImplicitFloorLevel),!1===(null==(e=b.enableBlueDotOptions)?void 0:e.smoothing)&&(b.positionSmoothing={reset(){},smooth:t=>t}),null!=(null==(i=b.enableBlueDotOptions)?void 0:i.positionUpdater)?(b.positionUpdater=b.enableBlueDotOptions.positionUpdater,"function"==typeof(null==(n=null==b?void 0:b.positionUpdater)?void 0:n.start)&&(null==(r=null==b?void 0:b.positionUpdater)||r.start())):(b.positionUpdater=new B0,null==(a=null==(s=b.positionUpdater)?void 0:s.start)||a.call(s,l)),b.positionUpdater.on(0,x),b.positionUpdater.on(1,v),u.transition(5)},disableBlueDot(){var t,e,i,n;"function"==typeof(null==(t=null==b?void 0:b.positionUpdater)?void 0:t.stop)&&(null==(e=null==b?void 0:b.positionUpdater)||e.stop()),null==(i=b.positionUpdater)||i.off(0,x),null==(n=b.positionUpdater)||n.off(1,v),u.transition(4)}});return b}),"BlueDot");J5.FakeGeolocation=V5;var Qe,Or,Rr,vs,fo,$5=J5,po={GHOST:"ghost",GREY:"grey",BLUE:"blue"},ys=h(((t,e)=>new Hn({color:t,transparent:!0,depthTest:!1,opacity:e})),"makeMeshBasicMaterial"),K5=h((t=>{let e=new Gn,i=0;for(e.moveTo(t,0);i<=2*Math.PI;)e.lineTo(Math.cos(i)*t,Math.sin(i)*t),i+=Math.PI/16;return e}),"drawCircle"),rO=h((({baseColor:t=F0})=>({outer:{blue:ys(16777215,1),ghost:ys(16777215,.5)},inner:{blue:ys(t,1),grey:ys(14540253,1),ghost:ys(t,.5)},aura:{inner:ys(t,.2),outer:ys(t,.3)},bearing:{blue:ys(t,.7),ghost:ys(t,.4)}})),"makeMaterials"),Q5=h(((t,e)=>{let i=K5(t);if(e&&e<t){let t=K5(e);i.holes=[t]}return new jn(i,{depth:0,bevelEnabled:!1,steps:2})}),"createAnnularGeometry"),Gy=h(((t,e,i)=>{let n=Math.sqrt(Math.pow(t,2)+Math.pow(e,2))/i;return n>1?n=1:n<0&&(n=0),new de(0,n)}),"generateRadialUV"),sO=h((t=>({generateTopUV:(e,i,n,r,s)=>{let a=i[3*n],o=i[3*n+1],l=i[3*r],h=i[3*r+1],u=i[3*s],c=i[3*s+1];return[Gy(a,o,t),Gy(l,h,t),Gy(u,c,t)]},generateSideWallUV:()=>[new de(0,1),new de(0,1),new de(0,1),new de(0,1)]})),"radialUVGenerator"),aO=h(((t,e,i=0)=>{if(Math.abs(t)>=Math.PI)throw new Error("Sector angle too wide!");let n=i/Math.tan(t/2),r=i/Math.sin(t/2),s=r+e,a=10,o=new Gn;o.moveTo(r*Math.cos(t/2)-n,r*Math.sin(t/2));for(let e=0;e<a;e++)o.lineTo(s*Math.cos(t/2-t/a*e)-n,s*Math.sin(t/2-t/a*e));for(let t=0;t<a;t++)o.lineTo(i*Math.cos(Math.PI/-2+Math.PI/a*t),i*Math.sin(Math.PI/-2+Math.PI/a*t));return new jn(o,{depth:1,bevelEnabled:!1,UVGenerator:sO(e)})}),"createSectorGeometry"),eb=h((function(t,e=0,i=0,{baseColor:n=F0}){let r,s,a=new rt,o=new rt,l=rO({baseColor:new Ee(n)});if(l.outer.grey=l.outer.blue,e>=0){let t=new Na(1,1,10,32),i=l.aura.inner;r=new lt(t,i),r.position.set(0,0,0),r.rotation.set(Math.PI/2,0,0),r.scale.set(e,1,e),o.add(r)}let h=aO(Math.PI/6,120,30),u=l.bearing[t];u&&(new Ci).load(U5,(t=>{u.alphaMap=t,u.needsUpdate=!0})),s=new lt(h,u),s.rotation.set(0,0,i),o.add(s);let c=Q5(30,22.5),d=Q5(22.5),p=new lt(c,l.outer[t]),m=new lt(d,l.inner[t]);return a.add(p),a.add(m),o.add(a),[o,a,p,m,s,r].forEach((t=>{t.renderOrder=999,t.layers.set(hi.ALWAYS_ON_TOP)})),{outerObject:o,radiusObject:r,dotObject:a,bearingObject:s}}),"makeBlueDot"),oO=h(((t,e,i)=>{let n=zt(e.x-i.x,2)+zt(e.y-i.y,2),r=0;n&&(r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n),r>1&&(r=1),r<0&&(r=0);let s=e.x+r*(i.x-e.x),a=e.y+r*(i.y-e.y);return{proportion:r,distance:Math.sqrt(zt(t.x-s,2)+zt(t.y-a,2))}}),"distanceToSegment"),jy=h(((t,e)=>null!=t?z0(-t)-e+Math.PI/2:null),"getBearing"),z0=h((t=>t*Math.PI/180),"degToRadians"),tb=h(((t,e)=>{let i,n,r,s=Number.MAX_SAFE_INTEGER;for(let a=0;a<t.length-1;a++){let o=t[a],l=t[a+1],h=oO(e,o,l);h.distance<=s&&(s=h.distance,n=h.proportion,r=a,i=h.proportion>.5?l:o)}return{nearestNode:i,proportion:n,index:r}}),"getNearestPathSegment"),nb=h(((t,e,i)=>{let n=[],r=[];for(let e=0;e<t.length-1;e++){let i=t[e],s=t[e+1],a=s.x-i.x,o=s.y-i.y,l=Math.atan2(a,o);n.push(l);let h=Math.sqrt(zt(a,2)+zt(o,2));r.push(h)}let s,a=[];for(let e=0;e<n.length;e++){let i=n[e],o=r[e];null==s||Math.abs(s-i)>.2?(s=i,a.push({angle:i,distance:o,nodes:[t[e]]})):(a[a.length-1].distance+=o,a[a.length-1].nodes.push(t[e]))}a[a.length-1].nodes.push(t[t.length-1]);let o=i||100,l=h((()=>a.filter((t=>t.distance>=o)).length),"validGroups");for(;!l();)o/=2;let u=a.find((t=>t.nodes.indexOf(e)>-1)),c=a.indexOf(u);for(;c>0&&a[c].distance<o;)c-=1;return a[c].angle}),"getHeadingOnPath"),ib=h(((t,e,i,n,r=.8)=>{let s=i*(n?.05:0),a=null!=e?Math.cos(e-Math.PI/2)*s:0,o=null!=e?Math.sin(e-Math.PI/2)*s:0;return{position:{x:t.x-a,y:t.y-o},rotation:e||void 0,zoom:i,tilt:r}}),"getCameraLookahead"),U0=class extends er{constructor(t){super(),H(this,Qe,void 0),H(this,Or,void 0),H(this,Rr,void 0),H(this,vs,void 0),H(this,fo,void 0),w(this,"interactions",{enable:()=>{_(this,Qe).controls.enablePan=!0,_(this,Qe).controls.enableZoom=!0,_(this,Qe).controls.enableRotate=!0},disable:()=>{_(this,Qe).controls.enablePan=!1,_(this,Qe).controls.enableZoom=!1,_(this,Qe).controls.enableRotate=!1}}),G(this,Qe,t),G(this,fo,!1);let e=$s((()=>this.publish("CHANGED",{tilt:this.tilt,zoom:this.zoom,rotation:this.rotation,position:this.position})),0);_(this,Qe).controls.dispatcher.addEventListener("positionUpdated",(()=>{this.publish("POSITION_CHANGED",this.position),e()})),_(this,Qe).controls.dispatcher.addEventListener("zoomUpdated",(()=>{this.publish("ZOOM_CHANGED",this.zoom),e()})),_(this,Qe).controls.dispatcher.addEventListener("rotationUpdated",(()=>{this.publish("ROTATION_CHANGED",this.rotation),e()})),_(this,Qe).controls.dispatcher.addEventListener("tiltUpdated",(()=>{this.publish("TILT_CHANGED",this.tilt),e()}));let i=h((()=>{_(this,fo)||(this.publish("USER_INTERACTION_START",void 0),G(this,fo,!0))}),"publishVoidEventStart"),n=h((()=>{this.publish("USER_INTERACTION_END",void 0),G(this,fo,!1)}),"publishVoidEventEnd");_(this,Qe).controls.dispatcher.addEventListener("userPanStart",i),_(this,Qe).controls.dispatcher.addEventListener("userZoomStart",i),_(this,Qe).controls.dispatcher.addEventListener("userRotateStart",i),_(this,Qe).controls.dispatcher.addEventListener("userTiltStart",i),_(this,Qe).controls.dispatcher.addEventListener("userPedestalStart",i),_(this,Qe).controls.dispatcher.addEventListener("userDollyStart",i),_(this,Qe).controls.dispatcher.addEventListener("userPanEnd",n),_(this,Qe).controls.dispatcher.addEventListener("userPedestalEnd",n),_(this,Qe).controls.dispatcher.addEventListener("userZoomEnd",n),_(this,Qe).controls.dispatcher.addEventListener("userRotateEnd",n),_(this,Qe).controls.dispatcher.addEventListener("userDollyEnd",n),_(this,Qe).controls.dispatcher.addEventListener("userTiltEnd",n)}get currentAnimation(){return _(this,Or)}get zoom(){return _(this,Qe).controls.getZoom()}get rotation(){return _(this,Qe).controls.getRotation()}get tilt(){return _(this,Qe).controls.getTilt()}get minZoom(){return _(this,Qe).controls.minZoom}set minZoom(t){_(this,Qe).controls.minZoom=t}get maxZoom(){return _(this,Qe).controls.maxZoom}set maxZoom(t){_(this,Qe).controls.maxZoom=t}get maxTilt(){return _(this,Qe).controls.maxTilt}set maxTilt(t){_(this,Qe).controls.maxTilt=Math.max(0,Math.min(t,Xh))}get position(){let t=_(this,Qe).controls.getPosition();return _(this,Qe).convert3DMapPositionToCoordinate(t)}setSafeAreaInsets(t){_(this,Qe).setPadding(t)}getSafeAreaInsets(){return _(this,Qe).cachedPadding}focusOn(t,e){var i;let n=null==(i=t.coordinates)?void 0:i.map((t=>_(this,Qe).convertTo3DMapPosition({x:t.x,y:t.y}))),r=_(this,Qe).focusOn({changeZoom:null==e?void 0:e.changeZoom,duration:null==e?void 0:e.duration,focusZoomFactor:1,curve:(null==e?void 0:e.easing)&&Sh[e.easing],minZoom:null==e?void 0:e.minZoom,nodes:t.nodes,points:n,polygons:t.polygons,padding:null==e?void 0:e.safeAreaInsets,tilt:null==e?void 0:e.tilt,rotation:null==e?void 0:e.rotation}),s=new Promise(((t,e)=>{G(this,Rr,t),G(this,vs,e)}));return r.onComplete((()=>{G(this,Or,void 0),_(this,Rr).call(this),G(this,Rr,void 0),G(this,vs,void 0)})),G(this,Or,s),s}set(t){if(!t)return;let e,{zoom:i,rotation:n,tilt:r,position:s}=t;s&&(e=_(this,Qe).convertTo3DMapPosition(s)),_(this,Qe).controls.setMulti(e||_(this,Qe).controls.getPosition(),i,n,r)}animate(t,e){let i;t.position&&(i=_(this,Qe).convertTo3DMapPosition(t.position));let n={position:i,zoom:t.zoom,tilt:t.tilt,rotation:t.rotation},r=_(this,Qe).controls.animateCamera(n,null==e?void 0:e.duration,(null==e?void 0:e.easing)&&Sh[e.easing]),s=new Promise(((t,e)=>{G(this,Rr,t),G(this,vs,e)}));return r.onComplete((()=>{G(this,Or,void 0),_(this,Rr).call(this),G(this,Rr,void 0),G(this,vs,void 0)})),G(this,Or,s),s}translate(t,e,i){return Ge(this,null,(function*(){if(!t||!e)return;let n=_(this,Qe).mapObjects.get(_(this,Qe).currentMap).mapClass,r=this.rotation,s=r+z0(90),a=r-z0(90),o=r+Math.PI,l=r,h=this.position,{x:u,y:c}=this.position,d=gf(n);if(1===d){u+=e*Math.cos(s),c-=e*Math.sin(s);let t=_(this,Qe).convertTo3DMapPosition(n.createCoordinateByXY(u,c)),i=_(this,Qe).convert3DMapPositionToCoordinate(t),r=h.absoluteDistanceTo(i);d=e/r}let p=e*d;switch(t){case"up":u+=p*Math.cos(s),c-=p*Math.sin(s);break;case"down":u+=p*Math.cos(a),c-=p*Math.sin(a);break;case"left":u+=p*Math.cos(o),c-=p*Math.sin(o);break;case"right":u+=p*Math.cos(l),c-=p*Math.sin(l)}return 0!==this.tilt&&e&&(yield this.animate({tilt:0},i)),this.animate({position:n.createCoordinateByXY(u,c)},i)}))}cancelAnimation(){_(this,Or)&&(_(this,Qe).controls.cancelAnimation(),_(this,vs).call(this),G(this,Or,void 0),G(this,Rr,void 0),G(this,vs,void 0))}};h(U0,"Camera"),Qe=new WeakMap,Or=new WeakMap,Rr=new WeakMap,vs=new WeakMap,fo=new WeakMap;var rb=U0;P();var Nr=gn(io(),1);P();var lO={ANIMATED:"animated",ALWAYS_ON_TOP:"always_on_top",ALL:"all",TWEEN:"tween"},Nt=lO,sb="attribute float pathDistance;\nattribute vec3 pathNormal;\nattribute vec3 pathTangent;\n\nuniform vec2 uvScale;\nuniform float vertexes;\nuniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform float nearZoom;\nuniform float farZoom;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pulseBulge;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform vec2 cameraParameters;\nuniform float flattenFactor;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n\treturn (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n\treturn clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main() {\n\tfragPathDistance = pathDistance;\n\n\t// We can get an origin point for the cross-section of the path by\n\t// subtracting the surface normal times the radius, since the surface normal\n\t// points strictly away from the centre.\n\tvec3 origin = position - nearRadius * normal;\n\n\t// Inflate the path along its surface normal to increase its radius from\n\t// `nearRadius` to `farRadius` when the camera is at `farZoom`.\n\tvec3 adjustedPosition = position;\n\tzoomLevel = clampRemap(cameraParameters.x, nearZoom, farZoom, 0.0, 1.0);\n\tadjustedPosition += normal * (farRadius - nearRadius) * zoomLevel;\n\n\t// Determine how far the path extends \"up\" or \"down\" in the direction of the\n\t// path normal.\n\tfloat height = dot(adjustedPosition - origin, pathNormal);\n\n\t// Flatten the bottom half of the path entirely so that it's flat\n\t// against the floor. This makes the path look nicer when it's\n\t// semitransparent behind opaque geometry, so you don't see it\n\t// peeking through.\n\tfloat desiredHeight = max(height, 0.0);\n\n\tdesiredHeight = desiredHeight * flattenFactor;\n\n\tfloat flattenMagnitude = height - desiredHeight;\n\tadjustedPosition = adjustedPosition - pathNormal * flattenMagnitude;\n\n\t// Transform the vertices into NDC.\n\tvec4 mvPosition = modelViewMatrix * vec4(adjustedPosition, 1.0);\n\tgl_Position = projectionMatrix * mvPosition;\n\n\tfragTexcoord = uv;\n\n\t// Compute a texture coordinate for mapping the arrow texture to the path.\n\t// We don't want to use the u-value that Three.js provides, because the\n\t// path may end up twisting arbitrarily -- but we want the arrow texture to\n\t// always be on the top of the path.\n\tvec3 bitangent = cross(normal, pathTangent);\n\tfragTopTextureU = -dot(bitangent, pathNormal) * 0.5 + 0.5;\n\n\tradius = mix(nearRadius, farRadius, zoomLevel);\n}\n",ab='uniform float complete;\nuniform float nearRadius;\nuniform float farRadius;\nuniform vec2 resolution;\nuniform vec2 cameraParameters;\nuniform vec3 color;\nuniform float pathLength;\nuniform bool showPulse;\nuniform vec3 pulseColor;\nuniform float pulse;\nuniform float pulseLength;\nuniform bool pathIsVertical;\nuniform bool displayArrowsOnPath;\nuniform float arrowAnimationTimer;\nuniform sampler2D arrowTexture;\n\nvarying float zoomLevel;\nvarying float radius;\nvarying vec2 fragTexcoord;\nvarying float fragTopTextureU;\nvarying float fragPathDistance;\n\n// How long the arrow should be, as a factor of `pathRadius`. Since we\'ve\n// mostly flattened the top of the path, values near 2.0 (the diameter)\n// will probably look best.\nconst float arrowLength = 2.0;\n\n// How much of a relative margin the arrow texture should have inside the\n// area laid out for it. Useful to pull the arrow away from the edges of the\n// path, which slope down.\nconst float arrowMargin = 0.1;\n\n// How many arrow-lengths of space should be between arrows on a short path.\nconst float arrowSpacingOnShortPath = 6.0;\n\n// How many arrow-lengths of space should be between arrows on a long path.\nconst float arrowSpacingOnLongPath = 7.5;\n\n// How long a path must be to be considered "long", as a factor of\n// the path radius.\nconst float longPathLength = 200.;\n\n// How long a path must be to be considered "short", as a factor of the\n// path radius.\nconst float shortPathLength = 75.;\n\n// How much of the path\'s length the fade-in should comprise when going from\n// zero opacity to full opacity.\nconst float completeLength = 0.1;\n\n// Map the x value from the range [xMin, xMax] to the range [yMin, yMax] using\n// linear interpolation/extrapolation.\n//\n// This performs a pure linear mapping `y = mx + b` where\n// `m = (yMax - yMin) / (xMax - xMin)`,\n// `b = -xMin * (yMax - yMin) / (xMax - xMin) + yMin`.\nfloat remap(float x, float xMin, float xMax, float yMin, float yMax) {\n\treturn (x - xMin) / (xMax - xMin) * (yMax - yMin) + yMin;\n}\n\n// Map the x value from [xMin, xMax] to the range [yMin, yMax] using linear\n// interpolation, clamping result values outside [yMin, yMax].\nfloat clampRemap(float x, float xMin, float xMax, float yMin, float yMax) {\n\treturn clamp(remap(x, xMin, xMax, yMin, yMax), yMin, yMax);\n}\n\nvoid main(void) {\n\t// Compute the opacity of the path based on the distance from the current\n\t// fragment to the `complete` value as it varies from 0.0 to 1.0.\n\t// Fragments that are at the `complete` value or past it will be fully\n\t// transparent, while fragments that are at `complete - completeLength`\n\t// or before it will be fully opaque. However, we adjust the `complete`\n\t// value here so that it overshoots by one full `completeLength`, so that\n\t// the entire path will be opaque when the `complete` value is at 1.0.\n\tfloat completeLocation = complete * (1.0 + completeLength);\n\tfloat completeAmount = clampRemap(\n\t\tfragPathDistance,\n\t\tcompleteLocation - completeLength,\n\t\tcompleteLocation,\n\t\t0.0,\n\t\t1.0\n\t);\n\tfloat opacity = 1.0 - smoothstep(0.0, 1.0, completeAmount);\n\n\t// 2020/01/09 Terence Dickson\n\t// When we render the background and overlay for the mapbox outdoor context\n\t// behind everything else in single-buffer rendering, the fact that the path\n\t// writes to the depth buffer means that the background and overlay will not\n\t// be drawn behind the path even when the path is still fading in. The effect\n\t// is subtle and is only visible in single-buffer rendering so this quick fix\n\t// prevents writes to the depth buffer for zero opacity fragments, which gets\n\t// rid of the most visually-offensive ghosting.\n\tif (opacity <= 0.0) {\n\t\tdiscard;\n\t}\n\n\t// Push in the texture coordinates so that they ramp up\n\t// at `arrowMargin` instead of at zero; this remapping looks somewhat\n\t// like this:\n\t// 1 ^ ___\n\t// | /\n\t// | /\n\t// | /\n\t// | /\n\t// |___/\n\t// 0 +----------\x3e\n\t// 0 ^ 1\n\t// arrowMargin\n\t// Making the arrows narrower on the path.\n\tfloat u = fragTopTextureU;\n\tu = clamp(\n\t\tu * (1. / (1. - arrowMargin * 2.)) - (1. / (1. - arrowMargin * 2.) - 1.) / 2.,\n\t\t0.0,\n\t\t1.0\n\t);\n\n\tfloat arrowSpacing = clampRemap(\n\t\tpathLength,\n\t\tshortPathLength * radius,\n\t\tlongPathLength * radius,\n\t\tarrowSpacingOnShortPath,\n\t\tarrowSpacingOnLongPath\n\t);\n\n\t// Reduce the spacing between arrows when the camera zooms out, as increasing\n\t// the path radius will increase the arrow size and thus be able to fit\n\t// fewer arrows on in total, and this secondary movement of the arrows\n\t// "zooming off" the end of the path is unpleasant\n\tfloat expandAmount = mix(1.0, farRadius / nearRadius, zoomLevel);\n\tfloat effectiveArrowSpacing =\n\t\tarrowSpacing * 1.0 / expandAmount +\n\t\tarrowMargin * 2.0;\n\n\tfloat effectiveArrowLength = arrowLength * radius * (1. - arrowMargin * 2.0);\n\n\t// Adjust the slope of the vertical texture coordinate so that it goes\n\t// from 0 to 1 along the length of the arrow plus the spacing between\n\t// arrows, and adjust its x-intercept so that one arrow moves to the\n\t// exact position of the next arrow as `arrowAnimationTimer` goes\n\t// from 0 to 1\n\tfloat v = (\n\t\tfragTexcoord.x * (pathLength / effectiveArrowLength)\n\t\t- arrowAnimationTimer * (1. + effectiveArrowSpacing)\n\t);\n\n\t// Compute a "looping sawtooth" wave for determining the vertical texture\n\t// coordinates of the arrow texture, roughly as follows:\n\t// 3 ^ /\n\t// | ___/\n\t// 2 | /\n\t// | ___/\n\t// 1 | /\n\t// |___/\n\t// 0 +---------------\x3e\n\t// 0 ^ ^\n\t// ^ |_|\n\t// | effectiveArrowLength\n\t// |___|\n\t// effectiveArrowSpacing\n\t//\n\t// This is effectively equivalent to this sort of sawtooth wave:\n\t// ^\n\t// 1 | / / /\n\t// |___/ ___/ ___/\n\t// 0 +---------------\x3e\n\t//\n\t// Causing the image of the arrow to repeat, with dead space (the bottom\n\t// edge of the texture stretched out) between the arrows at the provided\n\t// spacing. The reason why the "looping" design is preferred is because\n\t// it takes advantage of WebGL\'s `GL_REPEAT` texture wrapping behaviour\n\t// to avoid the discontinuity that can end up causing visual artifacts.\n\tif (mod(v, (1. + effectiveArrowSpacing)) < 1.) {\n\t\tv = v - effectiveArrowSpacing * floor(v / (1. + effectiveArrowSpacing));\n\t} else {\n\t\tv = ceil(v / (1. + effectiveArrowSpacing));\n\t}\n\n\t// Use the r-component of the texture to determine whether the arrow covers\n\t// this fragment or not\n\tvec2 sampleTexcoord = vec2(u, v);\n\tfloat arrowAmount = 0.0;\n\tif (displayArrowsOnPath) {\n\t\tarrowAmount = texture2D(arrowTexture, sampleTexcoord).r;\n\t}\n\n\tif (showPulse) {\n\t\t// Add the pulse color to the path by determining how far the current fragment\n\t\t// is from `pulse`\n\t\tfloat pulseLocation = remap(\n\t\tpulse,\n\t\t0.0,\n\t\t1.0,\n\t\t-pulseLength,\n\t\t1.0 + pulseLength\n\t\t);\n\t\tfloat pulseDistance = smoothstep(\n\t\t0.0,\n\t\tpulseLength,\n\t\tabs(fragPathDistance - pulseLocation)\n\t\t);\n\n\t\t// Blend the pulse color to the path based on how close this fragment is to\n\t\t// the `pulse` value and whether it\'s covered by an arrow -- but if it\'s\n\t\t// covered by *both*, then we go back to using the regular path color\n\t\t// (making arrows look like "holes" when they\'re overlapping the pulse.)\n\t\tfloat pulseLevel = abs(1.0 - pulseDistance - arrowAmount);\n\n\t\tgl_FragColor = vec4(mix(color, pulseColor, pulseLevel), opacity);\n\t} else {\n\t\tgl_FragColor = vec4(color, opacity);\n\t}\n}\n';P();var tr,Jn,ob='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M25.86,2.59A10.12,10.12,0,0,0,22.4.65a14,14,0,0,0-8.85.14A10.33,10.33,0,0,0,10,3.1,9.78,9.78,0,0,0,7.72,6.68,10,10,0,0,0,7,11h6a6.3,6.3,0,0,1,.18-2.33,5.57,5.57,0,0,1,1-1.77,4.05,4.05,0,0,1,1.5-1.13,6.87,6.87,0,0,1,4.5-.08,4.4,4.4,0,0,1,1.6.88,3.37,3.37,0,0,1,.93,1.22A3.84,3.84,0,0,1,23,9.29a3.15,3.15,0,0,1-.38,1.5,10.54,10.54,0,0,1-1.26,1.72,18.9,18.9,0,0,1-1.78,1.8c-.71.66-1.4,1.34-2,2C16.31,17.55,14,19,14,21v6h6V23c0-.63,0-1,1-2s1.24-1.3,2-2,1.69-1.66,2.5-2.52a14,14,0,0,0,2.28-2.81,7.51,7.51,0,0,0,1.08-4.05,9.68,9.68,0,0,0-.78-3.91A8.34,8.34,0,0,0,25.86,2.59Z"/><circle cx="17" cy="33" r="3"/></svg>',lb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAAAAAB5Gfe6AAAQkHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZpZciQ7rkT/uYpeAicQ5HI4mr0dvOX3ATOl0li3q3SVJkUqFMEBcHc4IuX2///fcf/hK7cSXRatpZXi+cott9h5U/3j63EMPt+fL1/h+fPdeff6NnJMHNPjD2U/7+qcl183aH6eH+/PO52PN7E+B3qZ+Tlgspkjb57X1edAKT7Oh+fvrj3v6/nNdp7ftd057abHnz78npVgLGG8FF3cKSTPz2oXJFaQWuocCz9D0mhnEu8Tx54k6dexc98F77vY+f48n96HwvnyvKB8iNHzfJCvY3cj9HZF4dfM7/6QZ4j+7deb2J2z6jn7sbueC5Eq7rmpl63cd1w4GCrd2wov5Vt4r/fVeFW2OMnYIpuD13ShhUi0T8hhhR5O2Pc4w2SJOe5IuGOMM6Z7rhL+FudNSrZXOFFJz3KpkqtJ1hKn4+tawp233flmqMy8AlfGwGCBOz693Fcn/+b1OtA5Bt0QfH2NFeuKFnCWYZmzn1xFQsJ5xlRufO/LvcGNf5PYRAblhrmywe7HY4gh4Re20s1z4jrx2fkHNYKu5wCEiLmFxYREBnwJSUIJXmPUEIhjJT+dlceU4yADQSSu4A65SamQnBptbu7RcK+NEh+nkRYSIZBGSQ0EIlk5C/jRXMFQlyTZiUgRlSpNekklFymlaDGN6po0q2hR1apNe001V6mlaq211d5iS0iYtNLUtdpa651JO0N37u5c0fuII408ZJSho442+gQ+M0+ZZeqss82+4koL+q+y1K262uo7bKC085Zdtu662+4HrJ108pFTjp562umvWXtm9X3WwofM/T5r4Zk1y1i+1+mvrHFa9WWIYHIiljMyFnMg42oZANDRcuZryDla5ixnvkVIIZGsBbHkrGAZI4N5hygnvObuV+Z+mzcn+Y/yFr/LnLPU/RuZc5a6Z+Y+5+2LrK1+K0q6CTIWWkx9OggbF+zaY+1Wk/766H46wF8ONFY+O8hBMEc7oc4Vdh+8JsE+PUSrVjr70Zz1+H56PH3o9sRR1ql5Ha8bUMQxpe89Tki8Sb0tE23cw3DcfEo+ugnj2G3WEmononVfoag71pVjR+EmAE53eT5tqYfEHl/7ThMusaI+St0jktFa9gKnreiQqCNpZ2mJdSkbaiK6DrovYR4/JhJfRsx5d5EVZnEIPetHnU5KynJPTSuCPuC0lOuXH7n1DNq7DpUtHbhM5lDA0c2bnDCJoOObMnyj+aPjPwx0yiDUxKKsg35VnRnBEVhonKwK5hOk5NttUrhr2+tMOXkPJb1RZ+iAelYjL2MuO3pGRQ78GdxwOOaTAcJZcewq7ilB1RJCSozUdSEdwVJVb6asiBsHH1Bqgbiv3Cmkkis6ktVnZGRRwMNJjUA3Ao2127YWdhAIblxF51hzMcZsVZc0r0dJo5Liqfn41Q+q193SGhhkMkgaLJRNnEpqBtyVvbcVffIk+LE9QPFBTMTQe0aWkMXMnx3dy5sfHreDE60Ql50E+SqRcmfK16L2p0Ol8JFATu3qASXy7SvmiGW2cdMBxsty44CvtLogfGlv7WkCSV0WId2270EaD5Ym40cs+SAwZuNjPSTywAvEfLmzQhtLDntfCnhl/fNmUNnzyA2g76Zn0SP+c+I6bCC0FONUQ4L50e95dif+DH/m9htQjBEhPPpOjYjmm2ChbfEMIUaYtAIxmWJHlilLU8ZRs9pCsHbDpFaRgZljz2QandjDIBPZDGTuoZW1KdlYh52ALzisKJRNWSQmLAWx8iv9mGttT15bBc2oxd57bZtVF98CYtK3UH22Yd/A7WaKa+ZjNTOXEzNhMJ5kmQOvfzsbxbZALJ2xwGBjX2HFQybhi7kpbA7DVpS3RxMJwFyHwGk5gs6a4lrRHVqhYT0QTJC9UZcC9Yrelkn6yXch68NKNtG7CiU3vf/zMZAYXPWdrR9XZ/ctMV1sJQ2wJEGxzaHs7LmmHIwnUwbwnNAapBY9xhE19DNJW3ua0dDk/AjwITacR0PqZxkbyJ+E5jYbxI84x1TBE+y90hwDCYZIM0tqAKPZfCzFrbH8kYCm3eqQkZ2+2GovcL8Suokyg8yyCJes6dcouSLiNSLb0ETJU+/N/WFsBBSOXBbm9Cwp4CzlOag7ro7R2vC19nSsCPmAjIEMiobFwaoVXhjTU2XMpgEsDH/L3Sx54OCTMUSXI/IIA2V4QcLQpwVz12pInI0bY56pIQ2BSGRLL+yLfZ7JkiimbK+aepsbwRStpokx5gCqe1hjdMAwcINbkk5jmedrNRAG5pUXPe0sZIoXy1h7lSDxApzheg24JeDNtDS1oBDBUC4iWZFilBPhZx0Kqx2lihpbG9q4sYidksCN4yRYhNM4nxfBbTi4E3AT6B3igbvs9Gv8ZkHsIfdlep+2HelEDbkJdNjqZQ90B7k6OIoFfkkPNoY+z0gzACa1f2qcBYxVJpT2QQgS19dKQlbC24S92xiEAFRKB5Uy1qrBgOtwIge55G0kRPfIytGx0tMOrGfrijB2FHOk/TKcMjDTMPeBo4FnXD5cQ8vtdgoAN0yuzZQHQI09wm/5vAB6RHyI9rYKiZ6YWC6rbaiLmDtoaToC1bViXQFNtgWsOfEEKCleC3GWPSfgQWRQWMgw/9FDgvOZrFAT3SmsA3DLbqlsSppQG5QeOjPXavUUkxF/qgLM05vW5o7UakuBqo2ZW8Nj0LB7imVJC9QSA+wd7RPztIUZ80xQZq0ROrc8CSVncWzkTA/RwmunldCPAQKjqVC7bhRuTIv0plbk7gOX4m5OAi2YesYZ0KBQRToG8iv9x8dgGtgECYRBeEU87OxoSc8epu+s7Mq/MN0VbBT19dii7ekO66UZwdAMtoAVQd13J5nwZe98OgGslmVqAGBkeLZNVNVlWpV18qihntXKnBZvrDIVgFpx4q5poLqREOVplMPSpTF2KvjBAzDpprkruXIaaUmUD4Xo2yrGWcYlixKIwRFjl0jPQhKznUXZAoSjlg9c/NwAI4p3Q/w5bCNfhUZS7bGfqesHqKAlyZZxZgNrhGevZXccaqBys4NEqB3Vqfptji9uUrhCL6yXFqxtm0hhLyYU3Tjd8I/HZaWD1oyVjnG5hhpCN5yHSf8BQUZlVNd00OP4M0TK+JSM7iqWi01SinFkCQXWxiZJLqqAHiEt3G3I2WYd46KU9pIJIOkoRQYCcEAAPguHo0Y4k8Hl6SW50MoW0uZU8jJOUghKo38Nl5ZSwsJNAUC2/lFZWkfMjrU8dFrTjHpJnUrLCILQIxINiYdQlDXaE/razQ4jjQluN5jW1Eh/S7yYvI5gigSjdLYU9TiFXAcHjISiLhQd9obb3OQmwY+YqVwiBMCkOGLXaK/ljBShh56c1g0uyIb2lBRKO7ZTAFncw5c5UGjGSy3CsI1Jt2mtruZkfhBZmbR+842Yu1eDiWEl0V6LZcGem6Ct+LW4Wy3oAjyNObazKBHomhJ3HMKEKHgiGksH+Ig1nTidfNMyA+oYHqVFaRGLiQreVLc9GvQgftKjW9cfUSKNYL80rqU7Um2rwqQJR1ai31Wq7vzKJEsFHDj0bAEMUKXgvfD5bWbaLPBTKz1Nk/Fg+GUZvUzFw80CLaKtPAACVAWrismh863FU4IJ0716SXBUNVb/SDMVvZgDt34CXoOq1JKvg0n08gPHTwXBNgD5W8pZZ8E9EVWcv1DZMB2NFysIwkqBSaH5QRmsAHdkHB+UANvLJvFpQKAahSmYTLEd2AFO+5rsqRRU6sVv5IP0wsSPLcWsbC1Y95mte71CUm6RJJWwkg6Q4k+xWMM0ByElJPQ6j2ED5hY42ALpZRytx9RlgQlJLijzhKi5eX5JBSIRGfo9o2xhd/0aWku8OS+4D9ZnovHDQMPaYo4qm2mlZbUnd7pR6oQj29Z2BqJ9n3LRT+MTLu3IR+ZP2TCPh3EDw8H1NHpoT7FibNYU8WHd9ESHcY12aDOQCUBddi4Ucp+4yuzz8ybcCCu1h8zvzXhDN4HYLq1R+U0xzUqg5QSA3iSBgdDouy55Ifx0DaeEhgezxBRGmoEJ6AJitVuzwtKPlUskHgU2F0LS7AFIwW5jPu0RUL7sp+fkNk0ee8P6uXYgl40WM+cdCOW21r13e0ivt0ff/mYcUfrQZWs2BiN6G+MDTGz1BKORmUTNQp9YGSHFxAeTkQrKd6FoVUogyytW25OLy3OpaO5oZCQp46aPzb5LnJiFEIwAKkmbYVYIjzVv3vj7rA6HignEeQAXTAHKDhoD7Uujh0QjtsB6fTP1NzO7T1Nzq4F1GnfHdXCG1Yxjwdtjf+PGRGTzEtEAUCz7KLfTdItLwCXuSOAzVjaZB6LvbUZhYGWmifSZlcMDnGHPd6gPeiK9erhpiw7ZP9ahTrMhFDa1J53m9ri2DloziqGETTcVSppCbTDDjExg6RrZ6cPEzB8XArEjQSB29odrUoLyoS/65RfM9fprGGjlHpbhGgbYD8MtmW1eFcAWX5dbcMHcl8sUI2k+H7GPW9VrArw3G+BefcCrCaAT/N53YLvP26Uy0kMFnDEZz0DJkmQqEOlL7SlKweYhH8gxpYeAYi0f9magqPbMYZuUI6007lSZQoyoGfYQHsNRzHXR3MMINTSMZpq1KD2A5MDJgtMLdRU6R4CEOJcKGiIJ7K6P/vAM6xpECHI8rRHsaEj6smkngAUjXTzrRoSI48ZpHOqgOY5OejKVdpnmiYUChQnVdIPa6ekGqRSRgEO119oDHOiIUQ5ciYVgaF1oG8Udo8WYtD+DEi8D/w8rAJE2k2PoyV0oMtpauxreaFjpujAvxFlwBhjuNqM9P0IfI5iD8Nh8y1kG4igjJkDNkOijnlLhItAd9lhRd670yNRTu95cR/Xuu0c5WO4DEFk5YQAPtLvU4TYPGRh4APPEDNiuuwR6SC21JoFbQBBMr+zJmT32QplNI6p16PbculN/pCX1wAyTWGTeJ774aln0gvQikw7TmkfsNbdQNs0adutYUDqNtGc0RqngUYdhUYuHSL1/eLrgvqDTC5neu++vufRkEgP9D2T64Kg/c4n+s7k3dDr3me8nOr0c72MRNmgF7D4WySPP0YAI/bI4eixwc7K13QiRiL85A8fnSsUj+mvTrsZtVUEQZ6sTpVafW8nYJZyaZS0U+0xIb6et9PhhtoObozQbjKAoDf6eiFgx1UUvpUYj1GweH0MNMrofhynfWn7+KYu7n5r83hN9aqm+6qjcH7dUlgvZVLV3xqq4fbP16qv+eofuTz43eomAqfS7GBAB9zEE31WJ37eVIPtdGN5A8nMYPvvLt8t2/V/6gM19G4g/hIL7UXf9JgbuLRZ+AoW//AzyMxTcWyz8BAruLRZ+AgX3r3y2+mT/PwfiN1DoVI+QT3CZDmvb8022JeYb6HiQPQpPPvboFB+i1MZdcqWZqthHmix6vttw0UAI1z8oEnGwVe++c7JamxslC+8xKJE41XJmug1npz+6CUAKyURd9gSxo+kWxvtZth848GBlws/0SKjYhmbZ9IiV+mcGBSdWHk8sqSr2zz5J7QME/0yD+z4Pe+JuGn1MV/vUyZwOHojWPlmPXgf9CuoeN9UAT+FGwaLg44v3dWe6QpvuL3Ln/p3k/2AgqNDcfwHgqUmIIqn+hwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4wYRESAMujenGAAAB9FJREFUeNrtnWlsFVUUx899fS1gUoKioEY+WBRUEohGkUhAKxgEjSgGoRGB4AJCNKAIJBJZJSiyGYMKKkIoLlEUKhUraxFkKUE2kU1aCrRgW2jpg9f29R2/sBTo67v3zL2zvfP73MzM+XU6mf+5504BGIZhGIZhGIZhGIZhGMZGGq3JvSmR62++BXHH7Ylbf9ouRMT99yVq/e0PICIiHumUmPV3PooXOf5EItafXoCXOdUn8ep/pgjrUDY40ervX4JXUTEiocoXL5/FawiNEwlU/6hzeB3hqQljQIwJYT3UzEkQA2JiGOslsiAhDIgZ1RiD6NIEMBD8NIKxyQr6vv7FtdgQa31uILg0ig2zsZmv4//yePUj7rjNv/U3yUEJ/r7Xr/XfvBmlOPKwT+vfhpIUdvdj/Wm7UZpTz/mv/g4HUYGyQb5r/+SjEhXD/VV/j5OoSGisj16LRe9iVCY8xTcGxIulSKBmtk8MiKHlSMIn8ViMqkQivojHgfcuIJ0VAc/XPzmMVljrcQOBmdVojY1NvVx/8mcRtEqeh+NxypJatM6+ezxb/7Io6uBwR4/e/1moicJunvz956A2ip/1Xv3Nt6JGSgd6rf47/0KtlHssHrfZi5rxVDwWDx5C7XgoHotHC9AANbO8YqBXERohMt8bv/8X/kNDRDM9cA+IgWVojhWuNxAYXo4mWePyeBwYHUKz5Lo6HidNvICmybvVxfXPqEbz7Gvr2vrn1KAdHH7IpX//8yNoD8dcGY+TM6NoF26MxzLTL26Mx0majtM4q5ed7yhNulVsd5WAxqset/mGS6/d5CIBLXI62/7I6ZKyzjUC0rIfsP+hE3zkxt9c8vy7tPnJbiKfuyP+Xdn8ZDeuiMei+zF0juWOGyBNv+iMxw4bEBkl6CzOxmPx6ll0mryWDtb/ViU6z17H4rEYG0I3cMiheByYFEZ34Ew8Dn5UjW7BiXisY/rFDfGYmgWCCwcngXto0q08z1YBSUsy3NWgb5Qe2WSjgJRlfdy2RJPcNXm9bQIarexpsP5VdxHjcbMcm2Q3/5P64i71U8k/ELuLNsVjcct2cnST+rGg+Jo4XmhLPBZ376GOfoOkAIB5NWTHxuu/nzj9ElkA8gLgA+pLlvF43IU4/VI9G1QEAHnIPjfVaP1PnqRdVngKqAkActDMa2Hw/u9zijjjNg5UBcBr1FbD3jbG6h9QSruk8ovfyFESABnUWSNT8VgMI06/lF7aBqomAJ4n3m+G4nHgbeJfZfHljcCKAqDHcWo87m2g/gnE53LhlS+lqQqATv9S4/FL2u//qcT2T34XoAuAdvuJBspf11z/LOKbyYG6q4bqAqDVTqKByjFa21/U6ZfdaWBNADTdTDQQnqSv/pRMYjrZevVLCUUAiF+JBqpnaqv/J2I+zb3mxZwkAMTPDq8ep1A3P/1y3ZOEJABgiaPxuOnvxLN/B7oEwELq/sPl1utvSdz8VPsl6BMAn1AbBKut1t96F+3ENXOFTgFiehXRwAZL8Vi0JW5+qppW7+HIAgDGnyca2G4hHouOh2knvTARdAuAkedsj8cinTj9Ujka9AuAV87YHI/F08TNT2eHgQkB0I/aIDhGmuIU/YnnKxkAZgTAU8SGHC0eDyJufiqKfTKrAqBrPtFAiXo8HlFBO1VBA7ebZQHQifhUVo7H4p2QgQeOdQHQbp8t8Tg4idj+2dPgwJIGAdBqhw3xmDz9EuelQ4cASP3DeDwOziW+ecdbldEiACDbcDxOWkBs/8QNHpoEAPXjLNFMmfpv+IZ4+PjRU5cAWGwwHqcQNz/J2NUmAMgjavHjMfEPTGpvvz4BQH1MrzMkoHoW2CsAppEaBFskemQUA+HJYLcAeJfQINgpNVuvbiA0FuwXAG8qNwh2S07WqxqQ/saPXgEwRDGu7W8te2Q1A6XSH0HWLAD6nVa5zoPS9asZKJb/DLZuAdDzhPx1Hu2gkobkDRQq/J8w7QJAfstevuI3+WQN1F39dkAAtP9H7jpPdFVtiMgZOKC0Z9aAAEiT+mrbScLQjIyBXWngtABokRf/kKefonRF4xvYqrjmYEQApG6Md8SyvrS+eDwDG5QbzUYExL3QMxnUlZGGD5wFbhEADQ7YVwyhr401YCD6LbhHACyK3SA4N9TK6mhMA5EvwE0CYF6sBkFopLXl8exYq9/gLgHwYf3x+PxoqwMC9RoIvw9uE1D/gH3VeOsjItnSq9/OCqhvwL5qAoABA5XU28qsAHjj2tW8mukABgzEXP12WgAMvrpBEPkYwICB2KvfjguAvnUH7GvnARgwUGRhEt24gLoD9tGvAAwYKLDyySzzAqDzpQH76CIAAwYOWtqNYoMAaH9xwP57AAMG9ljbj2SHALhjJyLijwAGDGyzuCPNFgGQuhlxpfw1yR94dfAxi5cmojI/lRyx+rtaX9XDhADr2CVABc//JycWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWAALYAEsgAWwABbAAlgAC2ABLIAFsAAWwAJYAAtgASyABbAAFsACWIDToH8FyJUWtVWAALedDoFhGIZhGIZhGIZhGIYxyf+YwEMsIhMo/AAAAABJRU5ErkJggg==",cb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><polygon points="36 14.99 28 7.99 28 12.99 17 12.99 17 16.99 28 16.99 28 21.99 36 14.99"/><path d="M24,29H15V7L6,2H24v9h2V0H0V29l14.94,7L15,31H26V19H24Z"/></svg>',ub='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M12.85,18.24H9.25a1.27,1.27,0,0,0-1.2,1.2v4.8c0,.43.65,1.07,1.08,1.18v5.52c0,1.09,1.2,1.09,1.2,0v-5.5h1.44v5.5c0,1.09,1.2,1.09,1.2,0V25.42c.43-.11,1.08-.75,1.08-1.18v-4.8A1.26,1.26,0,0,0,12.85,18.24Z"/><circle cx="11.05" cy="15.85" r="1.5"/><path d="M26.82,18.24h-3.6a1.26,1.26,0,0,0-1.2,1.2v4.8c0,.43.65,1.07,1.08,1.18v5.52c0,1.09,1.2,1.09,1.2,0v-5.5h1.44v5.5c0,1.09,1.2,1.09,1.2,0V25.42c.43-.11,1.08-.75,1.08-1.18v-4.8A1.27,1.27,0,0,0,26.82,18.24Z"/><circle cx="25.02" cy="15.85" r="1.5"/><path d="M19.79,18.24h-3.6a1.27,1.27,0,0,0-1.2,1.2v4.8c0,.43.66,1.07,1.08,1.18v5.52c0,1.09,1.2,1.09,1.2,0v-5.5h1.44v5.5c0,1.09,1.2,1.09,1.2,0V25.42A1.68,1.68,0,0,0,21,24.24v-4.8A1.26,1.26,0,0,0,19.79,18.24Z"/><path d="M18,17.35a1.5,1.5,0,1,0-1.5-1.5A1.51,1.51,0,0,0,18,17.35Z"/><path d="M28.79,10H7.27c-2.82,0-5.11,2-5.11,4.51V31.6c0,2.49,2.29,4.51,5.11,4.51H28.79c2.82,0,5.12-2,5.12-4.51V14.51C33.91,12,31.61,10,28.79,10Zm2.85,21.6a2.7,2.7,0,0,1-2.85,2.51H7.27A2.7,2.7,0,0,1,4.42,31.6V14.51A2.7,2.7,0,0,1,7.27,12H28.79a2.7,2.7,0,0,1,2.85,2.51Z"/><polygon points="27 4 26 3 24 5 24 0 22 0 22 5 20 3 19 4 23 8 27 4"/><polygon points="17 4 16 5 14 3 14 8 12 8 12 3 10 5 9 4 13 0 17 4"/></svg>',hb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M12.85,18.24H9.25a1.27,1.27,0,0,0-1.2,1.2v4.8c0,.43.65,1.07,1.08,1.18v5.52c0,1.09,1.2,1.09,1.2,0v-5.5h1.44v5.5c0,1.09,1.2,1.09,1.2,0V25.42c.43-.11,1.08-.75,1.08-1.18v-4.8A1.26,1.26,0,0,0,12.85,18.24Z"/><circle cx="11.05" cy="15.85" r="1.5"/><path d="M26.82,18.24h-3.6a1.26,1.26,0,0,0-1.2,1.2v4.8c0,.43.65,1.07,1.08,1.18v5.52c0,1.09,1.2,1.09,1.2,0v-5.5h1.44v5.5c0,1.09,1.2,1.09,1.2,0V25.42c.43-.11,1.08-.75,1.08-1.18v-4.8A1.27,1.27,0,0,0,26.82,18.24Z"/><circle cx="25.02" cy="15.85" r="1.5"/><path d="M19.79,18.24h-3.6a1.27,1.27,0,0,0-1.2,1.2v4.8c0,.43.66,1.07,1.08,1.18v5.52c0,1.09,1.2,1.09,1.2,0v-5.5h1.44v5.5c0,1.09,1.2,1.09,1.2,0V25.42A1.68,1.68,0,0,0,21,24.24v-4.8A1.26,1.26,0,0,0,19.79,18.24Z"/><path d="M18,17.35a1.5,1.5,0,1,0-1.5-1.5A1.51,1.51,0,0,0,18,17.35Z"/><path d="M28.79,10H7.27c-2.82,0-5.11,2-5.11,4.51V31.6c0,2.49,2.29,4.51,5.11,4.51H28.79c2.82,0,5.12-2,5.12-4.51V14.51C33.91,12,31.61,10,28.79,10Zm2.85,21.6a2.7,2.7,0,0,1-2.85,2.51H7.27A2.7,2.7,0,0,1,4.42,31.6V14.51A2.7,2.7,0,0,1,7.27,12H28.79a2.7,2.7,0,0,1,2.85,2.51Z"/><polygon points="22 4 21 5 19 3 19 8 17 8 17 3 15 5 14 4 18 0 22 4"/></svg>',db='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M12.85,18.24H9.25a1.27,1.27,0,0,0-1.2,1.2v4.8c0,.43.65,1.07,1.08,1.18v5.52c0,1.09,1.2,1.09,1.2,0v-5.5h1.44v5.5c0,1.09,1.2,1.09,1.2,0V25.42c.43-.11,1.08-.75,1.08-1.18v-4.8A1.26,1.26,0,0,0,12.85,18.24Z"/><circle cx="11.05" cy="15.85" r="1.5"/><path d="M26.82,18.24h-3.6a1.26,1.26,0,0,0-1.2,1.2v4.8c0,.43.65,1.07,1.08,1.18v5.52c0,1.09,1.2,1.09,1.2,0v-5.5h1.44v5.5c0,1.09,1.2,1.09,1.2,0V25.42c.43-.11,1.08-.75,1.08-1.18v-4.8A1.27,1.27,0,0,0,26.82,18.24Z"/><circle cx="25.02" cy="15.85" r="1.5"/><path d="M19.79,18.24h-3.6a1.27,1.27,0,0,0-1.2,1.2v4.8c0,.43.66,1.07,1.08,1.18v5.52c0,1.09,1.2,1.09,1.2,0v-5.5h1.44v5.5c0,1.09,1.2,1.09,1.2,0V25.42A1.68,1.68,0,0,0,21,24.24v-4.8A1.26,1.26,0,0,0,19.79,18.24Z"/><path d="M18,17.35a1.5,1.5,0,1,0-1.5-1.5A1.51,1.51,0,0,0,18,17.35Z"/><path d="M28.79,10H7.27c-2.82,0-5.11,2-5.11,4.51V31.6c0,2.49,2.29,4.51,5.11,4.51H28.79c2.82,0,5.12-2,5.12-4.51V14.51C33.91,12,31.61,10,28.79,10Zm2.85,21.6a2.7,2.7,0,0,1-2.85,2.51H7.27A2.7,2.7,0,0,1,4.42,31.6V14.51A2.7,2.7,0,0,1,7.27,12H28.79a2.7,2.7,0,0,1,2.85,2.51Z"/><polygon points="22 4 21 3 19 5 19 0 17 0 17 5 15 3 14 4 18 8 22 4"/></svg>',pb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><polygon points="4 16 18 0 31.99 16 4 16"/><polygon points="31.99 20 18 36 4 20 31.99 20"/></svg>',fb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M18,8a3,3,0,1,0-3-3A3,3,0,0,0,18,8Z"/><path d="M33,10H27a3.65,3.65,0,0,0-3,1l-2.76,2.75V12.39a2.48,2.48,0,0,0-2.46-2.47H17.22a2.48,2.48,0,0,0-2.47,2.47v7.87L9,26a3.26,3.26,0,0,1-2,1H3c-2.28,0-3,1.79-3,3.93A2.76,2.76,0,0,0,3,34H9a3.77,3.77,0,0,0,3-1L27,18a3.29,3.29,0,0,1,2.49-1h3.26A3.43,3.43,0,0,0,36,13.44C36,12.08,35,10,33,10Zm0,5H29c-1.47,0-1.92-.08-3,1L11,31a3.15,3.15,0,0,1-2,1H3c-.82,0-1-.29-1-1.16S2.12,28.9,3,29H7a3.87,3.87,0,0,0,3-1L25,13a2.72,2.72,0,0,1,2-1h6c.68,0,1,1.05,1,1.44S34,15,33,15Z"/><polygon points="30.18 26.18 26 31 26 28 24 28 24 34 31 34 31 32 28 32 31.69 27.59 30.18 26.18"/></svg>',mb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M18,8a3,3,0,1,0-3-3A3,3,0,0,0,18,8Z"/><path d="M33,10H27a3.65,3.65,0,0,0-3,1l-2.76,2.75V12.39a2.48,2.48,0,0,0-2.46-2.47H17.22a2.48,2.48,0,0,0-2.47,2.47v7.87L9,26a3.26,3.26,0,0,1-2,1H3c-2.28,0-3,1.79-3,3.93A2.76,2.76,0,0,0,3,34H9a3.77,3.77,0,0,0,3-1L27,18a3.29,3.29,0,0,1,2.49-1h3.26A3.43,3.43,0,0,0,36,13.44C36,12.08,35,10,33,10Zm0,5H29c-1.47,0-1.92-.08-3,1L11,31a3.15,3.15,0,0,1-2,1H3c-.82,0-1-.29-1-1.16S2.12,28.9,3,29H7a3.87,3.87,0,0,0,3-1L25,13a2.72,2.72,0,0,1,2-1h6c.68,0,1,1.05,1,1.44S34,15,33,15Z"/><polygon points="25.67 34 29.84 29.18 29.84 32.18 31.84 32.18 31.84 26.18 24.84 26.18 24.84 28.18 27.84 28.18 24.16 32.58 25.67 34"/></svg>',gb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M36,34H0L36,2ZM12,30H32V12Z"/></svg>',yb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M36,34H0L36,2ZM12,30H32V12Z"/><polygon points="18.18 4.18 14 9 14 6 12 6 12 12 19 12 19 10 16 10 19.69 5.59 18.18 4.18"/></svg>',vb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M36,34H0L36,2ZM12,30H32V12Z"/><polygon points="13.82 13.82 18 9 18 12 20 12 20 6 13 6 13 8 16 8 12.31 12.41 13.82 13.82"/></svg>',xb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M10,0,26,2s-5.59,5.68-5.56,5.71C23.32,10.88,23.94,15.27,24,18V36H20V18c-.05-2.09-.54-5.32-2.47-7.53L12,16Z"/></svg>',_b='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M26,0,10,2s5.59,5.68,5.57,5.71C12.68,10.88,12.06,15.27,12,18V36h4V18c.06-2.09.54-5.32,2.47-7.53L24,16Z"/></svg>',bb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><polygon points="35.99 2 30 2 25.99 2 25.99 6.59 25.99 8.84 24 8.84 19.99 8.84 19.99 13.43 19.99 15.67 13.99 15.67 13.99 15.69 13.99 20.27 13.99 22.52 12 22.52 7.99 22.52 7.99 27.12 7.99 29.36 0 29.36 0 33.95 7.99 33.95 11.99 33.95 12 33.95 12 27.12 13.99 27.12 18 27.12 18 22.52 18 20.27 19.99 20.27 24 20.27 24 15.67 24 13.43 25.99 13.43 30 13.43 30 8.84 30 6.59 35.99 6.59 35.99 2"/></svg>',Mb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><polygon points="30 2.03 25.99 2.03 25.99 6.63 25.99 8.87 24 8.87 19.99 8.87 19.99 13.47 19.99 15.71 13.99 15.71 13.99 15.73 13.99 20.31 13.99 22.57 12 22.57 7.99 22.57 7.99 27.16 7.99 29.4 0 29.4 0 34 7.99 34 11.99 34 12 34 12 27.16 13.99 27.16 18 27.16 18 22.57 18 20.31 19.99 20.31 24 20.31 24 15.71 24 13.47 25.99 13.47 30 13.47 30 8.87 30 6.63 35.99 6.63 35.99 2.03 30 2.03"/><polygon points="30.17 26.18 26 31 26 28 24 28 24 34 31 34 31 32 28 32 31.68 27.59 30.17 26.18"/></svg>',wb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><polygon points="30 2.03 25.99 2.03 25.99 6.63 25.99 8.87 24 8.87 19.99 8.87 19.99 13.47 19.99 15.71 13.99 15.71 13.99 15.73 13.99 20.31 13.99 22.57 12 22.57 7.99 22.57 7.99 27.16 7.99 29.4 0 29.4 0 34 7.99 34 11.99 34 12 34 12 27.16 13.99 27.16 18 27.16 18 22.57 18 20.31 19.99 20.31 24 20.31 24 15.71 24 13.47 25.99 13.47 30 13.47 30 8.87 30 6.63 35.99 6.63 35.99 2.03 30 2.03"/><polygon points="24.83 33.82 29 29 29 32 31 32 31 26 24 26 24 28 27 28 23.32 32.41 24.83 33.82"/></svg>',Tb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M5,10,17,0V8a11,11,0,0,1,8.44,3.5c2.88,3.2,3.5,7.8,3.56,10.5V36H25V22c-.05-2.11-.54-5.61-2.53-7.82A7.1,7.1,0,0,0,17,12v8Z"/></svg>',Eb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M29,10,17,0V8a11,11,0,0,0-8.44,3.5C5.68,14.7,5.06,19.3,5,22V36H9V22c.06-2.11.54-5.61,2.53-7.82A7.1,7.1,0,0,1,17,12v8Z"/></svg>',Sb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M20,0c-5.38,0-9.79,5.34-10,12H2L12,24,22,12H14c.19-4.39,2.86-8,6-8s6,4.58,6,10V36h4V14C30,6.13,25.6,0,20,0Z"/></svg>',Ab='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M21,3c-.44-.92-1-3-3-3s-2.63,2.16-3,3C15,3,2,29,2,33a2.65,2.65,0,0,0,3,3c2,0,6.1-2.2,9-4,2-1,3-2,4-2s2,1,4,2c0,0,7,4,9,4a2.65,2.65,0,0,0,3-3C34,29,21,3,21,3Z"/></svg>',qb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M18,4A14,14,0,1,1,4,18,14,14,0,0,1,18,4m0-4A18,18,0,1,0,36,18,18,18,0,0,0,18,0Z"/><circle cx="18" cy="18" r="6"/></svg>',Pb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M18,0A13.83,13.83,0,0,0,4,14c0,4,1,9,7,12,2,1,6.15,8.67,7,10,3.38-5.44,5-9,7-10,6-3,7-8,7-12A13.83,13.83,0,0,0,18,0Zm0,19a5,5,0,1,1,5-5A5,5,0,0,1,18,19Z"/></svg>',Cb='<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><title>mappedin-icon</title><path d="M18,0A13.83,13.83,0,0,0,4,14c0,4,1,9,7,12,2,1,6.15,8.67,7,10,3.38-5.44,5-9,7-10,6-3,7-8,7-12A13.83,13.83,0,0,0,18,0Z"/></svg>',Ib='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="25px" height="30px" viewBox="0 0 25 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 57.1 (83088) - https://sketch.com --\x3e\n <title>Marker Pin</title>\n <desc>Created with Sketch.</desc>\n <defs>\n <path d="M5.5,15 C6.34615385,14.1176471 7.33333333,12.9411765 8.46153846,11.4705882 C10.1538462,9.26470588 11,7.18962511 11,5.73529412 C11,2.56777864 8.53756612,0 5.5,0 C2.46243388,0 0,2.56777864 0,5.73529412 C0,7.1924534 0.846153846,9.26470588 2.53846154,11.4705882 C3.66666667,12.9411765 4.65384615,14.1176471 5.5,15 Z" id="path-1"></path>\n <filter x="-104.5%" y="-63.3%" width="309.1%" height="259.8%" filterUnits="objectBoundingBox" id="filter-2">\n <feMorphology radius="2" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>\n <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>\n <feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>\n <feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>\n <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>\n </filter>\n </defs>\n <g id="CE-1261" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Final-MVP-Markers" transform="translate(-204.000000, -523.000000)">\n <g id="Marker-Pin" transform="translate(211.000000, 528.000000)">\n <g id="Oval-Copy-25">\n <use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>\n <path stroke="#FFFFFF" stroke-width="1.5" d="M4.95868222,15.5191099 C4.09118889,14.6145045 3.08708286,13.4178617 1.94340415,11.9271041 C0.219570966,9.68012899 -0.75,7.4435468 -0.75,5.73529412 C-0.75,2.16043095 2.04102866,-0.75 5.5,-0.75 C8.95897134,-0.75 11.75,2.16043095 11.75,5.73529412 C11.75,7.44173178 10.7794284,9.68143336 9.05659585,11.9271041 C7.91291714,13.4178617 6.90881111,14.6145045 6.04131778,15.5191099 L5.5,16.0835856 L4.95868222,15.5191099 Z" fill="#FFFFFF" fill-rule="evenodd"></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',Lb='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="23px" height="27px" viewBox="0 0 23 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 57.1 (83088) - https://sketch.com --\x3e\n <title>Oval Copy 25</title>\n <desc>Created with Sketch.</desc>\n <defs>\n <path d="M5.5,15 C6.34615385,14.1176471 7.33333333,12.9411765 8.46153846,11.4705882 C10.1538462,9.26470588 11,7.18962511 11,5.73529412 C11,2.56777864 8.53756612,0 5.5,0 C2.46243388,0 0,2.56777864 0,5.73529412 C0,7.1924534 0.846153846,9.26470588 2.53846154,11.4705882 C3.66666667,12.9411765 4.65384615,14.1176471 5.5,15 Z" id="path-1"></path>\n <filter x="-90.9%" y="-53.3%" width="281.8%" height="236.1%" filterUnits="objectBoundingBox" id="filter-2">\n <feMorphology radius="0.5" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>\n <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>\n <feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>\n <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>\n </filter>\n </defs>\n <g id="CE-1261" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Final-MVP-Markers" transform="translate(-205.000000, -524.000000)">\n <g id="Marker-Pin" transform="translate(211.000000, 528.000000)">\n <g id="Oval-Copy-25">\n <use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>\n <use fill="#000000" fill-rule="evenodd" xlink:href="#path-1"></use>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',Ob='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="36px" height="36px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 57.1 (83088) - https://sketch.com --\x3e\n <defs>\n <filter id="f3" x="-50%" y="-50%" width="200%" height="200%">\n <feMorphology radius="3" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>\n <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>\n <feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>\n <feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>\n <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>\n </filter>\n </defs>\n <circle cx="50" cy="50" r="40" fill="white" filter="url(#f3)"/>\n <circle cx="50" cy="50" r="40" fill="white"/>\n</svg>\n',Rb='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="36px" height="36px" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 57.1 (83088) - https://sketch.com --\x3e\n <circle cx="50" cy="50" r="30" />\n</svg>\n',Nb='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 468.614 468.614">\n <g>\n <path d="M291.299 116.517h-3.501c10.635-12.36 17.102-28.378 17.102-45.915C304.899 31.666 273.219 0 234.305 0c-38.93 0-70.584 31.666-70.584 70.602 0 17.537 6.477 33.555 17.093 45.915h-3.51c-19.645 0-35.626 15.997-35.626 35.645v117.105c0 19.648 15.982 35.633 35.626 35.633h1.372v128.07c0 20.332 10.697 35.645 24.884 35.645h61.468c14.208 0 24.908-15.312 24.908-35.645V304.9h1.363c19.642 0 35.639-15.984 35.639-35.633V152.161c-.006-19.647-15.998-35.644-35.639-35.644z" fill="#386460" />\n <path d="M291.299 116.517h-3.501c10.635-12.36 17.102-28.378 17.102-45.915C304.899 31.666 273.219 0 234.305 0c-38.93 0-70.584 31.666-70.584 70.602 0 17.537 6.477 33.555 17.093 45.915h-3.51c-19.645 0-35.626 15.997-35.626 35.645v117.105c0 19.648 15.982 35.633 35.626 35.633h1.372v128.07c0 20.332 10.697 35.645 24.884 35.645h61.468c14.208 0 24.908-15.312 24.908-35.645V304.9h1.363c19.642 0 35.639-15.984 35.639-35.633V152.161c-.006-19.647-15.998-35.644-35.639-35.644z" style="fill:none;stroke-width:8px;stroke:white" />\n </g>\n</svg>',kb='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g>\n <path d="M12 0a8 8 0 00-8 8c0 1.421.382 2.75 1.031 3.906.108.192.221.381.344.563L12 24l6.625-11.531c.102-.151.19-.311.281-.469l.063-.094A7.954 7.954 0 0020 8a8 8 0 00-8-8zm0 4a4 4 0 110 8 4 4 0 010-8z" fill="#e74c3c"/>\n <path d="M12 0a8 8 0 00-8 8c0 1.421.382 2.75 1.031 3.906.108.192.221.381.344.563L12 24l6.625-11.531c.102-.151.19-.311.281-.469l.063-.094A7.954 7.954 0 0020 8a8 8 0 00-8-8zm0 4a4 4 0 110 8 4 4 0 010-8z" style="fill:none;stroke-width:1px;stroke-linecap:round;stroke:white"/>\n <path d="M12 3a5 5 0 100 10 5 5 0 000-10zm0 2a3 3 0 110 6 3 3 0 010-6z" fill="#c0392b"/>\n </g>\n</svg>',mo=new Map([["journey-departure",Nb],["journey-destination",kb],["question-mark",ob],["arrow",lb],["door",cb],["elevator",ub],["elevator-up",hb],["elevator-down",db],["elevator-alt",pb],["escalator-down",fb],["escalator-up",mb],["ramp",gb],["ramp-down",yb],["ramp-up",vb],["sligntTurnLeft",xb],["sightTurnRight",_b],["stairs",bb],["stairs-down",Mb],["stairs-up",wb],["turnLeft",Tb],["turnRight",Eb],["uTurn",Sb],["blue-arrow",Ab],["start",qb],["destination-marker-back",Pb],["destination-marker-front",Cb],["smart-label-pin-back",Ib],["smart-label-pin-front",Lb],["smart-label-circle-back",Ob],["smart-label-circle-front",Rb]]),UO=10,VO=new Ci,V0=class{constructor(t,e){H(this,tr,void 0),H(this,Jn,void 0),w(this,"pathSegments",new Map),w(this,"paths",new Map),G(this,tr,t),G(this,Jn,e)}getPathLength(t){let e=0;for(let i=0,n=t.length-1;i<n;++i){let n=t[i],r=t[i+1];n.path.includes(r)&&(e+=Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2)))}return e}drawPath(t,e={}){let i={color:"#4b90e2",pulseColor:"#ffffff",pulseIterations:1,nearRadius:1.8,nearZoom:375,farZoom:1e4,drawDuration:1200,curve:Nr.default.Easing.Cubic.InOut,drawConnectionSegments:!0,displayArrowsOnPath:!1},n=be({color:"#7ed321",pulseColor:"#ffffff",nearRadius:1.8,nearZoom:375,farZoom:1e4,drawDuration:800,curve:Nr.default.Easing.Cubic.InOut,displayArrowsOnPath:!1},e.connectionPathOptions),r=e.pulsePauseDuration||600;null!=n.radius&&(ge.warn("Deprecation warning: `connectionPathOptions.radius` has been deprecated. Use `connectionPathOptions.nearRadius` and `connectionPathOptions.farRadius` instead."),n.nearRadius=n.radius),null==n.farRadius&&(n.farRadius=2.3*n.nearRadius);let s=Ue(be(be({},i),e),{connectionPathOptions:n});null!=e.radius&&(ge.warn("Deprecation warning: `options.radius` has been deprecated. Use `options.nearRadius` and `options.farRadius` instead."),s.nearRadius=e.radius),null==s.farRadius&&(s.farRadius=2.3*s.nearRadius);let a,o,l,h=0,u=t.reduce(((e,i,n)=>{let r=t[n+1],u=t[n-1];return 0===n?a=i.map.id:(i.map.id!=a||null==r)&&(l=this.drawPathSegment(t.slice(h,null==r?n+1:n),a,s),h=n,e.push(l),null!=o&&(o.tween.chain(l.tween),o.pulseTween.chain(l.pulseTween),o.pulseTween.onComplete(o.resetPulse)),o=l,null!=u&&u.map.id!=i.map.id&&s.drawConnectionSegments,a=i.map.id),e}),[]),c=1,d=s.pulseIterations||1/0;if(u.length>0){let t=u[0],e=u[u.length-1];t.tween.start(),t.tween.onComplete((()=>{t.pulseTween.start()})),e.endPauseTween=new Nr.default.Tween({}).to({value:1},r).chain(t.pulseTween).onUpdate((()=>_(this,tr).tryRendering(Nt.TWEEN))),d>1&&e.pulseTween.chain(e.endPauseTween),e.pulseTween.onComplete((()=>{c+1>=d?u.forEach((t=>{t.pulseTween.onComplete((()=>{})),t.pulseTween.stop(),t.endPauseTween&&t.endPauseTween.stop(),t.resetPulse(),_(this,tr).tryRendering(Nt.ANIMATED)})):(e.resetPulse(),t.resetPulse()),c++}))}_(this,tr).tryRendering(Nt.ANIMATED);let p=Xn();return this.paths.set(p,u),p}drawSegment(t,e,i){let n=(i=i||{}).color||"#ff834c",r=i.pulseColor||"#000000",s=void 0!==i.nearRadius?i.nearRadius:1.8,a=void 0!==i.farRadius?i.farRadius:s,o=void 0!==i.nearZoom?i.nearZoom:375,l=void 0!==i.farZoom?i.farZoom:1e4,u=void 0!==i.drawDuration?i.drawDuration:1500,c=i.curve||Nr.default.Easing.Cubic.InOut,d=i.displayArrowsOnPath||!1,p=i.isConnectionPathSegment||!1,m=i.displayArrowsOnPath||i.flattenPath||!1,f=void 0===i.showPulse||i.showPulse,g=void 0===i.animateDrawing||i.animateDrawing,v=0;if(p)for(let e=1;e<t.length;++e){let i=t[e].x-t[e-1].x,n=t[e].z-t[e-1].z;v+=Math.sqrt(i*i+n*n)}else for(let e=1;e<t.length;++e){let i=t[e].x-t[e-1].x,n=t[e].y-t[e-1].y,r=t[e].z-t[e-1].z;v+=Math.sqrt(i*i+n*n+r*r)}let y={vertexes:{type:"f",value:1},resolution:{type:"v2",value:_(this,Jn).resolution},cameraParameters:{type:"v2",value:_(this,Jn).cameraParameters},complete:{type:"f",value:g?0:1},color:{type:"c",value:new Ee(n)},pathLength:{type:"f",value:v},nearRadius:{type:"f",value:s},farRadius:{type:"f",value:a},nearZoom:{type:"f",value:o},farZoom:{type:"f",value:l},pulseColor:{type:"c",value:new Ee(r)},pulse:{type:"f",value:0},pulseLength:{type:"f",value:.075},pulseBulge:{type:"b",value:!1},pathIsVertical:{type:"b",value:p},arrowAnimationTimer:{type:"f",value:0},arrowTexture:{type:"t",value:VO.load(mo.get("arrow"))},displayArrowsOnPath:{type:"b",value:d},flattenFactor:{type:"f",value:m?.05:1},showPulse:{type:"b",value:f}},x=new Da(t);x.curveType="catmullrom",x.tension=0;let b=30*e.length,w=new Fa(x,b,s,8,!1),M=new Float32Array(w.attributes.position.count);for(let t=e.length;t<M.length;t++)M[t]=t;w.setAttribute("vertexIndex",new qt(M,1));let E=new Float32Array(w.attributes.position.count),T=new qt(E,1);for(let t=0;t<b;t++)for(let e=0;e<=8;++e)T.setX(9*t+e,t/b);w.setAttribute("pathDistance",T);let S=new Float32Array(3*w.attributes.normal.count),q=new qt(S,3);for(let t=0;t<b;t++){let e=w.tangents[t];for(let i=0;i<=8;++i)q.setXYZ(9*t+i,e.x,e.y,e.z)}w.setAttribute("pathTangent",q);let P=new Float32Array(3*w.attributes.normal.count),A=new qt(P,3);for(let t=0;t<b;t++){let e=w.tangents[t];var C,L,I;p?(C=e.x*e.y,L=e.y*e.y-1,I=e.z*e.y):(C=-e.x*e.z,L=-e.y*e.z,I=1-e.z*e.z);let i=Math.sqrt(C*C+L*L+I*I);0===i&&(i=1);let n=C/i,r=L/i,s=I/i;for(let e=0;e<=8;++e)A.setXYZ(9*t+e,n,r,s)}w.setAttribute("pathNormal",A);let R=new pn({uniforms:y,vertexShader:sb,fragmentShader:ab});R.transparent=!0,R.alphaTest=.5,y.resolution.value.x=_(this,Jn).renderer.getBufferSize().width,y.resolution.value.y=_(this,Jn).renderer.getBufferSize().height,y.vertexes.value=M.length,y.arrowTexture.value.wrapS=Ji,y.arrowTexture.value.wrapT=Ji,y.arrowTexture.value.anisotropy=_(this,Jn).renderer.getMaxAnisotropy();let N=new lt(w,R),O=h((()=>{_(this,tr).tryRendering(Nt.ANIMATED)}),"tryRenderingAnimated"),D=new Nr.default.Tween(y.pulse).to({value:1},u).easing(c).onUpdate(O),B=new Nr.default.Tween(y.complete).to({value:1},u).easing(c).onUpdate(O),k=new Nr.default.Tween(y.arrowAnimationTimer).to({value:1},3e3).easing(Nr.default.Easing.Linear.None).repeat(1/0).onUpdate(O);return d&&k.start(),{id:N.id,object:N,tween:B,pulseTween:D,arrowAnimationTween:k,reset:function(){y.complete.value=0},resetPulse:function(){y.pulse.value=0}}}drawPathSegment(t,e,i={color:"#ff834c",pulseColor:"white",pulseIterations:1/0,nearRadius:1.8,nearZoom:375,farZoom:1e4,drawDuration:1500,displayArrowsOnPath:!1}){let n=i.nearRadius||2,r=i.farRadius||i.nearRadius||2,s=e?_(this,tr).venue.maps.find((t=>t.id===e)):_(this,tr).currentMap,a=(null==s?void 0:s.scale)||1;n/=a,r/=a;let o=e?Jt(e):_(this,tr).currentMap,l=[],h=_(this,Jn).mapObjects.get(o).mapClass;for(let e=0;e<t.length;e++){let i=t[e],r=new I(i.x-h.width/2,-i.y+h.height/2,n/2);l.push(r)}l.push(l[l.length-1].clone().setZ(-n)),l.unshift(l[0].clone().setZ(-n));let u=this.drawSegment(l,t,Ue(be({},i),{nearRadius:n,farRadius:r,mapId:o}));return this.pathSegments.set(u.id,u),u.object.layers.set(hi.ANIMATED),_(this,Jn).mapObjects.get(o).add(u.object),u}drawConnectionPathSegment(t,e={color:"#7dd322",pulseColor:"#ffffff",pulseIterations:1/0,nearRadius:1.8,nearZoom:375,farZoom:1e4,drawDuration:1500,curve:Nr.default.Easing.Cubic.InOut,displayArrowsOnPath:!1}){let i=_(this,Jn).mapObjects.get(t[0].map),n=_(this,Jn).mapObjects.get(t[1].map),r=i.mapClass,s=n.mapClass,a=new I(t[0].x-r.width/2,-t[0].y+r.height/2,0),o=new I(t[1].x-s.width/2,-t[1].y+s.height/2,0),l=Ox(a.clone().applyMatrix4(i.object.matrix),o.clone().applyMatrix4(n.object.matrix),UO),h=this.drawSegment(l,t,Ue(be({},e),{mapId:i.id,isConnectionPathSegment:!0}));return this.pathSegments.set(h.id,h),h.object.layers.set(hi.ANIMATED),_(this,Jn).scene.add(h.object),h}removePath(t){if(this.paths.has(t))for(let e of this.paths.get(t)){let t=this.pathSegments.get(e.id);this.removePathSegment(t)}}removePathSegment(t){t&&(_(this,Jn).scene.remove(t.object),t.object.destroy(),t.pulseTween.stop(),t.endPauseTween&&t.endPauseTween.stop(),t.tween.stop(),t.arrowAnimationTween.stop(),t.pulseTween=void 0,t.tween=void 0,t.arrowAnimationTween=void 0,this.pathSegments.delete(t.id))}removeAllPaths(){for(let t of this.pathSegments.values())this.removePathSegment(t);this.pathSegments.clear(),_(this,Jn).renderer.disposeOfRenderLists()}};h(V0,"PathsLayer"),tr=new WeakMap,Jn=new WeakMap;var Db=V0;P(),P(),P();var pa,H0=class extends hc{constructor(){super(...arguments),w(this,"contentEl",document.createElement("div")),w(this,"containerEl",document.createElement("div")),H(this,pa,!1)}removeSelf(){var t;this.__engine=null,null!=(t=this.containerEl.parentElement)&&t.contains(this.containerEl)&&this.containerEl.parentElement.removeChild(this.containerEl),this.containerEl=null,this.contentEl=null}enable(){this.__engine&&(this.enabled=!0,this.__engine.collisionEngineContainerEl.appendChild(this.containerEl),this.updateDimensionsImmediately())}disable(){this.__engine&&(this.enabled=!1,this.__engine.collisionEngineContainerEl.contains(this.containerEl)&&this.__engine.collisionEngineContainerEl.removeChild(this.containerEl))}colliderDidGoOffscreen(){this.visible=!1,this.containerEl.style.opacity="0"}colliderDidNotFindAHome(){this.visible=!1}colliderDidUpdatePosition(t){this.containerEl.style.transform=`translate3D(${t[0]}px, ${t[1]}px, 0)`}updateDimensions(){G(this,pa,!0),this.visible&&(this.updateDimensionsImmediately(),G(this,pa,!1))}updateDimensionsImmediately(){if(_(this,pa)){let{width:t,height:e}=this.containerEl.getBoundingClientRect();this.dimensions={width:t,height:e},Object.assign(this.containerEl,{width:t+"px",height:e+"px"}),G(this,pa,!1),this.__engine.update()}}colliderDidMount(){this.updateDimensions()}colliderDidUpdateVisiblity(){this.containerEl.style.opacity=this.visible?"1":"0",this.visible&&_(this,pa)&&this.updateDimensionsImmediately()}};h(H0,"HTMLCollider"),pa=new WeakMap;var G0=H0,Bb=(t=>(t[t.CENTER=0]="CENTER",t[t.TOP=1]="TOP",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT",t[t.RIGHT=4]="RIGHT",t))(Bb||{}),HO={anchor:0},j0=class extends G0{constructor(t){super(t),w(this,"_el",null),w(this,"style",{}),w(this,"polygon");let{contentHtml:e,position:i,mapId:n,id:r,collisionRank:s=3}=t;this.containerEl.innerHTML=`<div class="mappedin-marker__wrapper"><div class="mappedin-marker">${e}</div></div>`,this.position=i,this.rank=s,this.mapId=n,this.id="string"==typeof r?r:Xn(),this.containerEl=this.containerEl.querySelector(".mappedin-marker"),this.contentEl=this.containerEl.firstElementChild,this._el=this.contentEl,this.options=be(be({},HO),t)}get strategies(){let{width:t,height:e}=this.dimensions;return[{name:"center",getBoundingBox:({x:i,y:n})=>{let r=n-e/2,s=n+e/2,a=i-t/2,o=i+t/2;switch(this.options.anchor){case 1:r=n-e,s=n;break;case 2:r=n,s=n+e;break;case 3:a=i-t,o=i;break;case 4:a=i,o=i+t}return[r,s,a,o]},onStrategySelected:()=>{let i=-e/2+"px",n=-t/2+"px";switch(this.style.top=i,this.style.left=n,this.options.anchor){case 1:this.style.top=-e+"px";break;case 2:this.style.top=e+"px";break;case 3:this.style.left=-t+"px";break;case 4:this.style.left=t+"px";break;default:this.style.top=i,this.style.left=n}}}]}colliderDidMount(){this.updateDimensions()}setAction(t){super.setAction(t),this.visible=1===t}colliderDidNotFindAHome(){this.setAction(2)}colliderDidGoOffscreen(){}colliderDidUpdateVisiblity(){this.containerEl.style.opacity=1===this.action?"1":"0",super.colliderDidUpdateVisiblity(),!0===this.visible&&Object.assign(this.containerEl.style,this.style)}};h(j0,"Marker");var Fb=j0,gc={};function GO(t,e){var i;return null!=(null==(i=gc[t.id])?void 0:i[e])||(null==gc[t.id]&&(gc[t.id]={}),t.polygons.forEach((e=>{e.entrances.forEach((i=>{gc[t.id][i.id]=e}))}))),gc[t.id][e]}h(GO,"getPolygonByNodeId");var fa,pi,W0=class{constructor(t,e){H(this,fa,void 0),H(this,pi,void 0),G(this,fa,t),G(this,pi,e)}createMarker(t,e,i){let n=_(this,pi).mapObjects.get(t.map.id||_(this,pi).currentMap),r=_(this,pi).convertTo3DMapPosition(t);if(t instanceof Di){let e=GO(n.mapClass,t.id);null!=e&&r.setZ(e.geometry.scale.z*Math.max(n.mapClass.width,n.mapClass.height)/1e3)}let s=new Fb(Ue(be({},i),{collisionRank:null==i?void 0:i.rank,contentHtml:e,mapId:n.id,position:r.clone()}));return _(this,pi).smartCollisionEngine.add(s.id,s),n.addPendingLowPriorityTask("createTextObject",(()=>{n.markers.add(s),s.enable(),_(this,pi).smartCollisionEngine.update(),_(this,fa).tryRendering()})),_(this,fa).tryRendering(),s}removeMarker(t){_(this,pi).smartCollisionEngine.remove("string"==typeof t?t:t.id),_(this,pi).smartCollisionEngine.update(),_(this,fa).tryRendering()}removeAllMarkers(){Array.from(_(this,pi).mapObjects.values()).forEach((t=>{t.markers.forEach((t=>{_(this,pi).smartCollisionEngine.remove(t.id)}))})),_(this,pi).smartCollisionEngine.update(),_(this,fa).tryRendering()}};h(W0,"MarkersLayer"),fa=new WeakMap,pi=new WeakMap;var zb=W0;P(),P();var Jh,yc,jO={top:!0,left:!0,topLeft:!0,right:!0,topRight:!0,bottom:!0,bottomLeft:!0,bottomRight:!0},X0=class extends G0{constructor(t){super(t),w(this,"className","top"),w(this,"_el",null),w(this,"style",{}),w(this,"updateClassName",h((t=>{this.containerEl.classList.item(1)&&this.containerEl.classList.remove(this.containerEl.classList.item(1)),this.containerEl.classList.add(`tooltip--anchor-${t}`),G(this,yc,t)}),"updateClassName")),H(this,Jh,"-1"),H(this,yc,"");let{html:e,contentHtml:i,text:n,position:r,selector:s,map:a,padding:o=0,collisionRank:l=3,defaultAnchorType:u="top",enabledAnchorTypes:c}=t;this.containerEl.innerHTML=e||`<div class="mappedin-tooltip"><div class="mappedin-tooltip__content" style="padding: ${o}px">${n||i}</div></div>`,this.position=r,this.rank=l,this.mapId=a,this.id=Xn();let d=e?s:".mappedin-tooltip";this.containerEl=this.containerEl.querySelector(d),this.contentEl=this.containerEl.firstElementChild,this._el=this.contentEl,this.options={collisionRank:l,padding:o/Math.SQRT2,defaultAnchorType:u,enabledAnchorTypes:be(be({},jO),c)}}get strategies(){let{width:t,height:e}=this.dimensions,{padding:i}=this.options,n=i/2;return[{name:"top",getBoundingBox:({x:n,y:r})=>[r-e-i,r-i,n-t/2,n+t/2+i/2],onStrategySelected:()=>{this.style.top=-e-i+"px",this.style.left=-t/2+"px",this.className="top"}},{name:"right",getBoundingBox:({x:n,y:r})=>[r-e/2-i/2,r+e/2+i/2,n+i,n+i+t],onStrategySelected:()=>{this.style.top=-e/2+"px",this.style.left=i+"px",this.className="right"}},{name:"left",getBoundingBox:({x:n,y:r})=>[r-e/2,r+e/2,n-t-i,n],onStrategySelected:()=>{this.style.top=-e/2+"px",this.style.left=-t-i+"px",this.className="left"}},{name:"bottom",getBoundingBox:({x:n,y:r})=>[r+i,r+i+e,n-t/2,n+t/2],onStrategySelected:()=>{this.style.top=i+"px",this.style.left=-t/2+"px",this.className="bottom"}},{name:"bottomLeft",getBoundingBox:({x:r,y:s})=>[s+n+i,s+n+e+i,r-t-n,r-n],onStrategySelected:()=>{this.style.top=i+"px",this.style.left=-t-i+"px",this.className="bottom-left"}},{name:"bottomRight",getBoundingBox:({x:r,y:s})=>[s+n,s+n+e+i,r+n,r+n+t+i],onStrategySelected:()=>{this.style.top=i+"px",this.style.left=i+"px",this.className="bottom-right"}},{name:"topLeft",getBoundingBox:({x:i,y:r})=>[r-e-n,r-n,i-t-n,i-n],onStrategySelected:()=>{this.style.top=-e-i+"px",this.style.left=-t-i+"px",this.className="top-left"}},{name:"topRight",getBoundingBox:({x:r,y:s})=>[s-e-n,s-n,r+n+i,r+n+t+i],onStrategySelected:()=>{this.style.top=-e-i+"px",this.style.left=i+"px",this.className="top-right"}}].filter((t=>!0===this.options.enabledAnchorTypes[t.name]))}colliderDidMount(){this.updateDimensions()}updateDimensionsImmediately(){super.updateDimensionsImmediately(),G(this,yc,""),G(this,Jh,"-1")}setAction(t){super.setAction(t),this.visible=1===t}colliderDidNotFindAHome(){4===this.options.collisionRank?this.visible=!0:this.setAction(2)}colliderDidGoOffscreen(){}colliderDidUpdateVisiblity(){let t=1===this.action?"1":"0";_(this,Jh)!=t&&(this.containerEl.style.opacity=t),_(this,yc)!==this.className&&(this.updateClassName(this.className),!0===this.visible&&(this.updateDimensionsImmediately(),Object.assign(this.containerEl.style,this.style)))}};h(X0,"SmartTooltip"),Jh=new WeakMap,yc=new WeakMap;var xs,nr,Ub=X0,Y0=class{constructor(t,e){H(this,xs,void 0),H(this,nr,void 0),G(this,xs,t),G(this,nr,e)}createTooltip(t,e,i){return this.createTooltipInternal({nodeOrCoordinate:t,contentHtml:e,options:i})}createCustomTooltip(t,e,i,n){return this.createTooltipInternal({nodeOrCoordinate:t,html:e,selector:i,options:n})}createTooltipInternal({nodeOrCoordinate:t,html:e,contentHtml:i,selector:n,options:r}){let s=t.map.id,a=_(this,nr).mapObjects.get(s),o=_(this,nr).convertTo3DMapPosition(t);if(t instanceof Di&&t.polygon){let e=_(this,nr).getPositionPolygon(t.polygon);e&&o.setZ(e.z)}let l=new Ub(Ue(be({},r),{map:s,position:o,html:e,contentHtml:i,selector:n}));return _(this,nr).smartCollisionEngine.add(l.id,l),a.addPendingLowPriorityTask("createTextObject",(()=>{a.tooltips.add(l),l.mapId===_(this,xs).currentMap.id&&l.enable(),_(this,xs).tryRendering()})),_(this,xs).tryRendering(),l}removeTooltip(t){_(this,nr).smartCollisionEngine.remove("string"==typeof t?t:t.id),_(this,xs).tryRendering()}removeAllTooltips(){Array.from(_(this,nr).mapObjects.values()).forEach((t=>{t.tooltips.forEach((t=>{_(this,nr).smartCollisionEngine.remove(t.id)}))})),_(this,xs).tryRendering()}};h(Y0,"TooltipsLayer"),xs=new WeakMap,nr=new WeakMap;var Vb=Y0;P();var go,rr,Z0=class{constructor(t,e){H(this,go,void 0),H(this,rr,void 0),G(this,go,t),G(this,rr,e)}enableImageFlippingForAllLocations(t){_(this,rr).imageFlippingEnabled=!0,t||(t={});let e=t.excludeTypes||[],i=(t.locations||_(this,go).venue.locations.slice()).filter((function(t){return-1===e.indexOf(t.type)})),n={};for(let t=0,e=i.length;t<e;++t){let e=i[t].polygons;for(let t=0,i=e.length;t<i;++t){let i=e[t];n[i.id]||(n[i.id]=!0,this.enableImageFlippingForPolygon(i))}}}enableImageFlippingForPolygon(t){let e=_(this,rr).mapObjects.get(t.map.id),i=0,n=_(this,go).currentMap.perspectiveId;n&&t&&t.perspectives&&t.perspectives[n]&&t.perspectives[n].image&&t.perspectives[n].image.rotation&&!isNaN(t.perspectives[n].image.rotation.z)?i=t.perspectives[n].image.rotation.z*(Math.PI/180):t&&t.image&&t.image.rotation&&!isNaN(t.image.rotation.z)&&(i=t.image.rotation.z*(Math.PI/180)),_(this,rr).imageFlippingCache[t.map.id]=_(this,rr).imageFlippingCache[t.map.id]||[],_(this,rr).imageFlippingCache[t.map.id].push([t.id,i]),e.mapClass.id===_(this,go).currentMap.id&&e.load().then((()=>{e.enableImageFlipping(t.id,i)}))}disableImageFlippingForAllPolygons(){let t=Object.keys(_(this,rr).mapObjects);for(let e=0,i=t.length;e<i;e++){let i=t[e];_(this,rr).mapObjects.get(i).disableAllImageFlipping()}}};h(Z0,"PolygonImagesLayer"),go=new WeakMap,rr=new WeakMap;var Hb=Z0;P(),P();var yo=gn(io(),1),WO=2e3,XO=8,YO=65,ZO=3,JO={duration:2e3,easing:yo.default.Easing.Cubic.Out};function J0(t){return"number"==typeof t&&!isNaN(t)&&t>=0}h(J0,"isNonNegativeNumber");var $O=h(((t,e,i)=>t<e?t:t<i?e:t*e/i),"ledge"),$0=class extends di{constructor({mapManager:t,mapView:e,threeDMarkerLayer:i,core:n,minRadius:r=XO,maxRadius:s=YO,radiusUpdateInterval:a=ZO,radiusTweenOptions:o=JO}){if(super(),this.mapManager=t,this.mapView=e,this.threeDMarkerLayer=i,this.core=n,!J0(r))throw new Error(`Expecting minRadius parameter to be a valid number >= 0. Provided: ${r}`);if(this.minRadius=r,!J0(s))throw new Error(`Expecting maxRadius parameter to be a valid number >= 0. Provided: ${s}`);if(s<this.minRadius)throw new Error(`Expecting maxRadius parameter to be >= minRadius parameter. Provided: ${s}; minRadius = ${this.minRadius}`);if(this.maxRadius=s,!J0(a))throw new Error(`Expecting radiusUpdateInterval parameter to be a valid number >= 0. Provided: ${a}`);this.radiusUpdateInterval=a,this.radiusTweenOptions=o,this.state=null,this.prevRadius=null,this.radiusTween=null,this.prevBearing=null,this.bearingTween=null,this.currentX=null}computeNewRadius(t){if(!J0(t)||t<this.minRadius)return 0;if(t>=this.maxRadius)return this.maxRadius;if(0===this.radiusUpdateInterval)return t;{let e=t-this.minRadius;return e-e%this.radiusUpdateInterval+this.minRadius}}updateBlueDotSize(){this.blueDots&&this.blueDots.forEach((t=>{let e=this.core.controls.getZoomScaledMin(),i=3*e,n=5*e,r=$O(this.currentX,i,n)/2e3;t.dotObject.scale.set(r,r,r),t.bearing&&t.bearing.scale.set(r,r,r)}))}setBlueDotSizeFromZoom(t){this.currentX=t,this.updateBlueDotSize()}update(t){let e=t.mode||this.state.mode,i=t.mapId||t.map&&t.map.id||this.mapManager.currentMap.id;null==t.bearing&&(this.prevBearing=null),this.positionTween&&this.positionTween.stop(),this.state&&(e!==this.state.mode||i!==this.state.targetMap)&&this.cleanup();let n=this.computeNewRadius(t.radius);if(!this.blueDots){let n=[];this.mapManager.mapObjects.forEach((r=>{let s=r.getPositionLatLon(t.coordinates.latitude,t.coordinates.longitude),a=r.id!==i&&e===po.BLUE?po.GHOST:e,o=eb(a,0,jy(t.bearing,this.mapManager.currentMap.getNorth()),{baseColor:t.baseColor});this.prevRadius=0;let l=this.threeDMarkerLayer.createThreeJSMarker({object:o.outerObject,mapOrMapId:r,position:s});n.push({handle:l,radius:o.radiusObject,dotObject:o.dotObject,bearing:o.bearingObject})})),this.blueDots=n,this.currentX&&this.updateBlueDotSize()}this.currentPositionLatLon?(this.positionTween=new yo.default.Tween(this.currentPositionLatLon).to({lat:t.coordinates.latitude,lon:t.coordinates.longitude},WO).easing(yo.default.Easing.Cubic.Out).onUpdate((t=>{this.currentPositionLatLon=t,this.blueDots.forEach((e=>{let i=e.handle._mapId,n=this.mapManager.mapObjects.get(i).getPositionLatLon(t.lat,t.lon);e.handle.object.position.set(n.x,n.y,0)})),this.mapView.tryRendering(Nt.ALWAYS_ON_TOP)})),this.positionTween.start()):(this.currentPositionLatLon={lat:t.coordinates.latitude,lon:t.coordinates.longitude},this.blueDots.forEach((e=>{let i=e.handle._mapId,n=this.mapManager.mapObjects.get(i).getPositionLatLon(t.coordinates.latitude,t.coordinates.longitude);e.handle.object.position.set(n.x,n.y,0)}))),Math.abs(n-this.prevRadius)>=Number.EPSILON&&(null!=this.radiusTween&&this.radiusTween.stop(),this.radiusTween=new yo.default.Tween({value:this.prevRadius}).to({value:n},this.radiusTweenOptions.duration).easing(this.radiusTweenOptions.easing).onUpdate((({value:t})=>{this.prevRadius=t,null!=this.blueDots&&this.blueDots.forEach((e=>{if(e.radius){let i=e.handle._mapId,n=this.mapManager.mapObjects.get(i),r=t*n.getMapScale();e.radius.scale.set(r,1,r)}})),this.mapView.tryRendering(Nt.ALWAYS_ON_TOP)})).start());let r=t.bearing;null!=t.bearing?(Math.abs(r-this.prevBearing)>=Number.EPSILON||null==this.prevBearing)&&(this.bearingTween=new yo.default.Tween({value:this.prevBearing||0}).to({value:r},1e3).easing(yo.default.Easing.Cubic.Out).onUpdate((({value:t})=>{this.prevBearing=t,null!=this.blueDots&&this.blueDots.forEach((e=>{e.bearing&&(e.bearing.visible=!0,e.bearing.rotation.set(0,0,jy(t,this.mapManager.currentMap.getNorth())))})),this.mapView.tryRendering(Nt.ALWAYS_ON_TOP)})).start()):null!=this.blueDots&&this.blueDots.forEach((t=>{t.bearing&&(t.bearing.visible=!1)})),this.state={mode:e,targetMap:i},this.mapView.tryRendering(Nt.ALWAYS_ON_TOP)}getBlueDotForMap(t){if(!Array.isArray(this.blueDots))return;let e=("string"==typeof t&&t.length>0?t:"object"==typeof t?t.id:void 0)||this.mapView.currentMap.id,i=this.blueDots.filter((t=>t.handle._mapId===e));if(i.length>0){let t=new I,e=new I;return i[0].dotObject.updateMatrixWorld(),i[0].dotObject.getWorldPosition(t),i[0].dotObject.getWorldScale(e),e.divideScalar(2),e.setZ(0),t.sub(e),i[0].dotObject}}cleanup(){this.blueDots&&(this.blueDots.forEach((t=>{t.handle._object.children.forEach((t=>{t.geometry?t.geometry.dispose():t.children.forEach((t=>{t.geometry.dispose()}))})),this.threeDMarkerLayer.removeThreeJSMarker(t.handle)})),delete this.blueDots),this.state=null,null!=this.positionTween&&this.positionTween.stop(),null!=this.radiusTween&&this.radiusTween.stop()}};h($0,"BlueDotManager");var Gb=$0;P();var Wb=gn(jb(),1),$h=!1,KO=h((function({mapView:t,mapManager:e,core:i,blueDotManager:n,controller:r}){var s,a,o;let l=new Pr(Ue(be({},null==(s=null==t?void 0:t.venue)?void 0:s.options),{testMode:!(null!=(o=null==(a=null==t?void 0:t.venue)?void 0:a.options)&&o.emitAnalyticsEvents)})),{stateMachine:h}=r,u=yf(i.smartCollisionEngine.update,1e4),c=da({isFollowing:!1,blueDotTooltips:[],zoomCondition:0,setBlueDotPosition(){if(n&&r.userPosition&&r.userMap){let t=2===h.state||3===h.state;n.update({coordinates:r.userPosition.coords,bearing:r.bearing,radius:t&&r.userPosition.coords.accuracy||0,mapId:r.userMap.id})}},showBlueDotBearing(){if(n&&r.userPosition&&r.userMap){let t=2===h.state||3===h.state;n.update({coordinates:r.userPosition.coords,bearing:r.bearing,radius:t&&r.userPosition.coords.accuracy||0,mapId:r.userMap.id})}},addGhostMarkers(){n&&r.userPosition&&r.userMap&&n.update({mode:po.GHOST,coordinates:r.userPosition.coords,bearing:r.bearing,radius:r.userPosition.coords.accuracy,mapId:r.userMap.id})},addLocationUncertainMarkersAndTooltips(){n&&r.userPosition&&r.userMap&&n.update({mode:po.GREY,coordinates:r.userPosition.coords,radius:0,mapId:r.userMap.id})},addBlueDotMarker(){n&&r.userPosition&&r.userMap&&n.update({mode:po.BLUE,coordinates:r.userPosition.coords,bearing:r.bearing,radius:r.userPosition.coords.accuracy,mapId:r.userMap.id,baseColor:r.enableBlueDotOptions.baseColor})},removeTooltips(){c.blueDotTooltips.forEach(t.removeTooltip),c.blueDotTooltips=[]},removeBlueDot(){n.cleanup()},centerBlueDot(){var n,s,a,o;if(!r.userPosition)return;let{latitude:l,longitude:h}=r.userPosition.coords;r.userMap!==t.currentMap&&null!=r.userMap&&t.setMap(r.userMap);let d=i.getPositionLatLon(l,h),p=i.convert3DMapPositionToCoordinate(d),m=null!==t.currentPath&&r.enableBlueDotOptions.useRotationMode,f=i.controls.zoomFactor||1,g=(null==(s=null==(n=t.options.loadOptions)?void 0:n.zoomOverrides)?void 0:s.blueDotFollowingZoomFactor)||2.5,v=f*g;if(0===c.zoomCondition&&null!=(null==(o=null==(a=t.options.loadOptions)?void 0:a.zoomOverrides)?void 0:o.blueDotFollowingZoomFactor))c.zoomCondition=1,$h=!0,i.focusOn({points:[d],changeZoom:!0,duration:500,focusZoomFactor:v,callback:()=>{c.zoomCondition=2}}),$h=!1;else if(1!==this.zoomCondition&&m){let n=r.userMap;if(null==n)return;let s=t.currentPath,a=t.Camera.rotation,o={x:d.x+n.width/2,y:-d.y+n.height/2},l=null==s?void 0:s.filter((t=>t.map.id===n.id));if(null!=l&&l.length){let t,i=e.mapObjects.get(n.id).getMapScale(),r=(0,Wb.default)(l,i),s=tb(r,o);t=null!=s&&s.proportion&&s.proportion>.5?r[s.index||1]:r[s.index||0],a=nb(r,t)+Math.PI}let h=i.canvasHeight>i.canvasWidth&&i.canvasHeight>600&&i.canvasWidth>500,c=900,p=ib(d,a,g*i.controls.getZoomScaledMin(),h);i.controls.animateCamera(Ue(be({},p),{duration:c})),u()}else 1!==this.zoomCondition&&($h=!0,t.Camera.focusOn({coordinates:[p]},{changeZoom:!1,duration:1e3}),$h=!1)},endFollowing(){c.isFollowing=!1,c.zoomCondition=0}}),d=null,p=!1;return i.on("user-pan-begin",(()=>{!d&&p&&(d=setTimeout((()=>{c.endFollowing(),clearTimeout(d),d=null}),60))})),i.on("focuson-begin",(()=>{$h||c.endFollowing()})),i.on("user-hands-on",(()=>{p=!0})),i.on("user-hands-off",(()=>{d&&(clearTimeout(d),d=null,p=!1)})),i.on("user-zoom-begin",(()=>{c.endFollowing()})),i.on("user-tilt-begin",(()=>{c.endFollowing()})),i.on("user-rotate-begin",(()=>{c.endFollowing()})),r.on("userDataChanged",(t=>{let{position:e,state:i}=t.newValue;switch(i){case 2:c.removeTooltips(),c.addGhostMarkers(),l.trackBlueDotEvent(Pr.BLUEDOT_EVENT.FOUND_POSITION),c.setBlueDotPosition(),c.showBlueDotBearing();break;case 3:c.removeTooltips(),c.addBlueDotMarker(),l.trackBlueDotEvent(Pr.BLUEDOT_EVENT.FOUND_FLOOR),c.setBlueDotPosition(),c.showBlueDotBearing();break;case 4:c.removeTooltips(),c.addLocationUncertainMarkersAndTooltips(),c.setBlueDotPosition(),c.showBlueDotBearing();break;default:c.removeTooltips(),c.removeBlueDot()}let n=!0,r=!1;t.oldValue&&(n=t.oldValue.position&&t.newValue.position&&(e.coords.latitude!==t.oldValue.position.coords.latitude||e.coords.longitude!==t.oldValue.position.coords.longitude),r=t.oldValue.map!==t.newValue.map),c.isFollowing&&(n||r)&&c.centerBlueDot()})),c}),"BlueDotUI"),Xb=KO;P();var vo,vc,Kh,Q0=class{constructor(t,e){H(this,vo,void 0),H(this,vc,void 0),H(this,Kh,new Set),G(this,vo,t),G(this,vc,e)}createThreeJSMarker(t){let e=_(this,vo).currentMap.id;null!=t.mapOrMapId&&(e="string"==typeof t.mapOrMapId?t.mapOrMapId:t.mapOrMapId.id);let i=_(this,vc).mapObjects.get(e).addThreeJSMarker(t);return _(this,Kh).add(i),_(this,vo).tryRendering(Nt.ANIMATED),i}removeThreeJSMarker(t){if(null==t._mapId)return!1;let e=!1,i=_(this,vc).mapObjects.get(t._mapId);return i&&(e=i.removeThreeJSMarker(t)),_(this,vo).tryRendering(Nt.ANIMATED),e}removeAllThreeJSMarkers(){_(this,Kh).forEach((t=>{this.removeThreeJSMarker(t)}))}};h(Q0,"ThreeDMarkersLayer"),vo=new WeakMap,vc=new WeakMap,Kh=new WeakMap;var ri,Mn,xo,zi,Qh,t1,Zb,Yb=Q0,e1=class extends er{constructor(t,e,i){super(),H(this,t1),H(this,ri,void 0),H(this,Mn,void 0),H(this,xo,void 0),H(this,zi,void 0),H(this,Qh,void 0),G(this,ri,t),G(this,Mn,e),G(this,Qh,Rx(_(this,ri).venue,_(this,ri).options));let n=new Yb(_(this,ri),_(this,Mn));G(this,zi,new Gb({mapManager:_(this,Mn).mapManager,mapView:_(this,ri),threeDMarkerLayer:n,core:_(this,Mn)})),i.setBlueDotManager(_(this,zi)),G(this,xo,$5({data:_(this,ri).venue,mapView:_(this,ri),core:_(this,Mn),manager:_(this,zi)}));let r=Xb({mapView:_(this,ri),core:_(this,Mn),blueDotManager:_(this,zi),mapManager:_(this,Mn).mapManager,controller:_(this,xo),data:_(this,ri).venue});r.on("isFollowingChanged",(({newValue:t})=>{!1===t&&"follow"===_(this,ri).state&&_(this,Mn).publish(3,{state:"explore"})})),_(this,Mn).on(5,(t=>{r.isFollowing=t})),_(this,Mn).on(4,(({x:t,y:e})=>{_(this,zi).publish("update-position",{x:t,y:e})}));let s=$s(at(this,t1,Zb).bind(this),300);_(this,Mn).on(2,s),_(this,Mn).on(1,(t=>{_(this,zi).setBlueDotSizeFromZoom(t)}))}enable(t){_(this,xo).enableBlueDot(t)}disable(){_(this,xo).disableBlueDot()}};h(e1,"BlueDotLayer"),ri=new WeakMap,Mn=new WeakMap,xo=new WeakMap,zi=new WeakMap,Qh=new WeakMap,t1=new WeakSet,Zb=h((function(){if(!_(this,zi).blueDots)return;let t=_(this,zi).blueDots.filter((t=>t.handle._mapId===_(this,ri).currentMap.id))[0].handle.object.position.clone(),e=_(this,Mn).mapObjects.get(_(this,Qh)||_(this,ri).venue.venue.defaultMap),i=t.applyMatrix4(e.object.matrix).project(_(this,Mn).cameraObject),n=(i.x+1)/2*_(this,Mn).canvasWidth,r=(1-i.y)/2*_(this,Mn).canvasHeight;_(this,zi).publish("update-position",{x:n,y:r})}),"#publishBlueDot");var Jb=e1;P();var ed,_o,n1=class{constructor(t,e){H(this,ed,void 0),H(this,_o,void 0),G(this,_o,e),G(this,ed,t)}addInteractivePolygon(t){let e=Jt(t);_(this,_o).interactivePolygons[e]=!0}addInteractivePolygonsForAllLocations(t){t||(t={});let e=t.excludeTypes||[],i=(t.locations||_(this,ed).venue.locations.slice()).filter((t=>!e.includes(t.type))),n={};for(let t=0,e=i.length;t<e;++t){let e=i[t].polygons;for(let t=0,i=e.length;t<i;++t){let i=e[t];n[i.id]||(n[i.id]=!0,this.addInteractivePolygon(i))}}}removeInteractivePolygon(t){let e=Jt(t);delete _(this,_o).interactivePolygons[e]}removeAllInteractivePolygons(){for(let t in _(this,_o).interactivePolygons)this.removeInteractivePolygon(t)}};h(n1,"InteractivePolygonsLayer"),ed=new WeakMap,_o=new WeakMap;var Kb=n1;P();var eM=gn(Qb(),1),xc=new Zi,QO=300,eR=30,r1=class{constructor(t,e){w(this,"mapView"),w(this,"core"),w(this,"blueDotManager"),w(this,"rendererDomElement"),w(this,"currentHover",null),w(this,"hoverLabel"),w(this,"hoverColor",new Ee("#cccccc")),w(this,"options",{disableHover:!1}),w(this,"blueDot"),w(this,"setBlueDotManager",h((t=>{this.blueDotManager=t}),"setBlueDotManager")),w(this,"touchCount",0),w(this,"onMouseMove",h((t=>{t.preventDefault(),this.calculateMouseCoordinates(t),("touch"!=t.pointerType||null==t.pointerType&&this.hasTouched)&&(this.doHoverEffect(),this.hoverLabel.setPosition(this.cursorPos.x,this.cursorPos.y))}),"onMouseMove")),w(this,"onTouchEnd",h((t=>{t.preventDefault(),this.onMouseUp(t.changedTouches[0])}),"onTouchEnd")),w(this,"onMouseUp",h((t=>{if("grabbing"===this.rendererDomElement.style.cursor&&(this.rendererDomElement.style.cursor="grab"),this.touchCount&&this.decrementTouches(t),t.target.parentNode!=this.core.container)return;let e=Math.sqrt(Math.pow(t.clientX-this.mouseDownStart.clientX,2)+Math.pow(t.clientY-this.mouseDownStart.clientY,2));if(Date.now()<this.mouseDownStart.time+QO&&e<=eR){this.calculateMouseCoordinates(t);let e=this.detectPolygonsUnderMouse(),i=this.getMouseMapPosition(),n={lat:NaN,lon:NaN};!isNaN(i.x)&&!isNaN(i.y)&&(n=this.mapView.currentMap.createCoordinateByXY(i.x,i.y)),this.core.onMapClicked({latitude:n.lat,longitude:n.lon},e.filter((t=>this.core.interactivePolygons[t])),this.checkMouseIntersectsBlueDot());for(let t=0,i=e.length;t<i;++t){let i=e[t];if(this.core.interactivePolygons[i]&&!this.core.onPolygonClicked(i))return}this.core.onNothingClicked()}else this.touchCount||(this.core.publish(this.core.currentInteractionEvent),this.core.currentInteractionEvent="")}),"onMouseUp")),w(this,"onMouseDown",h((t=>{"pointer"!==this.rendererDomElement.style.cursor&&(this.rendererDomElement.style.cursor="grabbing"),this.mouseDownStart={time:Date.now(),clientX:t.clientX,clientY:t.clientY},this.incrementTouches(t)}),"onMouseDown")),w(this,"onTouchStart",h((t=>{this.hasTouched=!0,1==t.touches.length?this.onMouseDown(t.touches[0]):this.mouseDownStart={time:0,clientX:0,clientY:0}}),"onTouchStart")),w(this,"incrementTouches",h((t=>{window.PointerEvent&&"touch"==t.pointerType&&(this.touchCount=(this.touchCount||0)+1,1===this.touchCount&&this.core.publish("user-hands-on"))}),"incrementTouches")),w(this,"decrementTouches",h((t=>{window.PointerEvent&&"touch"==t.pointerType&&(this.touchCount--,this.touchCount||this.core.publish("user-hands-off"))}),"decrementTouches")),w(this,"clearMouse",h((()=>{this.mouse.x=1/0,this.mouse.y=1/0}),"clearMouse")),w(this,"getMousePos",h((t=>{let e=this.core.container.getBoundingClientRect();return{x:(t.clientX-e.left)/(e.right-e.left)*this.core.canvasWidth,y:(t.clientY-e.top)/(e.bottom-e.top)*this.core.canvasHeight}}),"getMousePos")),w(this,"cursorPos",{x:0,y:0}),w(this,"mouse",{x:0,y:0}),w(this,"mouseDownStart",{time:0,clientX:0,clientY:0}),w(this,"hasTouched",!1),w(this,"calculateMouseCoordinates",h((t=>{this.cursorPos=this.getMousePos(t),this.mouse.x=this.cursorPos.x/this.core.canvasWidth*2-1,this.mouse.y=-this.cursorPos.y/this.core.canvasHeight*2+1}),"calculateMouseCoordinates")),w(this,"getMouseRayIntersects",h((t=>(xc.setFromCamera(this.mouse,this.core.cameraObject),Array.isArray(t)?xc.intersectObjects(t,!0):xc.intersectObject(t,!0))),"getMouseRayIntersects")),w(this,"detectPolygonsUnderMouse",h((()=>{let t=this.core.mapManager.mapObjects.get(this.mapView.currentMap.id),e=this.getMouseRayIntersects(t.hoverableMeshChildren).map((function(t){return t.object.name}));(0,eM.default)(e);let i=[];for(let t=0,n=e.length;t<n;++t){let n=e[t];n&&this.core.interactivePolygons[n]&&i.push(n)}return i}),"detectPolygonsUnderMouse")),w(this,"getMouseMapPosition",h((()=>{let t=this.getMouseRayIntersects(this.core.cameraPlane);if(t.length>0){let e=t[t.length-1],i=this.core.mapManager.mapObjects.get(this.mapView.currentMap.id);return{x:e.point.x+i.mapClass.width/2,y:-e.point.y+i.mapClass.height/2}}return{x:NaN,y:NaN}}),"getMouseMapPosition")),w(this,"checkMouseIntersectsBlueDot",h((()=>{if(!this.blueDotManager)return!1;let t=this.blueDotManager.getBlueDotForMap(this.mapView.currentMap);if(t){let e=new I,i=new I;t.updateMatrixWorld(),t.getWorldPosition(e),t.getWorldScale(i),i.divideScalar(2),i.setZ(0),e.sub(i);let n=this.core.canvasWidth/2,r=this.core.canvasHeight/2;this.core.cameraObject.updateProjectionMatrix(),this.core.cameraObject.updateMatrixWorld(!0),e.project(this.core.cameraObject);let s={x:e.x*n+n,y:-e.y*r+r},a=Math.pow(this.cursorPos.x-s.x,2),o=Math.pow(this.cursorPos.y-s.y,2);return Math.sqrt(a+o)<=23}return!1}),"checkMouseIntersectsBlueDot")),w(this,"doHoverEffect",h((()=>{if(this.options.disableHover)return;let t=this.detectPolygonsUnderMouse(),e=!1;for(let i=0,n=t.length;i<n;++i){let n=t[i];if(this.core.interactivePolygons[n]){if(n!=this.currentHover){this.currentHover&&(this.onPolygonHoverOut(this.currentHover),this.currentHover=null),this.core.highlightedPolygons[n]||(this.currentHover=n,this.onPolygonHoverOver(n));let t=this.core.textLabelsByPolygonId[Jt(n)];t&&t.showHoverLabel?this.hoverLabel.show(t):this.hoverLabel.hide()}"grab"===this.rendererDomElement.style.cursor&&(this.rendererDomElement.style.cursor="pointer"),e=!0;break}}0==e&&(this.currentHover&&(this.onPolygonHoverOut(this.currentHover),this.currentHover=null),"pointer"===this.rendererDomElement.style.cursor&&(this.rendererDomElement.style.cursor="grab"),this.hoverLabel.hide())}),"doHoverEffect")),w(this,"onPolygonHoverOut",h((t=>{let e=this.core.polygonMeshesById[t];if(!e)return;let i=!1;if(e._MIOriginalMaterial){let t=(e.material.length&&e.material[0]||e.material).color.getHex();this.hoverColor.getHex()===t&&(i=!0)}return i?(this.mapView.clearPolygonColor(t),!1):void 0}),"onPolygonHoverOut")),w(this,"onPolygonHoverOver",h((t=>{let e=Jt(t);if(this.core.polygonMeshesById[e])return this.mapView.setPolygonColor(t,`#${this.hoverColor.getHexString()}`),!1}),"onPolygonHoverOver")),w(this,"setHoverColor",h((t=>{this.hoverColor=new Ee(t)}),"setHoverColor")),this.mapView=t,this.core=e;let i=this.core.renderer.domElement();this.core.container.style.touchAction="auto",this.rendererDomElement=i,this.hoverLabel=new hs(this.core.container),this.core.on(6,this.clearMouse),this.core.on(0,(()=>{this.currentHover&&(this.onPolygonHoverOut(this.currentHover),this.currentHover=null),this.hoverLabel.hovering&&this.hoverLabel.hide()})),window.PointerEvent?(i.addEventListener("pointerdown",this.onMouseDown,!1),i.addEventListener("pointermove",this.onMouseMove,!1),i.addEventListener("pointerup",this.onMouseUp,!1),i.addEventListener("pointercancel",this.onMouseUp,!1)):(i.addEventListener("mousemove",this.onMouseMove,!1),i.addEventListener("mousedown",this.onMouseDown,!1),i.addEventListener("mouseup",this.onMouseUp,!1),i.addEventListener("mouseleave",this.onMouseMove,!1),i.addEventListener("touchstart",this.onTouchStart,!1),i.addEventListener("touchend",this.onTouchEnd,!1),i.addEventListener("touchcancel",this.onTouchEnd,!1))}destroy(){window.PointerEvent?(this.rendererDomElement.removeEventListener("pointerdown",this.onMouseDown,!1),this.rendererDomElement.removeEventListener("pointermove",this.onMouseMove,!1),this.rendererDomElement.removeEventListener("pointerup",this.onMouseUp,!1),this.rendererDomElement.removeEventListener("pointercancel",this.onMouseUp,!1)):(this.rendererDomElement.removeEventListener("mousemove",this.onMouseMove,!1),this.rendererDomElement.removeEventListener("mousedown",this.onMouseDown,!1),this.rendererDomElement.removeEventListener("mouseup",this.onMouseUp,!1),this.rendererDomElement.removeEventListener("mouseleave",this.onMouseMove,!1),this.rendererDomElement.removeEventListener("touchstart",this.onTouchStart,!1),this.rendererDomElement.removeEventListener("touchend",this.onTouchEnd,!1),this.rendererDomElement.removeEventListener("touchcancel",this.onTouchEnd,!1))}};h(r1,"EventSystemLayer");var tM=r1;P(),P(),P();var _c,td,tR=h((t=>{let e=[];return t.forEach(((i,n)=>{n>0&&t[n-1].map.id===i.map.id?e[e.length-1].push(i):e.push([i])})),e}),"pathToPathSegments"),Wy=h(((t,e,i)=>{tR(t.path).forEach((t=>{t.length>0&&t[0].map.id===e.currentMap.id&&e.drawPath(t,be({},i))}))}),"drawCurrentMapPathSegments"),nR="white",nM=h(((t=1)=>`<div style="width: ${32*t}px; height: ${32*t}px;">${mo.get("journey-departure")}<div>`),"generateDepartureMarker"),iM=h(((t=1)=>`<div style="width: ${32*t}px; height: ${32*t}px;">${mo.get("journey-destination")}</div>`),"generateDestinationMarker"),iR=h((t=>{let e=null==t.direction?t.type:`${t.type}-${t.direction}`;return`<div style="width: 40px;\n height: 40px;\n\t\t\tcursor: pointer;\n border-radius: 50%;\n\t\t\tbackground: green;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;">\n <svg\n height="16"\n viewBox="0 0 36 36"\n width="16"\n >\n <g fill="${nR}">\n ${mo.get(e)}\n </g>\n </svg><div>`}),"defaultConnectionFn"),s1=class{constructor(t,e=iR,i,n){var r,s;H(this,_c,void 0),w(this,"tooltip"),w(this,"mapId"),w(this,"toMapId"),H(this,td,void 0),w(this,"handleClick",h((()=>{_(this,_c).setMap(this.toMapId)}),"handleClick")),w(this,"determineDirection",h((()=>{let{mapObjects:t}=_(this,td);return t.get(this.mapId).mapClass.elevation<t.get(this.toMapId).mapClass.elevation?"up":"down"}),"determineDirection")),this.mapId=t.node.map.id,this.toMapId="TakeVortex"===(null==(r=t.action)?void 0:r.type)?t.action.toMap.id:t.action.fromMap.id,G(this,_c,i),G(this,td,n);let a=t.atLocation.type,o=this.determineDirection(),l=e({type:a,direction:o,toMapName:t.action.toMap.name,icon:mo.get(null==o?a:`${a}-${o}`),isEntering:"TakeVortex"===(null==(s=t.action)?void 0:s.type)});this.tooltip=i.createTooltip(t.node,l,{collisionRank:4,padding:0,defaultAnchorType:"top"}),this.tooltip.contentEl.addEventListener("click",this.handleClick),this.tooltip.updateDimensions()}destroy(){var t;null==(t=this.tooltip)||t.containerEl.removeEventListener("click",this.handleClick),_(this,_c).removeTooltip(this.tooltip),this.tooltip=null}};h(s1,"Connection"),_c=new WeakMap,td=new WeakMap;var a1,$t,bo,Fn,kr,bc,cn,ga,Mo,_s,nd,wo,id,rd,rR={displayArrowsOnPath:!0,nearRadius:1.8,farRadius:5.4,color:"#ff834c",flattenPath:!0},sR={color:"#f5c7b3",displayArrowsOnPath:!1,flattenPath:!0,nearRadius:1.6,farRadius:4.8,showPulse:!1,animateDrawing:!1},rM=3,ma=class{constructor(t,e={},i,n){var r,s;w(this,"distance",0),w(this,"accessible",!1),H(this,a1,{}),H(this,$t,void 0),H(this,bo,void 0),H(this,Fn,void 0),H(this,kr,void 0),H(this,bc,void 0),H(this,cn,{}),H(this,ga,[]),H(this,Mo,void 0),H(this,_s,[]),w(this,"setStep",h((t=>{t!==_(this,bc)&&_(this,kr)&&(t<0||t>_(this,kr).length||(_(this,rd).call(this),_(this,id).call(this),G(this,bc,t),G(this,Fn,_(this,kr)[t]),_(this,wo).call(this),_(this,nd).call(this)))}),"setStep")),H(this,nd,h((()=>{let t=_(this,Fn).path[_(this,Fn).path.length-1],e=_(this,Fn).path[0];"string"==typeof _(this,cn).polygonHighlightColor&&(e.locations.forEach((t=>{t.polygons.forEach((t=>{_(this,$t).setPolygonColor(t,_(this,cn).polygonHighlightColor)}))})),t.locations.forEach((t=>{t.polygons.forEach((t=>{_(this,$t).setPolygonColor(t,_(this,cn).polygonHighlightColor)}))})));let i=(_(this,kr)||[_(this,Fn)]).map((t=>t.path[t.path.length-1]));null==i||i.forEach((t=>{let e=iM(_(this,cn).scale);"function"==typeof _(this,cn).destinationMarkerTemplate&&(_(this,_s)||G(this,_s,[]),_(this,_s).push(_(this,$t).createMarker(t,_(this,cn).destinationMarkerTemplate({icon:e,location:t.locations[0]}),{rank:4,anchor:1})))}));let n=nM(_(this,cn).scale);"function"==typeof _(this,cn).departureMarkerTemplate&&G(this,Mo,_(this,$t).createMarker(e,_(this,cn).departureMarkerTemplate({icon:n}),{rank:4,anchor:1})),_(this,$t).tryRendering()}),"#updateForJourneyStartOrStepChange")),H(this,wo,h((()=>{var t;_(this,$t).removeAllPaths(),this.isMultiFloor&&(_(this,ga).forEach((t=>t.destroy())),G(this,ga,[]),G(this,ga,_(this,Fn).instructions.filter((t=>{var e,i;return("TakeVortex"===(null==(e=t.action)?void 0:e.type)||"ExitVortex"===(null==(i=t.action)?void 0:i.type))&&t.node.map.id===_(this,$t).currentMap.id})).map((t=>new s1(t,_(this,cn).connectionTemplate,_(this,$t),_(this,bo)))).filter((t=>t)))),null==(t=_(this,kr))||t.forEach((t=>{t!==_(this,Fn)&&Wy(t,_(this,$t),_(this,cn).inactivePathOptions)})),Wy(_(this,Fn),_(this,$t),_(this,cn).pathOptions),_(this,$t).tryRendering()}),"#updateForMapChange")),H(this,id,h((()=>{if(!1!==_(this,cn).polygonHighlightColor){let t=_(this,Fn).path[_(this,Fn).path.length-1];_(this,Fn).path[0].locations.forEach((t=>{t.polygons.forEach((t=>{_(this,$t).clearPolygonColor(t.id)}))})),t.locations.forEach((t=>{t.polygons.forEach((t=>{_(this,$t).clearPolygonColor(t.id)}))}))}}),"#unhighlightPolygons")),H(this,rd,h((()=>{_(this,_s).length&&_(this,_s).forEach((t=>{_(this,$t).removeMarker(t)})),G(this,_s,[]),null!=_(this,Mo)&&_(this,$t).removeMarker(_(this,Mo)),G(this,Mo,void 0),_(this,ga).forEach((t=>t.destroy())),G(this,ga,[])}),"#removeAllMarkers")),G(this,cn,Ue(be({scale:1,polygonHighlightColor:"#7babc8",destinationMarkerTemplate:()=>iM(),departureMarkerTemplate:()=>nM()},e),{pathOptions:be(be({},rR),null==e?void 0:e.pathOptions),inactivePathOptions:be(be({},sR),null==e?void 0:e.inactivePathOptions)})),null!=(r=null==e?void 0:e.pathOptions)&&r.farRadius||(_(this,cn).pathOptions.farRadius=_(this,cn).pathOptions.nearRadius*rM),null!=(s=null==e?void 0:e.inactivePathOptions)&&s.farRadius||(_(this,cn).inactivePathOptions.farRadius=_(this,cn).inactivePathOptions.nearRadius*rM),G(this,$t,i),Array.isArray(t)?(G(this,kr,t),G(this,Fn,_(this,kr)[0]),G(this,bc,0),_(this,$t).currentPath=t[0].path):(G(this,Fn,t),_(this,$t).currentPath=t.path),G(this,bo,n),_(this,bo).on("set-map",_(this,wo)),_(this,wo).call(this),_(this,nd).call(this)}get isMultiFloor(){return this.mapIdsInvolvedInJourney.length>1}get mapIdsInvolvedInJourney(){let t={};_(this,Fn).path.forEach((e=>{t[e.map.id]=!0}));let e=Object.keys(t);return _(this,a1).mapsInvolvedInJourney=e,e}static create(t,e,i,n){return null!=ma.instance&&ma.instance.destroy(),ma.instance=new ma(t,e,i,n),ma.instance}destroy(){_(this,id).call(this),_(this,rd).call(this),_(this,$t).removeAllPaths(),_(this,$t).currentPath=void 0,_(this,bo).off("set-map",_(this,wo)),ma.instance=null}},Dr=ma;h(Dr,"Journey"),a1=new WeakMap,$t=new WeakMap,bo=new WeakMap,Fn=new WeakMap,kr=new WeakMap,bc=new WeakMap,cn=new WeakMap,ga=new WeakMap,Mo=new WeakMap,_s=new WeakMap,nd=new WeakMap,wo=new WeakMap,id=new WeakMap,rd=new WeakMap,w(Dr,"instance",null);var sd,ad,o1=class{constructor(t,e){H(this,sd,void 0),H(this,ad,void 0),G(this,sd,t),G(this,ad,e)}draw(t,e){return Dr.create(t,e,_(this,sd),_(this,ad).mapManager)}setStep(t){null!=Dr.instance&&Dr.instance.setStep(t)}clear(){null!=Dr.instance&&Dr.instance.destroy()}};h(o1,"JourneyLayer"),sd=new WeakMap,ad=new WeakMap;var sM=o1;P();var bs,Wt,c1,aM,od,Xy,l1=class{constructor(t,e){H(this,c1),H(this,od),H(this,bs,void 0),H(this,Wt,void 0),G(this,bs,t),G(this,Wt,e)}setPolygonColor(t,e){if(void 0===_(this,Wt).polygonMeshesById[t.id]){let i=mr(t,_(this,bs).venue.polygons);return null!=i&&null!=i.map.id&&null!=_(this,Wt).mapObjects.get(i.map.id).object?void at(this,c1,aM).call(this,i,e):void ge.error("Cannot set color of polygon "+i.id+", could be bad polygon or data mismatch.")}at(this,od,Xy).call(this,t,e)}clearPolygonColor(t){var e,i,n;let r=t;"string"==typeof t&&(r=null==(e=_(this,Wt).venue._polygonsById)?void 0:e[t]);let s=_(this,Wt).polygonMeshesById[r.id];if(s){if(s._MIOriginalMaterial&&((s.material.length?s.material:[s.material]).forEach((t=>Js(t))),s.material=s._MIOriginalMaterial,delete s._MIOriginalMaterial),delete _(this,Wt).highlightedPolygons[r.id],_(this,Wt).textLabelsByPolygonId[r.id]&&_(this,Wt).textLabelsByPolygonId[r.id].clearColor(),"SINGLE_GEOMETRY"===(null==(i=_(this,Wt).loadOptions)?void 0:i.mapRenderStrategy)){let t=null==(n=_(this,Wt).mapObjects.get(r.map.id))?void 0:n.object;t&&t.remove(s)}_(this,bs).tryRendering()}}clearAllPolygonColors(){let t=Object.keys(_(this,Wt).highlightedPolygons);for(let e=0,i=t.length;e<i;++e){let i=t[e];_(this,bs).clearPolygonColor(_(this,Wt).highlightedPolygons[i])}_(this,Wt).highlightedPolygons={},_(this,bs).tryRendering(),_(this,Wt).renderer.disposeOfRenderLists()}};h(l1,"PolygonColorsLayer"),bs=new WeakMap,Wt=new WeakMap,c1=new WeakSet,aM=h((function(t,e){_(this,Wt).mapObjects.get(t.map.id).load().then((()=>{_(this,Wt).mapObjects.get(t.map.id).elements&&_(this,Wt).mapObjects.get(t.map.id).loadPolygonNow(t.id),at(this,od,Xy).call(this,t,e)}))}),"#setPolygonColorLater"),od=new WeakSet,Xy=h((function(t,e){var i,n;let r=_(this,Wt).polygonMeshesById[t.id];if(null!=r){_(this,Wt).highlightedPolygons[t.id]=t.id,r._MIOriginalMaterial||(r._MIOriginalMaterial=r.material.length?[...r.material]:r.material);let s=(r.material.length?r.material:[r.material]).map((t=>{let i=t.clone();return i.color.set(e||"#4ca1fc"),i}));if(1===s.length?r.material=s[0]:r.material=s,"SINGLE_GEOMETRY"===(null==(i=_(this,Wt).loadOptions)?void 0:i.mapRenderStrategy)){let e=null==(n=_(this,Wt).mapObjects.get(t.map.id))?void 0:n.object;e&&e.add(r)}_(this,bs).tryRendering()}else ge.error("Cannot set color of polygon "+t.id+", could be bad polygon or data mismatch.")}),"#setPolygonColorNow");var oM=l1;P(),P();var lM="varying vec2 vUV;\n\nvoid main() {\n vUV = uv;\n\n gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.0);\n}",cM='precision mediump float;\n\n// The following uniforms are documented in Mappedin.ClosedPolygonManager.js\nuniform vec3 stripe1_color;\nuniform vec3 stripe2_color;\nuniform vec2 surface_dimensions;\nuniform float stripe1_width;\nuniform float stripe1_proportion;\nuniform float stripes_direction; \n\nvarying vec2 vUV;\n\nvec4 stripes(vec2 coord) {\n vec4 color1 = vec4(stripe1_color, 1.0);\n vec4 color2 = vec4(stripe2_color, 1.0);\n\n // Transform the uv to surface coordinates in world space units\n vec2 coord_absolute = coord * surface_dimensions;\n \n // Compute the width of a single texture "tile"\n // For example, if the first stripe is 10 units and it forms 25% of the tile, we know that the tile itself is 40 units wide\n float tile_width = stripe1_width / stripe1_proportion;\n\n // Lerp the x and y coordinates of the component using the "direction" parameter; clever way of "rotating" the stripe without using trig functions, courtesy of https://andreashackel.de/tech-art/stripes-shader-1/\n float stripe_coord = mix(coord_absolute.x, coord_absolute.y, stripes_direction);\n\n // Normalize the above "coordinate" to obtain its position within a single texture "tile"\n float stripe_coord_normalized = mod(stripe_coord, tile_width) / tile_width;\n\n // Decide which of the two stripes this coordinate belongs to!\n return mix(color1, color2, step(1. - stripe1_proportion, stripe_coord_normalized));\n}\n\nvoid main() { \n gl_FragColor = vec4(stripes(vUV).rgb, 1);\n}\n';function lR(t){let e=new xn(1,1,1,1),i=500,n=500,r=new I(0,0,0),s=0;if(null!=t&&null!=t.boundingBox&&null!=t.boundingBox.min&&null!=t.boundingBox.max){let e=new At(t.boundingBox.min,t.boundingBox.max),a=e.getSize(new I);i=a.x,n=a.y,e.getCenter(r),s=(isNaN(e.max.z)?0:e.max.z)+10}let a=new pn({vertexShader:lM,fragmentShader:cM,uniforms:{stripe1_color:{type:"c",value:new Ee(.91372549019,.91372549019,.91372549019)},stripe2_color:{type:"c",value:new Ee(.80784313725,.80784313725,.80784313725)},stripe1_width:{type:"f",value:7},stripe1_proportion:{type:"f",value:.3},stripes_direction:{type:"f",value:2/3},surface_dimensions:{type:"v2",value:new de(i,n)}}});a.transparent=!0,a.blending=rf,a.depthTest=!1,a.stencilWrite=!0,a.stencilFunc=lx,a.stencilFuncMask=255,a.stencilRef=1,a.stencilFail=Xr,a.stencilZFail=Xr,a.stencilZPass=Xr;let o=new lt(e,a);return o.position.set(r.x,r.y,s),o.rotation.set(0,0,0),o.scale.set(i,n,1),o}function uM(t){null!=t&&Js(t.material)}function hM(t){return t.stencilWrite=!0,t.stencilFunc=Gg,t.stencilRef=1,t.stencilFuncMask=255,t.stencilFail=Xr,t.stencilZFail=Xr,t.stencilZPass=ox,t}function cR(t,e,i){null==e||null==i||(null!=t&&i.remove(t),i.add(e))}function uR(t,e){return Math.abs(t-e)<Number.EPSILON}h(lR,"makeStencilSheet"),h(uM,"destroyStencilSheet"),h(hM,"enableStencilTestingAndConfigure"),h(cR,"replaceObjectInScene"),h(uR,"almostEqual");var u1=class{constructor({scene:t,getPolygonMeshFromId:e,tryRendering:i}){this.scene=t,this.getPolygonMeshFromId=e,this.tryRendering=i,this.stencilSheet=null,this.polygonsMarkedAsClosed={}}onMapChanged(t){t.load().then((()=>{this.currentMap=t,uM(this.stencilSheet);let e=lR(t);cR(this.stencilSheet,e,this.scene),this.stencilSheet=e,this.tryRendering()}))}dispose(){this.markAllPolygonsAsOpen(),uM(this.stencilSheet)}markPolygonAsClosed(t){if("string"!=typeof t||null!=this.polygonsMarkedAsClosed[t])return;let e=this.getPolygonMeshFromId(t);if(null==e||null==e.material)return;let i=e.geometry;if(ge.assert(i instanceof wt),ge.assert(null==i.index),e.material.length)return;let n={};n.geometryGroups=[...i.groups],i.clearGroups();let r=e.material,s=hM(e.material.clone());e.material=[r,s],e._MIOriginalMaterial&&(e._MIOriginalMaterial.length||(e._MIOriginalMaterial=[e._MIOriginalMaterial,hM(e._MIOriginalMaterial.clone())]));let a=i.getAttribute("normal");ge.assert(3===a.itemSize),ge.assert(a.array.length/3===a.count),ge.assert(a.count%3==0);let o=new I(0,0,1);for(let t=0;t<a.count;t+=3){let e=(a.getX(t)+a.getX(t+1)+a.getX(t+2))/3,n=(a.getY(t)+a.getY(t+1)+a.getY(t+2))/3,r=(a.getZ(t)+a.getZ(t+1)+a.getZ(t+2))/3;uR(new I(e,n,r).normalize().dot(o),1)?i.addGroup(t,3,1):i.addGroup(t,3,0)}this.tryRendering(),this.polygonsMarkedAsClosed[t]=n}markPolygonAsOpen(t){if("string"!=typeof t||null==this.polygonsMarkedAsClosed[t])return;let e=this.polygonsMarkedAsClosed[t],i=this.getPolygonMeshFromId(t),n=i.geometry;n.clearGroups(),e.geometryGroups.forEach((({start:t,count:e,materialIndex:i})=>n.addGroup(t,e,i))),Js(i.material[1]),i.material=i.material[0],i._MIOriginalMaterial&&i._MIOriginalMaterial.length&&(i._MIOriginalMaterial=i._MIOriginalMaterial[0]),delete this.polygonsMarkedAsClosed[t],this.tryRendering()}markAllPolygonsAsOpen(){for(let t in this.polygonsMarkedAsClosed)this.markPolygonAsOpen(t)}};h(u1,"ClosedPolygonManager");var ya,Br,Ms,dM=u1,h1=class{constructor(t,e){H(this,ya,void 0),H(this,Br,void 0),H(this,Ms,void 0),G(this,ya,t),G(this,Br,e),G(this,Ms,new dM({scene:_(this,Br).scene,tryRendering:()=>_(this,ya).tryRendering(),getPolygonMeshFromId:t=>_(this,Br).polygonMeshesById[t]})),_(this,Br).mapManager.addPersistentSetMapCallback((()=>{_(this,Ms).onMapChanged(_(this,Br).mapManager.currentMap)}))}updateClosedStateForPolygon(t){if(null==t||null==t.polygon)return;let e,i=Jt(t.polygon);if("string"!=typeof i)return void ge.error(`Invalid or no polygon provided. Expecting a MappedinPolygon or a string id. Received: ${t.polygon} of type ${typeof t.polygon}`);if(null!=t.closed)e=!!t.closed;else{if(null==t.open)return;e=!t.open}let n=mr(i,_(this,ya).venue.polygons).map.id||_(this,ya).currentMap;_(this,Br).mapManager.mapObjects.get(n).addPendingMapLoadedTask(`Set closed status of polygon ${i} to ${e}`,(()=>{e?_(this,Ms).markPolygonAsClosed(i):_(this,Ms).markPolygonAsOpen(i)}))}openAllPolygons(){[..._(this,Br).mapManager.mapObjects.values()].reduce(((t,e)=>(t.set(e,_(this,ya).venue.polygons.filter((t=>t.map===e.id))),t)),new Map).forEach(((t,e)=>{e.addPendingMapLoadedTask(`Open all polygons belonging to map ${e.id}`,(()=>t.forEach((t=>_(this,Ms).markPolygonAsOpen(t.id)))))}))}destroy(){_(this,Ms).dispose()}};h(h1,"PolygonStatesLayer"),ya=new WeakMap,Br=new WeakMap,Ms=new WeakMap;var pM=h1;P(),P(),"object"!=typeof globalThis&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var u6=gn(io(),1);P(),rt.prototype.destroy=function(){for(let t=this.children.length-1;t>=0;t--)this.children[t].destroy();this.geometry&&(this.geometry.dispose(),this.geometry=void 0),this.parent&&this.parent.remove(this),this.texture&&(this.texture.dispose(),this.texture=void 0),Array.isArray(this.material)?this.material.forEach((function(t){Js(t)})):void 0!==this.material&&Js(this.material),this.material=void 0},P(),P();var hR=h((function(t,e,i){this.touch=t,this.camera=e,this.cameraPlane=i,this.viewCoordinate={x:t.x,y:t.y},this.camera.updateMatrixWorld(),this.camera.updateMatrix(),this.snapHolderMatrix=this.camera.matrixWorld.clone(),this.snapCamera=this.camera.clone(),this.snapshotCameraState=function(){this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraPosition=this.camera.position;let t=new I(this.viewCoordinate.x,this.viewCoordinate.y,1);this.raycaster=this.raycaster||new Zi,this.raycaster.setFromCamera(t,this.snapCamera);let e=this.raycaster.intersectObject(this.cameraPlane,!1);this.worldCoordinate=e&&e[0]&&e[0].point,this.snapshotted=!0},this.updateAnchorState=function(t,e){this.camera=t,this.snapCamera=t.clone(),this.snapHolderMatrix=t.matrixWorld.clone(),this.updateViewCoordinate(e),this.snapshotCameraState()},this.updateViewCoordinate=function(t){this.viewCoordinate={x:t.x,y:t.y}},this.reUnproject=function(){let t=new I(this.viewCoordinate.x,this.viewCoordinate.y,1);this.raycaster.setFromCamera(t,this.snapCamera);let e=this.raycaster.intersectObject(this.cameraPlane,!1)[0];if(e)return e.point},this.snapshotCameraState()}),"TouchAnchor"),Yy=hR;function fM(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function mM(t,e){return Math.sqrt(zt(e.y-t.y,2)+zt(e.x-t.x,2))}function gM(t,e){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}P(),h(fM,"angle"),h(mM,"distance"),h(gM,"average");var dR=h((function(t,e){this.input1=t,this.input2=e,this.lastAngle=fM(t,e),this.lastDistance=mM(t,e),this.first=t,this.second=e,this.update=function(t,e){let i=mM(t,e);this.input1=t,this.input2=e;let n=fM(t,e);this.lastAngle=n,this.lastDistance=i,this.first=gM(this.first,t),this.second=gM(this.second,e)}}),"InputSet"),yM=dR;P();var vM=gn(io(),1),Mc={SINGLE_FLOOR:"single_floor",MULTI_FLOOR:"multi_floor"},pR=Math.PI/2,fR=1e3,mR=0,gR=30,yR=3,vR=900,xR=vM.default.Easing.Quadratic.InOut,ld={TOP:"top",BOTTOM:"bottom"},cd={DOWN:"down",UP:"up"},d1=class{constructor(t,e,i,n){w(this,"_focusMapsStart",ld.TOP),w(this,"_focusMapsDir",cd.DOWN),w(this,"_focusMapsLen",yR),w(this,"_focusAnimCurve",xR),w(this,"_focusAnimDuration",vR),w(this,"rotationAxis",new I(1,0,0)),w(this,"mapBoundingBoxes",[]),w(this,"_helperBoundingBoxes",[]),w(this,"mapAxesHelpers",[]),this.mapView=t,this.object=e,this.options=n,this.padding=null==n.padding?t.cachedPadding:n.padding,this.rotation=null==n.rotation?mR:n.rotation,this.maps=i,this.debug=n.debug,this.mapSpacing=null==n.mapSpacing?fR:parseInt(n.mapSpacing,10),this.mapView.setViewState(Mc.MULTI_FLOOR),this.object.children.forEach((t=>t.parent.remove(t))),this.mapTilt=(null==n.mapTilt?gR:n.mapTilt)*Math.PI/180,this.mapView.controls.setTilt(pR),this.positionMaps(i),this.addMaps(this.maps),this.resize=$s(this.resize.bind(this),300),this.focusOnMaps=this.focusOnMaps.bind(this),this.debug&&(this.addMapBoundingBoxes(),this.addAxesHelpers())}get viewPortHeight(){return this.mapView.canvasHeight-this.padding.top-this.padding.bottom}get viewPortWidth(){return this.mapView.canvasWidth-this.padding.left-this.padding.right}positionMaps(){let t=this.maps.map(((t,e)=>{let i=t.object;i.rotation.z=this.rotation*Math.PI/180;let n=new At;return n.setFromObject(i),i.rotation.z=0,n})),e=0;this.maps.forEach(((i,n)=>{let r=i.object;r.setRotationFromAxisAngle(this.rotationAxis,this.mapTilt);let s=t[n].min.y*Math.sin(this.mapTilt),a=t[n].max.y*Math.sin(this.mapTilt);e-=Math.abs(a),r.position.z=e,e-=Math.abs(s),e-=this.mapSpacing}));let i=Eu(this.maps),n=(i.max.z-i.min.z)/2;this.maps.forEach(((t,e)=>{let i=t.object;i.position.z+=n,i.rotation.z=this.rotation*Math.PI/180})),this.maps.forEach(((t,e)=>{if(!0===t.connection){let[e,i]=t.connectionNodes,n=this.mapView.convertTo3DMapPosition(e),r=this.mapView.convertTo3DMapPosition(i),s=t.object,a=this.maps.find((t=>t.id===e.map)).object,o=this.maps.find((t=>t.id===i.map)).object;a.updateMatrixWorld(),o.updateMatrixWorld(),n.applyMatrix4((new We).extractRotation(a.matrix)),r.applyMatrix4((new We).extractRotation(o.matrix)),n.z+=a.position.z,r.z+=o.position.z;let l=r.clone().sub(n),h=l.length();l=l.normalize().multiplyScalar(.5*h);let u=n.clone().add(l);s.rotation.z=0,s.position.set(u.x,u.y,u.z),s.renderOrder=1}}))}addMaps(t){t.forEach((t=>{this.object.add(t.object),t.addMarkers&&t.addMarkers()}))}removeMaps(){this.maps.forEach((t=>{t.object.position.set(0,0,0),t.object.rotation.set(0,0,0),t.removeMarkers&&t.removeMarkers(),t.object.parent&&t.object.parent.remove(t.object)}))}addMapBoundingBoxes(){let t=[16711680,65280,255,16711935,16776960,65535];this.maps.forEach(((e,i)=>{let n=e.object,r=(new At).setFromObject(n),s=new Ha(r,t[i]);this.object.add(s),this.mapBoundingBoxes.push(s)}))}removeMapBoundingBoxes(){this.mapBoundingBoxes.forEach(((t,e)=>{t.parent&&t.parent.remove(t)}))}removeHelperBoundingBoxes(){this._helperBoundingBoxes.forEach(((t,e)=>{t.parent&&t.parent.remove(t)}))}addAxesHelpers(){let t=new Pl(5e3);this.object.add(t),this.maps.forEach(((t,e)=>{let i=t.object,n=new Pl(1e3);i.add(n),this.mapAxesHelpers.push(n)}))}removeAxesHelpers(){this.mapAxesHelpers.forEach(((t,e)=>{t.parent&&t.parent.remove(t)}))}get mapTiltDegrees(){return 180*this.mapTilt/Math.PI}set mapTiltDegrees(t){this.mapTilt=t*Math.PI/180,this.positionMaps(),this.debug&&(this.removeMapBoundingBoxes(),this.addMapBoundingBoxes())}get projections(){return Lx({maps:this.maps,width:this.mapView.canvasWidth,height:this.mapView.canvasHeight,camera:this.mapView.controls.camera})}tiltMaps(t){this.maps.forEach(((e,i)=>{e.object.setRotationFromAxisAngle(this.rotationAxis,t)}))}focusOnMaps({start:t=this._focusMapsStart,len:e=this._focusMapsLen,dir:i=this._focusMapsDir,mapIndices:n,duration:r=this._focusAnimDuration,curve:s=this._focusAnimCurve}={}){return t===ld.TOP?i=cd.DOWN:t===ld.BOTTOM&&(i=cd.UP),this._focusMapsStart=t,this._focusMapsLen=e,this._focusMapsDir=i,this._focusAnimDuration=r,this._focusAnimCurve=s,new Promise((a=>{let o=n?this.getMapsByIndices(n):this.getFocusMaps(t,i,e),l=Eu(this.maps,this.mapSpacing),h=l.max.z-l.min.z,u=Eu(o,this.mapSpacing);u.min.setX(l.min.x),u.max.setX(l.max.x),this._focusBox=u,this._scrollWindow=u.max.z-u.min.z;let c=u.max.x-u.min.x,d=u.max.z-u.min.z,p=-h/2+d/2,m=+h/2-d/2,f=u.clone(),g=this.mapView.canvasWidth,v=this.mapView.canvasHeight;if(this.padding.top+this.padding.bottom<v){let t=v/(v-this.padding.top);f.max.z=u.min.z+d*t;let e=d/2*t-d/2;m+=e,p+=e;let i=v/(v-this.padding.bottom);f.min.z=u.max.z-d*i;let n=d/2*i-d/2;m-=n,p-=n}else ge.warn("top + bottom padding cannot exceed canvas height, ignoring");if(this.padding.left+this.padding.right<g){let t=g/(g-this.padding.left);f.min.x=u.max.x-c*t;let e=g/(g-this.padding.right);f.max.x=u.min.x+c*e}else ge.warn("left + right padding cannot exceed canvas width, ignoring");let y=f.max.x-f.min.x,_=f.max.z-f.min.z,x=f.min.x+y/2,b=f.min.z+_/2,w=this.mapView.controls.camera.fov;if(this.debug){this.removeHelperBoundingBoxes();let t=new Ha(u,16711680);this.object.add(t),this._helperBoundingBoxes.push(t);let e=new Ha(f,16776960);this.object.add(e),this._helperBoundingBoxes.push(e)}this.mapView.controls.minPedestal=p,this.mapView.controls.maxPedestal=m;let M=e2(f,_,w),E=e2(f,y,w*this.mapView.controls.camera.aspect),T=Math.max(E,M);this.mapView.controls.expandZoomLimits(T);let S={zoom:T,rotation:0,position:{x:x,y:0,z:b}},q=this.mapView.controls.animateCamera(S,r,s,(()=>{this.tween=q,a(this.tween)}))}))}getFocusMaps(t,e,i){let n=this.maps.slice(0);return i<this.maps.length&&(t===ld.TOP?n=n.slice(0,i):t===ld.BOTTOM?n=n.slice(-i):"number"==typeof t&&(e===cd.DOWN?n=n.slice(t,t+i):e===cd.UP&&(n=n.slice(Math.max(t+1-i,0),t+1)))),n}getFocusBox(){let t=Eu(this.maps,this.mapSpacing),e=t.max.z-t.min.z,i=this._focusBox.clone(),n=this._focusBox.max.z-this._focusBox.min.z,r=t.min.z+n/2,s=t.max.z-n/2,a=(this.mapView.controls.getPedestal()-r)/(s-r);return i.min.z=t.min.z+a*(e-n),i.max.z=t.min.z+n+a*(e-n),i}getVisibleMaps(){let t=this.getFocusBox();return this.maps.filter((e=>t.containsBox(Xa(e.object))))}getVisibleMapIds(){return this.getVisibleMaps().map((t=>t.id))}getVisibleMapIndices(){let t=this.getFocusBox(),e=[];for(let i=0;i<this.maps.length;i++){let n=this.maps[i];t.containsBox(Xa(n.object))&&e.push(i)}return e}getMapsByIndices(t){return this.maps.filter(((e,i)=>t.includes(i)))}get bottomMapVisible(){let t=this.maps[this.maps.length-1];return this.getVisibleMaps().includes(t)}get topMapVisible(){let t=this.maps[0];return this.getVisibleMaps().includes(t)}scrollMapsUp(){let t,e=this.getVisibleMapIndices()[0];if(e>0){let i=e-1;return t=[...new Array(this._focusMapsLen)].map(((t,e)=>i+e)),this.focusOnMaps({mapIndices:t})}return Promise.resolve()}scrollMapsDown(){let t,e=this.getVisibleMapIndices(),i=e[e.length-1];if(i<this.maps.length-1){let e=i+1;return t=[...new Array(this._focusMapsLen)].map(((t,i)=>e-i)).reverse(),this.focusOnMaps({mapIndices:t})}return Promise.resolve()}resize(){this.focusOnMaps()}destroy(){this.removeMaps(),this.debug&&(this.removeMapBoundingBoxes(),this.removeHelperBoundingBoxes()),this.mapView.setViewState(Mc.SINGLE_FLOOR),this.mapView.controls.setPosition(0,0),this.mapView.controls.setPedestal(0)}};h(d1,"MultiFloorView");var xM=d1;function wc(t,e,i){null==e&&(e=t.g,i=t.b,t=t.r);let n=0,r=t;e>t&&(n=1,r=e),i>e&&i>t&&(n=2,r=i);let s=t;e<t&&(s=e),i<e&&i<t&&(s=i);let a=0,o=0,l=0;return r!==s&&(a=0===n?60/360*(e-i)/(r-s):1===n?60/360*(2+(i-t)/(r-s)):60/360*(4+(t-e)/(r-s)),o=0===r?0:(r-s)/r),l=r,[a,o,l]}function ws(t,e,i){let n=360*t%360/60,r=0|n,s=n-r,a=i*(1-e),o=i*(1-e*s),l=i*(1-e*(1-s)),h=0,u=0,c=0;switch(r){case 0:h=i,u=l,c=a;break;case 1:h=o,u=i,c=a;break;case 2:h=a,u=i,c=l;break;case 3:h=a,u=o,c=i;break;case 4:h=l,u=a,c=i;break;case 5:h=i,u=a,c=o}return new Ee(h,u,c)}P(),P(),h(wc,"rgb2hsv"),h(ws,"hsv2rgb");var _M=16,ud=class{constructor({minimum:t,maximum:e,step:i,current:n,onValueChanged:r}){this._minimum=t,this._maximum=e,this._step=i,this._onValueChanged=r,this._element=document.createElement("input"),this._element.type="range",this._element.min=this._minimum,this._element.max=this._maximum,null!=this._step&&(this._element.step=this._step),this._element.value=null!=n?n:this._minimum,null!=r&&(this._element.addEventListener("input",(t=>{r(this._element.value)})),r(this._element.value)),Object.assign(this._element.style,{height:_M+"px"})}destroy(){this._element=null,Object.setPrototypeOf(this,null)}addValueChangedListener(t){this._element.addEventListener("input",(e=>t(this._element.value)))}setValue(t){this._element.value=t}get element(){return this._element}get value(){return this._element.value}get displayedValue(){return""+this._element.value}get height(){return _M}};h(ud,"DebugUIScalarSlider");var Zy=16,hd=class{constructor({current:t,onValueChanged:e}){this._onValueChanged=e,this._element=document.createElement("div"),this._titleElement=document.createElement("input"),this._titleElement.type="checkbox",this._titleElement.checked=t||!1,Object.assign(this._titleElement.style,{width:Zy+"px",height:Zy+"px",margin:"0px"}),null!=e&&(this._titleElement.addEventListener("click",(t=>{e(this._titleElement.checked)})),e(this._titleElement.checked))}destroy(){this._element=null,this._titleElement=null,Object.setPrototypeOf(this,null)}addValueChangedListener(t){this._titleElement.addEventListener("click",(e=>t(this._titleElement.checked)))}get element(){return this._element}get titleElement(){return this._titleElement}get value(){return this._titleElement.checked}get displayedValue(){return this._titleElement.checked?"true":"false"}get height(){return 0}get titleElementWidth(){return Zy}};h(hd,"DebugUICheckbox");var Jy=12,p1=2,Tc=64,f1=16,$y=24,bM=48,dd=class{constructor({current:t,onValueChanged:e}){this._onValueChanged=e,this._element=document.createElement("div"),this._titleElement=document.createElement("div"),this._color=t||new Ee,this._listeners=[],Object.assign(this._element.style,{width:"100%",height:this.height+"px"}),Object.assign(this._titleElement.style,{width:Jy-2+"px",height:Jy-2+"px","border-radius":"2px"}),this._colorPickerMain=document.createElement("canvas"),this._colorPickerMain.height=Tc-2,Object.assign(this._colorPickerMain.style,{position:"absolute",left:"0px",right:"0px",top:"0px",height:Tc-2+"px"}),this._element.appendChild(this._colorPickerMain),this._colorPickerBottomSlider=document.createElement("canvas"),this._colorPickerBottomSlider.height=f1-2,Object.assign(this._colorPickerBottomSlider.style,{position:"absolute",left:"0px",right:"0px",top:Tc+p1+"px",height:f1-2+"px"}),this._element.appendChild(this._colorPickerBottomSlider),this._requestAnimationFrameHandle=null,this._requestAnimationFrameUpdate=this._requestAnimationFrameUpdate.bind(this),this._pickingMain=!1,this._pickingX=0,this._pickingY=0,this._colorPickerMain.addEventListener("pointerdown",(t=>{this._pickingMain=!0,this._updateMain(t.offsetX,t.offsetY),this._notify(),this._moveListener=t=>{let e=t.clientX-this._colorPickerMain.getBoundingClientRect().x,i=t.clientY-this._colorPickerMain.getBoundingClientRect().y;this._pickingX=Math.min(Math.max(e,0),this._colorPickerMain.clientWidth),this._pickingY=Math.min(Math.max(i,0),this._colorPickerMain.clientHeight),this._requestAnimationFrame()},document.body.addEventListener("pointermove",this._moveListener),this._upListener=t=>{this._pickingMain=!1,this.redraw(),document.body.removeEventListener("pointermove",this._moveListener),document.body.removeEventListener("pointerup",this._upListener),delete this._moveListener,delete this._upListener},document.body.addEventListener("pointerup",this._upListener)})),this._pickingBottomSlider=!1,this._colorPickerBottomSlider.addEventListener("pointerdown",(t=>{this._pickingBottomSlider=!0,this._updateBottomSlider(t.offsetX),this._notify(),this._bottomMoveListener=t=>{let e=t.clientX-this._colorPickerBottomSlider.getBoundingClientRect().x;this._pickingX=Math.min(Math.max(e,0),this._colorPickerMain.clientWidth),this._requestAnimationFrame()},document.body.addEventListener("pointermove",this._bottomMoveListener),this._bottomUpListener=t=>{this._pickingBottomSlider=!1,this.redraw(),document.body.removeEventListener("pointermove",this._bottomMoveListener),document.body.removeEventListener("pointerup",this._bottomUpListener),delete this._bottomMoveListener,delete this._bottomUpListener},document.body.addEventListener("pointerup",this._bottomUpListener)}));let i=0,n=h(((t,e)=>{let n=document.createElement("button");return Object.assign(n.style,{position:"absolute",top:this.height-$y+"px",left:i+"px",height:$y+"px",width:bM+"px",color:"grey"}),n.innerHTML=e,i+=bM+p1,n.addEventListener("click",(()=>{this._modeButtons[this._mode].style.color="grey",this._mode=t,n.style.color="black",this.redraw()})),this._element.appendChild(n),n}),"createModeButton");this._modeButtons={},this._modeButtons.hsv=n("hsv","HSV"),this._modeButtons.svh=n("svh","SVH"),this._modeButtons.rgb=n("rgb","RGB"),this._mode="hsv",this._modeButtons.hsv.style.color="black",this._requestAnimationFrame(),this._notify()}destroy(){document.body.removeEventListener("pointermove",this._moveListener),document.body.removeEventListener("pointerup",this._upListener),document.body.removeEventListener("pointermove",this._bottomMoveListener),document.body.removeEventListener("pointerup",this._bottomUpListener),this._element=null,this._titleElement=null,this._destroyed=!0,Object.setPrototypeOf(this,null)}addValueChangedListener(t){this._listeners.push(t)}setValue(t){this._color.copy(t),this.redraw(),this._notify()}_requestAnimationFrame(){null==this._requestAnimationFrameHandle&&!this._destroyed&&(this._requestAnimationFrameHandle=requestAnimationFrame(this._requestAnimationFrameUpdate))}_requestAnimationFrameUpdate(){this._pickingMain&&(this._updateMain(this._pickingX,this._pickingY),this._notify()),this._pickingBottomSlider&&(this._updateBottomSlider(this._pickingX),this._notify()),this._requestAnimationFrameHandle=null}_notify(){null!=this._onValueChanged&&this._onValueChanged(this._color);for(let t of this._listeners)t(this._color)}_updateMain(t,e){let i=this._colorPickerMain.clientWidth,n=Tc;this._pickingX=Math.min(Math.max(t,1),i-1)-1,this._pickingY=Math.min(Math.max(e,1),n-1)-1;let r=this._pickingX/(i-1),s=this._pickingY/(n-1);if("hsv"===this._mode){let[,,t]=wc(this._color);this._color.set(ws(r,s,t))}else if("svh"===this._mode){let[t,,]=wc(this._color);this._color.set(ws(t,r,1-s))}else this._color.r=r,this._color.g=s;this.redraw()}_updateBottomSlider(t){let e=this._colorPickerBottomSlider.clientWidth;this._pickingX=Math.min(Math.max(t,1),e-1)-1;let i=this._pickingX/(e-1);if("hsv"===this._mode){let[t,e]=wc(this._color);this._color.set(ws(t,e,i))}else if("svh"===this._mode){let[,t,e]=wc(this._color);this._color.set(ws(i,t,e))}else this._color.b=i;this.redraw()}redraw(){let t=this._element.clientWidth-2,e=Tc-2,i=f1-2;this._colorPickerMain.width!==t&&(this._colorPickerMain.width=t);let[n,r,s]=wc(this._color),a=this._colorPickerMain.getContext("2d");for(let i=0;i<e;++i)for(let r=0;r<t;++r){if("hsv"===this._mode){let n=r/(t-1),o=i/(e-1),l=s,{r:h,g:u,b:c}=ws(n,o,l);a.fillStyle=`rgb(${255*h},${255*u},${255*c})`}else if("svh"===this._mode){let s=r/(t-1),o=1-i/(e-1),l=n,{r:h,g:u,b:c}=ws(l,s,o);a.fillStyle=`rgb(${255*h},${255*u},${255*c})`}else{let n=r/t*255,s=i/e*255,o=255*this._color.b;a.fillStyle=`rgb(${n},${s},${o})`}a.fillRect(r,i,1,1)}this._pickingMain&&(a.fillStyle="rgba(0,0,0,0.5)",a.fillRect(0,this._pickingY,t,1),a.fillRect(this._pickingX,0,1,e)),this._colorPickerBottomSlider.width!==t&&(this._colorPickerBottomSlider.width=t);let o=this._colorPickerBottomSlider.getContext("2d");for(let e=0;e<t;++e){if("hsv"===this._mode){let i=n,s=r,a=e/(t-1),{r:l,g:h,b:u}=ws(i,s,a);o.fillStyle=`rgb(${255*l},${255*h},${255*u})`}else if("svh"===this._mode){let i=r,n=s,a=e/(t-1),{r:l,g:h,b:u}=ws(a,i,n);o.fillStyle=`rgb(${255*l},${255*h},${255*u})`}else{let i=255*this._color.r,n=255*this._color.g,r=e/(t-2)*255;o.fillStyle=`rgb(${i},${n},${r})`}o.fillRect(e,0,1,i)}this._pickingBottomSlider&&(o.fillStyle="rgba(0,0,0,0.5)",o.fillRect(this._pickingX,0,1,i));let l=255*this._color.r,h=255*this._color.g,u=255*this._color.b,c=`1px solid rgb(${.9*l},${.9*h},${.9*u})`;Object.assign(this._colorPickerMain.style,{border:c}),Object.assign(this._colorPickerBottomSlider.style,{border:c}),Object.assign(this._titleElement.style,{"background-color":`rgb(${l},${h},${u})`,border:c})}get element(){return this._element}get titleElement(){return this._titleElement}get value(){return this._color}get displayedValue(){return"#"+this._color.getHexString().toUpperCase()}get height(){return Tc+p1+f1+p1+$y}get titleElementWidth(){return Jy}};h(dd,"DebugUIColorPicker");var m1=16,MM=12,_R=4,wM=10,TM=12,pd=class{constructor({name:t}){this._name=t,this._element=document.createElement("div"),this._entries=[],this._height=TM}destroy(){for(let t of this._entries)t.destroy();this._entries=null,this._element=null,Object.setPrototypeOf(this,null)}get element(){return this._element}get height(){return this._height}addControl(t,e,i){if(-1!==this._entries.findIndex((e=>e.name===t)))return;let n=new g1({name:t,description:e,control:i});this._entries.push(n),this._element.appendChild(n.element),null!=i.redraw&&i.redraw()}removeControl(t){let e=this._entries.findIndex((e=>e.name===t));if(-1!==e){let[t]=this._entries.splice(e,1);this._element.removeChild(t.element),t.destroy()}}_updateLayout(){this._height=0;for(let t of this._entries)t.element.style.top=this._height+"px",this._height+=t.height+TM;Object.assign(this._element.style,{height:this._height+"px"})}};h(pd,"DebugUIPanel");var g1=class{constructor({name:t,description:e,control:i}){this._name=t,this._description=e,this._control=i,this._element=document.createElement("div"),this._element.title=e,Object.assign(this._element.style,{position:"absolute",left:"0px",right:"0px"}),this._element.appendChild(this._control.element),Object.assign(this._control.element.style,{position:"absolute",left:"0px",width:"100%",top:m1+"px","font-size":wM+"px"});let n=0;null!=this._control.titleElement&&(this._element.appendChild(this._control.titleElement),Object.assign(this._control.titleElement.style,{position:"absolute",left:"0px",top:"0px","font-size":wM+"px"}),n=this._control.titleElementWidth+_R),this._control.addValueChangedListener((t=>{this._displayedValueElement.innerHTML=EM(this._control.displayedValue)})),this._nameElement=document.createElement("span"),this._nameElement.innerHTML=t,Object.assign(this._nameElement.style,{position:"absolute",left:n+"px",right:"0px",height:m1+"px",color:"#666666","font-size":MM+"px","text-align":"left","vertical-align":"middle"}),this._element.appendChild(this._nameElement),this._displayedValueElement=document.createElement("span"),this._displayedValueElement.innerHTML=EM(this._control.displayedValue),Object.assign(this._displayedValueElement.style,{position:"absolute",left:n+"px",right:"0px",height:m1+"px","font-size":MM+"px","text-align":"right","vertical-align":"middle"}),this._element.appendChild(this._displayedValueElement)}destroy(){this._element=null,this._nameElement=null,this._displayedValueElement=null,this._control.destroy(),Object.setPrototypeOf(this,null)}get name(){return this._name}get element(){return this._element}get value(){return this._control.value}get height(){return this._control.height+m1}};function EM(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}h(g1,"DebugUIEntry"),h(EM,"escapeHTML");var fd=gn(io(),1),Ky=1e4,SM={chain:"chain",cancel:"cancel"},bR=100,MR=new Ei,wR=h((function(t,e,i,n){this.dispatcher=MR,this.camera=t,this.canvas=e,this.elevation=t.parent,this.orbit=this.elevation.parent;let r,s=2*Math.PI,a=100;this.zoomSpeed=5,this.rotateSpeed=100,this.enabled=!0,this.enableZoom=!0,this.enablePan=!0,this.enablePedestal=!1,this.maxPedestal=1/0,this.minPedestal=-1/0,this.enableRotate=!0,this.minZoom=375,this.maxZoom=1e4,this.initialMinZoom=375,this.initialMaxZoom=1e4,this.ignoreZoomLimits=!1,this.minExpandedZoom=375,this.maxExpandedZoom=1e5,this.zoomFactor=1,this.panBounds={margin:1.25,min:{x:1/0,y:1/0},max:{x:-1/0,y:-1/0},center:{x:0,y:0},radius:200},this.minTilt=0,this.maxTilt=1.2,this.mouseButtons={ORBIT:cf.RIGHT,ZOOM:cf.MIDDLE,PAN:cf.LEFT};let o=this,l=new xn(1e6,1e6),u=new Hn({color:0,visible:!1}),c=new lt(l,u),d=new Zi;i.add(c);let p,m=-1,f=0,g=1,v=2,y=3,_=4,x=5,b=6,w=7,M=8,E=9,T=m,S=new de,q=[],P={offsetLeft:0,offsetTop:0},A=new de,C=new de,L=new de,R=new de,N=new de,O=new de,D=new I,B=new I,k=new de,F=new de,z=new de,U=!1,H=new gu(!0),V=0,G=!0;this.CAMERA_EVENTS={},this.CAMERA_EVENTS.CHANGE_EVENT={type:"change"},this.CAMERA_EVENTS.PAN_START_EVENT={type:"panStart"},this.CAMERA_EVENTS.PAN_END_EVENT={type:"panEnd"},this.CAMERA_EVENTS.PEDESTAL_START_EVENT={type:"pedestalStart"},this.CAMERA_EVENTS.PEDESTAL_CHANGE_EVENT={type:"pedestalChange"},this.CAMERA_EVENTS.PEDESTAL_END_EVENT={type:"pedestalEnd"},this.CAMERA_EVENTS.ROTATE_START_EVENT={type:"rotateStart"},this.CAMERA_EVENTS.ROTATE_END_EVENT={type:"rotateEnd"},this.CAMERA_EVENTS.ZOOM_START_EVENT={type:"zoomStart"},this.CAMERA_EVENTS.ZOOM_END_EVENT={type:"zoomEnd"},this.CAMERA_EVENTS.MULTI_START_EVENT={type:"multiStart"},this.CAMERA_EVENTS.MULTI_END_EVENT={type:"multiEnd"},this.INTERACTION_EVENTS={},this.INTERACTION_EVENTS.USER_PAN_START_EVENT={type:"userPanStart"},this.INTERACTION_EVENTS.USER_PEDESTAL_START_EVENT={type:"userPedestalStart"},this.INTERACTION_EVENTS.USER_ROTATE_START_EVENT={type:"userRotateStart"},this.INTERACTION_EVENTS.USER_DOLLY_START_EVENT={type:"userDollyStart"},this.INTERACTION_EVENTS.USER_ZOOM_START_EVENT={type:"userZoomStart"},this.INTERACTION_EVENTS.USER_TILT_START_EVENT={type:"userTiltStart"},this.INTERACTION_EVENTS.USER_PAN_END_EVENT={type:"userPanEnd"},this.INTERACTION_EVENTS.USER_PEDESTAL_END_EVENT={type:"userPedestalEnd"},this.INTERACTION_EVENTS.USER_ROTATE_END_EVENT={type:"userRotateEnd"},this.INTERACTION_EVENTS.USER_DOLLY_END_EVENT={type:"userDollyEnd"},this.INTERACTION_EVENTS.USER_ZOOM_END_EVENT={type:"userZoomEnd"},this.INTERACTION_EVENTS.USER_TILT_END_EVENT={type:"userTiltEnd"},this.UPDATE_EVENTS={},this.UPDATE_EVENTS.POSITION_UPDATED_EVENT={type:"positionUpdated"},this.UPDATE_EVENTS.ZOOM_UPDATED_EVENT={type:"zoomUpdated"},this.UPDATE_EVENTS.TILT_UPDATED_EVENT={type:"tiltUpdated"},this.UPDATE_EVENTS.ROTATION_UPDATED_EVENT={type:"rotationUpdated"};let W=yf((t=>{o.dispatcher.dispatchEvent(Ue(be({},o.CAMERA_EVENTS.PEDESTAL_CHANGE_EVENT),{pedestal:t,scrolledToTop:o.scrolledToTop,scrolledToBottom:o.scrolledToBottom,scrollPercent:o.scrollPercent}))}),bR);function X(t){"number"==typeof t&&!isNaN(t)&&(o.orbit.position.z=t,n.tryRendering())}this.addDebugControls=function(t){t.addDebugControls({CameraControls:[{name:"Stay Inside Bounds",description:"Ensure the camera stays inside its bounds.\n\nCaution: going too far outside-of-bounds may slow renderingsignificantly.",control:new hd({current:!0,onValueChanged:t=>{G=t}})}]})},this.removeDebugControls=function(t){t.removeDebugControls({CameraControls:["Stay Inside Bounds"]})},this.pan=function(t,e){isNaN(t)||isNaN(e)||(o.setPosition(o.orbit.position.x+t,o.orbit.position.y+e),o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.POSITION_UPDATED_EVENT))},this.setPosition=function(t,e){if(isNaN(t)||isNaN(e))return;T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.PAN_START_EVENT);let i=t-o.panBounds.center.x,n=e-o.panBounds.center.y,r=Math.sqrt(i*i+n*n);if(G&&r>o.panBounds.radius){let t=Math.atan2(n,i),e={x:Math.cos(t)*o.panBounds.radius+o.panBounds.center.x,y:Math.sin(t)*o.panBounds.radius+o.panBounds.center.y};o.orbit.position.x=e.x,o.orbit.position.y=e.y}else o.orbit.position.x=t,o.orbit.position.y=e;o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.POSITION_UPDATED_EVENT),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT),T==m&&o.dispatcher.dispatchEvent(o.this.CAMERA_EVENTS.PAN_END_EVENT)},this.setRotation=function(t){if(isNaN(t))return;T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_START_EVENT);let e=t%s;e!==o.orbit.rotation.z&&(o.orbit.rotation.z=e,o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.ROTATION_UPDATED_EVENT)),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT),T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_END_EVENT)},this.rotate=function(t){if(isNaN(t))return;T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_START_EVENT);let e=(o.orbit.rotation.z+t)%s;e!==o.orbit.rotation.z&&(o.orbit.rotation.z=e,o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.ROTATION_UPDATED_EVENT)),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT),T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_END_EVENT)},this.setTilt=function(t){if(isNaN(t))return;T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_START_EVENT);let e=G?Math.max(Math.min(t,o.maxTilt),o.minTilt):t;e!==o.elevation.rotation.x&&(o.elevation.rotation.x=e,o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.TILT_UPDATED_EVENT)),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT),T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_END_EVENT)},this.tilt=function(t){if(isNaN(t))return;T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_START_EVENT);let e=G?Math.max(Math.min(t+o.getTilt(),o.maxTilt),o.minTilt):t+o.getTilt();e!==o.elevation.rotation.x&&(o.elevation.rotation.x=e,o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.TILT_UPDATED_EVENT)),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT),T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_END_EVENT)},this.setZoom=function(t){if(isNaN(t))return;T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_START_EVENT);let e=G?Math.min(Math.max(t,o.getZoomScaledMin()),o.getZoomScaledMax()):t;e!==o.camera.position.z&&(o.camera.position.z=e,o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.ZOOM_UPDATED_EVENT)),o.camera.near=e/a,o.camera.far=e*a,o.camera.updateProjectionMatrix(),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT),T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_END_EVENT)},this.zoom=function(t){if(isNaN(t))return;T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_START_EVENT);let e=o.getZoom()-t;o.camera.position.z=G?Math.min(Math.max(e,o.minZoom*o.zoomFactor),o.maxZoom*o.zoomFactor):e,o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.ZOOM_UPDATED_EVENT),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT),T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_END_EVENT)},this.zoomIn=function(t,e,i){let n=this.getZoom();this.animateCamera({zoom:n/1.5},t,e,i)},this.zoomOut=function(t,e,i){let n=this.getZoom();this.animateCamera({zoom:1.5*n},t,e,i)},this.expandZoomLimits=function(t,e){e||(e=1.2),t*e>o.maxZoom&&(o.maxZoom=Math.min(t*e,o.maxExpandedZoom)),t/e<o.minZoom&&(o.minZoom=Math.max(t/e,o.minExpandedZoom))},this.restrictZoomLimits=function(t,e){e||(e=1.2),t*e>o.initialMaxZoom&&t*e<o.maxZoom&&(o.maxZoom=Math.max(o.getZoom(),t*e)),t/e<o.initialMinZoom&&t/e>o.minZoom&&(o.minZoom=Math.min(o.getZoom(),t/e))},this.getPosition=function(){return{x:o.orbit.position.x,y:o.orbit.position.y,z:o.orbit.position.z}},this.getPedestal=function(){return o.orbit.position.z},h(X,"setPedestal"),Object.defineProperty(this,"setPedestal",{enumerable:!1,value:X}),Object.defineProperty(this,"scrollPercent",{get(){let t=this.minPedestal,e=this.maxPedestal,i=this.getPedestal();return i=Math.min(i,e),i=Math.max(i,t),(i-t)/(e-t)*100}}),Object.defineProperty(this,"scrolledToTop",{get(){return 0===this.maxPedestal||Math.ceil(this.getPedestal())>=this.maxPedestal}}),Object.defineProperty(this,"scrolledToBottom",{get(){return 0===this.minPedestal||Math.floor(this.getPedestal())<=this.minPedestal}}),this.getRotation=function(){return o.orbit.rotation.z},this.getTilt=function(){return o.elevation.rotation.x},this.getZoom=function(){return o.camera.position.z},this.isCameraMoving=function(){return T!=m},this.getZoomScaledMin=function(){return o.minZoom*o.zoomFactor},this.getZoomScaledMax=function(){let t=o.minZoom*o.zoomFactor;return Math.max(o.maxZoom,1.5*t)};let Y=h((function(){return fd.default.getAll().some((function(t){return t._mMapAnimation}))}),"isAnimating"),Z=new Set;function J(t){t.isPlaying?t.stop():t.end(),Z.delete(t)}function Q(t){A.set(t.clientX,t.clientY),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_START_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_ROTATE_START_EVENT)}function K(t){k.set(t.clientX,t.clientY),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_START_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_DOLLY_START_EVENT)}function $(){let t=Rt(S);R.set(t.x,t.y),N.set(o.orbit.position.x,o.orbit.position.y),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.PAN_START_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_PAN_START_EVENT)}function tt(t){let e={x:t.clientX,y:t.clientY};o.initialShiftPos=e,o.initialPedestal=o.getPedestal(),o.pedestalScaleFactor=Qg(o.camera.fov,o.canvas.clientHeight,o.getZoom()),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.PEDESTAL_START_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_PEDESTAL_START_EVENT)}function et(t){t.clientX;let e=t.clientY,i=o.initialPedestal+o.pedestalScaleFactor*(e-o.initialShiftPos.y);G&&(i<o.minPedestal?i=Math.max(i,o.minPedestal):i>o.maxPedestal&&(i=Math.min(i,o.maxPedestal))),i!==o.getPedestal()&&(o.setPedestal(i),W(i))}function it(t){C.set(t.clientX,t.clientY),L.subVectors(C,A),o.rotate(-L.x/o.rotateSpeed),o.setTilt(o.getTilt()-L.y/o.rotateSpeed),A.copy(C),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT)}function nt(t){F.set(t.clientX,t.clientY),z.subVectors(F,k),o.setZoom(z.y*o.zoomSpeed),k.copy(F),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT)}function rt(){let t=Rt(S);O.set(t.x,t.y),D.subVectors(O,R),o.setPosition(N.x-D.x,N.y-D.y),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT)}function st(t){let e=0;return void 0!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail),e}function at(t){let e=st(t),i=o.getZoom();return!(e<0&&i==o.getZoomScaledMax()||e>0&&i==o.getZoomScaledMin())}function ot(t){if(o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_START_EVENT),!at(t))return V>0&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_END_EVENT),V=0,void(T=m);let e=o.getZoom(),i=e-st(t)*e/1e4*o.zoomSpeed;o.setZoom(i);let n=i/p;D.subVectors(B,N).multiplyScalar(1-n),o.setPosition(N.x+D.x,N.y+D.y),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT)}function ht(t){if(!1!==o.enabled){if(Nt(t),t.preventDefault(),T==y&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_END_EVENT),t.button===o.mouseButtons.ORBIT){if(!1===o.enableRotate)return;Q(t),T=f}else if(t.button===o.mouseButtons.ZOOM){if(!1===o.enableZoom)return;K(t),T=g}else t.button===o.mouseButtons.PAN&&(o.enablePan?($(),T=v):o.enablePedestal&&(tt(t),T=M));T!==m&&(o.canvas.addEventListener("mousemove",ut,!1),window.addEventListener("mouseup",ct,!1),window.addEventListener("mouseout",ct,!1))}}function ut(t){if(!1!==o.enabled)if(t.preventDefault(),Nt(t),T===f){if(!1===o.enableRotate)return;it(t)}else if(T===g){if(!1===o.enableZoom)return;nt(t)}else if(T===v){if(!1===o.enablePan)return;rt()}else T===y?(U=!0,T=m):T===M&&et(t)}function ct(){if(!1!==o.enabled){switch(document.removeEventListener("mousemove",ut,!1),window.removeEventListener("mouseup",ct,!1),window.removeEventListener("mouseout",ct,!1),T){case v:o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.PAN_END_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_PAN_END_EVENT);break;case g:o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_END_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_DOLLY_END_EVENT);break;case f:o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_END_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_ROTATE_END_EVENT);break;case M:o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.PEDESTAL_END_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_PEDESTAL_END_EVENT)}T=m}}h(J,"completeTween"),this.cancelAnimation=function(){let t=Array.from(Z);J(t[t.length-1])},this.animateCamera=function(t,e,i,r,s){let a=be({mode:SM.cancel},s),l={},h={},u=o.getPosition();if(null!=t.position&&(void 0!==t.position.x&&(l.x=u.x,h.x=t.position.x),void 0!==t.position.y&&(l.y=u.y,h.y=t.position.y),void 0!==t.position.z&&(l.z=u.z,h.z=t.position.z)),void 0!==t.zoom&&(l.zoom=G?Math.min(Math.max(o.getZoom(),o.getZoomScaledMin()),o.getZoomScaledMax()):o.getZoom(),o.viewState!==Mc.MULTI_FLOOR&&G?h.zoom=Math.min(Math.max(t.zoom,o.getZoomScaledMin()),o.getZoomScaledMax()):h.zoom=t.zoom),void 0!==t.rotation){l.rotation=o.getRotation();let e=t.rotation%(2*Math.PI);Math.abs(e-l.rotation)>Math.PI?h.rotation=e<0?2*Math.PI+e:-(2*Math.PI-e):h.rotation=e}void 0!==t.tilt&&(l.tilt=o.getTilt(),o.viewState!==Mc.MULTI_FLOOR&&G?h.tilt=Math.max(Math.min(t.tilt,o.maxTilt),o.minTilt):h.tilt=t.tilt);var c=new fd.default.Tween(l).to(h,j.env.TESTING?0:e).onUpdate((function(t){o.setMulti({x:t.x,y:t.y,z:t.z},t.zoom,t.rotation,t.tilt)})).onComplete((function(){r&&r(),J(c)})).onStart((function(){T!=w&&(T=w,o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.MULTI_START_EVENT)),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT)}));let d=Array.from(Z),p=d[d.length-1],m=!1;return null!=p&&(a.mode===SM.chain?(m=!0,p.chain(c)):(J(p),p=null)),Z.add(c),i?c.easing(i):c.easing(fd.default.Easing.Quadratic.In),!t.doNotAutoStart&&!m&&(c.start(),n.tryRendering()),c._mMapAnimation=!0,c},this.setMulti=function(t,e,i,n){T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.MULTI_START_EVENT);let r=!1;if(null!=t&&(void 0!==t.x&&!isNaN(t.x)&&(o.orbit.position.x=t.x,r=!0),void 0!==t.y&&!isNaN(t.y)&&(o.orbit.position.y=t.y,r=!0),void 0!==t.z&&!isNaN(t.z)&&this.setPedestal(t.z)),r&&o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.POSITION_UPDATED_EVENT),void 0!==e&&!isNaN(e)){let t=G?Math.min(Math.max(e,o.getZoomScaledMin()),o.getZoomScaledMax()):e;t!==o.camera.position.z&&(o.camera.position.z=t,o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.ZOOM_UPDATED_EVENT),o.viewState===Mc.MULTI_FLOOR?e>Ky&&(o.camera.near=e-Ky,o.camera.far=e+Ky):(o.camera.near=e/a,o.camera.far=e*a),o.camera.updateProjectionMatrix())}if(void 0!==i&&!isNaN(i)&&i!==o.orbit.rotation.z&&(o.orbit.rotation.z=i,o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.ROTATION_UPDATED_EVENT)),void 0!==n&&!isNaN(n)){let t=G?Math.max(Math.min(n,o.maxTilt),o.minTilt):n;t!==o.elevation.rotation.x&&(o.elevation.rotation.x=t,o.dispatcher.dispatchEvent(o.UPDATE_EVENTS.TILT_UPDATED_EVENT))}o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT),T==m&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.MULTI_END_EVENT)},h(Q,"handleMouseDownRotate"),h(K,"handleMouseDownDolly"),h($,"handleMouseDownPan"),h(tt,"handleMouseDownPedestal"),h(et,"handleMouseMovePedestal"),h(it,"handleMouseMoveRotate"),h(nt,"handleMouseMoveDolly"),h(rt,"handleMouseMovePan"),this.getProjectionScaleFactor=Qg,this.postRender=function(){(T==v||T==b)&&(d.setFromCamera(S,t),r=d.intersectObject(c,!1)[0],r&&(R.set(r.point.x,r.point.y),N.set(o.orbit.position.x,o.orbit.position.y))),T==y&&U&&(U=!1,p=o.getZoom(),B=Rt(S),N.set(o.orbit.position.x,o.orbit.position.y)),T==w&&0==Y()&&(T=m,o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.MULTI_END_EVENT))},h(st,"scrollDelta"),h(at,"canScrollZoom"),h(ot,"handleMouseWheel"),h(ht,"onMouseDown"),h(ut,"onMouseMove"),h(ct,"onMouseUp");let dt=null;function pt(t){!1===o.enabled||!1===o.enableZoom||T!==m&&T!==y||(t.preventDefault(),t.stopPropagation(),Nt(t),at(t)&&(V=H.getElapsedTime(),o.dispatchUserZoomEvent()),T!=y&&at(t)&&(o.canvas.addEventListener("mousemove",ut,!1),T=y,p=o.getZoom(),B=Rt(S),N.set(o.orbit.position.x,o.orbit.position.y),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_START_EVENT)),null!=dt&&clearTimeout(dt),dt=setTimeout((()=>{o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_END_EVENT)}),50),ot(t))}function mt(t){let e=Rt(t.x?t:q[0]);R.set(e.x,e.y),N.set(o.orbit.position.x,o.orbit.position.y),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_PAN_START_EVENT),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.PAN_START_EVENT)}function ft(t){let e=Rt(t.x?t:q[0]);O.set(e.x,e.y),D.subVectors(O,R),o.setPosition(N.x-D.x,N.y-D.y),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.CHANGE_EVENT)}function gt(){o.touchInputs=new yM(q[0],q[1]);let t=q[0].x-q[1].x,e=q[0].y-q[1].y;p=o.getZoom();let i={x:q[0].x-t/2,y:q[0].y-e/2};B=Rt(i),o.orbit.updateMatrixWorld(),o.touchAnchor1=new Yy(q[0],o.camera,c),o.touchAnchor2=new Yy(q[1],o.camera,c),N.set(o.orbit.position.x,o.orbit.position.y),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_DOLLY_START_EVENT),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.MULTI_START_EVENT)}function vt(){o.touchInputs.update(q[0],q[1]);let t=o.touchInputs.first,e=o.touchInputs.second;o.touchAnchor1.viewCoordinate={x:t.x,y:t.y},o.touchAnchor2.viewCoordinate={x:e.x,y:e.y};let i=Pt(o.touchAnchor1,o.touchAnchor2);i&&At(i),o.orbit.updateMatrixWorld(),o.touchAnchor1.updateAnchorState(o.camera,t),o.touchAnchor2.updateAnchorState(o.camera,e)}function yt(t){A.set(t.touches[1].clientX,t.touches[1].clientY),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_TILT_START_EVENT),o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_START_EVENT)}function _t(t){C.set(t.touches[1].clientX,t.touches[1].clientY),L.subVectors(C,A),o.setTilt(o.getTilt()-L.y/o.rotateSpeed),A.copy(C)}function xt(t){tt(t.touches[0])}function bt(t){et(t.touches[0])}function wt(){(T===_||T===x)&&o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.MULTI_END_EVENT)}function Mt(t){if(!1!==o.enabled)switch(It(t),Ot(t),t.touches.length){case 1:o.enablePedestal?(xt(t),T=E):o.enableRotate&&(mt(t),T=b);break;case 2:if(!1===o.enableZoom)return;gt(),T=x;break;case 3:if(!1===o.enablePan)return;yt(t),T=_;break;default:T=m}}function Et(t){if(!1!==o.enabled)switch(t.preventDefault(),t.stopPropagation(),Ot(t),t.touches.length){case 3:if(!1===o.enableRotate||T!==_)return;_t(t);break;case 2:if(!1===o.enableZoom||T!==x)return;vt();break;case 1:o.enablePedestal&&T===E?bt(t):o.enablePan&&T===b&&ft(t);break;default:T=m}}function Tt(t){if(!1!==o.enabled){switch(wt(),T){case v:case b:o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_PAN_END_EVENT);break;case _:o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.PAN_END_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_TILT_END_EVENT);break;case g:case x:o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_END_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_DOLLY_END_EVENT);break;case f:o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ROTATE_END_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_ROTATE_END_EVENT);break;case M:case E:o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.PEDESTAL_END_EVENT),o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_PEDESTAL_END_EVENT)}T=m}}function St(t){t.preventDefault()}function qt(t,e){return(e-t+Math.PI)%(2*Math.PI)+2*Math.PI%(2*Math.PI)-Math.PI}function Pt(t,e){o.orbit.updateMatrixWorld(),o.camera.updateProjectionMatrix();let i=o.camera.projectionMatrix.clone(),n=t.worldCoordinate,r=e.worldCoordinate,s=t.reUnproject(),a=e.reUnproject();if(!s||!a)return null;let l=t.viewCoordinate,u=e.viewCoordinate,c=r.x-n.x,d=r.y-n.y,p=Math.atan2(d,c),m=a.x-s.x,f=a.y-s.y,g=qt(p,Math.atan2(f,m)),v=new We;v.makeRotationZ(-g);let y=v.clone();y.multiply(t.snapHolderMatrix);let _=h(((t,e,i)=>t.elements[4*(e-1)+i-1]),"m"),x=_(i,1,1)*_(y,1,1)-l.x*_(i,3,4)*_(y,3,1),b=_(i,1,1)*_(y,1,2)-l.x*_(i,3,4)*_(y,3,2),w=_(i,1,1)*_(y,1,3)-l.x*_(i,3,4)*_(y,3,3),M=n.x*x+n.y*b+n.z*w,E=_(i,2,2)*_(y,2,1)-l.y*_(i,3,4)*_(y,3,1),T=_(i,2,2)*_(y,2,2)-l.y*_(i,3,4)*_(y,3,2),S=_(i,2,2)*_(y,2,3)-l.y*_(i,3,4)*_(y,3,3),q=n.x*E+n.y*T+n.z*S,P=_(i,1,1)*_(y,1,1)-u.x*_(i,3,4)*_(y,3,1),A=_(i,1,1)*_(y,1,2)-u.x*_(i,3,4)*_(y,3,2),C=_(i,1,1)*_(y,1,3)-u.x*_(i,3,4)*_(y,3,3),L=r.x*P+r.y*A+r.z*C,I=_(i,2,2)*_(y,2,1)-u.y*_(i,3,4)*_(y,3,1),R=_(i,2,2)*_(y,2,2)-u.y*_(i,3,4)*_(y,3,2),N=_(i,2,2)*_(y,2,3)-u.y*_(i,3,4)*_(y,3,3),O=r.x*I+r.y*R+r.z*N,D=Math.abs(P-x),B=Math.abs(A-b),k=Math.abs(C-w),F=Math.abs(P-E),z=Math.abs(A-T),U=Math.abs(C-S),H=Math.abs(I-x),V=Math.abs(R-b),G=Math.abs(N-w),W=Math.abs(I-E),j=Math.abs(R-T),X=Math.abs(N-S);Math.min(D+B+k,F+z+U)<Math.min(H+V+G,W+j+X)&&(P=I,A=R,C=N,L=O);let Y=E*w-x*S,Z=T*w-b*S,J=q*w-M*S,Q=P*S-E*C,K=A*S-T*C,$=L*S-q*C,tt=($*Z-J*K)/(Q*Z-Y*K),et=($*Y-J*Q)/(K*Y-Z*Q),it=T*x-b*E,nt=A*E-T*P,rt=((L*E-q*P)*it-(q*x-M*E)*nt)/((C*E-S*P)*it-(S*x-w*E)*nt),st=y.clone();return st.elements[12]=tt,st.elements[13]=et,st.elements[14]=rt,rt>0?st:null}function At(t){o.orbit.updateMatrixWorld();let e=new Si;e.setFromRotationMatrix(t,"ZYX");let i=t.elements[14]/Math.cos(e.x),n=e.z,r=new I(0,0,1);r.applyEuler(e),r.setLength(i);let s=new I;s.setFromMatrixPosition(t),s.sub(r),o.setPosition(s.x,s.y),o.setZoom(i),o.setRotation(n)}function Ct(t,e){return{x:e.offsetX,y:e.offsetY}}function Lt(t,e){return{x:e.clientX-P.offsetLeft,y:e.clientY-P.offsetTop}}function It(t){let e=o.canvas;P.offsetLeft=e.getBoundingClientRect().left,P.offsetTop=e.getBoundingClientRect().top}function Rt(e){d.setFromCamera(e,t);let i=d.intersectObject(c,!1)[0];return i?i.point:new I}function Nt(t){let e=Ct(o.canvas,t);return S.x=e.x/o.canvas.width*n.resolutionScale*2-1,S.y=-e.y/o.canvas.height*n.resolutionScale*2+1,S}function Ot(t){q=[];for(let e=0,i=t.touches.length;e<i;e++){let i=t.touches[e],r=Lt(o.canvas,i);q.push(new de(r.x/o.canvas.width*n.resolutionScale*2-1,-r.y/o.canvas.height*n.resolutionScale*2+1))}S=q[0]}h(pt,"onMouseWheel"),h(mt,"handleTouchStartPan"),h(ft,"handleTouchMovePan"),h(gt,"handleTouchStartDolly"),h(vt,"handleTouchMoveDolly"),h(yt,"handleTouchStartTilt"),h(_t,"handleTouchMoveTilt"),h(xt,"handleTouchStartPedestal"),h(bt,"handleTouchMovePedestal"),h(wt,"handleTouchEnd"),h(Mt,"onTouchStart"),h(Et,"onTouchMove"),h(Tt,"onTouchEnd"),h(St,"onContextMenu"),h(qt,"differenceBetweenAngles"),h(Pt,"makeTransformFromTouchAnchors"),h(At,"setCameraFromTransformMatrix"),h(Ct,"getMousePos"),h(Lt,"getTouchPos"),h(It,"updateTouchOrigin"),h(Rt,"raycastToFloor"),h(Nt,"mouseToScene"),h(Ot,"touchToScene"),this.update=function(){fd.default.update(),V>0&&T==y&&H.getElapsedTime()-V>.2&&(V=0,T=m,o.dispatcher.dispatchEvent(o.CAMERA_EVENTS.ZOOM_END_EVENT),o.canvas.removeEventListener("mousemove",ut,!1))};let Dt=!1;this.dispatchUserZoomDebounced=$s((()=>{Dt=!1,o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_ZOOM_END_EVENT)}),250),this.dispatchUserZoomEvent=function(){Dt||(o.dispatcher.dispatchEvent(o.INTERACTION_EVENTS.USER_ZOOM_START_EVENT),Dt=!0),o.dispatchUserZoomDebounced()},this.dispose=function(){o.canvas.removeEventListener("contextmenu",St,!1),o.canvas.removeEventListener("mousedown",ht,!1),o.canvas.removeEventListener("mousewheel",pt,!1),o.canvas.removeEventListener("MozMousePixelScroll",pt,!1),o.canvas.removeEventListener("touchstart",Mt,!1),o.canvas.removeEventListener("touchend",Tt,!1),o.canvas.removeEventListener("touchmove",Et,!1),o.canvas.removeEventListener("mousemove",ut,!1),window.removeEventListener("mouseup",ct,!1),window.removeEventListener("mouseout",ct,!1),i.remove(c),o.dispatcher._listeners={}},this.canvas.addEventListener("contextmenu",St,!1),this.canvas.addEventListener("mousedown",ht,!1),this.canvas.addEventListener("mousewheel",pt,!1),this.canvas.addEventListener("MozMousePixelScroll",pt,!1),this.canvas.addEventListener("touchstart",Mt,!1),this.canvas.addEventListener("touchend",Tt,!1),this.canvas.addEventListener("touchmove",Et,!1)}),"CameraControls"),AM=wR;P();var md,y1="varying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n\n",v1="varying vec2 vUv;\nuniform sampler2D staticSceneColorTexture;\nuniform sampler2D staticSceneDepthTexture;\nuniform sampler2D animatedSceneColorTexture;\nuniform sampler2D animatedSceneDepthTexture;\nuniform sampler2D alwaysOnTopSceneColorTexture;\n\n// Perform alpha blending between two colors with non-premultiplied\n// alpha, and return their non-premultiplied composite.\n//\n// This corresponds to the OVER porter-duff operation, aka, standard alpha\n// blending as implemented in most image editors.\nvec4 alphaBlend(vec4 background, vec4 foreground) {\n\tvec3 resultColor = (\n\t\tforeground.rgb * foreground.a +\n\t\tbackground.rgb * background.a * (1.0 - foreground.a)\n\t);\n\tfloat resultAlpha = foreground.a + background.a * (1.0 - foreground.a);\n\treturn vec4(resultColor / resultAlpha, resultAlpha);\n}\n\n// Assumes that the foreground (src) color is premultiplied with its alpha.\n// This corresponds to GL_ONE source factor and GL_ONE_MINUS_SRC_ALPHA for destination factor.\nvec4 alphaBlendPremultipliedAlpha(vec4 background, vec4 foreground) {\n\treturn foreground + (background * (1.0 - foreground.a));\n}\n\nvoid main() {\n\tfloat staticDepth = texture2D(staticSceneDepthTexture, vUv).r;\n\tfloat animatedDepth = texture2D(animatedSceneDepthTexture, vUv).r;\n\n\tvec4 staticColor = texture2D(staticSceneColorTexture, vUv).rgba;\n\tvec4 animatedColor = texture2D(animatedSceneColorTexture, vUv).rgba;\n\n\tif (staticDepth < animatedDepth) {\n\t\t// 19/06/10 Terence Dickson\n\t\t// Spoiler alert! This is to help prepare for CE-1352, where alpha\n\t\t// may be partial instead of zero. Not implementing that as part of\n\t\t// this PR, however.\n\t\tanimatedColor.a *= 0.0;\n\t}\n\t\n\tvec4 lowerColor = alphaBlend(staticColor, animatedColor);\n\tvec4 alwaysOnTopColor = texture2D(alwaysOnTopSceneColorTexture, vUv).rgba;\n\n\tgl_FragColor = alphaBlendPremultipliedAlpha(lowerColor, alwaysOnTopColor);\n}\n",PM=gn(qM(),1),t3=!1;t3&&((md=new PM.default).showPanel(0),document.body.appendChild(md.dom));var Ec=class{constructor(t){t.multiBufferRendering=t.multiBufferRendering||!1,this.contextLost=!1,this.implementation=t.multiBufferRendering?new _1(t):new x1(t),this.onWebGLContextCreationError=t.onWebGLContextCreationError,this.onWebGLContextLost=t.onWebGLContextLost,this.onWebGLContextRestored=t.onWebGLContextRestored,this.webGLContextCreationErrorListener=this.domElement().addEventListener("webglcontextcreationerror",(t=>this.reportWebGlContextCreationError(t))),this.webGLContextLostListener=this.domElement().addEventListener("webglcontextlost",(t=>this.reportWebGlContextLost(t))),this.webGLContextRestoredListener=this.domElement().addEventListener("webglcontextrestored",(t=>this.reportWebGLContextRestored(t)));let e=t.backgroundColor;"string"==typeof e&&(e=new Ee(t.backgroundColor)),null==e&&(e=new Ee("#ffffff"));let i=t.backgroundAlpha;null==i&&(i=1),this.shouldConsiderAlpha=t.alpha||!1,this.antialias=t.antialias||!1,this.setBackgroundColor(e,i)}destroy(){this.domElement().removeEventListener("webglcontextcreationerror",this.webGLContextCreationErrorListener),this.domElement().removeEventListener("webglcontextlost",this.webGLContextLostListener),this.domElement().removeEventListener("webglcontextrestored",this.webGLContextRestoredListener),this.implementation.destroy()}render(t,e,i,n){this.implementation.render(t,e,i,n)}getMaxAnisotropy(){return this.implementation.renderer.capabilities.getMaxAnisotropy()}getBufferSize(){return this.implementation.renderer.getSize(new de)}getContext(){return this.implementation.renderer.getContext()}preloadTexture(t){this.implementation.renderer.initTexture(t)}setBufferSize(t,e){this.implementation.setBufferSize(t,e)}get backgroundColor(){return this.implementation.backgroundColor}get backgroundAlpha(){return this.implementation.backgroundAlpha}setBackgroundColor(t,e){this.shouldConsiderAlpha||(e=1),e=(e=void 0!==e?+e:1)>=0&&e<=1?e:1,this.implementation.setBackgroundColor(t,e)}setMapboxOutdoorContext(t){this.implementation.setMapboxOutdoorContext(t)}domElement(){return this.implementation.renderer.domElement}isAvailable(){return null!=this.implementation.renderer&&!this.contextLost}disposeOfRenderLists(){this.implementation.renderer.renderLists.dispose()}reportWebGlContextCreationError(t){this.onWebGLContextCreationError&&this.onWebGLContextCreationError(t)}reportWebGlContextLost(t){t.preventDefault(),this.onWebGLContextLost&&this.onWebGLContextLost(t),this.contextLost=!0}reportWebGLContextRestored(){this.onWebGLContextRestored&&this.onWebGLContextRestored(),this.contextLost=!1}};h(Ec,"Renderer");var x1=class{constructor(t){try{this.renderer=new Oa({alpha:t.alpha||!1,antialias:t.antialias,powerPreference:"high-performance",preserveDrawingBuffer:!0})}catch(e){t.onWebGLRendererError&&t.onWebGLRendererError(e)}this.backgroundColor=new Ee,this.backgroundAlpha=1,this.mapboxOutdoorContext=null}destroy(){this.renderer.dispose()}render(t,e,i,n){n.layers.enable(hi.STATIC),n.layers.enable(hi.ANIMATED),n.layers.enable(hi.ALWAYS_ON_TOP),this.renderer.autoClear=!1,this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.setRenderTarget(e),this.renderer.clear(),t3&&md.begin(),this.renderer.render(i,n),t3&&md.end(),null!=this.mapboxOutdoorContext&&(this.renderer.state.reset(),this.mapboxOutdoorContext.render({resolution:this.renderer.getSize(new de),camera:n}),this.renderer.state.reset())}setBufferSize(t,e){this.renderer.setSize(t,e,!1)}setBackgroundColor(t,e){this.backgroundColor=t,this.backgroundAlpha=e}setMapboxOutdoorContext(t){this.mapboxOutdoorContext=t}};h(x1,"SingleBufferRenderer");var _1=class{constructor(t){try{this.renderer=new Oa({alpha:t.alpha||!1,antialias:!1,powerPreference:"high-performance",preserveDrawingBuffer:!0})}catch(e){t.onWebGLRendererError&&t.onWebGLRendererError(e)}this.backgroundColor=new Ee,this.backgroundAlpha=1,this.mapboxOutdoorContext=null,this.staticSceneRenderTarget=new dn(this.renderer.width,this.renderer.height),this.staticSceneRenderTarget.texture.format=Sn,this.staticSceneRenderTarget.texture.minFilter=Ut,this.staticSceneRenderTarget.texture.magFilter=Ut,this.staticSceneRenderTarget.texture.generateMipmaps=!1,this.staticSceneRenderTarget.stencilBuffer=!0,this.staticSceneRenderTarget.depthBuffer=!0,this.staticSceneRenderTarget.depthTexture=new Zr,this.staticSceneRenderTarget.depthTexture.type=Us,this.staticSceneRenderTarget.depthTexture.format=fr,this.animatedSceneRenderTarget=new dn(this.renderer.width,this.renderer.height),this.animatedSceneRenderTarget.texture.format=Sn,this.animatedSceneRenderTarget.stencilBuffer=!0,this.animatedSceneRenderTarget.texture.minFilter=Ut,this.animatedSceneRenderTarget.texture.magFilter=Ut,this.animatedSceneRenderTarget.texture.generateMipmaps=!1,this.animatedSceneRenderTarget.stencilBuffer=!0,this.animatedSceneRenderTarget.depthBuffer=!0,this.animatedSceneRenderTarget.depthTexture=new Zr,this.animatedSceneRenderTarget.depthTexture.type=Us,this.animatedSceneRenderTarget.depthTexture.format=fr,this.alwaysOnTopSceneRenderTarget=new dn(this.renderer.width,this.renderer.height),this.alwaysOnTopSceneRenderTarget.texture.format=Sn,this.alwaysOnTopSceneRenderTarget.texture.minFilter=Ut,this.alwaysOnTopSceneRenderTarget.texture.magFilter=Ut,this.alwaysOnTopSceneRenderTarget.texture.generateMipmaps=!1,this.alwaysOnTopSceneRenderTarget.stencilBuffer=!0,this.alwaysOnTopSceneRenderTarget.depthBuffer=!0,this.alwaysOnTopSceneRenderTarget.depthTexture=new Zr,this.alwaysOnTopSceneRenderTarget.depthTexture.type=Us,this.alwaysOnTopSceneRenderTarget.depthTexture.format=fr,this.compositeUniforms={staticSceneColorTexture:{type:"t",value:this.staticSceneRenderTarget.texture},staticSceneDepthTexture:{type:"t",value:this.staticSceneRenderTarget.depthTexture},animatedSceneColorTexture:{type:"t",value:this.animatedSceneRenderTarget.texture},animatedSceneDepthTexture:{type:"t",value:this.animatedSceneRenderTarget.depthTexture},alwaysOnTopSceneColorTexture:{type:"t",value:this.alwaysOnTopSceneRenderTarget.texture}},this.compositeCamera=new Vs(-1,1,1,-1,0,1),this.compositeMaterial=new pn({uniforms:this.compositeUniforms,vertexShader:y1,fragmentShader:v1}),this.compositeFullscreenQuad=new lt(new xn(2,2),this.compositeMaterial),this.compositeScene=new Jr,this.compositeScene.add(this.compositeFullscreenQuad)}destroy(){this.staticSceneRenderTarget.dispose(),this.animatedSceneRenderTarget.dispose(),this.alwaysOnTopSceneRenderTarget.dispose(),this.renderer.dispose()}renderComposite(t){this.renderer.setRenderTarget(t),this.renderer.clear(),this.renderer.getContext().depthMask(!1),this.renderer.render(this.compositeScene,this.compositeCamera),this.renderer.getContext().depthMask(!0)}renderToAnimatedBuffer(t,e){e.layers.set(hi.ANIMATED),this.renderer.setClearColor(new Ee,0),this.renderer.setRenderTarget(this.animatedSceneRenderTarget),this.renderer.clear(),this.renderer.render(t,e)}renderAnimated(t,e,i){this.renderToAnimatedBuffer(e,i),this.renderComposite(t)}renderToAlwaysOnTopBuffer(t,e){e.layers.set(hi.ALWAYS_ON_TOP),this.renderer.setClearColor(new Ee,0),this.renderer.setRenderTarget(this.alwaysOnTopSceneRenderTarget),this.renderer.clear(),this.renderer.render(t,e)}renderAlwaysOnTop(t,e,i){this.renderToAlwaysOnTopBuffer(e,i),this.renderComposite(t)}renderAll(t,e,i){i.layers.set(hi.STATIC),this.renderer.autoClear=!1,this.renderer.setClearColor(this.backgroundColor,this.backgroundAlpha),this.renderer.setRenderTarget(this.staticSceneRenderTarget),this.renderer.clear(),this.renderer.render(e,i),null!=this.mapboxOutdoorContext&&(this.renderer.state.reset(),this.mapboxOutdoorContext.render({resolution:this.renderer.getSize(new de),camera:i,renderTarget:this.staticSceneRenderTarget}),this.renderer.state.reset()),this.renderToAnimatedBuffer(e,i),this.renderToAlwaysOnTopBuffer(e,i),this.renderComposite(t)}render(t,e,i,n){t===Nt.ANIMATED?this.renderAnimated(e,i,n):t===Nt.ALWAYS_ON_TOP?this.renderAlwaysOnTop(e,i,n):t===Nt.ALL?this.renderAll(e,i,n):ge.error("Renderer.render called with invalid renderTask")}setBufferSize(t,e){this.renderer.setSize(t,e,!1),this.staticSceneRenderTarget.setSize(t,e),this.animatedSceneRenderTarget.setSize(t,e),this.alwaysOnTopSceneRenderTarget.setSize(t,e)}setBackgroundColor(t,e){this.backgroundColor=t,this.backgroundAlpha=e}setMapboxOutdoorContext(t){this.mapboxOutdoorContext=t}};function b1(t,e=!1){let i=null!==t[0].index,n=new Set(Object.keys(t[0].attributes)),r=new Set(Object.keys(t[0].morphAttributes)),s={},a={},o=t[0].morphTargetsRelative,l=new wt,h=0;for(let u=0;u<t.length;++u){let c=t[u],d=0;if(i!==(null!==c.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let t in c.attributes){if(!n.has(t))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+'. 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]),d++}if(d!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". Make sure all geometries have the same number of attributes."),null;if(o!==c.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let t in c.morphAttributes){if(!r.has(t))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". .morphAttributes must be consistent throughout all geometries."),null;void 0===a[t]&&(a[t]=[]),a[t].push(c.morphAttributes[t])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(c.userData),e){let t;if(i)t=c.index.count;else{if(void 0===c.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". The geometry must have either an index or a position attribute"),null;t=c.attributes.position.count}l.addGroup(h,t,u),h+=t}}if(i){let e=0,i=[];for(let n=0;n<t.length;++n){let r=t[n].index;for(let t=0;t<r.count;++t)i.push(r.getX(t)+e);e+=t[n].attributes.position.count}l.setIndex(i)}for(let t in s){let e=CM(s[t]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+t+" attribute."),null;l.setAttribute(t,e)}for(let t in a){let e=a[t][0].length;if(0===e)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[t]=[];for(let i=0;i<e;++i){let e=[];for(let n=0;n<a[t].length;++n)e.push(a[t][n][i]);let n=CM(e);if(!n)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+t+" morphAttribute."),null;l.morphAttributes[t].push(n)}}return l}function CM(t){let e,i,n,r=0;for(let s=0;s<t.length;++s){let a=t[s];if(a.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===e&&(e=a.array.constructor),e!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===i&&(i=a.itemSize),i!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===n&&(n=a.normalized),n!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;r+=a.array.length}let s=new e(r),a=0;for(let e=0;e<t.length;++e)s.set(t[e].array,a),a+=t[e].array.length;return new qt(s,i,n)}h(_1,"MultiBufferRenderer"),P(),P(),P(),h(b1,"mergeBufferGeometries"),h(CM,"mergeBufferAttributes"),P();var SR=h((function(t){let e=t.image,i=t.rotation||0,n=e.position.clone(),r=e.rotation.z,s=i,a=h((function(){let t=e.geometry;t.boundingBox||t.computeBoundingBox(),i=(i+Math.PI)%L0,e.rotation.z=e.rotation.z+Math.PI,e.translateX(-2*(t.boundingBox.min.x+(t.boundingBox.max.x-t.boundingBox.min.x)/2)),e.translateY(-2*(t.boundingBox.min.y+(t.boundingBox.max.y-t.boundingBox.min.y)/2))}),"flip");this.flipIfNeeded=function(t){let e=(i-t+L0)%L0;(e>Xh&&e<By||e<-Xh&&e>-By)&&a()},this.reset=function(){e.position.x=n.x,e.position.y=n.y,e.rotation.z=r,i=s}}),"FlippableImage"),LM=SR;P(),P(),P();var gd=class extends jn{constructor(t,e={}){let i=e.font;if(void 0===i)super();else{let n=i.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(n,e)}this.type="TextGeometry"}};h(gd,"TextGeometry");var Es=gn(zM(),1);P();var o3=gn(JM(),1);function $M(t){this.name="JSClipperError",this.message=t,this.stack=(new Error).stack}h($M,"JSClipperError"),$M.prototype=Error.prototype,o3.default.Error=function(t){throw new $M(t)};var bd=o3.default;P(),P();var qc=class{constructor(t){this.type="Font",this.data=t}generateShapes(t,e=100){let i=[],n=Hk(t,e,this.data);for(let t=0,e=n.length;t<e;t++)Array.prototype.push.apply(i,n[t].toShapes());return i}};function Hk(t,e,i){let n=Array.from(t),r=e/i.resolution,s=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*r,a=[],o=0,l=0;for(let t=0;t<n.length;t++){let e=n[t];if("\n"===e)o=0,l-=s;else{let t=Gk(e,r,o,l,i);o+=t.offsetX,a.push(t.path)}}return a}function Gk(t,e,i,n,r){let s=r.glyphs[t]||r.glyphs["?"];if(!s)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");let a,o,l,h,u,c,d,p,m=new yu;if(s.o){let t=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let r=0,s=t.length;r<s;)switch(t[r++]){case"m":a=t[r++]*e+i,o=t[r++]*e+n,m.moveTo(a,o);break;case"l":a=t[r++]*e+i,o=t[r++]*e+n,m.lineTo(a,o);break;case"q":l=t[r++]*e+i,h=t[r++]*e+n,u=t[r++]*e+i,c=t[r++]*e+n,m.quadraticCurveTo(u,c,l,h);break;case"b":l=t[r++]*e+i,h=t[r++]*e+n,u=t[r++]*e+i,c=t[r++]*e+n,d=t[r++]*e+i,p=t[r++]*e+n,m.bezierCurveTo(u,c,d,p,l,h)}}return{offsetX:s.ha*e,path:m}}h(qc,"Font"),h(Hk,"createPaths"),h(Gk,"createPath"),qc.prototype.isFont=!0;var Pc={glyphs:{0:{ha:765,x_min:66,x_max:700,o:"m 700 497 q 683 282 700 377 q 627 121 665 187 q 528 21 589 56 q 382 -14 468 -14 q 242 21 302 -14 q 144 121 183 56 q 86 282 105 187 q 66 497 66 377 q 84 712 66 617 q 139 872 101 807 q 236 972 176 938 q 382 1007 296 1007 q 522 973 463 1007 q 621 873 582 939 q 680 713 661 808 q 700 497 700 618 m 192 497 q 202 319 192 395 q 235 193 212 243 q 293 117 257 142 q 382 92 330 92 q 471 117 434 92 q 531 192 507 142 q 565 318 554 242 q 575 497 575 395 q 565 675 575 599 q 531 801 554 751 q 471 876 507 851 q 382 901 434 901 q 293 876 330 901 q 235 801 257 851 q 202 675 212 751 q 192 497 192 599 z "},1:{ha:765,x_min:121,x_max:482,o:"m 482 0 l 363 0 l 363 619 q 363 682 363 648 q 365 748 363 715 q 367 811 366 781 q 368 864 368 841 q 348 843 357 852 q 330 826 339 834 q 311 809 321 818 q 286 787 300 800 l 186 705 l 121 789 l 380 991 l 482 991 l 482 0 z "},2:{ha:765,x_min:65,x_max:684,o:"m 684 0 l 65 0 l 65 106 l 302 364 q 393 465 353 419 q 461 553 433 510 q 505 641 490 597 q 519 736 519 684 q 508 806 519 776 q 475 858 496 837 q 425 890 454 880 q 359 901 395 901 q 243 875 295 901 q 144 808 191 849 l 75 889 q 134 935 102 913 q 201 972 165 956 q 277 997 237 987 q 361 1006 317 1006 q 478 987 426 1006 q 568 935 531 969 q 624 851 604 901 q 644 741 644 802 q 626 631 644 683 q 577 528 608 578 q 502 427 545 477 q 407 321 458 376 l 216 118 l 216 113 l 684 113 l 684 0 z "},3:{ha:765,x_min:56,x_max:682,o:"m 652 760 q 636 669 652 710 q 592 599 621 629 q 525 550 564 569 q 437 522 486 530 l 437 518 q 620 442 557 503 q 682 282 682 380 q 660 163 682 217 q 593 69 638 109 q 480 8 549 30 q 318 -14 412 -14 q 179 -2 244 -14 q 56 40 113 9 l 56 155 q 183 107 115 124 q 315 90 252 90 q 423 104 378 90 q 498 142 469 117 q 542 204 528 168 q 555 286 555 241 q 537 365 555 332 q 486 419 519 398 q 405 451 453 441 q 297 461 357 461 l 207 461 l 207 564 l 297 564 q 395 577 352 564 q 466 616 437 591 q 510 675 495 641 q 525 751 525 710 q 513 814 525 787 q 478 862 500 842 q 425 891 456 881 q 355 901 393 901 q 228 879 283 901 q 122 819 172 856 l 60 904 q 117 943 85 925 q 186 976 149 962 q 266 998 223 989 q 355 1006 308 1006 q 484 987 429 1006 q 576 936 539 969 q 633 858 614 903 q 652 760 652 813 z "},4:{ha:765,x_min:16,x_max:737,o:"m 737 222 l 593 222 l 593 0 l 473 0 l 473 222 l 16 222 l 16 330 l 465 997 l 593 997 l 593 335 l 737 335 l 737 222 m 473 335 l 473 576 q 474 656 473 614 q 477 738 475 698 q 480 812 478 777 q 482 869 481 846 l 476 869 q 464 839 471 856 q 449 806 457 823 q 431 774 440 789 q 415 747 422 758 l 136 335 l 473 335 z "},5:{ha:765,x_min:89,x_max:688,o:"m 370 608 q 495 590 437 608 q 596 534 553 571 q 663 444 639 498 q 688 318 688 389 q 665 179 688 241 q 596 75 642 117 q 484 9 551 32 q 330 -14 417 -14 q 262 -10 296 -14 q 198 0 229 -7 q 139 16 167 6 q 89 40 111 26 l 89 157 q 141 129 111 141 q 205 109 172 117 q 272 96 238 100 q 334 92 305 92 q 429 104 387 92 q 500 143 471 117 q 545 210 530 170 q 561 304 561 250 q 501 453 561 401 q 328 504 441 504 q 288 502 309 504 q 245 498 267 500 q 204 492 224 495 q 171 486 185 489 l 110 525 l 147 991 l 615 991 l 615 879 l 254 879 l 228 595 q 285 604 250 599 q 370 608 321 608 z "},6:{ha:765,x_min:77,x_max:701,o:"m 77 424 q 84 566 77 495 q 109 701 91 636 q 158 821 127 766 q 237 918 189 877 q 353 982 286 959 q 510 1006 420 1006 q 538 1005 523 1006 q 570 1003 554 1004 q 601 999 586 1001 q 627 993 615 996 l 627 888 q 573 900 603 896 q 514 904 543 904 q 407 889 453 904 q 326 848 360 875 q 270 785 292 822 q 233 704 247 749 q 212 610 218 660 q 203 505 205 559 l 211 505 q 244 551 224 530 q 289 588 263 572 q 347 612 315 603 q 419 621 379 621 q 536 601 484 621 q 625 542 588 581 q 681 447 661 503 q 701 319 701 391 q 680 180 701 242 q 620 76 659 119 q 525 9 581 33 q 400 -14 469 -14 q 273 13 332 -14 q 170 94 214 39 q 102 230 127 148 q 77 424 77 312 m 399 90 q 473 104 439 90 q 531 146 507 118 q 569 217 555 174 q 582 319 582 260 q 571 405 582 367 q 537 469 559 442 q 481 509 515 495 q 403 524 448 524 q 320 508 357 524 q 256 466 282 492 q 215 408 229 441 q 200 343 200 376 q 213 253 200 298 q 250 172 225 208 q 312 113 275 136 q 399 90 349 90 z "},7:{ha:765,x_min:61,x_max:699,o:"m 191 0 l 572 879 l 61 879 l 61 991 l 699 991 l 699 893 l 322 0 l 191 0 z "},8:{ha:765,x_min:72,x_max:694,o:"m 383 1007 q 491 992 440 1007 q 579 947 541 977 q 640 873 618 918 q 663 768 663 828 q 649 686 663 723 q 612 620 635 650 q 555 567 588 591 q 485 525 523 544 q 562 478 524 504 q 629 420 600 452 q 676 348 659 388 q 694 258 694 308 q 672 145 694 196 q 608 60 649 95 q 510 5 567 24 q 383 -14 452 -14 q 251 5 309 -14 q 153 57 193 23 q 93 141 113 92 q 72 253 72 191 q 87 345 72 304 q 128 418 102 385 q 189 475 154 450 q 264 519 224 500 q 201 565 231 541 q 151 621 172 590 q 117 688 130 651 q 104 770 104 725 q 127 873 104 829 q 189 947 150 918 q 278 992 227 977 q 383 1007 328 1007 m 193 252 q 204 185 193 216 q 238 134 215 155 q 296 101 261 113 q 380 89 332 89 q 464 101 428 89 q 525 135 500 113 q 562 188 549 157 q 574 257 574 219 q 561 321 574 292 q 523 374 547 349 q 463 420 498 398 q 386 463 429 441 l 366 472 q 237 379 280 431 q 193 252 193 326 m 382 904 q 268 868 310 904 q 225 764 225 832 q 237 697 225 725 q 270 648 249 669 q 320 609 291 626 q 385 575 350 591 q 446 608 417 590 q 496 648 475 625 q 530 699 517 670 q 542 764 542 727 q 499 868 542 832 q 382 904 456 904 z "},9:{ha:765,x_min:72,x_max:697,o:"m 697 568 q 690 426 697 497 q 665 291 683 355 q 616 171 647 227 q 536 74 585 115 q 421 10 488 33 q 264 -14 354 -14 q 235 -13 251 -14 q 204 -11 220 -12 q 174 -7 189 -9 q 147 -1 159 -5 l 147 104 q 201 92 171 96 q 260 87 231 87 q 410 119 351 87 q 504 206 469 151 q 553 333 538 260 q 571 486 568 406 l 562 486 q 530 441 549 462 q 485 404 511 420 q 427 380 459 389 q 354 371 394 371 q 237 391 290 371 q 149 450 185 411 q 92 544 112 488 q 72 672 72 600 q 93 811 72 749 q 154 917 115 873 q 249 983 193 960 q 374 1006 304 1006 q 501 979 442 1006 q 604 899 560 953 q 672 762 647 844 q 697 568 697 680 m 375 901 q 301 888 334 901 q 243 846 267 874 q 205 774 218 817 q 192 672 192 731 q 203 587 192 625 q 237 523 214 549 q 293 482 259 496 q 371 468 326 468 q 454 484 417 468 q 518 525 492 500 q 559 583 545 551 q 574 648 574 616 q 561 739 574 694 q 524 820 549 784 q 462 879 499 857 q 375 901 425 901 z "}," ":{ha:361,x_min:0,x_max:0,o:""},"!":{ha:374,x_min:100,x_max:272,o:"m 228 281 l 146 281 l 111 991 l 262 991 l 228 281 m 100 75 q 106 119 100 101 q 125 148 113 137 q 152 164 136 159 q 186 170 168 170 q 219 164 203 170 q 247 148 235 159 q 265 119 258 137 q 272 75 272 101 q 265 32 272 50 q 247 3 258 14 q 219 -14 235 -9 q 186 -20 203 -20 q 152 -14 168 -20 q 125 3 136 -9 q 106 32 113 14 q 100 75 100 50 z "},'"':{ha:558,x_min:90,x_max:468,o:"m 224 991 l 196 633 l 118 633 l 90 991 l 224 991 m 468 991 l 440 633 l 363 633 l 335 991 l 468 991 z "},"#":{ha:897,x_min:35,x_max:863,o:"m 667 606 l 624 383 l 814 383 l 814 290 l 606 290 l 550 0 l 450 0 l 507 290 l 310 290 l 254 0 l 157 0 l 210 290 l 35 290 l 35 383 l 228 383 l 272 606 l 86 606 l 86 699 l 289 699 l 345 991 l 444 991 l 389 699 l 587 699 l 644 991 l 742 991 l 685 699 l 863 699 l 863 606 l 667 606 m 328 383 l 525 383 l 568 606 l 371 606 l 328 383 z "},$:{ha:765,x_min:83,x_max:668,o:"m 668 302 q 651 216 668 255 q 603 149 634 178 q 526 102 571 121 q 424 75 481 83 l 424 -81 l 330 -81 l 330 69 q 262 72 296 69 q 195 81 227 75 q 134 96 162 87 q 83 117 105 105 l 83 233 q 135 211 106 222 q 197 191 165 200 q 264 177 230 182 q 330 171 298 171 l 330 465 q 225 508 270 486 q 152 559 181 530 q 109 625 123 588 q 94 713 94 663 q 111 796 94 758 q 158 862 127 833 q 233 908 189 890 q 330 932 277 926 l 330 1054 l 424 1054 l 424 935 q 549 917 492 931 q 652 882 606 903 l 607 783 q 522 814 569 800 q 424 832 474 828 l 424 546 q 529 503 484 525 q 606 452 575 480 q 652 388 637 424 q 668 302 668 351 m 549 302 q 542 343 549 325 q 520 377 535 362 q 482 406 506 393 q 424 431 458 418 l 424 178 q 518 220 487 187 q 549 302 549 254 m 214 711 q 219 668 214 687 q 239 632 225 648 q 275 604 252 616 q 330 579 297 591 l 330 829 q 242 788 270 819 q 214 711 214 758 z "},"%":{ha:1146,x_min:69,x_max:1076,o:"m 170 696 q 194 528 170 584 q 272 472 218 472 q 378 696 378 472 q 272 918 378 918 q 194 863 218 918 q 170 696 170 808 m 478 696 q 466 564 478 623 q 429 466 454 506 q 365 405 404 426 q 272 383 326 383 q 184 405 222 383 q 121 466 146 426 q 82 564 95 506 q 69 696 69 623 q 81 827 69 769 q 118 924 93 884 q 181 985 142 964 q 272 1006 219 1006 q 361 985 323 1006 q 426 924 399 964 q 465 827 452 884 q 478 696 478 769 m 768 298 q 792 131 768 186 q 871 75 817 75 q 977 298 977 75 q 871 521 977 521 q 792 466 817 521 q 768 298 768 410 m 1076 298 q 1064 167 1076 225 q 1027 69 1053 109 q 963 8 1002 29 q 871 -14 924 -14 q 783 8 821 -14 q 719 69 745 29 q 681 167 694 109 q 668 298 668 225 q 680 429 668 372 q 716 527 692 487 q 780 587 741 566 q 871 608 818 608 q 960 587 922 608 q 1024 527 998 566 q 1063 429 1050 487 q 1076 298 1076 372 m 903 991 l 353 0 l 245 0 l 796 991 l 903 991 z "},"&":{ha:975,x_min:74,x_max:953,o:"m 286 790 q 292 745 286 767 q 308 701 297 723 q 337 656 319 679 q 379 608 355 633 q 448 653 419 632 q 496 696 477 674 q 525 741 515 718 q 534 793 534 765 q 526 838 534 817 q 502 873 517 859 q 463 897 486 888 q 412 905 441 905 q 320 875 354 905 q 286 790 286 845 m 378 96 q 450 103 417 96 q 512 125 484 111 q 565 157 541 138 q 611 196 589 175 l 349 472 q 286 428 313 450 q 240 382 259 407 q 212 329 222 358 q 203 262 203 300 q 215 195 203 226 q 249 142 227 164 q 304 108 271 120 q 378 96 336 96 m 74 258 q 87 353 74 311 q 127 428 101 394 q 191 491 153 462 q 277 549 229 520 q 235 599 256 573 q 200 655 215 625 q 175 718 184 684 q 165 790 165 751 q 182 881 165 841 q 231 950 199 922 q 310 992 263 978 q 416 1007 357 1007 q 517 992 473 1007 q 592 950 562 978 q 640 881 623 922 q 656 790 656 841 q 639 710 656 747 q 593 641 622 673 q 528 583 565 610 q 450 532 491 556 l 689 279 q 722 319 707 299 q 748 363 736 340 q 769 412 760 386 q 785 471 778 439 l 909 471 q 885 388 899 426 q 853 317 871 351 q 813 255 836 284 q 765 199 791 227 l 953 0 l 800 0 l 686 117 q 621 62 653 86 q 551 21 588 38 q 473 -4 515 5 q 378 -14 431 -14 q 250 4 307 -14 q 154 57 193 22 q 95 143 115 92 q 74 258 74 193 z "},"'":{ha:314,x_min:90,x_max:224,o:"m 224 991 l 196 633 l 118 633 l 90 991 l 224 991 z "},"(":{ha:418,x_min:56,x_max:376,o:"m 56 380 q 68 548 56 465 q 105 708 80 630 q 169 857 130 785 q 260 991 207 928 l 376 991 q 232 704 281 861 q 183 382 183 547 q 196 221 183 301 q 232 64 208 141 q 292 -84 256 -12 q 375 -220 328 -156 l 260 -220 q 169 -89 207 -159 q 105 57 130 -19 q 68 215 80 134 q 56 380 56 296 z "},")":{ha:418,x_min:41,x_max:363,o:"m 363 380 q 351 215 363 296 q 313 57 338 134 q 249 -89 288 -19 q 158 -220 211 -159 l 43 -220 q 125 -84 90 -156 q 186 64 161 -12 q 222 221 210 141 q 235 382 235 301 q 186 704 235 547 q 41 991 137 861 l 158 991 q 249 857 211 928 q 313 708 288 785 q 351 548 338 630 q 363 380 363 465 z "},"*":{ha:765,x_min:56,x_max:708,o:"m 450 1055 l 421 789 l 690 864 l 708 733 l 452 714 l 618 493 l 497 428 l 378 671 l 271 428 l 146 493 l 310 714 l 56 733 l 75 864 l 340 789 l 311 1055 l 450 1055 z "},"+":{ha:765,x_min:69,x_max:696,o:"m 332 439 l 69 439 l 69 541 l 332 541 l 332 804 l 433 804 l 433 541 l 696 541 l 696 439 l 433 439 l 433 178 l 332 178 l 332 439 z "},",":{ha:347,x_min:43,x_max:256,o:"m 245 161 l 256 146 q 233 68 246 109 q 204 -16 220 26 q 171 -99 188 -58 q 136 -179 153 -141 l 43 -179 q 63 -93 53 -138 q 82 -4 73 -48 q 98 83 91 41 q 111 161 106 125 l 245 161 z "},"-":{ha:447,x_min:56,x_max:392,o:"m 56 315 l 56 429 l 392 429 l 392 315 l 56 315 z "},".":{ha:372,x_min:100,x_max:272,o:"m 100 75 q 106 119 100 101 q 125 148 113 137 q 152 164 136 159 q 186 170 168 170 q 219 164 203 170 q 247 148 235 159 q 265 119 258 137 q 272 75 272 101 q 265 32 272 50 q 247 3 258 14 q 219 -14 235 -9 q 186 -20 203 -20 q 152 -14 168 -20 q 125 3 136 -9 q 106 32 113 14 q 100 75 100 50 z "},"/":{ha:518,x_min:14,x_max:504,o:"m 504 991 l 135 0 l 14 0 l 383 991 l 504 991 z "},":":{ha:372,x_min:100,x_max:272,o:"m 100 75 q 106 119 100 101 q 125 148 113 137 q 152 164 136 159 q 186 170 168 170 q 219 164 203 170 q 247 148 235 159 q 265 119 258 137 q 272 75 272 101 q 265 32 272 50 q 247 3 258 14 q 219 -14 235 -9 q 186 -20 203 -20 q 152 -14 168 -20 q 125 3 136 -9 q 106 32 113 14 q 100 75 100 50 m 100 669 q 106 714 100 696 q 125 743 113 732 q 152 759 136 754 q 186 764 168 764 q 219 759 203 764 q 247 743 235 754 q 265 714 258 732 q 272 669 272 696 q 265 627 272 644 q 247 597 258 609 q 219 581 235 586 q 186 575 203 575 q 152 581 168 575 q 125 597 136 586 q 106 627 113 609 q 100 669 100 644 z "},";":{ha:372,x_min:43,x_max:272,o:"m 245 161 l 256 146 q 233 68 246 109 q 204 -16 220 26 q 171 -99 188 -58 q 136 -179 153 -141 l 43 -179 q 63 -93 53 -138 q 82 -4 73 -48 q 98 83 91 41 q 111 161 106 125 l 245 161 m 100 669 q 106 714 100 696 q 125 743 113 732 q 152 759 136 754 q 186 764 168 764 q 219 759 203 764 q 247 743 235 754 q 265 714 258 732 q 272 669 272 696 q 265 627 272 644 q 247 597 258 609 q 219 581 235 586 q 186 575 203 575 q 152 581 168 575 q 125 597 136 586 q 106 627 113 609 q 100 669 100 644 z "},"<":{ha:765,x_min:69,x_max:696,o:"m 696 161 l 69 449 l 69 518 l 696 844 l 696 736 l 197 489 l 696 271 l 696 161 z "},"=":{ha:765,x_min:69,x_max:696,o:"m 69 578 l 69 679 l 696 679 l 696 578 l 69 578 m 69 300 l 69 401 l 696 401 l 696 300 l 69 300 z "},">":{ha:765,x_min:69,x_max:696,o:"m 69 271 l 568 489 l 69 736 l 69 844 l 696 518 l 696 449 l 69 161 l 69 271 z "},"?":{ha:591,x_min:25,x_max:546,o:"m 191 281 l 191 306 q 196 376 191 345 q 214 434 201 407 q 250 487 227 461 q 306 542 272 513 q 361 592 338 570 q 399 638 385 615 q 421 689 414 662 q 428 751 428 715 q 418 811 428 784 q 388 857 408 838 q 340 887 369 876 q 273 897 311 897 q 166 880 217 897 q 68 839 115 862 l 25 937 q 144 986 80 966 q 273 1006 208 1006 q 387 988 336 1006 q 473 939 437 971 q 527 859 508 906 q 546 753 546 812 q 537 672 546 707 q 509 606 528 636 q 464 547 491 575 q 400 486 437 518 q 342 433 365 456 q 307 389 320 410 q 290 345 294 368 q 285 293 285 323 l 285 281 l 191 281 m 158 75 q 165 119 158 101 q 183 148 172 137 q 210 164 195 159 q 244 170 226 170 q 278 164 262 170 q 305 148 294 159 q 323 119 317 137 q 330 75 330 101 q 323 32 330 50 q 305 3 317 14 q 278 -14 294 -9 q 244 -20 262 -20 q 210 -14 226 -20 q 183 3 195 -9 q 165 32 172 14 q 158 75 158 50 z "},"@":{ha:1203,x_min:74,x_max:1129,o:"m 1129 496 q 1123 411 1129 454 q 1104 331 1116 369 q 1072 259 1091 292 q 1027 202 1053 227 q 968 164 1001 178 q 896 150 935 150 q 841 160 865 150 q 798 187 816 170 q 769 226 781 204 q 754 272 758 248 l 751 272 q 721 224 739 247 q 679 185 703 202 q 624 159 654 169 q 558 150 594 150 q 466 169 506 150 q 397 222 425 188 q 355 304 370 256 q 340 411 340 353 q 360 536 340 479 q 418 635 380 593 q 509 699 456 676 q 629 722 563 722 q 690 720 660 722 q 749 712 721 717 q 800 702 777 707 q 839 690 823 696 l 823 408 q 822 384 823 393 q 822 370 822 375 q 822 361 822 364 q 822 357 822 359 q 829 298 822 321 q 848 261 836 275 q 874 242 859 248 q 904 237 888 237 q 959 258 935 237 q 999 314 983 279 q 1023 397 1015 349 q 1031 497 1031 444 q 1002 668 1031 593 q 921 795 972 743 q 799 873 869 846 q 644 900 728 900 q 442 862 530 900 q 295 757 355 825 q 205 597 236 690 q 175 395 175 505 q 202 213 175 292 q 280 79 229 134 q 409 -3 332 25 q 586 -31 486 -31 q 668 -26 627 -31 q 746 -13 708 -21 q 817 6 783 -5 q 880 28 851 16 l 880 -68 q 749 -109 822 -94 q 587 -123 675 -123 q 371 -89 466 -123 q 209 12 275 -54 q 109 173 143 78 q 74 390 74 269 q 114 628 74 517 q 228 819 154 738 q 408 945 302 899 q 644 991 513 991 q 839 957 750 991 q 992 859 928 923 q 1093 703 1057 795 q 1129 496 1129 611 m 449 408 q 483 278 449 318 q 575 237 517 237 q 639 253 612 237 q 682 296 665 268 q 708 363 699 324 q 720 449 717 402 l 729 621 q 684 630 710 626 q 629 635 658 635 q 545 615 579 635 q 489 564 511 595 q 458 491 468 532 q 449 408 449 450 z "},A:{ha:844,x_min:0,x_max:844,o:"m 715 0 l 607 307 l 237 307 l 127 0 l 0 0 l 364 996 l 479 996 l 844 0 l 715 0 m 567 419 l 467 707 q 457 736 463 719 q 445 774 451 754 q 433 817 439 795 q 421 860 427 839 q 410 817 416 839 q 398 773 404 794 q 386 735 392 753 q 376 707 380 718 l 278 419 l 567 419 z "},B:{ha:863,x_min:135,x_max:786,o:"m 135 991 l 406 991 q 558 978 492 991 q 669 936 625 965 q 736 858 713 906 q 758 741 758 810 q 745 662 758 699 q 707 597 732 625 q 645 551 682 570 q 561 526 608 532 l 561 519 q 649 496 608 511 q 720 454 690 481 q 768 387 751 427 q 786 288 786 346 q 764 166 786 220 q 700 76 742 113 q 599 20 659 39 q 464 0 539 0 l 135 0 l 135 991 m 261 571 l 427 571 q 522 581 484 571 q 585 611 561 591 q 619 662 608 631 q 629 732 629 692 q 577 848 629 813 q 412 884 525 884 l 261 884 l 261 571 m 261 465 l 261 107 l 441 107 q 542 121 501 107 q 607 159 582 134 q 642 217 631 183 q 653 293 653 252 q 642 363 653 331 q 605 417 631 395 q 538 453 580 440 q 433 465 496 465 l 261 465 z "},C:{ha:838,x_min:85,x_max:798,o:"m 538 895 q 406 867 465 895 q 306 788 347 840 q 241 663 264 736 q 218 496 218 589 q 238 326 218 400 q 298 201 258 252 q 398 123 338 150 q 538 97 458 97 q 652 109 598 97 q 760 136 707 121 l 760 26 q 707 8 733 16 q 651 -4 680 1 q 590 -11 623 -9 q 517 -14 557 -14 q 324 23 406 -14 q 190 127 243 60 q 111 288 136 194 q 85 497 85 382 q 114 703 85 610 q 201 864 144 797 q 343 968 258 931 q 538 1006 428 1006 q 677 991 611 1006 q 798 947 744 976 l 745 842 q 652 879 702 863 q 538 895 602 895 z "},D:{ha:950,x_min:135,x_max:865,o:"m 865 505 q 833 285 865 380 q 739 127 800 191 q 587 32 677 64 q 383 0 497 0 l 135 0 l 135 991 l 411 991 q 599 960 515 991 q 742 868 683 929 q 833 715 801 806 q 865 505 865 625 m 732 501 q 709 672 732 600 q 644 791 687 745 q 539 861 602 838 q 397 884 477 884 l 261 884 l 261 109 l 371 109 q 641 208 550 109 q 732 501 732 307 z "},E:{ha:733,x_min:135,x_max:650,o:"m 650 0 l 135 0 l 135 991 l 650 991 l 650 880 l 261 880 l 261 574 l 624 574 l 624 464 l 261 464 l 261 111 l 650 111 l 650 0 z "},F:{ha:682,x_min:135,x_max:650,o:"m 261 0 l 135 0 l 135 991 l 650 991 l 650 880 l 261 880 l 261 530 l 624 530 l 624 419 l 261 419 l 261 0 z "},G:{ha:958,x_min:85,x_max:859,o:"m 530 524 l 859 524 l 859 37 q 783 16 821 25 q 705 0 745 6 q 621 -10 665 -7 q 526 -14 577 -14 q 338 22 420 -14 q 199 124 256 58 q 114 284 143 190 q 85 497 85 379 q 117 708 85 614 q 211 868 149 802 q 363 970 273 935 q 570 1006 454 1006 q 714 991 645 1006 q 843 947 783 976 l 794 838 q 742 859 770 849 q 684 877 713 869 q 622 890 654 885 q 559 895 591 895 q 413 867 477 895 q 306 788 349 840 q 241 663 263 736 q 218 496 218 589 q 237 334 218 408 q 296 208 256 261 q 401 126 337 155 q 557 97 466 97 q 611 99 587 97 q 657 103 636 100 q 697 110 678 106 q 733 117 715 113 l 733 412 l 530 412 l 530 524 z "},H:{ha:974,x_min:135,x_max:839,o:"m 839 0 l 713 0 l 713 463 l 261 463 l 261 0 l 135 0 l 135 991 l 261 991 l 261 574 l 713 574 l 713 991 l 839 991 l 839 0 z "},I:{ha:471,x_min:56,x_max:415,o:"m 415 0 l 56 0 l 56 69 l 172 97 l 172 895 l 56 922 l 56 991 l 415 991 l 415 922 l 298 895 l 298 97 l 415 69 l 415 0 z "},J:{ha:376,x_min:-125,x_max:252,o:"m -20 -264 q -80 -259 -54 -264 q -125 -248 -106 -255 l -125 -139 q -75 -149 -102 -145 q -18 -153 -49 -153 q 32 -146 7 -153 q 78 -123 58 -140 q 112 -76 99 -106 q 125 0 125 -46 l 125 991 l 252 991 l 252 14 q 232 -110 252 -58 q 176 -196 212 -162 q 91 -247 140 -231 q -20 -264 41 -264 z "},K:{ha:804,x_min:135,x_max:804,o:"m 804 0 l 661 0 l 355 473 l 261 396 l 261 0 l 135 0 l 135 991 l 261 991 l 261 496 l 343 610 l 650 991 l 791 991 l 439 559 l 804 0 z "},L:{ha:682,x_min:135,x_max:650,o:"m 135 0 l 135 991 l 261 991 l 261 113 l 650 113 l 650 0 l 135 0 z "},M:{ha:1208,x_min:135,x_max:1074,o:"m 545 0 l 244 868 l 239 868 q 245 768 243 818 q 250 679 248 726 q 252 593 252 631 l 252 0 l 135 0 l 135 991 l 322 991 l 602 183 l 606 183 l 886 991 l 1074 991 l 1074 0 l 947 0 l 947 602 q 949 682 947 637 q 952 769 950 728 q 957 867 955 817 l 951 867 l 648 0 l 545 0 z "},N:{ha:1013,x_min:135,x_max:878,o:"m 878 0 l 732 0 l 244 821 l 239 821 q 245 717 243 768 q 250 625 248 673 q 252 538 252 576 l 252 0 l 135 0 l 135 991 l 279 991 l 765 175 l 770 175 q 765 277 768 227 q 763 321 764 298 q 761 367 762 344 q 760 410 760 389 q 760 449 760 431 l 760 991 l 878 991 l 878 0 z "},O:{ha:1031,x_min:85,x_max:945,o:"m 945 497 q 917 288 945 382 q 836 127 890 194 q 701 23 781 60 q 515 -14 621 -14 q 324 23 405 -14 q 190 127 243 60 q 111 289 136 194 q 85 498 85 383 q 111 708 85 614 q 190 868 136 802 q 325 971 243 935 q 517 1007 406 1007 q 702 971 622 1007 q 836 868 781 935 q 917 707 890 801 q 945 497 945 613 m 218 497 q 236 330 218 404 q 290 204 254 256 q 382 124 326 152 q 515 97 438 97 q 649 124 593 97 q 741 204 705 152 q 794 330 777 256 q 811 497 811 404 q 794 665 811 591 q 741 790 777 739 q 650 868 705 841 q 517 896 594 896 q 383 868 439 896 q 290 790 327 841 q 236 665 254 739 q 218 497 218 591 z "},P:{ha:800,x_min:135,x_max:729,o:"m 729 701 q 710 583 729 640 q 649 482 692 526 q 536 412 606 438 q 363 386 466 386 l 261 386 l 261 0 l 135 0 l 135 991 l 380 991 q 537 972 471 991 q 646 916 603 953 q 709 825 688 879 q 729 701 729 770 m 261 493 l 349 493 q 459 504 412 493 q 537 539 506 515 q 583 601 568 563 q 599 694 599 640 q 543 837 599 791 q 370 884 488 884 l 261 884 l 261 493 z "},Q:{ha:1029,x_min:85,x_max:945,o:"m 945 497 q 928 332 945 408 q 879 194 911 255 q 799 87 847 132 q 688 17 751 43 q 763 -95 717 -47 q 871 -184 810 -144 l 789 -281 q 660 -164 719 -231 q 567 -11 602 -97 q 542 -13 555 -12 q 515 -14 528 -14 q 324 23 405 -14 q 190 127 243 60 q 111 289 136 194 q 85 498 85 383 q 111 708 85 614 q 190 868 136 802 q 325 971 243 935 q 517 1007 406 1007 q 702 971 622 1007 q 836 868 781 935 q 917 707 890 801 q 945 497 945 613 m 218 497 q 236 330 218 404 q 290 204 254 256 q 382 124 326 152 q 515 97 438 97 q 649 124 593 97 q 741 204 705 152 q 794 330 777 256 q 811 497 811 404 q 794 665 811 591 q 741 790 777 739 q 650 868 705 841 q 517 896 594 896 q 383 868 439 896 q 290 790 327 841 q 236 665 254 739 q 218 497 218 591 z "},R:{ha:819,x_min:135,x_max:803,o:"m 261 410 l 261 0 l 135 0 l 135 991 l 376 991 q 643 922 557 991 q 729 710 729 852 q 712 607 729 651 q 668 531 696 563 q 606 479 641 500 q 533 444 570 458 l 803 0 l 654 0 l 416 410 l 261 410 m 261 517 l 372 517 q 476 529 433 517 q 546 564 519 541 q 586 622 574 587 q 599 704 599 657 q 585 787 599 753 q 543 842 571 821 q 472 874 515 864 q 370 884 429 884 l 261 884 l 261 517 z "},S:{ha:721,x_min:71,x_max:657,o:"m 657 265 q 634 148 657 199 q 567 60 610 96 q 461 5 524 24 q 321 -14 399 -14 q 180 -2 245 -14 q 71 33 115 10 l 71 154 q 123 133 94 143 q 185 114 153 122 q 252 101 218 106 q 321 96 287 96 q 481 136 429 96 q 533 253 533 177 q 523 317 533 290 q 489 367 513 344 q 422 411 464 389 q 318 457 381 432 q 213 509 258 481 q 140 572 169 537 q 97 652 111 608 q 83 754 83 697 q 105 861 83 814 q 166 940 127 907 q 260 989 205 972 q 380 1006 315 1006 q 526 990 461 1006 q 640 951 590 975 l 595 846 q 495 880 551 865 q 379 895 439 895 q 251 856 296 895 q 205 753 205 818 q 216 686 205 714 q 250 635 226 658 q 312 592 273 612 q 408 550 351 572 q 516 500 470 526 q 594 441 563 474 q 641 366 625 409 q 657 265 657 323 z "},T:{ha:721,x_min:14,x_max:707,o:"m 424 0 l 297 0 l 297 880 l 14 880 l 14 991 l 707 991 l 707 880 l 424 880 l 424 0 z "},U:{ha:970,x_min:125,x_max:844,o:"m 844 993 l 844 350 q 822 206 844 273 q 754 91 800 140 q 641 14 709 42 q 481 -14 573 -14 q 328 13 394 -14 q 216 87 261 39 q 148 202 171 135 q 125 353 125 270 l 125 991 l 252 991 l 252 346 q 310 162 252 227 q 488 97 369 97 q 591 115 548 97 q 663 167 635 134 q 704 246 690 200 q 718 347 718 292 l 718 993 l 844 993 z "},V:{ha:789,x_min:0,x_max:789,o:"m 654 991 l 789 991 l 457 0 l 330 0 l 0 991 l 134 991 l 334 363 q 368 244 353 301 q 393 136 382 186 q 419 244 404 186 q 456 367 435 301 l 654 991 z "},W:{ha:1227,x_min:14,x_max:1214,o:"m 549 991 l 682 991 l 838 411 q 858 335 848 373 q 876 261 867 297 q 891 194 884 226 q 901 136 897 162 q 908 193 904 162 q 918 257 912 223 q 929 325 923 290 q 943 393 936 360 l 1079 991 l 1214 991 l 965 0 l 838 0 l 665 636 q 647 707 656 671 q 631 776 638 744 q 615 848 623 813 q 600 777 608 814 q 585 707 593 745 q 567 632 576 669 l 403 0 l 275 0 l 14 991 l 147 991 l 298 389 q 313 324 307 357 q 326 257 320 290 q 336 193 332 224 q 345 136 341 162 q 353 195 348 161 q 365 264 358 228 q 379 339 372 301 q 396 410 387 376 l 549 991 z "},X:{ha:760,x_min:0,x_max:760,o:"m 760 0 l 616 0 l 376 431 l 127 0 l 0 0 l 307 518 l 21 991 l 155 991 l 380 612 l 607 991 l 736 991 l 450 522 l 760 0 z "},Y:{ha:732,x_min:0,x_max:732,o:"m 366 490 l 596 991 l 732 991 l 429 386 l 429 0 l 302 0 l 302 379 l 0 991 l 138 991 l 366 490 z "},Z:{ha:749,x_min:56,x_max:693,o:"m 693 0 l 56 0 l 56 98 l 538 879 l 69 879 l 69 991 l 679 991 l 679 893 l 197 113 l 693 113 l 693 0 z "},"[":{ha:421,x_min:111,x_max:386,o:"m 386 -220 l 111 -220 l 111 991 l 386 991 l 386 890 l 235 890 l 235 -118 l 386 -118 l 386 -220 z "},"\\":{ha:518,x_min:16,x_max:505,o:"m 136 991 l 505 0 l 385 0 l 16 991 l 136 991 z "},"]":{ha:421,x_min:35,x_max:310,o:"m 35 -118 l 186 -118 l 186 890 l 35 890 l 35 991 l 310 991 l 310 -220 l 35 -220 l 35 -118 z "},"^":{ha:739,x_min:28,x_max:711,o:"m 28 372 l 339 999 l 408 999 l 711 372 l 602 372 l 374 871 l 137 372 l 28 372 z "},_:{ha:571,x_min:-3,x_max:574,o:"m 574 -220 l -3 -220 l -3 -125 l 574 -125 l 574 -220 z "},"`":{ha:802,x_min:267,x_max:533,o:"m 533 842 l 452 842 q 400 889 428 861 q 346 947 372 917 q 299 1004 320 977 q 267 1050 277 1031 l 267 1064 l 415 1064 q 440 1014 426 1041 q 471 959 455 986 q 503 905 486 931 q 533 860 519 880 l 533 842 z "},a:{ha:737,x_min:64,x_max:627,o:"m 538 0 l 513 103 l 507 103 q 463 51 485 73 q 414 14 440 28 q 355 -7 387 0 q 279 -14 322 -14 q 193 0 233 -14 q 125 40 154 13 q 80 110 96 68 q 64 208 64 151 q 142 379 64 319 q 380 444 220 439 l 505 449 l 505 496 q 495 572 505 541 q 467 621 486 602 q 421 648 448 640 q 358 656 393 656 q 253 640 302 656 q 160 600 205 623 l 117 693 q 229 739 167 720 q 358 758 290 758 q 478 744 427 758 q 561 700 528 730 q 610 623 594 670 q 627 510 627 576 l 627 0 l 538 0 m 311 86 q 388 99 353 86 q 449 138 423 112 q 489 204 475 164 q 504 297 504 243 l 504 364 l 407 359 q 304 346 346 357 q 238 316 263 335 q 203 269 214 296 q 192 207 192 241 q 225 115 192 144 q 311 86 258 86 z "},b:{ha:814,x_min:118,x_max:737,o:"m 454 758 q 570 734 518 758 q 660 661 623 709 q 717 541 696 612 q 737 374 737 469 q 717 206 737 278 q 660 85 696 134 q 570 11 623 36 q 454 -14 518 -14 q 382 -5 414 -14 q 323 19 349 4 q 277 53 297 33 q 241 94 257 73 l 233 94 l 208 0 l 118 0 l 118 1055 l 241 1055 l 241 800 q 241 750 241 777 q 239 700 240 723 q 236 647 237 673 l 241 647 q 277 691 257 671 q 322 726 296 711 q 381 750 349 741 q 454 758 414 758 m 431 656 q 340 638 376 656 q 282 586 304 621 q 251 498 260 551 q 241 374 241 445 q 251 252 241 305 q 282 162 260 199 q 340 107 304 126 q 432 89 377 89 q 567 163 524 89 q 610 375 610 237 q 567 586 610 516 q 431 656 524 656 z "},c:{ha:643,x_min:77,x_max:596,o:"m 403 -14 q 275 8 334 -14 q 171 76 215 29 q 102 194 127 122 q 77 368 77 267 q 102 549 77 475 q 173 670 128 623 q 279 737 218 716 q 408 758 339 758 q 512 747 461 758 q 596 718 562 735 l 559 614 q 525 627 544 621 q 486 638 506 633 q 446 647 465 644 q 408 650 426 650 q 253 582 302 650 q 204 370 204 513 q 253 160 204 227 q 403 94 302 94 q 502 107 458 94 q 583 136 547 119 l 583 26 q 505 -3 547 7 q 403 -14 463 -14 z "},d:{ha:814,x_min:77,x_max:696,o:"m 578 100 l 572 100 q 537 56 557 77 q 491 20 517 35 q 433 -5 465 4 q 359 -14 400 -14 q 244 11 296 -14 q 155 84 192 35 q 97 204 117 132 q 77 371 77 276 q 97 539 77 467 q 155 660 117 611 q 244 733 192 709 q 359 758 296 758 q 432 749 399 758 q 491 726 465 741 q 537 691 517 711 q 572 650 557 671 l 581 650 q 576 694 578 673 q 574 730 575 711 q 572 760 572 749 l 572 1055 l 696 1055 l 696 0 l 596 0 l 578 100 m 383 89 q 470 104 435 89 q 528 152 506 120 q 561 232 550 184 q 572 343 571 279 l 572 371 q 563 493 572 439 q 532 582 554 546 q 473 637 510 618 q 382 656 437 656 q 247 582 290 656 q 204 370 204 508 q 247 158 204 228 q 383 89 290 89 z "},e:{ha:743,x_min:77,x_max:673,o:"m 412 -14 q 276 12 338 -14 q 170 85 214 37 q 101 204 125 133 q 77 367 77 275 q 99 532 77 459 q 162 655 121 604 q 259 732 203 705 q 385 758 316 758 q 505 734 452 758 q 596 666 559 710 q 653 561 633 623 q 673 425 673 500 l 673 349 l 204 349 q 259 156 208 218 q 414 94 311 94 q 478 98 448 94 q 535 107 507 101 q 588 124 562 114 q 640 146 614 134 l 640 36 q 587 14 613 23 q 533 -2 561 4 q 476 -11 506 -8 q 412 -14 447 -14 m 382 656 q 259 603 304 656 q 207 449 214 550 l 541 449 q 531 533 541 495 q 503 599 522 572 q 454 641 484 626 q 382 656 424 656 z "},f:{ha:457,x_min:20,x_max:510,o:"m 441 652 l 275 652 l 275 0 l 151 0 l 151 652 l 20 652 l 20 703 l 151 749 l 151 814 q 166 934 151 886 q 211 1010 182 982 q 281 1051 239 1039 q 376 1063 323 1063 q 450 1055 416 1063 q 510 1038 484 1047 l 478 942 q 432 955 457 949 q 380 961 408 961 q 334 955 353 961 q 301 932 314 948 q 282 887 288 916 q 275 815 275 859 l 275 745 l 441 745 l 441 652 z "},g:{ha:720,x_min:25,x_max:692,o:"m 692 745 l 692 668 l 558 650 q 590 589 577 626 q 603 505 603 552 q 587 410 603 454 q 539 334 571 366 q 459 284 507 302 q 349 267 412 267 q 319 267 334 267 q 294 269 304 267 q 272 254 283 262 q 251 235 260 245 q 236 210 242 224 q 231 180 231 197 q 239 151 231 162 q 261 134 247 140 q 294 125 275 127 q 334 123 313 123 l 453 123 q 559 107 516 123 q 630 64 603 92 q 670 0 658 37 q 682 -78 682 -37 q 660 -185 682 -138 q 593 -266 638 -233 q 478 -316 547 -298 q 314 -334 408 -334 q 187 -319 241 -334 q 97 -278 133 -305 q 43 -213 61 -251 q 25 -126 25 -174 q 38 -55 25 -85 q 74 -1 52 -24 q 126 35 96 21 q 187 57 155 50 q 140 98 159 70 q 122 161 122 125 q 144 233 122 203 q 212 292 165 263 q 159 325 183 304 q 118 374 135 347 q 93 434 102 401 q 83 501 83 467 q 100 609 83 562 q 151 690 117 656 q 233 741 184 723 q 349 758 283 758 q 400 754 374 758 q 446 745 427 751 l 692 745 m 142 -122 q 151 -169 142 -147 q 179 -206 159 -191 q 232 -231 199 -222 q 314 -240 265 -240 q 503 -201 440 -240 q 566 -89 566 -162 q 557 -38 566 -58 q 531 -7 549 -18 q 481 8 512 4 q 407 12 451 12 l 288 12 q 238 7 264 12 q 191 -14 212 1 q 156 -55 170 -28 q 142 -122 142 -81 m 204 505 q 241 389 204 427 q 345 351 277 351 q 447 389 412 351 q 482 507 482 427 q 447 630 482 591 q 343 669 411 669 q 240 629 276 669 q 204 505 204 588 z "},h:{ha:818,x_min:118,x_max:707,o:"m 583 0 l 583 479 q 548 612 583 568 q 436 656 512 656 q 344 638 381 656 q 284 586 307 621 q 251 501 261 551 q 241 386 241 451 l 241 0 l 118 0 l 118 1055 l 241 1055 l 241 742 l 236 644 l 243 644 q 283 695 260 673 q 334 730 307 716 q 393 751 362 745 q 457 758 425 758 q 644 693 581 758 q 707 486 707 629 l 707 0 l 583 0 z "},i:{ha:359,x_min:109,x_max:253,o:"m 241 0 l 118 0 l 118 745 l 241 745 l 241 0 m 109 946 q 129 1005 109 987 q 180 1023 150 1023 q 209 1019 195 1023 q 232 1005 222 1015 q 247 981 241 996 q 253 946 253 966 q 232 887 253 907 q 180 868 210 868 q 129 887 150 868 q 109 946 109 906 z "},j:{ha:359,x_min:-46,x_max:253,o:"m 45 -334 q -9 -329 12 -334 q -46 -317 -31 -324 l -46 -216 q -10 -227 -28 -223 q 32 -231 8 -231 q 66 -225 50 -231 q 93 -207 81 -220 q 112 -172 105 -194 q 118 -115 118 -150 l 118 745 l 241 745 l 241 -107 q 230 -201 241 -159 q 194 -272 218 -243 q 133 -318 170 -302 q 45 -334 96 -334 m 109 946 q 129 1005 109 987 q 180 1023 150 1023 q 209 1019 195 1023 q 232 1005 222 1015 q 247 981 241 996 q 253 946 253 966 q 232 887 253 907 q 180 868 210 868 q 129 887 150 868 q 109 946 109 906 z "},k:{ha:689,x_min:118,x_max:684,o:"m 232 385 l 323 500 l 522 745 l 665 745 l 393 422 l 684 0 l 542 0 l 314 342 l 240 286 l 240 0 l 118 0 l 118 1055 l 240 1055 l 240 571 l 229 385 l 232 385 z "},l:{ha:359,x_min:118,x_max:241,o:"m 241 0 l 118 0 l 118 1055 l 241 1055 l 241 0 z "},m:{ha:1244,x_min:118,x_max:1133,o:"m 1010 0 l 1010 479 q 976 612 1010 568 q 871 656 942 656 q 787 640 821 656 q 730 593 752 624 q 698 516 708 562 q 688 411 688 471 l 688 0 l 564 0 l 564 479 q 530 612 564 568 q 425 656 496 656 q 338 638 373 656 q 281 586 302 621 q 251 501 260 551 q 241 386 241 451 l 241 0 l 118 0 l 118 745 l 218 745 l 236 644 l 243 644 q 281 695 259 673 q 331 730 304 716 q 388 751 357 745 q 449 758 418 758 q 584 728 530 758 q 664 635 638 699 l 669 635 q 712 690 687 667 q 766 728 736 713 q 828 751 795 743 q 895 758 861 758 q 1073 693 1013 758 q 1133 486 1133 629 l 1133 0 l 1010 0 z "},n:{ha:818,x_min:118,x_max:707,o:"m 583 0 l 583 479 q 548 612 583 568 q 436 656 512 656 q 344 638 381 656 q 284 586 307 621 q 251 501 261 551 q 241 386 241 451 l 241 0 l 118 0 l 118 745 l 218 745 l 236 644 l 243 644 q 283 695 260 673 q 334 730 307 716 q 393 751 362 745 q 457 758 425 758 q 644 693 581 758 q 707 486 707 629 l 707 0 l 583 0 z "},o:{ha:802,x_min:77,x_max:725,o:"m 725 374 q 702 209 725 281 q 637 87 680 136 q 534 12 595 38 q 399 -14 474 -14 q 270 12 329 -14 q 168 87 211 38 q 101 209 125 136 q 77 374 77 281 q 99 537 77 466 q 164 658 122 609 q 267 733 206 707 q 403 758 328 758 q 532 733 473 758 q 634 658 591 707 q 701 537 677 609 q 725 374 725 466 m 204 374 q 251 160 204 232 q 401 89 297 89 q 552 160 506 89 q 597 374 597 232 q 551 586 597 515 q 400 656 505 656 q 250 586 296 656 q 204 374 204 515 z "},p:{ha:814,x_min:118,x_max:737,o:"m 454 -14 q 382 -5 414 -14 q 323 19 349 4 q 277 53 297 33 q 241 94 257 73 l 233 94 q 237 50 235 71 q 240 14 239 33 q 241 -16 241 -5 l 241 -334 l 118 -334 l 118 745 l 218 745 l 236 644 l 241 644 q 277 689 257 668 q 322 725 296 709 q 381 749 349 740 q 454 758 414 758 q 570 734 518 758 q 660 661 623 709 q 717 541 696 612 q 737 374 737 469 q 717 206 737 278 q 660 85 696 134 q 570 11 623 36 q 454 -14 518 -14 m 431 656 q 343 640 379 656 q 286 593 308 625 q 253 513 264 561 q 241 401 243 466 l 241 374 q 251 252 241 305 q 282 162 260 199 q 340 107 304 126 q 432 89 377 89 q 567 163 524 89 q 610 375 610 237 q 567 586 610 516 q 431 656 524 656 z "},q:{ha:814,x_min:77,x_max:696,o:"m 383 89 q 470 104 435 89 q 528 152 506 120 q 561 232 550 184 q 572 343 571 279 l 572 371 q 563 493 572 439 q 532 582 554 546 q 473 637 510 618 q 382 656 437 656 q 247 582 290 656 q 204 370 204 508 q 247 158 204 228 q 383 89 290 89 m 359 -14 q 244 11 296 -14 q 155 84 192 35 q 97 204 117 132 q 77 371 77 276 q 97 539 77 467 q 155 660 117 611 q 244 733 192 709 q 359 758 296 758 q 432 749 399 758 q 490 725 465 740 q 536 689 516 709 q 572 644 557 668 l 578 644 l 596 745 l 696 745 l 696 -334 l 572 -334 l 572 -16 q 574 17 572 -3 q 576 55 575 37 q 581 100 578 77 l 572 100 q 537 56 557 77 q 491 20 517 35 q 433 -5 465 4 q 359 -14 400 -14 z "},r:{ha:554,x_min:118,x_max:526,o:"m 440 758 q 484 756 460 758 q 526 751 509 755 l 510 637 q 471 643 491 641 q 433 646 451 646 q 355 628 391 646 q 295 579 320 611 q 255 502 269 547 q 241 401 241 456 l 241 0 l 118 0 l 118 745 l 218 745 l 233 608 l 239 608 q 275 665 256 637 q 318 712 294 692 q 372 746 342 733 q 440 758 402 758 z "},s:{ha:627,x_min:61,x_max:564,o:"m 564 204 q 544 109 564 150 q 487 41 524 68 q 398 0 450 14 q 281 -14 346 -14 q 154 -2 207 -14 q 61 33 101 10 l 61 146 q 108 124 82 135 q 162 106 134 114 q 221 93 191 98 q 281 87 251 87 q 356 95 325 87 q 406 116 387 102 q 434 150 425 130 q 443 195 443 170 q 436 233 443 216 q 411 266 429 250 q 362 300 393 283 q 282 338 331 317 q 194 379 233 359 q 128 425 155 399 q 86 483 101 450 q 72 561 72 515 q 91 645 72 608 q 143 707 109 682 q 224 745 177 732 q 330 758 272 758 q 451 744 396 758 q 554 707 505 730 l 511 607 q 421 641 467 627 q 326 656 374 656 q 224 633 257 656 q 191 568 191 610 q 198 527 191 545 q 225 494 206 509 q 276 462 244 478 q 355 427 308 446 q 443 386 404 406 q 508 340 481 366 q 549 282 535 315 q 564 204 564 250 z "},t:{ha:471,x_min:22,x_max:444,o:"m 343 87 q 371 89 355 87 q 400 92 386 90 q 426 97 414 94 q 444 102 438 100 l 444 8 q 422 0 435 4 q 392 -7 408 -4 q 358 -12 376 -10 q 323 -14 340 -14 q 245 -3 281 -14 q 183 35 210 8 q 142 106 157 61 q 127 220 127 151 l 127 652 l 22 652 l 22 707 l 127 760 l 180 916 l 252 916 l 252 745 l 439 745 l 439 652 l 252 652 l 252 220 q 273 121 252 154 q 343 87 294 87 z "},u:{ha:818,x_min:111,x_max:700,o:"m 600 0 l 582 100 l 575 100 q 535 49 558 71 q 484 14 511 28 q 425 -7 456 0 q 361 -14 393 -14 q 252 2 299 -14 q 174 51 205 18 q 127 136 143 84 q 111 258 111 187 l 111 745 l 235 745 l 235 265 q 271 133 235 177 q 382 89 307 89 q 474 106 437 89 q 534 158 511 124 q 567 243 557 193 q 576 358 576 293 l 576 745 l 700 745 l 700 0 l 600 0 z "},v:{ha:665,x_min:0,x_max:665,o:"m 254 0 l 0 745 l 127 745 l 262 330 q 280 273 270 308 q 300 201 290 237 q 319 132 311 164 q 330 82 328 99 l 335 82 q 347 132 338 99 q 365 201 355 164 q 385 273 375 237 q 403 330 395 308 l 538 745 l 665 745 l 411 0 l 254 0 z "},w:{ha:1036,x_min:14,x_max:1022,o:"m 684 0 l 570 418 q 563 445 567 430 q 555 477 559 460 q 546 512 551 494 q 538 547 542 530 q 518 628 528 586 l 514 628 q 496 546 505 585 q 480 476 488 512 q 464 415 471 440 l 347 0 l 204 0 l 14 745 l 143 745 l 232 349 q 245 282 239 318 q 258 212 252 247 q 269 146 264 177 q 277 96 274 115 l 281 96 q 290 143 284 113 q 303 205 296 172 q 317 270 310 238 q 332 325 325 302 l 453 745 l 586 745 l 703 325 q 716 271 709 302 q 732 207 724 239 q 745 145 739 175 q 754 96 751 115 l 758 96 q 765 143 760 113 q 775 208 769 172 q 788 280 781 243 q 803 349 795 317 l 896 745 l 1022 745 l 829 0 l 684 0 z "},x:{ha:694,x_min:24,x_max:669,o:"m 277 382 l 37 745 l 178 745 l 347 467 l 517 745 l 657 745 l 416 382 l 669 0 l 529 0 l 347 296 l 164 0 l 24 0 l 277 382 z "},y:{ha:679,x_min:7,x_max:672,o:"m 7 745 l 135 745 l 281 329 q 300 272 290 302 q 318 212 310 242 q 333 155 327 182 q 342 103 339 127 l 346 103 q 357 149 349 120 q 373 211 364 178 q 392 276 382 244 q 410 330 402 308 l 545 745 l 672 745 l 378 -97 q 337 -196 359 -152 q 286 -270 315 -239 q 217 -317 256 -300 q 123 -334 178 -334 q 62 -330 88 -334 q 18 -322 37 -326 l 18 -224 q 54 -230 33 -227 q 100 -232 76 -232 q 156 -224 132 -232 q 197 -201 180 -216 q 228 -165 215 -186 q 250 -115 240 -143 l 289 -7 l 7 745 z "},z:{ha:612,x_min:56,x_max:557,o:"m 557 0 l 56 0 l 56 85 l 419 652 l 78 652 l 78 745 l 545 745 l 545 646 l 189 93 l 557 93 l 557 0 z "},"{":{ha:492,x_min:41,x_max:457,o:"m 339 -11 q 347 -64 339 -43 q 371 -97 355 -85 q 408 -113 386 -109 q 457 -118 430 -117 l 457 -220 q 360 -208 405 -219 q 284 -173 316 -197 q 233 -111 252 -149 q 215 -21 215 -74 l 215 205 q 171 304 215 275 q 41 334 126 334 l 41 439 q 171 468 126 439 q 215 567 215 497 l 215 793 q 233 883 215 846 q 284 944 252 920 q 360 980 316 968 q 457 991 405 991 l 457 890 q 408 885 430 890 q 371 869 386 881 q 347 837 355 857 q 339 783 339 816 l 339 558 q 299 445 339 487 q 180 390 258 404 l 180 382 q 299 327 258 368 q 339 214 339 286 l 339 -11 z "},"|":{ha:765,x_min:332,x_max:433,o:"m 332 1055 l 433 1055 l 433 -334 l 332 -334 l 332 1055 z "},"}":{ha:492,x_min:35,x_max:450,o:"m 153 214 q 193 327 153 286 q 311 382 233 368 l 311 390 q 193 445 233 404 q 153 558 153 487 l 153 783 q 144 837 153 816 q 121 869 136 857 q 84 885 106 881 q 35 890 62 890 l 35 991 q 131 980 87 991 q 208 944 176 968 q 258 883 240 920 q 277 793 277 846 l 277 567 q 288 507 277 532 q 321 468 299 483 q 376 446 343 452 q 450 439 408 439 l 450 334 q 321 304 366 334 q 277 205 277 275 l 277 -21 q 258 -111 277 -74 q 208 -173 240 -149 q 131 -208 176 -197 q 35 -220 87 -219 l 35 -118 q 84 -113 62 -117 q 121 -97 106 -109 q 144 -64 136 -85 q 153 -11 153 -43 l 153 214 z "},"~":{ha:765,x_min:69,x_max:696,o:"m 359 441 q 316 460 334 452 q 282 472 297 467 q 253 478 267 476 q 224 479 239 479 q 184 473 205 479 q 144 455 164 467 q 105 429 124 444 q 69 397 86 414 l 69 507 q 237 581 137 581 q 274 579 257 581 q 310 573 291 577 q 351 560 328 568 q 406 538 374 551 q 449 519 431 527 q 484 508 468 512 q 513 502 500 503 q 542 500 527 500 q 581 506 561 500 q 622 524 602 513 q 661 550 642 535 q 696 582 680 565 l 696 472 q 528 399 629 399 q 491 400 508 399 q 455 407 474 402 q 414 419 437 411 q 359 441 391 428 z "}," ":{ha:361,x_min:0,x_max:0,o:""},"¡":{ha:374,x_min:100,x_max:272,o:"m 144 458 l 227 458 l 261 -253 l 110 -253 l 144 458 m 272 664 q 266 620 272 638 q 247 591 259 602 q 220 575 235 580 q 186 570 204 570 q 153 575 168 570 q 125 591 137 580 q 106 620 113 602 q 100 664 100 638 q 106 707 100 689 q 125 736 113 724 q 153 753 137 747 q 186 758 168 758 q 220 753 204 758 q 247 736 235 747 q 266 707 259 724 q 272 664 272 689 z "},"¢":{ha:765,x_min:127,x_max:647,o:"m 635 163 q 564 134 601 144 q 475 122 526 123 l 475 -14 l 382 -14 l 382 126 q 276 160 323 135 q 196 231 229 186 q 145 343 163 276 q 127 504 127 411 q 145 668 127 600 q 196 783 163 737 q 276 855 229 829 q 382 889 323 880 l 382 1006 l 475 1006 l 475 895 q 570 881 524 892 q 647 854 616 870 l 611 750 q 576 763 595 757 q 537 775 557 770 q 497 783 517 780 q 460 786 477 786 q 304 718 353 786 q 256 505 256 649 q 305 297 256 363 q 454 231 354 231 q 554 243 509 231 q 635 272 598 256 l 635 163 z "},"£":{ha:765,x_min:46,x_max:718,o:"m 452 1004 q 583 989 524 1004 q 686 950 642 974 l 642 852 q 556 887 604 872 q 457 901 508 901 q 397 892 425 901 q 349 863 369 883 q 317 811 328 843 q 306 734 306 779 l 306 534 l 561 534 l 561 441 l 306 441 l 306 298 q 298 226 306 256 q 277 174 290 196 q 247 138 264 153 q 211 113 229 123 l 718 113 l 718 0 l 46 0 l 46 104 q 101 126 76 112 q 143 163 125 140 q 172 219 161 186 q 182 297 182 252 l 182 441 l 47 441 l 47 534 l 182 534 l 182 754 q 202 860 182 813 q 257 938 222 906 q 342 987 293 970 q 452 1004 392 1004 z "},"¤":{ha:765,x_min:83,x_max:681,o:"m 126 490 q 138 567 126 530 q 171 635 150 603 l 83 722 l 150 789 l 236 701 q 304 735 268 723 q 382 747 341 747 q 459 735 422 747 q 526 701 495 723 l 614 789 l 681 724 l 593 636 q 626 568 614 605 q 639 490 639 531 q 627 412 639 450 q 593 345 615 375 l 679 258 l 614 193 l 526 279 q 459 247 495 258 q 382 235 422 235 q 304 247 341 235 q 236 281 267 259 l 150 195 l 85 260 l 171 346 q 138 413 150 376 q 126 490 126 450 m 220 490 q 232 427 220 456 q 267 375 245 397 q 318 340 289 353 q 382 328 348 328 q 447 340 416 328 q 499 375 477 353 q 534 427 522 397 q 547 490 547 456 q 534 555 547 525 q 499 608 522 585 q 447 643 477 630 q 382 656 416 656 q 318 643 348 656 q 267 608 289 630 q 232 555 245 585 q 220 490 220 525 z "},"¥":{ha:765,x_min:20,x_max:746,o:"m 382 490 l 616 991 l 746 991 l 485 471 l 647 471 l 647 378 l 443 378 l 443 271 l 647 271 l 647 178 l 443 178 l 443 0 l 322 0 l 322 178 l 118 178 l 118 271 l 322 271 l 322 378 l 118 378 l 118 471 l 277 471 l 20 991 l 150 991 l 382 490 z "},"¦":{ha:765,x_min:332,x_max:433,o:"m 332 1055 l 433 1055 l 433 526 l 332 526 l 332 1055 m 332 196 l 433 196 l 433 -334 l 332 -334 l 332 196 z "},"§":{ha:675,x_min:82,x_max:585,o:"m 93 549 q 102 611 93 583 q 126 661 111 640 q 161 698 141 683 q 201 724 180 713 q 122 788 151 749 q 93 884 93 827 q 112 958 93 925 q 164 1015 130 991 q 245 1050 198 1038 q 351 1063 293 1063 q 470 1049 417 1063 q 572 1014 524 1036 l 534 920 q 443 952 490 939 q 347 965 395 965 q 245 945 280 965 q 211 886 211 925 q 219 852 211 868 q 247 822 227 837 q 298 791 266 807 q 378 755 330 775 q 465 714 427 736 q 530 666 503 692 q 570 607 556 640 q 585 532 585 574 q 576 468 585 496 q 554 416 568 439 q 523 376 541 393 q 486 349 505 359 q 559 286 533 323 q 585 196 585 249 q 565 110 585 148 q 508 46 545 73 q 419 7 471 20 q 301 -7 366 -7 q 175 4 228 -7 q 82 37 122 16 l 82 144 q 129 124 103 134 q 183 106 155 114 q 242 94 212 98 q 301 89 272 89 q 379 97 348 89 q 430 118 411 105 q 456 149 448 132 q 464 184 464 166 q 458 219 464 204 q 435 250 452 235 q 386 282 418 265 q 302 319 354 298 q 214 361 253 340 q 148 409 175 382 q 107 469 121 435 q 93 549 93 503 m 197 564 q 207 517 197 538 q 238 476 216 496 q 293 438 259 456 q 376 399 328 419 l 400 389 q 428 410 414 397 q 453 437 441 422 q 471 472 464 453 q 478 514 478 491 q 469 562 478 540 q 438 603 460 583 q 380 643 416 623 q 288 682 343 662 q 255 666 271 677 q 226 641 239 656 q 205 606 213 625 q 197 564 197 586 z "},"¨":{ha:802,x_min:208,x_max:593,o:"m 208 946 q 227 999 208 983 q 273 1015 246 1015 q 319 999 300 1015 q 339 946 339 982 q 319 893 339 910 q 273 876 300 876 q 227 893 246 876 q 208 946 208 910 m 463 946 q 481 999 463 983 q 528 1015 500 1015 q 552 1011 541 1015 q 573 999 564 1007 q 587 977 582 990 q 593 946 593 964 q 573 893 593 910 q 528 876 553 876 q 481 893 500 876 q 463 946 463 910 z "},"©":{ha:1156,x_min:68,x_max:1088,o:"m 604 714 q 531 699 563 714 q 477 656 499 684 q 445 587 456 628 q 433 496 433 547 q 443 402 433 443 q 474 334 453 361 q 527 291 494 306 q 604 277 559 277 q 638 279 620 277 q 676 286 656 281 q 714 295 695 290 q 750 307 733 301 l 750 218 q 717 205 734 211 q 683 194 701 199 q 644 187 665 189 q 600 184 624 184 q 479 207 531 184 q 394 271 428 229 q 342 370 359 312 q 325 497 325 427 q 343 622 325 566 q 397 720 361 679 q 485 783 433 760 q 604 806 536 806 q 692 794 647 806 q 777 764 736 783 l 734 677 q 666 705 699 695 q 604 714 633 714 m 68 496 q 86 631 68 566 q 137 753 104 696 q 217 857 170 810 q 320 936 264 903 q 442 987 377 969 q 578 1006 507 1006 q 713 987 648 1006 q 835 936 779 969 q 939 857 892 903 q 1018 753 985 810 q 1069 631 1051 696 q 1088 496 1088 566 q 1069 360 1088 425 q 1018 238 1051 295 q 939 135 985 182 q 835 56 892 89 q 713 4 779 22 q 578 -14 648 -14 q 442 4 507 -14 q 320 56 377 22 q 217 135 264 89 q 137 238 170 182 q 86 360 104 295 q 68 496 68 425 m 142 496 q 176 326 142 406 q 270 188 210 247 q 408 94 329 128 q 578 60 488 60 q 747 94 668 60 q 886 188 827 128 q 980 326 945 247 q 1014 496 1014 406 q 980 665 1014 586 q 886 804 945 745 q 747 898 827 863 q 578 932 668 932 q 408 898 488 932 q 270 804 329 863 q 176 665 210 745 q 142 496 142 586 z "},"ª":{ha:460,x_min:46,x_max:392,o:"m 330 541 l 311 596 q 286 569 299 581 q 257 549 273 557 q 222 536 241 541 q 179 532 203 532 q 125 541 150 532 q 83 567 101 549 q 56 610 66 584 q 46 671 46 636 q 94 777 46 740 q 239 817 142 813 l 306 819 l 306 840 q 285 908 306 889 q 227 928 264 928 q 163 918 194 928 q 104 893 133 908 l 72 961 q 146 991 106 979 q 227 1003 186 1003 q 352 967 311 1003 q 392 848 392 931 l 392 541 l 330 541 m 256 753 q 198 745 221 751 q 161 728 175 739 q 141 704 147 718 q 135 669 135 689 q 152 620 135 635 q 197 604 169 604 q 240 611 220 604 q 274 633 260 618 q 297 670 289 648 q 306 722 306 692 l 306 755 l 256 753 z "},"«":{ha:676,x_min:56,x_max:621,o:"m 56 375 l 265 656 l 345 603 l 183 367 l 345 131 l 265 78 l 56 357 l 56 375 m 332 375 l 542 656 l 621 603 l 460 367 l 621 131 l 542 78 l 332 357 l 332 375 z "},"¬":{ha:765,x_min:69,x_max:696,o:"m 696 541 l 696 178 l 595 178 l 595 439 l 69 439 l 69 541 l 696 541 z "},"­":{ha:447,x_min:56,x_max:392,o:"m 56 315 l 56 429 l 392 429 l 392 315 l 56 315 z "},"®":{ha:1092,x_min:61,x_max:1023,o:"m 61 494 q 124 749 61 631 q 300 933 188 866 q 543 1001 412 1001 q 785 933 673 1001 q 960 749 897 866 q 1023 494 1023 631 q 962 244 1023 361 q 789 57 901 127 q 543 -14 677 -14 q 297 56 409 -14 q 123 243 184 126 q 61 494 61 359 m 139 494 q 193 278 139 378 q 341 123 248 179 q 543 66 434 66 q 745 124 652 66 q 892 279 839 181 q 945 494 945 378 q 892 708 945 610 q 745 863 839 806 q 543 920 652 920 q 340 864 434 920 q 193 709 247 808 q 139 494 139 610 m 443 444 l 443 214 l 347 214 l 347 790 l 534 790 q 695 746 638 790 q 753 616 753 701 q 666 489 753 533 q 749 351 749 455 l 749 309 q 761 225 749 251 l 761 214 l 663 214 q 653 301 653 239 q 651 376 653 364 q 562 444 640 441 l 443 444 m 443 530 l 549 530 q 627 554 597 532 q 657 613 657 576 q 631 683 657 663 q 536 704 604 704 l 443 704 l 443 530 z "},"¯":{ha:694,x_min:-4,x_max:699,o:"m 699 1055 l -4 1055 l -4 1150 l 699 1150 l 699 1055 z "},"°":{ha:595,x_min:83,x_max:511,o:"m 83 791 q 100 874 83 836 q 146 943 117 913 q 214 989 175 972 q 297 1006 253 1006 q 380 989 341 1006 q 448 943 419 972 q 494 874 477 913 q 511 791 511 836 q 494 709 511 747 q 448 641 477 670 q 380 596 419 612 q 297 579 341 579 q 214 596 253 579 q 146 641 175 612 q 100 709 117 670 q 83 791 83 747 m 167 791 q 177 742 167 765 q 205 701 187 718 q 246 673 222 683 q 297 663 270 663 q 348 673 324 663 q 390 701 372 683 q 418 742 408 718 q 428 791 428 765 q 418 843 428 819 q 390 885 408 867 q 348 913 372 903 q 297 924 324 924 q 246 913 270 924 q 205 885 222 903 q 177 843 187 867 q 167 791 167 819 z "},"±":{ha:765,x_min:69,x_max:696,o:"m 332 439 l 69 439 l 69 541 l 332 541 l 332 804 l 433 804 l 433 541 l 696 541 l 696 439 l 433 439 l 433 178 l 332 178 l 332 439 m 69 0 l 69 102 l 696 102 l 696 0 l 69 0 z "},"²":{ha:460,x_min:33,x_max:421,o:"m 421 397 l 33 397 l 33 473 l 175 628 q 238 699 214 670 q 276 750 262 728 q 295 793 290 773 q 300 836 300 813 q 277 902 300 880 q 218 924 255 924 q 152 907 184 924 q 90 864 121 890 l 37 928 q 119 982 74 960 q 220 1004 164 1004 q 293 993 260 1004 q 349 961 326 982 q 385 908 372 939 q 397 839 397 878 q 388 776 397 805 q 359 718 378 747 q 314 658 341 689 q 253 590 288 627 l 153 484 l 421 484 l 421 397 z "},"³":{ha:460,x_min:21,x_max:418,o:"m 400 851 q 373 762 400 798 q 298 710 345 726 q 388 659 358 694 q 418 570 418 623 q 404 495 418 529 q 362 437 391 461 q 292 399 334 413 q 191 386 249 386 q 101 394 143 386 q 21 424 60 403 l 21 514 q 109 478 64 491 q 189 465 153 465 q 286 493 256 465 q 315 571 315 522 q 279 644 315 621 q 178 667 243 667 l 111 667 l 111 743 l 178 743 q 269 770 240 743 q 297 840 297 797 q 290 878 297 862 q 272 904 283 894 q 244 919 260 914 q 210 924 228 924 q 137 910 170 924 q 69 871 104 896 l 22 936 q 63 964 42 951 q 106 985 83 977 q 155 999 130 994 q 211 1004 181 1004 q 293 993 258 1004 q 353 961 329 981 q 388 912 376 941 q 400 851 400 884 z "},"´":{ha:802,x_min:267,x_max:533,o:"m 267 860 q 297 905 281 880 q 329 959 313 931 q 359 1014 345 986 q 385 1064 374 1041 l 533 1064 l 533 1050 q 501 1004 522 1031 q 453 947 479 977 q 400 889 427 917 q 349 842 372 861 l 267 842 l 267 860 z "},"µ":{ha:825,x_min:118,x_max:707,o:"m 241 265 q 277 133 241 177 q 389 89 313 89 q 481 106 444 89 q 542 158 519 124 q 574 243 564 193 q 583 358 583 293 l 583 745 l 707 745 l 707 0 l 607 0 l 589 100 l 582 100 q 500 15 549 43 q 382 -14 452 -14 q 297 2 333 -14 q 237 46 261 18 q 239 -7 238 20 q 241 -59 241 -31 q 241 -117 241 -88 l 241 -334 l 118 -334 l 118 745 l 241 745 l 241 265 z "},"¶":{ha:909,x_min:77,x_max:764,o:"m 764 -176 l 682 -176 l 682 947 l 542 947 l 542 -176 l 460 -176 l 460 379 q 361 367 418 367 q 244 384 296 367 q 154 441 191 401 q 97 547 117 481 q 77 707 77 612 q 99 873 77 806 q 161 981 121 940 q 258 1038 201 1021 q 382 1055 314 1055 l 764 1055 l 764 -176 z "},"·":{ha:372,x_min:100,x_max:272,o:"m 100 490 q 106 534 100 516 q 125 563 113 552 q 152 579 136 574 q 186 585 168 585 q 219 579 203 585 q 247 563 235 574 q 265 534 258 552 q 272 490 272 516 q 265 448 272 465 q 247 418 258 430 q 219 401 235 407 q 186 396 203 396 q 152 401 168 396 q 125 418 136 407 q 106 448 113 430 q 100 490 100 465 z "},"¸":{ha:285,x_min:24,x_max:277,o:"m 277 -195 q 229 -297 277 -260 q 79 -334 181 -334 q 49 -332 64 -334 q 24 -328 34 -330 l 24 -254 q 51 -257 34 -256 q 78 -258 67 -258 q 153 -244 126 -258 q 180 -196 180 -229 q 172 -168 180 -180 q 147 -147 163 -156 q 110 -132 132 -138 q 64 -119 89 -125 l 125 0 l 207 0 l 168 -78 q 211 -92 191 -83 q 245 -115 231 -101 q 268 -149 260 -129 q 277 -195 277 -168 z "},"¹":{ha:460,x_min:43,x_max:300,o:"m 208 991 l 300 991 l 300 397 l 201 397 l 201 747 q 202 785 201 764 q 203 825 202 805 q 205 865 204 846 q 207 899 206 884 q 184 873 197 887 q 157 848 172 860 l 93 799 l 43 864 l 208 991 z "},"º":{ha:486,x_min:45,x_max:441,o:"m 441 768 q 428 668 441 712 q 388 594 414 624 q 325 548 361 564 q 241 532 288 532 q 163 548 199 532 q 100 594 127 564 q 59 668 74 624 q 45 768 45 712 q 59 868 45 825 q 98 942 73 912 q 161 987 124 972 q 244 1003 198 1003 q 322 987 286 1003 q 385 942 359 972 q 427 868 412 912 q 441 768 441 825 m 134 768 q 159 647 134 688 q 243 606 184 606 q 326 647 300 606 q 351 768 351 688 q 326 889 351 850 q 243 928 300 928 q 159 889 184 928 q 134 768 134 850 z "},"»":{ha:676,x_min:57,x_max:623,o:"m 623 357 l 412 78 l 334 131 l 494 367 l 334 603 l 412 656 l 623 375 l 623 357 m 346 357 l 136 78 l 57 131 l 218 367 l 57 603 l 136 656 l 346 375 l 346 357 z "},"¼":{ha:1023,x_min:43,x_max:962,o:"m 208 991 l 300 991 l 300 397 l 201 397 l 201 747 q 202 785 201 764 q 203 825 202 805 q 205 865 204 846 q 207 899 206 884 q 184 873 197 887 q 157 848 172 860 l 93 799 l 43 864 l 208 991 m 815 991 l 265 0 l 159 0 l 709 991 l 815 991 m 962 131 l 878 131 l 878 1 l 781 1 l 781 131 l 526 131 l 526 206 l 782 599 l 878 599 l 878 217 l 962 217 l 962 131 m 781 217 l 781 349 q 782 411 781 378 q 785 478 783 445 q 774 458 781 471 q 760 431 768 446 q 745 404 753 417 q 730 380 736 390 l 625 217 l 781 217 z "},"½":{ha:1023,x_min:30,x_max:977,o:"m 195 991 l 287 991 l 287 397 l 189 397 l 189 747 q 189 785 189 764 q 190 825 189 805 q 192 865 191 846 q 194 899 193 884 q 172 873 184 887 q 144 848 159 860 l 80 799 l 30 864 l 195 991 m 801 991 l 251 0 l 144 0 l 694 991 l 801 991 m 977 1 l 589 1 l 589 77 l 730 231 q 793 302 769 273 q 831 354 818 331 q 850 396 845 376 q 855 439 855 416 q 833 505 855 484 q 774 527 810 527 q 708 510 739 527 q 646 467 676 493 l 593 531 q 674 586 629 564 q 775 608 720 608 q 849 596 816 608 q 905 564 882 585 q 940 512 928 543 q 953 442 953 481 q 943 379 953 408 q 915 321 933 350 q 870 261 897 292 q 808 193 843 231 l 708 87 l 977 87 l 977 1 z "},"¾":{ha:1023,x_min:21,x_max:1008,o:"m 400 851 q 373 762 400 798 q 298 710 345 726 q 388 659 358 694 q 418 570 418 623 q 404 495 418 529 q 362 437 391 461 q 292 399 334 413 q 191 386 249 386 q 101 394 143 386 q 21 424 60 403 l 21 514 q 109 478 64 491 q 189 465 153 465 q 286 493 256 465 q 315 571 315 522 q 279 644 315 621 q 178 667 243 667 l 111 667 l 111 743 l 178 743 q 269 770 240 743 q 297 840 297 797 q 290 878 297 862 q 272 904 283 894 q 244 919 260 914 q 210 924 228 924 q 137 910 170 924 q 69 871 104 896 l 22 936 q 63 964 42 951 q 106 985 83 977 q 155 999 130 994 q 211 1004 181 1004 q 293 993 258 1004 q 353 961 329 981 q 388 912 376 941 q 400 851 400 884 m 879 991 l 329 0 l 222 0 l 772 991 l 879 991 m 1008 131 l 923 131 l 923 1 l 826 1 l 826 131 l 572 131 l 572 206 l 827 599 l 923 599 l 923 217 l 1008 217 l 1008 131 m 826 217 l 826 349 q 827 411 826 378 q 830 478 828 445 q 820 458 827 471 q 806 431 813 446 q 790 404 798 417 q 776 380 782 390 l 671 217 l 826 217 z "},"¿":{ha:591,x_min:46,x_max:567,o:"m 401 458 l 401 433 q 396 363 401 394 q 377 305 391 332 q 342 252 364 277 q 286 197 320 226 q 231 147 254 170 q 193 101 208 124 q 171 51 178 77 q 164 -12 164 24 q 174 -72 164 -45 q 204 -118 184 -98 q 252 -148 223 -137 q 318 -158 281 -158 q 426 -141 375 -158 q 524 -100 477 -123 l 567 -199 q 448 -247 511 -227 q 318 -267 384 -267 q 204 -249 255 -267 q 119 -199 154 -232 q 65 -120 84 -167 q 46 -14 46 -73 q 55 68 46 33 q 82 134 64 103 q 128 193 100 164 q 192 253 155 221 q 250 306 227 283 q 285 350 272 329 q 302 394 298 371 q 307 446 307 416 l 307 458 l 401 458 m 433 664 q 427 620 433 638 q 409 591 420 602 q 381 575 397 580 q 347 570 366 570 q 314 575 330 570 q 287 591 298 580 q 268 620 275 602 q 261 664 261 638 q 268 707 261 689 q 287 736 275 724 q 314 753 298 747 q 347 758 330 758 q 381 753 366 758 q 409 736 397 747 q 427 707 420 724 q 433 664 433 689 z "},"À":{ha:844,x_min:0,x_max:844,o:"m 715 0 l 607 307 l 237 307 l 127 0 l 0 0 l 364 996 l 479 996 l 844 0 l 715 0 m 567 419 l 467 707 q 457 736 463 719 q 445 774 451 754 q 433 817 439 795 q 421 860 427 839 q 410 817 416 839 q 398 773 404 794 q 386 735 392 753 q 376 707 380 718 l 278 419 l 567 419 m 488 1071 l 406 1071 q 355 1118 382 1090 q 301 1176 327 1146 q 253 1233 275 1206 q 221 1279 232 1261 l 221 1293 l 370 1293 q 395 1243 380 1270 q 425 1188 410 1215 q 457 1135 441 1160 q 488 1089 473 1109 l 488 1071 z "},"Á":{ha:844,x_min:0,x_max:844,o:"m 715 0 l 607 307 l 237 307 l 127 0 l 0 0 l 364 996 l 479 996 l 844 0 l 715 0 m 567 419 l 467 707 q 457 736 463 719 q 445 774 451 754 q 433 817 439 795 q 421 860 427 839 q 410 817 416 839 q 398 773 404 794 q 386 735 392 753 q 376 707 380 718 l 278 419 l 567 419 m 362 1089 q 393 1135 377 1109 q 425 1188 409 1160 q 455 1243 441 1215 q 480 1293 469 1270 l 629 1293 l 629 1279 q 596 1233 618 1261 q 549 1176 575 1206 q 495 1118 523 1146 q 444 1071 468 1090 l 362 1071 l 362 1089 z "},"Â":{ha:844,x_min:0,x_max:844,o:"m 715 0 l 607 307 l 237 307 l 127 0 l 0 0 l 364 996 l 479 996 l 844 0 l 715 0 m 567 419 l 467 707 q 457 736 463 719 q 445 774 451 754 q 433 817 439 795 q 421 860 427 839 q 410 817 416 839 q 398 773 404 794 q 386 735 392 753 q 376 707 380 718 l 278 419 l 567 419 m 646 1071 l 564 1071 q 493 1127 530 1094 q 421 1197 456 1160 q 349 1127 385 1160 q 278 1071 313 1094 l 196 1071 l 196 1089 q 237 1135 214 1109 q 282 1188 260 1160 q 325 1243 305 1215 q 356 1293 345 1270 l 486 1293 q 517 1243 497 1270 q 560 1188 537 1215 q 606 1135 583 1160 q 646 1089 629 1109 l 646 1071 z "},"Ã":{ha:844,x_min:0,x_max:844,o:"m 715 0 l 607 307 l 237 307 l 127 0 l 0 0 l 364 996 l 479 996 l 844 0 l 715 0 m 567 419 l 467 707 q 457 736 463 719 q 445 774 451 754 q 433 817 439 795 q 421 860 427 839 q 410 817 416 839 q 398 773 404 794 q 386 735 392 753 q 376 707 380 718 l 278 419 l 567 419 m 524 1072 q 470 1084 496 1072 q 417 1111 443 1096 q 368 1137 391 1125 q 322 1149 344 1149 q 275 1131 292 1149 q 250 1071 259 1113 l 179 1071 q 194 1145 182 1112 q 223 1201 205 1178 q 266 1237 241 1225 q 322 1250 291 1250 q 378 1238 351 1250 q 431 1212 406 1226 q 480 1186 457 1198 q 524 1174 504 1174 q 570 1192 554 1174 q 595 1251 585 1209 l 667 1251 q 652 1178 663 1211 q 623 1121 641 1145 q 580 1085 605 1098 q 524 1072 555 1072 z "},"Ä":{ha:844,x_min:0,x_max:844,o:"m 715 0 l 607 307 l 237 307 l 127 0 l 0 0 l 364 996 l 479 996 l 844 0 l 715 0 m 567 419 l 467 707 q 457 736 463 719 q 445 774 451 754 q 433 817 439 795 q 421 860 427 839 q 410 817 416 839 q 398 773 404 794 q 386 735 392 753 q 376 707 380 718 l 278 419 l 567 419 m 231 1175 q 250 1228 231 1212 q 296 1244 269 1244 q 342 1228 322 1244 q 361 1175 361 1211 q 342 1122 361 1139 q 296 1105 322 1105 q 250 1122 269 1105 q 231 1175 231 1139 m 485 1175 q 504 1228 485 1212 q 550 1244 523 1244 q 575 1240 563 1244 q 595 1228 587 1236 q 610 1206 604 1219 q 615 1175 615 1194 q 595 1122 615 1139 q 550 1105 576 1105 q 504 1122 523 1105 q 485 1175 485 1139 z "},"Å":{ha:844,x_min:0,x_max:844,o:"m 715 0 l 607 307 l 237 307 l 127 0 l 0 0 l 364 996 l 479 996 l 844 0 l 715 0 m 567 419 l 467 707 q 457 736 463 719 q 445 774 451 754 q 433 817 439 795 q 421 860 427 839 q 410 817 416 839 q 398 773 404 794 q 386 735 392 753 q 376 707 380 718 l 278 419 l 567 419 m 575 1074 q 563 1011 575 1039 q 531 965 551 984 q 481 936 510 946 q 420 926 453 926 q 358 936 386 926 q 310 965 330 946 q 279 1011 290 984 q 269 1072 269 1038 q 279 1134 269 1107 q 310 1179 290 1160 q 358 1208 330 1198 q 420 1218 386 1218 q 481 1208 452 1218 q 530 1180 509 1198 q 563 1134 551 1161 q 575 1074 575 1107 m 496 1072 q 474 1128 496 1108 q 420 1149 453 1149 q 365 1128 386 1149 q 343 1072 343 1108 q 362 1016 343 1036 q 420 996 382 996 q 474 1016 453 996 q 496 1072 496 1036 z "},"Æ":{ha:1183,x_min:-1,x_max:1100,o:"m 1100 0 l 585 0 l 585 307 l 262 307 l 125 0 l -1 0 l 443 991 l 1100 991 l 1100 880 l 711 880 l 711 574 l 1074 574 l 1074 464 l 711 464 l 711 111 l 1100 111 l 1100 0 m 311 419 l 585 419 l 585 880 l 511 880 l 311 419 z "},"Ç":{ha:838,x_min:85,x_max:798,o:"m 538 895 q 406 867 465 895 q 306 788 347 840 q 241 663 264 736 q 218 496 218 589 q 238 326 218 400 q 298 201 258 252 q 398 123 338 150 q 538 97 458 97 q 652 109 598 97 q 760 136 707 121 l 760 26 q 707 8 733 16 q 651 -4 680 1 q 590 -11 623 -9 q 517 -14 557 -14 q 324 23 406 -14 q 190 127 243 60 q 111 288 136 194 q 85 497 85 382 q 114 703 85 610 q 201 864 144 797 q 343 968 258 931 q 538 1006 428 1006 q 677 991 611 1006 q 798 947 744 976 l 745 842 q 652 879 702 863 q 538 895 602 895 m 621 -195 q 573 -297 621 -260 q 424 -334 526 -334 q 394 -332 409 -334 q 368 -328 378 -330 l 368 -254 q 395 -257 378 -256 q 422 -258 412 -258 q 498 -244 471 -258 q 525 -196 525 -229 q 516 -168 525 -180 q 492 -147 507 -156 q 455 -132 476 -138 q 408 -119 433 -125 l 469 0 l 551 0 l 513 -78 q 555 -92 536 -83 q 590 -115 575 -101 q 613 -149 604 -129 q 621 -195 621 -168 z "},"È":{ha:733,x_min:135,x_max:650,o:"m 650 0 l 135 0 l 135 991 l 650 991 l 650 880 l 261 880 l 261 574 l 624 574 l 624 464 l 261 464 l 261 111 l 650 111 l 650 0 m 484 1071 l 402 1071 q 351 1118 378 1090 q 297 1176 323 1146 q 249 1233 271 1206 q 217 1279 228 1261 l 217 1293 l 366 1293 q 391 1243 376 1270 q 421 1188 406 1215 q 453 1135 437 1160 q 484 1089 469 1109 l 484 1071 z "},"É":{ha:733,x_min:135,x_max:650,o:"m 650 0 l 135 0 l 135 991 l 650 991 l 650 880 l 261 880 l 261 574 l 624 574 l 624 464 l 261 464 l 261 111 l 650 111 l 650 0 m 309 1089 q 340 1135 324 1109 q 372 1188 356 1160 q 402 1243 388 1215 q 427 1293 416 1270 l 576 1293 l 576 1279 q 544 1233 565 1261 q 496 1176 522 1206 q 443 1118 470 1146 q 391 1071 415 1090 l 309 1071 l 309 1089 z "},"Ê":{ha:733,x_min:135,x_max:650,o:"m 650 0 l 135 0 l 135 991 l 650 991 l 650 880 l 261 880 l 261 574 l 624 574 l 624 464 l 261 464 l 261 111 l 650 111 l 650 0 m 615 1071 l 533 1071 q 462 1127 498 1094 q 390 1197 425 1160 q 317 1127 353 1160 q 247 1071 281 1094 l 165 1071 l 165 1089 q 205 1135 182 1109 q 251 1188 229 1160 q 294 1243 274 1215 q 325 1293 314 1270 l 455 1293 q 486 1243 466 1270 q 529 1188 506 1215 q 575 1135 551 1160 q 615 1089 598 1109 l 615 1071 z "},"Ë":{ha:733,x_min:135,x_max:650,o:"m 650 0 l 135 0 l 135 991 l 650 991 l 650 880 l 261 880 l 261 574 l 624 574 l 624 464 l 261 464 l 261 111 l 650 111 l 650 0 m 201 1175 q 220 1228 201 1212 q 266 1244 239 1244 q 312 1228 292 1244 q 332 1175 332 1211 q 312 1122 332 1139 q 266 1105 292 1105 q 220 1122 239 1105 q 201 1175 201 1139 m 455 1175 q 474 1228 455 1212 q 520 1244 493 1244 q 545 1240 533 1244 q 566 1228 557 1236 q 580 1206 574 1219 q 585 1175 585 1194 q 566 1122 585 1139 q 520 1105 546 1105 q 474 1122 493 1105 q 455 1175 455 1139 z "},"Ì":{ha:471,x_min:42,x_max:415,o:"m 415 0 l 56 0 l 56 69 l 172 97 l 172 895 l 56 922 l 56 991 l 415 991 l 415 922 l 298 895 l 298 97 l 415 69 l 415 0 m 309 1071 l 227 1071 q 176 1118 203 1090 q 122 1176 148 1146 q 74 1233 96 1206 q 42 1279 53 1261 l 42 1293 l 191 1293 q 216 1243 201 1270 q 246 1188 231 1215 q 278 1135 262 1160 q 309 1089 294 1109 l 309 1071 z "},"Í":{ha:471,x_min:56,x_max:441,o:"m 415 0 l 56 0 l 56 69 l 172 97 l 172 895 l 56 922 l 56 991 l 415 991 l 415 922 l 298 895 l 298 97 l 415 69 l 415 0 m 174 1089 q 205 1135 189 1109 q 237 1188 221 1160 q 267 1243 253 1215 q 292 1293 281 1270 l 441 1293 l 441 1279 q 409 1233 430 1261 q 361 1176 387 1206 q 308 1118 335 1146 q 256 1071 280 1090 l 174 1071 l 174 1089 z "},"Î":{ha:471,x_min:12,x_max:462,o:"m 415 0 l 56 0 l 56 69 l 172 97 l 172 895 l 56 922 l 56 991 l 415 991 l 415 922 l 298 895 l 298 97 l 415 69 l 415 0 m 462 1071 l 380 1071 q 309 1127 345 1094 q 237 1197 272 1160 q 164 1127 200 1160 q 94 1071 128 1094 l 12 1071 l 12 1089 q 52 1135 29 1109 q 98 1188 75 1160 q 141 1243 121 1215 q 172 1293 161 1270 l 302 1293 q 333 1243 313 1270 q 375 1188 353 1215 q 421 1135 398 1160 q 462 1089 445 1109 l 462 1071 z "},"Ï":{ha:471,x_min:43,x_max:428,o:"m 415 0 l 56 0 l 56 69 l 172 97 l 172 895 l 56 922 l 56 991 l 415 991 l 415 922 l 298 895 l 298 97 l 415 69 l 415 0 m 43 1175 q 62 1228 43 1212 q 109 1244 81 1244 q 155 1228 135 1244 q 174 1175 174 1211 q 155 1122 174 1139 q 109 1105 135 1105 q 62 1122 81 1105 q 43 1175 43 1139 m 298 1175 q 317 1228 298 1212 q 363 1244 336 1244 q 388 1240 376 1244 q 408 1228 399 1236 q 422 1206 417 1219 q 428 1175 428 1194 q 408 1122 428 1139 q 363 1105 389 1105 q 317 1122 336 1105 q 298 1175 298 1139 z "},"Ð":{ha:950,x_min:32,x_max:865,o:"m 32 546 l 135 546 l 135 991 l 411 991 q 599 960 515 991 q 742 868 683 929 q 833 715 801 806 q 865 505 865 625 q 833 285 865 380 q 739 127 800 191 q 587 32 677 64 q 383 0 497 0 l 135 0 l 135 436 l 32 436 l 32 546 m 732 501 q 709 672 732 600 q 644 791 687 745 q 539 861 602 838 q 397 884 477 884 l 261 884 l 261 546 l 489 546 l 489 436 l 261 436 l 261 109 l 371 109 q 641 208 550 109 q 732 501 732 307 z "},"Ñ":{ha:1013,x_min:135,x_max:878,o:"m 878 0 l 732 0 l 244 821 l 239 821 q 245 717 243 768 q 250 625 248 673 q 252 538 252 576 l 252 0 l 135 0 l 135 991 l 279 991 l 765 175 l 770 175 q 765 277 768 227 q 763 321 764 298 q 761 367 762 344 q 760 410 760 389 q 760 449 760 431 l 760 991 l 878 991 l 878 0 m 614 1072 q 560 1084 587 1072 q 507 1111 533 1096 q 458 1137 481 1125 q 412 1149 434 1149 q 366 1131 382 1149 q 340 1071 349 1113 l 269 1071 q 284 1145 273 1112 q 313 1201 295 1178 q 356 1237 331 1225 q 412 1250 381 1250 q 468 1238 441 1250 q 522 1212 496 1226 q 571 1186 547 1198 q 614 1174 594 1174 q 660 1192 644 1174 q 686 1251 675 1209 l 757 1251 q 742 1178 753 1211 q 713 1121 731 1145 q 670 1085 695 1098 q 614 1072 645 1072 z "},"Ò":{ha:1031,x_min:85,x_max:945,o:"m 945 497 q 917 288 945 382 q 836 127 890 194 q 701 23 781 60 q 515 -14 621 -14 q 324 23 405 -14 q 190 127 243 60 q 111 289 136 194 q 85 498 85 383 q 111 708 85 614 q 190 868 136 802 q 325 971 243 935 q 517 1007 406 1007 q 702 971 622 1007 q 836 868 781 935 q 917 707 890 801 q 945 497 945 613 m 218 497 q 236 330 218 404 q 290 204 254 256 q 382 124 326 152 q 515 97 438 97 q 649 124 593 97 q 741 204 705 152 q 794 330 777 256 q 811 497 811 404 q 794 665 811 591 q 741 790 777 739 q 650 868 705 841 q 517 896 594 896 q 383 868 439 896 q 290 790 327 841 q 236 665 254 739 q 218 497 218 591 m 590 1071 l 509 1071 q 457 1118 485 1090 q 403 1176 429 1146 q 356 1233 377 1206 q 323 1279 334 1261 l 323 1293 l 472 1293 q 497 1243 483 1270 q 528 1188 512 1215 q 559 1135 543 1160 q 590 1089 576 1109 l 590 1071 z "},"Ó":{ha:1031,x_min:85,x_max:945,o:"m 945 497 q 917 288 945 382 q 836 127 890 194 q 701 23 781 60 q 515 -14 621 -14 q 324 23 405 -14 q 190 127 243 60 q 111 289 136 194 q 85 498 85 383 q 111 708 85 614 q 190 868 136 802 q 325 971 243 935 q 517 1007 406 1007 q 702 971 622 1007 q 836 868 781 935 q 917 707 890 801 q 945 497 945 613 m 218 497 q 236 330 218 404 q 290 204 254 256 q 382 124 326 152 q 515 97 438 97 q 649 124 593 97 q 741 204 705 152 q 794 330 777 256 q 811 497 811 404 q 794 665 811 591 q 741 790 777 739 q 650 868 705 841 q 517 896 594 896 q 383 868 439 896 q 290 790 327 841 q 236 665 254 739 q 218 497 218 591 m 441 1089 q 472 1135 456 1109 q 504 1188 488 1160 q 534 1243 520 1215 q 559 1293 549 1270 l 708 1293 l 708 1279 q 676 1233 697 1261 q 628 1176 654 1206 q 575 1118 602 1146 q 524 1071 547 1090 l 441 1071 l 441 1089 z "},"Ô":{ha:1031,x_min:85,x_max:945,o:"m 945 497 q 917 288 945 382 q 836 127 890 194 q 701 23 781 60 q 515 -14 621 -14 q 324 23 405 -14 q 190 127 243 60 q 111 289 136 194 q 85 498 85 383 q 111 708 85 614 q 190 868 136 802 q 325 971 243 935 q 517 1007 406 1007 q 702 971 622 1007 q 836 868 781 935 q 917 707 890 801 q 945 497 945 613 m 218 497 q 236 330 218 404 q 290 204 254 256 q 382 124 326 152 q 515 97 438 97 q 649 124 593 97 q 741 204 705 152 q 794 330 777 256 q 811 497 811 404 q 794 665 811 591 q 741 790 777 739 q 650 868 705 841 q 517 896 594 896 q 383 868 439 896 q 290 790 327 841 q 236 665 254 739 q 218 497 218 591 m 743 1071 l 661 1071 q 590 1127 627 1094 q 518 1197 553 1160 q 446 1127 481 1160 q 375 1071 410 1094 l 293 1071 l 293 1089 q 334 1135 311 1109 q 379 1188 357 1160 q 422 1243 402 1215 q 453 1293 442 1270 l 583 1293 q 614 1243 594 1270 q 657 1188 634 1215 q 703 1135 680 1160 q 743 1089 726 1109 l 743 1071 z "},"Õ":{ha:1031,x_min:85,x_max:945,o:"m 945 497 q 917 288 945 382 q 836 127 890 194 q 701 23 781 60 q 515 -14 621 -14 q 324 23 405 -14 q 190 127 243 60 q 111 289 136 194 q 85 498 85 383 q 111 708 85 614 q 190 868 136 802 q 325 971 243 935 q 517 1007 406 1007 q 702 971 622 1007 q 836 868 781 935 q 917 707 890 801 q 945 497 945 613 m 218 497 q 236 330 218 404 q 290 204 254 256 q 382 124 326 152 q 515 97 438 97 q 649 124 593 97 q 741 204 705 152 q 794 330 777 256 q 811 497 811 404 q 794 665 811 591 q 741 790 777 739 q 650 868 705 841 q 517 896 594 896 q 383 868 439 896 q 290 790 327 841 q 236 665 254 739 q 218 497 218 591 m 604 1072 q 550 1084 577 1072 q 498 1111 524 1096 q 448 1137 472 1125 q 403 1149 425 1149 q 356 1131 372 1149 q 330 1071 340 1113 l 260 1071 q 274 1145 263 1112 q 303 1201 286 1178 q 347 1237 321 1225 q 403 1250 372 1250 q 459 1238 431 1250 q 512 1212 486 1226 q 561 1186 538 1198 q 604 1174 585 1174 q 650 1192 635 1174 q 676 1251 666 1209 l 747 1251 q 733 1178 744 1211 q 704 1121 722 1145 q 661 1085 686 1098 q 604 1072 635 1072 z "},"Ö":{ha:1031,x_min:85,x_max:945,o:"m 945 497 q 917 288 945 382 q 836 127 890 194 q 701 23 781 60 q 515 -14 621 -14 q 324 23 405 -14 q 190 127 243 60 q 111 289 136 194 q 85 498 85 383 q 111 708 85 614 q 190 868 136 802 q 325 971 243 935 q 517 1007 406 1007 q 702 971 622 1007 q 836 868 781 935 q 917 707 890 801 q 945 497 945 613 m 218 497 q 236 330 218 404 q 290 204 254 256 q 382 124 326 152 q 515 97 438 97 q 649 124 593 97 q 741 204 705 152 q 794 330 777 256 q 811 497 811 404 q 794 665 811 591 q 741 790 777 739 q 650 868 705 841 q 517 896 594 896 q 383 868 439 896 q 290 790 327 841 q 236 665 254 739 q 218 497 218 591 m 323 1175 q 342 1228 323 1212 q 389 1244 361 1244 q 435 1228 415 1244 q 454 1175 454 1211 q 435 1122 454 1139 q 389 1105 415 1105 q 342 1122 361 1105 q 323 1175 323 1139 m 578 1175 q 597 1228 578 1212 q 643 1244 616 1244 q 668 1240 656 1244 q 688 1228 680 1236 q 703 1206 697 1219 q 708 1175 708 1194 q 688 1122 708 1139 q 643 1105 669 1105 q 597 1122 616 1105 q 578 1175 578 1139 z "},"×":{ha:765,x_min:96,x_max:671,o:"m 311 490 l 96 707 l 167 778 l 382 562 l 600 778 l 671 708 l 453 490 l 669 273 l 600 204 l 382 419 l 167 205 l 97 275 l 311 490 z "},"Ø":{ha:1031,x_min:85,x_max:945,o:"m 882 986 l 819 885 q 913 720 881 818 q 945 497 945 621 q 917 288 945 382 q 836 127 890 194 q 701 23 781 60 q 515 -14 621 -14 q 297 35 387 -14 l 244 -52 l 151 1 l 212 100 q 116 269 146 168 q 85 498 85 370 q 111 708 85 614 q 190 868 136 802 q 325 971 243 935 q 517 1007 406 1007 q 635 993 581 1007 q 734 953 690 979 l 789 1039 l 882 986 m 218 497 q 234 337 218 408 q 282 214 250 267 l 675 854 q 604 885 642 874 q 517 896 565 896 q 383 868 439 896 q 290 790 327 841 q 236 665 254 739 q 218 497 218 591 m 811 497 q 751 774 811 671 l 359 136 q 430 107 391 117 q 515 97 469 97 q 649 124 593 97 q 741 204 705 152 q 794 330 777 256 q 811 497 811 404 z "},"Ù":{ha:970,x_min:125,x_max:844,o:"m 844 993 l 844 350 q 822 206 844 273 q 754 91 800 140 q 641 14 709 42 q 481 -14 573 -14 q 328 13 394 -14 q 216 87 261 39 q 148 202 171 135 q 125 353 125 270 l 125 991 l 252 991 l 252 346 q 310 162 252 227 q 488 97 369 97 q 591 115 548 97 q 663 167 635 134 q 704 246 690 200 q 718 347 718 292 l 718 993 l 844 993 m 574 1071 l 493 1071 q 441 1118 469 1090 q 388 1176 414 1146 q 340 1233 361 1206 q 308 1279 319 1261 l 308 1293 l 456 1293 q 482 1243 467 1270 q 512 1188 496 1215 q 544 1135 528 1160 q 574 1089 560 1109 l 574 1071 z "},"Ú":{ha:970,x_min:125,x_max:844,o:"m 844 993 l 844 350 q 822 206 844 273 q 754 91 800 140 q 641 14 709 42 q 481 -14 573 -14 q 328 13 394 -14 q 216 87 261 39 q 148 202 171 135 q 125 353 125 270 l 125 991 l 252 991 l 252 346 q 310 162 252 227 q 488 97 369 97 q 591 115 548 97 q 663 167 635 134 q 704 246 690 200 q 718 347 718 292 l 718 993 l 844 993 m 400 1089 q 431 1135 415 1109 q 463 1188 447 1160 q 493 1243 479 1215 q 518 1293 507 1270 l 667 1293 l 667 1279 q 634 1233 656 1261 q 587 1176 613 1206 q 533 1118 561 1146 q 482 1071 506 1090 l 400 1071 l 400 1089 z "},"Û":{ha:970,x_min:125,x_max:844,o:"m 844 993 l 844 350 q 822 206 844 273 q 754 91 800 140 q 641 14 709 42 q 481 -14 573 -14 q 328 13 394 -14 q 216 87 261 39 q 148 202 171 135 q 125 353 125 270 l 125 991 l 252 991 l 252 346 q 310 162 252 227 q 488 97 369 97 q 591 115 548 97 q 663 167 635 134 q 704 246 690 200 q 718 347 718 292 l 718 993 l 844 993 m 707 1071 l 625 1071 q 554 1127 591 1094 q 482 1197 517 1160 q 410 1127 446 1160 q 339 1071 374 1094 l 257 1071 l 257 1089 q 298 1135 275 1109 q 343 1188 321 1160 q 386 1243 366 1215 q 417 1293 406 1270 l 547 1293 q 578 1243 558 1270 q 621 1188 598 1215 q 667 1135 644 1160 q 707 1089 690 1109 l 707 1071 z "},"Ü":{ha:970,x_min:125,x_max:844,o:"m 844 993 l 844 350 q 822 206 844 273 q 754 91 800 140 q 641 14 709 42 q 481 -14 573 -14 q 328 13 394 -14 q 216 87 261 39 q 148 202 171 135 q 125 353 125 270 l 125 991 l 252 991 l 252 346 q 310 162 252 227 q 488 97 369 97 q 591 115 548 97 q 663 167 635 134 q 704 246 690 200 q 718 347 718 292 l 718 993 l 844 993 m 293 1175 q 312 1228 293 1212 q 358 1244 331 1244 q 404 1228 385 1244 q 424 1175 424 1211 q 404 1122 424 1139 q 358 1105 385 1105 q 312 1122 331 1105 q 293 1175 293 1139 m 547 1175 q 566 1228 547 1212 q 612 1244 585 1244 q 637 1240 625 1244 q 658 1228 649 1236 q 672 1206 667 1219 q 677 1175 677 1194 q 658 1122 677 1139 q 612 1105 638 1105 q 566 1122 585 1105 q 547 1175 547 1139 z "},"Ý":{ha:732,x_min:0,x_max:732,o:"m 366 490 l 596 991 l 732 991 l 429 386 l 429 0 l 302 0 l 302 379 l 0 991 l 138 991 l 366 490 m 300 1089 q 331 1135 315 1109 q 362 1188 347 1160 q 393 1243 378 1215 q 418 1293 407 1270 l 566 1293 l 566 1279 q 534 1233 555 1261 q 487 1176 513 1206 q 433 1118 460 1146 q 382 1071 406 1090 l 300 1071 l 300 1089 z "},"Þ":{ha:800,x_min:135,x_max:729,o:"m 729 530 q 710 412 729 469 q 649 311 692 355 q 536 241 606 267 q 363 215 466 215 l 261 215 l 261 0 l 135 0 l 135 991 l 261 991 l 261 821 l 380 821 q 537 801 471 821 q 646 745 603 782 q 709 654 688 708 q 729 530 729 600 m 261 322 l 349 322 q 459 333 412 322 q 537 368 506 344 q 583 430 568 392 q 599 524 599 469 q 543 667 599 621 q 370 713 488 713 l 261 713 l 261 322 z "},"ß":{ha:836,x_min:118,x_max:774,o:"m 685 854 q 670 786 685 816 q 634 731 656 755 q 588 686 613 706 q 541 647 562 665 q 505 610 519 628 q 490 571 490 591 q 495 546 490 557 q 513 521 500 534 q 550 491 526 508 q 612 449 574 475 q 680 399 650 424 q 731 347 710 375 q 763 287 751 319 q 774 212 774 254 q 755 111 774 153 q 702 40 736 68 q 620 0 667 13 q 514 -14 572 -14 q 401 -2 448 -14 q 318 33 354 10 l 318 146 q 358 124 336 135 q 404 106 380 114 q 454 93 429 98 q 505 87 480 87 q 571 96 543 87 q 616 120 598 104 q 642 157 633 135 q 650 205 650 178 q 644 250 650 230 q 624 289 638 270 q 585 328 609 308 q 522 371 560 347 q 451 421 479 398 q 404 467 422 444 q 378 513 386 490 q 371 566 371 537 q 385 629 371 602 q 420 677 399 656 q 465 717 441 699 q 511 755 490 735 q 546 797 532 774 q 559 850 559 820 q 548 899 559 878 q 517 934 537 920 q 468 955 496 948 q 406 961 440 961 q 342 955 372 961 q 290 932 313 948 q 255 887 268 916 q 241 815 241 859 l 241 0 l 118 0 l 118 814 q 139 932 118 884 q 199 1009 161 980 q 290 1050 237 1038 q 406 1063 343 1063 q 519 1050 468 1063 q 608 1011 571 1037 q 665 946 644 985 q 685 854 685 907 z "},"à":{ha:737,x_min:64,x_max:627,o:"m 538 0 l 513 103 l 507 103 q 463 51 485 73 q 414 14 440 28 q 355 -7 387 0 q 279 -14 322 -14 q 193 0 233 -14 q 125 40 154 13 q 80 110 96 68 q 64 208 64 151 q 142 379 64 319 q 380 444 220 439 l 505 449 l 505 496 q 495 572 505 541 q 467 621 486 602 q 421 648 448 640 q 358 656 393 656 q 253 640 302 656 q 160 600 205 623 l 117 693 q 229 739 167 720 q 358 758 290 758 q 478 744 427 758 q 561 700 528 730 q 610 623 594 670 q 627 510 627 576 l 627 0 l 538 0 m 311 86 q 388 99 353 86 q 449 138 423 112 q 489 204 475 164 q 504 297 504 243 l 504 364 l 407 359 q 304 346 346 357 q 238 316 263 335 q 203 269 214 296 q 192 207 192 241 q 225 115 192 144 q 311 86 258 86 m 460 842 l 378 842 q 327 889 355 861 q 273 947 299 917 q 225 1004 247 977 q 193 1050 204 1031 l 193 1064 l 342 1064 q 367 1014 353 1041 q 397 959 382 986 q 429 905 413 931 q 460 860 446 880 l 460 842 z "},"á":{ha:737,x_min:64,x_max:627,o:"m 538 0 l 513 103 l 507 103 q 463 51 485 73 q 414 14 440 28 q 355 -7 387 0 q 279 -14 322 -14 q 193 0 233 -14 q 125 40 154 13 q 80 110 96 68 q 64 208 64 151 q 142 379 64 319 q 380 444 220 439 l 505 449 l 505 496 q 495 572 505 541 q 467 621 486 602 q 421 648 448 640 q 358 656 393 656 q 253 640 302 656 q 160 600 205 623 l 117 693 q 229 739 167 720 q 358 758 290 758 q 478 744 427 758 q 561 700 528 730 q 610 623 594 670 q 627 510 627 576 l 627 0 l 538 0 m 311 86 q 388 99 353 86 q 449 138 423 112 q 489 204 475 164 q 504 297 504 243 l 504 364 l 407 359 q 304 346 346 357 q 238 316 263 335 q 203 269 214 296 q 192 207 192 241 q 225 115 192 144 q 311 86 258 86 m 302 860 q 333 905 317 880 q 365 959 349 931 q 395 1014 381 986 q 420 1064 410 1041 l 569 1064 l 569 1050 q 537 1004 558 1031 q 489 947 515 977 q 436 889 463 917 q 385 842 408 861 l 302 842 l 302 860 z "},"â":{ha:737,x_min:64,x_max:627,o:"m 538 0 l 513 103 l 507 103 q 463 51 485 73 q 414 14 440 28 q 355 -7 387 0 q 279 -14 322 -14 q 193 0 233 -14 q 125 40 154 13 q 80 110 96 68 q 64 208 64 151 q 142 379 64 319 q 380 444 220 439 l 505 449 l 505 496 q 495 572 505 541 q 467 621 486 602 q 421 648 448 640 q 358 656 393 656 q 253 640 302 656 q 160 600 205 623 l 117 693 q 229 739 167 720 q 358 758 290 758 q 478 744 427 758 q 561 700 528 730 q 610 623 594 670 q 627 510 627 576 l 627 0 l 538 0 m 311 86 q 388 99 353 86 q 449 138 423 112 q 489 204 475 164 q 504 297 504 243 l 504 364 l 407 359 q 304 346 346 357 q 238 316 263 335 q 203 269 214 296 q 192 207 192 241 q 225 115 192 144 q 311 86 258 86 m 605 842 l 523 842 q 452 898 488 865 q 380 968 415 930 q 307 898 343 930 q 237 842 271 865 l 155 842 l 155 860 q 195 905 172 880 q 241 959 218 931 q 284 1014 264 986 q 315 1064 304 1041 l 445 1064 q 476 1014 456 1041 q 518 959 496 986 q 565 905 541 931 q 605 860 588 880 l 605 842 z "},"ã":{ha:737,x_min:64,x_max:627,o:"m 538 0 l 513 103 l 507 103 q 463 51 485 73 q 414 14 440 28 q 355 -7 387 0 q 279 -14 322 -14 q 193 0 233 -14 q 125 40 154 13 q 80 110 96 68 q 64 208 64 151 q 142 379 64 319 q 380 444 220 439 l 505 449 l 505 496 q 495 572 505 541 q 467 621 486 602 q 421 648 448 640 q 358 656 393 656 q 253 640 302 656 q 160 600 205 623 l 117 693 q 229 739 167 720 q 358 758 290 758 q 478 744 427 758 q 561 700 528 730 q 610 623 594 670 q 627 510 627 576 l 627 0 l 538 0 m 311 86 q 388 99 353 86 q 449 138 423 112 q 489 204 475 164 q 504 297 504 243 l 504 364 l 407 359 q 304 346 346 357 q 238 316 263 335 q 203 269 214 296 q 192 207 192 241 q 225 115 192 144 q 311 86 258 86 m 474 843 q 420 855 447 843 q 368 881 393 867 q 318 908 342 896 q 273 920 294 920 q 226 902 242 920 q 200 842 210 884 l 130 842 q 144 916 133 882 q 173 972 155 949 q 216 1008 191 996 q 273 1021 241 1021 q 329 1009 301 1021 q 382 983 356 997 q 431 957 408 968 q 474 945 454 945 q 520 962 505 945 q 546 1022 536 980 l 617 1022 q 603 948 614 981 q 573 892 591 916 q 530 856 555 869 q 474 843 505 843 z "},"ä":{ha:737,x_min:64,x_max:627,o:"m 538 0 l 513 103 l 507 103 q 463 51 485 73 q 414 14 440 28 q 355 -7 387 0 q 279 -14 322 -14 q 193 0 233 -14 q 125 40 154 13 q 80 110 96 68 q 64 208 64 151 q 142 379 64 319 q 380 444 220 439 l 505 449 l 505 496 q 495 572 505 541 q 467 621 486 602 q 421 648 448 640 q 358 656 393 656 q 253 640 302 656 q 160 600 205 623 l 117 693 q 229 739 167 720 q 358 758 290 758 q 478 744 427 758 q 561 700 528 730 q 610 623 594 670 q 627 510 627 576 l 627 0 l 538 0 m 311 86 q 388 99 353 86 q 449 138 423 112 q 489 204 475 164 q 504 297 504 243 l 504 364 l 407 359 q 304 346 346 357 q 238 316 263 335 q 203 269 214 296 q 192 207 192 241 q 225 115 192 144 q 311 86 258 86 m 185 946 q 204 999 185 983 q 250 1015 223 1015 q 296 999 277 1015 q 316 946 316 982 q 296 893 316 910 q 250 876 277 876 q 204 893 223 876 q 185 946 185 910 m 439 946 q 458 999 439 983 q 505 1015 477 1015 q 529 1011 517 1015 q 550 999 541 1007 q 564 977 559 990 q 570 946 570 964 q 550 893 570 910 q 505 876 530 876 q 458 893 477 876 q 439 946 439 910 z "},"å":{ha:737,x_min:64,x_max:627,o:"m 538 0 l 513 103 l 507 103 q 463 51 485 73 q 414 14 440 28 q 355 -7 387 0 q 279 -14 322 -14 q 193 0 233 -14 q 125 40 154 13 q 80 110 96 68 q 64 208 64 151 q 142 379 64 319 q 380 444 220 439 l 505 449 l 505 496 q 495 572 505 541 q 467 621 486 602 q 421 648 448 640 q 358 656 393 656 q 253 640 302 656 q 160 600 205 623 l 117 693 q 229 739 167 720 q 358 758 290 758 q 478 744 427 758 q 561 700 528 730 q 610 623 594 670 q 627 510 627 576 l 627 0 l 538 0 m 311 86 q 388 99 353 86 q 449 138 423 112 q 489 204 475 164 q 504 297 504 243 l 504 364 l 407 359 q 304 346 346 357 q 238 316 263 335 q 203 269 214 296 q 192 207 192 241 q 225 115 192 144 q 311 86 258 86 m 531 989 q 519 927 531 954 q 487 880 507 899 q 437 851 466 861 q 376 842 409 842 q 314 851 342 842 q 266 880 286 861 q 235 926 246 899 q 224 987 224 953 q 235 1049 224 1022 q 266 1095 246 1076 q 314 1123 286 1114 q 376 1133 342 1133 q 437 1123 408 1133 q 486 1095 465 1114 q 519 1049 507 1076 q 531 989 531 1023 m 452 987 q 430 1044 452 1023 q 376 1064 409 1064 q 320 1044 342 1064 q 299 987 299 1023 q 318 931 299 951 q 376 911 338 911 q 430 931 409 911 q 452 987 452 951 z "},"æ":{ha:1157,x_min:64,x_max:1088,o:"m 64 208 q 142 379 64 319 q 380 444 220 439 l 505 449 l 505 496 q 495 572 505 541 q 467 621 486 602 q 421 648 448 640 q 358 656 393 656 q 253 640 302 656 q 160 600 205 623 l 117 693 q 229 739 167 720 q 358 758 290 758 q 503 729 447 758 q 589 637 559 701 q 680 727 623 695 q 806 758 736 758 q 924 734 871 758 q 1013 666 976 710 q 1068 561 1049 623 q 1088 425 1088 500 l 1088 349 l 632 349 q 685 156 635 218 q 835 94 735 94 q 897 98 868 94 q 952 107 926 101 q 1004 124 979 114 q 1054 146 1029 134 l 1054 36 q 1002 14 1027 23 q 950 -2 977 4 q 894 -11 923 -8 q 832 -14 865 -14 q 670 25 739 -14 q 559 142 602 64 q 511 76 536 105 q 453 27 485 47 q 381 -3 420 7 q 292 -14 342 -14 q 202 0 243 -14 q 130 40 160 13 q 81 110 99 68 q 64 208 64 151 m 192 207 q 225 115 192 144 q 311 86 258 86 q 388 99 353 86 q 449 138 423 112 q 489 204 475 164 q 504 297 504 243 l 504 364 l 407 359 q 304 346 346 357 q 238 316 263 335 q 203 269 214 296 q 192 207 192 241 m 803 656 q 685 603 728 656 q 635 449 642 550 l 954 449 q 945 533 954 495 q 918 599 937 572 q 871 641 899 626 q 803 656 842 656 z "},"ç":{ha:643,x_min:77,x_max:596,o:"m 403 -14 q 275 8 334 -14 q 171 76 215 29 q 102 194 127 122 q 77 368 77 267 q 102 549 77 475 q 173 670 128 623 q 279 737 218 716 q 408 758 339 758 q 512 747 461 758 q 596 718 562 735 l 559 614 q 525 627 544 621 q 486 638 506 633 q 446 647 465 644 q 408 650 426 650 q 253 582 302 650 q 204 370 204 513 q 253 160 204 227 q 403 94 302 94 q 502 107 458 94 q 583 136 547 119 l 583 26 q 505 -3 547 7 q 403 -14 463 -14 m 495 -195 q 447 -297 495 -260 q 298 -334 399 -334 q 268 -332 283 -334 q 242 -328 252 -330 l 242 -254 q 269 -257 252 -256 q 296 -258 286 -258 q 372 -244 345 -258 q 399 -196 399 -229 q 390 -168 399 -180 q 366 -147 381 -156 q 329 -132 350 -138 q 282 -119 307 -125 l 343 0 l 425 0 l 387 -78 q 429 -92 410 -83 q 464 -115 449 -101 q 487 -149 478 -129 q 495 -195 495 -168 z "},"è":{ha:743,x_min:77,x_max:673,o:"m 412 -14 q 276 12 338 -14 q 170 85 214 37 q 101 204 125 133 q 77 367 77 275 q 99 532 77 459 q 162 655 121 604 q 259 732 203 705 q 385 758 316 758 q 505 734 452 758 q 596 666 559 710 q 653 561 633 623 q 673 425 673 500 l 673 349 l 204 349 q 259 156 208 218 q 414 94 311 94 q 478 98 448 94 q 535 107 507 101 q 588 124 562 114 q 640 146 614 134 l 640 36 q 587 14 613 23 q 533 -2 561 4 q 476 -11 506 -8 q 412 -14 447 -14 m 382 656 q 259 603 304 656 q 207 449 214 550 l 541 449 q 531 533 541 495 q 503 599 522 572 q 454 641 484 626 q 382 656 424 656 m 460 842 l 378 842 q 327 889 355 861 q 273 947 299 917 q 225 1004 247 977 q 193 1050 204 1031 l 193 1064 l 342 1064 q 367 1014 353 1041 q 397 959 382 986 q 429 905 413 931 q 460 860 446 880 l 460 842 z "},"é":{ha:743,x_min:77,x_max:673,o:"m 412 -14 q 276 12 338 -14 q 170 85 214 37 q 101 204 125 133 q 77 367 77 275 q 99 532 77 459 q 162 655 121 604 q 259 732 203 705 q 385 758 316 758 q 505 734 452 758 q 596 666 559 710 q 653 561 633 623 q 673 425 673 500 l 673 349 l 204 349 q 259 156 208 218 q 414 94 311 94 q 478 98 448 94 q 535 107 507 101 q 588 124 562 114 q 640 146 614 134 l 640 36 q 587 14 613 23 q 533 -2 561 4 q 476 -11 506 -8 q 412 -14 447 -14 m 382 656 q 259 603 304 656 q 207 449 214 550 l 541 449 q 531 533 541 495 q 503 599 522 572 q 454 641 484 626 q 382 656 424 656 m 322 860 q 353 905 337 880 q 385 959 369 931 q 415 1014 401 986 q 440 1064 429 1041 l 589 1064 l 589 1050 q 556 1004 578 1031 q 509 947 535 977 q 455 889 483 917 q 404 842 428 861 l 322 842 l 322 860 z "},"ê":{ha:743,x_min:77,x_max:673,o:"m 412 -14 q 276 12 338 -14 q 170 85 214 37 q 101 204 125 133 q 77 367 77 275 q 99 532 77 459 q 162 655 121 604 q 259 732 203 705 q 385 758 316 758 q 505 734 452 758 q 596 666 559 710 q 653 561 633 623 q 673 425 673 500 l 673 349 l 204 349 q 259 156 208 218 q 414 94 311 94 q 478 98 448 94 q 535 107 507 101 q 588 124 562 114 q 640 146 614 134 l 640 36 q 587 14 613 23 q 533 -2 561 4 q 476 -11 506 -8 q 412 -14 447 -14 m 382 656 q 259 603 304 656 q 207 449 214 550 l 541 449 q 531 533 541 495 q 503 599 522 572 q 454 641 484 626 q 382 656 424 656 m 602 842 l 520 842 q 449 898 486 865 q 377 968 412 930 q 304 898 340 930 q 234 842 269 865 l 152 842 l 152 860 q 193 905 170 880 q 238 959 216 931 q 281 1014 261 986 q 312 1064 301 1041 l 442 1064 q 473 1014 453 1041 q 516 959 493 986 q 562 905 538 931 q 602 860 585 880 l 602 842 z "},"ë":{ha:743,x_min:77,x_max:673,o:"m 412 -14 q 276 12 338 -14 q 170 85 214 37 q 101 204 125 133 q 77 367 77 275 q 99 532 77 459 q 162 655 121 604 q 259 732 203 705 q 385 758 316 758 q 505 734 452 758 q 596 666 559 710 q 653 561 633 623 q 673 425 673 500 l 673 349 l 204 349 q 259 156 208 218 q 414 94 311 94 q 478 98 448 94 q 535 107 507 101 q 588 124 562 114 q 640 146 614 134 l 640 36 q 587 14 613 23 q 533 -2 561 4 q 476 -11 506 -8 q 412 -14 447 -14 m 382 656 q 259 603 304 656 q 207 449 214 550 l 541 449 q 531 533 541 495 q 503 599 522 572 q 454 641 484 626 q 382 656 424 656 m 182 946 q 201 999 182 983 q 248 1015 220 1015 q 294 999 274 1015 q 313 946 313 982 q 294 893 313 910 q 248 876 274 876 q 201 893 220 876 q 182 946 182 910 m 437 946 q 456 999 437 983 q 502 1015 475 1015 q 527 1011 515 1015 q 547 999 538 1007 q 562 977 556 990 q 567 946 567 964 q 547 893 567 910 q 502 876 528 876 q 456 893 475 876 q 437 946 437 910 z "},"ì":{ha:359,x_min:-23,x_max:243,o:"m 241 0 l 118 0 l 118 745 l 241 745 l 241 0 m 243 842 l 162 842 q 111 889 138 861 q 57 947 83 917 q 9 1004 31 977 q -23 1050 -12 1031 l -23 1064 l 125 1064 q 151 1014 136 1041 q 181 959 165 986 q 213 905 197 931 q 243 860 229 880 l 243 842 z "},"í":{ha:359,x_min:118,x_max:392,o:"m 241 0 l 118 0 l 118 745 l 241 745 l 241 0 m 125 860 q 156 905 140 880 q 188 959 172 931 q 218 1014 204 986 q 243 1064 233 1041 l 392 1064 l 392 1050 q 360 1004 381 1031 q 312 947 338 977 q 259 889 286 917 q 208 842 231 861 l 125 842 l 125 860 z "},"î":{ha:359,x_min:-45,x_max:405,o:"m 241 0 l 118 0 l 118 745 l 241 745 l 241 0 m 405 842 l 323 842 q 252 898 288 865 q 180 968 215 930 q 107 898 143 930 q 37 842 71 865 l -45 842 l -45 860 q -5 905 -28 880 q 41 959 18 931 q 84 1014 64 986 q 115 1064 104 1041 l 245 1064 q 276 1014 256 1041 q 318 959 296 986 q 365 905 341 931 q 405 860 388 880 l 405 842 z "},"ï":{ha:359,x_min:-12,x_max:372,o:"m 241 0 l 118 0 l 118 745 l 241 745 l 241 0 m -12 946 q 7 999 -12 983 q 53 1015 26 1015 q 99 999 79 1015 q 119 946 119 982 q 99 893 119 910 q 53 876 79 876 q 7 893 26 876 q -12 946 -12 910 m 242 946 q 261 999 242 983 q 307 1015 280 1015 q 332 1011 320 1015 q 353 999 344 1007 q 367 977 361 990 q 372 946 372 964 q 353 893 372 910 q 307 876 333 876 q 261 893 280 876 q 242 946 242 910 z "},"ð":{ha:802,x_min:75,x_max:725,o:"m 725 389 q 702 218 725 292 q 637 92 680 143 q 534 13 595 40 q 399 -14 474 -14 q 269 9 328 -14 q 166 74 210 31 q 99 180 123 117 q 75 323 75 243 q 97 467 75 404 q 158 572 118 529 q 255 636 198 614 q 383 659 312 659 q 505 638 452 659 q 586 578 557 618 l 591 581 q 530 726 570 661 q 428 846 489 791 l 254 742 l 204 819 l 351 908 q 295 946 324 927 q 235 982 267 964 l 282 1065 q 368 1019 326 1044 q 449 965 409 995 l 603 1059 l 653 982 l 521 903 q 604 806 566 859 q 668 689 642 753 q 710 551 695 626 q 725 389 725 476 m 597 357 q 586 431 597 395 q 551 495 574 467 q 490 540 527 523 q 401 557 452 557 q 312 541 349 557 q 252 496 275 526 q 217 421 228 466 q 205 319 205 377 q 217 225 205 268 q 252 153 228 183 q 313 105 276 122 q 401 89 350 89 q 552 156 506 89 q 597 357 597 224 z "},"ñ":{ha:818,x_min:118,x_max:707,o:"m 583 0 l 583 479 q 548 612 583 568 q 436 656 512 656 q 344 638 381 656 q 284 586 307 621 q 251 501 261 551 q 241 386 241 451 l 241 0 l 118 0 l 118 745 l 218 745 l 236 644 l 243 644 q 283 695 260 673 q 334 730 307 716 q 393 751 362 745 q 457 758 425 758 q 644 693 581 758 q 707 486 707 629 l 707 0 l 583 0 m 515 843 q 461 855 488 843 q 408 881 434 867 q 359 908 382 896 q 313 920 335 920 q 267 902 283 920 q 241 842 250 884 l 170 842 q 185 916 174 882 q 214 972 196 949 q 257 1008 232 996 q 313 1021 282 1021 q 369 1009 342 1021 q 422 983 397 997 q 472 957 448 968 q 515 945 495 945 q 561 962 545 945 q 587 1022 576 980 l 658 1022 q 643 948 654 981 q 614 892 632 916 q 571 856 596 869 q 515 843 546 843 z "},"ò":{ha:802,x_min:77,x_max:725,o:"m 725 374 q 702 209 725 281 q 637 87 680 136 q 534 12 595 38 q 399 -14 474 -14 q 270 12 329 -14 q 168 87 211 38 q 101 209 125 136 q 77 374 77 281 q 99 537 77 466 q 164 658 122 609 q 267 733 206 707 q 403 758 328 758 q 532 733 473 758 q 634 658 591 707 q 701 537 677 609 q 725 374 725 466 m 204 374 q 251 160 204 232 q 401 89 297 89 q 552 160 506 89 q 597 374 597 232 q 551 586 597 515 q 400 656 505 656 q 250 586 296 656 q 204 374 204 515 m 506 842 l 425 842 q 373 889 401 861 q 319 947 345 917 q 272 1004 293 977 q 239 1050 250 1031 l 239 1064 l 388 1064 q 413 1014 399 1041 q 444 959 428 986 q 475 905 459 931 q 506 860 492 880 l 506 842 z "},"ó":{ha:802,x_min:77,x_max:725,o:"m 725 374 q 702 209 725 281 q 637 87 680 136 q 534 12 595 38 q 399 -14 474 -14 q 270 12 329 -14 q 168 87 211 38 q 101 209 125 136 q 77 374 77 281 q 99 537 77 466 q 164 658 122 609 q 267 733 206 707 q 403 758 328 758 q 532 733 473 758 q 634 658 591 707 q 701 537 677 609 q 725 374 725 466 m 204 374 q 251 160 204 232 q 401 89 297 89 q 552 160 506 89 q 597 374 597 232 q 551 586 597 515 q 400 656 505 656 q 250 586 296 656 q 204 374 204 515 m 321 860 q 352 905 336 880 q 384 959 368 931 q 414 1014 399 986 q 439 1064 428 1041 l 587 1064 l 587 1050 q 555 1004 576 1031 q 508 947 534 977 q 454 889 481 917 q 403 842 427 861 l 321 842 l 321 860 z "},"ô":{ha:802,x_min:77,x_max:725,o:"m 725 374 q 702 209 725 281 q 637 87 680 136 q 534 12 595 38 q 399 -14 474 -14 q 270 12 329 -14 q 168 87 211 38 q 101 209 125 136 q 77 374 77 281 q 99 537 77 466 q 164 658 122 609 q 267 733 206 707 q 403 758 328 758 q 532 733 473 758 q 634 658 591 707 q 701 537 677 609 q 725 374 725 466 m 204 374 q 251 160 204 232 q 401 89 297 89 q 552 160 506 89 q 597 374 597 232 q 551 586 597 515 q 400 656 505 656 q 250 586 296 656 q 204 374 204 515 m 622 842 l 540 842 q 469 898 505 865 q 397 968 432 930 q 324 898 360 930 q 254 842 288 865 l 172 842 l 172 860 q 212 905 189 880 q 258 959 235 931 q 301 1014 281 986 q 332 1064 321 1041 l 462 1064 q 493 1014 473 1041 q 535 959 513 986 q 582 905 558 931 q 622 860 605 880 l 622 842 z "},"õ":{ha:802,x_min:77,x_max:725,o:"m 725 374 q 702 209 725 281 q 637 87 680 136 q 534 12 595 38 q 399 -14 474 -14 q 270 12 329 -14 q 168 87 211 38 q 101 209 125 136 q 77 374 77 281 q 99 537 77 466 q 164 658 122 609 q 267 733 206 707 q 403 758 328 758 q 532 733 473 758 q 634 658 591 707 q 701 537 677 609 q 725 374 725 466 m 204 374 q 251 160 204 232 q 401 89 297 89 q 552 160 506 89 q 597 374 597 232 q 551 586 597 515 q 400 656 505 656 q 250 586 296 656 q 204 374 204 515 m 499 843 q 445 855 472 843 q 393 881 418 867 q 343 908 367 896 q 298 920 319 920 q 251 902 267 920 q 225 842 235 884 l 155 842 q 169 916 158 882 q 198 972 180 949 q 241 1008 216 996 q 298 1021 267 1021 q 354 1009 326 1021 q 407 983 381 997 q 456 957 433 968 q 499 945 479 945 q 545 962 530 945 q 571 1022 561 980 l 642 1022 q 628 948 639 981 q 598 892 616 916 q 555 856 581 869 q 499 843 530 843 z "},"ö":{ha:802,x_min:77,x_max:725,o:"m 725 374 q 702 209 725 281 q 637 87 680 136 q 534 12 595 38 q 399 -14 474 -14 q 270 12 329 -14 q 168 87 211 38 q 101 209 125 136 q 77 374 77 281 q 99 537 77 466 q 164 658 122 609 q 267 733 206 707 q 403 758 328 758 q 532 733 473 758 q 634 658 591 707 q 701 537 677 609 q 725 374 725 466 m 204 374 q 251 160 204 232 q 401 89 297 89 q 552 160 506 89 q 597 374 597 232 q 551 586 597 515 q 400 656 505 656 q 250 586 296 656 q 204 374 204 515 m 203 946 q 222 999 203 983 q 269 1015 241 1015 q 315 999 295 1015 q 334 946 334 982 q 315 893 334 910 q 269 876 295 876 q 222 893 241 876 q 203 946 203 910 m 458 946 q 477 999 458 983 q 523 1015 496 1015 q 548 1011 536 1015 q 568 999 559 1007 q 583 977 577 990 q 588 946 588 964 q 568 893 588 910 q 523 876 549 876 q 477 893 496 876 q 458 946 458 910 z "},"÷":{ha:765,x_min:69,x_max:696,o:"m 69 439 l 69 541 l 696 541 l 696 439 l 69 439 m 304 253 q 311 293 304 277 q 327 319 317 309 q 352 333 338 329 q 382 338 366 338 q 412 333 397 338 q 437 319 426 329 q 454 293 448 309 q 460 253 460 277 q 454 215 460 231 q 437 188 448 199 q 412 173 426 178 q 382 168 397 168 q 352 173 366 168 q 327 188 338 178 q 311 215 317 199 q 304 253 304 231 m 304 726 q 311 766 304 750 q 327 792 317 782 q 352 807 338 802 q 382 811 366 811 q 412 807 397 811 q 437 792 426 802 q 454 766 448 782 q 460 726 460 750 q 454 688 460 704 q 437 662 448 672 q 412 646 426 651 q 382 642 397 642 q 352 646 366 642 q 327 662 338 651 q 311 688 317 672 q 304 726 304 704 z "},"ø":{ha:802,x_min:78,x_max:726,o:"m 726 374 q 704 209 726 281 q 638 87 681 136 q 536 12 596 38 q 400 -14 475 -14 q 249 22 315 -14 l 203 -52 l 114 -1 l 168 87 q 102 209 125 136 q 78 374 78 281 q 101 537 78 466 q 165 658 123 609 q 268 733 208 707 q 404 758 329 758 q 485 748 447 758 q 557 720 524 739 l 603 793 l 692 743 l 637 656 q 703 535 680 606 q 726 374 726 465 m 205 374 q 212 272 205 317 q 233 193 218 228 l 503 632 q 457 650 483 644 q 401 656 432 656 q 251 586 297 656 q 205 374 205 515 m 599 374 q 572 549 599 481 l 302 111 q 348 94 323 100 q 403 89 372 89 q 553 160 507 89 q 599 374 599 232 z "},"ù":{ha:818,x_min:111,x_max:700,o:"m 600 0 l 582 100 l 575 100 q 535 49 558 71 q 484 14 511 28 q 425 -7 456 0 q 361 -14 393 -14 q 252 2 299 -14 q 174 51 205 18 q 127 136 143 84 q 111 258 111 187 l 111 745 l 235 745 l 235 265 q 271 133 235 177 q 382 89 307 89 q 474 106 437 89 q 534 158 511 124 q 567 243 557 193 q 576 358 576 293 l 576 745 l 700 745 l 700 0 l 600 0 m 470 842 l 389 842 q 337 889 365 861 q 283 947 309 917 q 236 1004 257 977 q 203 1050 214 1031 l 203 1064 l 352 1064 q 377 1014 363 1041 q 408 959 392 986 q 439 905 423 931 q 470 860 456 880 l 470 842 z "},"ú":{ha:818,x_min:111,x_max:700,o:"m 600 0 l 582 100 l 575 100 q 535 49 558 71 q 484 14 511 28 q 425 -7 456 0 q 361 -14 393 -14 q 252 2 299 -14 q 174 51 205 18 q 127 136 143 84 q 111 258 111 187 l 111 745 l 235 745 l 235 265 q 271 133 235 177 q 382 89 307 89 q 474 106 437 89 q 534 158 511 124 q 567 243 557 193 q 576 358 576 293 l 576 745 l 700 745 l 700 0 l 600 0 m 332 860 q 362 905 347 880 q 394 959 378 931 q 425 1014 410 986 q 450 1064 439 1041 l 598 1064 l 598 1050 q 566 1004 587 1031 q 518 947 545 977 q 465 889 492 917 q 414 842 437 861 l 332 842 l 332 860 z "},"û":{ha:818,x_min:111,x_max:700,o:"m 600 0 l 582 100 l 575 100 q 535 49 558 71 q 484 14 511 28 q 425 -7 456 0 q 361 -14 393 -14 q 252 2 299 -14 q 174 51 205 18 q 127 136 143 84 q 111 258 111 187 l 111 745 l 235 745 l 235 265 q 271 133 235 177 q 382 89 307 89 q 474 106 437 89 q 534 158 511 124 q 567 243 557 193 q 576 358 576 293 l 576 745 l 700 745 l 700 0 l 600 0 m 631 842 l 549 842 q 477 898 514 865 q 406 968 441 930 q 333 898 369 930 q 262 842 297 865 l 180 842 l 180 860 q 221 905 198 880 q 267 959 244 931 q 310 1014 290 986 q 340 1064 330 1041 l 471 1064 q 502 1014 481 1041 q 544 959 522 986 q 590 905 567 931 q 631 860 614 880 l 631 842 z "},"ü":{ha:818,x_min:111,x_max:700,o:"m 600 0 l 582 100 l 575 100 q 535 49 558 71 q 484 14 511 28 q 425 -7 456 0 q 361 -14 393 -14 q 252 2 299 -14 q 174 51 205 18 q 127 136 143 84 q 111 258 111 187 l 111 745 l 235 745 l 235 265 q 271 133 235 177 q 382 89 307 89 q 474 106 437 89 q 534 158 511 124 q 567 243 557 193 q 576 358 576 293 l 576 745 l 700 745 l 700 0 l 600 0 m 210 946 q 229 999 210 983 q 275 1015 248 1015 q 321 999 301 1015 q 340 946 340 982 q 321 893 340 910 q 275 876 301 876 q 229 893 248 876 q 210 946 210 910 m 464 946 q 483 999 464 983 q 529 1015 502 1015 q 554 1011 542 1015 q 574 999 566 1007 q 589 977 583 990 q 594 946 594 964 q 574 893 594 910 q 529 876 555 876 q 483 893 502 876 q 464 946 464 910 z "},"ý":{ha:679,x_min:7,x_max:672,o:"m 7 745 l 135 745 l 281 329 q 300 272 290 302 q 318 212 310 242 q 333 155 327 182 q 342 103 339 127 l 346 103 q 357 149 349 120 q 373 211 364 178 q 392 276 382 244 q 410 330 402 308 l 545 745 l 672 745 l 378 -97 q 337 -196 359 -152 q 286 -270 315 -239 q 217 -317 256 -300 q 123 -334 178 -334 q 62 -330 88 -334 q 18 -322 37 -326 l 18 -224 q 54 -230 33 -227 q 100 -232 76 -232 q 156 -224 132 -232 q 197 -201 180 -216 q 228 -165 215 -186 q 250 -115 240 -143 l 289 -7 l 7 745 m 276 860 q 307 905 291 880 q 339 959 323 931 q 369 1014 355 986 q 394 1064 383 1041 l 543 1064 l 543 1050 q 510 1004 532 1031 q 463 947 489 977 q 409 889 437 917 q 358 842 382 861 l 276 842 l 276 860 z "},"þ":{ha:814,x_min:118,x_max:737,o:"m 241 644 q 277 689 257 668 q 322 725 296 709 q 381 749 349 740 q 454 758 414 758 q 570 734 518 758 q 660 661 623 709 q 717 541 696 612 q 737 374 737 469 q 717 206 737 278 q 660 85 696 134 q 570 11 623 36 q 454 -14 518 -14 q 382 -5 414 -14 q 323 19 349 4 q 277 53 297 33 q 241 94 257 73 l 233 94 q 237 50 235 71 q 240 14 239 33 q 241 -16 241 -5 l 241 -334 l 118 -334 l 118 1055 l 241 1055 l 241 745 l 236 644 l 241 644 m 431 656 q 343 640 379 656 q 286 593 308 625 q 253 513 264 561 q 241 401 243 466 l 241 374 q 251 252 241 305 q 282 162 260 199 q 340 107 304 126 q 432 89 377 89 q 567 163 524 89 q 610 375 610 237 q 567 586 610 516 q 431 656 524 656 z "},"ÿ":{ha:679,x_min:7,x_max:672,o:"m 7 745 l 135 745 l 281 329 q 300 272 290 302 q 318 212 310 242 q 333 155 327 182 q 342 103 339 127 l 346 103 q 357 149 349 120 q 373 211 364 178 q 392 276 382 244 q 410 330 402 308 l 545 745 l 672 745 l 378 -97 q 337 -196 359 -152 q 286 -270 315 -239 q 217 -317 256 -300 q 123 -334 178 -334 q 62 -330 88 -334 q 18 -322 37 -326 l 18 -224 q 54 -230 33 -227 q 100 -232 76 -232 q 156 -224 132 -232 q 197 -201 180 -216 q 228 -165 215 -186 q 250 -115 240 -143 l 289 -7 l 7 745 m 155 946 q 174 999 155 983 q 220 1015 193 1015 q 266 999 246 1015 q 286 946 286 982 q 266 893 286 910 q 220 876 246 876 q 174 893 193 876 q 155 946 155 910 m 409 946 q 428 999 409 983 q 474 1015 447 1015 q 499 1011 487 1015 q 519 999 511 1007 q 534 977 528 990 q 539 946 539 964 q 519 893 539 910 q 474 876 500 876 q 428 893 447 876 q 409 946 409 910 z "},"ı":{ha:359,x_min:118,x_max:241,o:"m 241 0 l 118 0 l 118 745 l 241 745 l 241 0 z "},"ˆ":{ha:802,x_min:175,x_max:625,o:"m 625 842 l 543 842 q 472 898 509 865 q 400 968 435 930 q 328 898 363 930 q 257 842 292 865 l 175 842 l 175 860 q 216 905 193 880 q 261 959 239 931 q 304 1014 284 986 q 335 1064 324 1041 l 465 1064 q 496 1014 476 1041 q 539 959 516 986 q 585 905 562 931 q 625 860 608 880 l 625 842 z "},"˚":{ha:802,x_min:248,x_max:554,o:"m 554 989 q 542 927 554 954 q 510 880 530 899 q 460 851 489 861 q 399 842 432 842 q 337 851 365 842 q 289 880 309 861 q 258 926 269 899 q 248 987 248 953 q 258 1049 248 1022 q 289 1095 269 1076 q 337 1123 309 1114 q 399 1133 365 1133 q 460 1123 431 1133 q 509 1095 488 1114 q 542 1049 530 1076 q 554 989 554 1023 m 475 987 q 453 1044 475 1023 q 399 1064 432 1064 q 343 1044 365 1064 q 322 987 322 1023 q 341 931 322 951 q 399 911 361 911 q 453 931 432 911 q 475 987 475 951 z "},"˜":{ha:802,x_min:175,x_max:663,o:"m 519 843 q 466 855 492 843 q 413 881 439 867 q 363 908 387 896 q 318 920 340 920 q 271 902 288 920 q 245 842 255 884 l 175 842 q 190 916 178 882 q 219 972 201 949 q 262 1008 237 996 q 318 1021 287 1021 q 374 1009 347 1021 q 427 983 401 997 q 476 957 453 968 q 519 945 500 945 q 566 962 550 945 q 591 1022 581 980 l 663 1022 q 648 948 659 981 q 619 892 637 916 q 576 856 601 869 q 519 843 551 843 z "},"–":{ha:694,x_min:56,x_max:639,o:"m 56 315 l 56 429 l 639 429 l 639 315 l 56 315 z "},"—":{ha:1389,x_min:56,x_max:1333,o:"m 56 315 l 56 429 l 1333 429 l 1333 315 l 56 315 z "},"‘":{ha:243,x_min:16,x_max:228,o:"m 25 652 l 16 667 q 38 745 25 703 q 67 828 52 786 q 100 912 83 870 q 135 991 118 954 l 228 991 q 208 905 218 950 q 189 816 198 861 q 173 730 180 772 q 160 652 165 688 l 25 652 z "},"’":{ha:243,x_min:16,x_max:228,o:"m 218 991 l 228 977 q 205 898 218 939 q 176 815 192 857 q 143 731 160 772 q 109 652 125 690 l 16 652 q 35 737 25 692 q 54 827 45 782 q 71 913 63 871 q 83 991 78 956 l 218 991 z "},"‚":{ha:347,x_min:43,x_max:256,o:"m 245 161 l 256 146 q 233 68 246 109 q 204 -16 220 26 q 171 -99 188 -58 q 136 -179 153 -141 l 43 -179 q 63 -93 53 -138 q 82 -4 73 -48 q 98 83 91 41 q 111 161 106 125 l 245 161 z "},"“":{ha:504,x_min:16,x_max:489,o:"m 286 652 l 277 667 q 299 745 286 703 q 328 828 313 786 q 361 912 344 870 q 396 991 379 954 l 489 991 q 469 905 479 950 q 450 816 459 861 q 434 730 441 772 q 421 652 427 688 l 286 652 m 25 652 l 16 667 q 38 745 25 703 q 67 828 52 786 q 100 912 83 870 q 135 991 118 954 l 228 991 q 208 905 218 950 q 189 816 198 861 q 173 730 180 772 q 160 652 165 688 l 25 652 z "},"”":{ha:504,x_min:16,x_max:489,o:"m 218 991 l 228 977 q 205 898 218 939 q 176 815 192 857 q 143 731 160 772 q 109 652 125 690 l 16 652 q 35 737 25 692 q 54 827 45 782 q 71 913 63 871 q 83 991 78 956 l 218 991 m 479 991 l 489 977 q 466 898 479 939 q 437 815 453 857 q 404 731 421 772 q 370 652 387 690 l 277 652 q 296 737 286 692 q 315 827 306 782 q 332 913 324 871 q 345 991 339 956 l 479 991 z "},"„":{ha:608,x_min:43,x_max:517,o:"m 245 161 l 256 146 q 233 68 246 109 q 204 -16 220 26 q 171 -99 188 -58 q 136 -179 153 -141 l 43 -179 q 63 -93 53 -138 q 82 -4 73 -48 q 98 83 91 41 q 111 161 106 125 l 245 161 m 507 161 l 517 146 q 494 68 507 109 q 465 -16 481 26 q 432 -99 449 -58 q 397 -179 414 -141 l 304 -179 q 324 -93 314 -138 q 343 -4 334 -48 q 359 83 352 41 q 372 161 367 125 l 507 161 z "},"•":{ha:522,x_min:102,x_max:421,o:"m 102 507 q 114 589 102 555 q 148 645 126 623 q 198 675 169 666 q 261 685 227 685 q 323 675 294 685 q 374 645 353 666 q 409 589 396 623 q 421 507 421 555 q 409 426 421 460 q 374 371 396 392 q 323 339 353 349 q 261 329 294 329 q 198 339 227 329 q 148 371 169 349 q 114 426 126 392 q 102 507 102 460 z "},"‹":{ha:400,x_min:56,x_max:345,o:"m 56 375 l 265 656 l 345 603 l 183 367 l 345 131 l 265 78 l 56 357 l 56 375 z "},"›":{ha:400,x_min:56,x_max:345,o:"m 345 357 l 135 78 l 56 131 l 216 367 l 56 603 l 135 656 l 345 375 l 345 357 z "},"⁄":{ha:180,x_min:-239,x_max:418,o:"m 418 991 l -132 0 l -239 0 l 311 991 l 418 991 z "}},familyName:"Droid Sans",ascender:1293,descender:-334,underlinePosition:-154,underlineThickness:102,boundingBox:{yMin:-492,xMin:-352,yMax:1907,xMax:1966},resolution:1e3,original_font_information:{format:0,copyright:"Digitized data copyright © 2007, Google Corporation.",fontFamily:"Droid Sans",fontSubfamily:"Regular",uniqueID:"Ascender - Droid Sans",fullName:"Droid Sans",version:"Version 1.00 build 113",postScriptName:"DroidSans",trademark:"Droid is a trademark of Google and may be registered in certain jurisdictions.",manufacturer:"Ascender Corporation",description:"Droid Sans is a humanist sans serif typeface designed for user interfaces and electronic communication.",manufacturerURL:"http://www.ascendercorp.com/",designerURL:"http://www.ascendercorp.com/typedesigners.html",licence:"Licensed under the Apache License, Version 2.0",licenceURL:"http://®www.apache.org/licenses/LICENSE-2.0",compatibleFullName:"Droid Sans"},cssFontWeight:"normal",cssFontStyle:"normal"},S1=class{constructor(){this.fonts={},this.getFont=this.getFont.bind(this)}getFont(t){if(this.fonts[t])return this.fonts[t];if(!t)return Promise.resolve(KM);switch(t){case"arrival":return this.fonts[t]=import("./Arrival-JVXBAUFE.js").then((t=>Ts(t))),this.fonts[t];case"chalet-parisnineteensixty":return this.fonts[t]=import("./Chalet-7VKCGC5R.js").then((t=>Ts(t))),this.fonts[t];case"helvetica neue":return this.fonts[t]=import("./HelveticaNeue-M6HRIIGZ.js").then((t=>Ts(t))),this.fonts[t];case"helvetiker":return this.fonts[t]=import("./Helvetiker-K2MS62IA.js").then((t=>Ts(t))),this.fonts[t];case"lato":return this.fonts[t]=import("./Lato-PKBWMAQE.js").then((t=>Ts(t))),this.fonts[t];case"myriad pro":return this.fonts[t]=import("./MyriadPro-MKDHQECZ.js").then((t=>Ts(t))),this.fonts[t];case"proxima nova medium":return this.fonts[t]=import("./ProximaNova-U6AQPIB5.js").then((t=>Ts(t))),this.fonts[t];case"simon circular book":return this.fonts[t]=import("./SimonCircular-LDXYDCAN.js").then((t=>Ts(t))),this.fonts[t];default:return Promise.resolve(KM)}}};h(S1,"FontLib");var QM=new S1,Ts=h((function(t){let e={},i={};Object.keys(Pc.glyphs).forEach((function(t){i[t]=Pc.glyphs[t]})),Object.keys(t.glyphs).forEach((function(e){i[e]=t.glyphs[e]})),Object.keys(Pc).forEach((function(t){e[t]=Pc[t]})),e.glyphs=i;let n=new qc(e);n._mSupportedCharacters=Object.keys(e.glyphs).join("");let r=n._mSupportedCharacters.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");return n._mInvalidCharacters=new RegExp("[^"+r+"]","g"),n}),"createFont"),KM=Ts(Pc);P();var Md="x",wd="y",Ao="z";function l3(t,e,i){t.computeBoundingBox();let n=t.boundingBox,r=Math.max(i.width,i.height)/1e3,s=Math.max(i.width*r,i.height*r),a={min:new I(0,0,0),max:new I(1,1,1).multiplyScalar(s)},o={};e.forEach((t=>{o[t.name]=t}));let l,u,c=t.getAttribute("position"),d=t.getAttribute("normal"),p=t.getAttribute("uv");ge.assert(c.count==d.count),ge.assert(c.count==p.count),t.index?(ge.assert(t.index.count%3==0),l=t.index.count/3,u=h((function(e,i){return t.index.getX(3*e+i)}),"meshIndex")):(ge.assert(c.count%3==0),l=c.count/3,u=h((function(t,e){return 3*t+e}),"meshIndex"));let m=o.side||{},f=o.front||{},g=null!=m.repeat?m.repeat.u:1,v=null!=m.repeat?m.repeat.v:1,y=null!=m.offset?m.offset.u:1,_=null!=m.offset?m.offset.v:1,x=null!=m.rotation?m.rotation:0,b=m.useLocalScaling||!1,w=null!=f.repeat?f.repeat.u:1,M=null!=f.repeat?f.repeat.v:1,E=null!=f.offset?f.offset.u:1,T=null!=f.offset?f.offset.v:1,S=null!=f.rotation?f.rotation:0,q=f.useLocalScaling||!1;for(let t=0;t<l;++t){let e=d.getX(u(t,0))+d.getX(u(t,1))+d.getX(u(t,2)),i=d.getY(u(t,0))+d.getY(u(t,1))+d.getY(u(t,2)),r=d.getZ(u(t,0))+d.getZ(u(t,1))+d.getZ(u(t,2)),s=Math.abs(e),o=Math.abs(i),l=Math.abs(r);var P,A,C,L,R,N,O,D;s<=o&&s<=l?(P=Md,A=o<=l?wd:Ao):o<=s&&o<=l?(P=wd,A=s<=l?Md:Ao):(P=Ao,A=s<=o?Md:wd),P===Ao&&(P=A,A=Ao),A===Ao||P===Ao?(C=g,L=v,R=y,N=_,O=x,D=b?n:a):(C=w,L=M,R=E,N=T,O=S,D=q?n:a);let h=D.min,m=D.max,f=Math.abs(m[P]-h[P]),I=Math.abs(m[A]-h[A]),F=O*Math.PI/180||0,z=Math.cos(F),U=Math.sin(F);for(let e=0;e<3;e++){let i=c.getX(u(t,e)),n=c.getY(u(t,e)),r=c.getZ(u(t,e));var B,k;B=P===Md?C*(i-h[P])/f+R:P===wd?C*(n-h[P])/f+R:C*(r-h[P])/f+R,k=A===Md?L*(i-h[A])/I+N:A===wd?L*(n-h[A])/I+N:L*(r-h[A])/I+N;let s=(B-=.5)*z-(k-=.5)*U+.5,a=B*U+k*z+.5;p.setX(u(t,e),s),p.setY(u(t,e),a)}}t.uvsNeedUpdate=!0}h(l3,"updateUVs");var Ot=class extends di{constructor(t,e,i,n,r="MULTI_GEOMETRY"){var s,a;super(),w(this,"polygon"),w(this,"mapClass"),w(this,"container"),w(this,"visible"),w(this,"mode"),w(this,"assetManager"),w(this,"imageVisible"),w(this,"labelVisible"),w(this,"boundingBox"),w(this,"polygonHeight"),w(this,"geometry"),w(this,"mesh"),w(this,"material"),w(this,"labelMesh"),w(this,"imageMesh"),this.mode=r,this.polygon=t,this.mapClass=e,this.container=i,this.assetManager=n;let o=!1!==t.geometry.visible,l=!0===(null==(s=t.image)?void 0:s.visible)&&(null!=t.image.url||null!=t.image.original),h=!0===(null==(a=t.label)?void 0:a.visible)&&null!=t.label.text;(o||l||h)&&Ot._setPolygonDefaults(t),this.visible=o,this.imageVisible=l,this.labelVisible=h,this.load=this.load.bind(this)}static getDefaultMaterial(){return Ot.defaultMaterial||(Ot.defaultMaterial=new yi({color:0})),Ot.defaultMaterial}static getWeightedCenter(t){let e=t.reduce(((t,e)=>({x:t.x+e.x,y:t.y+e.y})),{x:0,y:0});return e.x/=t.length,e.y/=t.length,e}static getBoundingCentre(t){let e=1/0,i=1/0,n=-1/0,r=-1/0;return t.forEach((t=>{t.x>n&&(n=t.x),t.x<e&&(e=t.x),t.y>r&&(r=t.y),t.y<i&&(i=t.y)})),{x:(e+n)/2,y:(i+r)/2}}static _makeFromCoords(t,e,i){let n=new t;return n.moveTo(e[0].x-i.width/2,-e[0].y+i.height/2),e.slice(1).forEach((t=>n.lineTo(t.x-i.width/2,-t.y+i.height/2))),n.lineTo(e[0].x-i.width/2,-e[0].y+i.height/2),n}static _setPolygonDefaults(t){let e={visible:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:5},bevel:{size:0,thickness:0,segments:1},offset:0};return t.layer||(t.layer="Polygon"),t.geometry=(0,Es.default)(t.geometry,e),t.geometry.bevel=(0,Es.default)(t.geometry.bevel,e.bevel),t.image&&(t.image.position=(0,Es.default)(t.image.position,e.position),t.image.rotation=(0,Es.default)(t.image.rotation,e.rotation),t.image.scale=(0,Es.default)(t.image.scale,e.scale)),t.label&&(t.label.position=(0,Es.default)(t.label.position,e.position),t.label.rotation=(0,Es.default)(t.label.rotation,e.rotation),t.label.scale=(0,Es.default)(t.label.scale,e.scale),t.label.color=t.label.color||"#000000",t.label.fontSize=t.label.fontSize||20),t}getBoundingBox(){if(this.boundingBox)return this.boundingBox;let t=1/0,e=1/0,i=-1/0,n=-1/0,r=-this.mapClass.width/2,s=this.mapClass.height/2;return this.polygon.vertexes.forEach((a=>{a.x+r>i&&(i=a.x+r),a.x+r<t&&(t=a.x+r),-a.y+s>n&&(n=-a.y+s),-a.y+s<e&&(e=-a.y+s)})),this.boundingBox={min:{x:t,y:e,z:0},max:{x:i,y:n,z:0}},this.boundingBox}load(){return Ge(this,null,(function*(){let t=this.polygon,e=this.mapClass;if(this.visible){let i=t.vertexes,n=Math.max(e.width,e.height)/1e3;(this.imageVisible||t.geometry.offset)&&(i=Ot._clip(i,0),i=Ot._clip(i,t.geometry.offset),t.vertexes=i);let r,s=Ot._makeFromCoords(Gn,i,e);t.holes&&(s.holes=t.holes.map((t=>Ot._makeFromCoords(Qr,t,e)))),r=t.geometry.bevel?{bevelEnabled:!0,depth:t.geometry.scale.z*n,bevelThickness:t.geometry.bevel.thickness*t.geometry.scale.z*n,bevelSize:t.geometry.bevel.size*n,bevelSegments:t.geometry.bevel.segments||1}:{bevelEnabled:!1,depth:t.geometry.scale.z*n},this.polygonHeight=t.geometry.scale.z*Math.max(this.mapClass.width,this.mapClass.height)/1e3;let a=Array.isArray(t.textures)&&t.textures.filter((t=>t.image&&Object.keys(t.image).length)).length,o=Ot._normalizeColor(t.material.color),l=t.material.opacity||1;if(this.geometry=new jn(s,r),a&&Array.isArray(t.textures)){let i,n,r=t.textures.find((t=>"front"===t.name)),s=t.textures.find((t=>"side"===t.name)),a=s&&s.useFrontFaceImage,h=r&&r.image&&(r.image.url||r.image.original),u=s&&s.image&&(s.image.url||s.image.original);l3(this.geometry,t.textures,e),h&&(i=yield this.assetManager.loadImage(h),i.mapping=Tu,i.wrapS=Ji,i.wrapT=Ji,i.anisotropy=16),!a&&u?(n=yield this.assetManager.loadImage(u),n.mapping=Tu,n.wrapS=Ji,n.wrapT=Ji,n.anisotropy=16):i&&(n=i);let c={color:o,transparent:!0,opacity:l,side:l<1?pr:Xs};this.material=n===i?new yi(Ue(be({},c),{map:i})):[new yi(Ue(be({},c),{map:i})),new yi(Ue(be({},c),{map:n}))]}else this.material=Ot._getMaterial(t.material.color,l);this.mesh=new lt(this.geometry,"MULTI_GEOMETRY"===this.mode?this.material:Ot.hoverMeshMaterial),this.mesh.name=t.id,Array.isArray(this.mesh.material)||(this.mesh.material.needsUpdate=!0),"MULTI_GEOMETRY"===this.mode?(this.mesh.translateZ(t.geometry.position.z*n),this.container.add(this.mesh)):(this.geometry.translate(0,0,t.geometry.position.z*n),this.mesh.renderOrder=1)}return this.imageVisible||this.labelVisible?(this.imageVisible&&this._addImage(t,e),this.labelVisible&&this._addLabel(t,e),this):this}))}_addLabel(t,e){var i;if(null==(null==(i=null==t?void 0:t.label)?void 0:i.text))return;let n=Math.max(e.width,e.height)/1e3,r=Ot.getWeightedCenter(t.vertexes),s=t.label.position,a=t.label.rotation.z,o=t.label.text.split("\n");QM.getFont(t.label.fontFamily).then((i=>{if(!t.label)return;let l={font:i,size:t.label.fontSize*n,height:Ot.overlayHeight,bevelEnabled:!1,curveSegments:4,align:t.label.align||"left"},h=0,u=o.reverse().map(((t,e)=>(t.length>o[h].length&&(h=e),new gd(t,l)))),c=u[h],d=new lt(c),p=(new At).setFromObject(d).getSize(new I).x,m=Ot._getMaterial(t.label.color),f=0,g=b1(o.map(((t,e)=>{let i,n=u[e],r=new lt(n,m),s=(new At).setFromObject(r).getSize(new I);return i="left"===l.align?0:"right"===l.align?p-s.x:(p-s.x)/2,r.position.set(i,f,0),r.geometry.translate(i,f,0),f+=1.25*l.size,r.geometry}))),v=new lt(g,m);g.computeBoundingBox();let y=g.boundingBox,_=y.max.x-y.min.x,x=y.max.y-y.min.y,b=t.geometry.position.z+t.geometry.scale.z;v.translateX(r.x-e.width/2+s.x-_/2),v.translateY(-r.y+e.height/2+s.y-x/2),v.rotation.set(0,0,a*Math.PI/180),v.translateZ((Ot.overlayHeight+b)*n),this.labelMesh=v,this.container.add(v)}))}_addImage(t,e){if(null==(null==t?void 0:t.image))return;let i=t.image.url||t.image.original;i instanceof Blob&&(i=URL.createObjectURL(i));let n,r=new lt(new xn(1,1));r.renderOrder=2,r.name=t.id+"_image",this.container.add(r),this.imageMesh=r,Ot.imagesLoadingInProgress.has(i)?n=Ot.imagesLoadingInProgress.get(i):(n=this.assetManager.loadImage(i).then((t=>(t.anisotropy=16,[t,new yi({transparent:!0,depthWrite:!1,side:pr,map:t})]))),Ot.imagesLoadingInProgress.set(i,n)),n.then((([n,s])=>{if(null==t.image)return;r.material=s;let a,o=this.getBoundingBox(),l=Math.max(e.width,e.height)/1e3,h=t.vertexes;a=t.image._isAbsolutelyPositioned?{x:t.image.position.x,y:t.image.position.y}:t.image.fitToBounds?Ot.getBoundingCentre(h):Ot.getWeightedCenter(h);let u=t.image.fitToBounds||t.image._isAbsolutelyPositioned?0:t.image.position.x,c=t.image.fitToBounds||t.image._isAbsolutelyPositioned?0:t.image.position.y,d=t.geometry.position.z+t.geometry.scale.z;t.image.position&&(r.position.x=a.x-e.width/2+u,r.position.y=-a.y+e.height/2+c,r.translateZ((d+t.image.position.z)*l)),t.image.rotation&&r.rotation.set(t.image.rotation.x*Math.PI/180,t.image.rotation.y*Math.PI/180,t.image.rotation.z*Math.PI/180);let p=n.image.width,m=n.image.height;"string"==typeof i&&null!=URL&&"function"==typeof URL.revokeObjectURL&&URL.revokeObjectURL(i);let f,g={x:t.image.viewBox.width,y:t.image.viewBox.height};f=!1===t.image.useLocalScaling?l:Math.min(o.max.x-o.min.x,o.max.y-o.min.y)/Math.max(g.x,g.y),t.image.fitToBounds?r.scale.set(o.max.x-o.min.x,o.max.y-o.min.y,1):t.image.scale&&r.scale.set(t.image.scale.x*f*t.image.viewBox.width,t.image.scale.y*f*t.image.viewBox.height,1),r.translateZ(Ot.overlayHeight*l),n.repeat=new de(t.image.viewBox.width/p,t.image.viewBox.height/m),n.offset=new de(0,(n.image.height-t.image.viewBox.height)/n.image.height),this.publish("texture-loaded",n)}))}static _normalizeColor(t){let e=t.replace(/#/,"");return 3===e.length&&(e=`${e[0]}${e[0]}${e[1]}${e[1]}${e[2]}${e[2]}`),parseInt(e,16)}static _getMaterial(t,e){let i,n=Ot._normalizeColor(t),r=e<1?n+"_"+e:n;if(Ot.materials[r])i=Ot.materials[r];else{let t={color:n,side:e<1?pr:Xs};e<1&&(t.transparent=!0,t.opacity=e),Ot.materials[r]=new yi(t),i=Ot.materials[r]}return i}static _clip(t,e){e/=2;let i=Ot.scale,n=t.map((t=>({X:t.x*i,Y:t.y*i})));for(let t=8;0!==t;t--){let t=new bd.ClipperOffset;t.AddPath(n,bd.JoinType.jtMiter,bd.EndType.etClosedPolygon);let r=new bd.Paths;try{if(t.Execute(r,e*i),r.length)return r[0].map((t=>({x:t.X/i,y:t.Y/i})));e/=2}catch(t){e/=2}}return n}},sr=Ot;h(sr,"Element"),w(sr,"defaultMaterial"),w(sr,"hoverMeshMaterial",new yi({color:"#333"})),w(sr,"materials",{}),w(sr,"defaultExtrudeSettings",{depth:10,bevelEnabled:!1}),w(sr,"scale",100),w(sr,"overlayHeight",.15),w(sr,"imagesLoadingInProgress",new Map);var A1=sr;P();var e6=!1,Ss=class{constructor(){w(this,"textureLoader",new Ci)}loadMapPolygons(t){return Ge(this,null,(function*(){return e6&&ge.log("loading map: ",t.scene.polygons),(yield _r()(t.scene.polygons)).json()}))}loadImage(t){return new Promise(((e,i)=>{e6&&ge.log("loading image: ",t),this.textureLoader.load(t,(t=>{e(t)}),(()=>{}),i)}))}};h(Ss,"DefaultAssetManager");var q1=class{constructor(){w(this,"defaultExtrudeSettings",{amount:10,bevelEnabled:!1}),w(this,"materials",{}),w(this,"scale",100),w(this,"assetManager",new Ss),w(this,"overlayHeight",.15)}setAssetManager(t){this.assetManager=t}load(t,e,i){if("string"==typeof t)return this.assetManager.loadMapPolygons(e).then((t=>null==t||0===t.length?Promise.reject("No polygons found for venue"):this._build(t,e,i))).catch((t=>Promise.reject(t)));try{return this._build(t,e,i)}catch(t){return Promise.reject(t)}}_build(t,e,i){ge.time("JSONSceneLoader");let n=new Set;e.layers.forEach((t=>{!1!==t.visible&&n.add(t.id)}));let r=new cr,s=t.map((t=>{let s=t.layer||"Polygon";return n.has(s)?new A1(t,e,r,this.assetManager,i):null})).filter((t=>t));return ge.timeEnd("JSONSceneLoader"),Promise.resolve({container:r,elements:s,visibleLayers:n})}};h(q1,"JSONSceneLoader");var r6,Td=new q1,ar={VISIBLE_MAP_HIGH:5,VISIBLE_MAP_LOW:4,VISIBLE_MAP_MARKER:3,ASYNC_MAP_HIGH:2,ASYNC_MAP_LOW:1,ASYNC_MAP_MARKER:0,MAP_LOADED:-1},t6=new rt,Wk=1,Xk=!1,n6={Floor:1,Wall:2,"Outer Wall":2.2,Anchors:4,Anchor:4,"Anchor Store":4,Polygon:5,Kiosks:6,"Inner Wall":7,"Non Public":7.5},i6=h((t=>{if(n6[t.layer])return n6[t.layer];let e=t.geometry.scale,i=t.geometry.position;return 100+(e?e.z:1)+(i?i.z:0)}),"calculateScore"),P1=class extends di{constructor(t,e,i,n,r={}){super(),w(this,"_flippableImagedById",{}),w(this,"_started",!1),w(this,"_loaderPromise",null),w(this,"_promiseResolve",null),w(this,"hoverableMeshChildren",[]),w(this,"objectsDictionary",{}),w(this,"north",null),w(this,"mapScale",null),w(this,"object",new rt),w(this,"labels",new Set),w(this,"tooltips",new Set),w(this,"markers",new Set),w(this,"textObjects",[]),w(this,"labelBatchCreator",null),w(this,"imagesToFlip",[]),w(this,"seenByCamera",!1),w(this,"threeJSMarkers",new Map),this.mapView=n,this.mapClass=t,this.polygonMeshesById=e,this._showCount=i,this.loadMethod="json",this.loadAsync=r.async,this._taskScheduler=r.taskScheduler,this.id=this.mapClass.id,this.mapRenderingStrategy=(null==r?void 0:r.mapRenderStrategy)||"MULTI_GEOMETRY",this._highPriorityTasks=new Cr({name:"_highPriorityTasks",onComplete:this._checkIfLoaded.bind(this),priority:!this.visible&&this.loadAsync?ar.ASYNC_MAP_HIGH:ar.VISIBLE_MAP_HIGH,postponeOnAdd:!this.visible&&!this.loadAsync}),this._lowPriorityTasks=new Cr({name:"_lowPriorityTasks",onComplete:this._checkIfLoaded.bind(this),priority:!this.visible&&this.loadAsync?ar.ASYNC_MAP_LOW:ar.VISIBLE_MAP_LOW,postponeOnAdd:!this.visible&&!this.loadAsync}),this._markerTasks=new Cr({name:"_markerTasks",priority:!this.visible&&this.loadAsync?ar.ASYNC_MAP_MARKER:ar.VISIBLE_MAP_MARKER,postponeOnAdd:!this.visible}),this._mapLoadedTasks=new Cr({name:"_mapLoadedTasks",priority:ar.MAP_LOADED,postponeOnAdd:!this.isReady()}),this._visibilityLatch=null,this._objLoadedComplete=!1,this._loaderPromise=new Promise(((t,e)=>{this._promiseResolve=t,r6=e})),this._objLoaded=this._objLoaded.bind(this),this._objLoadedMerged=this._objLoadedMerged.bind(this),this.enableImageFlipping=this.enableImageFlipping.bind(this),this.destroy=this.destroy.bind(this)}_objLoadedMerged(t){return Ge(this,null,(function*(){if(t.elements){this.elements=t.elements;let i=Object.values(this.elements),n=new I(1/0,1/0,0),r=new I(-1/0,-1/0,0);this.boundingBox={min:n,max:r},t=t.container;this.object.children;this.object=t,this.object.userData.type="mappedin_map",this.object.userData.mapId=this.mapClass.id,yield Promise.all(i.map((t=>{let e=t.getBoundingBox();return n.min(e.min),r.max(e.max),t.load()}))).then((t=>t.reduce(((t,e)=>(e&&e.visible&&(t.has(e.material)||t.set(e.material,[]),t.get(e.material).push(e),this._addElementToScene(e)),t)),new Map))).then((t=>{for(let[e,i]of t){let t=b1(i.map((t=>t.geometry)),!1),n=new lt(t,e);this.object.add(n)}this._promiseResolve(this)})).catch((()=>{throw new Error("Error loading map using SINGLE_GEOMETRY strategy",e)})),this.publish("pinsNeedUpdating",!0),this._objLoadedComplete=!0,this._onRootObjectCreated(),this._checkIfLoaded()}return this._promiseResolve(this)}))}_objLoaded(t){if(t.elements){this.elements=t.elements;let e=Object.values(this.elements);this.loadAsync&&e.sort(((t,e)=>(null==t.sortScore&&(t.sortScore=i6(t.polygon)),null==e.sortScore&&(e.sortScore=i6(e.polygon)),e.sortScore-t.sortScore)));let i=new I(1/0,1/0,0),n=new I(-1/0,-1/0,0);for(let t of e){let e=t.getBoundingBox();i.min(e.min),n.max(e.max),this.loadAsync?this._addPendingHighPriorityTask("addPolygon",(()=>this._addElementToScene(t))):this._addElementToScene(t)}this.boundingBox={min:i,max:n},t=t.container}let e=t.children;for(let t=0,i=e.length;t<i;++t){let i=e[t];this.objectsDictionary[i.name]=i,this.polygonMeshesById[i.name]=i}return this.object=t,this.object.userData.type="mappedin_map",this.object.userData.mapId=this.mapClass.id,this.publish("pinsNeedUpdating",!0),this._objLoadedComplete=!0,this._onRootObjectCreated(),this._checkIfLoaded(),this._promiseResolve(this)}loadPolygonNow(t){if(!this.elements)return;let e=this.elements[t];e&&this._addElementToScene(e)}_addElementToScene(t){if(!this.objectsDictionary[t.polygon.id]){if("MULTI_GEOMETRY"===this.mapRenderingStrategy?t.load().then((()=>{t.mesh&&this.hoverableMeshChildren.push(t.mesh)})):t.mesh&&this.hoverableMeshChildren.push(t.mesh),t.imageVisible&&t.on("texture-loaded",(t=>{this.publish("texture-loaded",t)})),t.mesh){let e=t.mesh;this.objectsDictionary[e.name]=e,this.polygonMeshesById[e.name]=e}if(t.imageMesh){let e=t.imageMesh;this.objectsDictionary[e.name]=e,this.polygonMeshesById[e.name]=e}if(t.polygon.image){let e=null!=t.polygon.image.rotation?t.polygon.image.rotation.z:0;this.mapView._imageFlippingEnabled&&this.enableImageFlipping(t.polygon.id,e*(Math.PI/180))}}}load(){if(!this._started){this._started=!0;try{let t=Xk&&this.mapClass._mappedin.polygons.filter((t=>t.map===this.mapClass.id)),e=this.mapClass.scene.polygons;if("json"!==this.loadMethod&&void 0!==this.loadMethod||!e&&!t)throw new Error("Error parsing JSON scene");{let i=e||t;this.loadMethodUsed="JSON - "+(e?"published":"live"),Td.load(i,this.mapClass,this.mapRenderingStrategy).then("MULTI_GEOMETRY"===this.mapRenderingStrategy?this._objLoaded:this._objLoadedMerged)}}catch(t){r6("ERROR: No 3D files for map "+(this.mapClass.name||this.mapClass.shortName||this.mapClass.id||this.mapClass))}}return this._loaderPromise}_dispose(t){let e=t;for(let t=e.children.length-1;t>=0;t--)this._dispose(e.children[t]);e.destroy(),delete this.objectsDictionary[e.name],delete this.polygonMeshesById[e.name]}destroy(){for(let t of this.hoverableMeshChildren)t.destroy();this.hoverableMeshChildren=[],this.removeLabels(),this._removeThreeJSMarkers(),this.disableAllImageFlipping(),this.elements=[],this._dispose(this.object),this.objectsDictionary={},this.polygonMeshesById={}}add(t){t6.add(t),this.load().then((()=>{1===t6.children.filter((e=>e.uuid===t.uuid)).length&&this.object.add(t)}))}getPositionLatLon(t,e){let i=this.mapClass.georeference[0],n=new Be(i.target.x,i.target.y),r=new Be(t,e),s=n.distanceTo(r),a=(n.finalBearingTo(r)+0)*Math.PI/180,o=s*this.getMapScale(this.mapClass),l=a+this.getNorth(this.mapClass),h=Math.sin(l)*o,u=Math.cos(l)*o;return this.mapView.convertTo3DMapPosition({x:i.control.x+h,y:i.control.y-u,map:this.mapClass.id})}getMapScale(){return null==this.mapScale&&(this.mapScale=gf(this.mapClass)),this.mapScale}getNorth(){return null==this.north&&(this.north=Ix(this.mapClass)),this.north}enableImageFlipping(t,e){if(e=e||0,!this._flippableImagedById[t]&&this.object&&Object.keys(this.object).length>0){let i=this.object.getObjectByName(t+"_image");if(i){let n=new LM({image:i,rotation:e});this.imagesToFlip.push(n),this.publish("flippablesNeedUpdating"),this.publish("render"),this._flippableImagedById[t]=!0}}}disableAllImageFlipping(){for(let t=0,e=this.imagesToFlip.length;t<e;t++)this.imagesToFlip[t].reset();this.imagesToFlip=[],this._flippableImagedById={}}get visible(){return null!=this.object.parent}isReady(){return(this.loadAsync?this._highPriorityTasks.isComplete():this.isFullyLoaded())&&this._objLoadedComplete}isFullyLoaded(){return this._highPriorityTasks.isComplete()&&this._lowPriorityTasks.isComplete()}onVisible(){!0!==this._visibilityLatch&&(this.loadAsync?(this._taskScheduler.setTaskPriority(this._highPriorityTasks,ar.VISIBLE_MAP_HIGH),this._taskScheduler.setTaskPriority(this._lowPriorityTasks,ar.VISIBLE_MAP_LOW),this._taskScheduler.resumeTask(this._markerTasks)):(this._taskScheduler.resumeTask(this._highPriorityTasks),this._taskScheduler.resumeTask(this._lowPriorityTasks),this._taskScheduler.resumeTask(this._markerTasks)),this._visibilityLatch=!0)}onInvisible(){!1!==this._visibilityLatch&&(this.loadAsync?(this._taskScheduler.setTaskPriority(this._highPriorityTasks,ar.ASYNC_MAP_HIGH),this._taskScheduler.setTaskPriority(this._lowPriorityTasks,ar.ASYNC_MAP_LOW),this._taskScheduler.postponeTask(this._markerTasks)):(this._taskScheduler.postponeTask(this._highPriorityTasks),this._taskScheduler.postponeTask(this._lowPriorityTasks),this._taskScheduler.postponeTask(this._markerTasks)),this._visibilityLatch=!1)}addPendingMarkerTask(t,e){this._taskScheduler.scheduleTask(new Yn({name:"addMarker",group:this._markerTasks,callback:e,userdata:{marker:t}}))}addPendingLowPriorityTask(t,e){this._taskScheduler.scheduleTask(new Yn({name:t,group:this._lowPriorityTasks,callback:e}))}addPendingMapLoadedTask(t,e){this._taskScheduler.scheduleTask(new Yn({name:t,group:this._mapLoadedTasks,callback:e})),this._checkIfLoaded()}_addPendingHighPriorityTask(t,e){this._taskScheduler.scheduleTask(new Yn({name:t,group:this._highPriorityTasks,callback:e}))}addThreeJSMarker(t){if(!(t.object instanceof rt))throw new Error("threeJSMarker `object` must be an instance of `Object3D`");let e=new C1({mapId:this.id,object:t.object}),i={object:t.object};return t.object.layers.set(hi.ANIMATED),null!=t.position&&t.object.position.copy(t.position),null!=t.rotation&&t.object.rotation.copy(t.rotation),null!=t.scale&&t.object.scale.copy(t.scale),this.threeJSMarkers.set(e,i),this._objLoadedComplete?this.object.add(i.object):this.load().then((()=>{e._deleted||this.object.add(i.object)})),e}removeThreeJSMarker(t){let e=this.threeJSMarkers.get(t);return null!=e&&(t._deleted=!0,this.threeJSMarkers.delete(t),this._objLoadedComplete&&this.object.remove(e.object),t._destroy(),!0)}_removeThreeJSMarkers(){if(this._objLoadedComplete)for(let[t,e]of this.threeJSMarkers.entries())this.object.remove(e.object),t._destroy();this.threeJSMarkers.clear()}removeLabels(){if(this.labels.forEach((t=>{t.disable(),t.removeSelf()})),this.labels=new Set,Array.isArray(this.textObjects)){for(let t=0,e=this.textObjects.length;t<e;++t){let e=this.textObjects[t];e.removeSelf(!0),e=void 0}this.textObjects=[]}}_checkIfLoaded(){this.isReady()&&this._taskScheduler.scheduleTask(new Yn({name:"onMapLoaded",callback:()=>{this._taskScheduler.resumeTask(this._mapLoadedTasks),this.mapLoaded&&typeof this.mapLoaded==typeof Function&&(this.mapLoaded(),this.mapLoaded=null)}}))}_onRootObjectCreated(){for(let t in this.threeJSMarkers.values())this.object.add(t.object)}_popinChildObjects(){this.loadAsync||"SINGLE_GEOMETRY"===this.mapRenderingStrategy||this.object.traverse((t=>{0==t.children.length&&"Mesh"==t.type&&t.material.map&&(t.visible=!1,this._addPendingHighPriorityTask("addPolygon",(()=>{t.visible=!0,this._showCount>=Wk&&(this._showCount=0,this.publish("render:now")),this._showCount++})))}))}};h(P1,"MapObject");var C1=class{constructor({mapId:t,object:e}){this._mapId=t,this._object=e}get object(){return this._object}_destroy(){this._mapId=null,this._object=null}};h(C1,"ThreeJSMarkerHandle");var c3=P1;function s6(t){return t.sort(((t,e)=>e.mapClass.elevation-t.mapClass.elevation))}h(s6,"sortByElevation");var Yk=7.9,Zk=.3,u3=h(((t,e)=>{let{min:i,max:n}=t,{margin:r}=t;r||(r=1);let s=e.boundingBox;s||(s=(new At).setFromObject(e.object),e.boundingBox=s);let a={min:{},max:{},margin:r};a.min.x=Math.min(i.x,s.min.x*r),a.max.x=Math.max(n.x,s.max.x*r),a.min.y=Math.min(i.y,s.min.y*r),a.max.y=Math.max(n.y,s.max.y*r);let o=(a.max.x+a.min.x)/2,l=(a.max.y+a.min.y)/2,h=Math.sqrt(zt(a.max.x-o,2)+zt(a.max.y-l,2));if(a.radius=h,"function"==typeof t.getCenter){let e=new I;a.center=t.getCenter(e)}else a.center=t.center;return a.margin=r,a}),"getNewPanBounds"),I1=class extends di{constructor(t,e,i,n,r={}){super(),w(this,"mapObjects",new Map),w(this,"currentMap"),w(this,"object",new rt),w(this,"_showCount",0),w(this,"_mapObjectsSortedByElevationDirty",!1),w(this,"expanded",!1),this.polygonMeshesById=t,this.mapView=i,this.renderer=e,this.loadOptions=r,this.addMap=this.addMap.bind(this),this.setMap=this.setMap.bind(this),this.removeMap=this.removeMap.bind(this),this.removeAllMaps=this.removeAllMaps.bind(this),this.loadMaps=this.loadMaps.bind(this),this.expandMaps=this.expandMaps.bind(this),this.contractMaps=this.contractMaps.bind(this),this.expandPanBounds=this.expandPanBounds.bind(this),this.loadOptions.taskScheduler=n}expandPanBounds(t){this.mapView.controls.panBounds=u3(t,this.currentMap)}addMap(t,e=(()=>{})){this._mapObjectsSortedByElevationDirty=!0;let i=new c3(t,this.polygonMeshesById,this._showCount,this.mapView,this.loadOptions);return i.on("flippablesNeedUpdating",(t=>this.publish("flippablesNeedUpdating",t))),i.on("render",(t=>this.publish("render",t))),i.on("updateMarkerPosition",(t=>this.publish("updateMarkerPosition",t))),this.mapObjects.set(t.id,i),null==this.currentMap?(this.setMap(t),i.load().then(e)):Promise.resolve().then(e)}addPersistentSetMapCallback(t){this.persistentSetMapCallbacks=Array.isArray(this.persistentSetMapCallbacks)&&this.persistentSetMapCallbacks||[],this.persistentSetMapCallbacks.push(t)}setMap(t,e){this.setMapCallbacks||(this.setMapCallbacks=[]);let i=Jt(t);return this.setMapCallbacks.push(...this.persistentSetMapCallbacks||[]),e&&this.setMapCallbacks.push(e),new Promise(((t,e)=>{if(this.mapObjects.has(i)){if(null!=this.currentMap){let{labels:t,tooltips:e,markers:i}=this.currentMap;[...t,...e,...i].forEach((t=>{t.disable(!1)})),this.object.remove(this.currentMap.object)}this.currentMap=this.mapObjects.get(i),this.currentMap.addPendingMapLoadedTask("resolveSetMap",(()=>{t(),this.setMapCallbacks.forEach((t=>t())),this.setMapCallbacks=[]}));let e=this.currentMap.mapClass.id,n=this.loadOptions&&this.loadOptions.zoomOverrides&&this.loadOptions.zoomOverrides.zoomMultiplier||Yk;this.mapView.controls.zoomFactor=this.mapView.getMapScale()/n,this.currentMap.load().then((t=>{var e;if(this.currentMap&&this.currentMap.mapClass.id!==t.mapClass.id)return;t.seenByCamera||(t.seenByCamera=!0,t._popinChildObjects());let i=u3(this.mapView.controls.panBounds,this.currentMap);this.mapView.controls.panBounds=i;let n=this.mapView.getZoomLevelForCurrentMap();this.mapView.controls.expandZoomLimits(n),this.object.add(this.currentMap.object),this.mapView.imageFlippingEnabled&&(null==(e=this.mapView.imageFlippingCache[this.currentMap.id])||e.forEach((([e,i])=>{t.enableImageFlipping(e,i)}))),this.currentMap.textObjects.forEach((t=>{"function"==typeof t.show&&t.show()}));let{labels:r,tooltips:s,markers:a}=this.currentMap;[...r,...s,...a].forEach((t=>{t.enable(!1)})),this.publish("flippablesNeedUpdating",!0),this.publish("render"),this.publish("set-map"),"function"==typeof this.mapView.onMapChanged&&this.mapView.onMapChanged(t.mapClass.id)})).catch((t=>{ge.error("Error loading map ",e,t)}))}else{let t={error:"Map does not exist"};ge.error(t.error),this.setMapCallbacks.forEach((e=>e(t))),this.setMapCallbacks=[],e(t)}}))}get mapObjectsSortedByElevation(){return!this._mapObjectsSortedByElevationDirty&&Array.isArray(this._mapObjectsSortedByElevation)||(this._mapObjectsSortedByElevation=Array.from(this.mapObjects.values()).sort(((t,e)=>e.mapClass.elevation-t.mapClass.elevation)),this._mapObjectsSortedByElevationDirty=!1),this._mapObjectsSortedByElevation}loadMaps(t,e,i=(()=>{}),n=(()=>{}),r=(()=>{})){let s=Jt(e);for(let e=0;e<t.length;e++){let a=t[e],o=new c3(a,this.polygonMeshesById,this._showCount,this.mapView,this.loadOptions);o.on("flippablesNeedUpdating",(t=>this.publish("flippablesNeedUpdating",t))),o.on("render",(t=>this.publish("render",t))),o.on("updateMarkerPosition",(t=>this.publish("updateMarkerPosition",t))),o.on("texture-loaded",(t=>this.publish("texture-loaded",t))),this.mapObjects.set(a.id,o),a.id===s&&(o.load().then((()=>{this.mapView.resetCamera(),n()})).catch(r),this.setMap(a,i))}}removeMap(t){this._mapObjectsSortedByElevationDirty=!0;let e=Jt(t);if(this.mapObjects.has(e)){let t=this.mapObjects.get(e);this.currentMap===t&&(this.currentMap=null),t.off("flippablesNeedUpdating"),t.off("render"),t.destroy(),this.mapObjects.delete(e)}this.renderer.renderLists.dispose()}removeAllMaps(){this._mapObjectsSortedByElevationDirty=!0;for(let t of this.mapObjects.values())t.destroy(),t=null;this.mapObjects.clear()}get visibleMaps(){return this.mapObjectsSortedByElevation.filter((t=>t.visible))}getCompoundBoundingBoxPoints(t){this.mapView.controls.orbit.updateMatrixWorld();let e=this.mapView.controls.camera.matrixWorld,i=this.mapView.controls.camera.matrixWorldInverse,n=new I(1/0,1/0,1/0),r=new I(-1/0,-1/0,-1/0);t.forEach((t=>{t.applyMatrix4(i),mf(Xa(t)).forEach((t=>{n.min(t),r.max(t)})),t.applyMatrix4(e)}));let s=mf({min:n,max:r});return s.forEach((t=>t.applyMatrix4(e))),s}expandMaps(t,e){let i=be({focus:!1,debug:!1,rotation:0,duration:600},e);if(this.expanded)return Promise.resolve({maps:this.renderedMaps,projections:this.projections});if(!Array.isArray(t))return Promise.reject("Maps to expand are not an array");let n,r=t.map((t=>{let i="string"!=typeof t&&null!=t.id?t.id:t;if("string"!=typeof t&&!0===t.connection&&Array.isArray(t.maps)){let i=t.maps.map((t=>{let e="string"!=typeof t?t.id:t;return this.mapObjects.has(e)||(ge.error(`Expand maps: > Map ${e} does not exist`),n=`Expand maps: > Map ${e} does not exist`),this.mapObjects.get(e)}));i=s6(i);let r=new xn(1,1,1);!0===e.debug&&(r=new xn(500,500,10));let s=new Hn({color:11184810});return{connection:!0,object:new lt(r,s),connectionNodes:t.connectionNodes,mapClass:{elevation:i[0].mapClass.elevation},maps:i}}if(this.mapObjects.has(i))return this.mapObjects.get(i);ge.error(`Expand maps: > Map ${i} does not exist`),n=`Expand maps: Map ${i} does not exist`}));if(null!=n)return Promise.reject(n);r=s6(r);let s=r.map((t=>t.connection&&Array.isArray(t.maps)?Promise.all(t.maps.map((t=>t.load()))):t.load()));return Promise.all(s).then((()=>(this.expanded=!0,this.multiFloorView=new xM(this.mapView,this.object,r,i),this.multiFloorView.focusOnMaps(i)))).then((()=>(this.renderedMaps=r,this.projections=this.multiFloorView.projections,Promise.resolve({maps:r,projections:this.projections}))))}contractMaps(t={focus:!1,debug:!1,duration:300}){if(!this.expanded)return Promise.resolve();this.expanded=!1,this.multiFloorView.destroy(),this.object.add(this.currentMap.object),this.publish("render");let e=u3(this.mapView.controls.panBounds,this);this.mapView.controls.panBounds=e;let i=this.mapView.getZoomLevelForObject(this.object);return this.mapView.controls.expandZoomLimits(i),new Promise((e=>{t.focus?this.mapView.focusOn({boundingBox:Xa(this.object),padding:this.mapView.cachedPadding,debug:t.debug,duration:t.duration,focusZoomFactor:1,callback:e,tilt:Zk}):e()}))}mapsFullyLoaded(t=(()=>{})){let e=[...this.mapObjects.values()].map((t=>t.connection&&Array.isArray(t.maps)?Promise.all(t.maps.map((t=>t._loaderPromise))):t._loaderPromise));return Promise.all(e).then(t)}scrollMapsUp(){return this.multiFloorView?this.multiFloorView.scrollMapsUp():(ge.warn("scrollMapsUp() not supported unless multifloor is active"),Promise.reject())}scrollMapsDown(){return this.multiFloorView?this.multiFloorView.scrollMapsDown():(ge.warn("scrollMapsDown() not supported unless multifloor is active"),Promise.reject())}tiltMaps(t){this.multiFloorView&&(this.multiFloorView.mapTiltDegrees=t)}resize(){null!=this.multiFloorView&&this.multiFloorView.resize()}destroy(){this.removeAllMaps(),this.polygonMeshesById={},this.object.destroy(),this._subscribers={}}};h(I1,"MapManager");var a6=I1;P();var qo=20,Jk=14,o6=8,O1=72,Ed=16,l6=12,$k=52,Kk=4,L1=2,h3=8,d3=128,f3=320,un=8,c6=2,Qk=2/(Math.sqrt(5)+1)*360/6,eD=60,tD=5,Cc=class{constructor(){this._element=document.createElement("div"),this._titleElement=document.createElement("select"),this._minimizeElement=document.createElement("button"),this._performancePanelElement=document.createElement("div"),this._performanceEntries=new Map,this._sortedPerformanceEntryNames=[];let t=document.createElement("option");t.value="Performance",t.innerHTML="Performance",t.selected="selected",this._titleElement.appendChild(t),this._titleElement.addEventListener("change",this._onCategoryChanged.bind(this)),this._overviewGraph=new Sd({width:f3,height:d3,seriesList:[]}),this._controlPanels=new Map,this._sortedControlPanelNames=[],this._minimized=!1,this._element.appendChild(this._titleElement),this._element.appendChild(this._minimizeElement),this._element.appendChild(this._performancePanelElement),this._performancePanelElement.appendChild(this._overviewGraph.element),this._layout(),this._minimizeElement.addEventListener("click",this._onMinimizeClicked.bind(this)),null==window.MappedinDebug&&(window.MappedinDebug={}),window.MappedinDebug.DebugUI=this}destroy(){for(let t of this._performanceEntries.values())t.destroy();for(let t of this._controlPanels.values())t.destroy();this._controlPanels=null,this._performanceEntries=null,this._element=null,this._titleElement=null,this._minimizeElement=null,this._performancePanelElement=null,this._overviewGraph=null,Object.setPrototypeOf(this,null)}get element(){return this._element}reportFramePerformance(t){let e=!1;for(let i in t){if(!this._performanceEntries.has(i)){let t=new R1({name:i});this._performanceEntries.set(i,t),this._performancePanelElement.appendChild(t.element),this._sortedPerformanceEntryNames.push(i),this._sortedPerformanceEntryNames.sort(),e=!0}this._performanceEntries.get(i).report(t[i])}for(let e of this._performanceEntries.keys())null==t[e]&&this._performanceEntries.get(e).report(0);e&&this._updateLayout();for(let t of this._performanceEntries.values())if(t.series.changed()){this._overviewGraph.redraw();break}}addDebugControls(t){for(let e in t){for(let i of t[e]){let{name:t,description:n,control:r}=i;this._addDebugControl(e,t,n,r)}this._controlPanels.get(e)._updateLayout()}this._updateLayout()}addDebugControl(t,e,i,n){this._addDebugControl(t,e,i,n),this._updateLayout(),this._controlPanels.get(t)._updateLayout()}removeDebugControls(t){for(let e in t){for(let i of t[e])this._removeDebugControl(e,i);this._controlPanels.get(e)._updateLayout()}this._updateLayout()}removeDebugControl(t,e){this._removeDebugControl(t,e),this._updateLayout(),this._controlPanels.get(t)._updateLayout()}_addDebugControl(t,e,i,n){if(!this._controlPanels.has(t)){let e=new pd({name:t});this._controlPanels.set(t,e),this._element.appendChild(e.element);let i=document.createElement("option");i.value=t,i.innerHTML=t;let n=this._titleElement.children,r=1;for(;r<n.length&&!(n[r].value>t);++r);r===n.length?this._titleElement.appendChild(i):this._titleElement.insertBefore(i,n[r]),Object.assign(e.element.style,{display:"hidden",position:"absolute",left:un+"px",right:un+"px",top:un+qo+un+"px"})}this._controlPanels.get(t).addControl(e,i,n)}_removeDebugControl(t,e){this._controlPanels.get(t).removeControl(e)}_layout(){Object.assign(this._element.style,{display:"block",position:"absolute",right:o6+"px",top:o6+"px",width:f3+2*un+"px","font-family":"sans-serif",background:"rgba(255, 255, 255, 0.9)",outline:"1px solid white"}),Object.assign(this._titleElement.style,{display:"block",position:"absolute",left:un+"px",top:un+"px","font-size":Jk+"px"}),Object.assign(this._minimizeElement.style,{display:"block",position:"absolute",right:un+"px",top:un+"px",width:1.5*qo+"px",height:qo+"px"}),Object.assign(this._performancePanelElement.style,{display:"block",position:"absolute",left:un+"px",right:un+"px",top:un+qo+un+"px"}),Object.assign(this._overviewGraph.element.style,{display:"block",position:"absolute",left:"0px",right:"0px",height:d3+"px",border:"1px solid white",outline:"1px solid #bbb"}),this._updateLayout()}_updateLayout(){let t=null;for(let e of this._titleElement.children){e.selected&&(t=e);let i=e.selected&&!this._minimized;"Performance"===e.value?this._performancePanelElement.style.display=i?"block":"none":this._controlPanels.get(e.value).element.style.display=i?"block":"none"}this._minimized?this._element.style.height=un+qo+un+"px":"Performance"===t.value?this._element.style.height=un+qo+(O1+h3)*this._performanceEntries.size+d3+un+2*un+"px":this._element.style.height=un+qo+this._controlPanels.get(t.value).height+un+"px";for(let t=0;t<this._sortedPerformanceEntryNames.length;++t){let e=this._sortedPerformanceEntryNames[t],i=this._performanceEntries.get(e);i.setHue(t*Qk),i.element.style.top=(O1+h3)*t+"px"}this._overviewGraph.setSeriesList(this._sortedPerformanceEntryNames.map((t=>this._performanceEntries.get(t).series))),this._overviewGraph.element.style.top=(O1+h3)*this._performanceEntries.size+un+"px",this._minimizeElement.innerHTML=this._minimized?"⇕":"⇗"}_onMinimizeClicked(){this._minimized=!this._minimized,this._updateLayout()}_onCategoryChanged(){this._updateLayout()}};h(Cc,"DebugUI");var R1=class{constructor({name:t,hue:e}){this._name=t,this.series=new N1({hue:e}),this._graph=new Sd({width:f3,height:$k,seriesList:[this.series]}),this._element=document.createElement("div"),this._nameElement=document.createElement("div"),this._hueElement=document.createElement("div"),this._lastFrameTimeElement=document.createElement("div"),this._element.appendChild(this._graph.element),this._element.appendChild(this._nameElement),this._element.appendChild(this._hueElement),this._element.appendChild(this._lastFrameTimeElement),this._layout()}destroy(){this._element.removeChild(this._graph.element),this._element.removeChild(this._nameElement),this._element.removeChild(this._hueElement),this._element.removeChild(this._lastFrameTimeElement),this._graph.destroy(),this._element=null,this._nameElement=null,this._hueElement=null,this._lastFrameTimeElement=null}_layout(){Object.assign(this._element.style,{display:"block",position:"absolute",left:"0px",right:"0px",height:O1+"px"}),Object.assign(this._hueElement.style,{display:"block",position:"absolute",left:"-1px",top:L1-1+"px",width:Ed-2*L1+"px",height:Ed-2*L1+"px","background-color":Ad(this.series.hue,.3,.9),border:"1px solid "+Ad(this.series.hue,.9,.9),"border-radius":"2px"}),Object.assign(this._nameElement.style,{display:"block",position:"absolute",left:Ed-L1+Kk+"px",right:"0px",top:"0px",height:Ed+"px","font-size":l6+"px","text-align":"left","vertical-align":"middle"}),Object.assign(this._lastFrameTimeElement.style,{display:"block",position:"absolute",left:"0px",right:"0px",top:"0px",height:Ed+"px","font-size":l6+"px","text-align":"right","vertical-align":"middle"}),Object.assign(this._graph.element.style,{display:"block",position:"absolute",left:"0px",right:"0px",bottom:"0px","text-align":"right",border:"1px solid white",outline:"1px solid "+Ad(this.series.hue,.2,1)}),this._nameElement.innerHTML=this._name}get element(){return this._element}report(t){if(this.series.report(t),this.series.changed()){if(this.series.length>=1){let t=0;for(let e=0;e<this.series.length;++e)t+=this.series.at(e);let e=this.series.maximumValue();this._lastFrameTimeElement.innerHTML="∫ "+(t/this.series.length).toFixed(c6)+"ms, ⤒ "+e.toFixed(c6)+" ms"}this._graph.redraw()}}setHue(t){this.series.hue=t,this._graph.setSeriesList([this.series]),this._layout()}};h(R1,"PerformanceEntry");var Sd=class{constructor({seriesList:t,width:e,height:i}){this._gradients=new Map,this._canvas=document.createElement("canvas"),this._layout(e,i),this._context=this._canvas.getContext("2d"),this.setSeriesList(t)}destroy(){this._gradients=null,this._canvas=null,this._context=null,Object.setPrototypeOf(this,null)}_layout(t,e){Object.assign(this._canvas.style,{display:"block",position:"absolute",left:"0px",right:"0px",width:t+"px",height:e+"px"}),this._canvas.width=t*window.devicePixelRatio,this._canvas.height=e*window.devicePixelRatio}get element(){return this._canvas}redraw(){this._context.clearRect(0,0,this._canvas.width,this._canvas.height);let t=0;for(let e of this._seriesList)t=Math.max(t,e.maximumValue());for(let e of this._seriesList)if(e.length>=1){this._context.beginPath();let i=1-(e.length-1)/(e.windowSize-1),n=1-e.at(0)/t;this._context.moveTo(i*this._canvas.width,n*this._canvas.height);for(let i=1;i<e.length;++i){let n=1-(e.length-1-i)/(e.windowSize-1),r=1-e.at(i)/t;this._context.lineTo(n*this._canvas.width,r*this._canvas.height)}this._context.strokeStyle=this._gradients.get(e),this._context.lineWidth=window.devicePixelRatio,this._context.stroke()}}setSeriesList(t){this._seriesList=t;for(let t of this._seriesList){let e=this._context.createLinearGradient(0,0,0,this._canvas.height);e.addColorStop(0,Ad(t.hue,1,1)),e.addColorStop(1,Ad(t.hue,.5,.5)),this._gradients.set(t,e)}}};h(Sd,"LineGraph");var N1=class{constructor({windowSize:t=eD,totalAccumulationCount:e=tD,hue:i=0}){this.windowSize=t,this.hue=i,this._totalAccumulationCount=e,this._ringBuffer=new Array(this.windowSize).fill(0),this._ringBufferLength=0,this._ringBufferPointer=0,this._accumulatorValue=0,this._accumulatorCount=0,this._changed=!0}destroy(){}report(t){this._accumulatorValue+=t,++this._accumulatorCount,this._changed=!1,this._accumulatorCount===this._totalAccumulationCount&&(this._push(this._accumulatorValue/this._totalAccumulationCount),this._accumulatorValue=0,this._accumulatorCount=0,this._changed=!0)}at(t){if(!Number.isFinite(t)||t>=this._ringBufferLength||t<0)throw new Error("invalid index: "+t+" (length: "+this.length+")");let e=(this._ringBufferPointer+t-this._ringBufferLength+this.windowSize)%this.windowSize;return this._ringBuffer[e]}_push(t){this._ringBuffer[this._ringBufferPointer]=t,++this._ringBufferLength,this._ringBufferLength>this.windowSize&&(this._ringBufferLength=this.windowSize),++this._ringBufferPointer,this._ringBufferPointer>=this.windowSize&&(this._ringBufferPointer=0)}maximumValue(){let t=0;for(let e=0;e<this._ringBufferLength;++e)t=Math.max(t,this.at(e));return t}changed(){return this._changed}get length(){return this._ringBufferLength}};function Ad(t,e,i,n){let r=t%360/60,s=0|r,a=r-s,o=i*(1-e),l=i*(1-e*a),h=i*(1-e*(1-a)),u=0,c=0,d=0;switch(s){case 0:u=i,c=h,d=o;break;case 1:u=l,c=i,d=o;break;case 2:u=o,c=i,d=h;break;case 3:u=o,c=l,d=i;break;case 4:u=h,c=o,d=i;break;case 5:u=i,c=o,d=l}return"#"+p3(u)+p3(c)+p3(d)}function p3(t){let e=(255*t|0).toString(16);return 1===e.length&&(e="0"+e),e}h(N1,"TimeSeries"),h(Ad,"hsv2rgb"),h(p3,"toHex"),P();var nD=!1,Ic=class{constructor(t){w(this,"textureLoader",new Ci),w(this,"data"),this.data=t}loadMapPolygons(){return Ge(this,null,(function*(){}))}loadImage(t){let e=this.data.get(t.split(/[\/\.]/)[1]);return new Promise(((i,n)=>{nD&&ge.log("loading image: ",t);let r=new Blob([e]),s=URL.createObjectURL(r);this.textureLoader.load(s,(t=>{i(t)}),(()=>{}),n)}))}};h(Ic,"BinaryAssetManager");var h6={},d6={},Fr={BEFORE_CAMERA:5,CAMERA:4,AFTER_CAMERA:3,RENDER:2,AFTER_RENDER:1,AFTER_ALL_UPDATES:0};d6.CameraControls=AM,h6.CompositeVertexShader=y1,h6.CompositeFragmentShader=v1;var Po,k1=class extends er{constructor(t,e,i={},n){var r,s,a,o;super(),H(this,Po,void 0),w(this,"imageFlippingCache",{}),w(this,"imageFlippingEnabled",!1),this.MapView=n,this.type="MapView3D",this.container=t,this.venue=e,window.MappedinDebug||(window.MappedinDebug={}),"test"===j.env.NODE_ENV&&(window.MappedinDebug.mapViewCoreInstance=this);let l=!1,u=i.backgroundColor||"#ffffff",c=i.backgroundAlpha||1;this.colors={defaultHover2D:"#cccccc",select:"#4ca1fc",text:"#000000",path:"#ff834c",pathPulse:"#ffffff",textSelect:"#ffffff"};let d="boolean"==typeof i.antialias?i.antialias:window.devicePixelRatio<=1;i.disableZoomOnMapSizeChange&&(l=!0),this.loadOptions=be({mapRenderStrategy:"SINGLE_GEOMETRY"},i.loadOptions),!0===this.loadOptions.loadAsync&&"SINGLE_GEOMETRY"===this.loadOptions.mapRenderStrategy&&(ge.warn("Async loading does not work with the single geometry map render strategy. Reverting to non-async loading."),this.loadOptions.loadAsync=!1),this.smartCollisionEngine=new q5(n,this);let p=new eo({performance:!0}),m=new so,f=new Ec({multiBufferRendering:"boolean"==typeof i.multiBufferRendering&&i.multiBufferRendering,alpha:!0,antialias:d,onWebGLContextCreationError:i.onWebGLContextCreationError,onWebGLContextLost:i.onWebGLContextLost,onWebGLContextRestored:()=>{i.onWebGLContextRestored&&i.onWebGLContextRestored(),m.onWebGLContextRestored(),this.tryRendering()},onWebGLRendererError:i.onWebGLRendererError,backgroundColor:u,backgroundAlpha:c});this.renderer=f;this.highlightedPolygons={},this.scene=new Jr,this.resolutionScale=window.devicePixelRatio;let g=new vn(40,this.container.clientWidth/this.container.clientHeight,50,1e5);this.cameraObject=g;let v=new rt;v.add(g);let y=new rt;y.add(v),this.scene.add(y),g.updateProjectionMatrix(),g.updateMatrixWorld(!0);let x=h((()=>{f.render(Nt.ALL,null,this.scene,g)}),"renderFull");this.focusZoomFactor=1.1;let b=!1;function M(){b=!0,S=!0}function E(){b=!1,S=!0}h(M,"cameraRotationStarted"),h(E,"cameraRotationStopped");let T=[];var S=!0;let q={};this.polygonMeshesById=q;this.textLabelsByPolygonId={},this.labelOrientationDelay=650;let P={};this.interactivePolygons=P;let A=new a6(q,f.implementation.renderer,this,p,this.loadOptions);this.mapManager=A,this.scene.add(A.object);let C=A.mapObjects;this.mapObjects=C,Object.defineProperty(this,"currentMap",{get:()=>A.currentMap?A.currentMap.id:A.mapObjects.size>0?Array.from(C)[0].id:(ge.error("No maps loaded."),null)});let L=h((function(t){return mr(t,e.polygons)}),"getPolygon");this.setMap=A.setMap,this.expandMaps=A.expandMaps.bind(A),this.tiltMaps=A.tiltMaps.bind(A),this.contractMaps=A.contractMaps.bind(A),Object.defineProperty(this,"mapsExpanded",{get:()=>A.expanded}),this.showEntireMap=t=>{t||(t={});let e,i=C.get(this.currentMap);return t.interactiveOnly?e=Object.keys(P):(e=i.hoverableMeshChildren.map((function(t){return t.name})),!e.length&&i.elements&&(e=Object.keys(i.elements))),t.polygons=e,this.focusOn(t)},this.resetPanBounds=()=>{let t=C.get(this.currentMap);this.controls.panBounds.min=this.controls.getPosition(),this.controls.panBounds.max=this.controls.getPosition();let e=t.boundingBox;e||(e=(new At).setFromObject(t.object),C.get(this.currentMap).boundingBox=e),A.expandPanBounds(e)},this.addMap=A.addMap,this.removeMap=A.removeMap,this.removeAllMaps=A.removeAllMaps;let R=f.domElement();this.currentInteractionEvent="";let N,O=h((()=>{this.shouldMeasureCanvas=!0,this.smartCollisionEngine.resize(this.container),A.resize(),this.canvasWidth=R.clientWidth,this.canvasHeight=R.clientHeight,this.tryRendering()}),"onWindowResize");this.focusOnPolygon=(t,e,i,n)=>this.focusOn({polygons:[t],changeZoom:e,duration:i,curve:n}),this.focusOnPath=(t,e,i,n,r)=>this.focusOn({nodes:t,polygons:e,changeZoom:i,duration:n,curve:r}),this.focusOn=t=>{if(null==t)return;let i,n=void 0===t.changeZoom||t.changeZoom;i=void 0!==t.duration?t.duration:"true"===j.env.TESTING?0:200;let r=void 0!==t.focusZoomFactor?t.focusZoomFactor:this.focusZoomFactor,s=t.curve,a=void 0!==t.horizontalFovFactor?t.horizontalFovFactor:1,o=void 0!==t.verticalFovFactor?t.verticalFovFactor:1,l=t.callback,h=void 0!==t.minZoom?t.minZoom:this.controls.minZoom,u=t.updateZoomLimits||!0,c=!1,d=[];if(t.nodes){let i=t.nodes;for(var p=0,m=i.length;p<m;p++){let t=i[p];"string"==typeof t&&(t=mr(t,e.nodes)),(null==t.map||t.map.id==this.currentMap)&&(d.push(this.convertTo3DMapPosition(t)),c=!0)}}if(t.debug){N&&N.destroy(),N=new rt,this.scene.add(N);var f=new dr(100,100,100),g=new Hn({color:65280})}if(t.points&&(t.points.forEach((t=>d.push(t))),c=!0),t.boundingBox){let{min:e,max:i}=t.boundingBox;[new I(e.x,e.y,e.z),new I(e.x,i.y,e.z),new I(i.x,e.y,e.z),new I(i.x,i.y,e.z),new I(e.x,e.y,i.z),new I(e.x,i.y,i.z),new I(i.x,e.y,i.z),new I(i.x,i.y,i.z)].forEach((e=>{if(t.debug){let t=new lt(f,g);t.position.set(e.x,e.y,e.z),N.add(t)}d.push(e)})),c=!0}if(t.polygons){let e=t.polygons,i=C.get(this.currentMap),n=0;for(p=0,m=e.length;p<m;p++){let t=Jt(e[p]),r=i.objectsDictionary[t];if(r)if(n++,r.geometry.attributes){let t=r.geometry.attributes.position;for(let e=0,i=t.count;e<i;e++){let i=new I;i.set(t.getX(e),t.getY(e),t.getZ(e)),d.push(i)}c=!0}else{for(let t=0,e=r.geometry.vertices.length;t<e;t++)d.push(r.geometry.vertices[t].clone());c=!0}else{let e=i.elements;if(e){let i=e[t];if(i){n++;let t=i.getBoundingBox();d.push(new I(t.min.x,t.min.y,0)),d.push(new I(t.min.x,t.max.y,0)),d.push(new I(t.max.x,t.min.y,0)),d.push(new I(t.max.x,t.max.y,0)),c=!0}}}}1===n&&(r=this.loadOptions&&this.loadOptions.zoomOverrides&&this.loadOptions.zoomOverrides.focusZoomFactorPolygon||r)}if(c){this.tryRendering();let e=t.padding||this.cachedPadding||{top:0,bottom:0,left:0,right:0},c=D(d,a,o,e,!0),p=this.getZoomLevelForCurrentMap(),m=c.zoom;u&&(this.controls.restrictZoomLimits(p),this.controls.expandZoomLimits(m*r));let f={position:c.position,tilt:t.tilt,rotation:t.rotation};return n&&(f.zoom=Math.max(c.zoom*r,h)),this.publish("focuson-begin"),this.controls.animateCamera(f,i,s,l)}return this.publish("focuson-begin"),this.controls.animateCamera({},i,s,l)},this.CAMERA_FRAME_PADDING_SIDES=["top","bottom","left","right"],this.CAMERA_FRAME_PADDING_UNITS={PIXELS:"pixels",PORTIONS:"portions"};var D=h(((t,e,i,n,r)=>{(!i||isNaN(i))&&(i=1),(!e||isNaN(e))&&(e=1);let s={position:this.controls.getPosition(),zoom:this.controls.minZoom};if(null==t||0==t.length)return s;n||(n={top:0,bottom:0,left:0,right:0,type:this.CAMERA_FRAME_PADDING_UNITS.PIXELS});for(let t of this.CAMERA_FRAME_PADDING_SIDES)"number"!=typeof n[t]&&(n[t]=0);if(n.type||(n.type=this.CAMERA_FRAME_PADDING_UNITS.PIXELS),n.type===this.CAMERA_FRAME_PADDING_UNITS.PORTIONS&&(n={top:n.top*ft,bottom:n.bottom*ft,left:n.left*mt,right:n.right*mt,type:this.CAMERA_FRAME_PADDING_UNITS.PIXELS}),n.left+n.right>=mt||n.top+n.bottom>=ft)return s;y.updateMatrixWorld();let a=g.matrixWorldInverse,o=g.fov*(Math.PI/180)/2,l=o*i,h=Math.atan(Math.tan(o)*(mt/ft))*e;if(1==t.length){let e=t[0].clone();e.applyMatrix4(a);let i=this.controls.minZoom*Math.tan(h)*2,r=this.controls.minZoom*Math.tan(l)*2,o=(n.left-n.right)/2/mt,u=(n.top-n.bottom)/2/ft,c=new I(-o*i,u*r,0);return e.add(c),e.applyMatrix4(g.matrixWorld),s.position.x=e.x,s.position.y=e.y,s}let u,c=new I(1/0,1/0,1/0),d=new I(-1/0,-1/0,-1/0);for(let e=0,i=t.length;e<i;e++)u=t[e],u.applyMatrix4(a),c.min(u),d.max(u);let p=d.x-c.x,m=d.y-c.y,f=mt-n.left-n.right,v=ft-n.top-n.bottom,_=(d.x+c.x)/2,x=(d.y+c.y)/2,b=p/f,w=m/v,M=this.controls.getZoomScaledMin(),E=this.controls.getZoomScaledMax(),T=M*Math.tan(h)*2,S=E*Math.tan(h)*2,q=T/mt,P=S/mt,A=Math.max(b,w);r||(A=Math.min(Math.max(A,q),P));let C=f*A,L=v*A,R={x:_-C/2-n.left*A,y:x-L/2-n.bottom*A},N={x:_+C/2+n.right*A,y:x+L/2+n.top*A},O=(R.x+N.x)/2,D=(R.y+N.y)/2,B=Math.abs(O-R.x),k=Math.abs(D-R.y),F=B/Math.tan(h),z=k/Math.tan(l),U=new I;U.set(O,D,d.z+Math.max(F,z)),U.applyMatrix4(g.matrixWorld);let H=new I;H.set(O,D,d.z),H.applyMatrix4(g.matrixWorld),H.sub(U);let V=U.z/H.z;return s.position.x=U.x-H.x*V,s.position.y=U.y-H.y*V,H.set(s.position.x,s.position.y,0),U.sub(H),s.zoom=U.length(),s}),"getCameraFrameForPoints");this.setPadding=t=>{this.cachedPadding=t||{top:0,bottom:0,left:0,right:0}},this.getZoomLevelForPolygon=t=>{let e=Jt(t),i=[],n=C.get(this.currentMap).objectsDictionary[e];if(n){let t=n.geometry.attributes?n.geometry.attributes.position:[];for(let e=0,n=t.count;e<n;e++){let n=new I;n.set(t.getX(e),t.getY(e),t.getZ(e)),i.push(n)}return D(i,1,1,this.cachedPadding,!0).zoom}return this.controls.getZoom()},this.getZoomLevelForCurrentMap=()=>{let t=C.get(this.currentMap).object;if(t){let e=C.get(this.currentMap).boundingBox;e||(e=(new At).setFromObject(t),C.get(this.currentMap).boundingBox=e);let i=[e.min.clone(),e.max.clone()];return D(i,1,1,this.cachedPadding,!0).zoom}return this.controls.getZoom()},this.getZoomLevelForObject=t=>{let e;e||(e=(new At).setFromObject(t));let i=[e.min.clone(),e.max.clone()];return D(i,1,1,0,!0).zoom},this.resetCamera=(t=!1)=>{let e={x:0,y:0};if(!t){let t=C.get(this.currentMap).boundingBox;t&&(e={x:(t.max.x-t.min.x)/2+t.min.x,y:(t.max.y-t.min.y)/2+t.min.y})}let i=this.getZoomLevelForCurrentMap();this.controls.expandZoomLimits(i);this.controls.setMulti(e,i,0,.6)},this.getPositionLatLon=(t,e,i)=>{i=null==i?this.currentMap:Jt(i);let n=C.get(i);if(null==n)throw new Error("Invalid map: "+i);return n.getPositionLatLon(t,e)};let B=h(((t,e)=>{t.style.transform="rotate("+(e+t._mRotationOffset)+"rad)"}),"rotateNode");this.lockNorth=(t,e=0)=>{T.push(t),t._mRotationOffset=e,B(t,this.getNorth()+this.controls.getRotation())},this.unlockNorth=t=>{delete t._mRotationOffset,T=T.filter((function(e){return e!=t}))};let k=h((function(){}),"cameraMovementStart"),F=h((function(){}),"cameraMovementEnd");function z(t){return Math.trunc(100*t)/100}this.convertTo3DMapPosition=t=>{var e;let i=null==(e=t.map)?void 0:e.id,n=C.get(i||this.currentMap).mapClass;return new I(t.x-n.width/2,-t.y+n.height/2,1)},this.convert3DMapPositionToCoordinate=(t,e)=>{e||(e=C.get(this.currentMap).mapClass);let i=t.x+e.width/2,n=-t.y+e.height/2;return e.createCoordinateByXY(i,n)},this.getPositionPolygon=t=>{let e=Jt(t),i=t;null==t.map&&(i=L(e));let n=C.get(i.map.id).objectsDictionary[e];if(n){n.geometry.computeBoundingBox();let t=n.geometry.boundingBox;return new I(t.min.x+(t.max.x-t.min.x)/2,t.min.y+(t.max.y-t.min.y)/2,t.max.z)}return null},this.getPositionNode=t=>{let i=t;return"string"==typeof i&&(i=mr(t,e.nodes)),this.convertTo3DMapPosition(i)},h(z,"round100"),this.hideAllLabels=function(){A.mapObjectsSortedByElevation.forEach((t=>{t.textObjects.forEach((t=>t.hide())),t.colliders.forEach((t=>{t.disable()}))}))};let U=h(((t,e)=>{g.updateProjectionMatrix(),g.updateMatrixWorld(!0);let i=C.get(e);if(null==i)return[0,0];let n=t.clone().applyMatrix4(i.object.matrix).project(g),r=(n.x+1)/2*mt-0,s=(1-n.y)/2*ft-0;return{x:z(r),y:z(s)}}),"project");this.setBackgroundColor=(t,e)=>{f.setBackgroundColor(t,e)};var V=new de;this.resolution=V;let W=h(((t,e)=>{f.setBufferSize(t,e),g.aspect=t/e,g.updateProjectionMatrix(),g.updateMatrixWorld(!0),V.x=t,V.y=e}),"setBufferSize");this.setSize=(t,e)=>{mt=R.clientWidth,ft=R.clientHeight;let i=Math.floor(t*this.resolutionScale),n=Math.floor(e*this.resolutionScale);if(!l&&R.width*R.height*i*n!=0){let t=R.width!==i?R.width/i:R.height/n;this.controls.setZoom(t*this.controls.getZoom())}W(i,n)};let X=h((()=>{let t=mt=R.clientWidth,e=ft=R.clientHeight,i=Math.floor(t*this.resolutionScale),n=Math.floor(e*this.resolutionScale);if(R.width!==i||R.height!==n){if(R.width*R.height*i*n!=0){let t=R.width!==i?R.width/i:R.height/n;this.controls.setZoom(t*this.controls.getZoom())}W(i,n)}this.shouldMeasureCanvas=!1}),"measureCanvas"),Y=new Zn({name:"updateMapVisibility",ordering:Fr.BEFORE_CAMERA,callback:()=>{for(let t of A.mapObjectsSortedByElevation)t.visible?t.onVisible():t.onInvisible()}}),Z=new Zn({name:"updateTweens",ordering:Fr.BEFORE_CAMERA,callback:()=>u6.default.update()});var J=new de;this.cameraParameters=J;let Q=new Zn({name:"camera",ordering:Fr.CAMERA,callback:()=>{this.controls.update(),J.x=this.controls.getZoom(),J.y=this.controls.getTilt(),this.controls.isCameraMoving()&&this.publish(0,J),this.publish(1,J.x)}}),K=new Zn({name:"rotateObjects",ordering:Fr.AFTER_CAMERA,callback:()=>{let t=this.getNorth()+this.controls.getRotation();for(let e=0,i=T.length;e<i;++e)B(T[e],t);at(),ot(),S=!1}}),$=new Zn({name:"renderAll",ordering:Fr.RENDER,callback:()=>{null!=this.currentMap&&f.isAvailable()&&(this.shouldMeasureCanvas&&X(),f.render(Nt.ALL,null,this.scene,g),this.controls.postRender&&this.controls.postRender())}});this.getMapScale=()=>C.get(this.currentMap).getMapScale(),this.getNorth=()=>C.get(this.currentMap).getNorth();let tt=new Zn({name:"renderAnimated",ordering:Fr.RENDER,supersededBy:[$],callback:()=>{null!=this.currentMap&&f.isAvailable()&&(this.shouldMeasureCanvas&&X(),f.render(Nt.ANIMATED,null,this.scene,g),this.controls.postRender&&this.controls.postRender())}}),et=new Zn({name:"renderAlwaysOnTop",ordering:Fr.RENDER,supersededBy:[$],callback:()=>{null!=this.currentMap&&f.isAvailable()&&(this.shouldMeasureCanvas&&X(),f.render(Nt.ALWAYS_ON_TOP,null,this.scene,g),this.controls.postRender&&this.controls.postRender())}}),it=new Zn({name:"updateBlueDotPosition",ordering:Fr.AFTER_RENDER,callback:()=>{this.publish(2)}}),nt=new Zn({name:"updateColliders",ordering:Fr.AFTER_RENDER,frameCount:32,callback:()=>{this.smartCollisionEngine.reposition()}}),st=new Zn({name:"updateDebugUI",ordering:Fr.AFTER_ALL_UPDATES,frameCount:1,callback:()=>{let t={};for(let e of p.getUpdatesRunLastFrame().values())t[e.name]=e.getLastFrameTime();this._debugUI.reportFramePerformance(t)}});this.tryRendering=(t=Nt.ALL)=>{if(null!=f)if(null!=this._debugUI&&p.scheduleUpdate(st),t===Nt.ALL)p.scheduleUpdate(Z),p.scheduleUpdate(Y),p.scheduleUpdate(Q),p.scheduleUpdate(K),p.scheduleUpdate($),p.scheduleUpdate(it),p.scheduleUpdate(nt);else if(t===Nt.ANIMATED)p.scheduleUpdate(Z),p.scheduleUpdate(tt);else if(t===Nt.ALWAYS_ON_TOP)p.scheduleUpdate(Z),p.scheduleUpdate(et);else{if(t!==Nt.TWEEN)throw new Error("invalid render task passed to tryRendering");p.scheduleUpdate(Z)}};var at=h((()=>{let t=y.rotation.z;(b||S)&&A.visibleMaps.forEach((e=>{let i=t-e.object.rotation.z;e.imagesToFlip.forEach((t=>t.flipIfNeeded(i)))}))}),"rotateTextLabels"),ot=h((()=>{let t=y.rotation.z;(b||S)&&A.visibleMaps.forEach((e=>{let i=t-e.object.rotation.z;e.imagesToFlip.forEach((t=>t.flipIfNeeded(i)))}))}),"rotateImages");let ht=h((t=>{t.addDebugControls({MapView3D:[{name:"Background Color",description:"The color of the mapview background. Will be obscured if there is a fully-opaque outdoor context.",control:new dd({current:new Ee("#ffffff"),onValueChanged:t=>{f.setBackgroundColor(t,f.backgroundAlpha),this.tryRendering()}})},{name:"Background Opacity",description:"The opacity of the mapview background. Will be obscured if there is a fully-opaque outdoor context.",control:new ud({minimum:0,maximum:1,step:.01,current:f.backgroundAlpha,onValueChanged:t=>{f.setBackgroundColor(f.backgroundColor,t),this.tryRendering()}})}]})}),"addDebugControls"),ut=h((t=>{t.removeDebugControls({MapView3D:["Background Color","Background Opacity"]})}),"removeDebugControls");this.showDebugUI=()=>{null==this._debugUI&&(this._debugUI=new Cc,t.appendChild(this._debugUI.element),ht(this._debugUI),this.controls.addDebugControls(this._debugUI),this.tryRendering())},this.hideDebugUI=()=>{null!=this._debugUI&&(t.removeChild(this._debugUI.element),ut(this._debugUI),this.controls.removeDebugControls(this._debugUI),this._debugUI.destroy(),this._debugUI=null)};let ct=new xn(1e6,1e6),dt=new Hn({color:0,visible:!1}),pt=new lt(ct,dt);this.cameraPlane=pt,this.scene.add(pt),this.determineNewLabelSize=()=>{let t=this.controls.getZoom(),e=this.controls.getZoomScaledMin(),i=(t-e)/(this.controls.getZoomScaledMax()-e);this.currentScale=i},t.appendChild(R),t.style.touchAction="auto",window.addEventListener("resize",O,!1),"function"==typeof ResizeObserver&&"test"!==(null==(r=j.env)?void 0:r.NODE_ENV)&&(G(this,Po,new ResizeObserver((()=>{window.requestAnimationFrame(O)}))),null==(s=_(this,Po))||s.observe(t)),t.style.overflow="hidden",R.style.width=null!=(a=globalThis.MappedinDebug)&&a.TEST_IOS?"1080px":"100%",R.style.height=null!=(o=globalThis.MappedinDebug)&&o.TEST_IOS?"1920px":"100%",R.style.cursor="grab",this.canvasWidth=R.clientWidth,this.canvasHeight=R.clientHeight;let mt=this.canvasWidth,ft=this.canvasHeight;this.shouldMeasureCanvas=!0,this.setBackgroundColor(u,c),W(Math.floor(mt*this.resolutionScale),Math.floor(ft*this.resolutionScale)),x();let gt=new El(16777215,.3);gt.position.set(-150,-150,350),this.scene.add(gt);let vt=new wl(16777215,16777215,.77);this.scene.add(vt),this.controls=new d6.CameraControls(g,R,this.scene,this),this.controls.enableZoom=!0,this.INTERACTION_EVENTS=this.controls.INTERACTION_EVENTS;let yt=h((()=>this.tryRendering()),"tryRendering");this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.CHANGE_EVENT.type,this.determineNewLabelSize),this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.CHANGE_EVENT.type,yt),this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.ZOOM_START_EVENT.type,(()=>{this.publish("user-zoom-begin"),k()})),this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.ROTATE_START_EVENT.type,(()=>{this.publish("user-rotate-begin"),k(),M()})),this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.MULTI_START_EVENT.type,(()=>{this.publish("user-multi-begin"),this.publish(6),k(),M()})),this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.PAN_START_EVENT.type,(()=>{this.publish("user-pan-begin"),k(),this.publish(6)})),this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.ZOOM_END_EVENT.type,(()=>{this.publish("user-zoom"),this.publish("user-zoom-begin"),F()})),this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.ROTATE_END_EVENT.type,(()=>{this.publish("user-rotate"),F(),E()})),this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.MULTI_END_EVENT.type,(()=>{this.publish("user-multi-end"),F(),E()})),this.controls.dispatcher.addEventListener(this.controls.CAMERA_EVENTS.PAN_END_EVENT.type,F),this.controls.dispatcher.addEventListener(this.controls.INTERACTION_EVENTS.USER_PAN_START_EVENT.type,(()=>{this.currentInteractionEvent="user-pan"})),this.controls.dispatcher.addEventListener(this.controls.INTERACTION_EVENTS.USER_ROTATE_START_EVENT.type,(()=>{this.currentInteractionEvent="user-rotate"})),this.controls.dispatcher.addEventListener(this.controls.INTERACTION_EVENTS.USER_DOLLY_START_EVENT.type,(()=>{this.currentInteractionEvent="user-zoom"})),this.controls.dispatcher.addEventListener(this.controls.INTERACTION_EVENTS.USER_TILT_START_EVENT.type,(()=>{this.currentInteractionEvent="user-tilt"})),this.controls.dispatcher.addEventListener(this.controls.INTERACTION_EVENTS.USER_ZOOM_START_EVENT.type,(()=>{this.publish("user-zoom"),this.currentInteractionEvent="user-zoom"}));let _t,xt=e.maps;var bt=e.venue.defaultMap;if(i&&i.firstMap&&(bt=Jt(i.firstMap)),bt)for(let t=0,e=xt.length;t<e;++t)if(xt[t].id===bt){_t=xt[t].id;break}if(!_t){let t=e.maps[0];for(let i of e.maps.slice(1))t=Math.abs(i.elevation)===Math.abs(t.elevation)?i.elevation>t.elevation?i:t:Math.abs(i.elevation)<Math.abs(t.elevation)?i:t;_t=t}let wt=h((function(t=!0){S=t}),"setFlippablesNeedUpdating");A.on("render",yt),A.on("render:now",x),A.on("flippablesNeedUpdating",wt),A.on("texture-loaded",(t=>{this.tryRendering(),f.preloadTexture(t)})),e.imageBinaries&&f6(new Ic(e.imageBinaries)),A.loadMaps(xt,_t,(()=>{i.onFirstMapLoaded(e),this.smartCollisionEngine.init(t,U)}),i.onDataLoaded,(()=>{})),"function"==typeof i.onMapsFullyLoaded&&A.mapsFullyLoaded(i.onMapsFullyLoaded),this.setPadding(),this.destroy=()=>{this.controls.dispose(),A.off("set-map"),A.off("render"),A.off("render:now"),A.off("flippablesNeedUpdating"),window.removeEventListener("resize",O,!1),_(this,Po)&&_(this,Po).disconnect(),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.CHANGE_EVENT.type,this.determineNewLabelSize),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.CHANGE_EVENT.type,yt),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.ZOOM_START_EVENT.type,k),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.ROTATE_START_EVENT.type,k),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.ROTATE_START_EVENT.type,M),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.MULTI_START_EVENT.type,k),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.MULTI_START_EVENT.type,this.publish(6)),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.MULTI_START_EVENT.type,M),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.PAN_START_EVENT.type,k),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.PAN_START_EVENT.type,this.publish(6)),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.ZOOM_END_EVENT.type,F),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.ROTATE_END_EVENT.type,F),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.ROTATE_END_EVENT.type,E),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.MULTI_END_EVENT.type,F),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.MULTI_END_EVENT.type,E),this.controls.dispatcher.removeEventListener(this.controls.CAMERA_EVENTS.PAN_END_EVENT.type,F);for(let t in this.polygonMeshesById)this.polygonMeshesById[t].destroy();this.polygonMeshesById={},this.interactivePolygons={},this._subscribers={},A.destroy(),this.scene.destroy(),P={},m.dispose(),p.destroy(),f.destroy(),t.removeChild(R),null!=this._debugUI&&this.hideDebugUI(),f=void 0}}};h(k1,"Core"),Po=new WeakMap;var p6=k1;P();var As,qd=class{constructor(t){H(this,As,void 0),G(this,As,t)}labelAllLocations(t){_(this,As).labelAllLocations(t)}add(t,e,i){_(this,As).labelPolygon(t,e,i)}remove(t){_(this,As).removeLabel(t)}removeAll(){_(this,As).removeAllLabels()}setAppearance(t,e){_(this,As).setAppearance(t,e)}};h(qd,"FlatLabels"),As=new WeakMap,P();var or,Pd=class{constructor(t){H(this,or,void 0),G(this,or,t)}labelAllLocations(t){_(this,or).labelAllLocations(t)}add(t,e,i){_(this,or).addLabel(t,e,i)}setAppearance(t,e){_(this,or).setAppearance(t,e)}remove(t){_(this,or).removeLabel(t,!1)}removeAll(){_(this,or).removeAllLabels()}setPriority(t,e){_(this,or).setPriority(t,e)}resetPriority(t){_(this,or).resetPriority(t)}};h(Pd,"FloatingLabels"),or=new WeakMap;var qs,Lc,_a,ba,Ps,Co,Cs,Io,Id,Ld,Od,ot,Cd=class extends er{constructor(t,e,i){super(),H(this,qs,"explore"),w(this,"currentPath"),H(this,Lc,void 0),H(this,_a,void 0),H(this,ba,void 0),H(this,Ps,void 0),H(this,Co,void 0),H(this,Cs,void 0),H(this,Io,void 0),H(this,Id,void 0),H(this,Ld,void 0),H(this,Od,void 0),w(this,"BlueDot"),w(this,"Journey"),w(this,"Camera"),H(this,ot,void 0),w(this,"FlatLabels"),w(this,"FloatingLabels"),w(this,"options",{}),this.options=i||{},G(this,ot,new p6(t,e,i,this)),_(this,ot).onMapClicked=(t,i,n)=>{this.publish("CLICK",{position:t,polygons:null!=e._polygonsById?i.map((t=>e._polygonsById[t])).filter((t=>null!=t)):[],nearBlueDot:n})},_(this,ot).onPolygonClicked=t=>{this.publish("POLYGON_CLICKED",e.polygons.find((e=>e.id===t)))},_(this,ot).onNothingClicked=()=>{this.publish("NOTHING_CLICKED")},_(this,ot).onMapChanged=()=>{this.publish("MAP_CHANGED",this.currentMap)},this.Journey=new sM(this,_(this,ot)),this.Camera=new rb(_(this,ot)),G(this,_a,new Db(this,_(this,ot))),G(this,Ld,new E5(this,_(this,ot))),G(this,Od,new z5(this,_(this,ot))),G(this,ba,new zb(this,_(this,ot))),G(this,Ps,new Vb(this,_(this,ot))),G(this,Co,new Hb(this,_(this,ot))),G(this,Id,new pM(this,_(this,ot))),G(this,Cs,new Kb(this,_(this,ot))),G(this,Io,new oM(this,_(this,ot))),G(this,Lc,new tM(this,_(this,ot))),this.BlueDot=new Jb(this,_(this,ot),_(this,Lc)),this.FlatLabels=new qd(_(this,Ld)),this.FloatingLabels=new Pd(_(this,Od)),_(this,ot).on(3,(({state:t})=>{G(this,qs,t),this.publish("STATE_CHANGE",t)}))}labelAllLocations(t){return null!=t&&t.flatLabels?this.FlatLabels.labelAllLocations(t):this.FloatingLabels.labelAllLocations(t),[]}getNearestNodeByScreenCoordinates(t,e,i){let n="string"==typeof i?i:(null==i?void 0:i.id)||this.currentMap.id,r=_(this,ot).mapManager.mapObjects.get(n);if(null==r)throw new Error("getNodeByScreenCoordinates failed: map not found");_(this,ot).cameraObject.updateMatrixWorld(!0),_(this,ot).cameraObject.updateMatrix();let s=t/_(this,ot).canvasWidth*2-1,a=-e/_(this,ot).canvasHeight*2+1,o=new I(s,a,0);xc.setFromCamera(o,_(this,ot).cameraObject.clone());let l=xc.intersectObject(_(this,ot).cameraPlane,!1)[0].point.applyMatrix4(r.object.matrix);return _(this,ot).venue._mapsById[n].createCoordinateByXY(l.x+r.mapClass.width/2,-l.y+r.mapClass.height/2).nearestNode}setState(t){return Ge(this,null,(function*(){if(t!==_(this,qs)){if("explore"===t)_(this,ot).publish(5,!1),G(this,qs,t);else{if("follow"!==t)throw new Error("Unsupported State");_(this,ot).publish(5,!0),G(this,qs,t)}return this.publish("STATE_CHANGE",_(this,qs)),Promise.resolve()}}))}get state(){return _(this,qs)}get venue(){return _(this,ot).venue}get container(){return _(this,ot).container}get currentMap(){return _(this,ot).venue.maps.find((t=>_(this,ot).currentMap===t.id))}removeAllInteractivePolygons(){_(this,Cs).removeAllInteractivePolygons()}setMap(t){return _(this,ot).setMap(t)}setPolygonColor(t,e){_(this,Io).setPolygonColor(t,e)}clearPolygonColor(t){_(this,Io).clearPolygonColor(t)}clearAllPolygonColors(){_(this,Io).clearAllPolygonColors()}addInteractivePolygon(t){_(this,Cs).addInteractivePolygon(t)}addInteractivePolygonsForAllLocations(t){_(this,Cs).addInteractivePolygonsForAllLocations(t)}removeInteractivePolygon(t){_(this,Cs).removeInteractivePolygon(t)}createMarker(t,e,i){return _(this,ba).createMarker(t,e,i)}removeMarker(t){_(this,ba).removeMarker(t)}removeAllMarkers(){_(this,ba).removeAllMarkers()}removeAllTooltips(){_(this,Ps).removeAllTooltips()}createTooltip(t,e,i){return _(this,Ps).createTooltip(t,e,i)}createCustomTooltip(t,e,i,n){return _(this,Ps).createCustomTooltip(t,e,i,n)}removeTooltip(t){_(this,Ps).removeTooltip(t)}enableImageFlippingForAllLocations(t){_(this,Co).enableImageFlippingForAllLocations(t)}enableImageFlippingForPolygon(t){_(this,Co).enableImageFlippingForPolygon(t)}disableImageFlippingForAllPolygons(){_(this,Co).disableImageFlippingForAllPolygons()}drawPath(t,e){return _(this,_a).drawPath(t,e)}removePath(t){return _(this,_a).removePath(t)}removeAllPaths(){_(this,_a).removeAllPaths()}setBackgroundColor(t,e){_(this,ot).setBackgroundColor(t,e)}setHoverColor(t){_(this,Lc).setHoverColor(t)}tryRendering(t){_(this,ot).tryRendering(t)}getPrimaryLocationForPolygon(t){return kl(t,this.venue)}getPolygonsAtCoordinate(t,e){let i=_(this,ot).convertTo3DMapPosition(t);i.setZ(_(this,ot).controls.maxZoom);let n=_(this,ot).mapObjects.get(t.map.id);if(!n||!n.hoverableMeshChildren)return[];let r=new Zi;return r.set(i,new I(0,0,-1)),r.intersectObjects(n.hoverableMeshChildren,!0).filter((t=>!!t.object.name&&(null!=e&&e.includeNonInteractive&&_(this,ot).venue._polygonsById?t.object.name in _(this,ot).venue._polygonsById:t.object.name in _(this,ot).interactivePolygons))).map((t=>_(this,ot).venue._polygonsById[t.object.name]))||[]}destroy(){A1.imagesLoadingInProgress.clear(),this.FlatLabels.removeAll(),this.FloatingLabels.removeAll(),_(this,ba).removeAllMarkers(),_(this,Cs).removeAllInteractivePolygons(),_(this,Ps).removeAllTooltips(),_(this,_a).removeAllPaths(),_(this,ot).smartCollisionEngine.destroy(),_(this,Id).destroy(),_(this,ot).destroy()}};h(Cd,"MapView"),qs=new WeakMap,Lc=new WeakMap,_a=new WeakMap,ba=new WeakMap,Ps=new WeakMap,Co=new WeakMap,Cs=new WeakMap,Io=new WeakMap,Id=new WeakMap,Ld=new WeakMap,Od=new WeakMap,ot=new WeakMap,P();var iD=!1,D1=class extends Ss{constructor(t){super(),w(this,"venueData"),this.venueData=t}loadMapPolygons(t){return Ge(this,null,(function*(){return iD&&ge.log("loading map: ",t.id),Promise.resolve(this.venueData.scenes[t.id])}))}loadImage(t){return Ge(this,null,(function*(){return new Promise(((e,i)=>{let n=t.split("/"),r=n[n.length-1],s="data:image/png;base64,"+this.venueData.images[r];this.textureLoader.load(s,(t=>{e(t)}),(()=>{}),i)}))}))}};function Dne(t,e,i){return new Promise(((n,r)=>{var s,a,o;try{let r=new Cd(t,e,Ue(be({},i),{onFirstMapLoaded(){n(r)}}));new Pr(Ue(be({},null==(s=null==r?void 0:r.venue)?void 0:s.options),{testMode:!(null!=(o=null==(a=null==r?void 0:r.venue)?void 0:a.options)&&o.emitAnalyticsEvents)})).mapViewLoaded("3d",!1,-1,"")}catch(t){r(t)}}))}h(D1,"BundleAssetManager"),h(Dne,"showVenue");var f6=Td.setAssetManager.bind(Td);export{Za as ACTION_TYPE,Sh as ANIMATION_TWEENS,Ss as AssetManager,Ou as BEARING_TYPE,D1 as BundleAssetManager,uy as CAMERA_EASING_MODE,ro as COLLISION_RANKING_TIERS,$m as E_BLUEDOT_EVENT,Zm as E_BLUEDOT_MARKER_STATE,rc as E_BLUEDOT_STATE,Ym as E_BLUEDOT_STATE_REASON,Qm as E_CAMERA_DIRECTION,Km as E_CAMERA_EVENT,Jm as E_SDK_EVENT,us as MAP_RENDER_MODE,Bb as MARKER_ANCHOR,qr as Mappedin,br as MappedinCategory,as as MappedinCollectionType,os as MappedinCoordinate,ea as MappedinDestinationSet,ss as MappedinDirections,ra as MappedinEvent,Ni as MappedinLocation,sa as MappedinMap,aa as MappedinMapGroup,Ri as MappedinNavigatable,Di as MappedinNode,xr as MappedinPolygon,oa as MappedinVenue,la as MappedinVortex,Yl as OfflineSearch,Yh as PositionUpdater,cy as SAFE_AREA_INSET_TYPE,Eh as STATE,RC as downloadBundle,NC as downloadVenueBundleMVF,k4 as getVenue,D4 as getVenueBundle,B4 as getVenueBundleURL,r0 as labelThemes,f6 as setAssetManager,IC as setFetchFn,Dne as showVenue};