PageSourceSearch

https://www.flughafen-zuerich.ch/_next/static/chunks/f580a60b.297ef3ce49e5fa18.js

js flughafen-zuerich.ch collected 2026-09-24 09:05:44 UTC 1,225,413 bytes, 1,238 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[755],{79729:(e,t,n)=>{let r;n.d(t,{A:()=>UA});var i,a,o,s,l,u,c,h,d,p,f,m,g,v,y,b,x,_,w,M,E,S,T,A,C,R,P,I,O,L,D,N,U,k,B,F,z,H,j,W,G,V,X,q,Y,Z,$,K,J,Q,ee,et,en,er,ei,ea,eo,es,el,eu,ec,eh,ed,ep,ef,em,eg,ev,ey,eb,ex,e_,ew,eM,eE,eS,eT,eA,eC,eR,eP,eI,eO,eL,eD,eN,eU,ek,eB,eF,ez,eH,ej,eW,eG,eV,eX,eq,eY,eZ,e$,eK,eJ,eQ,e0,e1,e2,e3,e5,e4,e6,e8,e7,e9,te,tt,tn,tr,ti,ta,to,ts,tl,tu,tc,th,td,tp,tf,tm,tg,tv,ty,tb,tx,t_,tw,tM,tE,tS,tT,tA,tC,tR,tP,tI,tO,tL,tD,tN,tU,tk,tB,tF,tz,tH,tj,tW,tG,tV,tX,tq,tY,tZ,t$,tK,tJ,tQ,t0,t1,t2,t3,t5,t4,t6,t8,t7,t9,ne,nt,nn,nr,ni,na,no,ns,nl,nu,nc,nh,nd,np,nf,nm,ng,nv,ny,nb,nx,n_,nw,nM,nE,nS,nT,nA,nC,nR,nP,nI,nO,nL,nD,nN,nU,nk,nB,nF,nz,nH,nj,nW,nG,nV,nX,nq,nY,nZ,n$,nK,nJ,nQ,n0,n1,n2,n3,n5,n4,n6,n8,n7,n9,re,rt,rn,rr,ri,ra,ro,rs,rl,ru,rc=n(14232),rh=n(70964),rd=n(98477);e=n.hmd(e),"undefined"!=typeof globalThis||("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self);var rp={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,o){if("function"!=typeof r)throw TypeError("The listener must be a function");var s=new i(r,a||e,o),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=Array(a);i<a;i++)o[i]=r[i].fn;return o},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,a,o){var s=n?n+e:e;if(!this._events[s])return!1;var l,u,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,a),!0;case 6:return c.fn.call(c.context,t,r,i,a,o),!0}for(u=1,l=Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,p=c.length;for(u=0;u<p;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,r);break;case 4:c[u].fn.call(c[u].context,t,r,i);break;default:if(!l)for(d=1,l=Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},s.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var l=0,u=[],c=s.length;l<c;l++)(s[l].fn!==t||i&&!s[l].once||r&&s[l].context!==r)&&u.push(s[l]);u.length?this._events[a]=1===u.length?u[0]:u:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}(rp);var rf=rp.exports;function rm(e){if(Array.isArray(e[0]))return void e.forEach(rm);let t=e[0];e[0]=e[1],e[1]=t}function rg(e){return e&&e.type&&e.coordinates?("MultiLineString"===e.type?rm(e.coordinates[0]):rm(e.coordinates),e):null}var rv={create:function(){var e={root:{root:!0,next:null},exists:function(t){return null!==t&&t!==e.root},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,n){for(var r=e.root,i=e.root.next;null!==i;){if(n(i)){t.prev=i.prev,t.next=i,i.prev.next=t,i.prev=t;return}r=i,i=i.next}r.next=t,t.prev=r,t.next=null},findTransition:function(t){for(var n=e.root,r=e.root.next;null!==r&&!t(r);)n=r,r=r.next;return{before:n===e.root?null:n,after:r,insert:function(e){return e.prev=n,e.next=r,n.next=e,null!==r&&(r.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}};function ry(e,t,n){var r=[];return e.forEach(function(e){var i=8*!!e.myFill.above+4*!!e.myFill.below+(e.otherFill&&e.otherFill.above?2:0)+(e.otherFill&&e.otherFill.below?1:0);0!==t[i]&&r.push({id:n?n.segmentId():-1,start:e.start,end:e.end,myFill:{above:1===t[i],below:2===t[i]},otherFill:null})}),n&&n.selected(r),r}var rb=function(){var e,t=0,n=!1;function r(t,n){return e.list.push({type:t,data:n?JSON.parse(JSON.stringify(n)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return r("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return r("div_seg",{seg:e,pt:t}),r("chop",{seg:e,pt:t})},statusRemove:function(e){return r("pop_seg",{seg:e})},segmentUpdate:function(e){return r("seg_update",{seg:e})},segmentNew:function(e,t){return r("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return r("rem_seg",{seg:e})}
1,tempStatus:function(e,t,n){return r("temp_status",{seg:e,above:t,below:n})},rewind:function(e){return r("rewind",{seg:e})},status:function(e,t,n){return r("status",{seg:e,above:t,below:n})},vert:function(t){return t===n?e:(n=t,r("vert",{x:t}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1,"  ")),r("log",{txt:e})},reset:function(){return r("reset")},selected:function(e){return r("selected",{segs:e})},chainStart:function(e){return r("chain_start",{seg:e})},chainRemoveHead:function(e,t){return r("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return r("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return r("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return r("chain_match",{index:e})},chainClose:function(e){return r("chain_close",{index:e})},chainAddHead:function(e,t){return r("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return r("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return r("chain_con",{index1:e,index2:t})},chainReverse:function(e){return r("chain_rev",{index:e})},chainJoin:function(e,t){return r("chain_join",{index1:e,index2:t})},done:function(){return r("done")}}},rx=function(e,t,n){function r(e,t,r){return{id:n?n.segmentId():-1,start:e,end:t,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var i=rv.create();function a(e,n){i.insertBefore(e,function(r){var i,a,o,s,l,u;return i=e.isStart,a=e.pt,o=r.isStart,s=r.pt,l=r.other.pt,(0!==(u=t.pointsCompare(a,s))?u:t.pointsSame(n,l)?0:i!==o?i?1:-1:t.pointAboveOrOnLine(n,o?s:l,o?l:s)?1:-1)<0})}function o(e,t){var n,r,i=(a(n=rv.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null}),e.end),n);return r=rv.node({isStart:!1,pt:e.end,seg:e,primary:t,other:i,status:null}),i.other=r,a(r,i.pt),i}function s(e,t){var i=r(t,e.seg.end,e.seg);return n&&n.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,a(e.other,e.pt),o(i,e.primary)}function l(r,a){var o=rv.create();function l(e,r){var i=e.seg,a=r.seg,o=i.start,l=i.end,u=a.start,c=a.end;n&&n.checkIntersection(i,a);var h=t.linesIntersect(o,l,u,c);if(!1===h){if(!t.pointsCollinear(o,l,u)||t.pointsSame(o,c)||t.pointsSame(l,u))return!1;var d=t.pointsSame(o,u),p=t.pointsSame(l,c);if(d&&p)return r;var f=!d&&t.pointBetween(o,u,c),m=!p&&t.pointBetween(l,u,c);if(d)return m?s(r,l):s(e,c),r;f&&(p||(m?s(r,l):s(e,c)),s(r,o))}else 0===h.alongA&&(-1===h.alongB?s(e,u):0===h.alongB?s(e,h.pt):1===h.alongB&&s(e,c)),0===h.alongB&&(-1===h.alongA?s(r,o):0===h.alongA?s(r,h.pt):1===h.alongA&&s(r,l));return!1}for(var u=[];!i.isEmpty();){var c=i.getHead();if(n&&n.vert(c.pt[0]),c.isStart){n&&n.segmentNew(c.seg,c.primary);var h,d,p=function(e){return o.findTransition(function(n){return function(e,n){var r=e.seg.start,i=e.seg.end,a=n.seg.start,o=n.seg.end;return t.pointsCollinear(r,a,o)?t.pointsCollinear(i,a,o)||t.pointAboveOrOnLine(i,a,o)?1:-1:t.pointAboveOrOnLine(r,a,o)?1:-1}(e,n.ev)>0})}(c),f=p.before?p.before.ev:null,m=p.after?p.after.ev:null;n&&n.tempStatus(c.seg,!!f&&f.seg,!!m&&m.seg);var g=function(){if(f){var e=l(c,f);if(e)return e}return!!m&&l(c,m)}();if(g&&(e?(h=null===c.seg.myFill.below||c.seg.myFill.above!==c.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=c.seg.myFill,n&&n.segmentUpdate(g.seg),c.other.remove(),c.remove()),i.getHead()!==c){n&&n.rewind(c.seg);continue}e?(h=null===c.seg.myFill.below||c.seg.myFill.above!==c.seg.myFill.below,m?c.seg.myFill.below=m.seg.myFill.above:c.seg.myFill.below=r,h?c.seg.myFill.above=!c.seg.myFill.below:c.seg.myFill.above=c.seg.myFill.below):null===c.seg.otherFill&&(d=m?c.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:c.primary?a:r,c.seg.otherFill={above:d,below:d}),n&&n.status(c.seg,!!f&&f.seg,!!m&&m.seg),c.other.status=p.insert(rv.node({ev:c}))}else{var v=c.status;if(null===v)throw Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(o.exists(v.prev)&&o.exists(v.next)&&l(v.prev.ev,v.next.ev),n&&n.statusRemove(v.ev.seg),v.remove(),!c.primary){var y=c.seg.myFill;c.seg.myFill=c.seg.otherFill,c.seg.otherFill=y}u.push(c.seg)}i.getHead().remove()}return n&&n.done(),u}return e?{addRegion:function(e){for(var r,i=e[e.length-1],a=0;a<e.length;a++){r=i,i=e[a];var s,l,u=t.pointsCompare(r,i);0!==u&&o((s=u<0?r:i,l=u<0?i:r,{id:n?n.segmentId():-1,start:s,end:l,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(e){return l(e,!1)}}:{calculate:function(e,t,n,i){return e.forEach(function(e){o(r(e.start,e.end,e),!0)}
1),n.forEach(function(e){o(r(e.start,e.end,e),!1)}),l(t,i)}}},r_=function(e,t,n){var r=[],i=[];return e.forEach(function(e){var a=e.start,o=e.end;if(t.pointsSame(a,o))return void console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");n&&n.chainStart(e);var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},u=s;function c(e,t,n){return(u.index=e,u.matches_head=t,u.matches_pt1=n,u===s)?(u=l,!1):(u=null,!0)}for(var h=0;h<r.length;h++){var d=r[h],p=d[0];d[1];var f=d[d.length-1];if(d[d.length-2],t.pointsSame(p,a)){if(c(h,!0,!0))break}else if(t.pointsSame(p,o)){if(c(h,!0,!1))break}else if(t.pointsSame(f,a)){if(c(h,!1,!0))break}else if(t.pointsSame(f,o)&&c(h,!1,!1))break}if(u===s){r.push([a,o]),n&&n.chainNew(a,o);return}if(u===l){n&&n.chainMatch(s.index);var m=s.index,g=s.matches_pt1?o:a,v=s.matches_head,d=r[m],y=v?d[0]:d[d.length-1],b=v?d[1]:d[d.length-2],x=v?d[d.length-1]:d[0],_=v?d[d.length-2]:d[1];if(t.pointsCollinear(b,y,g)&&(v?(n&&n.chainRemoveHead(s.index,g),d.shift()):(n&&n.chainRemoveTail(s.index,g),d.pop()),y=b),t.pointsSame(x,g)){r.splice(m,1),t.pointsCollinear(_,x,y)&&(v?(n&&n.chainRemoveTail(s.index,y),d.pop()):(n&&n.chainRemoveHead(s.index,y),d.shift())),n&&n.chainClose(s.index),i.push(d);return}v?(n&&n.chainAddHead(s.index,g),d.unshift(g)):(n&&n.chainAddTail(s.index,g),d.push(g));return}function w(e){n&&n.chainReverse(e),r[e].reverse()}function M(e,i){var a=r[e],o=r[i],s=a[a.length-1],l=a[a.length-2],u=o[0],c=o[1];t.pointsCollinear(l,s,u)&&(n&&n.chainRemoveTail(e,s),a.pop(),s=l),t.pointsCollinear(s,u,c)&&(n&&n.chainRemoveHead(i,u),o.shift()),n&&n.chainJoin(e,i),r[e]=a.concat(o),r.splice(i,1)}var E=s.index,S=l.index;n&&n.chainConnect(E,S);var T=r[E].length<r[S].length;s.matches_head?l.matches_head?T?(w(E),M(E,S)):(w(S),M(S,E)):M(S,E):l.matches_head?M(E,S):T?(w(E),M(S,E)):(w(S),M(E,S))}),i},rw={union:function(e,t){return ry(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return ry(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return ry(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return ry(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return ry(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}},rM={toPolygon:function(e,t){function n(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function n(t){var n=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[n]})}for(var r=n(t[0]),i=1;i<t.length;i++)r=e.selectDifference(e.combine(r,n(t[i])));return r}if("Polygon"===t.type)return e.polygon(n(t.coordinates));if("MultiPolygon"===t.type){for(var r=e.segments({inverted:!1,regions:[]}),i=0;i<t.coordinates.length;i++)r=e.selectUnion(e.combine(r,n(t.coordinates[i])));return e.polygon(r)}throw Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(e,t,n){function r(e,n){return t.pointInsideRegion([(e[0][0]+e[1][0])*.5,(e[0][1]+e[1][1])*.5],n)}function i(e){return{region:e,children:[]}}n=e.polygon(e.segments(n));for(var a=i(null),o=0;o<n.regions.length;o++){var s=n.regions[o];s.length<3||function e(t,n){for(var a=0;a<t.children.length;a++){var o=t.children[a];if(r(n,o.region))return void e(o,n)}for(var s=i(n),a=0;a<t.children.length;a++){var o=t.children[a];r(o.region,n)&&(s.children.push(o),t.children.splice(a,1),a--)}t.children.push(s)}(a,s)}function l(e,t){for(var n=0,r=e[e.length-1][0],i=e[e.length-1][1],a=[],o=0;o<e.length;o++){var s=e[o][0],l=e[o][1];a.push([s,l]),n+=l*r-s*i,r=s,i=l}return n<0!==t&&a.reverse(),a.push([a[0][0],a[0][1]]),a}for(var u=[],o=0;o<a.children.length;o++)!function e(t){var n=[l(t.region,!1)];u.push(n);for(var r=0;r<t.children.length;r++)n.push(function(t){for(var n=0;n<t.children.length;n++)e(t.children[n]);return l(t.region,!0)}(t.children[r]))}(a.children[o]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}},rE=!1,rS=function(e){"number"!=typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"==typeof t&&(e=t),e},pointAboveOrOnLine:function(t,n,r){var i=n[0],a=n[1],o=r[0],s=r[1],l=t[0],u=t[1],c=o-i,h=s-a,d=Math.sqrt(c*c+h*h);
1return c*(u-a)-h*(l-i)>=-e*d},pointBetween:function(e,n,r){if(t.pointsSame(e,n)||t.pointsSame(e,r))return!1;var i=e[1]-n[1],a=r[0]-n[0],o=e[0]-n[0],s=r[1]-n[1],l=o*a+i*s;return!(l<0)&&l<=a*a+s*s},pointsSameX:function(t,n){return Math.abs(t[0]-n[0])<e},pointsSameY:function(t,n){return Math.abs(t[1]-n[1])<e},pointsSame:function(e,n){return t.pointsSameX(e,n)&&t.pointsSameY(e,n)},pointsCompare:function(e,n){return t.pointsSameX(e,n)?t.pointsSameY(e,n)?0:e[1]<n[1]?-1:1:e[0]<n[0]?-1:1},pointsCollinear:function(t,n,r){var i=t[0]-n[0],a=t[1]-n[1],o=n[0]-r[0],s=n[1]-r[1],l=Math.sqrt(i*i+a*a),u=Math.sqrt(o*o+s*s);return Math.abs(i*s-o*a)<=e*(l+u)},linesIntersect:function(n,r,i,a){var o=r[0]-n[0],s=r[1]-n[1],l=a[0]-i[0],u=a[1]-i[1],c=o*u-s*l;if(Math.abs(c)<=e*(Math.sqrt(o*o+s*s)+Math.sqrt(l*l+u*u)))return!1;var h=n[0]-i[0],d=n[1]-i[1],p=(l*d-u*h)/c,f=(o*d-s*h)/c,m=[n[0]+p*o,n[1]+p*s],g={alongA:0,alongB:0,pt:m};return t.pointsSame(m,n)?g.alongA=-1:t.pointsSame(m,r)?g.alongA=1:p<0?g.alongA=-2:p>1&&(g.alongA=2),t.pointsSame(m,i)?g.alongB=-1:t.pointsSame(m,a)?g.alongB=1:f<0?g.alongB=-2:f>1&&(g.alongB=2),g},pointInsideRegion:function(t,n){for(var r=t[0],i=t[1],a=n[n.length-1][0],o=n[n.length-1][1],s=!1,l=0;l<n.length;l++){var u=n[l][0],c=n[l][1];c-i>e!=o-i>e&&(a-u)*(i-c)/(o-c)+u-r>e&&(s=!s),a=u,o=c}return s}};return t}();function rT(e,t,n){var r=a.segments(e),i=a.segments(t),o=n(a.combine(r,i));return a.polygon(o)}a={buildLog:function(e){return!0===e?rE=rb():!1===e&&(rE=!1),!1!==rE&&rE.list},epsilon:function(e){return rS.epsilon(e)},segments:function(e){var t=rx(!0,rS,rE);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:rx(!1,rS,rE).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:rw.union(e.combined,rE),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:rw.intersect(e.combined,rE),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:rw.difference(e.combined,rE),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:rw.differenceRev(e.combined,rE),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:rw.xor(e.combined,rE),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:r_(e.segments,rS,rE),inverted:e.inverted}},polygonFromGeoJSON:function(e){return rM.toPolygon(a,e)},polygonToGeoJSON:function(e){return rM.fromPolygon(a,rS,e)},union:function(e,t){return rT(e,t,a.selectUnion)},intersect:function(e,t){return rT(e,t,a.selectIntersect)},difference:function(e,t){return rT(e,t,a.selectDifference)},differenceRev:function(e,t){return rT(e,t,a.selectDifferenceRev)},xor:function(e,t){return rT(e,t,a.selectXor)}},"object"==typeof window&&(window.PolyBool=a);var rA=a;let rC={ROTATE:0,DOLLY:1,PAN:2},rR={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},rP="attached",rI="srgb",rO="srgb-linear",rL="display-p3",rD="display-p3-linear",rN="linear",rU="srgb",rk="rec709",rB="300 es";class rF{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let n=this._listeners[e];if(void 0!==n){let e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}let rz=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","5
15","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],rH=Math.PI/180,rj=180/Math.PI;function rW(){let e=0xffffffff*Math.random()|0,t=0xffffffff*Math.random()|0,n=0xffffffff*Math.random()|0,r=0xffffffff*Math.random()|0;return(rz[255&e]+rz[e>>8&255]+rz[e>>16&255]+rz[e>>24&255]+"-"+rz[255&t]+rz[t>>8&255]+"-"+rz[t>>16&15|64]+rz[t>>24&255]+"-"+rz[63&n|128]+rz[n>>8&255]+"-"+rz[n>>16&255]+rz[n>>24&255]+rz[255&r]+rz[r>>8&255]+rz[r>>16&255]+rz[r>>24&255]).toLowerCase()}function rG(e,t,n){return Math.max(t,Math.min(n,e))}function rV(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function rX(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let rq={DEG2RAD:rH,degToRad:function(e){return e*rH},radToDeg:function(e){return e*rj}};class rY{constructor(e=0,t=0){rY.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}
vendor: 5,113 bytes, line 1
1roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(rG(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class rZ{constructor(e,t,n,r,i,a,o,s,l){rZ.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,o,s,l)}set(e,t,n,r,i,a,o,s,l){let u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=i,u[5]=s,u[6]=n,u[7]=a,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],u=n[4],c=n[7],h=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],b=r[7],x=r[2],_=r[5],w=r[8];return i[0]=a*f+o*v+s*x,i[3]=a*m+o*y+s*_,i[6]=a*g+o*b+s*w,i[1]=l*f+u*v+c*x,i[4]=l*m+u*y+c*_,i[7]=l*g+u*b+c*w,i[2]=h*f+d*v+p*x,i[5]=h*m+d*y+p*_,i[8]=h*g+d*b+p*w,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8];return t*a*u-t*o*l-n*i*u+n*o*s+r*i*l-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=u*a-o*l,h=o*s-u*i,d=l*i-a*s,p=t*c+n*h+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=c*f,e[1]=(r*l-u*n)*f,e[2]=(o*n-r*a)*f,e[3]=h*f,e[4]=(u*t-r*s)*f,e[5]=(r*i-o*t)*f,e[6]=d*f,e[7]=(n*s-l*t)*f,e[8]=(a*t-n*i)*f,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(r$.makeScale(e,t)),this}rotate(e){return this.premultiply(r$.makeRotation(-e)),this}translate(e,t){return this.premultiply(r$.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let r$=new rZ;function rK(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function rJ(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}let rQ={};function r0(e){e in rQ||(rQ[e]=!0,console.warn(e))}let r1=new rZ().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),r2=new rZ().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),r3={[rO]:{transfer:rN,primaries:rk,toReference:e=>e,fromReference:e=>e},[rI]:{transfer:rU,primaries:rk,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[rD]:{transfer:rN,primaries:"p3",toReference:e=>
1e.applyMatrix3(r2),fromReference:e=>e.applyMatrix3(r1)},[rL]:{transfer:rU,primaries:"p3",toReference:e=>e.convertSRGBToLinear().applyMatrix3(r2),fromReference:e=>e.applyMatrix3(r1).convertLinearToSRGB()}},r5=new Set([rO,rD]),r4={enabled:!0,_workingColorSpace:rO,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(colorSpace){if(!r5.has(colorSpace))throw Error(`Unsupported working color space, "${colorSpace}".`);this._workingColorSpace=colorSpace},convert:function(e,t,n){if(!1===this.enabled||t===n||!t||!n)return e;let r=r3[t].toReference;return(0,r3[n].fromReference)(r(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return r3[e].primaries},getTransfer:function(e){return""===e?rN:r3[e].transfer}};function r6(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function r8(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class r7{static getDataURL(e){let t;if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===r&&(r=rJ("canvas")),r.width=e.width,r.height=e.height;let n=r.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=r}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let t=rJ("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*r6(i[e]/255);return n.putImageData(r,0,0),t}if(!e.data)return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e;{let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*r6(t[e]/255)):t[e]=r6(t[e]);return{data:t,width:e.width,height:e.height}}}}let r9=0;class ie{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:r9++}),this.uuid=rW(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(it(r[t].image)):e.push(it(r[t]))}else e=it(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function it(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?r7.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let ir=0;class ii extends rF{constructor(e=ii.DEFAULT_IMAGE,t=ii.DEFAULT_MAPPING,n=1001,r=1001,i=1006,a=1008,o=1023,s=1009,l=ii.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:ir++}),this.uuid=rW(),this.name="",this.source=new ie(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new rY(0,0),this.repeat=new rY(1,1),this.center=new rY(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new rZ,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace
vendor: 3,802 bytes, line 1
1=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}ii.DEFAULT_IMAGE=null,ii.DEFAULT_MAPPING=300,ii.DEFAULT_ANISOTROPY=1;class ia{constructor(e=0,t=0,n=0,r=1){ia.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=e.elements,o=a[0],s=a[4],l=a[8],u=a[
11],c=a[5],h=a[9],d=a[2],p=a[6],f=a[10];if(.01>Math.abs(s-u)&&.01>Math.abs(l-d)&&.01>Math.abs(h-p)){if(.1>Math.abs(s+u)&&.1>Math.abs(l+d)&&.1>Math.abs(h+p)&&.1>Math.abs(o+c+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(o+1)/2,a=(c+1)/2,m=(f+1)/2,g=(s+u)/4,v=(l+d)/4,y=(h+p)/4;return e>a&&e>m?e<.01?(n=0,r=.707106781,i=.707106781):(r=g/(n=Math.sqrt(e)),i=v/n):a>m?a<.01?(n=.707106781,r=0,i=.707106781):(n=g/(r=Math.sqrt(a)),i=y/r):m<.01?(n=.707106781,r=.707106781,i=0):(n=v/(i=Math.sqrt(m)),r=y/i),this.set(n,r,i,t),this}let m=Math.sqrt((p-h)*(p-h)+(l-d)*(l-d)+(u-s)*(u-s));return .001>Math.abs(m)&&(m=1),this.x=(p-h)/m,this.y=(l-d)/m,this.z=(u-s)/m,this.w=Math.acos((o+c+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class io extends rF{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new ia(0,0,e,t),this.scissorTest=!1,this.viewport=new ia(0,0,e,t);let r=new ii({width:e,height:t,depth:1},(n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n)).mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);r.flipY=!1,r.generateMipmaps=n.generateMipmaps,r.internalFormat=n.internalFormat,this.textures=[];let i=n.count;for(let e=0;e<i;e++)this.textures[e]=r.clone(),this.textures[e].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++)this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new ie(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class is extends io{constructor(e=1,t=1,n={}
vendor: 8,336 bytes, line 1
1){super(e,t,n),this.isWebGLRenderTarget=!0}}class il extends ii{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class iu extends ii{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ic{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3],h=i[a+0],d=i[a+1],p=i[a+2],f=i[a+3];if(0===o){e[t+0]=s,e[t+1]=l,e[t+2]=u,e[t+3]=c;return}if(1===o){e[t+0]=h,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(c!==f||s!==h||l!==d||u!==p){let e=1-o,t=s*h+l*d+u*p+c*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){let i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,o=Math.sin(o*a)/i}let i=o*n;if(s=s*e+h*i,l=l*e+d*i,u=u*e+p*i,c=c*e+f*i,e===1-o){let e=1/Math.sqrt(s*s+l*l+u*u+c*c);s*=e,l*=e,u*=e,c*=e}}e[t]=s,e[t+1]=l,e[t+2]=u,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],l=n[r+2],u=n[r+3],c=i[a],h=i[a+1],d=i[a+2],p=i[a+3];return e[t]=o*p+u*c+s*d-l*h,e[t+1]=s*p+u*h+l*c-o*d,e[t+2]=l*p+u*d+o*h-s*c,e[t+3]=u*p-o*c-s*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),u=o(r/2),c=o(i/2),h=s(n/2),d=s(r/2),p=s(i/2);switch(a){case"XYZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"YXZ":this._x=h*u*c+l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"ZXY":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c-h*d*p;break;case"ZYX":this._x=h*u*c-l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c+h*d*p;break;case"YZX":this._x=h*u*c+l*d*p,this._y=l*d*c+h*u*p,this._z=l*u*p-h*d*c,this._w=l*u*c-h*d*p;break;case"XZY":this._x=h*u*c-l*d*p,this._y=l*d*c-h*u*p,this._z=l*u*p+h*d*c,this._w=l*u*c+h*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],u=t[6],c=t[10],h=n+o+c;if(h>0){let e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(u-s)*e,this._y=(i-l)*e,this._z=(a-r)*e}else if(n>o&&n>c){let e=2*Math.sqrt(1+n-o-c);this._w=(u-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+l)/e}else if(o>c){let e=2*Math.sqrt(1+o-n-c);this._w=(i-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+u)/e}else{let e=2*Math.sqrt(1+c-n-o);this._w=(a-r)/e,this._x=(i+l)/e,this._y=(s+u)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=n,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(rG(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(0===n)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,u=t._w;return this._x=n*u+a*o+r*l-i*s,this._y=r*u+a*s+i*o-n*l,this._z=i*u+a*l+n*s-r*o,this._w=a*u-n*o-r*s-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);let n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;let s=1-o*o;if(s<=Number.EPSILON){let e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}let l=Math.sqrt(s),u=Math.atan2(l,o),c=Math.sin((1-t)*u)/l,h=Math.sin(t*u)/l;return this._w=a*c+this._w*h,this._x=n*c+this._x*h,this._y=r*c+this._y*h,this._z=i*c+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ih{constructor(e=0,t=0,n=0){ih.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ip.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ip.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}
vendor: 6,226 bytes, line 1
1applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=2*(a*r-o*n),u=2*(o*t-i*r),c=2*(i*n-a*t);return this.x=t+s*l+a*c-o*u,this.y=n+s*u+o*l-i*c,this.z=r+s*c+i*u-a*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return id.copy(this).projectOnVector(e),this.sub(id)}reflect(e){return this.sub(id.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(rG(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let id=new ih,ip=new ic;class im{constructor(e=new ih(Infinity,Infinity,Infinity),t=new ih(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(iv.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(iv.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=iv.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(void 0!==n){let r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(let t=0,n=r.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,iv):iv.fromBufferAttribute(r,t),iv.applyM
1atrix4(e.matrixWorld),this.expandByPoint(iv);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),iy.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),iy.copy(n.boundingBox)),iy.applyMatrix4(e.matrixWorld),this.union(iy)}let r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return!(e.x<this.min.x)&&!(e.x>this.max.x)&&!(e.y<this.min.y)&&!(e.y>this.max.y)&&!(e.z<this.min.z)&&!(e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x)&&!(e.min.x>this.max.x)&&!(e.max.y<this.min.y)&&!(e.min.y>this.max.y)&&!(e.max.z<this.min.z)&&!(e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,iv),iv.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(iS),iT.subVectors(this.max,iS),ib.subVectors(e.a,iS),ix.subVectors(e.b,iS),i_.subVectors(e.c,iS),iw.subVectors(ix,ib),iM.subVectors(i_,ix),iE.subVectors(ib,i_);let t=[0,-iw.z,iw.y,0,-iM.z,iM.y,0,-iE.z,iE.y,iw.z,0,-iw.x,iM.z,0,-iM.x,iE.z,0,-iE.x,-iw.y,iw.x,0,-iM.y,iM.x,0,-iE.y,iE.x,0];return!!iR(t,ib,ix,i_,iT)&&!!iR(t=[1,0,0,0,1,0,0,0,1],ib,ix,i_,iT)&&(iA.crossVectors(iw,iM),iR(t=[iA.x,iA.y,iA.z],ib,ix,i_,iT))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,iv).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(iv).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(ig[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ig[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ig[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ig[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ig[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ig[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ig[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ig[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ig)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}let ig=[new ih,new ih,new ih,new ih,new ih,new ih,new ih,new ih],iv=new ih,iy=new im,ib=new ih,ix=new ih,i_=new ih,iw=new ih,i
1M=new ih,iE=new ih,iS=new ih,iT=new ih,iA=new ih,iC=new ih;function iR(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){iC.fromArray(e,a);let o=i.x*Math.abs(iC.x)+i.y*Math.abs(iC.y)+i.z*Math.abs(iC.z),s=t.dot(iC),l=n.dot(iC),u=r.dot(iC);if(Math.max(-Math.max(s,l,u),Math.min(s,l,u))>o)return!1}return!0}let iP=new im,iI=new ih,iO=new ih;class iL{constructor(e=new ih,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;void 0!==t?n.copy(t):iP.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(e.set(this.center,this.center),e.expandByScalar(this.radius)),e}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;iI.subVectors(e,this.center);let t=iI.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(iI,n/e),this.radius+=n}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(iO.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(iI.copy(e.center).add(iO)),this.expandByPoint(iI.copy(e.center).sub(iO)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}let iD=new ih,iN=new ih,iU=new ih,ik=new ih,iB=new ih,iF=new ih,iz=new ih;class iH{constructor(e=new ih,t=new ih(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,iD)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=iD.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(iD.copy(this.origin).addScaledVector(this.direction,t),iD.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){let i,a,o,s;iN.copy(e).add(t).multiplyScalar(.5),iU.copy(t).sub(e).normalize(),ik.copy(this.origin).sub(iN);let l=.5*e.distanceTo(t),u=-this.direction.dot(iU),c=ik.dot(this.direction),h=-ik.dot(iU),d=ik.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(i=u*h-c,a=u*c-h,s=l*p,i>=0)if(a>=-s)if(a<=s){let e=1/p;i*=e,a*=e,o=i*(i+u*a+2*c)+a*(u*i+a+2*h)+d}else o=-(i=Math.max(0,-(u*(a=l)+c)))*i+a*(a+2*h)+d;else o=-(i=Math.max(0,-(u*(a=-l)+c)))*i+a*(a+2*h)+d;else a<=-s?(a=(i=Math.max(0,-(-u*l+c)))>0?-l:Math.min(Math.max(-l,-h),l),o=-i*i+a*(a+2*h)+d):a<=s?(i=0,o=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):(a=(i=Math.max(0,-(u*l+c)))>0?l:Math.min(Math.max(-l,-h),l),o=-i*i+a*(a+2*h)+d);else a=u>0?-l:l,o=-(i=Math.max(0,-(u*a+c)))*i+a*(a+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,i),r&&r.copy(iN).addScaledVector(iU,a),o}intersectSphere(e,t){iD.subVectors(e.center,this.origin);let n=iD.dot(this.direction),r=iD.dot(iD)-n*n,i=e.radius*e.radiu
vendor: 4,595 bytes, line 1
1s;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let n,r,i,a,o,s,l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return(l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),u>=0?(i=(e.min.y-h.y)*u,a=(e.max.y-h.y)*u):(i=(e.max.y-h.y)*u,a=(e.min.y-h.y)*u),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),c>=0?(o=(e.min.z-h.z)*c,s=(e.max.z-h.z)*c):(o=(e.max.z-h.z)*c,s=(e.min.z-h.z)*c),n>s||o>r||((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0)))?null:this.at(n>=0?n:r,t)}intersectsBox(e){return null!==this.intersectBox(e,iD)}intersectTriangle(e,t,n,r,i){let a;iB.subVectors(t,e),iF.subVectors(n,e),iz.crossVectors(iB,iF);let o=this.direction.dot(iz);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}ik.subVectors(this.origin,e);let s=a*this.direction.dot(iF.crossVectors(ik,iF));if(s<0)return null;let l=a*this.direction.dot(iB.cross(ik));if(l<0||s+l>o)return null;let u=-a*ik.dot(iz);return u<0?null:this.at(u/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ij{constructor(e,t,n,r,i,a,o,s,l,u,c,h,d,p,f,m){ij.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,a,o,s,l,u,c,h,d,p,f,m)}set(e,t,n,r,i,a,o,s,l,u,c,h,d,p,f,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=u,g[10]=c,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 ij().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,r=1/iW.setFromMatrixColumn(e,0).length(),i=1/iW.setFromMatrixColumn(e,1).length(),a=1/iW.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){let e=a*u,n=a*c,r=o*u,i=o*c;t[0]=s*u,t[4]=-s*c,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-o*s,t[2]=i-e*l,t[6]=r+n*l,t[10]=a*s}else if("YXZ"===e.order){let e=s*u,n=s*c,r=l*u,i=l*c;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*l,t[1]=a*c,t[5]=a*u,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if("ZXY"===e.order){let e=s*u,n=s*c,r=l*u,i=l*c;t[0]=e-i*o,t[4]=-a*c,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*u,t[9]=i-e*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){let e=a*u,n=a*c,r=o*u,i=o*c;t[0]=s*u,t[4]=r*l-n,t[8]=e*l+i,t[1]=s*c,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){let e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*u,t[4]=i-e*c,t[8]=r*c+n,t[1]=c,t[5]=a*u,t[9]=-o*u,t[2]=-l*u,t[6]=n*c+r,t[10]=e-i*c}else if("XZY"===e.order){let e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*u,t[4]=-c,t[8]=l*u,t[1]=e*c+i,t[5]=a*u,t[9]=n*c-r,t[2]=r*c-n,t[6]=o*u,t[10]=i*c+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(iV,e,iX)}lookAt(e,t,n){let r=this.elements;return iZ.subVectors(e,t),0===iZ.lengthSq()&&(iZ.z=1),iZ.normalize(),iq.crossVectors(n,iZ),0===iq.lengthSq()&&(1===Math.abs(n.z)?iZ.x+=1e-4:iZ.z+=1e-4,iZ.normalize(),iq.crossVectors(n,iZ)),iq.normalize(),iY.crossVectors(i
1Z,iq),r[0]=iq.x,r[4]=iY.x,r[8]=iZ.x,r[1]=iq.y,r[5]=iY.y,r[9]=iZ.y,r[2]=iq.z,r[6]=iY.z,r[10]=iZ.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],u=n[1],c=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],b=n[11],x=n[15],_=r[0],w=r[4],M=r[8],E=r[12],S=r[1],T=r[5],A=r[9],C=r[13],R=r[2],P=r[6],I=r[10],O=r[14],L=r[3],D=r[7],N=r[11],U=r[15];return i[0]=a*_+o*S+s*R+l*L,i[4]=a*w+o*T+s*P+l*D,i[8]=a*M+o*A+s*I+l*N,i[12]=a*E+o*C+s*O+l*U,i[1]=u*_+c*S+h*R+d*L,i[5]=u*w+c*T+h*P+d*D,i[9]=u*M+c*A+h*I+d*N,i[13]=u*E+c*C+h*O+d*U,i[2]=p*_+f*S+m*R+g*L,i[6]=p*w+f*T+m*P+g*D,i[10]=p*M+f*A+m*I+g*N,i[14]=p*E+f*C+m*O+g*U,i[3]=v*_+y*S+b*R+x*L,i[7]=v*w+y*T+b*P+x*D,i[11]=v*M+y*A+b*I+x*N,i[15]=v*E+y*C+b*O+x*U,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],u=e[2],c=e[6],h=e[10],d=e[14],p=e[3],f=e[7];return p*(i*s*c-r*l*c-i*o*h+n*l*h+r*o*d-n*s*d)+f*(t*s*d-t*l*h+i*a*h-r*a*d+r*l*u-i*s*u)+e[11]*(t*l*c-t*o*d-i*a*c+n*a*d+i*o*u-n*l*u)+e[15]*(-r*o*u-t*s*c+t*o*h+r*a*c-n*a*h+n*s*u)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=c*m*l-f*h*l+f*s*d-o*m*d-c*s*g+o*h*g,y=p*h*l-u*m*l-p*s*d+a*m*d+u*s*g-a*h*g,b=u*f*l-p*c*l+p*o*d-a*f*d-u*o*g+a*c*g,x=p*c*s-u*f*s-p*o*h+a*f*h+u*o*m-a*c*m,_=t*v+n*y+r*b+i*x;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/_;return e[0]=v*w,e[1]=(f*h*i-c*m*i-f*r*d+n*m*d+c*r*g-n*h*g)*w,e[2]=(o*m*i-f*s*i+f*r*l-n*m*l-o*r*g+n*s*g)*w,e[3]=(c*s*i-o*h*i-c*r*l+n*h*l+o*r*d-n*s*d)*w,e[4]=y*w,e[5]=(u*m*i-p*h*i+p*r*d-t*m*d-u*r*g+t*h*g)*w,e[6]=(p*s*i-a*m*i-p*r*l+t*m*l+a*r*g-t*s*g)*w,e[7]=(a*h*i-u*s*i+u*r*l-t*h*l-a*r*d+t*s*d)*w,e[8]=b*w,e[9]=(p*c*i-u*f*i-p*n*d+t*f*d+u*n*g-t*c*g)*w,e[10]=(a*f*i-p*o*i+p*n*l-t*f*l-a*n*g+t*o*g)*w,e[11]=(u*o*i-a*c*i-u*n*l+t*c*l+a*n*d-t*o*d)*w,e[12]=x*w,e[13]=(u*f*r-p*c*r+p*n*h-t*f*h-u*n*m+t*c*m)*w,e[14]=(p*o*r-a*f*r-p*n*s+t*f*s+a*n*m-t*o*m)*w,e[15]=(a*c*r-u*o*r+u*n*s-t*c*s-a*n*h+t*o*h)*w,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];return Math.sqrt(Math.max(t,e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,u=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,u*o+n,u*s-r*a,0,l*s-r*o,u*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,u=a+a,c=o+o,h=i*l,d=i*u,p=i*c,f=a*u,m=a*c,g=o*c,v=s*l,y=s*u,b=s*c,x=n.x,_=n.y,w=n.z;return r[0]=(1-(f+g))*x,r[1]=(d+b)*x,r[2]=(p-y)*x,r[3]=0,r[4]=(d-b)*_,r[5]=(1-(h+g))*_,r[6]=(m+v)*_,r[7]=0,r[8]=(p+y)*w,r[9]=(m-v)*w,r[10]=(1-(h+f))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements,i=iW.set(r[0],r[1],r[2]).length(),a=iW.set(r[4],r[5],r[6]).length(),o=iW.set(r[8],r[9],r[10]).length();0>this.determinant()&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],iG.copy(this);let s=1/i,l=1/a,u=1/o;return iG.elements[0]*=s,iG.elements[1]*=s,iG.elements[2]*=s,iG.elements[4]*=l,iG.elements[5]*=l,iG.elements[6]*=l,iG.elements[8]*=u,iG.elements[9]*=u,iG.elements[10]*=u,t.setFromRotationMatrix(iG),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=2e3){let s,l,u=this.elements;if(2e3===o)s=-(a+i)/(a-i),l=-2*a*i/(a-i);else if(2001===o)s=-a/(a-i),l=-a*i/(a-i);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return u[0]=2*i/(t-e),u[4]=0,u[8]=(t+e)/(t-e),u[12]=0,u[1]=0,u[5]=2*i/(n-r),u[9]=(n+r)/(n-r),u[13]=0,u[2]=0,u[6]=0,u[10]=s,u[14]=l,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}
1makeOrthographic(e,t,n,r,i,a,o=2e3){let s,l,u=this.elements,c=1/(t-e),h=1/(n-r),d=1/(a-i);if(2e3===o)s=(a+i)*d,l=-2*d;else if(2001===o)s=i*d,l=-1*d;else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return u[0]=2*c,u[4]=0,u[8]=0,u[12]=-((t+e)*c),u[1]=0,u[5]=2*h,u[9]=0,u[13]=-((n+r)*h),u[2]=0,u[6]=0,u[10]=l,u[14]=-s,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}let iW=new ih,iG=new ij,iV=new ih(0,0,0),iX=new ih(1,1,1),iq=new ih,iY=new ih,iZ=new ih,i$=new ij,iK=new ic;class iJ{constructor(e=0,t=0,n=0,r=iJ.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],l=r[5],u=r[9],c=r[2],h=r[6],d=r[10];switch(t){case"XYZ":this._y=Math.asin(rG(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-rG(u,-1,1)),.9999999>Math.abs(u)?(this._y=Math.atan2(o,d),this._z=Math.atan2(s,l)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(rG(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-rG(c,-1,1)),.9999999>Math.abs(c)?(this._x=Math.atan2(h,d),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(rG(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-rG(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(h,l),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return i$.makeRotationFromQuaternion(e),this.setFromRotationMatrix(i$,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return iK.setFromEuler(this),this.setFromQuaternion(iK,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}iJ.DEFAULT_ORDER="XYZ";class iQ{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!=0}isEnabled(e){return(this.mask&1<<e)!=0}}let i0=0,i1=new ih,i2=new ic,i3=new ij,i5=new ih,i4=new ih,i6=new ih,i8=new ic,i7=new ih(1,0,0),i9=new ih(0,1,0),ae=new ih(0,0,1),at={type:"added"},an={type:"removed"},ar={type:"childadded",child:null},ai={type:"childremoved",child:null};class aa extends rF{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:i0++}),this.uuid=rW(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=aa.DEFAULT_UP.clone();let e=new ih,t=new iJ,n=new ic,r=new ih(1,1,1);t._onChange(function(){n.setFromEuler(t,!1)}),n._onChange(function(){t.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new ij},normalMatrix:{value:new rZ}}),this.matrix=new ij,this.matrixWorld=new ij,this.matrixAutoUpdate=aa.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=aa.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new iQ,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}
vendor: 4,269 bytes, line 1
1setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return i2.setFromAxisAngle(e,t),this.quaternion.multiply(i2),this}rotateOnWorldAxis(e,t){return i2.setFromAxisAngle(e,t),this.quaternion.premultiply(i2),this}rotateX(e){return this.rotateOnAxis(i7,e)}rotateY(e){return this.rotateOnAxis(i9,e)}rotateZ(e){return this.rotateOnAxis(ae,e)}translateOnAxis(e,t){return i1.copy(e).applyQuaternion(this.quaternion),this.position.add(i1.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(i7,e)}translateY(e){return this.translateOnAxis(i9,e)}translateZ(e){return this.translateOnAxis(ae,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(i3.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?i5.copy(e):i5.set(e,t,n);let r=this.parent;this.updateWorldMatrix(!0,!1),i4.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?i3.lookAt(i4,i5,this.up):i3.lookAt(i5,i4,this.up),this.quaternion.setFromRotationMatrix(i3),r&&(i3.extractRotation(r.matrixWorld),i2.setFromRotationMatrix(i3),this.quaternion.premultiply(i2.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(at),ar.child=e,this.dispatchEvent(ar),ar.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return -1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(an),ai.child=e,this.dispatchEvent(ai),ai.child=null),this}removeFromParent(){let e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),i3.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),i3.multiply(e.parent.matrixWorld)),e.applyMatrix4(i3),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(at),ar.child=e,this.dispatchEvent(ar),ar.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){let r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(i4,e,i6),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(i4,i8,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){let t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,r=t.length;n<r;n++){let r=t[n];(!0===r.matrixWorldAutoUpdate||!0===e)&&r.updateMatrixWorld(e)}}updateWorldMatrix(e,t){let n=this.parent;if(!0===e&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix
1):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t){let e=this.children;for(let t=0,n=e.length;t<n;t++){let n=e[t];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(e){let t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(e=>({boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){let r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){let t=a(e.geometries),r=a(e.materials),i=a(e.textures),o=a(e.images),s=a(e.shapes),l=a(e.skeletons),u=a(e.animations),c=a(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),c.length>0&&(n.nodes=c)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){let n=e.children[t];this.add(n.clone())}return this}}aa.DEFAULT_UP=new ih(0,1,0),aa.DEFAULT_MATRIX_AUTO_UPDATE=!0,aa.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;
vendor: 5,626 bytes, line 1
1let ao=new ih,as=new ih,al=new ih,au=new ih,ac=new ih,ah=new ih,ad=new ih,ap=new ih,af=new ih,am=new ih;class ag{constructor(e=new ih,t=new ih,n=new ih){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),ao.subVectors(e,t),r.cross(ao);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){ao.subVectors(r,t),as.subVectors(n,t),al.subVectors(e,t);let a=ao.dot(ao),o=ao.dot(as),s=ao.dot(al),l=as.dot(as),u=as.dot(al),c=a*l-o*o;if(0===c)return i.set(0,0,0),null;let h=1/c,d=(l*s-o*u)*h,p=(a*u-o*s)*h;return i.set(1-d-p,p,d)}static containsPoint(e,t,n,r){return null!==this.getBarycoord(e,t,n,r,au)&&au.x>=0&&au.y>=0&&au.x+au.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return null===this.getBarycoord(e,t,n,r,au)?(s.x=0,s.y=0,"z"in s&&(s.z=0),"w"in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,au.x),s.addScaledVector(a,au.y),s.addScaledVector(o,au.z),s)}static isFrontFacing(e,t,n,r){return ao.subVectors(n,t),as.subVectors(e,t),0>ao.cross(as).dot(r)}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ao.subVectors(this.c,this.b),as.subVectors(this.a,this.b),.5*ao.cross(as).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ag.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ag.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,i){return ag.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return ag.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ag.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n,r,i=this.a,a=this.b,o=this.c;ac.subVectors(a,i),ah.subVectors(o,i),ap.subVectors(e,i);let s=ac.dot(ap),l=ah.dot(ap);if(s<=0&&l<=0)return t.copy(i);af.subVectors(e,a);let u=ac.dot(af),c=ah.dot(af);if(u>=0&&c<=u)return t.copy(a);let h=s*c-u*l;if(h<=0&&s>=0&&u<=0)return n=s/(s-u),t.copy(i).addScaledVector(ac,n);am.subVectors(e,o);let d=ac.dot(am),p=ah.dot(am);if(p>=0&&d<=p)return t.copy(o);let f=d*l-s*p;if(f<=0&&l>=0&&p<=0)return r=l/(l-p),t.copy(i).addScaledVector(ah,r);let m=u*p-d*c;if(m<=0&&c-u>=0&&d-p>=0)return ad.subVectors(o,a),r=(c-u)/(c-u+(d-p)),t.copy(a).addScaledVector(ad,r);let g=1/(m+f+h);return n=f*g,r=h*g,t.copy(i).addScaledVector(ac,n).addScaledVector(ah,r)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let av={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},ay={h:0,s:0,l:0},ab={h:0,s:0,l:0};
1function ax(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*6*(2/3-n):e}class a_{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){return void 0===t&&void 0===n?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,n),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=rI){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,r4.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r=r4.workingColorSpace){return this.r=e,this.g=t,this.b=n,r4.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r=r4.workingColorSpace){var i;if(e=(e%1+(i=1))%i,t=rG(t,0,1),n=rG(n,0,1),0===t)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=ax(i,r,e+1/3),this.g=ax(i,r,e),this.b=ax(i,r,e-1/3)}return r4.toWorkingColorSpace(this,r),this}setStyle(e,t=rI){let n;function r(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=n[1],o=n[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return r(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let r=n[1],i=r.length;if(3===i)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(6===i)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=rI){let n=av[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=r6(e.r),this.g=r6(e.g),this.b=r6(e.b),this}copyLinearToSRGB(e){return this.r=r8(e.r),this.g=r8(e.g),this.b=r8(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=rI){return r4.fromWorkingColorSpace(aw.copy(this),e),65536*Math.round(rG(255*aw.r,0,255))+256*Math.round(rG(255*aw.g,0,255))+Math.round(rG(255*aw.b,0,255))}getHexString(e=rI){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=r4.workingColorSpace){let n,r;r4.fromWorkingColorSpace(aw.copy(this),t);let i=aw.r,a=aw.g,o=aw.b,s=Math.max(i,a,o),l=Math.min(i,a,o),u=(l+s)/2;if(l===s)n=0,r=0;else{let e=s-l;switch(r=u<=.5?e/(s+l):e/(2-s-l),s){case i:n=(a-o)/e+6*(a<o);break;case a:n=(o-i)/e+2;break;case o:n=(i-a)/e+4}n/=6}return e.h=n,e.s=r,e.l=u,e}getRGB(e,t=r4.workingColorSpace){return r4.fromWorkingColorSpace(aw.copy(this),t),e.r=aw.r,e.g=aw.g,e.b=aw.b,e}getStyle(e=rI){r4.fromWorkingColorSpace(aw.copy(this),e);let t=aw.r,n=aw.g,r=aw.b;return e!==rI?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(e,t,n){return this.getHSL(ay),this.setHSL(ay.h+e,ay.s+t,ay.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}
1lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){var n,r,i,a,o,s,l,u,c;this.getHSL(ay),e.getHSL(ab);let h=(n=ay.h,r=ab.h,(1-(i=t))*n+i*r),d=(a=ay.s,o=ab.s,(1-(s=t))*a+s*o),p=(l=ay.l,u=ab.l,(1-(c=t))*l+c*u);return this.setHSL(h,d,p),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let aw=new a_;a_.NAMES=av;let aM=0;class aE extends rF{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:aM++}),this.uuid=rW(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new a_(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(void 0===r){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}
vendor: 5,428 bytes, line 1
1if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),100!==this.blendEquation&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&
1(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(n.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(n.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(null!==t){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class aS extends aE{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new a_(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new iJ,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}let aT=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,i[e]=24,i[256|e]=24):(r[e]=31744,r[256|e]=64512,i[e]=13,i[256|e]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;(8388608&t)==0;)t<<=1,n-=8388608;t&=-8388609,n+=0x38800000,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=0x38000000+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=0x47800000,o[32]=0x80000000;for(let e=33;e<63;++e)o[e]=0x80000000+(e-32<<23);o[63]=0xc7800000;for(let e=1;e<64;++e)32!==e&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}(),aA={toHalfFloat:function(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=rG(e,-65504,65504),aT.floatView[0]=e;let t=aT.uint32View[0],n=t>>23&511;return aT.baseTable[n]+((8388607&t)>>aT.shiftTable[n])}},aC=new ih,aR=new rY;class aP{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=1015,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return r0("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;
vendor: 4,743 bytes, line 1
1for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)aR.fromBufferAttribute(this,t),aR.applyMatrix3(e),this.setXY(t,aR.x,aR.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)aC.fromBufferAttribute(this,t),aC.applyMatrix3(e),this.setXYZ(t,aC.x,aC.y,aC.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)aC.fromBufferAttribute(this,t),aC.applyMatrix4(e),this.setXYZ(t,aC.x,aC.y,aC.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)aC.fromBufferAttribute(this,t),aC.applyNormalMatrix(e),this.setXYZ(t,aC.x,aC.y,aC.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)aC.fromBufferAttribute(this,t),aC.transformDirection(e),this.setXYZ(t,aC.x,aC.y,aC.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=rV(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=rX(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=rV(t,this.array)),t}setX(e,t){return this.normalized&&(t=rX(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=rV(t,this.array)),t}setY(e,t){return this.normalized&&(t=rX(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=rV(t,this.array)),t}setZ(e,t){return this.normalized&&(t=rX(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=rV(t,this.array)),t}setW(e,t){return this.normalized&&(t=rX(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=rX(t,this.array),n=rX(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=rX(t,this.array),n=rX(n,this.array),r=rX(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=rX(t,this.array),n=rX(n,this.array),r=rX(r,this.array),i=rX(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),e}}class aI extends aP{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class aO extends aP{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class aL extends aP{constructor(e,t,n){super(new Float32Array(e),t,n)}}let aD=0,aN=new ij,aU=new aa,ak=new ih,aB=new im,aF=new im,az=new ih;class aH extends rF{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:aD++}),this.uuid=rW(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(rK(e)?aO:aI)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(void 0!==n){let t=new rZ().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return aN.makeRotationFromQuaternion(e),this.applyMatrix4(aN),this}rotateX(e){return aN.makeRotationX(e),this.applyMatrix4(aN),this}rotateY(e){return aN.makeRotationY(e),this.applyMatrix4(aN),this}rotateZ(e){return aN.makeRotationZ(e),this.applyMatrix4(aN),this}translate(e,t,n){return aN.makeTranslation(e,t,n),this.applyMatrix4(aN),this}scale(e,t,n){return aN.makeScale(e,t,n),this.applyMatrix4(aN),this}lookAt(e){return aU.lookAt(e),aU.updateMatrix(),this.applyMatrix4(aU.matrix
1),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ak).negate(),this.translate(ak.x,ak.y,ak.z),this}setFromPoints(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new aL(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new im);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ih(-1/0,-1/0,-1/0),new ih(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];aB.setFromBufferAttribute(n),this.morphTargetsRelative?(az.addVectors(this.boundingBox.min,aB.min),this.boundingBox.expandByPoint(az),az.addVectors(this.boundingBox.max,aB.max),this.boundingBox.expandByPoint(az)):(this.boundingBox.expandByPoint(aB.min),this.boundingBox.expandByPoint(aB.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 iL);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new ih,1/0);return}if(e){let n=this.boundingSphere.center;if(aB.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];aF.setFromBufferAttribute(n),this.morphTargetsRelative?(az.addVectors(aB.min,aF.min),aB.expandByPoint(az),az.addVectors(aB.max,aF.max),aB.expandByPoint(az)):(aB.expandByPoint(aF.min),aB.expandByPoint(aF.max))}aB.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)az.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(az));if(t)for(let i=0,a=t.length;i<a;i++){let a=t[i],o=this.morphTargetsRelative;for(let t=0,i=a.count;t<i;t++)az.fromBufferAttribute(a,t),o&&(ak.fromBufferAttribute(e,t),az.add(ak)),r=Math.max(r,n.distanceToSquared(az))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let n=t.position,r=t.normal,i=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new aP(new Float32Array(4*n.count),4));let a=this.getAttribute("tangent"),o=[],s=[];for(let e=0;e<n.count;e++)o[e]=new ih,s[e]=new ih;let l=new ih,u=new ih,c=new ih,h=new rY,d=new rY,p=new rY,f=new ih,m=new ih,g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(let t=0,r=g.length;t<r;++t){let r=g[t],a=r.start,v=r.count;for(let t=a,r=a+v;t<r;t+=3)!function(e,t,r){l.fromBufferAttribute(n,e),u.fromBufferAttribute(n,t),c.fromBufferAttribute(n,r),h.fromBufferAttribute(i,e),d.fromBufferAttribute(i,t),p.fromBufferAttribute(i,r),u.sub(l),c.sub(l),d.sub(h),p.sub(h);let a=1/(d.x*p.y-p.x*d.y);isFinite(a)&&(f.copy(u).multiplyScalar(p.y).addScaledVector(c,-d.y).multiplyScalar(a),m.copy(c).multiplyScalar(d.x).addScaledVector(u,-p.x).multiplyScalar(a),o[e].add(f),o[t].add(f),o[r].add(f),s[e].add(m),s[t].add(m),s[r].add(m))}(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new ih,y=new ih,b=new ih,x=new ih;function _(e){b.fromBufferAttribute(r,e),x.copy(b);let t=o[e];v.copy(t),v.sub(b.multiplyScalar(b.dot(t))).normalize(),y.crossVectors(x,t);let n=y.dot(s[e]);a.setXYZW(e,v.x,v.y,v.z,n<0?-1:1)}for(let t=0,n=g.length;t<n;++t){let n=g[t],r=n.start,i=n.count;for(let t=r,n=r+i;t<n;t+=3)_(e.getX(t+0)),_(e.getX(t+1)),_(e.getX(t+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new aP(new Float32Array(3*t.count),3),this.setAttribute("normal",n
vendor: 6,215 bytes, line 1
1);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let r=new ih,i=new ih,a=new ih,o=new ih,s=new ih,l=new ih,u=new ih,c=new ih;if(e)for(let h=0,d=e.count;h<d;h+=3){let d=e.getX(h+0),p=e.getX(h+1),f=e.getX(h+2);r.fromBufferAttribute(t,d),i.fromBufferAttribute(t,p),a.fromBufferAttribute(t,f),u.subVectors(a,i),c.subVectors(r,i),u.cross(c),o.fromBufferAttribute(n,d),s.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),o.add(u),s.add(u),l.add(u),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),u.subVectors(a,i),c.subVectors(r,i),u.cross(c),n.setXYZ(e+0,u.x,u.y,u.z),n.setXYZ(e+1,u.x,u.y,u.z),n.setXYZ(e+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)az.fromBufferAttribute(e,t),az.normalize(),e.setXYZ(t,az.x,az.y,az.z)}toNonIndexed(){function e(e,t){let n=e.array,r=e.itemSize,i=e.normalized,a=new n.constructor(t.length*r),o=0,s=0;for(let i=0,l=t.length;i<l;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)a[s++]=n[o++]}return new aP(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new aH,n=this.index.array,r=this.attributes;for(let i in r){let a=e(r[i],n);t.setAttribute(i,a)}let i=this.morphAttributes;for(let r in i){let a=[],o=i[r];for(let t=0,r=o.length;t<r;t++){let r=e(o[t],n);a.push(r)}t.morphAttributes[r]=a}t.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let e=0,n=a.length;e<n;e++){let n=a[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){let e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t<r;t++){let r=n[t];a.push(r.toJSON(e.data))}a.length>0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;null!==n&&this.setIndex(n.clone(t));let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());let s=e.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}let aj=new ij,aW=new iH,aG=new iL,aV=new ih,aX=new ih,aq=new ih,aY=new ih,aZ=new ih,a$=new ih,aK=new rY,aJ=new rY,aQ=new rY,a0=new ih,a1=new ih,a2=new ih,a3=new ih,a5=new ih;class a4 extends aa{constructor(e=new aH,t=new aS){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);let o=this.morphTargetInfluences;if(i&&o){a$.set(0,0,0);for(let n=0,r=i.length;n<r;n++){let r=o[n],s=i[n];0!==r&&(aZ.fromBufferAttribute(s,e),a?a$.addScaledVector(aZ,r):a$.addScaledVector(aZ.sub(t),r))}t.add(a$)}return t}raycast(e,t){let n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r)null===n.boundingSphere&&n.computeBoundingSphere(),aG.copy(n.boundingSphere),aG.applyMatrix4(i),aW.copy(e.ray).recast(e.near),!1===aG.containsPoint(aW.origin)&&(null===aW.intersectSphere(aG,aV)||aW.origin.distanceToSquared(aV)>(e.far-e.near)**2)||(aj.copy(i).invert(),aW.copy(e.ray).applyMatrix4(aj),(null===n.boundingBox||!1!==aW.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,aW))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,l=i.attributes.uv,u=i.attributes.uv1,c=i.attributes.normal,h=i.groups,d=i.drawRange;if(null!==o)if(Array.isArray(a))for(let i=0,s=h.length;i<s;i++){let s=h[i],p=a[s.materialIndex],f=Math.max(s.start,d.start),m=Math.min(o.count,Math.min(s.start+s.count,d.start+d.count));for(let i=f;i<m;i+=3){let a=o.getX(i);(r=a6(this,p,e,n,l,u,c,a,o.getX(i+1),o.getX(i+2)))&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{let i=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);for(let h=i;h<s;h+=3){let i=o.getX(h);(r=a6(this,a,e,n,l,u,c,i,o.getX(h+1),o.getX(h+2)))&&(r.faceIndex=Math.floor(h/3),t.pu
1sh(r))}}else if(void 0!==s)if(Array.isArray(a))for(let i=0,o=h.length;i<o;i++){let o=h[i],p=a[o.materialIndex],f=Math.max(o.start,d.start),m=Math.min(s.count,Math.min(o.start+o.count,d.start+d.count));for(let i=f;i<m;i+=3)(r=a6(this,p,e,n,l,u,c,i,i+1,i+2))&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}else{let i=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);for(let s=i;s<o;s+=3)(r=a6(this,a,e,n,l,u,c,s,s+1,s+2))&&(r.faceIndex=Math.floor(s/3),t.push(r))}}}function a6(e,t,n,r,i,a,o,s,l,u){e.getVertexPosition(s,aX),e.getVertexPosition(l,aq),e.getVertexPosition(u,aY);let c=function(e,t,n,r,i,a,o,s){if(null===(1===t.side?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,0===t.side,s)))return null;a5.copy(s),a5.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(a5);return l<n.near||l>n.far?null:{distance:l,point:a5.clone(),object:e}}(e,t,n,r,aX,aq,aY,a3);if(c){i&&(aK.fromBufferAttribute(i,s),aJ.fromBufferAttribute(i,l),aQ.fromBufferAttribute(i,u),c.uv=ag.getInterpolation(a3,aX,aq,aY,aK,aJ,aQ,new rY)),a&&(aK.fromBufferAttribute(a,s),aJ.fromBufferAttribute(a,l),aQ.fromBufferAttribute(a,u),c.uv1=ag.getInterpolation(a3,aX,aq,aY,aK,aJ,aQ,new rY)),o&&(a0.fromBufferAttribute(o,s),a1.fromBufferAttribute(o,l),a2.fromBufferAttribute(o,u),c.normal=ag.getInterpolation(a3,aX,aq,aY,a0,a1,a2,new ih),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));let e={a:s,b:l,c:u,normal:new ih,materialIndex:0};ag.getNormal(aX,aq,aY,e.normal),c.face=e}return c}class a8 extends aH{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i);let s=[],l=[],u=[],c=[],h=0,d=0;function p(e,t,n,r,i,a,p,f,m,g,v){let y=a/m,b=p/g,x=a/2,_=p/2,w=f/2,M=m+1,E=g+1,S=0,T=0,A=new ih;for(let a=0;a<E;a++){let o=a*b-_;for(let s=0;s<M;s++){let h=s*y-x;A[e]=h*r,A[t]=o*i,A[n]=w,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=f>0?1:-1,u.push(A.x,A.y,A.z),c.push(s/m),c.push(1-a/g),S+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){let n=h+t+M*e,r=h+t+M*(e+1),i=h+(t+1)+M*(e+1),a=h+(t+1)+M*e;s.push(n,r,a),s.push(r,i,a),T+=6}o.addGroup(d,T,v),d+=T,h+=S}p("z","y","x",-1,-1,n,t,e,a=Math.floor(a),i,0),p("z","y","x",1,-1,n,t,-e,a,i,1),p("x","z","y",1,1,e,n,t,r,a,2),p("x","z","y",1,-1,e,n,-t,r,a,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new aL(l,3)),this.setAttribute("normal",new aL(u,3)),this.setAttribute("uv",new aL(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new a8(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function a7(e){let t={};for(let n in e)for(let r in t[n]={},e[n]){let i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][r]=null):t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}return t}function a9(e){let t={};for(let n=0;n<e.length;n++){let r=a7(e[n]);for(let e in r)t[e]=r[e]}return t}function oe(e){let t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:r4.workingColorSpace}let ot={clone:a7};class on extends aE{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=a7(e.uniforms),this.uniformsGroups=function(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);for(let n in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){let r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class or extends aa{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ij,this.projectionMatrix=new ij,this.projectionMatrixInverse=new ij,this.coordinateSystem=2e3}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}let oi=new ih,oa=new rY,oo=new rY;class os extends or{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){let t=.5*this.getFilmHeight()/e;this.fov=2*rj*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*rH*this.fov);return .5*this.getFilmHeight()/e}
1getEffectiveFOV(){return 2*rj*Math.atan(Math.tan(.5*rH*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){oi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(oi.x,oi.y).multiplyScalar(-e/oi.z),oi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(oi.x,oi.y).multiplyScalar(-e/oi.z)}getViewSize(e,t){return this.getViewBounds(e,oa,oo),t.subVectors(oo,oa)}setViewOffset(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*rH*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}let o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class ol extends aa{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new os(-90,1,e,t);r.layers=this.layers,this.add(r);let i=new os(-90,1,e,t);i.layers=this.layers,this.add(i);let a=new os(-90,1,e,t);a.layers=this.layers,this.add(a);let o=new os(-90,1,e,t);o.layers=this.layers,this.add(o);let s=new os(-90,1,e,t);s.layers=this.layers,this.add(s);let l=new os(-90,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(2e3===e)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(2001===e)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,l,u]=this.children,c=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,a),e.setRenderTarget(n,2,r),e.render(t,o),e.setRenderTarget(n,3,r),e.render(t,s),e.setRenderTarget(n,4,r),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,r),e.render(t,u),e.setRenderTarget(c,h,d),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class ou extends ii{constructor(e,t,n,r,i,a,o,s,l,u){super(e=void 0!==e?e:[],t=void 0!==t?t:301,n,r,i,a,o,s,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class oc extends is{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1};this.texture=new ou([n,n,n,n,n,n],t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:1006}
1fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`
2
3				varying vec3 vWorldDirection;
4
5				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
6
7					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
8
9				}
10
11				void main() {
12
13					vWorldDirection = transformDirection( position, modelMatrix );
14
15					#include <begin_vertex>
16					#include <project_vertex>
17
18				}
19			`,fragmentShader:`
20
21				uniform sampler2D tEquirect;
22
23				varying vec3 vWorldDirection;
24
25				#include <common>
26
27				void main() {
28
29					vec3 direction = normalize( vWorldDirection );
30
31					vec2 sampleUV = equirectUv( direction );
32
33					gl_FragColor = texture2D( tEquirect, sampleUV );
34
35				}
36			`},r=new a8(5,5,5),i=new on({name:"CubemapFromEquirect",uniforms:a7(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new a4(r,i),o=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new ol(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,r){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}let oh=new ih,od=new ih,op=new rZ;class of{constructor(e=new ih(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){let r=oh.subVectors(n,t).cross(od.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let n=e.delta(oh),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;let i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||op.getNormalMatrix(e),r=this.coplanarPoint(oh).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}let om=new iL,og=new ih;class ov{constructor(e=new of,t=new of,n=new of,r=new of,i=new of,a=new of){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3){let n=this.planes,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],c=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],b=r[15];if(n[0].setComponents(s-i,h-l,m-d,b-g).normalize(),n[1].setComponents(s+i,h+l,m+d,b+g).normalize(),n[2].setComponents(s+a,h+u,m+p,b+v).normalize(),n[3].setComponents(s-a,h-u,m-p,b-v).normalize(),n[4].setComponents(s-o,h-c,m-f,b-y).normalize(),2e3===t)n[5].setComponents(s+o,h+c,m+f,b+y).normalize();else if(2001===t)n[5].setComponents(o,c,f,y).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),om.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),om.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(om)}intersectsSprite(e){return om.center.set(0,0,0),om.radius=.7071067811865476,om.applyM
36atrix4(e.matrixWorld),this.intersectsSphere(om)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let r=t[n];if(og.x=r.normal.x>0?e.max.x:e.min.x,og.y=r.normal.y>0?e.max.y:e.min.y,og.z=r.normal.z>0?e.max.z:e.min.z,0>r.distanceToPoint(og))return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}}function oy(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function ob(e){let t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))},update:function(n,r){if(n.isGLBufferAttribute){let e=t.get(n);(!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version});return}n.isInterleavedBufferAttribute&&(n=n.data);let i=t.get(n);if(void 0===i)t.set(n,function(t,n){let r,i=t.array,a=t.usage,o=i.byteLength,s=e.createBuffer();if(e.bindBuffer(n,s),e.bufferData(n,i,a),t.onUploadCallback(),i instanceof Float32Array)r=e.FLOAT;else if(i instanceof Uint16Array)r=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(i instanceof Int16Array)r=e.SHORT;else if(i instanceof Uint32Array)r=e.UNSIGNED_INT;else if(i instanceof Int32Array)r=e.INT;else if(i instanceof Int8Array)r=e.BYTE;else if(i instanceof Uint8Array)r=e.UNSIGNED_BYTE;else if(i instanceof Uint8ClampedArray)r=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);return{buffer:s,type:r,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version,size:o}}(n,r));else if(i.version<n.version){if(i.size!==n.array.byteLength)throw Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,n,r){let i=n.array,a=n._updateRange,o=n.updateRanges;if(e.bindBuffer(r,t),-1===a.count&&0===o.length&&e.bufferSubData(r,0,i),0!==o.length){for(let t=0,n=o.length;t<n;t++){let n=o[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}-1!==a.count&&(e.bufferSubData(r,a.offset*i.BYTES_PER_ELEMENT,i,a.offset,a.count),a.count=-1),n.onUploadCallback()}(i.buffer,n,r),i.version=n.version}}}}class ox extends aH{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};let i=e/2,a=t/2,o=Math.floor(n),s=Math.floor(r),l=o+1,u=s+1,c=e/o,h=t/s,d=[],p=[],f=[],m=[];for(let e=0;e<u;e++){let t=e*h-a;for(let n=0;n<l;n++){let r=n*c-i;p.push(r,-t,0),f.push(0,0,1),m.push(n/o),m.push(1-e/s)}}for(let e=0;e<s;e++)for(let t=0;t<o;t++){let n=t+l*e,r=t+l*(e+1),i=t+1+l*(e+1),a=t+1+l*e;d.push(n,r,a),d.push(r,i,a)}this.setIndex(d),this.setAttribute("position",new aL(p,3)),this.setAttribute("normal",new aL(f,3)),this.setAttribute("uv",new aL(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ox(e.width,e.height,e.widthSegments,e.heightSegments)}}let o_={alphahash_fragment:"#ifdef USE_ALPHAHASH\n	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n	const float ALPHA_HASH_SCALE = 0.05;\n	float hash2D( vec2 value ) {\n		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n	}\n	float hash3D( vec3 value ) {\n		return hash2D( vec2( hash2D( value.xy ), value.z ) );\n	}\n	float getAlphaHashThreshold( vec3 position ) {\n		float maxDeriv = max(\n			length( dFdx( position.xyz ) ),\n			length( dFdy( position.xyz ) )\n		);\n		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n		vec2 pixScales = vec2(\n			exp2( floor( log2( pixScale ) ) ),\n			exp2( ceil( log2( pixScale ) ) )\n		);\n		vec2 alpha = vec2(\n			hash3D( floor( pixScales.x * position.xyz ) ),\n			hash3D( floor( pixScales.y * position.xyz ) )\n		);\n		float lerpFactor = fract( log2( pixScale ) );\n		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n		float a = min( lerpFactor, 1.0 - lerpFactor );\n		vec3 cases = vec3(\n			x * x / ( 2.0 * a * ( 1.0 - a ) ),\n			( x - 0.5 * a ) / ( 1.0 - a ),\n			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n		);\n		float threshold = ( x < ( 1.0 - a ) )\n			? ( ( x < a ) ? cases.x : cases.y )\n			: cases.z;\n		return clamp( threshold , 1.0e-6, 1.0 );\n	}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n	uniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n	#ifdef ALPHA_TO_COVERAGE\n	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n	if ( diffuseColor.a == 0.0 ) discard;\n	#else\n	if ( diffuseColor.a < alphaTest ) discard;\n	#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n	uniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n	reflectedLight.indirectDiffuse *= ambientOcclusion;\n	#if defined( USE_CLEARCOAT ) \n		clearcoatSpecularIndirect *= ambientOcclusion;\n	#endif\n	#if defined( USE_SHEEN ) \n		sheenSpecularIndirect *= ambientOcclusion;\n	#endif\n	#if defined( USE_ENVMAP ) && defined( STANDARD )\n		float dotNV = saturate( dot
36( geometryNormal, geometryViewDir ) );\n		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n	#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n	uniform sampler2D aoMap;\n	uniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n	attribute float batchId;\n	uniform highp sampler2D batchingTexture;\n	mat4 getBatchingMatrix( const in float i ) {\n		int size = textureSize( batchingTexture, 0 ).x;\n		int j = int( i ) * 4;\n		int x = j % size;\n		int y = j / size;\n		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n		return mat4( v1, v2, v3, v4 );\n	}\n#endif\n#ifdef USE_BATCHING_COLOR\n	uniform sampler2D batchingColorTexture;\n	vec3 getBatchingColor( const in float i ) {\n		int size = textureSize( batchingColorTexture, 0 ).x;\n		int j = int( i );\n		int x = j % size;\n		int y = j / size;\n		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n	}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n	mat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n	vPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n	vec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n	return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n	return 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	vec3 halfDir = normalize( lightDir + viewDir );\n	float dotNH = saturate( dot( normal, halfDir ) );\n	float dotVH = saturate( dot( viewDir, halfDir ) );\n	vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n	float G = G_BlinnPhong_Implicit( );\n	float D = D_BlinnPhong( shininess, dotNH );\n	return F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n	const mat3 XYZ_TO_REC709 = mat3(\n		 3.2404542, -0.9692660,  0.0556434,\n		-1.5371385,  1.8760108, -0.2040259,\n		-0.4985314,  0.0415560,  1.0572252\n	);\n	vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n		vec3 sqrtF0 = sqrt( fresnel0 );\n		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n	}\n	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n	}\n	float IorToFresnel0( float transmittedIor, float incidentIor ) {\n		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n	}\n	vec3 evalSensitivity( float OPD, vec3 shift ) {\n		float phase = 2.0 * PI * OPD * 1.0e-9;\n		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n		xyz /= 1.0685e-7;\n		vec3 rgb = XYZ_TO_REC709 * xyz;\n		return rgb;\n	}\n	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n		vec3 I;\n		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n		float cosTheta2Sq = 1.0 - sinTheta2Sq;\n		if ( cosTheta2Sq < 0.0 ) {\n			return vec3( 1.0 );\n		}\n		float cosTheta2 = sqrt( cosTheta2Sq );\n		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
36\n		float T121 = 1.0 - R12;\n		float phi12 = 0.0;\n		if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n		float phi21 = PI - phi12;\n		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n		vec3 phi23 = vec3( 0.0 );\n		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n		vec3 phi = vec3( phi21 ) + phi23;\n		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n		vec3 r123 = sqrt( R123 );\n		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n		vec3 C0 = R12 + Rs;\n		I = C0;\n		vec3 Cm = Rs - T121;\n		for ( int m = 1; m <= 2; ++ m ) {\n			Cm *= r123;\n			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n			I += Cm * Sm;\n		}\n		return max( I, vec3( 0.0 ) );\n	}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n	uniform sampler2D bumpMap;\n	uniform float bumpScale;\n	vec2 dHdxy_fwd() {\n		vec2 dSTdx = dFdx( vBumpMapUv );\n		vec2 dSTdy = dFdy( vBumpMapUv );\n		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n		return vec2( dBx, dBy );\n	}\n	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n		vec3 vN = surf_norm;\n		vec3 R1 = cross( vSigmaY, vN );\n		vec3 R2 = cross( vN, vSigmaX );\n		float fDet = dot( vSigmaX, R1 ) * faceDirection;\n		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n		return normalize( abs( fDet ) * surf_norm - vGrad );\n	}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n	vec4 plane;\n	#ifdef ALPHA_TO_COVERAGE\n		float distanceToPlane, distanceGradient;\n		float clipOpacity = 1.0;\n		#pragma unroll_loop_start\n		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n			plane = clippingPlanes[ i ];\n			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n			distanceGradient = fwidth( distanceToPlane ) / 2.0;\n			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n			if ( clipOpacity == 0.0 ) discard;\n		}\n		#pragma unroll_loop_end\n		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n			float unionClipOpacity = 1.0;\n			#pragma unroll_loop_start\n			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n				plane = clippingPlanes[ i ];\n				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n				distanceGradient = fwidth( distanceToPlane ) / 2.0;\n				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n			}\n			#pragma unroll_loop_end\n			clipOpacity *= 1.0 - unionClipOpacity;\n		#endif\n		diffuseColor.a *= clipOpacity;\n		if ( diffuseColor.a == 0.0 ) discard;\n	#else\n		#pragma unroll_loop_start\n		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n			plane = clippingPlanes[ i ];\n			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n		}\n		#pragma unroll_loop_end\n		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n			bool clipped = true;\n			#pragma unroll_loop_start\n			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n				plane = clippingPlanes[ i ];\n				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n			}\n			#pragma unroll_loop_end\n			if ( clipped ) discard;\n		#endif\n	#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n	varying vec3 vClipPosition;\n	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n	varying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n	vClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n	diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n	diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n	varying vec4 vColor;\n#elif defined( USE_COLOR )\n	varying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n	varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n	varying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n	vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n	vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n	vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n	vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n	vec3 batchingColor = getBatchingColor( batchId );\n	vColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n	const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n	return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n	float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n	float precisionSafeLength( vec3 v ) {\n		float maxComponent = max3( abs( v ) );\n		return length( v / maxComponent ) * maxComponent;\n	}\n#endif\nstruct IncidentLight {\n	vec3 color;\n	vec3 direction;\n	bool visible;\n};\nstruct ReflectedLight {\n	vec3 directDiffuse;\n	vec3 directSpecular;\n	vec3 indirectDiffuse;\n	vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n	varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n	mat3 tmp;\n	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n	return tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n	const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n	return dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n	return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n	return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n	return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n	#define cubeUV_minMipLevel 4.0\n	#define cubeUV_minTileSize 16.0\n	float getFace( vec3 direction ) {\n		vec3 absDirection = abs( direction );\n		float face = - 1.0;\n		if ( absDirection.x > absDirection.z ) {\n			if ( absDirection.x > absDirection.y )\n				face = direction.x > 0.0 ? 0.0 : 3.0;\n			else\n				face = direction.y > 0.0 ? 1.0 : 4.0;\n		} else {\n			if ( absDirection.z > absDirection.y )\n				face = direction.z > 0.0 ? 2.0 : 5.0;\n			else\n				face = direction.y > 0.0 ? 1.0 : 4.0;\n		}\n		return face;\n	}\n	vec2 getUV( vec3 direction, float face ) {\n		vec2 uv;\n		if ( face == 0.0 ) {\n			uv = vec2( direction.z, direction.y ) / abs( direction.x );\n		} else if ( face == 1.0 ) {\n			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n		} else if ( face == 2.0 ) {\n			uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n		} else if ( face == 3.0 ) {\n			uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n		} else if ( face == 4.0 ) {\n			uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n		} else {\n			uv = vec2( direction.x, direction.y ) / abs( direction.z );\n		}\n		return 0.5 * ( uv + 1.0 );\n	}\n	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n		float face = getFace( direction );\n		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n		mipInt = max( mipInt, cubeUV_minMipLevel );\n		float faceSize = exp2( mipInt );\n		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n		if ( face > 2.0 ) {\n			uv.y += faceSize;\n			face -= 3.0;\n		}\n		uv.x += face * faceSize;\n		uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n		uv.x *= CUBEUV_TEXEL_WIDTH;\n		uv.y *= CUBEUV_TEXEL_HEIGHT;\n		#ifdef texture2DGradEXT\n			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n		#else\n			return texture2D( envMap, uv ).rgb;\n		#endif\n	}\n	#define cubeUV_r0 1.0\n	#define cubeUV_m0 - 2.0\n	#define cubeUV_r1 0.8\n	#define cubeUV_m1 - 1.0\n	#define cubeUV_r4 0.4\n	#define cubeUV_m4 2.0\n	#define cubeUV_r5 0.305\n	#define cubeUV_m5 3.0\n	#define cubeUV_r6 0.21\n	#define cubeUV_m6 4.0\n	float roughnessToMip( float roughness ) {\n		float mip = 0.0;\n		if ( roughness >= cubeUV_r1 ) {\n			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n		} else if ( roughness >= cubeUV_r4 ) {\n			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n		} else if ( roughness >= cubeUV_r5 ) {\n			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n		} else if ( roughness >= cubeUV_r6 ) {\n			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n		} else {\n			mip = - 2.0 * log2( 1.16 * roughness );		}\n		return mip;\n	}\n	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n		float mipF = fract( mip );\n		float mipInt = floor( mip );\n		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n		if ( mipF == 0.0 ) {\n			return vec4( color0, 1.0 );\n		} else {\n			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n			return vec4( mix( color0, color1, mipF ), 1.0 );\n		}\n	}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n	vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n	mat3 bm = mat3( batchingMatrix );
36\n	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n	transformedNormal = bm * transformedNormal;\n	#ifdef USE_TANGENT\n		transformedTangent = bm * transformedTangent;\n	#endif\n#endif\n#ifdef USE_INSTANCING\n	mat3 im = mat3( instanceMatrix );\n	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n	transformedNormal = im * transformedNormal;\n	#ifdef USE_TANGENT\n		transformedTangent = im * transformedTangent;\n	#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n	transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n	#ifdef FLIP_SIDED\n		transformedTangent = - transformedTangent;\n	#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n	uniform sampler2D displacementMap;\n	uniform float displacementScale;\n	uniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n	totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n	uniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n	vec3( 0.8224621, 0.177538, 0.0 ),\n	vec3( 0.0331941, 0.9668058, 0.0 ),\n	vec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n	vec3( 1.2249401, - 0.2249404, 0.0 ),\n	vec3( - 0.0420569, 1.0420571, 0.0 ),\n	vec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n	return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n	return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n	return value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n	return value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n	return sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n	#ifdef ENV_WORLDPOS\n		vec3 cameraToFrag;\n		if ( isOrthographic ) {\n			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n		} else {\n			cameraToFrag = normalize( vWorldPosition - cameraPosition );\n		}\n		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n		#ifdef ENVMAP_MODE_REFLECTION\n			vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n		#else\n			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n		#endif\n	#else\n		vec3 reflectVec = vReflect;\n	#endif\n	#ifdef ENVMAP_TYPE_CUBE\n		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n	#else\n		vec4 envColor = vec4( 0.0 );\n	#endif\n	#ifdef ENVMAP_BLENDING_MULTIPLY\n		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n	#elif defined( ENVMAP_BLENDING_MIX )\n		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n	#elif defined( ENVMAP_BLENDING_ADD )\n		outgoingLight += envColor.xyz * specularStrength * reflectivity;\n	#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n	uniform float envMapIntensity;\n	uniform float flipEnvMap;\n	uniform mat3 envMapRotation;\n	#ifdef ENVMAP_TYPE_CUBE\n		uniform samplerCube envMap;\n	#else\n		uniform sampler2D envMap;\n	#endif\n	\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n	uniform float reflectivity;\n	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n		#define ENV_WORLDPOS\n	#endif\n	#ifdef ENV_WORLDPOS\n		varying vec3 vWorldPosition;\n		uniform float refractionRatio;\n	#else\n		varying vec3 vReflect;\n	#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n		#define ENV_WORLDPOS\n	#endif\n	#ifdef ENV_WORLDPOS\n		\n		varying vec3 vWorldPosition;\n	#else\n		varying vec3 vReflect;\n		uniform float refractionRatio;\n	#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n	vec3 getIBLIrradiance( const in vec3 normal ) {\n		#ifdef ENVMAP_TYPE_CUBE_UV\n			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n			return PI * envMapColor.rgb * envMapIntensity;\n		#else\n			return vec3( 0.0 );\n		#endif\n	}\n	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n		#ifdef ENVMAP_TYPE_CUBE_UV\n			vec3 reflectVec = reflect( - viewDir, normal );\n			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n			return envMapColor.rgb * envMapIntensity;\n		#else\n			return vec3( 0.0 );\n		#endif\n	}\n	#ifdef USE_ANISOTROPY\n		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n			#ifdef ENVMAP_TYPE_CUBE_UV\n				vec3 bentNormal = cross( bitangent, viewDir );\n				bentNormal = normalize( cross( bentNormal, bitangent ) );\n				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n				return getIBLRadiance( viewDir, bentNormal, roughness );\n			#else\n				return vec3( 0.0 );\n			#endif\n		}\n	#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n	#ifdef ENV_WORLDPOS\n		vWorldPosition = worldPosition.xyz;\n	#else\n		vec3 cameraToVertex;\n		if ( isOrthographic ) {\n			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n		}
36 else {\n			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n		}\n		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n		#ifdef ENVMAP_MODE_REFLECTION\n			vReflect = reflect( cameraToVertex, worldNormal );\n		#else\n			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n		#endif\n	#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n	vFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n	varying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n	#ifdef FOG_EXP2\n		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n	#else\n		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n	#endif\n	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n	uniform vec3 fogColor;\n	varying float vFogDepth;\n	#ifdef FOG_EXP2\n		uniform float fogDensity;\n	#else\n		uniform float fogNear;\n		uniform float fogFar;\n	#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n	uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n	float dotNL = dot( normal, lightDirection );\n	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n	#ifdef USE_GRADIENTMAP\n		return vec3( texture2D( gradientMap, coord ).r );\n	#else\n		vec2 fw = fwidth( coord ) * 0.5;\n		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n	#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n	uniform sampler2D lightMap;\n	uniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n	vec3 diffuseColor;\n	float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n	vec3 irradiance = dotNL * directLight.color;\n	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct				RE_Direct_Lambert\n#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n	uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n	float x = normal.x, y = normal.y, z = normal.z;\n	vec3 result = shCoefficients[ 0 ] * 0.886227;\n	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n	return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n	return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n	vec3 irradiance = ambientLightColor;\n	return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n	if ( cutoffDistance > 0.0 ) {\n		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n	}\n	return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n	return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n	struct DirectionalLight {\n		vec3 direction;\n		vec3 color;\n	};\n	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n		light.color = directionalLight.color;\n		light.direction = directionalLight.direction;\n		light.visible = true;\n	}\n#endif\n#if NUM_POINT_LIGHTS > 0\n	struct PointLight {\n		vec3 position;\n		vec3 color;\n		float distance;\n		float decay;\n	};\n	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n		vec3 lVector = pointLight.position - geometryPosition;\n		light.direction = normalize( lVector );\n		float lightDistance = length( lVector );\n		light.color = pointLight.color;\n		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n		light.visible = ( light.color != vec3( 0.0 ) );\n	}
36\n#endif\n#if NUM_SPOT_LIGHTS > 0\n	struct SpotLight {\n		vec3 position;\n		vec3 direction;\n		vec3 color;\n		float distance;\n		float decay;\n		float coneCos;\n		float penumbraCos;\n	};\n	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n		vec3 lVector = spotLight.position - geometryPosition;\n		light.direction = normalize( lVector );\n		float angleCos = dot( light.direction, spotLight.direction );\n		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n		if ( spotAttenuation > 0.0 ) {\n			float lightDistance = length( lVector );\n			light.color = spotLight.color * spotAttenuation;\n			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n			light.visible = ( light.color != vec3( 0.0 ) );\n		} else {\n			light.color = vec3( 0.0 );\n			light.visible = false;\n		}\n	}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n	struct RectAreaLight {\n		vec3 color;\n		vec3 position;\n		vec3 halfWidth;\n		vec3 halfHeight;\n	};\n	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;\n	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n	struct HemisphereLight {\n		vec3 direction;\n		vec3 skyColor;\n		vec3 groundColor;\n	};\n	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n		float dotNL = dot( normal, hemiLight.direction );\n		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n		return irradiance;\n	}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n	vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct				RE_Direct_Toon\n#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n	vec3 diffuseColor;\n	vec3 specularColor;\n	float specularShininess;\n	float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n	vec3 irradiance = dotNL * directLight.color;\n	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct				RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n	material.ior = ior;\n	#ifdef USE_SPECULAR\n		float specularIntensityFactor = specularIntensity;\n		vec3 specularColorFactor = specularColor;\n		#ifdef USE_SPECULAR_COLORMAP\n			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n		#endif\n		#ifdef USE_SPECULAR_INTENSITYMAP\n			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n		#endif\n		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n	#else\n		float specularIntensityFactor = 1.0;\n		vec3 specularColorFactor = vec3( 1.0 );\n		material.specularF90 = 1.0;\n	#endif\n	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n	material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n	material.clearcoat = clearcoat;
36\n	material.clearcoatRoughness = clearcoatRoughness;\n	material.clearcoatF0 = vec3( 0.04 );\n	material.clearcoatF90 = 1.0;\n	#ifdef USE_CLEARCOATMAP\n		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n	#endif\n	#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n	#endif\n	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n	material.clearcoatRoughness += geometryRoughness;\n	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n	material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n	material.iridescence = iridescence;\n	material.iridescenceIOR = iridescenceIOR;\n	#ifdef USE_IRIDESCENCEMAP\n		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n	#endif\n	#ifdef USE_IRIDESCENCE_THICKNESSMAP\n		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n	#else\n		material.iridescenceThickness = iridescenceThicknessMaximum;\n	#endif\n#endif\n#ifdef USE_SHEEN\n	material.sheenColor = sheenColor;\n	#ifdef USE_SHEEN_COLORMAP\n		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n	#endif\n	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n	#ifdef USE_SHEEN_ROUGHNESSMAP\n		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n	#endif\n#endif\n#ifdef USE_ANISOTROPY\n	#ifdef USE_ANISOTROPYMAP\n		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n	#else\n		vec2 anisotropyV = anisotropyVector;\n	#endif\n	material.anisotropy = length( anisotropyV );\n	if( material.anisotropy == 0.0 ) {\n		anisotropyV = vec2( 1.0, 0.0 );\n	} else {\n		anisotropyV /= material.anisotropy;\n		material.anisotropy = saturate( material.anisotropy );\n	}\n	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n	vec3 diffuseColor;\n	float roughness;\n	vec3 specularColor;\n	float specularF90;\n	float dispersion;\n	#ifdef USE_CLEARCOAT\n		float clearcoat;\n		float clearcoatRoughness;\n		vec3 clearcoatF0;\n		float clearcoatF90;\n	#endif\n	#ifdef USE_IRIDESCENCE\n		float iridescence;\n		float iridescenceIOR;\n		float iridescenceThickness;\n		vec3 iridescenceFresnel;\n		vec3 iridescenceF0;\n	#endif\n	#ifdef USE_SHEEN\n		vec3 sheenColor;\n		float sheenRoughness;\n	#endif\n	#ifdef IOR\n		float ior;\n	#endif\n	#ifdef USE_TRANSMISSION\n		float transmission;\n		float transmissionAlpha;\n		float thickness;\n		float attenuationDistance;\n		vec3 attenuationColor;\n	#endif\n	#ifdef USE_ANISOTROPY\n		float anisotropy;\n		float alphaT;\n		vec3 anisotropyT;\n		vec3 anisotropyB;\n	#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n    float x2 = x * x;\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n	float a2 = pow2( alpha );\n	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n	return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n	float a2 = pow2( alpha );\n	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n	return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n		float gv = dotNL * length( vec3( alphaT * dotTV, alph
36aB * dotBV, dotNV ) );\n		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n		float v = 0.5 / ( gv + gl );\n		return saturate(v);\n	}\n	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n		float a2 = alphaT * alphaB;\n		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n		highp float v2 = dot( v, v );\n		float w2 = a2 / v2;\n		return RECIPROCAL_PI * a2 * pow2 ( w2 );\n	}\n#endif\n#ifdef USE_CLEARCOAT\n	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n		vec3 f0 = material.clearcoatF0;\n		float f90 = material.clearcoatF90;\n		float roughness = material.clearcoatRoughness;\n		float alpha = pow2( roughness );\n		vec3 halfDir = normalize( lightDir + viewDir );\n		float dotNL = saturate( dot( normal, lightDir ) );\n		float dotNV = saturate( dot( normal, viewDir ) );\n		float dotNH = saturate( dot( normal, halfDir ) );\n		float dotVH = saturate( dot( viewDir, halfDir ) );\n		vec3 F = F_Schlick( f0, f90, dotVH );\n		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n		float D = D_GGX( alpha, dotNH );\n		return F * ( V * D );\n	}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n	vec3 f0 = material.specularColor;\n	float f90 = material.specularF90;\n	float roughness = material.roughness;\n	float alpha = pow2( roughness );\n	vec3 halfDir = normalize( lightDir + viewDir );\n	float dotNL = saturate( dot( normal, lightDir ) );\n	float dotNV = saturate( dot( normal, viewDir ) );\n	float dotNH = saturate( dot( normal, halfDir ) );\n	float dotVH = saturate( dot( viewDir, halfDir ) );\n	vec3 F = F_Schlick( f0, f90, dotVH );\n	#ifdef USE_IRIDESCENCE\n		F = mix( F, material.iridescenceFresnel, material.iridescence );\n	#endif\n	#ifdef USE_ANISOTROPY\n		float dotTL = dot( material.anisotropyT, lightDir );\n		float dotTV = dot( material.anisotropyT, viewDir );\n		float dotTH = dot( material.anisotropyT, halfDir );\n		float dotBL = dot( material.anisotropyB, lightDir );\n		float dotBV = dot( material.anisotropyB, viewDir );\n		float dotBH = dot( material.anisotropyB, halfDir );\n		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n	#else\n		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n		float D = D_GGX( alpha, dotNH );\n	#endif\n	return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n	const float LUT_SIZE = 64.0;\n	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n	const float LUT_BIAS = 0.5 / LUT_SIZE;\n	float dotNV = saturate( dot( N, V ) );\n	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n	uv = uv * LUT_SCALE + LUT_BIAS;\n	return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n	float l = length( f );\n	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n	float x = dot( v1, v2 );\n	float y = abs( x );\n	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n	float b = 3.4175940 + ( 4.1616724 + y ) * y;\n	float v = a / b;\n	float theta_sintheta = ( x >
36 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n	return 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	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n	vec3 lightNormal = cross( v1, v2 );\n	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n	vec3 T1, T2;\n	T1 = normalize( V - N * dot( V, N ) );\n	T2 = - cross( N, T1 );\n	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n	vec3 coords[ 4 ];\n	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n	coords[ 0 ] = normalize( coords[ 0 ] );\n	coords[ 1 ] = normalize( coords[ 1 ] );\n	coords[ 2 ] = normalize( coords[ 2 ] );\n	coords[ 3 ] = normalize( coords[ 3 ] );\n	vec3 vectorFormFactor = vec3( 0.0 );\n	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n	return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n	float alpha = pow2( roughness );\n	float invAlpha = 1.0 / alpha;\n	float cos2h = dotNH * dotNH;\n	float sin2h = max( 1.0 - cos2h, 0.0078125 );\n	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n	return 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	vec3 halfDir = normalize( lightDir + viewDir );\n	float dotNL = saturate( dot( normal, lightDir ) );\n	float dotNV = saturate( dot( normal, viewDir ) );\n	float dotNH = saturate( dot( normal, halfDir ) );\n	float D = D_Charlie( sheenRoughness, dotNH );\n	float V = V_Neubelt( dotNV, dotNL );\n	return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n	float dotNV = saturate( dot( normal, viewDir ) );\n	float r2 = roughness * roughness;\n	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n	return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n	float dotNV = saturate( dot( normal, viewDir ) );\n	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n	vec4 r = roughness * c0 + c1;\n	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n	return 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	vec2 fab = DFGApprox( normal, viewDir, roughness );\n	return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n	vec2 fab = DFGApprox( normal, viewDir, roughness );
36\n	#ifdef USE_IRIDESCENCE\n		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n	#else\n		vec3 Fr = specularColor;\n	#endif\n	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n	float Ess = fab.x + fab.y;\n	float Ems = 1.0 - Ess;\n	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n	singleScatter += FssEss;\n	multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n		vec3 normal = geometryNormal;\n		vec3 viewDir = geometryViewDir;\n		vec3 position = geometryPosition;\n		vec3 lightPos = rectAreaLight.position;\n		vec3 halfWidth = rectAreaLight.halfWidth;\n		vec3 halfHeight = rectAreaLight.halfHeight;\n		vec3 lightColor = rectAreaLight.color;\n		float roughness = material.roughness;\n		vec3 rectCoords[ 4 ];\n		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n		vec2 uv = LTC_Uv( normal, viewDir, roughness );\n		vec4 t1 = texture2D( ltc_1, uv );\n		vec4 t2 = texture2D( ltc_2, uv );\n		mat3 mInv = mat3(\n			vec3( t1.x, 0, t1.y ),\n			vec3(    0, 1,    0 ),\n			vec3( t1.z, 0, t1.w )\n		);\n		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n	}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n	vec3 irradiance = dotNL * directLight.color;\n	#ifdef USE_CLEARCOAT\n		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n		vec3 ccIrradiance = dotNLcc * directLight.color;\n		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n	#endif\n	#ifdef USE_SHEEN\n		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n	#endif\n	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n	#ifdef USE_CLEARCOAT\n		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n	#endif\n	#ifdef USE_SHEEN\n		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n	#endif\n	vec3 singleScattering = vec3( 0.0 );\n	vec3 multiScattering = vec3( 0.0 );\n	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
36\n	#ifdef USE_IRIDESCENCE\n		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n	#else\n		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n	#endif\n	vec3 totalScattering = singleScattering + multiScattering;\n	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n	reflectedLight.indirectSpecular += radiance * singleScattering;\n	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct				RE_Direct_Physical\n#define RE_Direct_RectArea		RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular		RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n	geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n	float dotNVi = saturate( dot( normal, geometryViewDir ) );\n	if ( material.iridescenceThickness == 0.0 ) {\n		material.iridescence = 0.0;\n	} else {\n		material.iridescence = saturate( material.iridescence );\n	}\n	if ( material.iridescence > 0.0 ) {\n		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n	}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n	PointLight pointLight;\n	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n	PointLightShadow pointLightShadow;\n	#endif\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n		pointLight = pointLights[ i ];\n		getPointLightInfo( pointLight, geometryPosition, directLight );\n		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n		pointLightShadow = pointLightShadows[ i ];\n		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n		#endif\n		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n	}\n	#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n	SpotLight spotLight;\n	vec4 spotColor;\n	vec3 spotLightCoord;\n	bool inSpotLightMap;\n	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n	SpotLightShadow spotLightShadow;\n	#endif\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n		spotLight = spotLights[ i ];\n		getSpotLightInfo( spotLight, geometryPosition, directLight );\n		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n		#else\n		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n		#endif\n		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n		#endif\n		#undef SPOT_LIGHT_MAP_INDEX\n		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_L
36IGHT_SHADOWS )\n		spotLightShadow = spotLightShadows[ i ];\n		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n		#endif\n		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n	}\n	#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n	DirectionalLight directionalLight;\n	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n	DirectionalLightShadow directionalLightShadow;\n	#endif\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n		directionalLight = directionalLights[ i ];\n		getDirectionalLightInfo( directionalLight, directLight );\n		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n		directionalLightShadow = directionalLightShadows[ i ];\n		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n		#endif\n		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n	}\n	#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n	RectAreaLight rectAreaLight;\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n		rectAreaLight = rectAreaLights[ i ];\n		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n	}\n	#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n	vec3 iblIrradiance = vec3( 0.0 );\n	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n	#if defined( USE_LIGHT_PROBES )\n		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n	#endif\n	#if ( NUM_HEMI_LIGHTS > 0 )\n		#pragma unroll_loop_start\n		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n		}\n		#pragma unroll_loop_end\n	#endif\n#endif\n#if defined( RE_IndirectSpecular )\n	vec3 radiance = vec3( 0.0 );\n	vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n	#ifdef USE_LIGHTMAP\n		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n		irradiance += lightMapIrradiance;\n	#endif\n	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n		iblIrradiance += getIBLIrradiance( geometryNormal );\n	#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n	#ifdef USE_ANISOTROPY\n		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n	#else\n		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n	#endif\n	#ifdef USE_CLEARCOAT\n		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n	#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n	uniform float logDepthBufFC;\n	varying float vFragDepth;\n	varying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n	varying float vFragDepth;\n	varying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n	vFragDepth = 1.0 + gl_Position.w;\n	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n	vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n	#ifdef DECODE_VIDEO_TEXTURE\n		sampledDiffuseColor = 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	\n	#endif\n	diffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n	uniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n	#if defined( USE_POINTS_UV )\n		vec2 uv = vUv;\n	#else\n		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n	#endif\n#endif\n#ifdef USE_MAP\n	diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n	diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n	varying vec2 vUv;\n#else\n	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n		uniform mat3 uvTransform;\n	#endif\n#endif\n#ifdef USE_MAP\n	uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n	uniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n	metalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n	uniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n	float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n	}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n	vColor *= morphTargetBaseInfluence;\n	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n		#if defined( USE_COLOR_ALPHA )\n			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n		#elif defined( USE_COLOR )\n			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n		#endif\n	}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n	objectNormal *= morphTargetBaseInfluence;\n	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n	}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n	#ifndef USE_INSTANCING_MORPH\n		uniform float morphTargetBaseInfluence;\n		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n	#endif\n	uniform sampler2DArray morphTargetsTexture;\n	uniform ivec2 morphTargetsTextureSize;\n	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n		int y = texelIndex / morphTargetsTextureSize.x;\n		int x = texelIndex - y * morphTargetsTextureSize.x;\n		ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n		return texelFetch( morphTargetsTexture, morphUV, 0 );\n	}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n	transformed *= morphTargetBaseInfluence;\n	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n	}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n	vec3 fdx = dFdx( vViewPosition );\n	vec3 fdy = dFdy( vViewPosition );\n	vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n	vec3 normal = normalize( vNormal );\n	#ifdef DOUBLE_SIDED\n		normal *= faceDirection;\n	#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n	#ifdef USE_TANGENT\n		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n	#else\n		mat3 tbn = getTangentFrame( - vViewPosition, normal,\n		#if defined( USE_NORMALMAP )\n			vNormalMapUv\n		#elif defined( USE_CLEARCOAT_NORMALMAP )\n			vClearcoatNormalMapUv\n		#else\n			vUv\n		#endif\n		);\n	#endif\n	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n		tbn[0] *= faceDirection;\n		tbn[1] *= faceDirection;\n	#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n	#ifdef USE_TANGENT\n		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n	#else\n		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n	#endif\n	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n		tbn2[0] *= faceDirection;\n		tbn2[1] *= faceDirection;\n	#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n	#ifdef FLIP_SIDED\n		normal = - normal;\n	#endif\n	#ifdef DOUBLE_SIDED\n		normal = normal * faceDirection;\n	#endif\n	normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n	mapN.xy *= normalScale;\n	normal = normalize( tbn * mapN );
36\n#elif defined( USE_BUMPMAP )\n	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n	varying vec3 vNormal;\n	#ifdef USE_TANGENT\n		varying vec3 vTangent;\n		varying vec3 vBitangent;\n	#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n	varying vec3 vNormal;\n	#ifdef USE_TANGENT\n		varying vec3 vTangent;\n		varying vec3 vBitangent;\n	#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n	vNormal = normalize( transformedNormal );\n	#ifdef USE_TANGENT\n		vTangent = normalize( transformedTangent );\n		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n	#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n	uniform sampler2D normalMap;\n	uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n	uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n		vec3 q0 = dFdx( eye_pos.xyz );\n		vec3 q1 = dFdy( eye_pos.xyz );\n		vec2 st0 = dFdx( uv.st );\n		vec2 st1 = dFdy( uv.st );\n		vec3 N = surf_norm;\n		vec3 q1perp = cross( q1, N );\n		vec3 q0perp = cross( N, q0 );\n		vec3 T = q1perp * st0.x + q0perp * st1.x;\n		vec3 B = q1perp * st0.y + q0perp * st1.y;\n		float det = max( dot( T, T ), dot( B, B ) );\n		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n		return mat3( T * scale, B * scale, N );\n	}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n	vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n	clearcoatMapN.xy *= clearcoatNormalScale;\n	clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n	uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n	uniform sampler2D clearcoatNormalMap;\n	uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n	uniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n	uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n	uniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n	return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n	return 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	vec4 r = vec4( fract( v * PackFactors ), v );\n	r.yzw -= r.xyz * ShiftRight8;	return r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n	return dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n	return packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n	return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n	return 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	return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n	return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n	return ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n	gl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n	mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n	mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n	gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n	vec3 dithering( vec3 color ) {\n		float grid_position = rand( gl_FragCoord.xy );\n		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n		return color + dither_shift_RGB;\n	}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n	roughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n	uniform sampler2D roughnessMap;
36\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n	#if NUM_DIR_LIGHT_SHADOWS > 0\n		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n		struct DirectionalLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n		};\n		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n	#endif\n	#if NUM_SPOT_LIGHT_SHADOWS > 0\n		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n		struct SpotLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n		};\n		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n	#endif\n	#if NUM_POINT_LIGHT_SHADOWS > 0\n		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n		struct PointLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n			float shadowCameraNear;\n			float shadowCameraFar;\n		};\n		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n	#endif\n	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n	}\n	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n		return unpackRGBATo2Half( texture2D( shadow, uv ) );\n	}\n	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n		float occlusion = 1.0;\n		vec2 distribution = texture2DDistribution( shadow, uv );\n		float hard_shadow = step( compare , distribution.x );\n		if (hard_shadow != 1.0 ) {\n			float distance = compare - distribution.x ;\n			float variance = max( 0.00000, distribution.y * distribution.y );\n			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n		}\n		return occlusion;\n	}\n	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n		float shadow = 1.0;\n		shadowCoord.xyz /= shadowCoord.w;\n		shadowCoord.z += shadowBias;\n		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n		if ( frustumTest ) {\n		#if defined( SHADOWMAP_TYPE_PCF )\n			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n			float dx0 = - texelSize.x * shadowRadius;\n			float dy0 = - texelSize.y * shadowRadius;\n			float dx1 = + texelSize.x * shadowRadius;\n			float dy1 = + texelSize.y * shadowRadius;\n			float dx2 = dx0 / 2.0;\n			float dy2 = dy0 / 2.0;\n			float dx3 = dx1 / 2.0;\n			float dy3 = dy1 / 2.0;\n			shadow = (\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n			) * ( 1.0 / 17.0 );\n		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n			float dx = texelSize.x;\n			float dy = texelSize.y;\n			vec2 uv = shadowCoord.xy;
36\n			vec2 f = fract( uv * shadowMapSize + 0.5 );\n			uv -= f * texelSize;\n			shadow = (\n				texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n					 f.x ) +\n				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n					 f.x ) +\n				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n					 f.y ) +\n				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n					 f.y ) +\n				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n						  f.x ),\n					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n						  f.x ),\n					 f.y )\n			) * ( 1.0 / 9.0 );\n		#elif defined( SHADOWMAP_TYPE_VSM )\n			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n		#else\n			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n		#endif\n		}\n		return shadow;\n	}\n	vec2 cubeToUV( vec3 v, float texelSizeY ) {\n		vec3 absV = abs( v );\n		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n		absV *= scaleToCube;\n		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n		vec2 planar = v.xy;\n		float almostATexel = 1.5 * texelSizeY;\n		float almostOne = 1.0 - almostATexel;\n		if ( absV.z >= almostOne ) {\n			if ( v.z > 0.0 )\n				planar.x = 4.0 - v.x;\n		} else if ( absV.x >= almostOne ) {\n			float signX = sign( v.x );\n			planar.x = v.z * signX + 2.0 * signX;\n		} else if ( absV.y >= almostOne ) {\n			float signY = sign( v.y );\n			planar.x = v.x + 2.0 * signY + 2.0;\n			planar.y = v.z * signY - 2.0;\n		}\n		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n	}\n	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n		float shadow = 1.0;\n		vec3 lightToPosition = shadowCoord.xyz;\n		\n		float lightToPositionLength = length( lightToPosition );\n		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;\n			vec3 bd3D = normalize( lightToPosition );\n			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n				shadow = (\n					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n				) * ( 1.0 / 9.0 );\n			#else\n				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n			#endif\n		}\n		return shadow;\n	}
36\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n	#if NUM_DIR_LIGHT_SHADOWS > 0\n		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n		struct DirectionalLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n		};\n		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n	#endif\n	#if NUM_SPOT_LIGHT_SHADOWS > 0\n		struct SpotLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n		};\n		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n	#endif\n	#if NUM_POINT_LIGHT_SHADOWS > 0\n		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n		struct PointLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n			float shadowCameraNear;\n			float shadowCameraFar;\n		};\n		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n	#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n	vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n	#if NUM_DIR_LIGHT_SHADOWS > 0\n		#pragma unroll_loop_start\n		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n		}\n		#pragma unroll_loop_end\n	#endif\n	#if NUM_POINT_LIGHT_SHADOWS > 0\n		#pragma unroll_loop_start\n		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n		}\n		#pragma unroll_loop_end\n	#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n		shadowWorldPosition = worldPosition;\n		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n		#endif\n		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n	}\n	#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n	float shadow = 1.0;\n	#ifdef USE_SHADOWMAP\n	#if NUM_DIR_LIGHT_SHADOWS > 0\n	DirectionalLightShadow directionalLight;\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n		directionalLight = directionalLightShadows[ i ];\n		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n	}\n	#pragma unroll_loop_end\n	#endif\n	#if NUM_SPOT_LIGHT_SHADOWS > 0\n	SpotLightShadow spotLight;\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n		spotLight = spotLightShadows[ i ];\n		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n	}\n	#pragma unroll_loop_end\n	#endif\n	#if NUM_POINT_LIGHT_SHADOWS > 0\n	PointLightShadow pointLight;\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n		pointLight = pointLightShadows[ i ];\n		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n	}\n	#pragma unroll_loop_end\n	#endif\n	#endif\n	return shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n	mat4 boneMatX = getBoneMatrix( skinIndex.x );\n	mat4 boneMatY = getBoneMatrix( skinIndex.y );\n	mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n	mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n	uniform mat4 bindMatrix;\n	uniform mat4 bindMatrixInverse;\n	uniform highp sampler2D boneTexture;\n	mat4 getBoneMatrix( const in float i ) {\n		int size = textureSize( boneTexture, 0 ).x;\n		int j = int( i ) * 4;\n		int x = j % size;\n		int y = j / size;\n		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n		return mat4( v1, v2, v3, v4 );\n	}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n	vec4 skinned = vec4( 0.0 );\n	skinned += boneMatX * skinVertex * skinWeight.x;\n	skinned += boneMatY * skinVertex * skinWeight.y;\n	skinned += boneMatZ * skinVertex * skinWeight.z;\n	skinned += boneMatW * skinVertex * skinWeight.w;\n	transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n	mat4 skinMatrix = mat4( 0.0 );\n	skinMatrix += skinWeight.x * boneMatX;\n	skinMatrix += skinWeight.y * boneMatY;\n	skinMatrix += skinWeight.z * boneMatZ;\n	skinMatrix += skinWeight.w * boneMatW;\n	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n	#ifdef USE_TANGENT\n		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n	#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n	specularStrength = texelSpecular.r;\n#else\n	specularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n	uniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;
36\nvec3 LinearToneMapping( vec3 color ) {\n	return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n	color *= toneMappingExposure;\n	return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n	color *= toneMappingExposure;\n	color = max( vec3( 0.0 ), color - 0.004 );\n	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n	return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n	const mat3 ACESInputMat = mat3(\n		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),\n		vec3( 0.04823, 0.01566, 0.83777 )\n	);\n	const mat3 ACESOutputMat = mat3(\n		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),\n		vec3( -0.07367, -0.00605,  1.07602 )\n	);\n	color *= toneMappingExposure / 0.6;\n	color = ACESInputMat * color;\n	color = RRTAndODTFit( color );\n	color = ACESOutputMat * color;\n	return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n	vec3( 1.6605, - 0.1246, - 0.0182 ),\n	vec3( - 0.5876, 1.1329, - 0.1006 ),\n	vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n	vec3( 0.6274, 0.0691, 0.0164 ),\n	vec3( 0.3293, 0.9195, 0.0880 ),\n	vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n	vec3 x2 = x * x;\n	vec3 x4 = x2 * x2;\n	return + 15.5 * x4 * x2\n		- 40.14 * x4 * x\n		+ 31.96 * x4\n		- 6.868 * x2 * x\n		+ 0.4298 * x2\n		+ 0.1191 * x\n		- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n	const mat3 AgXInsetMatrix = mat3(\n		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n	);
36\n	const mat3 AgXOutsetMatrix = mat3(\n		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n	);\n	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;\n	color *= toneMappingExposure;\n	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n	color = AgXInsetMatrix * color;\n	color = max( color, 1e-10 );	color = log2( color );\n	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n	color = clamp( color, 0.0, 1.0 );\n	color = agxDefaultContrastApprox( color );\n	color = AgXOutsetMatrix * color;\n	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n	color = clamp( color, 0.0, 1.0 );\n	return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n	const float StartCompression = 0.8 - 0.04;\n	const float Desaturation = 0.15;\n	color *= toneMappingExposure;\n	float x = min( color.r, min( color.g, color.b ) );\n	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n	color -= offset;\n	float peak = max( color.r, max( color.g, color.b ) );\n	if ( peak < StartCompression ) return color;\n	float d = 1. - StartCompression;\n	float newPeak = 1. - d * d / ( peak + d - StartCompression );\n	color *= newPeak / peak;\n	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n	return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n	material.transmission = transmission;\n	material.transmissionAlpha = 1.0;\n	material.thickness = thickness;\n	material.attenuationDistance = attenuationDistance;\n	material.attenuationColor = attenuationColor;\n	#ifdef USE_TRANSMISSIONMAP\n		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n	#endif\n	#ifdef USE_THICKNESSMAP\n		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n	#endif\n	vec3 pos = vWorldPosition;\n	vec3 v = normalize( cameraPosition - pos );\n	vec3 n = inverseTransformDirection( normal, viewMatrix );\n	vec4 transmitted = getIBLVolumeRefraction(\n		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n		material.attenuationColor, material.attenuationDistance );\n	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n	uniform float transmission;\n	uniform float thickness;\n	uniform float attenuationDistance;\n	uniform vec3 attenuationColor;\n	#ifdef USE_TRANSMISSIONMAP\n		uniform sampler2D transmissionMap;\n	#endif\n	#ifdef USE_THICKNESSMAP\n		uniform sampler2D thicknessMap;\n	#endif\n	uniform vec2 transmissionSamplerSize;\n	uniform sampler2D transmissionSamplerMap;\n	uniform mat4 modelMatrix;\n	uniform mat4 projectionMatrix;\n	varying vec3 vWorldPosition;\n	float w0( float a ) {\n		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n	}\n	float w1( float a ) {\n		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\n	}\n	float w2( float a ){\n		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n	}\n	float w3( float a ) {\n		return ( 1.0 / 6.0 ) * ( a * a * a );\n	}\n	float g0( float a ) {\n		return w0( a ) + w1( a );\n	}\n	float g1( float a ) {\n		return w2( a ) + w3( a );\n	}\n	float h0( float a ) {\n		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n	}\n	float h1( float a ) {\n		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n	}\n	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n		uv = uv * texelSize.zw + 0.5;\n		vec2 iuv = floor( uv );\n		vec2 fuv = fract( uv );\n		float g0x = g0( fuv.x );\n		float g1x = g1( fuv.x );\n		float h0x = h0( fuv.x );\n		float h1x = h1( fuv.x );\n		float h0y = h0( fuv.y );\n		float h1y = h1( fuv.y );\n		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n	}\n	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n		vec2 fLodSizeInv = 1.0 / fLodSize;\n		vec2 cLodSizeInv = 1.0 / cLodSize;\n		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n		return mix( fSample, cSample, fract( lod ) );\n	}\n	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n		vec3 modelScale;\n		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n		return normalize( refractionVector ) * thickness * modelScale;\n	}\n	float applyIorToRoughness( const in float roughness, const in float ior ) {\n		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n	}\n	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n	}\n	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n		if ( isinf( attenuationDistance ) ) {\n			return vec3( 1.0 );\n		} else {\n			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;\n		}\n	}\n	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n		const in vec3 attenuationColor, const in float attenuationDistance ) {\n		vec4 transmittedLight;\n		vec3 transmittance;\n		#ifdef USE_DISPERSION\n			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n			for ( int i = 0; i < 3; i ++ ) {\n				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n				vec3 refractedRayExit = position + transmissionRay;\n		\n				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n				vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n				refractionCoords += 1.0;\n				refractionCoords /= 2.0;\n		\n				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n				transmittedLight[ i ] = transmissionSample[ i ];\n				transmittedLight.a += transmissionSample.a;\n				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n			}\n			transmittedLight.a /= 3.0;\n		\n		#else\n		\n			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n			vec3 refractedRayExit = position + transmissionRay;\n			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n			vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n			refractionCoords += 1.0;\n			refractionCoords /= 2.0;\n			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n		\n		#endif\n		vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n	}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n	varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n	varying vec2 vMapUv;
36\n#endif\n#ifdef USE_ALPHAMAP\n	varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n	varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n	varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n	varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n	varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n	varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n	varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n	varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n	varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n	varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n	varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n	varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n	varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n	varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n	varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n	varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n	varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n	varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n	varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n	uniform mat3 transmissionMapTransform;\n	varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n	uniform mat3 thicknessMapTransform;\n	varying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n	varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n	uniform mat3 mapTransform;\n	varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n	uniform mat3 alphaMapTransform;\n	varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n	uniform mat3 lightMapTransform;\n	varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n	uniform mat3 aoMapTransform;\n	varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n	uniform mat3 bumpMapTransform;\n	varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n	uniform mat3 normalMapTransform;\n	varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n	uniform mat3 displacementMapTransform;\n	varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n	uniform mat3 emissiveMapTransform;\n	varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n	uniform mat3 metalnessMapTransform;\n	varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n	uniform mat3 roughnessMapTransform;\n	varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n	uniform mat3 anisotropyMapTransform;\n	varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n	uniform mat3 clearcoatMapTransform;\n	varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n	uniform mat3 clearcoatNormalMapTransform;\n	varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n	uniform mat3 clearcoatRoughnessMapTransform;\n	varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n	uniform mat3 sheenColorMapTransform;\n	varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n	uniform mat3 sheenRoughnessMapTransform;\n	varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n	uniform mat3 iridescenceMapTransform;\n	varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n	uniform mat3 iridescenceThicknessMapTransform;\n	varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n	uniform mat3 specularMapTransform;\n	varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n	uniform mat3 specularColorMapTransform;\n	varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n	uniform mat3 specularIntensityMapTransform;\n	varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n	uniform mat3 transmissionMapTransform;\n	varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n	uniform mat3 thicknessMapTransform;\n	varying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n	vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
36\n#endif\n#ifdef USE_IRIDESCENCEMAP\n	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n	vec4 worldPosition = vec4( transformed, 1.0 );\n	#ifdef USE_BATCHING\n		worldPosition = batchingMatrix * worldPosition;\n	#endif\n	#ifdef USE_INSTANCING\n		worldPosition = instanceMatrix * worldPosition;\n	#endif\n	worldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n	gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n	vec4 texColor = texture2D( t2D, vUv );\n	#ifdef DECODE_VIDEO_TEXTURE\n		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n	#endif\n	texColor.rgb *= backgroundIntensity;\n	gl_FragColor = texColor;\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n	vWorldDirection = transformDirection( position, modelMatrix );\n	#include <begin_vertex>\n	#include <project_vertex>\n	gl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n	uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n	uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n	#ifdef ENVMAP_TYPE_CUBE\n		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n	#elif defined( ENVMAP_TYPE_CUBE_UV )\n		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n	#else\n		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n	#endif\n	texColor.rgb *= backgroundIntensity;\n	gl_FragColor = texColor;\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n	vWorldDirection = transformDirection( position, modelMatrix );\n	#include <begin_vertex>\n	#include <project_vertex>\n	gl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n	gl_FragColor = texColor;\n	gl_FragColor.a *= opacity;\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n	#include <uv_vertex>\n	#include <batching_vertex>\n	#include <skinbase_vertex>\n	#include <morphinstance_vertex>\n	#ifdef USE_DISPLACEMENTMAP\n		#include <beginnormal_vertex>\n		#include <morphnormal_vertex>\n		#include <skinnormal_vertex>\n	#endif\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n	uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n	vec4 diffuseColor = vec4( 1.0 );\n	#include <clipping_planes_fragment>\n	#if DEPTH_PACKING == 3200\n		diffuseColor.a = opacity;\n	#endif\n	#include <map_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	#include <logdepthbuf_fragment>\n	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n	#if DEPTH_PACKING == 3200\n		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n	#elif DEPTH_PACKING == 3201\n		gl_FragColor = packDepthToRGBA( fragCoordZ );\n	#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <batching_vertex>\n	#include <skinbase_vertex>\n	#include <morphinstance_vertex>\n	#ifdef USE_DISPLACEMENTMAP\n		#include <beginnormal_vertex>\n		#include <morphnormal_vertex>\n		#include <skinnormal_vertex>\n	#endif\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <worldpos_vertex>\n	#include <clipping_planes_vertex>\n	vWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n	vec4 diffuseColor = vec4( 1.0 );\n	#include <clipping_planes_fragment>\n	#include <map_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	float dist = length( vWorldPosition - referencePosition );\n	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n	dist = saturate( dist );\n	gl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n	vWorldDirection = transformDirection( position, modelMatrix );\n	#include <begin_vertex>\n	#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n	vec3 direction = normalize( vWorldDirection );\n	vec2 sampleUV = equirectUv( direction );\n	gl_FragColor = texture2D( tEquirect, sampleUV );\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	vLineDistance = scale * lineDistance;\n	#include <uv_vertex>\n	#include <color_vertex>\n	#include <morphinstance_vertex>\n	#include <morphcolor_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <clipping_planes_fragment>\n	if ( mod( vLineDistance, totalSize ) > dashSize ) {\n		discard;\n	}\n	vec3 outgoingLight = vec3( 0.0 );\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	outgoingLight = diffuseColor.rgb;\n	#include <opaque_fragment>\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <color_vertex>\n	#include <morphinstance_vertex>\n	#include <morphcolor_vertex>\n	#include <batching_vertex>\n	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n		#include <beginnormal_vertex>\n		#include <morphnormal_vertex>\n		#include <skinbase_vertex>\n		#include <skinnormal_vertex>\n		#include <defaultnormal_vertex>\n	#endif\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <worldpos_vertex>\n	#include <envmap_vertex>\n	#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n	varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <clipping_planes_fragment>\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	#include <specularmap_fragment>\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	#ifdef USE_LIGHTMAP\n		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n	#else\n		reflectedLight.indirectDiffuse += vec3( 1.0 );\n	#endif\n	#include <aomap_fragment>\n	reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n	vec3 outgoingLight = reflectedLight.indirectDiffuse;\n	#include <envmap_fragment>\n	#include <opaque_fragment>\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <color_vertex>\n	#include <morphinstance_vertex>\n	#include <morphcolor_vertex>\n	#include <batching_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	vViewPosition = - mvPosition.xyz;\n	#include <worldpos_vertex>\n	#include <envmap_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <clipping_planes_fragment>\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	vec3 totalEmissiveRadiance = emissive;\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	#include <specularmap_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	#include <emissivemap_fragment>\n	#include <lights_lambert_fragment>\n	#include <lights_fragment_begin>\n	#include <lights_fragment_maps>\n	#include <lights_fragment_end>\n	#include <aomap_fragment>\n	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n	#include <envmap_fragment>\n	#include <opaque_fragment>\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <color_vertex>\n	#include <morphinstance_vertex>\n	#include <morphcolor_vertex>\n	#include <batching_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <fog_vertex>\n	vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nunif
36orm vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <clipping_planes_fragment>\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	vec3 viewDir = normalize( vViewPosition );\n	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n	vec3 y = cross( viewDir, x );\n	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n	#ifdef USE_MATCAP\n		vec4 matcapColor = texture2D( matcap, uv );\n	#else\n		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n	#endif\n	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n	#include <opaque_fragment>\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n	varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <batching_vertex>\n	#include <beginnormal_vertex>\n	#include <morphinstance_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n	vViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n	varying 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	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n	#include <clipping_planes_fragment>\n	#include <logdepthbuf_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n	#ifdef OPAQUE\n		gl_FragColor.a = 1.0;\n	#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <color_vertex>\n	#include <morphcolor_vertex>\n	#include <batching_vertex>\n	#include <beginnormal_vertex>\n	#include <morphinstance_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	vViewPosition = - mvPosition.xyz;\n	#include <worldpos_vertex>\n	#include <envmap_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <clipping_planes_fragment>\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	vec3 totalEmissiveRadiance = emissive;\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	#include <specularmap_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	#include <emissivemap_fragment>\n	#include <lights_phong_fragment>\n	#include <lights_fragment_begin>\n	#include <lights_fragment_maps>\n	#include <lights_fragment_end>\n	#include <aomap_fragment>\n	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n	#include <envmap_fragment>\n	#include <opaque_fragment>\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n	varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <color_vertex>\n	#include <morphinstance_vertex>\n	#include <morphcolor_vertex>\n	#include <batching_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	vViewPosition = - mvPosition.xyz;\n	#include <worldpos_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n	vWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n	#define IOR\n	#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n	uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n	uniform float specularIntensity;\n	uniform vec3 specularColor;\n	#ifdef USE_SPECULAR_COLORMAP\n		uniform sampler2D specularColorMap;\n	#endif\n	#ifdef USE_SPECULAR_INTENSITYMAP\n		uniform sampler2D specularIntensityMap;\n	#endif\n#endif\n#ifdef USE_CLEARCOAT\n	uniform float clearcoat;
36\n	uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n	uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n	uniform float iridescence;\n	uniform float iridescenceIOR;\n	uniform float iridescenceThicknessMinimum;\n	uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n	uniform vec3 sheenColor;\n	uniform float sheenRoughness;\n	#ifdef USE_SHEEN_COLORMAP\n		uniform sampler2D sheenColorMap;\n	#endif\n	#ifdef USE_SHEEN_ROUGHNESSMAP\n		uniform sampler2D sheenRoughnessMap;\n	#endif\n#endif\n#ifdef USE_ANISOTROPY\n	uniform vec2 anisotropyVector;\n	#ifdef USE_ANISOTROPYMAP\n		uniform sampler2D anisotropyMap;\n	#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <clipping_planes_fragment>\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	vec3 totalEmissiveRadiance = emissive;\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	#include <roughnessmap_fragment>\n	#include <metalnessmap_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	#include <clearcoat_normal_fragment_begin>\n	#include <clearcoat_normal_fragment_maps>\n	#include <emissivemap_fragment>\n	#include <lights_physical_fragment>\n	#include <lights_fragment_begin>\n	#include <lights_fragment_maps>\n	#include <lights_fragment_end>\n	#include <aomap_fragment>\n	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n	#include <transmission_fragment>\n	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n	#ifdef USE_SHEEN\n		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n	#endif\n	#ifdef USE_CLEARCOAT\n		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
36\n	#endif\n	#include <opaque_fragment>\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <color_vertex>\n	#include <morphinstance_vertex>\n	#include <morphcolor_vertex>\n	#include <batching_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	vViewPosition = - mvPosition.xyz;\n	#include <worldpos_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <clipping_planes_fragment>\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	vec3 totalEmissiveRadiance = emissive;\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	#include <emissivemap_fragment>\n	#include <lights_toon_fragment>\n	#include <lights_fragment_begin>\n	#include <lights_fragment_maps>\n	#include <lights_fragment_end>\n	#include <aomap_fragment>\n	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n	#include <opaque_fragment>\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n	varying vec2 vUv;\n	uniform mat3 uvTransform;\n#endif\nvoid main() {\n	#ifdef USE_POINTS_UV\n		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n	#endif\n	#include <color_vertex>\n	#include <morphinstance_vertex>\n	#include <morphcolor_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <project_vertex>\n	gl_PointSize = size;\n	#ifdef USE_SIZEATTENUATION\n		bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n	#endif\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <worldpos_vertex>\n	#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <clipping_planes_fragment>\n	vec3 outgoingLight = vec3( 0.0 );\n	#include <logdepthbuf_fragment>\n	#include <map_particle_fragment>\n	#include <color_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	outgoingLight = diffuseColor.rgb;\n	#include <opaque_fragment>\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n	#include <batching_vertex>\n	#include <beginnormal_vertex>\n	#include <morphinstance_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <worldpos_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n	#include <logdepthbuf_fragment>\n	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n	vec2 scale;\n	scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n	scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n	#ifndef USE_SIZEATTENUATION\n		bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n		if ( isPerspective ) scale *= - mvPosition.z;\n	#endif\n	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n	vec2 rotatedPosition;\n	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n	mvPosition.xy += rotatedPosition;\n	gl_Position = projectionMatrix * mvPosition;\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <clipping_planes_fragment>\n	vec3 outgoingLight = vec3( 0.0 );\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <alphahash_fragment>\n	outgoingLight = diffuseColor.rgb;\n	#include <opaque_fragment>\n	#include <tonemapping_fragment>\n	#include <colorspace_fragment>\n	#include <fog_fragment>\n}"},ow={common:{diffuse:{value:new a_(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new rZ},alphaMap:{value:null},alphaMapTransform:{value:new rZ},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new rZ}},envmap:{envMap:{value:null},envMapRotation:{value:new rZ},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new rZ}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new rZ}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new rZ},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new rZ},normalScale:{value:new rY(1,1)}}
vendor: 7,593 bytes, line 36
36,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new rZ},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new rZ}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new rZ}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new rZ}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new a_(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new a_(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new rZ},alphaTest:{value:0},uvTransform:{value:new rZ}},sprite:{diffuse:{value:new a_(0xffffff)},opacity:{value:1},center:{value:new rY(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new rZ},alphaMap:{value:null},alphaMapTransform:{value:new rZ},alphaTest:{value:0}}},oM={basic:{uniforms:a9([ow.common,ow.specularmap,ow.envmap,ow.aomap,ow.lightmap,ow.fog]),vertexShader:o_.meshbasic_vert,fragmentShader:o_.meshbasic_frag},lambert:{uniforms:a9([ow.common,ow.specularmap,ow.envmap,ow.aomap,ow.lightmap,ow.emissivemap,ow.bumpmap,ow.normalmap,ow.displacementmap,ow.fog,ow.lights,{emissive:{value:new a_(0)}}]),vertexShader:o_.meshlambert_vert,fragmentShader:o_.meshlambert_frag},phong:{uniforms:a9([ow.common,ow.specularmap,ow.envmap,ow.aomap,ow.lightmap,ow.emissivemap,ow.bumpmap,ow.normalmap,ow.displacementmap,ow.fog,ow.lights,{emissive:{value:new a_(0)},specular:{value:new a_(1118481)},shininess:{value:30}}]),vertexShader:o_.meshphong_vert,fragmentShader:o_.meshphong_frag},standard:{uniforms:a9([ow.common,ow.envmap,ow.aomap,ow.lightmap,ow.emissivemap,ow.bumpmap,ow.normalmap,ow.displacementmap,ow.roughnessmap,ow.metalnessmap,ow.fog,ow.lights,{emissive:{value:new a_(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:o_.meshphysical_vert,fragmentShader:o_.meshphysical_frag},toon:{uniforms:a9([ow.common,ow.aomap,ow.lightmap,ow.emissivemap,ow.bumpmap,ow.normalmap,ow.displacementmap,ow.gradientmap,ow.fog,ow.lights,{emissive:{value:new a_(0)}}]),vertexShader:o_.meshtoon_vert,fragmentShader:o_.meshtoon_frag},matcap:{uniforms:a9([ow.common,ow.bumpmap,ow.normalmap,ow.displacementmap,ow.fog,{matcap:{value:null}}]),vertexShader:o_.meshmatcap_vert,fragmentShader:o_.meshmatcap_frag},points:{uniforms:a9([ow.points,ow.fog]),vertexShader:o_.points_vert,fragmentShader:o_.points_frag},dashed:{uniforms:a9([ow.common,ow.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:o_.linedashed_vert,fragmentShader:o_.linedashed_frag},depth:{uniforms:a9([ow.common,ow.displacementmap]),vertexShader:o_.depth_vert,fragmentShader:o_.depth_frag},normal:{uniforms:a9([ow.common,ow.bumpmap,ow.normalmap,ow.displacementmap,{opacity:{value:1}}]),vertexShader:o_.meshnormal_vert,fragmentShader:o_.meshnormal_frag},sprite:{uniforms:a9([ow.sprite,ow.fog]),vertexShader:o_.sprite_vert,fragmentShader:o_.sprite_frag},background:{uniforms:{uvTransform:{value:new rZ},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:o_.background_vert,fragmentShader:o_.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new rZ}},vertexShader:o_.backgroundCube_vert,fragmentShader:o_.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:o_.cube_vert,fragmentShader:o_.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:o_.equirect_vert,fragmentShader:o_.equirect_frag},distanceRGBA:{uniforms:a9([ow.common,ow.displacementmap,{referencePosition:{value:new ih},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:o_.distanceRGBA_vert,fragmentShader:o_.distanceRGBA_frag},shadow:{uniforms:a9([ow.lights,ow.fog,{color:{value:new a_(0)},opacity:{value:1}}]),vertexShader:o_.shadow_vert,fragmentShader:o_.shadow_frag}};oM.physical={uniforms:a9([oM.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new rZ},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new rZ},clearcoatNormalScale:{value:new rY(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new rZ},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new rZ},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new rZ},sheen:{value:0},sheenColor:{value:new a_(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new rZ},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new rZ},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new rZ},transmissionSamplerSize:{value:new rY},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new rZ},attenuationDistance:{value:0},attenuationColor:{value:new a_(0)},specularColor:{value:new a_(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new rZ},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new rZ},anisotropyVector:{value:new rY},anisotropyMap:{value:null},anisotropyMapTransform:{value:new rZ}}]),vertexShader:o_.meshphysical_vert,fragmentShader:o_.meshphysical_frag};let oE={r:0,b:0,g:0},oS=new iJ,oT=new ij;function oA(e,t,n,r,i,a,o){let s,l,u=new a_(0),c=+(!0!==a),h=null,d=0,p=null;function f(e){let r=!0===e.isScene?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function m(t,n){t.getRGB(oE,oe(e)),r.buffers.color.setClear(oE.r,oE.g,oE.b,n,o)}return{getClearColor:function(){return u},setClearColor:function(e,t=1){u.set(e),m(u,c=t)},getClearAlpha:function(){return c},setClearAlpha:function(e){m(u,c=e)},render:function(t){let n=!1,i=f(t);null===i?m(u,c):i&&i.isColor&&(m(i,1),n=!0);let a=e.xr.getEnvironmentBlendMode();"additive"===a?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===a&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){let r=f(n);
36r&&(r.isCubeTexture||306===r.mapping)?(void 0===l&&((l=new a4(new a8(1,1,1),new on({name:"BackgroundCubeMaterial",uniforms:a7(oM.backgroundCube.uniforms),vertexShader:oM.backgroundCube.vertexShader,fragmentShader:oM.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),oS.copy(n.backgroundRotation),oS.x*=-1,oS.y*=-1,oS.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(oS.y*=-1,oS.z*=-1),l.material.uniforms.envMap.value=r,l.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(oT.makeRotationFromEuler(oS)),l.material.toneMapped=r4.getTransfer(r.colorSpace)!==rU,(h!==r||d!==r.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,h=r,d=r.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):r&&r.isTexture&&(void 0===s&&((s=new a4(new ox(2,2),new on({name:"BackgroundMaterial",uniforms:a7(oM.background.uniforms),vertexShader:oM.background.vertexShader,fragmentShader:oM.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(s)),s.material.uniforms.t2D.value=r,s.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,s.material.toneMapped=r4.getTransfer(r.colorSpace)!==rU,!0===r.matrixAutoUpdate&&r.updateMatrix(),s.material.uniforms.uvTransform.value.copy(r.matrix),(h!==r||d!==r.version||p!==e.toneMapping)&&(s.material.needsUpdate=!0,h=r,d=r.version,p=e.toneMapping),s.layers.enableAll(),t.unshift(s,s.geometry,s.material,0,0,null))}}}function oC(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=u(null),a=i,o=!1;function s(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function u(e){let t=[],r=[],i=[];for(let e=0;e<n;e++)t[e]=0,r[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function c(){let e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function h(e){d(e,0)}function d(t,n){let r=a.newAttributes,i=a.enabledAttributes,o=a.attributeDivisors;r[t]=1,0===i[t]&&(e.enableVertexAttribArray(t),i[t]=1),o[t]!==n&&(e.vertexAttribDivisor(t,n),o[t]=n)}function p(){let t=a.newAttributes,n=a.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function f(t,n,r,i,a,o,s){!0===s?e.vertexAttribIPointer(t,n,r,a,o):e.vertexAttribPointer(t,n,r,i,a,o)}function m(){g(),o=!0,a!==i&&s((a=i).object)}function g(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:function(n,i,l,m,g){let v=!1,y=function(t,n,i){let a=!0===i.wireframe,o=r[t.id];void 0===o&&(o={},r[t.id]=o);let s=o[n.id];void 0===s&&(s={},o[n.id]=s);let l=s[a];return void 0===l&&(l=u(e.createVertexArray()),s[a]=l),l}(m,l,i);a!==y&&s((a=y).object),(v=function(e,t,n,r){let i=a.attributes,o=t.attributes,s=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=i[t],r=o[t];if(void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor)),void 0===n||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}(n,m,l,g))&&function(e,t,n,r){let i={},o=t.attributes,s=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=o[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(v||o)&&(o=!1,function(n,r,i,a){c();let o=a.attributes,s=i.getAttributes(),l=r.defaultAttributeValues;for(let r in s){let i=s[r];if(i.location>=0){let s=o[r];if(void 0===s&&("instanceMatrix"===r&&n.instanceMatrix&&(s=n.instanceMatrix),"instanceColor"===r&&n.instanceColor&&(s=n.instanceColor)),void 0!==s){let r=s.normalized,o=s.itemSize,l=t.get(s);if(void 0===l)continue;let u=l.buffer,c=l.type,p=l.bytesPerElement,m=c===e.INT||c===e.UNSIGNED_INT||1013===s.gpuType;if(s.isInterleavedBufferAttribute){let t=s.data,l=t.stride,g=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)d(i.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<i.locationSize;e++)h(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<i.locationSize;e++)f(i.location+e,o/i.locationSize,c,r,l*p,(g+o/i.locationSize*e)*p,m)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)d(i.location+e,s.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<i.locationSize;e++)h(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<i.locationSize;e++)f(i.location+e,o/i.locationSize,c,r,o*p,o/i.locationSize*e*p,m)}}else if(void 0!==l){let t=l[r];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(i.location,t);break;case 3:e.vertexAttrib3fv(i.location,t);break;case 4:e.vertexAttrib4fv(i.location,t);break;default:e.vertexAttrib1fv(i.location,t)}}}}p()}(n,i,l,m),null!==g&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(g).buffer))},reset:m,resetDefaultState:g,dispose:function(){for(let e in m(),r){let t=r[e];for(let e in t){let n=t[e];for(let e in n)l(n[e].object),delete n[e];delete t[e]}delete r[e]}},releaseStatesOfGeometry:function(e){if(void 0===r[e.id])return;let t=r[e.id];for(let e in t){let n=t[e];for(let e in n)l(n[e].object),delete n[e];delete t[e]}delete r[e.id]},releaseStatesOfProgram:function(e){for(let t in r){let n=r[t];if(void 0===n[e.id])continue;let i=n[e.id];for(let e in i)l(i[e].object),delete i[e];delete n[e.id]}},initAttributes:c,enableAttribute:h,disableUnusedAttributes:p}}
36function oR(e,t,n){let r;function i(t,i,a){0!==a&&(e.drawArraysInstanced(r,t,i,a),n.update(i,r,a))}this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r,1)},this.renderInstances=i,this.renderMultiDraw=function(e,i,a){if(0===a)return;let o=t.get("WEBGL_multi_draw");if(null===o)for(let t=0;t<a;t++)this.render(e[t],i[t]);else{o.multiDrawArraysWEBGL(r,e,0,i,0,a);let t=0;for(let e=0;e<a;e++)t+=i[e];n.update(t,r,1)}},this.renderMultiDrawInstances=function(e,a,o,s){if(0===o)return;let l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)i(e[t],a[t],s[t]);else{l.multiDrawArraysInstancedWEBGL(r,e,0,a,0,s,0,o);let t=0;for(let e=0;e<o;e++)t+=a[e];for(let e=0;e<s.length;e++)n.update(t,r,s[e])}}}function oP(e,t,n,r){let i;function a(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=void 0!==n.precision?n.precision:"highp",s=a(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);let l=!0===n.logarithmicDepthBuffer,u=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),c=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),d=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),p=e.getParameter(e.MAX_VERTEX_ATTRIBS),f=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),m=e.getParameter(e.MAX_VARYING_VECTORS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){let n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:a,textureFormatReadable:function(t){return 1023===t||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){let i=1016===n&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return 1009===n||r.convert(n)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||1015===n||!!i},precision:o,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:c,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:c>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function oI(e){let t=this,n=null,r=0,i=!1,a=!1,o=new of,s=new rZ,l={value:null,needsUpdate:!1};function u(e,n,r,i){let a=null!==e?e.length:0,u=null;if(0!==a){if(u=l.value,!0!==i||null===u){let t=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===u||u.length<t)&&(u=new Float32Array(t));for(let t=0,n=r;t!==a;++t,n+=4)o.copy(e[t]).applyMatrix4(i,s),o.normal.toArray(u,n),u[n+3]=o.constant}l.value=u,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,u}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=0!==e.length||t||0!==r||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(o,s,c){let h=o.clippingPlanes,d=o.clipIntersection,p=o.clipShadows,f=e.get(o);if(i&&null!==h&&0!==h.length&&(!a||p)){let e=a?0:r,t=4*e,i=f.clippingState||null;l.value=i,i=u(h,s,t,c);for(let e=0;e!==t;++e)i[e]=n[e];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}else a?u(null):(l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0)}}function oO(e){let t=new WeakMap;function n(e,t){return 303===t?e.mapping=301:304===t&&(e.mapping=302),e}function r(e){let n=e.target;n.removeEventListener("dispose",r);let i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){let a=i.mapping;if(303===a||304===a)if(t.has(i))return n(t.get(i).texture,i.mapping);else{let a=i.image;if(!a||!(a.height>0))return null;{let o=new oc(a.height);return o.fromEquirectangularTexture(e,i),t.set(i,o),i.addEventListener("dispose",r),n(o.texture,i.mapping)}}}return i},dispose:function(){t=new WeakMap}}}class oL extends or{constructor(e=-1,t=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
36phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,a=i+e*this.view.width,o-=t*this.view.offsetY,s=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}let oD=[.125,.215,.35,.446,.526,.582],oN=new oL,oU=new a_,ok=null,oB=0,oF=0,oz=!1,oH=(1+Math.sqrt(5))/2,oj=1/oH,oW=[new ih(-oH,oj,0),new ih(oH,oj,0),new ih(-oj,0,oH),new ih(oj,0,oH),new ih(0,oH,-oj),new ih(0,oH,oj),new ih(-1,1,-1),new ih(1,1,-1),new ih(-1,1,1),new ih(1,1,1)];class oG{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){ok=this._renderer.getRenderTarget(),oB=this._renderer.getActiveCubeFace(),oF=this._renderer.getActiveMipmapLevel(),oz=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=oY(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=oq(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(ok,oB,oF),this._renderer.xr.enabled=oz,e.scissorTest=!1,oX(e,0,0,e.width,e.height)}_fromTexture(e,t){301===e.mapping||302===e.mapping?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ok=this._renderer.getRenderTarget(),oB=this._renderer.getActiveCubeFace(),oF=this._renderer.getActiveMipmapLevel(),oz=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:1006,minFilter:1006,generateMipmaps:!1,type:1016,format:1023,colorSpace:rO,depthBuffer:!1},r=oV(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){var i;null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=oV(e,t,n);let{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}
36=function(e){let t=[],n=[],r=[],i=e,a=e-4+1+oD.length;for(let o=0;o<a;o++){let a=Math.pow(2,i);n.push(a);let s=1/a;o>e-4?s=oD[o-e+4-1]:0===o&&(s=0),r.push(s);let l=1/(a-2),u=-l,c=1+l,h=[u,u,c,u,c,c,u,u,c,c,u,c],d=new Float32Array(108),p=new Float32Array(72),f=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];d.set(r,18*e),p.set(h,12*e);let i=[e,e,e,e,e,e];f.set(i,6*e)}let m=new aH;m.setAttribute("position",new aP(d,3)),m.setAttribute("uv",new aP(p,2)),m.setAttribute("faceIndex",new aP(f,1)),t.push(m),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=(i=r,new on({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new ih(0,1,0)}},vertexShader:oZ(),fragmentShader:`
37
38			precision mediump float;
39			precision mediump int;
40
41			varying vec3 vOutputDirection;
42
43			uniform sampler2D envMap;
44			uniform int samples;
45			uniform float weights[ n ];
46			uniform bool latitudinal;
47			uniform float dTheta;
48			uniform float mipInt;
49			uniform vec3 poleAxis;
50
51			#define ENVMAP_TYPE_CUBE_UV
52			#include <cube_uv_reflection_fragment>
53
54			vec3 getSample( float theta, vec3 axis ) {
55
56				float cosTheta = cos( theta );
57				// Rodrigues' axis-angle rotation
58				vec3 sampleDirection = vOutputDirection * cosTheta
59					+ cross( axis, vOutputDirection ) * sin( theta )
60					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
61
62				return bilinearCubeUV( envMap, sampleDirection, mipInt );
63
64			}
65
66			void main() {
67
68				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
69
70				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
71
72					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
73
74				}
75
76				axis = normalize( axis );
77
78				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
79				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
80
81				for ( int i = 1; i < n; i++ ) {
82
83					if ( i >= samples ) {
84
85						break;
86
87					}
88
89					float theta = dTheta * float( i );
90					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
91					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
92
93				}
94
95			}
96		`,blending:0,depthTest:!1,depthWrite:!1}))}return r}_compileMaterial(e){let t=new a4(this._lodPlanes[0],e);this._renderer.compile(t,oN)}_sceneToCubeUV(e,t,n,r){let i=new os(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,l=s.autoClear,u=s.toneMapping;s.getClearColor(oU),s.toneMapping=0,s.autoClear=!1;
96let c=new aS({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),h=new a4(new a8,c),d=!1,p=e.background;p?p.isColor&&(c.color.copy(p),e.background=null,d=!0):(c.color.copy(oU),d=!0);for(let t=0;t<6;t++){let n=t%3;0===n?(i.up.set(0,a[t],0),i.lookAt(o[t],0,0)):1===n?(i.up.set(0,0,a[t]),i.lookAt(0,o[t],0)):(i.up.set(0,a[t],0),i.lookAt(0,0,o[t]));let l=this._cubeSize;oX(r,n*l,t>2?l:0,l,l),s.setRenderTarget(r),d&&s.render(h,i),s.render(e,i)}h.geometry.dispose(),h.material.dispose(),s.toneMapping=u,s.autoClear=l,e.background=p}_textureToCubeUV(e,t){let n=this._renderer,r=301===e.mapping||302===e.mapping;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=oY()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=oq());let i=r?this._cubemapMaterial:this._equirectMaterial,a=new a4(this._lodPlanes[0],i);i.uniforms.envMap.value=e;let o=this._cubeSize;oX(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(a,oN)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodPlanes.length;for(let t=1;t<r;t++){let n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),i=oW[(r-t-1)%oW.length];this._blur(e,t-1,t,n,i)}t.autoClear=n}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",i),this._halfBlur(a,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");let u=new a4(this._lodPlanes[r],l),c=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,p=i/d,f=isFinite(i)?1+Math.floor(3*p):20;f>20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);let m=[],g=0;for(let e=0;e<20;++e){let t=e/p,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:e<f&&(g+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/g;c.envMap.value=e.texture,c.samples.value=f,c.weights.value=m,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o);let{_lodMax:v}=this;c.dTheta.value=d,c.mipInt.value=v-n;let y=this._sizeLods[r],b=4*(this._cubeSize-y);oX(t,3*y*(r>v-4?r-v+4:0),b,3*y,2*y),s.setRenderTarget(t),s.render(u,oN)}}function oV(e,t,n){let r=new is(e,t,n);return r.texture.mapping=306,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function oX(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function oq(){return new on({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:oZ(),fragmentShader:`
97
98			precision mediump float;
99			precision mediump int;
100
101			varying vec3 vOutputDirection;
102
103			uniform sampler2D envMap;
104
105			#include <common>
106
107			void main() {
108
109				vec3 outputDirection = normalize( vOutputDirection );
110				vec2 uv = equirectUv( outputDirection );
111
112				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
113
114			}
115		`,blending:0,depthTest:!1,depthWrite:!1})}function oY(){return new on({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:oZ(),fragmentShader:`
116
117			precision mediump float;
118			precision mediump int;
119
120			uniform float flipEnvMap;
121
122			varying vec3 vOutputDirection;
123
124			uniform samplerCube envMap;
125
126			void main() {
127
128				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
129
130			}
131		`,blending:0,depthTest:!1,depthWrite:!1})}function oZ(){return`
132
133		precision mediump float;
134		precision mediump int;
135
136		attribute float faceIndex;
137
138		varying vec3 vOutputDirection;
139
140		// RH coordinate system; PMREM face-indexing convention
141		vec3 getDirection( vec2 uv, float face ) {
142
143			uv = 2.0 * uv - 1.0;
144
145			vec3 direction = vec3( uv, 1.0 );
146
147			if ( face == 0.0 ) {
148
149				direction = direction.zyx; // ( 1, v, u ) pos x
150
151			} else if ( face == 1.0 ) {
152
153				direction = direction.xzy;
154				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
155
156			} else if ( face == 2.0 ) {
157
158				direction.x *= -1.0; // ( -u, v, 1 ) pos z
159
160			} else if ( face == 3.0 ) {
161
162				direction = direction.zyx;
163				direction.xz *= -1.0; // ( -1, v, -u ) neg x
164
165			} else if ( face == 4.0 ) {
166
167				direction = direction.xzy;
168				direction.xy *= -1.0; // ( -u, -1, v ) neg y
169
170			} else if ( face == 5.0 ) {
171
172				direction.z *= -1.0; // ( u, v, -1 ) neg z
173
174			}
175
176			return direction;
177
178		}
179
180		void main() {
181
182			vOutputDirection = getDirection( uv, faceIndex );
183			gl_Position = vec4( position, 1.0 );
184
185		}
186	`}function o$(e){let t=new WeakMap,n=null;function r(e){let n=e.target;n.removeEventListener("dispose",r);let i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){let a=i.mapping,o=303===a||304===a,s=301===a||302===a;if(o||s){let a=t.get(i),l=void 0!==a?a.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==l)return null===n&&(n=new oG(e)),(a=o?n.fromEquirectangular(i,a):n.fromCubemap(i,a)).texture.pmremVersion=i.pmremVersion,t.set(i,a),a.texture;{if(void 0!==a)return a.texture;let l=i.image;return o&&l&&l.height>0||s&&l&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(l)?(null===n&&(n=new oG(e)),(a=o?n.fromEquirectangular(i):n.fromCubemap(i)).texture.pmremVersion=i.pmremVersion,t.set(i,a),i.addEventListener("dispose",r),a.texture):null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function oK(e){let t={};function n(n){let r;if(void 0!==t[n])return t[n];switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){let t=n(e);return null===t&&r0("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function oJ(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;for(let e in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[e]);for(let e in s.morphAttributes){let n=s.morphAttributes[e];for(let e=0,r=n.length;e<r;e++)t.remove(n[e])}s.removeEventListener("dispose",o),delete i[s.id];let l=a.get(s);l&&(t.remove(l),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(null!==r){let e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){let r=e[t+0],i=e[t+1],a=e[t+2];n.push(r,i,i,a,a,r)}}else{if(void 0===i)return;let e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;
186t+=3){let e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}let s=new(rK(n)?aO:aI)(n,1);s.version=o;let l=a.get(e);l&&t.remove(l),a.set(e,s)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER);let i=n.morphAttributes;for(let n in i){let r=i[n];for(let n=0,i=r.length;n<i;n++)t.update(r[n],e.ARRAY_BUFFER)}},getWireframeAttribute:function(e){let t=a.get(e);if(t){let n=e.index;null!==n&&t.version<n.version&&s(e)}else s(e);return a.get(e)}}}function oQ(e,t,n){let r,i,a;function o(t,o,s){0!==s&&(e.drawElementsInstanced(r,o,i,t*a,s),n.update(o,r,s))}this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,a=e.bytesPerElement},this.render=function(t,o){e.drawElements(r,o,i,t*a),n.update(o,r,1)},this.renderInstances=o,this.renderMultiDraw=function(e,o,s){if(0===s)return;let l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<s;t++)this.render(e[t]/a,o[t]);else{l.multiDrawElementsWEBGL(r,o,0,i,e,0,s);let t=0;for(let e=0;e<s;e++)t+=o[e];n.update(t,r,1)}},this.renderMultiDrawInstances=function(e,s,l,u){if(0===l)return;let c=t.get("WEBGL_multi_draw");if(null===c)for(let t=0;t<e.length;t++)o(e[t]/a,s[t],u[t]);else{c.multiDrawElementsInstancedWEBGL(r,s,0,i,e,0,u,0,l);let t=0;for(let e=0;e<l;e++)t+=s[e];for(let e=0;e<u.length;e++)n.update(t,r,u[e])}}}function o0(e){let t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,i){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=n/3*i;break;case e.LINES:t.lines+=n/2*i;break;case e.LINE_STRIP:t.lines+=i*(n-1);break;case e.LINE_LOOP:t.lines+=i*n;break;case e.POINTS:t.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function o1(e,t,n){let r=new WeakMap,i=new ia;return{update:function(a,o,s){let l=a.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,c=void 0!==u?u.length:0,h=r.get(o);if(void 0===h||h.count!==c){void 0!==h&&h.texture.dispose();let e=void 0!==o.morphAttributes.position,n=void 0!==o.morphAttributes.normal,a=void 0!==o.morphAttributes.color,s=o.morphAttributes.position||[],l=o.morphAttributes.normal||[],u=o.morphAttributes.color||[],d=0;!0===e&&(d=1),!0===n&&(d=2),!0===a&&(d=3);let p=o.attributes.position.count*d,f=1;p>t.maxTextureSize&&(f=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let m=new Float32Array(p*f*4*c),g=new il(m,p,f,c);g.type=1015,g.needsUpdate=!0;let v=4*d;for(let t=0;t<c;t++){let r=s[t],o=l[t],c=u[t],h=p*f*4*t;for(let t=0;t<r.count;t++){let s=t*v;!0===e&&(i.fromBufferAttribute(r,t),m[h+s+0]=i.x,m[h+s+1]=i.y,m[h+s+2]=i.z,m[h+s+3]=0),!0===n&&(i.fromBufferAttribute(o,t),m[h+s+4]=i.x,m[h+s+5]=i.y,m[h+s+6]=i.z,m[h+s+7]=0),!0===a&&(i.fromBufferAttribute(c,t),m[h+s+8]=i.x,m[h+s+9]=i.y,m[h+s+10]=i.z,m[h+s+11]=4===c.itemSize?i.w:1)}}h={count:c,texture:g,size:new rY(p,f)},r.set(o,h),o.addEventListener("dispose",function e(){g.dispose(),r.delete(o),o.removeEventListener("dispose",e)})}if(!0===a.isInstancedMesh&&null!==a.morphTexture)s.getUniforms().setValue(e,"morphTexture",a.morphTexture,n);else{let t=0;for(let e=0;e<l.length;e++)t+=l[e];let n=o.morphTargetsRelative?1:1-t;s.getUniforms().setValue(e,"morphTargetBaseInfluence",n),s.getUniforms().setValue(e,"morphTargetInfluences",l)}s.getUniforms().setValue(e,"morphTargetsTexture",h.texture,n),s.getUniforms().setValue(e,"morphTargetsTextureSize",h.size)}}}function o2(e,t,n,r){let i=new WeakMap;function a(e){let t=e.target;t.removeEventListener("dispose",a),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(o){let s=r.render.frame,l=o.geometry,u=t.get(o,l);if(i.get(u)!==s&&(t.update(u),i.set(u,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),i.get(o)!==s&&(n.update(o.instanceMatrix,e.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,e.ARRAY_BUFFER),i.set(o,s))),o.isSkinnedMesh){let e=o.skeleton;
186i.get(e)!==s&&(e.update(),i.set(e,s))}return u},dispose:function(){i=new WeakMap}}}class o3 extends ii{constructor(e,t,n,r,i,a,o,s,l,u=1026){if(1026!==u&&1027!==u)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===u&&(n=1014),void 0===n&&1027===u&&(n=1020),super(null,r,i,a,o,s,u,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}let o5=new ii,o4=new o3(1,1);o4.compareFunction=515;let o6=new il,o8=new iu,o7=new ou,o9=[],se=[],st=new Float32Array(16),sn=new Float32Array(9),sr=new Float32Array(4);function si(e,t,n){let r=e[0];if(r<=0||r>0)return e;let i=t*n,a=o9[i];if(void 0===a&&(a=new Float32Array(i),o9[i]=a),0!==t){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function sa(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function so(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function ss(e,t){let n=se[t];void 0===n&&(n=new Int32Array(t),se[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function sl(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function su(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(sa(n,t))return;e.uniform2fv(this.addr,t),so(n,t)}}function sc(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(sa(n,t))return;e.uniform3fv(this.addr,t),so(n,t)}}function sh(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(sa(n,t))return;e.uniform4fv(this.addr,t),so(n,t)}}function sd(e,t){let n=this.cache,r=t.elements;if(void 0===r){if(sa(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),so(n,t)}else{if(sa(n,r))return;sr.set(r),e.uniformMatrix2fv(this.addr,!1,sr),so(n,r)}}function sp(e,t){let n=this.cache,r=t.elements;if(void 0===r){if(sa(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),so(n,t)}else{if(sa(n,r))return;sn.set(r),e.uniformMatrix3fv(this.addr,!1,sn),so(n,r)}}function sf(e,t){let n=this.cache,r=t.elements;if(void 0===r){if(sa(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),so(n,t)}else{if(sa(n,r))return;st.set(r),e.uniformMatrix4fv(this.addr,!1,st),so(n,r)}}function sm(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function sg(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(sa(n,t))return;e.uniform2iv(this.addr,t),so(n,t)}}function sv(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(sa(n,t))return;e.uniform3iv(this.addr,t),so(n,t)}}function sy(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(sa(n,t))return;e.uniform4iv(this.addr,t),so(n,t)}}function sb(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function sx(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(sa(n,t))return;e.uniform2uiv(this.addr,t),so(n,t)}}function s_(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(sa(n,t))return;e.uniform3uiv(this.addr,t),so(n,t)}}function sw(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(sa(n,t))return;e.uniform4uiv(this.addr,t),so(n,t)}}function sM(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i);let a=this.type===e.SAMPLER_2D_SHADOW?o4:o5;n.setTexture2D(t||a,i)}function sE(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||o8,i)}function sS(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||o7,i)}function sT(e,t,n){let r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||o6,i)}function sA(e,t){e.uniform1fv(this.addr,t)}function sC(e,t){let n=si(t,this.size,2);e.uniform2fv(this.addr,n)}function sR(e,t){let n=si(t,this.size,3);e.uniform3fv(this.addr,n)}function sP(e,t){let n=si(t,this.size,4);e.uniform4fv(this.addr,n)}function sI(e,t){let n=si(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function sO(e,t){let n=si(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function sL(e,t){let n=si(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function sD(e,t){e.uniform1iv(this.addr,t)}function sN(e,t){e.uniform2iv(this.addr,t)}function sU(e,t){e.uniform3iv(this.addr,t)}function sk(e,t){e.uniform4iv(this.addr,t)}function sB(e,t){e.uniform1uiv(this.addr,t)}function sF(e,t){e.uniform2uiv(this.addr,t)}function sz(e,t){e.uniform3uiv(this.addr,t)}function sH(e,t){e.uniform4uiv(this.addr,t)}function sj(e,t,n){let r=this.cache,i=t.length,a=ss(n,i);sa(r,a)||(e.uniform1iv(this.addr,a),so(r,a));for(let e=0;e!==i;++e)n.setTexture2D(t[e]||o5,a[e])}function sW(e,t,n){let r=this.cache,i=t.length,a=ss(n,i);sa(r,a)||(e.uniform1iv(this.addr,a),so(r,a));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||o8,a[e])}function sG(e,t,n){let r=this.cache,i=t.length,a=ss(n,i);sa(r,a)||(e.uniform1iv(this.addr,a),so(r,a));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||o7,a[e])}function sV(e,t,n){let r=this.cache,i=t.length,a=ss(n,i);sa(r,a)||(e.uniform1iv(this.addr,a),so(r,a));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||o6,a[e])}class sX{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return sl;case 35664:return su;case 35665:return sc;case 35666:return sh;case 35674:return sd;case 35675:return sp;case 35676:return sf;case 5124:case 35670:return sm;case 35667:case 35671:return sg;case 35668:case 35672:return sv;case 35669:case 35673:return sy;case 5125:return sb;case 36294:return sx;case 36295:return s_;case 36296:return sw;case 35678:case 36198:case 36298:case 36306:case 35682:return sM;case 35679:case 36299:case 36307:return sE;case 35680:case 36300:case 36308:case 36293:return sS;case 36289:case 36303:case 36311:case 36292:return sT}}(t.type)}}class sq{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return sA;case 35664:return sC;case 35665:return sR;case 35666:return sP;case 35674:return sI;case 35675:return sO;case 35676:return sL;case 5124:case 35670:return sD;case 35667:case 35671:return sN;case 35668:case 35672:return sU;case 35669:case 35673:return sk;case 5125:return sB;case 36294:return sF;case 36295:return sz;case 36296:return sH;case 35678:case 36198:case 36298:case 36306:case 35682:return sj;case 35679:case 36299:case 36307:return sW;case 35680:case 36300:case 36308:case 36293:return sG;case 36289:case 36303:case 36311:case 36292:return sV}}(t.type)}}class sY{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let r=this.seq;for(let i=0,a=r.length;i!==a;++i){let a=r[i];a.setValue(e,t[a.id],n)}}}let sZ=/(\w+)(\])?(\[|\.)?/g;function s$(e,t){e.seq.push(t),e.map[t.id]=t}class sK{constructor(e,t){this.seq=[],this.map={};let n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){let n=e.getActiveUniform(t,r),i=e.getUniformLocation(t,n.name);!function(e,t,n){let r=e.name,i=r.length;for(sZ.lastIndex=0;;){let a=sZ.exec(r),o=sZ.lastIndex,s=a[1],l="]"===a[2],u=a[3];if(l&&(s|=0),void 0===u||"["===u&&o+2===i){s$(n,void 0===u?new sX(s,e,t):new sq(s,e,t));break}{let e=n.map[s];void 0===e&&s$(n,e=new sY(s)),n=e}}}(n,i,this)}}setValue(e,t,n,r){let i=this.map[t];void 0!==i&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];void 0!==r&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];!1!==o.needsUpdate&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}}function sJ(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}let sQ=0;function s0(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";let a=/ERROR: 0:(\d+)/.exec(i);if(!a)return i;{let r=parseInt(a[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){let n=e.split("\n"),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e<a;e++){let i=e+1;r.push(`${i===t?">":" "} ${i}: ${n[e]}`)}return r.join("\n")}(e.getShaderSource(t),r)}}function s1(e){return""!==e}function s2(e,t){let n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_L
186IGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function s3(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let s5=/^[ \t]*#include +<([\w\d./]+)>/gm;function s4(e){return e.replace(s5,s8)}let s6=new Map;function s8(e,t){let n=o_[t];if(void 0===n){let e=s6.get(t);if(void 0!==e)n=o_[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e);else throw Error("Can not resolve #include <"+t+">")}return s4(n)}let s7=/#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 s9(e){return e.replace(s7,le)}function le(e,t,n,r){let i="";for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return i}function lt(e){let t=`precision ${e.precision} float;
187	precision ${e.precision} int;
188	precision ${e.precision} sampler2D;
189	precision ${e.precision} samplerCube;
190	precision ${e.precision} sampler3D;
191	precision ${e.precision} sampler2DArray;
192	precision ${e.precision} sampler2DShadow;
193	precision ${e.precision} samplerCubeShadow;
194	precision ${e.precision} sampler2DArrayShadow;
195	precision ${e.precision} isampler2D;
196	precision ${e.precision} isampler3D;
197	precision ${e.precision} isamplerCube;
198	precision ${e.precision} isampler2DArray;
199	precision ${e.precision} usampler2D;
200	precision ${e.precision} usampler3D;
201	precision ${e.precision} usamplerCube;
202	precision ${e.precision} usampler2DArray;
203	`;return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function ln(e,t,n,r){let i,a,o,s,l,u,c=e.getContext(),h=n.defines,d=n.vertexShader,p=n.fragmentShader,f=(l="SHADOWMAP_TYPE_BASIC",1===n.shadowMapType?l="SHADOWMAP_TYPE_PCF":2===n.shadowMapType?l="SHADOWMAP_TYPE_PCF_SOFT":3===n.shadowMapType&&(l="SHADOWMAP_TYPE_VSM"),l),m=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),g=(u="ENVMAP_MODE_REFLECTION",n.envMap&&302===n.envMapMode&&(u="ENVMAP_MODE_REFRACTION"),u),v=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),y=function(e){let t=e.envMapCubeUVHeight;if(null===t)return null;let n=Math.log2(t)-2;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:1/t,maxMip:n}}(n),b=[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(s1).join("\n"),x=function(e){let t=[];for(let n in e){let r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(h),_=c.createProgram(),w=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?((i=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(s1).join("\n")).length>0&&(i+="\n"),(a=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x].filter(s1).join("\n")).length>0&&(a+="\n")):(i=[lt(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+g:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IR
203IDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+f:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","	uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif","\n"].filter(s1).join("\n"),a=[lt(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,x,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alph
203aToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+m:"",n.envMap?"#define "+g:"",n.envMap?"#define "+v:"",y?"#define CUBEUV_TEXEL_WIDTH "+y.texelWidth:"",y?"#define CUBEUV_TEXEL_HEIGHT "+y.texelHeight:"",y?"#define CUBEUV_MAX_MIP "+y.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+f:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?o_.tonemapping_pars_fragment:"",0!==n.toneMapping?function(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",o_.colorspace_pars_fragment,function(e,t){let n=function(e){let t,n=r4.getPrimaries(r4.workingColorSpace),r=r4.getPrimaries(e);
203switch(n===r?t="":"p3"===n&&r===rk?t="LinearDisplayP3ToLinearSRGB":n===rk&&"p3"===r&&(t="LinearSRGBToLinearDisplayP3"),e){case rO:case rD:return[t,"LinearTransferOETF"];case rI:case rL:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[t,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(s1).join("\n")),d=s3(d=s2(d=s4(d),n),n),p=s3(p=s2(p=s4(p),n),n),d=s9(d),p=s9(p),!0!==n.isRawShaderMaterial&&(w="#version 300 es\n",i=[b,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+i,a=["#define varying in",n.glslVersion===rB?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===rB?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+a);let M=w+i+d,E=w+a+p,S=sJ(c,c.VERTEX_SHADER,M),T=sJ(c,c.FRAGMENT_SHADER,E);function A(t){if(e.debug.checkShaderErrors){let n=c.getProgramInfoLog(_).trim(),r=c.getShaderInfoLog(S).trim(),o=c.getShaderInfoLog(T).trim(),s=!0,l=!0;if(!1===c.getProgramParameter(_,c.LINK_STATUS))if(s=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(c,_,S,T);else{let e=s0(c,S,"vertex"),r=s0(c,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+c.getError()+" - VALIDATE_STATUS "+c.getProgramParameter(_,c.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+r)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):(""===r||""===o)&&(l=!1);l&&(t.diagnostics={runnable:s,programLog:n,vertexShader:{log:r,prefix:i},fragmentShader:{log:o,prefix:a}})}c.deleteShader(S),c.deleteShader(T),o=new sK(c,_),s=function(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){let r=e.getActiveAttrib(t,i),a=r.name,o=1;r.type===e.FLOAT_MAT2&&(o=2),r.type===e.FLOAT_MAT3&&(o=3),r.type===e.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:e.getAttribLocation(t,a),locationSize:o}}return n}(c,_)}c.attachShader(_,S),c.attachShader(_,T),void 0!==n.index0AttributeName?c.bindAttribLocation(_,0,n.index0AttributeName):!0===n.morphTargets&&c.bindAttribLocation(_,0,"position"),c.linkProgram(_),this.getUniforms=function(){return void 0===o&&A(this),o},this.getAttributes=function(){return void 0===s&&A(this),s};let C=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===C&&(C=c.getProgramParameter(_,37297)),C},this.destroy=function(){r.releaseStatesOfProgram(this),c.deleteProgram(_),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=sQ++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=S,this.fragmentShader=T,this}let lr=0;class li{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(r)&&(a.add(r),r.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}remove(e){for(let t of this.materialCache.get(e))t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return void 0===n&&(n=new la(e),t.set(e,n)),n}}class la{constructor(e){this.id=lr++,this.code=e,this.usedTimes=0}}function lo(e,t,n,r,i,a,o){let s=new iQ,l=new li,u=new Set,c=[],h=i.logarithmicDepthBuffer,d=i.vertexTextures,p=i.precision,f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(e){return(u.add(e),0===e)?"uv":`uv${e}`}return{getParameters:function(a,s,c,g,v){let y,b,x,_,w=g.fog,M=v.geometry,E=a.isMeshStandardMaterial?g.environment:null,S=(a.isMeshStandardMaterial?n:t).get(a.envMap||E),T=S&&306===S.mapping?S.image.height:null,A=f[a.type];null!==a.precision&&(p=i.getMaxPrecision(a.precision))!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",p,"instead.");let C=M.morphAttributes.position||M.morphAttributes.normal||M.morphAttributes.color,R=void 0!==C?C.length:0,P=0;if(void 0!==M.morphAttributes.position&&(P=1),void 0!==M.morphAttributes.normal&&(P=2),void 0!==M.morphAttributes.color&&(P=3),A){let e=oM[A];y=e.vertexShader,b=e.fragmentShader}else y=a.vertexShader,b=a.fragmentShader,l.update(a),x=l.getVertexShaderID(a),_=l.getFragmentShaderID(a);let I=e.getRenderTarget(),O=!0===v.isInstancedMesh,L=!0===v.isBatchedMesh,D=!!a.map,N=!!a.matcap,U=!!S,k=!!a.aoMap,B=!!a.lightMap,F=!!a.bumpMap,z=!!a.normalMap,H=!!a.displacementMap,j=!!a.emissiveMap,W=!!a.metalnessMap,G=!!a.roughnessMap,V=a.anisotropy>0,X=a.clearcoat>0,q=a.dispersion>0,Y=a.iridescence>0,Z=a.sheen>0,$=a.transmission>0,K=V&&!!a.anisotropyMap,J=X&&!!a.clearcoatMap,Q=X&&!!a.clearcoatNormalMap,ee=X&&!!a.clearcoatRoughnessMap,et=Y&&!!a.iridescenceMap,en=Y&&!!a.iridescenceThicknessMap,er=Z&&!!a.sheenColorMap,ei=Z&&!!a.sheenRoughnessMap,ea=!!a.specularMap,eo=!!a.specularColorMap,es=!!a.specularIntensityMap,el=$&&!!a.transmissionMap,eu=$&&!!a.thicknessMap,ec=!!a.gradientMap,eh=!!a.alphaMap,ed=a.alphaTest>0,ep=!!a.alphaHash,ef=!!a.extensions,em=0;a.toneMapped&&(null===I||!0===I.isXRRenderTarget)&&(em=e.toneMapping);let eg={shaderID:A,shaderType:a.type,shaderName:a.name,vertexShader:y,fragmentShader:b,defines:a.defines,customVertexShaderID:x,customFragmentShaderID:_,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:p,batching:L,batchingColor:L&&null!==v._colorsTexture,instancing:O,instancingColor:O&&null!==v.instanceColor,
203instancingMorph:O&&null!==v.morphTexture,supportsVertexTextures:d,outputColorSpace:null===I?e.outputColorSpace:!0===I.isXRRenderTarget?I.texture.colorSpace:rO,alphaToCoverage:!!a.alphaToCoverage,map:D,matcap:N,envMap:U,envMapMode:U&&S.mapping,envMapCubeUVHeight:T,aoMap:k,lightMap:B,bumpMap:F,normalMap:z,displacementMap:d&&H,emissiveMap:j,normalMapObjectSpace:z&&1===a.normalMapType,normalMapTangentSpace:z&&0===a.normalMapType,metalnessMap:W,roughnessMap:G,anisotropy:V,anisotropyMap:K,clearcoat:X,clearcoatMap:J,clearcoatNormalMap:Q,clearcoatRoughnessMap:ee,dispersion:q,iridescence:Y,iridescenceMap:et,iridescenceThicknessMap:en,sheen:Z,sheenColorMap:er,sheenRoughnessMap:ei,specularMap:ea,specularColorMap:eo,specularIntensityMap:es,transmission:$,transmissionMap:el,thicknessMap:eu,gradientMap:ec,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:eh,alphaTest:ed,alphaHash:ep,combine:a.combine,mapUv:D&&m(a.map.channel),aoMapUv:k&&m(a.aoMap.channel),lightMapUv:B&&m(a.lightMap.channel),bumpMapUv:F&&m(a.bumpMap.channel),normalMapUv:z&&m(a.normalMap.channel),displacementMapUv:H&&m(a.displacementMap.channel),emissiveMapUv:j&&m(a.emissiveMap.channel),metalnessMapUv:W&&m(a.metalnessMap.channel),roughnessMapUv:G&&m(a.roughnessMap.channel),anisotropyMapUv:K&&m(a.anisotropyMap.channel),clearcoatMapUv:J&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:Q&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ee&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:et&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:en&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:er&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:ei&&m(a.sheenRoughnessMap.channel),specularMapUv:ea&&m(a.specularMap.channel),specularColorMapUv:eo&&m(a.specularColorMap.channel),specularIntensityMapUv:es&&m(a.specularIntensityMap.channel),transmissionMapUv:el&&m(a.transmissionMap.channel),thicknessMapUv:eu&&m(a.thicknessMap.channel),alphaMapUv:eh&&m(a.alphaMap.channel),vertexTangents:!!M.attributes.tangent&&(z||V),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!M.attributes.color&&4===M.attributes.color.itemSize,pointsUvs:!0===v.isPoints&&!!M.attributes.uv&&(D||eh),fog:!!w,useFog:!0===a.fog,fogExp2:!!w&&w.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===v.isSkinnedMesh,morphTargets:void 0!==M.morphAttributes.position,morphNormals:void 0!==M.morphAttributes.normal,morphColors:void 0!==M.morphAttributes.color,morphTargetsCount:R,morphTextureStride:P,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:em,decodeVideoTexture:D&&!0===a.map.isVideoTexture&&r4.getTransfer(a.map.colorSpace)===rU,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:1===a.side,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:ef&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:ef&&!0===a.extensions.multiDraw&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return eg.vertexUv1s=u.has(1),eg.vertexUv2s=u.has(2),eg.vertexUv3s=u.has(3),u.clear(),eg},getProgramCacheKey:function(t){var n,r,i,a;let o=[];if(t.shaderID?o.push(t.shaderID):(o.push(t.customVertexShaderID),o.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)o.push(e),o.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(n=o,r=t,n.push(r.precision),n.push(r.outputColorSpace),n.push(r.envMapMode),n.push(r.envMapCubeUVHeight),n.push(r.mapUv),n.push(r.alphaMapUv),n.push(r.lightMapUv),n.push(r.aoMapUv),n.push(r.bumpMapUv),n.push(r.normalMapUv),n.push(r.displacementMapUv),n.push(r.emissiveMapUv),n.push(r.metalnessMapUv),n.push(r.roughnessMapUv),n.push(r.anisotropyMapUv),n.push(r.clearcoatMapUv),n.push(r.clearcoatNormalMapUv),n.push(r.clearcoatRoughnessMapUv),n.push(r.iridescenceMapUv),n.push(r.iridescenceThicknessMapUv),n.push(r.sheenColorMapUv),n.push(r.sheenRoughnessMapUv),n.push(r.specularMapUv),n.push(r.specularColorMapUv),n.push(r.specularIntensityMapUv),n.push(r.transmissionMapUv),n.push(r.thicknessMapUv),n.push(r.combine),n.push(r.fogExp2),n.push(r.sizeAttenuation),n.push(r.morphTargetsCount),n.push(r.morphAttributeCount),n.push(r.numDirLights),n.push(r.numPointLights),n.push(r.numSpotLights),n.push(r.numSpotLightMaps),n.push(r.numHemiLights),n.push(r.numRectAreaLights),n.push(r.numDirLightShadows),n.push(r.numPointLightShadows),n.push(r.numSpotLightShadows),n.push(r.numSpotLightShadowsWithMaps),n.push(r.numLightProbes),n.push(r.shadowMapType),n.push(r.toneMapping),n.push(r.numClippingPlanes),n.push(r.numClipIntersection),n.push(r.depthPacking),i=o,a=t,s.disableAll(),a.supportsVertexTextures&&s.enable(0),a.instancing&&s.enable(1),a.instancingColor&&s.enable(2),a.instancingMorph&&s.enable(3),a.matcap&&s.enable(4),a.envMap&&s.enable(5),a.normalMapObjectSpace&&s.enable(6),a.normalMapTangentSpace&&s.enable(7),a.clearcoat&&s.enable(8),a.iridescence&&s.enable(9),a.alphaTest&&s.enable(10),a.vertexColors&&s.enable(11),a.vertexAlphas&&s.enable(12),a.vertexUv1s&&s.enable(13),a.vertexUv2s&&s.enable(14),a.vertexUv3s&&s.enable(15),a.vertexTangents&&s.enable(16),a.anisotropy&&s.enable(17),a.alphaHash&&s.enable(18),a.batching&&s.enable(19),a.dispersion&&s.enable(20),a.batchingColor&&s.enable(21),i.push(s.mask),s.disableAll(),a.fog&&s.enable(0),a.useFog&&s.enable(1),a.flatShading&&s.enable(2),a.logarithmicDepthBuffer&&s.enable(3),a.skinning&&s.enable(4),a.morphTargets&&s.enable(5),a.morphNormals&&s.enable(6),a.morphColors&&s.enable(7),a.premultipliedAlpha&&s.enable(8),a.shadowMapEnabled&&s.enable(9),a.doubleSided&&s.enable(10),a.flipSided&&s.enable(11),a.useDepthPacking&&s.enable(12),a.dithering&&s.enable(13),a.transmission&&s.enable(14),a.sheen&&s.enable(15),a.opaque&&s.enable(16),a.pointsUvs&&s.enable(17),a.decodeVideoTexture&&s.enable(18),a.alphaToCoverage&&s.enable(19),i.push(s.mask),o.push(e.outputColorSpace)),o.push(t.customProgramCacheKey),o.join()},getUniforms:function(e){let t,n=f[e.type];if(n){let e=oM[n];t=ot.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,n){let r;for(let e=0,t=c.length;e<t;e++){let t=c[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new ln(e,n,t,a),c.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){let t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function ls(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function ll(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function lu(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function lc(){let e=[],t=0,n=[],r=[],i=[];function a(n,r,i,a,o,s){let l=e[t];
203return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=o,l.group=s),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,o,s,l,u){let c=a(e,t,o,s,l,u);o.transmission>0?r.push(c):!0===o.transparent?i.push(c):n.push(c)},unshift:function(e,t,o,s,l,u){let c=a(e,t,o,s,l,u);o.transmission>0?r.unshift(c):!0===o.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=t,r=e.length;n<r;n++){let t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||ll),r.length>1&&r.sort(t||lu),i.length>1&&i.sort(t||lu)}}}function lh(){let e=new WeakMap;return{get:function(t,n){let r,i=e.get(t);return void 0===i?(r=new lc,e.set(t,[r])):n>=i.length?(r=new lc,i.push(r)):r=i[n],r},dispose:function(){e=new WeakMap}}}function ld(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":n={direction:new ih,color:new a_};break;case"SpotLight":n={position:new ih,direction:new ih,color:new a_,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ih,color:new a_,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ih,skyColor:new a_,groundColor:new a_};break;case"RectAreaLight":n={color:new a_,position:new ih,halfWidth:new ih,halfHeight:new ih}}return e[t.id]=n,n}}}let lp=0;function lf(e,t){return 2*!!t.castShadow-2*!!e.castShadow+ +!!t.map-!!e.map}function lm(e){let t=new ld,n=function(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new rY};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new rY,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new ih);let i=new ih,a=new ij,o=new ij;return{setup:function(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,u=0,c=0,h=0,d=0,p=0,f=0,m=0,g=0,v=0,y=0;i.sort(lf);for(let e=0,b=i.length;e<b;e++){let b=i[e],x=b.color,_=b.intensity,w=b.distance,M=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)a+=x.r*_,o+=x.g*_,s+=x.b*_;else if(b.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(b.sh.coefficients[e],_);y++}else if(b.isDirectionalLight){let e=t.get(b);if(e.color.copy(b.color).multiplyScalar(b.intensity),b.castShadow){let e=b.shadow,t=n.get(b);t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[l]=t,r.directionalShadowMap[l]=M,r.directionalShadowMatrix[l]=b.shadow.matrix,p++}r.directional[l]=e,l++}else if(b.isSpotLight){let e=t.get(b);e.position.setFromMatrixPosition(b.matrixWorld),e.color.copy(x).multiplyScalar(_),e.distance=w,e.coneCos=Math.cos(b.angle),e.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),e.decay=b.decay,r.spot[c]=e;let i=b.shadow;if(b.map&&(r.spotLightMap[g]=b.map,g++,i.updateMatrices(b),b.castShadow&&v++),r.spotLightMatrix[c]=i.matrix,b.castShadow){let e=n.get(b);e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[c]=e,r.spotShadowMap[c]=M,m++}c++}else if(b.isRectAreaLight){let e=t.get(b);e.color.copy(x).multiplyScalar(_),e.halfWidth.set(.5*b.width,0,0),e.halfHeight.set(0,.5*b.height,0),r.rectArea[h]=e,h++}else if(b.isPointLight){let e=t.get(b);if(e.color.copy(b.color).multiplyScalar(b.intensity),e.distance=b.distance,e.decay=b.decay,b.castShadow){let e=b.shadow,t=n.get(b);
203t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[u]=t,r.pointShadowMap[u]=M,r.pointShadowMatrix[u]=b.shadow.matrix,f++}r.point[u]=e,u++}else if(b.isHemisphereLight){let e=t.get(b);e.skyColor.copy(b.color).multiplyScalar(_),e.groundColor.copy(b.groundColor).multiplyScalar(_),r.hemi[d]=e,d++}}h>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=ow.LTC_FLOAT_1,r.rectAreaLTC2=ow.LTC_FLOAT_2):(r.rectAreaLTC1=ow.LTC_HALF_1,r.rectAreaLTC2=ow.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let b=r.hash;(b.directionalLength!==l||b.pointLength!==u||b.spotLength!==c||b.rectAreaLength!==h||b.hemiLength!==d||b.numDirectionalShadows!==p||b.numPointShadows!==f||b.numSpotShadows!==m||b.numSpotMaps!==g||b.numLightProbes!==y)&&(r.directional.length=l,r.spot.length=c,r.rectArea.length=h,r.point.length=u,r.hemi.length=d,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=f,r.pointShadowMap.length=f,r.spotShadow.length=m,r.spotShadowMap.length=m,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=f,r.spotLightMatrix.length=m+g-v,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=v,r.numLightProbes=y,b.directionalLength=l,b.pointLength=u,b.spotLength=c,b.rectAreaLength=h,b.hemiLength=d,b.numDirectionalShadows=p,b.numPointShadows=f,b.numSpotShadows=m,b.numSpotMaps=g,b.numLightProbes=y,r.version=lp++)},setupView:function(e,t){let n=0,s=0,l=0,u=0,c=0,h=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){let d=e[t];if(d.isDirectionalLight){let e=r.directional[n];e.direction.setFromMatrixPosition(d.matrixWorld),i.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(h),n++}else if(d.isSpotLight){let e=r.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(d.matrixWorld),i.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(h),l++}else if(d.isRectAreaLight){let e=r.rectArea[u];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),o.identity(),a.copy(d.matrixWorld),a.premultiply(h),o.extractRotation(a),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),u++}else if(d.isPointLight){let e=r.point[s];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),s++}else if(d.isHemisphereLight){let e=r.hemi[c];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(h),c++}}},state:r}}function lg(e){let t=new lm(e),n=[],r=[],i={lightsArray:n,shadowsArray:r,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){i.camera=e,n.length=0,r.length=0},state:i,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function lv(e){let t=new WeakMap;return{get:function(n,r=0){let i,a=t.get(n);return void 0===a?(i=new lg(e),t.set(n,[i])):r>=a.length?(i=new lg(e),a.push(i)):i=a[r],i},dispose:function(){t=new WeakMap}}}class ly extends aE{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class lb extends aE{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function lx(e,t,n){let r=new ov,i=new rY,a=new rY,o=new ia,s=new ly({depthPacking:3201}),l=new lb,u={},c=n.maxTextureSize,h={0:1,1:0,2:2}
203,d=new on({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new rY},radius:{value:4}},vertexShader:"void main() {\n	gl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n	const float samples = float( VSM_SAMPLES );\n	float mean = 0.0;\n	float squared_mean = 0.0;\n	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n	for ( float i = 0.0; i < samples; i ++ ) {\n		float uvOffset = uvStart + i * uvStride;\n		#ifdef HORIZONTAL_PASS\n			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n			mean += distribution.x;\n			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n		#else\n			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n			mean += depth;\n			squared_mean += depth * depth;\n		#endif\n	}\n	mean = mean / samples;\n	squared_mean = squared_mean / samples;\n	float std_dev = sqrt( squared_mean - mean * mean );\n	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;let f=new aH;f.setAttribute("position",new aP(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new a4(f,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let v=this.type;function y(t,n,r,i){let a=null,o=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?l:s,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){let e=a.uuid,t=n.uuid,r=u[e];void 0===r&&(r={},u[e]=r);let i=r[t];void 0===i&&(i=a.clone(),r[t]=i,n.addEventListener("dispose",b)),a=i}return a.visible=n.visible,a.wireframe=n.wireframe,3===i?a.side=null!==n.shadowSide?n.shadowSide:n.side:a.side=null!==n.shadowSide?n.shadowSide:h[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=r),a}function b(e){for(let t in e.target.removeEventListener("dispose",b),u){let n=u[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}this.render=function(n,s,l){if(!1===g.enabled||!1===g.autoUpdate&&!1===g.needsUpdate||0===n.length)return;let u=e.getRenderTarget(),h=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),b=e.state;b.setBlending(0),b.buffers.color.setClear(1,1,1,1),b.buffers.depth.setTest(!0),b.setScissorTest(!1);let x=3!==v&&3===this.type,_=3===v&&3!==this.type;for(let u=0,h=n.length;u<h;u++){let h=n[u],f=h.shadow;if(void 0===f){console.warn("THREE.WebGLShadowMap:",h,"has no shadow.");continue}if(!1===f.autoUpdate&&!1===f.needsUpdate)continue;i.copy(f.mapSize);let g=f.getFrameExtents();if(i.multiply(g),a.copy(f.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/g.x),i.x=a.x*g.x,f.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/g.y),i.y=a.y*g.y,f.mapSize.y=a.y)),null===f.map||!0===x||!0===_){let e=3!==this.type?{minFilter:1003,magFilter:1003}:{};null!==f.map&&f.map.dispose(),f.map=new is(i.x,i.y,e),f.map.texture.name=h.name+".shadowMap",f.camera.updateProjectionMatrix()}e.setRenderTarget(f.map),e.clear();let v=f.getViewportCount();for(let n=0;n<v;n++){let i=f.getViewport(n);o.set(a.x*i.x,a.y*i.y,a.x*i.z,a.y*i.w),b.viewport(o),f.updateMatrices(h,n),r=f.getFrustum(),function n(i,a,o,s,l){if(!1===i.visible)return;if(i.layers.test(a.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&3===l)&&(!i.frustumCulled||r.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,i.matrixWorld);let n=t.update(i),r=i.material;if(Array.isArray(r)){let t=n.groups;for(let u=0,c=t.length;u<c;u++){let c=t[u],h=r[c.materialIndex];if(h&&h.visible){let t=y(i,h,s,l);i.onBeforeShadow(e,i,a,o,n,t,c),e.renderBufferDirect(o,null,n,t,i,c),i.onAfterShadow(e,i,a,o,n,t,c)}}}else if(r.visible){let t=y(i,r,s,l);i.onBeforeShadow(e,i,a,o,n,t,null),e.renderBufferDirect(o,null,n,t,i,null),i.onAfterShadow(e,i,a,o,n,t,null)}}let u=i.children;for(let e=0,t=u.length;e<t;e++)n(u[e],a,o,s,l)}(s,l,f.camera,h,this.type)}!0!==f.isPointLightShadow&&3===this.type&&function(n,r){let a=t.update(m);d.defines.VSM_SAMPLES!==n.blurSamples&&(d.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,d.needsUpdate=!0,p.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new is(i.x,i.y)),d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,a,d,m,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,a,p,m,null)}(f,l),f.needsUpdate=!1}
203v=this.type,g.needsUpdate=!1,e.setRenderTarget(u,h,f)}}function l_(e){let t=new function(){let t=!1,n=new ia,r=null,i=new ia(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,a,o,s){!0===s&&(t*=o,r*=o,a*=o),n.set(t,r,a,o),!1===i.equals(n)&&(e.clearColor(t,r,a,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},n=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(t){t?B(e.DEPTH_TEST):F(e.DEPTH_TEST)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},r=new function(){let t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null;return{setTest:function(n){t||(n?B(e.STENCIL_TEST):F(e.STENCIL_TEST))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){(r!==t||i!==n||a!==o)&&(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){(o!==t||s!==n||l!==r)&&(e.stencilOp(t,n,r),o=t,s=n,l=r)},setLocked:function(e){t=e},setClear:function(t){u!==t&&(e.clearStencil(t),u=t)},reset:function(){t=!1,n=null,r=null,i=null,a=null,o=null,s=null,l=null,u=null}}},i=new WeakMap,a=new WeakMap,o={},s={},l=new WeakMap,u=[],c=null,h=!1,d=null,p=null,f=null,m=null,g=null,v=null,y=null,b=new a_(0,0,0),x=0,_=!1,w=null,M=null,E=null,S=null,T=null,A=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),C=!1,R=e.getParameter(e.VERSION);-1!==R.indexOf("WebGL")?C=parseFloat(/^WebGL (\d)/.exec(R)[1])>=1:-1!==R.indexOf("OpenGL ES")&&(C=parseFloat(/^OpenGL ES (\d)/.exec(R)[1])>=2);let P=null,I={},O=e.getParameter(e.SCISSOR_BOX),L=e.getParameter(e.VIEWPORT),D=new ia().fromArray(O),N=new ia().fromArray(L);function U(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o<r;o++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return o}let k={};function B(t){!0!==o[t]&&(e.enable(t),o[t]=!0)}function F(t){!1!==o[t]&&(e.disable(t),o[t]=!1)}k[e.TEXTURE_2D]=U(e.TEXTURE_2D,e.TEXTURE_2D,1),k[e.TEXTURE_CUBE_MAP]=U(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),k[e.TEXTURE_2D_ARRAY]=U(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),k[e.TEXTURE_3D]=U(e.TEXTURE_3D,e.TEXTURE_3D,1,1),t.setClear(0,0,0,1),n.setClear(1),r.setClear(0),B(e.DEPTH_TEST),n.setFunc(3),W(!1),G(1),B(e.CULL_FACE),j(0);let z={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};z[103]=e.MIN,z[104]=e.MAX;let H={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function j(t,n,r,i,a,o,s,l,u,c){if(0===t){!0===h&&(F(e.BLEND),h=!1);return}if(!1===h&&(B(e.BLEND),h=!0),5!==t){if(t!==d||c!==_){if((100!==p||100!==g)&&(e.blendEquation(e.FUNC_ADD),p=100,g=100),c)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}f=null,m=null,v=null,y=null,b.set(0,0,0),x=0,d=t,_=c}return}a=a||n,o=o||r,s=s||i,(n!==p||a!==g)&&(e.blendEquationSeparate(z[n],z[a]),p=n,g=a),(r!==f||i!==m||o!==v||s!==y)&&(e.blendFuncSeparate(H[r],H[i],H[o],H[s]),f=r,m=i,v=o,y=s),(!1===l.equals(b)||u!==x)&&(e.blendColor
vendor: 4,261 bytes, line 203
203(l.r,l.g,l.b,u),b.copy(l),x=u),d=t,_=!1}function W(t){w!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),w=t)}function G(t){0!==t?(B(e.CULL_FACE),t!==M&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):F(e.CULL_FACE),M=t}function V(t,n,r){t?(B(e.POLYGON_OFFSET_FILL),(S!==n||T!==r)&&(e.polygonOffset(n,r),S=n,T=r)):F(e.POLYGON_OFFSET_FILL)}return{buffers:{color:t,depth:n,stencil:r},enable:B,disable:F,bindFramebuffer:function(t,n){return s[t]!==n&&(e.bindFramebuffer(t,n),s[t]=n,t===e.DRAW_FRAMEBUFFER&&(s[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(s[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let r=u,i=!1;if(t){void 0===(r=l.get(n))&&(r=[],l.set(n,r));let a=t.textures;if(r.length!==a.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=a.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)},useProgram:function(t){return c!==t&&(e.useProgram(t),c=t,!0)},setBlending:j,setMaterial:function(i,a){2===i.side?F(e.CULL_FACE):B(e.CULL_FACE);let o=1===i.side;a&&(o=!o),W(o),1===i.blending&&!1===i.transparent?j(0):j(i.blending,i.blendEquation,i.blendSrc,i.blendDst,i.blendEquationAlpha,i.blendSrcAlpha,i.blendDstAlpha,i.blendColor,i.blendAlpha,i.premultipliedAlpha),n.setFunc(i.depthFunc),n.setTest(i.depthTest),n.setMask(i.depthWrite),t.setMask(i.colorWrite);let s=i.stencilWrite;r.setTest(s),s&&(r.setMask(i.stencilWriteMask),r.setFunc(i.stencilFunc,i.stencilRef,i.stencilFuncMask),r.setOp(i.stencilFail,i.stencilZFail,i.stencilZPass)),V(i.polygonOffset,i.polygonOffsetFactor,i.polygonOffsetUnits),!0===i.alphaToCoverage?B(e.SAMPLE_ALPHA_TO_COVERAGE):F(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:W,setCullFace:G,setLineWidth:function(t){t!==E&&(C&&e.lineWidth(t),E=t)},setPolygonOffset:V,setScissorTest:function(t){t?B(e.SCISSOR_TEST):F(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+A-1),P!==t&&(e.activeTexture(t),P=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===P?e.TEXTURE0+A-1:P);let i=I[r];void 0===i&&(i={type:void 0,texture:void 0},I[r]=i),(i.type!==t||i.texture!==n)&&(P!==r&&(e.activeTexture(r),P=r),e.bindTexture(t,n||k[t]),i.type=t,i.texture=n)},unbindTexture:function(){let t=I[P];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},updateUBOMapping:function(t,n){let r=a.get(n);void 0===r&&(r=new WeakMap,a.set(n,r));let i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){let r=a.get(n).get(t);i.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),i.set(n,r))},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===D.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),D.copy(t))},viewport:function(t){!1===N.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),N.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor
203(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(0xffffffff),e.stencilFunc(e.ALWAYS,0,0xffffffff),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),o={},P=null,I={},s={},l=new WeakMap,u=[],c=null,h=!1,d=null,p=null,f=null,m=null,g=null,v=null,y=null,b=new a_(0,0,0),x=0,_=!1,w=null,M=null,E=null,S=null,T=null,D.set(0,0,e.canvas.width,e.canvas.height),N.set(0,0,e.canvas.width,e.canvas.height),t.reset(),n.reset(),r.reset()}}}function lw(e,t,n,r,i,a,o){let s,l=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,u="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new rY,h=new WeakMap,d=new WeakMap,p=!1;try{p="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function f(e,t){return p?new OffscreenCanvas(e,t):rJ("canvas")}function m(e,t,n){let r=1,i=z(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1)if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);void 0===s&&(s=f(n,a));let o=t?f(n,a):s;return o.width=n,o.height=a,o.getContext("2d").drawImage(e,0,0,n,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+i.width+"x"+i.height+") to ("+n+"x"+a+")."),o}else"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+i.width+"x"+i.height+").");return e}function g(e){return e.generateMipmaps&&1003!==e.minFilter&&1006!==e.minFilter}function v(t){e.generateMipmap(t)}function y(n,r,i,a,o=!1){if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let s=r;if(r===e.RED&&(i===e.FLOAT&&(s=e.R32F),i===e.HALF_FLOAT&&(s=e.R16F),i===e.UNSIGNED_BYTE&&(s=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.R8UI),i===e.UNSIGNED_SHORT&&(s=e.R16UI),i===e.UNSIGNED_INT&&(s=e.R32UI),i===e.BYTE&&(s=e.R8I),i===e.SHORT&&(s=e.R16I),i===e.INT&&(s=e.R32I)),r===e.RG&&(i===e.FLOAT&&(s=e.RG32F),i===e.HALF_FLOAT&&(s=e.RG16F),i===e.UNSIGNED_BYTE&&(s=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(s=e.RG8UI),i===e.UNSIGNED_SHORT&&(s=e.RG16UI),i===e.UNSIGNED_INT&&(s=e.RG32UI),i===e.BYTE&&(s=e.RG8I),i===e.SHORT&&(s=e.RG16I),i===e.INT&&(s=e.RG32I)),r===e.RGB&&i===e.UNSIGNED_INT_5_9_9_9_REV&&(s=e.RGB9_E5),r===e.RGBA){let t=o?rN:r4.getTransfer(a);i===e.FLOAT&&(s=e.RGBA32F),i===e.HALF_FLOAT&&(s=e.RGBA16F),i===e.UNSIGNED_BYTE&&(s=t===rU?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(s=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(s=e.RGB5_A1)}return(s===e.R16F||s===e.R32F||s===e.RG16F||s===e.RG32F||s===e.RGBA16F||s===e.RGBA32F)&&t.get("EXT_color_buffer_float"),s}function b(t,n){let r;return t?null===n||1014===n||1020===n?r=e.DEPTH24_STENCIL8:1015===n?r=e.DEPTH32F_STENCIL8:1012===n&&(r=e.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||1014===n||1020===n?r=e.DEPTH_COMPONENT24:1015===n?r=e.DEPTH_COMPONENT32F:1012===n&&(r=e.DEPTH_COMPONENT16),r}function x(e,t){return!0===g(e)||e.isFramebufferTexture&&1003!==e.minFilter&&1006!==e.minFilter?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function _(e){let t=e.target;t.removeEventListener("dispose",_),function(e){let t=r.get(e);if(void 0===t.__webglInit)return;let n=e.source,i=d.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&M(e),0===Object.keys(i).length&&d.delete(n)}r.remove(e)}(t),t.isVideoTexture&&h.delete(t)}function w(t){let n=t.target;n.removeEventListener("dispose",w),function(t){let n=r.get(t);
203if(t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r<n.__webglFramebuffer[t].length;r++)e.deleteFramebuffer(n.__webglFramebuffer[t][r]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}let i=t.textures;for(let t=0,n=i.length;t<n;t++){let n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[t])}r.remove(t)}(n)}function M(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=d.get(i);delete a[n.__cacheKey],o.memory.textures--}let E=0;function S(t,i){let a=r.get(t);if(t.isVideoTexture&&function(e){let t=o.render.frame;h.get(e)!==t&&(h.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version){let e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void I(a,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}let T={1e3:e.REPEAT,1001:e.CLAMP_TO_EDGE,1002:e.MIRRORED_REPEAT},A={1003:e.NEAREST,1004:e.NEAREST_MIPMAP_NEAREST,1005:e.NEAREST_MIPMAP_LINEAR,1006:e.LINEAR,1007:e.LINEAR_MIPMAP_NEAREST,1008:e.LINEAR_MIPMAP_LINEAR},C={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function R(n,a){if((1015===a.type&&!1===t.has("OES_texture_float_linear")&&(1006===a.magFilter||1007===a.magFilter||1005===a.magFilter||1008===a.magFilter||1006===a.minFilter||1007===a.minFilter||1005===a.minFilter||1008===a.minFilter)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,T[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,T[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,T[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,A[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,A[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,C[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic"))&&1003!==a.magFilter&&(1005===a.minFilter||1008===a.minFilter)&&(1015!==a.type||!1!==t.has("OES_texture_float_linear"))&&(a.anisotropy>1||r.get(a).__currentAnisotropy)){let o=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}function P(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",_));let i=n.source,a=d.get(i);void 0===a&&(a={},d.set(i,a));let s=function(e){let t=[];
203return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(s!==t.__cacheKey){void 0===a[s]&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];void 0!==i&&(a[t.__cacheKey].usedTimes--,0===i.usedTimes&&M(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function I(t,o,s){let l=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=e.TEXTURE_3D);let u=P(t,o),c=o.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+s);let h=r.get(c);if(c.version!==h.__version||!0===u){let t;n.activeTexture(e.TEXTURE0+s);let r=r4.getPrimaries(r4.workingColorSpace),d=""===o.colorSpace?null:r4.getPrimaries(o.colorSpace),p=""===o.colorSpace||r===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);let f=m(o.image,!1,i.maxTextureSize);f=F(o,f);let _=a.convert(o.format,o.colorSpace),w=a.convert(o.type),M=y(o.internalFormat,_,w,o.colorSpace,o.isVideoTexture);R(l,o);let E=o.mipmaps,S=!0!==o.isVideoTexture,T=void 0===h.__version||!0===u,A=c.dataReady,C=x(o,f);if(o.isDepthTexture)M=b(1027===o.format,o.type),T&&(S?n.texStorage2D(e.TEXTURE_2D,1,M,f.width,f.height):n.texImage2D(e.TEXTURE_2D,0,M,f.width,f.height,0,_,w,null));else if(o.isDataTexture)if(E.length>0){S&&T&&n.texStorage2D(e.TEXTURE_2D,C,M,E[0].width,E[0].height);for(let r=0,i=E.length;r<i;r++)t=E[r],S?A&&n.texSubImage2D(e.TEXTURE_2D,r,0,0,t.width,t.height,_,w,t.data):n.texImage2D(e.TEXTURE_2D,r,M,t.width,t.height,0,_,w,t.data);o.generateMipmaps=!1}else S?(T&&n.texStorage2D(e.TEXTURE_2D,C,M,f.width,f.height),A&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,f.width,f.height,_,w,f.data)):n.texImage2D(e.TEXTURE_2D,0,M,f.width,f.height,0,_,w,f.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){S&&T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,M,E[0].width,E[0].height,f.depth);for(let r=0,i=E.length;r<i;r++)if(t=E[r],1023!==o.format)if(null!==_)if(S){if(A)if(o.layerUpdates.size>0){for(let i of o.layerUpdates){let a=t.width*t.height;n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,i,t.width,t.height,1,_,t.data.slice(a*i,a*(i+1)),0,0)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,t.width,t.height,f.depth,_,t.data,0,0)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,r,M,t.width,t.height,f.depth,0,t.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else S?A&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,t.width,t.height,f.depth,_,w,t.data):n.texImage3D(e.TEXTURE_2D_ARRAY,r,M,t.width,t.height,f.depth,0,_,w,t.data)}else{S&&T&&n.texStorage2D(e.TEXTURE_2D,C,M,E[0].width,E[0].height);for(let r=0,i=E.length;r<i;r++)t=E[r],1023!==o.format?null!==_?S?A&&n.compressedTexSubImage2D(e.TEXTURE_2D,r,0,0,t.width,t.height,_,t.data):n.compressedTexImage2D(e.TEXTURE_2D,r,M,t.width,t.height,0,t.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):S?A&&n.texSubImage2D(e.TEXTURE_2D,r,0,0,t.width,t.height,_,w,t.data):n.texImage2D(e.TEXTURE_2D,r,M,t.width,t.height,0,_,w,t.data)}else if(o.isDataArrayTexture)if(S){if(T&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,M,f.width,f.height,f.depth),A)if(o.layerUpdates.size>0){let t;switch(w){case e.UNSIGNED_BYTE:switch(_){case e.ALPHA:case e.LUMINANCE:t=1;break;case e.LUMINANCE_ALPHA:t=2;break;case e.RGB:t=3;break;case e.RGBA:t=4;break;default:throw Error(`Unknown texel size for format ${_}.`)}break;case e.UNSIGNED_SHORT_4_4_4_4:case e.UNSIGNED_SHORT_5_5_5_1:case e.UNSIGNED_SHORT_5_6_5:t=1;break;default:throw Error(`Unknown texel size for type ${w}.`)}let r=f.width*f.height*t;
203for(let t of o.layerUpdates)n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,t,f.width,f.height,1,_,w,f.data.slice(r*t,r*(t+1)));o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,f.width,f.height,f.depth,_,w,f.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,M,f.width,f.height,f.depth,0,_,w,f.data);else if(o.isData3DTexture)S?(T&&n.texStorage3D(e.TEXTURE_3D,C,M,f.width,f.height,f.depth),A&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,f.width,f.height,f.depth,_,w,f.data)):n.texImage3D(e.TEXTURE_3D,0,M,f.width,f.height,f.depth,0,_,w,f.data);else if(o.isFramebufferTexture){if(T)if(S)n.texStorage2D(e.TEXTURE_2D,C,M,f.width,f.height);else{let t=f.width,r=f.height;for(let i=0;i<C;i++)n.texImage2D(e.TEXTURE_2D,i,M,t,r,0,_,w,null),t>>=1,r>>=1}}else if(E.length>0){if(S&&T){let t=z(E[0]);n.texStorage2D(e.TEXTURE_2D,C,M,t.width,t.height)}for(let r=0,i=E.length;r<i;r++)t=E[r],S?A&&n.texSubImage2D(e.TEXTURE_2D,r,0,0,_,w,t):n.texImage2D(e.TEXTURE_2D,r,M,_,w,t);o.generateMipmaps=!1}else if(S){if(T){let t=z(f);n.texStorage2D(e.TEXTURE_2D,C,M,t.width,t.height)}A&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,_,w,f)}else n.texImage2D(e.TEXTURE_2D,0,M,_,w,f);g(o)&&v(l),h.__version=c.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function O(t,i,o,s,u,c){let h=a.convert(o.format,o.colorSpace),d=a.convert(o.type),p=y(o.internalFormat,h,d,o.colorSpace);if(!r.get(i).__hasExternalTextures){let t=Math.max(1,i.width>>c),r=Math.max(1,i.height>>c);u===e.TEXTURE_3D||u===e.TEXTURE_2D_ARRAY?n.texImage3D(u,c,p,t,r,i.depth,0,h,d,null):n.texImage2D(u,c,p,t,r,0,h,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),B(i)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,s,u,r.get(o).__webglTexture,0,k(i)):(u===e.TEXTURE_2D||u>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,s,u,r.get(o).__webglTexture,c),n.bindFramebuffer(e.FRAMEBUFFER,null)}function L(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=b(n.stencilBuffer,a),s=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=k(n);B(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,u,o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,u,o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,s,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i<t.length;i++){let o=t[i],s=a.convert(o.format,o.colorSpace),u=a.convert(o.type),c=y(o.internalFormat,s,u,o.colorSpace),h=k(n);r&&!1===B(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,h,c,n.width,n.height):B(n)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,h,c,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,c,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function D(t){let i=r.get(t),a=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw Error("target.depthTexture not supported in Cube render targets");var o=i.__webglFramebuffer;if(t&&t.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,o),!(t.depthTexture&&t.depthTexture.isDepthTexture))throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),S(t.depthTexture,0);let s=r.get(t.depthTexture).__webglTexture,u=k(t);if(1026===t.depthTexture.format)B(t)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0,u):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,s,0);else if(1027===t.depthTexture.format)B(t)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0,u):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,s,0);else throw Error("Unknown depthTexture format")}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),L(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),L(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(e.FRAMEBUFFER,null)}let N=[],U=[];function k(e){return Math.min(i.maxSamples,e.samples)}function B(e){let n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function F(e,t){let n=e.colorSpace,r=e.format,i=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==rO&&""!==n&&(r4.getTransfer(n)===rU?(1023!==r||1009!==i)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",n)),t}function z(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(c.width=e.naturalWi
203dth||e.width,c.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(c.width=e.displayWidth,c.height=e.displayHeight):(c.width=e.width,c.height=e.height),c}this.allocateTextureUnit=function(){let e=E;return e>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+i.maxTextures),E+=1,e},this.resetTextureUnits=function(){E=0},this.setTexture2D=S,this.setTexture2DArray=function(t,i){let a=r.get(t);if(t.version>0&&a.__version!==t.version)return void I(a,t,i);n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){let a=r.get(t);if(t.version>0&&a.__version!==t.version)return void I(a,t,i);n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,o){let s=r.get(t);if(t.version>0&&s.__version!==t.version)return void function(t,o,s){if(6!==o.image.length)return;let l=P(t,o),u=o.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+s);let c=r.get(u);if(u.version!==c.__version||!0===l){let t;n.activeTexture(e.TEXTURE0+s);let r=r4.getPrimaries(r4.workingColorSpace),h=""===o.colorSpace?null:r4.getPrimaries(o.colorSpace),d=""===o.colorSpace||r===h?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let p=o.isCompressedTexture||o.image[0].isCompressedTexture,f=o.image[0]&&o.image[0].isDataTexture,b=[];for(let e=0;e<6;e++)p||f?b[e]=f?o.image[e].image:o.image[e]:b[e]=m(o.image[e],!0,i.maxCubemapSize),b[e]=F(o,b[e]);let _=b[0],w=a.convert(o.format,o.colorSpace),M=a.convert(o.type),E=y(o.internalFormat,w,M,o.colorSpace),S=!0!==o.isVideoTexture,T=void 0===c.__version||!0===l,A=u.dataReady,C=x(o,_);if(R(e.TEXTURE_CUBE_MAP,o),p){S&&T&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,E,_.width,_.height);for(let r=0;r<6;r++){t=b[r].mipmaps;for(let i=0;i<t.length;i++){let a=t[i];1023!==o.format?null!==w?S?A&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,i,0,0,a.width,a.height,w,a.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,i,E,a.width,a.height,0,a.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):S?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,i,0,0,a.width,a.height,w,M,a.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,i,E,a.width,a.height,0,w,M,a.data)}}}else{if(t=o.mipmaps,S&&T){t.length>0&&C++;let r=z(b[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,E,r.width,r.height)}for(let r=0;r<6;r++)if(f){S?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,0,0,b[r].width,b[r].height,w,M,b[r].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,E,b[r].width,b[r].height,0,w,M,b[r].data);for(let i=0;i<t.length;i++){let a=t[i].image[r].image;S?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,i+1,0,0,a.width,a.height,w,M,a.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,i+1,E,a.width,a.height,0,w,M,a.data)}}else{S?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,0,0,w,M,b[r]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,0,E,w,M,b[r]);for(let i=0;i<t.length;i++){let a=t[i];S?A&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,i+1,0,0,w,M,a.image[r]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,i+1,E,w,M,a.image[r])}}}g(o)&&v(e.TEXTURE_CUBE_MAP),c.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(s,t,o);n.bindTexture(e.TEXTURE_CUBE_MAP,s.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,n,i){let a=r.get(t);void 0!==n&&O(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&D(t)},this.setupRenderTarget=function(t){let i=t.texture,s=r.get(t),l=r.get(i);t.addEventListener("dispose",w);let u=t.textures,c=!0===t.isWebGLCubeRenderTarget,h=u.length>1;if(!h&&(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,o.memory.textures++),c){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)s.__webglFramebuffer[t][n]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(h)for(let t=0,n=u.length;t<n;t++){let n=r.get(u[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===B(t)){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRen
203derbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n<u.length;n++){let r=u[n];s.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[n]);let i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),l=y(r.internalFormat,i,o,r.colorSpace,!0===t.isXRRenderTarget),c=k(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,c,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,s.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),L(s.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(c){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),R(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)O(s.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else O(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);g(i)&&v(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(h){for(let i=0,a=u.length;i<a;i++){let a=u[i],o=r.get(a);n.bindTexture(e.TEXTURE_2D,o.__webglTexture),R(e.TEXTURE_2D,a),O(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+i,e.TEXTURE_2D,0),g(a)&&v(e.TEXTURE_2D)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,l.__webglTexture),R(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)O(s.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else O(s.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);g(i)&&v(r),n.unbindTexture()}t.depthBuffer&&D(t)},this.updateRenderTargetMipmap=function(t){let i=t.textures;for(let a=0,o=i.length;a<o;a++){let o=i[a];if(g(o)){let i=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=r.get(o).__webglTexture;n.bindTexture(i,a),v(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0){if(!1===B(t)){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=r.get(t),h=i.length>1;if(h)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,c.__webglMultisampledFramebuffer),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(s|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(s|=e.STENCIL_BUFFER_BIT)),h){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,c.__webglColorRenderbuffer[n]);let t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,o,0,0,a,o,s,e.NEAREST),!0===u&&(N.length=0,U.length=0,N.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(N.push(l),U.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,U)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,N))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),h)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,c.__webglColorRenderbuffer[t]);let a=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&u){let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}}},this.setupDepthRenderbuffer=D,this.setupFrameBufferTexture=O,this.useMultisampledRTT=B}function lM(e,t){return{convert:function(n,r=""){let i,a=r4.getTransfer(r);if(1009===n)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(35902===n)return e.UNSIGNED_INT_5_9_9_9_REV;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(1012===n)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(1014===n)return e.UNSIGNED_INT;if(1015===n)return e.FLOAT;if(1016===n)return e.HALF_FLOAT;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(1023===n)return e.RGBA;if(1024===n)return e.LUMINANCE;if(1025===n)return e.LUMINANCE_ALPHA;if(1026===n)return e.DEPTH_COMPONENT;if(1027===n)return e.DEPTH_STENCIL;if(1028===n)return e.RED;if(1029===n)return e.RED_INTEGER;if(1030===n)return e.RG;if(1031===n)return e.RG_INTEGER;if(1033===n)return e.RGBA_INTEGER;if(33776===n||33777===n||33778===n||33779===n)if(a===rU){if(null===(i=t.get("WEBGL_compressed_texture_s3tc_srgb")))return null;if(33776===n)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(33777===n)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(33778===n)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(33779===n)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(null===(i=t.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===n)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(null===(i=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===n)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n||37492===n||37496===n){if(null===(i=t.get("WEBGL_compressed_texture_etc")))return null;if(36196===n||37492===n)return a===rU?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(37496===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(null===(i=t.get("WEBGL_compressed_texture_astc")))return null;if(37808===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return a===rU?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(36492===n||36494===n||36495===n){if(null===(i=t.get("EXT_texture_compression_bptc")))return null;if(36492===n)return a===rU?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(null===(i=t.get("EXT_texture_compression_rgtc")))return null;
203if(36492===n)return i.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return 1020===n?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class lE extends os{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class lS extends aa{constructor(){super(),this.isGroup=!0,this.type="Group"}}let lT={type:"move"};class lA{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new lS,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 lS,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ih,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ih),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new lS,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ih,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ih),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,a=null,o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let r of(a=!0,e.hand.values())){let e=t.getJointPose(r,n),i=this._getHandJoint(l,r);null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=null!==e}let r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],o=r.position.distanceTo(i.position);l.inputState.pinching&&o>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&null!==(i=t.getPose(e.gripSpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1);null!==o&&(null===(r=t.getPose(e.targetRaySpace,n))&&null!==i&&(r=i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(lT)))}return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let n=new lS;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}let lC=`
204void main() {
205
206	gl_Position = vec4( position, 1.0 );
207
208}`,lR=`
209uniform sampler2DArray depthColor;
210uniform float depthWidth;
211uniform float depthHeight;
212
213void main() {
214
215	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
216
217	if ( coord.x >= 1.0 ) {
218
219		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
220
221	} else {
222
223		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
224
225	}
226
227}`;class lP{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){let r=new ii;e.properties.get(r).__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,n=new on({vertexShader:lC,fragmentShader:lR,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new a4(new ox(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}}class lI extends rF{constructor(e,t){super();let n=this,r=null,i=1,a=null,o="local-floor",s=1,l=null,u=null,c=null,h=null,d=null,p=null,f=new lP,m=t.getContextAttributes(),g=null,v=null,y=[],b=[],x=new rY,_=null,w=new os;w.layers.enable(1),w.viewport=new ia;let M=new os;M.layers.enable(2),M.viewport=new ia;let E=[w,M],S=new lE;S.layers.enable(1),S.layers.enable(2);let T=null,A=null;function C(e){let t=b.indexOf(e.inputSource);if(-1===t)return;let n=y[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function R(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",R),r.removeEventListener("inputsourceschange",P);for(let e=0;e<y.length;e++){let t=b[e];null!==t&&(b[e]=null,y[e].disconnect(t))}T=null,A=null,f.reset(),e.setRenderTarget(g),d=null,h=null,c=null,r=null,v=null,N.stop(),n.isPresenting=!1,e.setPixelRatio(_),e.setSize(x.width,x.height,!1),n.dispatchEvent({type:"sessionend"})}function P(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],r=b.indexOf(n);r>=0&&(b[r]=null,y[r].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],r=b.indexOf(n);if(-1===r){for(let e=0;e<y.length;e++)if(e>=b.length){b.push(n),r=e;break}else if(null===b[e]){b[e]=n,r=e;break}if(-1===r)break}let i=y[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=y[e];return void 0===t&&(t=new lA,y[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=y[e];return void 0===t&&(t=new lA,y[e]=t),t.getGripSpace()},this.getHand=function(e){let t=y[e];return void 0===t&&(t=new lA,y[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return c},this.getFrame=function(){return p}
227,this.getSession=function(){return r},this.setSession=async function(u){if(null!==(r=u)){if(g=e.getRenderTarget(),r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",R),r.addEventListener("inputsourceschange",P),!0!==m.xrCompatible&&await t.makeXRCompatible(),_=e.getPixelRatio(),e.getSize(x),void 0===r.renderState.layers){let n={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:i};d=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),v=new is(d.framebufferWidth,d.framebufferHeight,{format:1023,type:1009,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let n=null,a=null,o=null;m.depth&&(o=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=m.stencil?1027:1026,a=m.stencil?1020:1014);let s={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:i};h=(c=new XRWebGLBinding(r,t)).createProjectionLayer(s),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),v=new is(h.textureWidth,h.textureHeight,{format:1023,type:1009,depthTexture:new o3(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:4*!!m.antialias,resolveDepthBuffer:!1===h.ignoreDepthValues})}v.isXRRenderTarget=!0,this.setFoveation(s),l=null,a=await r.requestReferenceSpace(o),N.setContext(r),N.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode};let I=new ih,O=new ih;function L(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){var t,n,i;if(null===r)return;null!==f.texture&&(e.near=f.depthNear,e.far=f.depthFar),S.near=M.near=w.near=e.near,S.far=M.far=w.far=e.far,(T!==S.near||A!==S.far)&&(r.updateRenderState({depthNear:S.near,depthFar:S.far}),T=S.near,A=S.far,w.near=T,w.far=A,M.near=T,M.far=A,w.updateProjectionMatrix(),M.updateProjectionMatrix(),e.updateProjectionMatrix());let a=e.parent,o=S.cameras;L(S,a);for(let e=0;e<o.length;e++)L(o[e],a);2===o.length?function(e,t,n){I.setFromMatrixPosition(t.matrixWorld),O.setFromMatrixPosition(n.matrixWorld);let r=I.distanceTo(O),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],h=(a[8]+1)/a[0],d=r/(-c+h),p=-(d*c);t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(p),e.translateZ(d),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();let f=o+d,m=s+d;e.projectionMatrix.makePerspective(o*c-p,o*h+(r-p),l*s/m*f,u*s/m*f,f,m),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}(S,w,M):S.projectionMatrix.copy(w.projectionMatrix),t=e,n=S,null===(i=a)?t.matrix.copy(n.matrixWorld):(t.matrix.copy(i.matrixWorld),t.matrix.invert(),t.matrix.multiply(n.matrixWorld)),t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(n.projectionMatrix),t.projectionMatrixInverse.copy(n.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*rj*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)},this.getCamera=function(){return S},this.getFoveation=function(){if(null!==h||null!==d)return s},this.setFoveation=function(e){s=e,null!==h&&(h.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==f.texture},this.getDepthSensingMesh=function(){return f.getMesh(S)};let D=null,N=new oy;N.setAnimationLoop(function(t,i){if(u=i.getViewerPose(l||a),p=i,null!==u){let t=u.views;null!==d&&(e.setRenderTargetFramebuffer(v,d.framebuffer),e.setRenderTarget(v));let n=!1;t.length!==S.cameras.length&&(S.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){let i=t[r],a=null;if(null!==d)a=d.getViewport(i);else{let t=c.getViewSubImage(h,i);a=t.viewport,0===r&&(e.setRenderTargetTextures(v,t.colorTexture,h.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(v))}let o=E[r];void 0===o&&((o=new os).layers.enable(r),o.viewport=new ia,E[r]=o),o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(i.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),0===r&&(S.matrix.copy(o.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),!0===n&&S.cameras.push(o)}let i=r.enabledFeatures;if(i&&i.includes("depth-sensing")){let n=c.getDepthInformation(t[0]);n&&n.isValid&&n.texture&&f.init(e,n,r.renderState)}}for(let e=0;e<y.length;e++){let t=b[e],n=y[e];null!==t&&void 0!==n&&n.update(t,i,l||a)}D&&D(t,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),p=null}),this.setAnimationLoop=function(e){D=e},this.dispose=function(){}}}let lO=new iJ,lL=new ij;function lD(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,1===r.side&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.
227normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),1===r.side&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,lO.copy(o),lO.x*=-1,lO.y*=-1,lO.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(lO.y*=-1,lO.z*=-1),e.envMapRotation.value.setFromMatrix4(lL.makeRotationFromEuler(lO)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,oe(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,a,o,s){var l,u,c,h,d,p,f,m,g,v,y,b,x,_,w,M,E,S,T,A,C;i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),l=e,(u=i).gradientMap&&(l.gradientMap.value=u.gradientMap)):i.isMeshPhongMaterial?(r(e,i),c=e,h=i,c.specular.value.copy(h.specular),c.shininess.value=Math.max(h.shininess,1e-4)):i.isMeshStandardMaterial?(r(e,i),d=e,p=i,d.metalness.value=p.metalness,p.metalnessMap&&(d.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,d.metalnessMapTransform)),d.roughness.value=p.roughness,p.roughnessMap&&(d.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,d.roughnessMapTransform)),p.envMap&&(d.envMapIntensity.value=p.envMapIntensity),i.isMeshPhysicalMaterial&&(f=e,m=i,g=s,f.ior.value=m.ior,m.sheen>0&&(f.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),f.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(f.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,f.sheenColorMapTransform)),m.sheenRoughnessMap&&(f.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,f.sheenRoughnessMapTransform))),m.clearcoat>0&&(f.clearcoat.value=m.clearcoat,f.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(f.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,f.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(f.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,f.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(f.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,f.clearcoatNormalMapTransform),f.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),1===m.side&&f.clearcoatNormalScale.value.negate())),m.dispersion>0&&(f.dispersion.value=m.dispersion),m.iridescence>0&&(f.iridescence.value=m.iridescence,f.iridescenceIOR.value=m.iridescenceIOR,f.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],f.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(f.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,f.iridescenceMapTransform)),m.iridescenceThicknessMap&&(f.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,f.iridescenceThicknessMapTransform))),m.transmission>0&&(f.transmission.value=m.transmission,f.transmissionSamplerMap.value=g.texture,f.transmissionSamplerSize.value.set(g.width,g.height),m.transmissionMap&&(f.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,f.transmissionMapTransform)),f.thickness.value=m.thickness,m.thicknessMap&&(f.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,f.thicknessMapTransform)),f.attenuationDistance.value=m.attenuationDistance,f.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(f.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(f.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,f.anisotropyMapTransform))),f.specularIntensity.value=m.specularIntensity,f.specularColor.value.copy(m.specularColor),m.specularColorMap&&(f.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,f.specularColorMapTransform)),m.specularIntensityMap&&(f.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,f.specularIntensityMapTransform)))):i.isMeshMat
227capMaterial?(r(e,i),v=e,(y=i).matcap&&(v.matcap.value=y.matcap)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(b=e,x=i,b.diffuse.value.copy(x.color),b.opacity.value=x.opacity,x.map&&(b.map.value=x.map,n(x.map,b.mapTransform)),i.isLineDashedMaterial&&(_=e,w=i,_.dashSize.value=w.dashSize,_.totalSize.value=w.dashSize+w.gapSize,_.scale.value=w.scale)):i.isPointsMaterial?(M=e,E=i,S=a,T=o,M.diffuse.value.copy(E.color),M.opacity.value=E.opacity,M.size.value=E.size*S,M.scale.value=.5*T,E.map&&(M.map.value=E.map,n(E.map,M.uvTransform)),E.alphaMap&&(M.alphaMap.value=E.alphaMap,n(E.alphaMap,M.alphaMapTransform)),E.alphaTest>0&&(M.alphaTest.value=E.alphaTest)):i.isSpriteMaterial?(A=e,C=i,A.diffuse.value.copy(C.color),A.opacity.value=C.opacity,A.rotation.value=C.rotation,C.map&&(A.map.value=C.map,n(C.map,A.mapTransform)),C.alphaMap&&(A.alphaMap.value=C.alphaMap,n(C.alphaMap,A.alphaMapTransform)),C.alphaTest>0&&(A.alphaTest.value=C.alphaTest)):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function lN(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e){let t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",e),t}function u(t){let n=t.target;n.removeEventListener("dispose",u);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(e,t){let n=t.program;r.uniformBlockBinding(e,n)},update:function(n,c){let h=i[n.id];void 0===h&&(function(e){let t=e.uniforms,n=0;for(let e=0,r=t.length;e<r;e++){let r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){let t=r[e],i=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=i.length;e<r;e++){let r=l(i[e]),a=n%16;0!==a&&16-a<r.boundary&&(n+=16-a),t.__data=new Float32Array(r.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=r.storage}}}let r=n%16;r>0&&(n+=16-r),e.__size=n,e.__cache={}}(n),h=function(t){let n=function(){for(let e=0;e<s;e++)if(-1===o.indexOf(e))return o.push(e),e;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=h,n.addEventListener("dispose",u));let d=c.program;r.updateUBOMapping(n,d);let p=t.render.frame;a[n.id]!==p&&(function(t){let n=i[t.id],r=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=r.length;t<n;t++){let n=Array.isArray(r[t])?r[t]:[r[t]];for(let r=0,i=n.length;r<i;r++){let i=n[r];if(!0===function(e,t,n,r){let i=e.value,a=t+"_"+n;if(void 0===r[a])return"number"==typeof i||"boolean"==typeof i?r[a]=i:r[a]=i.clone(),!0;{let e=r[a];if("number"==typeof i||"boolean"==typeof i){if(e!==i)return r[a]=i,!0}else if(!1===e.equals(i))return e.copy(i),!0}return!1}(i,t,r,a)){let t=i.__offset,n=Array.isArray(i.value)?i.value:[i.value],r=0;for(let a=0;a<n.length;a++){let o=n[a],s=l(o);"number"==typeof o||"boolean"==typeof o?(i.__data[0]=o,e.bufferSubData(e.UNIFORM_BUFFER,t+r,i.__data)):o.isMatrix3?(i.__data[0]=o.elements[0],i.__data[1]=o.elements[1],i.__data[2]=o.elements[2],i.__data[3]=0,i.__data[4]=o.elements[3],i.__data[5]=o.elements[4],i.__data[6]=o.elements[5],i.__data[7]=0,i.__data[8]=o.elements[6],i.__data[9]=o.elements[7],i.__data[10]=o.elements[8],i.__data[11]=0):(o.toArray(i.__data,r),r+=s.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,i.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),a[n.id]=p)},dispose:function(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}}}class lU{constructor(e={}){let t,n,r,i,a,o,s,l,u,c,h,d,p,f,m,g,v,y,b,x,_,w,M,E,S,{canvas:T=function(){let e=rJ("canvas");return e.style.display="block",e}(),context:A=null,depth:C=!0,stencil:R=!1,alpha:P=!1,antialias:I=!1,premultipliedAlpha:O=!0,preserveDrawingBuffer:L=!1,powerPreference:D="default",failIfMajorPerformanceCaveat:N=!1}=e;
227if(this.isWebGLRenderer=!0,null!==A){if("undefined"!=typeof WebGLRenderingContext&&A instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");t=A.getContextAttributes().alpha}else t=P;let U=new Uint32Array(4),k=new Int32Array(4),B=null,F=null,z=[],H=[];this.domElement=T,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=rI,this.toneMapping=0,this.toneMappingExposure=1;let j=this,W=!1,G=0,V=0,X=null,q=-1,Y=null,Z=new ia,$=new ia,K=null,J=new a_(0),Q=0,ee=T.width,et=T.height,en=1,er=null,ei=null,ea=new ia(0,0,ee,et),eo=new ia(0,0,ee,et),es=!1,el=new ov,eu=!1,ec=!1,eh=new ij,ed=new ih,ep={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},ef=!1;function em(){return null===X?en:1}let eg=A;function ev(e,t){return T.getContext(e,t)}try{if("setAttribute"in T&&T.setAttribute("data-engine","three.js r165"),T.addEventListener("webglcontextlost",ex,!1),T.addEventListener("webglcontextrestored",e_,!1),T.addEventListener("webglcontextcreationerror",ew,!1),null===eg){let e="webgl2";if(eg=ev(e,{alpha:!0,depth:C,stencil:R,antialias:I,premultipliedAlpha:O,preserveDrawingBuffer:L,powerPreference:D,failIfMajorPerformanceCaveat:N}),null===eg)if(ev(e))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function ey(){(n=new oK(eg)).init(),M=new lM(eg,n),r=new oP(eg,n,e,M),i=new l_(eg),a=new o0(eg),o=new ls,s=new lw(eg,n,i,o,r,M,a),l=new oO(j),u=new o$(j),c=new ob(eg),E=new oC(eg,c),h=new oJ(eg,c,a,E),d=new o2(eg,h,c,a),x=new o1(eg,r,s),v=new oI(o),p=new lo(j,l,u,n,r,E,v),f=new lD(j,o),m=new lh,g=new lv(n),b=new oA(j,l,u,i,d,t,O),y=new lx(j,d,r),S=new lN(eg,a,r,i),_=new oR(eg,n,a),w=new oQ(eg,n,a),a.programs=p.programs,j.capabilities=r,j.extensions=n,j.properties=o,j.renderLists=m,j.shadowMap=y,j.state=i,j.info=a}ey();let eb=new lI(j,eg);function ex(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),W=!0}function e_(){console.log("THREE.WebGLRenderer: Context Restored."),W=!1;let e=a.autoReset,t=y.enabled,n=y.autoUpdate,r=y.needsUpdate,i=y.type;ey(),a.autoReset=e,y.enabled=t,y.autoUpdate=n,y.needsUpdate=r,y.type=i}function ew(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function eM(e){var t;let n=e.target;n.removeEventListener("dispose",eM),function(e){let t=o.get(e).programs;void 0!==t&&(t.forEach(function(e){p.releaseProgram(e)}),e.isShaderMaterial&&p.releaseShaderCache(e))}(t=n),o.remove(t)}function eE(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,eD(e,t,n),e.side=0,e.needsUpdate=!0,eD(e,t,n),e.side=2):eD(e,t,n)}this.xr=eb,this.getContext=function(){return eg},this.getContextAttributes=function(){return eg.getContextAttributes()},this.forceContextLoss=function(){let e=n.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=n.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return en},this.setPixelRatio=function(e){void 0!==e&&(en=e,this.setSize(ee,et,!1))},this.getSize=function(e){return e.set(ee,et)},this.setSize=function(e,t,n=!0){if(eb.isPresenting)return void console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");ee=e,et=t,T.width=Math.floor(e*en),T.height=Math.floor(t*en),!0===n&&(T.style.width=e+"px",T.style.height=t+"px"),this.setViewport(0,0,e,t)},this.getDrawingBufferSize=function(e){return e.set(ee*en,et*en).floor()},this.setDrawingBufferSize=function(e,t,n){ee=e,et=t,en=n,T.width=Math.floor(e*n),T.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(Z)},this.getViewport=function(e){return e.copy(ea)},this.setViewport=function(e,t,n,r){e.isVector4?ea.set(e.x,e.y,e.z,e.w):ea.set(e,t,n,r),i.viewport(Z.copy(ea).multiplyScalar(en).round())}
227,this.getScissor=function(e){return e.copy(eo)},this.setScissor=function(e,t,n,r){e.isVector4?eo.set(e.x,e.y,e.z,e.w):eo.set(e,t,n,r),i.scissor($.copy(eo).multiplyScalar(en).round())},this.getScissorTest=function(){return es},this.setScissorTest=function(e){i.setScissorTest(es=e)},this.setOpaqueSort=function(e){er=e},this.setTransparentSort=function(e){ei=e},this.getClearColor=function(e){return e.copy(b.getClearColor())},this.setClearColor=function(){b.setClearColor.apply(b,arguments)},this.getClearAlpha=function(){return b.getClearAlpha()},this.setClearAlpha=function(){b.setClearAlpha.apply(b,arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(null!==X){let t=X.texture.format;e=1033===t||1031===t||1029===t}if(e){let e=X.texture.type,t=1009===e||1014===e||1012===e||1020===e||1017===e||1018===e,n=b.getClearColor(),r=b.getClearAlpha(),i=n.r,a=n.g,o=n.b;t?(U[0]=i,U[1]=a,U[2]=o,U[3]=r,eg.clearBufferuiv(eg.COLOR,0,U)):(k[0]=i,k[1]=a,k[2]=o,k[3]=r,eg.clearBufferiv(eg.COLOR,0,k))}else r|=eg.COLOR_BUFFER_BIT}t&&(r|=eg.DEPTH_BUFFER_BIT),n&&(r|=eg.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(0xffffffff)),eg.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){T.removeEventListener("webglcontextlost",ex,!1),T.removeEventListener("webglcontextrestored",e_,!1),T.removeEventListener("webglcontextcreationerror",ew,!1),m.dispose(),g.dispose(),o.dispose(),l.dispose(),u.dispose(),d.dispose(),E.dispose(),S.dispose(),p.dispose(),eb.dispose(),eb.removeEventListener("sessionstart",eT),eb.removeEventListener("sessionend",eA),eC.stop()},this.renderBufferDirect=function(e,t,n,a,d,p){let m;null===t&&(t=ep);let g=d.isMesh&&0>d.matrixWorld.determinant(),y=function(e,t,n,a,c){var h,d;!0!==t.isScene&&(t=ep),s.resetTextureUnits();let p=t.fog,m=a.isMeshStandardMaterial?t.environment:null,g=null===X?j.outputColorSpace:!0===X.isXRRenderTarget?X.texture.colorSpace:rO,y=(a.isMeshStandardMaterial?u:l).get(a.envMap||m),b=!0===a.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,_=!!n.attributes.tangent&&(!!a.normalMap||a.anisotropy>0),w=!!n.morphAttributes.position,M=!!n.morphAttributes.normal,E=!!n.morphAttributes.color,T=0;a.toneMapped&&(null===X||!0===X.isXRRenderTarget)&&(T=j.toneMapping);let A=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,C=void 0!==A?A.length:0,R=o.get(a),P=F.state.lights;if(!0===eu&&(!0===ec||e!==Y)){let t=e===Y&&a.id===q;v.setState(a,e,t)}let I=!1;a.version===R.__version?R.needsLights&&R.lightsStateVersion!==P.state.version||R.outputColorSpace!==g||c.isBatchedMesh&&!1===R.batching?I=!0:c.isBatchedMesh||!0!==R.batching?c.isBatchedMesh&&!0===R.batchingColor&&null===c.colorTexture||c.isBatchedMesh&&!1===R.batchingColor&&null!==c.colorTexture||c.isInstancedMesh&&!1===R.instancing?I=!0:c.isInstancedMesh||!0!==R.instancing?c.isSkinnedMesh&&
227!1===R.skinning?I=!0:c.isSkinnedMesh||!0!==R.skinning?c.isInstancedMesh&&!0===R.instancingColor&&null===c.instanceColor||c.isInstancedMesh&&!1===R.instancingColor&&null!==c.instanceColor||c.isInstancedMesh&&!0===R.instancingMorph&&null===c.morphTexture||c.isInstancedMesh&&!1===R.instancingMorph&&null!==c.morphTexture||R.envMap!==y||!0===a.fog&&R.fog!==p||void 0!==R.numClippingPlanes&&(R.numClippingPlanes!==v.numPlanes||R.numIntersection!==v.numIntersection)||R.vertexAlphas!==b||R.vertexTangents!==_||R.morphTargets!==w||R.morphNormals!==M||R.morphColors!==E||R.toneMapping!==T?I=!0:R.morphTargetsCount!==C&&(I=!0):I=!0:I=!0:I=!0:(I=!0,R.__version=a.version);let O=R.currentProgram;!0===I&&(O=eD(a,t,c));let L=!1,D=!1,N=!1,U=O.getUniforms(),k=R.uniforms;if(i.useProgram(O.program)&&(L=!0,D=!0,N=!0),a.id!==q&&(q=a.id,D=!0),L||Y!==e){U.setValue(eg,"projectionMatrix",e.projectionMatrix),U.setValue(eg,"viewMatrix",e.matrixWorldInverse);let t=U.map.cameraPosition;void 0!==t&&t.setValue(eg,ed.setFromMatrixPosition(e.matrixWorld)),r.logarithmicDepthBuffer&&U.setValue(eg,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(a.isMeshPhongMaterial||a.isMeshToonMaterial||a.isMeshLambertMaterial||a.isMeshBasicMaterial||a.isMeshStandardMaterial||a.isShaderMaterial)&&U.setValue(eg,"isOrthographic",!0===e.isOrthographicCamera),Y!==e&&(Y=e,D=!0,N=!0)}if(c.isSkinnedMesh){U.setOptional(eg,c,"bindMatrix"),U.setOptional(eg,c,"bindMatrixInverse");let e=c.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),U.setValue(eg,"boneTexture",e.boneTexture,s))}c.isBatchedMesh&&(U.setOptional(eg,c,"batchingTexture"),U.setValue(eg,"batchingTexture",c._matricesTexture,s),U.setOptional(eg,c,"batchingColorTexture"),null!==c._colorsTexture&&U.setValue(eg,"batchingColorTexture",c._colorsTexture,s));let B=n.morphAttributes;if((void 0!==B.position||void 0!==B.normal||void 0!==B.color)&&x.update(c,n,O),(D||R.receiveShadow!==c.receiveShadow)&&(R.receiveShadow=c.receiveShadow,U.setValue(eg,"receiveShadow",c.receiveShadow)),a.isMeshGouraudMaterial&&null!==a.envMap&&(k.envMap.value=y,k.flipEnvMap.value=y.isCubeTexture&&!1===y.isRenderTargetTexture?-1:1),a.isMeshStandardMaterial&&null===a.envMap&&null!==t.environment&&(k.envMapIntensity.value=t.environmentIntensity),D&&(U.setValue(eg,"toneMappingExposure",j.toneMappingExposure),R.needsLights&&(h=k,d=N,h.ambientLightColor.needsUpdate=d,h.lightProbe.needsUpdate=d,h.directionalLights.needsUpdate=d,h.directionalLightShadows.needsUpdate=d,h.pointLights.needsUpdate=d,h.pointLightShadows.needsUpdate=d,h.spotLights.needsUpdate=d,h.spotLightShadows.needsUpdate=d,h.rectAreaLights.needsUpdate=d,h.hemisphereLights.needsUpdate=d),p&&!0===a.fog&&f.refreshFogUniforms(k,p),f.refreshMaterialUniforms(k,a,en,et,F.state.transmissionRenderTarget[e.id]),sK.upload(eg,eN(R),k,s)),a.isShaderMaterial&&!0===a.uniformsNeedUpdate&&(sK.upload(eg,eN(R),k,s),a.uniformsNeedUpdate=!1),a.isSpriteMaterial&&U.setValue(eg,"center",c.center),U.setValue(eg,"modelViewMatrix",c.modelViewMatrix),U.setValue(eg,"normalMatrix",c.normalMatrix),U.setValue(eg,"modelMatrix",c.matrixWorld),a.isShaderMaterial||a.isRawShaderMaterial){let e=a.uniformsGroups;for(let t=0,n=e.length;t<n;t++){let n=e[t];S.update(n,O),S.bind(n,O)}}return O}(e,t,n,a,d);i.setMaterial(a,g);let b=n.index,M=1;if(!0===a.wireframe){if(void 0===(b=h.getWireframeAttribute(n)))return;M=2}let T=n.drawRange,A=n.attributes.position,C=T.start*M,R=(T.start+T.count)*M;null!==p&&(C=Math.max(C,p.start*M),R=Math.min(R,(p.start+p.count)*M)),null!==b?(C=Math.max(C,0),R=Math.min(R,b.count)):null!=A&&(C=Math.max(C,0),R=Math.min(R,A.count));let P=R-C;if(P<0||P===1/0)return;E.setup(d,a,y,n,b);let I=_;if(null!==b&&(m=c.get(b),(I=w).setIndex(m)),d.isMesh)!0===a.wireframe?(i.setLineWidth(a.wireframeLinewidth*em()),I.setMode(eg.LINES)):I.setMode(eg.TRIANGLES);else if(d.isLine){let e=a.linewidth;void 0===e&&(e=1),i.setLineWidth(e*em()),d.isLineSegments?I.setMode(eg.LINES):d.isLineLoop?I.setMode(eg.LINE_LOOP):I.setMode(eg.LINE_STRIP)}else d.isPoints?I.setMode(eg.POINTS):d.isSprite&&I.setMode(eg.TRIANGLES);if(d.isBatchedMesh)null!==d._multiDrawInstances?I.renderMultiDrawInstances(d._multiDrawStarts,d._multiDrawCounts,d._multiDrawCount,d._multiDrawInstances):I.renderMultiDraw(d._multiDrawStarts,d._multiDrawCounts,d._multiDrawCount);else if(d.isInstancedMesh)I.renderInstances(C,P,d.count);else if(n.isInstancedBufferGeometry){let e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);I.renderInstances(C,P,t)}else I.render(C,P)},this.compile=function(e,t,n=null){null===n&&(n=e),(F=g.get(n)).init(t),H.push(F),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(F.pushLight(e),e.castShadow&&F.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(F.pushLight(e),e.castShadow&&F.pushShadow(e))}),F.setupLights();let r=new Set;return e.traverse(function(e){let t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){let a=t[i];eE(a,n,e),r.add(a)}else eE(t,n,e),r.add(t)}),H.pop(),F=null,r},this.compileAsync=function(e,t,r=null){let i=this.compile(e,t,r);return new Promise(t=>
227{function r(){if(i.forEach(function(e){o.get(e).currentProgram.isReady()&&i.delete(e)}),0===i.size)return void t(e);setTimeout(r,10)}null!==n.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)})};let eS=null;function eT(){eC.stop()}function eA(){eC.start()}let eC=new oy;function eR(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)F.pushLight(e),e.castShadow&&F.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||el.intersectsSprite(e)){r&&ed.setFromMatrixPosition(e.matrixWorld).applyMatrix4(eh);let t=d.update(e),i=e.material;i.visible&&B.push(e,t,i,n,ed.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||el.intersectsObject(e))){let t=d.update(e),i=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),ed.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),ed.copy(t.boundingSphere.center)),ed.applyMatrix4(e.matrixWorld).applyMatrix4(eh)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a<o;a++){let o=r[a],s=i[o.materialIndex];s&&s.visible&&B.push(e,t,s,n,ed.z,o)}}else i.visible&&B.push(e,t,i,n,ed.z,null)}}let i=e.children;for(let e=0,a=i.length;e<a;e++)eR(i[e],t,n,r)}function eP(e,t,n,r){let a=e.opaque,o=e.transmissive,s=e.transparent;F.setupLightsView(n),!0===eu&&v.setGlobalState(j.clippingPlanes,n),r&&i.viewport(Z.copy(r)),a.length>0&&eO(a,t,n),o.length>0&&eO(o,t,n),s.length>0&&eO(s,t,n),i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),i.setPolygonOffset(!1)}function eI(e,t,r,i){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;void 0===F.state.transmissionRenderTarget[i.id]&&(F.state.transmissionRenderTarget[i.id]=new is(1,1,{generateMipmaps:!0,type:n.has("EXT_color_buffer_half_float")||n.has("EXT_color_buffer_float")?1016:1009,minFilter:1008,samples:4,stencilBuffer:R,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:r4.workingColorSpace}));let a=F.state.transmissionRenderTarget[i.id],o=i.viewport||Z;a.setSize(o.z,o.w);let l=j.getRenderTarget();j.setRenderTarget(a),j.getClearColor(J),(Q=j.getClearAlpha())<1&&j.setClearColor(0xffffff,.5),ef?b.render(r):j.clear();let u=j.toneMapping;j.toneMapping=0;let c=i.viewport;if(void 0!==i.viewport&&(i.viewport=void 0),F.setupLightsView(i),!0===eu&&v.setGlobalState(j.clippingPlanes,i),eO(e,r,i),s.updateMultisampleRenderTarget(a),s.updateRenderTargetMipmap(a),!1===n.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let n=0,a=t.length;n<a;n++){let a=t[n],o=a.object,s=a.geometry,l=a.material,u=a.group;if(2===l.side&&o.layers.test(i.layers)){let t=l.side;l.side=1,l.needsUpdate=!0,eL(o,r,i,s,l,u),l.side=t,l.needsUpdate=!0,e=!0}}!0===e&&(s.updateMultisampleRenderTarget(a),s.updateRenderTargetMipmap(a))}j.setRenderTarget(l),j.setClearColor(J,Q),void 0!==c&&(i.viewport=c),j.toneMapping=u}function eO(e,t,n){let r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=a.object,s=a.geometry,l=null===r?a.material:r,u=a.group;o.layers.test(n.layers)&&eL(o,t,n,s,l,u)}}function eL(e,t,n,r,i,a){e.onBeforeRender(j,t,n,r,i,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(j,t,n,r,e,a),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=1,i.needsUpdate=!0,j.renderBufferDirect(n,t,r,i,e,a),i.side=0,i.needsUpdate=!0,j.renderBufferDirect(n,t,r,i,e,a),i.side=2):j.renderBufferDirect(n,t,r,i,e,a),e.onAfterRender(j,t,n,r,i,a)}function eD(e,t,n){var r;!0!==t.isScene&&(t=ep);let i=o.get(e),a=F.state.lights,s=F.state.shadowsArray,c=a.state.version,h=p.getParameters(e,a.state,s,t,n),d=p.getProgramCacheKey(h),f=i.programs;i.environment=e.isMeshStandardMaterial?t.environment:null,i.fog=t.fog,i.envMap=(e.isMeshStandardMaterial?u:l).get(e.envMap||i.environment),i.envMapRotation=null!==i.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===f&&(e.addEventListener("dispose",eM),i.programs=f=new Map);let m=f.get(d);if(void 0!==m){if(i.currentProgram===m&&i.lightsStateVersion===c)return eU(e,h),m}else h.uniforms=p.getUniforms(e),e.onBuild(n,h,j),e.onBeforeCompile(h,j),m=p.acquireProgram(h,d),f.set(d,m),i.uniforms=h.uniforms;let g=i.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(g.clippingPlanes=v.uniform),eU(e,h),i.needsLights=(r=e).isMeshLambertMaterial||r.isMeshToonMaterial||r.isMeshPhongMaterial||r.isMeshStandardMaterial||r.isShadowMaterial||r.isShaderMaterial&&!0===r.lights,i.lightsStateVersion=c,i.needsLights&&(g.ambientLightColor.value=a.state.ambient,g.lightProbe.value=a.state.probe,g.directionalLights.value=a.state.directional,g.directionalLightShadows.value=a.state.directionalShadow,g.spotLights.value=a.state.spot,g.spotLightShadows.value=a.state.spotShadow,g.rectAreaLights.value=a.state.rectArea,g.ltc_1.value=a.state.rectAreaLTC1,g.ltc_2.value=a.state.rectAreaLTC2,g.pointLights.value=a.state.point,g.pointLightShadows.value=a.state.pointShadow,g.hemisphereLights.value=a.state.hemi,g.directionalShadowMap.value=a.state.directionalShadowMap,g.directionalShadowMatrix.value=a.state.directionalShadowMatrix,g.spotShadowMap.value=a.state.spotShadowMap,g.spotLightMatrix.value=a.state.spotLightMatrix,g.spotLightMap.value=a.state.spotLightMap,g.pointShadowMap.value=a.state.pointShadowMap,g.pointShadowMatrix.value=a.state.pointShadowMatrix),i.currentProgram=m,i.uniformsList=null,m}function eN(e){if(null===e.uniformsList){let t=e.currentProgram.getUniforms();e.uniformsList=sK.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function eU(e,t){let n=o.get(e);
227n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}eC.setAnimationLoop(function(e){eS&&eS(e)}),"undefined"!=typeof self&&eC.setContext(self),this.setAnimationLoop=function(e){eS=e,eb.setAnimationLoop(e),null===e?eC.stop():eC.start()},eb.addEventListener("sessionstart",eT),eb.addEventListener("sessionend",eA),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===W)return;if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===eb.enabled&&!0===eb.isPresenting&&(!0===eb.cameraAutoUpdate&&eb.updateCamera(t),t=eb.getCamera()),!0===e.isScene&&e.onBeforeRender(j,e,t,X),(F=g.get(e,H.length)).init(t),H.push(F),eh.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),el.setFromProjectionMatrix(eh),ec=this.localClippingEnabled,eu=v.init(this.clippingPlanes,ec),(B=m.get(e,z.length)).init(),z.push(B),!0===eb.enabled&&!0===eb.isPresenting){let e=j.xr.getDepthSensingMesh();null!==e&&eR(e,t,-1/0,j.sortObjects)}eR(e,t,0,j.sortObjects),B.finish(),!0===j.sortObjects&&B.sort(er,ei),(ef=!1===eb.enabled||!1===eb.isPresenting||!1===eb.hasDepthSensing())&&b.addToRenderList(B,e),this.info.render.frame++,!0===eu&&v.beginShadows();let n=F.state.shadowsArray;y.render(n,e,t),!0===eu&&v.endShadows(),!0===this.info.autoReset&&this.info.reset();let r=B.opaque,i=B.transmissive;if(F.setupLights(),t.isArrayCamera){let n=t.cameras;if(i.length>0)for(let t=0,a=n.length;t<a;t++)eI(r,i,e,n[t]);ef&&b.render(e);for(let t=0,r=n.length;t<r;t++){let r=n[t];eP(B,e,r,r.viewport)}}else i.length>0&&eI(r,i,e,t),ef&&b.render(e),eP(B,e,t);null!==X&&(s.updateMultisampleRenderTarget(X),s.updateRenderTargetMipmap(X)),!0===e.isScene&&e.onAfterRender(j,e,t),E.resetDefaultState(),q=-1,Y=null,H.pop(),H.length>0?(F=H[H.length-1],!0===eu&&v.setGlobalState(j.clippingPlanes,F.state.camera)):F=null,z.pop(),B=z.length>0?z[z.length-1]:null},this.getActiveCubeFace=function(){return G},this.getActiveMipmapLevel=function(){return V},this.getRenderTarget=function(){return X},this.setRenderTargetTextures=function(e,t,r){o.get(e.texture).__webglTexture=t,o.get(e.depthTexture).__webglTexture=r;let i=o.get(e);i.__hasExternalTextures=!0,i.__autoAllocateDepthBuffer=void 0===r,i.__autoAllocateDepthBuffer||!0!==n.has("WEBGL_multisampled_render_to_texture")||(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(e,t){let n=o.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){X=e,G=t,V=n;let r=!0,a=null,l=!1,u=!1;if(e){let c=o.get(e);void 0!==c.__useDefaultFramebuffer?(i.bindFramebuffer(eg.FRAMEBUFFER,null),r=!1):void 0===c.__webglFramebuffer?s.setupRenderTarget(e):c.__hasExternalTextures&&s.rebindTextures(e,o.get(e.texture).__webglTexture,o.get(e.depthTexture).__webglTexture);let h=e.texture;(h.isData3DTexture||h.isDataArrayTexture||h.isCompressedArrayTexture)&&(u=!0);let d=o.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(a=Array.isArray(d[t])?d[t][n]:d[t],l=!0):a=e.samples>0&&!1===s.useMultisampledRTT(e)?o.get(e).__webglMultisampledFramebuffer:Array.isArray(d)?d[n]:d,Z.copy(e.viewport),$.copy(e.scissor),K=e.scissorTest}else Z.copy(ea).multiplyScalar(en).floor(),$.copy(eo).multiplyScalar(en).floor(),K=es;if(i.bindFramebuffer(eg.FRAMEBUFFER,a)&&r&&i.drawBuffers(e,a),i.viewport(Z),i.scissor($),i.setScissorTest(K),l){let r=o.get(e.texture);eg.framebufferTexture2D(eg.FRAMEBUFFER,eg.COLOR_ATTACHMENT0,eg.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(u){let r=o.get(e.texture);eg.framebufferTextureLayer(eg.FRAMEBUFFER,eg.COLOR_ATTACHMENT0,r.__webglTexture,n||0,t||0)}q=-1},this.readRenderTargetPixels=function(e,t,n,a,s,l,u){if(!(e&&e.isWebGLRenderTarget))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let c=o.get(e).__webglFramebuffer;
227if(e.isWebGLCubeRenderTarget&&void 0!==u&&(c=c[u]),c){i.bindFramebuffer(eg.FRAMEBUFFER,c);try{let i=e.texture,o=i.format,u=i.type;if(!r.textureFormatReadable(o))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!r.textureTypeReadable(u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-a&&n>=0&&n<=e.height-s&&eg.readPixels(t,n,a,s,M.convert(o),M.convert(u),l)}finally{let e=null!==X?o.get(X).__webglFramebuffer:null;i.bindFramebuffer(eg.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,a,s,l,u){if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let c=o.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==u&&(c=c[u]),c){i.bindFramebuffer(eg.FRAMEBUFFER,c);try{let i=e.texture,o=i.format,u=i.type;if(!r.textureFormatReadable(o))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!r.textureTypeReadable(u))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(t>=0&&t<=e.width-a&&n>=0&&n<=e.height-s){var h;let e=eg.createBuffer();eg.bindBuffer(eg.PIXEL_PACK_BUFFER,e),eg.bufferData(eg.PIXEL_PACK_BUFFER,l.byteLength,eg.STREAM_READ),eg.readPixels(t,n,a,s,M.convert(o),M.convert(u),0),eg.flush();let r=eg.fenceSync(eg.SYNC_GPU_COMMANDS_COMPLETE,0);await (h=eg,new Promise(function(e,t){setTimeout(function n(){switch(h.clientWaitSync(r,h.SYNC_FLUSH_COMMANDS_BIT,0)){case h.WAIT_FAILED:t();break;case h.TIMEOUT_EXPIRED:setTimeout(n,4);break;default:e()}},4)}));try{eg.bindBuffer(eg.PIXEL_PACK_BUFFER,e),eg.getBufferSubData(eg.PIXEL_PACK_BUFFER,0,l)}finally{eg.deleteBuffer(e),eg.deleteSync(r)}return l}}finally{let e=null!==X?o.get(X).__webglFramebuffer:null;i.bindFramebuffer(eg.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t=null,n=0){!0!==e.isTexture&&(console.warn("WebGLRenderer: copyFramebufferToTexture function signature has changed."),t=arguments[0]||null,e=arguments[1]);let r=Math.pow(2,-n),a=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r),l=null!==t?t.x:0,u=null!==t?t.y:0;s.setTexture2D(e,0),eg.copyTexSubImage2D(eg.TEXTURE_2D,n,0,0,l,u,a,o),i.unbindTexture()},this.copyTextureToTexture=function(e,t,n=null,r=null,a=0){let o,l,u,c,h,d;!0!==e.isTexture&&(console.warn("WebGLRenderer: copyTextureToTexture function signature has changed."),r=arguments[0]||null,e=arguments[1],t=arguments[2],a=arguments[3]||0,n=null),null!==n?(o=n.max.x-n.min.x,l=n.max.y-n.min.y,u=n.min.x,c=n.min.y):(o=e.image.width,l=e.image.height,u=0,c=0),null!==r?(h=r.x,d=r.y):(h=0,d=0);let p=M.convert(t.format),f=M.convert(t.type);s.setTexture2D(t,0),eg.pixelStorei(eg.UNPACK_FLIP_Y_WEBGL,t.flipY),eg.pixelStorei(eg.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eg.pixelStorei(eg.UNPACK_ALIGNMENT,t.unpackAlignment);let m=eg.getParameter(eg.UNPACK_ROW_LENGTH),g=eg.getParameter(eg.UNPACK_IMAGE_HEIGHT),v=eg.getParameter(eg.UNPACK_SKIP_PIXELS),y=eg.getParameter(eg.UNPACK_SKIP_ROWS),b=eg.getParameter(eg.UNPACK_SKIP_IMAGES),x=e.isCompressedTexture?e.mipmaps[a]:e.image;eg.pixelStorei(eg.UNPACK_ROW_LENGTH,x.width),eg.pixelStorei(eg.UNPACK_IMAGE_HEIGHT,x.height),eg.pixelStorei(eg.UNPACK_SKIP_PIXELS,u),eg.pixelStorei(eg.UNPACK_SKIP_ROWS,c),e.isDataTexture?eg.texSubImage2D(eg.TEXTURE_2D,a,h,d,o,l,p,f,x.data):e.isCompressedTexture?eg.compressedTexSubImage2D(eg.TEXTURE_2D,a,h,d,x.width,x.height,p,x.data):eg.texSubImage2D(eg.TEXTURE_2D,a,h,d,p,f,x),eg.pixelStorei(eg.UNPACK_ROW_LENGTH,m),eg.pixelStorei(eg.UNPACK_IMAGE_HEIGHT,g),eg.pixelStorei(eg.UNPACK_SKIP_PIXELS,v),eg.pixelStorei(eg.UNPACK_SKIP_ROWS,y),eg.pixelStorei(eg.UNPACK_SKIP_IMAGES,b),0===a&&t.generateMipmaps&&eg.generateMipmap(eg.TEXTURE_2D),i.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n=null,r=null,a=0){let o,l,u,c,h,d,p,f,m,g;!0!==e.isTexture&&(console.warn("WebGLRenderer: copyTextureToTexture3D function signature has changed."),n=arguments[0]||null,r=arguments[1]||null,e=arguments[2],t=arguments[3],a=arguments[4]||0);let v=e.isCompressedTexture?e.mipmaps[a]:e.image;null!==n?(o=n.max.x-n.min.x,l=n.max.y-n.min.y,u=n.max.z-n.min.z,c=n.min.x,h=n.min.y,d=n.min.z):(o=v.width,l=v.height,u=v.depth,c=0,h=0,d=0),null!==r?(p=r.x,f=r.y,m=r.z):(p=0,f=0,m=0);let y=M.convert(t.format),b=M.convert(t.type);if(t.isData3DTexture)s.setTexture3D(t,0),g=eg.TEXTURE_3D;else{if(!t.isDataArrayTexture&&!t.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");s.setTexture2DArray(t,0),g=eg.TEXTURE_2D_ARRAY}eg.pixelStorei(eg.UNPACK_FLIP_Y_WEBGL,t.flipY),eg.pixelStorei(eg.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eg.pixelStorei(eg.UNPACK_ALIGNMENT,t.unpackAlignment);let x=eg.getParameter(eg.UNPACK_ROW_LENGTH),_=eg.getParameter(eg.UNPACK_IMAGE_HEIGHT),w=eg.getParameter(eg.UNPACK_SKIP_PIXELS),E=eg.getParameter(eg.UNPACK_SKIP_ROWS),S=eg.getParameter(eg.UNPACK_SKIP_IMAGES);eg.pixelStorei(eg.UNPACK_ROW_LENGTH,v.width),eg.pixelStorei(eg.UNPACK_IMAGE_HEIGHT,v.height),eg.pixelStorei(eg.UNPACK_SKIP_PIXELS,c),eg.pixelStorei(eg.UNPACK_SKIP_ROWS,h),eg.pixelStorei(eg.UNPACK_SKIP_IMAGES,d),e.isDataTexture||e.isData3DTexture?eg.texSubImage3D(g,a,p,f,m,o,l,u,y,b,v.data):t.isCompressedArrayTexture?eg.compressedTexSubImage3D(g,a,p,f,m,o,l,u,y,v.data):eg.texSubImage3D(g,a,p,f,m,o,l,u,y,b,v),eg.pixelStorei(eg.UNPACK_ROW_LENGTH,x),eg.pixelStorei(eg.UNPACK_IMAGE_HEIGHT,_),eg.pixelStorei(eg.UNPACK_SKIP_PIXELS,w),eg.pixelStorei(eg.UNPACK_SKIP_ROWS,E),eg.pixelStorei(eg.UNPACK_SKIP_IMAGES,S),0===a&&t.generateMipmaps&&eg.generateMipmap(g),i.unbindTexture()},this.initRenderTarget=function(e){void 0===o.get(e).__webglFramebuffer&&s.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?s.setTextureCube(e,0):e.isData3DTexture?s.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?s.setTexture2DArray(e,0):s.setTexture2D(e,0),i.unbindTexture()},this.resetState=function(){G=0,V=0,X=null,i.reset(),E.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return 2e3}get outputColorSpace(){return this._outputColorSpace}
vendor: 7,453 bytes, line 227
227set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===rL?"display-p3":"srgb",t.unpackColorSpace=r4.workingColorSpace===rD?"display-p3":"srgb"}}class lk extends aa{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new iJ,this.environmentIntensity=1,this.environmentRotation=new iJ,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class lB{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=rW()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}get updateRange(){return r0("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=rW()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=rW()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}let lF=new ih;class lz{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)lF.fromBufferAttribute(this,t),lF.applyMatrix4(e),this.setXYZ(t,lF.x,lF.y,lF.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)lF.fromBufferAttribute(this,t),lF.applyNormalMatrix(e),this.setXYZ(t,lF.x,lF.y,lF.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)lF.fromBufferAttribute(this,t),lF.transformDirection(e),this.setXYZ(t,lF.x,lF.y,lF.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=rV(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=rX(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=rX(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=rX(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=rX(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=rX(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=rV(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=rV(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=rV(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=rV(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=rX(t,this.array),n=rX(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=rX(t,this.array),n=rX(n,this.array),r=rX(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=rX(t,this.array),n=rX(n,this.array),r=rX(r,this.array),i=rX(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0!==e)return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new lz(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new aP(new this.array.constructor(e),this.itemSize,this.normalized)}}toJSON(e){if(void 0!==e)return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let e=[];for(let t=0;t<this.count;t++){let n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}}}let lH=new ih,lj=new ia,lW=new ia,lG=new ih,lV=new ij,lX=new ih,lq=new iL,lY=new ij,lZ=new iH;class l$ extends a4{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=rP,this.bindMatrix=new ij,this.bindMatrixInverse=new ij,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;
227null===this.boundingBox&&(this.boundingBox=new im),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,lX),this.boundingBox.expandByPoint(lX)}computeBoundingSphere(){let e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new iL),this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,lX),this.boundingSphere.expandByPoint(lX)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let n=this.material,r=this.matrixWorld;if(void 0!==n)null===this.boundingSphere&&this.computeBoundingSphere(),lq.copy(this.boundingSphere),lq.applyMatrix4(r),!1!==e.ray.intersectsSphere(lq)&&(lY.copy(r).invert(),lZ.copy(e.ray).applyMatrix4(lY),(null===this.boundingBox||!1!==lZ.intersectsBox(this.boundingBox))&&this._computeIntersections(e,t,lZ))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new ia,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);let r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===rP?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){let n=this.skeleton,r=this.geometry;lj.fromBufferAttribute(r.attributes.skinIndex,e),lW.fromBufferAttribute(r.attributes.skinWeight,e),lH.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){let r=lW.getComponent(e);if(0!==r){let i=lj.getComponent(e);lV.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(lG.copy(lH).applyMatrix4(lV),r)}}return t.applyMatrix4(this.bindMatrixInverse)}}class lK extends aa{constructor(){super(),this.isBone=!0,this.type="Bone"}}class lJ extends ii{constructor(e=null,t=1,n=1,r,i,a,o,s,l=1003,u=1003,c,h){super(null,a,o,s,l,u,r,i,c,h),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let lQ=new ij,l0=new ij;class l1{constructor(e=[],t=[]){this.uuid=rW(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new ij)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new ij;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){let i=e[r]?e[r].matrixWorld:l0;lQ.multiplyMatrices(i,t[r]),lQ.toArray(n,16*r)}null!==r&&(r.needsUpdate=!0)}clone(){return new l1(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length),t=new Float32Array((e=Math.max(e=4*Math.ceil(e/4),4))*e*4);t.set(this.boneMatrices);let n=new lJ(t,e,e,1023,1015);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){let n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;
227for(let n=0,r=e.bones.length;n<r;n++){let r=e.bones[n],i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new lK),this.bones.push(i),this.boneInverses.push(new ij().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){let e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){let i=t[r];e.bones.push(i.uuid);let a=n[r];e.boneInverses.push(a.toArray())}return e}}class l2 extends aP{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}let l3=new ij,l5=new ij,l4=[],l6=new im,l8=new ij,l7=new a4,l9=new iL;class ue extends a4{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new l2(new Float32Array(16*n),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e<n;e++)this.setMatrixAt(e,l8)}computeBoundingBox(){let e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new im),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,l3),l6.copy(e.boundingBox).applyMatrix4(l3),this.boundingBox.union(l6)}computeBoundingSphere(){let e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new iL),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,l3),l9.copy(e.boundingSphere).applyMatrix4(l3),this.boundingSphere.union(l9)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.morphTexture&&(this.morphTexture=e.morphTexture.clone()),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}getMorphAt(e,t){let n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,i=e*(n.length+1)+1;for(let e=0;e<n.length;e++)n[e]=r[i+e]}raycast(e,t){let n=this.matrixWorld,r=this.count;if((l7.geometry=this.geometry,l7.material=this.material,void 0!==l7.material)&&(null===this.boundingSphere&&this.computeBoundingSphere(),l9.copy(this.boundingSphere),l9.applyMatrix4(n),!1!==e.ray.intersectsSphere(l9)))for(let i=0;i<r;i++){this.getMatrixAt(i,l3),l5.multiplyMatrices(n,l3),l7.matrixWorld=l5,l7.raycast(e,l4);for(let e=0,n=l4.length;e<n;e++){let n=l4[e];n.instanceId=i,n.object=this,t.push(n)}l4.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new l2(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}setMorphAt(e,t){let n=t.morphTargetInfluences,r=n.length+1;null===this.morphTexture&&(this.morphTexture=new lJ(new Float32Array(r*this.count),r,this.count,1028,1015));let i=this.morphTexture.source.data.data,a=0;for(let e=0;e<n.length;e++)a+=n[e];let o=this.geometry.morphTargetsRelative?1:1-a,s=r*e;i[s]=o,i.set(n,s+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class ut extends aE{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new a_(0xffffff),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}let un=new ih,ur=new ih,ui=new ij,ua=new iH,uo=new iL,us=new ih,ul=new ih;class uu extends aa{constructor(e=new aH,t=new ut){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)un.fromBufferAttribute(t,e-1),ur.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=un.distanceTo(ur);e.setAttribute("lineDistance",new aL(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),uo.copy(n.boundingSphere),uo.applyMatrix4(r),uo.radius+=i,!1===e.ray.intersectsSphere(uo))return;ui.copy(r).invert(),ua.copy(e.ray).applyMatrix4(ui);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=this.isLineSegments?2:1,u=n.index,c=n.attributes.position;if(null!==u){let n=Math.max(0,a.start),r=Math.min(u.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=l){let n=uc(this,e,ua,s,u.getX(i),u.getX(i+1));
227n&&t.push(n)}if(this.isLineLoop){let i=uc(this,e,ua,s,u.getX(r-1),u.getX(n));i&&t.push(i)}}else{let n=Math.max(0,a.start),r=Math.min(c.count,a.start+a.count);for(let i=n,a=r-1;i<a;i+=l){let n=uc(this,e,ua,s,i,i+1);n&&t.push(n)}if(this.isLineLoop){let i=uc(this,e,ua,s,r-1,n);i&&t.push(i)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function uc(e,t,n,r,i,a){let o=e.geometry.attributes.position;if(un.fromBufferAttribute(o,i),ur.fromBufferAttribute(o,a),n.distanceSqToSegment(un,ur,us,ul)>r)return;us.applyMatrix4(e.matrixWorld);let s=t.ray.origin.distanceTo(us);if(!(s<t.near)&&!(s>t.far))return{distance:s,point:ul.clone().applyMatrix4(e.matrixWorld),index:i,face:null,faceIndex:null,object:e}}let uh=new ih,ud=new ih;class up extends uu{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)uh.fromBufferAttribute(t,e),ud.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+uh.distanceTo(ud);e.setAttribute("lineDistance",new aL(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class uf extends uu{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class um extends aE{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new a_(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let ug=new ij,uv=new iH,uy=new iL,ub=new ih;class ux extends aa{constructor(e=new aH,t=new um){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),uy.copy(n.boundingSphere),uy.applyMatrix4(r),uy.radius+=i,!1===e.ray.intersectsSphere(uy))return;ug.copy(r).invert(),uv.copy(e.ray).applyMatrix4(ug);let o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,l=n.index,u=n.attributes.position;if(null!==l){let n=Math.max(0,a.start),i=Math.min(l.count,a.start+a.count);for(let a=n;a<i;a++){let n=l.getX(a);ub.fromBufferAttribute(u,n),u_(ub,n,s,r,e,t,this)}}else{let n=Math.max(0,a.start),i=Math.min(u.count,a.start+a.count);for(let a=n;a<i;a++)ub.fromBufferAttribute(u,a),u_(ub,a,s,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function u_(e,t,n,r,i,a,o){let s=uv.distanceSqToPoint(e);if(s<n){let n=new ih;uv.closestPointToPoint(e,n),n.applyMatrix4(r);let l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:o})}}class uw{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){let n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)t.push(i+=(n=this.getPoint(a/e)).distanceTo(r)),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){let n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];let o=0,s=a-1,l;for(;o<=s;
227)if((l=r[i=Math.floor(o+(s-o)/2)]-n)<0)o=i+1;else if(l>0)s=i-1;else{s=i;break}if(r[i=s]===n)return i/(a-1);let u=r[i],c=r[i+1];return(i+(n-u)/(c-u))/(a-1)}getTangent(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);let i=this.getPoint(n),a=this.getPoint(r),o=t||(i.isVector2?new rY:new ih);return o.copy(a).sub(i).normalize(),o}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){let n=new ih,r=[],i=[],a=[],o=new ih,s=new ij;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new ih)}i[0]=new ih,a[0]=new ih;let l=Number.MAX_VALUE,u=Math.abs(r[0].x),c=Math.abs(r[0].y),h=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),c<=l&&(l=c,n.set(0,1,0)),h<=l&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>Number.EPSILON){o.normalize();let e=Math.acos(rG(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(rG(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class uM extends uw{constructor(e=0,t=0,n=1,r=1,i=0,a=2*Math.PI,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t=new rY){let n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,i=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=i?0:n),!0!==this.aClockwise||i||(r===n?r=-n:r-=n);let a=this.aStartAngle+e*r,o=this.aX+this.xRadius*Math.cos(a),s=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=o-this.aX,r=s-this.aY;o=n*e-r*t+this.aX,s=n*t+r*e+this.aY}return t.set(o,s)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class uE extends uM{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type="ArcCurve"}}function uS(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let l=(t-e)/a-(n-e)/(a+o)+(n-t)/o,u=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,l*=o,u*=o)},calc:function(i){let a=i*i;return e+t*i+n*a+a*i*r}}}let uT=new ih,uA=new uS,uC=new uS,uR=new uS;class uP extends uw{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new ih){let n,r,i=this.points,a=i.length,o=(a-!this.closed)*e,s=Math.floor(o),l=o-s;this.closed?s+=s>0?0:(Math.floor(Math.abs(s)/a)+1)*a:0===l&&s===a-1&&(s=a-2,l=1),this.closed||s>0?n=i[(s-1)%a]:(uT.subVectors(i[0],i[1]).add(i[0]),n=uT);let u=i[s%a],c=i[(s+1)%a];if(this.closed||s+2<a?r=i[(s+2)%a]:(uT.subVectors(i[a-1],i[a-2]).add(i[a-1]),r=uT),"centripetal"===this.curveType||"chordal"===this.curveType){let e="chordal"===this.curveType?.5:.25,t=Math.pow(n.distanceToSquared(u),e),i=Math.pow(u.distanceToSquared(c),e),a=Math.pow(c.distanceToSquared(r),e);i<1e-4&&(i=1),t<1e-4&&(t=i),a<1e-4&&(a=i),uA.initNonuniformCatmullRom(n.x,u.x,c.x,r.x,t,i,a),uC.initNonuniformCatmullRom(n.y,u.y,c.y,r.y,t,i,a),uR.initNonuniformCatmullRom(n.z,u.z,c.z,r.z,t,i,a)}else"catmullrom"===this.curveType&&(uA.initCatmullRom(n.x,u.x,c.x,r.x,this.tension),uC.initCatmullRom(n.y,u.y,c.y,r.y,this.tension),uR.initCatmullRom(n.z,u.z,c.z,r.z,this.tension));return t.set(uA.calc(l),uC.calc(l),uR.calc(l)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(new ih().fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function uI(e,t,n,r,i){let a=(r-t)*.5,o=(i-n)*.5,s=e*e;return e*s*(2*n-2*r+a+o)+(-3*n+3*r-2*a-o)*s+a*e+n}function uO(e,t,n,r){return function(e,t){let n=1-e;return n*n*t}(e,t)+2*(1-e)*e*n+e*e*r}function uL(e,t,n,r,i){return function(e,t){let n=1-e;return n*n*n*t}(e,t)+function(e,t){let n=1-e;return 3*n*n*e*t}(e,n)+3*(1-e)*e*e*r+e*e*e*i}class uD extends uw{constructor(e=new rY,t=new rY,n=new rY,r=new rY){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new rY){let n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(uL(e,n.x,r.x,i.x,a.x),uL(e,n.y,r.y,i.y,a.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class uN extends uw{constructor(e=new ih,t=new ih,n=new ih,r=new ih){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new ih){let n=this.v0,r=this.v1,i=this.v2,a=this.v3;return t.set(uL(e,n.x,r.x,i.x,a.x),uL(e,n.y,r.y,i.y,a.y),uL(e,n.z,r.z,i.z,a.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class uU extends uw{constructor(e=new rY,t=new rY){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new rY){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}
227getTangent(e,t=new rY){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class uk extends uw{constructor(e=new ih,t=new ih){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new ih){return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new ih){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class uB extends uw{constructor(e=new rY,t=new rY,n=new rY){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new rY){let n=this.v0,r=this.v1,i=this.v2;return t.set(uO(e,n.x,r.x,i.x),uO(e,n.y,r.y,i.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class uF extends uw{constructor(e=new ih,t=new ih,n=new ih){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new ih){let n=this.v0,r=this.v1,i=this.v2;return t.set(uO(e,n.x,r.x,i.x),uO(e,n.y,r.y,i.y),uO(e,n.z,r.z,i.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class uz extends uw{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new rY){let n=this.points,r=(n.length-1)*e,i=Math.floor(r),a=r-i,o=n[0===i?i:i-1],s=n[i],l=n[i>n.length-2?n.length-1:i+1],u=n[i>n.length-3?n.length-1:i+2];return t.set(uI(a,o.x,s.x,l.x,u.x),uI(a,o.y,s.y,l.y,u.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(new rY().fromArray(n))}return this}}var uH=Object.freeze({__proto__:null,ArcCurve:uE,CatmullRomCurve3:uP,CubicBezierCurve:uD,CubicBezierCurve3:uN,EllipseCurve:uM,LineCurve:uU,LineCurve3:uk,QuadraticBezierCurve:uB,QuadraticBezierCurve3:uF,SplineCurve:uz});class uj extends uw{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){let n=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new uH[n](t,e))}return this}getPoint(e,t){let n=e*this.getLength(),r=this.getCurveLengths(),i=0;for(;i<r.length;){if(r[i]>=n){let e=r[i]-n,a=this.curves[i],o=a.getLength(),s=0===o?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,r=this.curves.length;n<r;n++)e.push(t+=this.curves[n].getLength());return this.cacheLengths=e,e}getSpacedPoints(e=40){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){let t,n=[];for(let r=0,i=this.curves;r<i.length;r++){let a=i[r],o=a.isEllipseCurve?2*e:a.isLineCurve||a.isLineCurve3?1:a.isS
227plineCurve?e*a.points.length:e,s=a.getPoints(o);for(let e=0;e<s.length;e++){let r=s[e];t&&t.equals(r)||(n.push(r),t=r)}}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){let n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){let n=e.curves[t];this.curves.push(new uH[n.type]().fromJSON(n))}return this}}class uW extends uj{constructor(e){super(),this.type="Path",this.currentPoint=new rY,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let n=new uU(this.currentPoint.clone(),new rY(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){let i=new uB(this.currentPoint.clone(),new rY(e,t),new rY(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,a){let o=new uD(this.currentPoint.clone(),new rY(e,t),new rY(n,r),new rY(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}splineThru(e){let t=new uz([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,a){let o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this}absarc(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this}ellipse(e,t,n,r,i,a,o,s){let l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+l,t+u,n,r,i,a,o,s),this}absellipse(e,t,n,r,i,a,o,s){let l=new uM(e,t,n,r,i,a,o,s);if(this.curves.length>0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class uG extends aH{constructor(e=1,t=1,n=1,r=32,i=1,a=!1,o=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};let l=this;r=Math.floor(r),i=Math.floor(i);let u=[],c=[],h=[],d=[],p=0,f=[],m=n/2,g=0;function v(n){let i=p,a=new rY,f=new ih,v=0,y=!0===n?e:t,b=!0===n?1:-1;for(let e=1;e<=r;e++)c.push(0,m*b,0),h.push(0,b,0),d.push(.5,.5),p++;let x=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);f.x=y*i,f.y=m*b,f.z=y*n,c.push(f.x,f.y,f.z),h.push(0,b,0),a.x=.5*n+.5,a.y=.5*i*b+.5,d.push(a.x,a.y),p++}for(let e=0;e<r;e++){let t=i+e,r=x+e;!0===n?u.push(r,r+1,t):u.push(r+1,r,t),v+=3}l.addGroup(g,v,!0===n?1:2),g+=v}(function(){let a=new ih,v=new ih,y=0,b=(t-e)/n;for(let l=0;l<=i;l++){let u=[],g=l/i,y=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,l=Math.sin(i),f=Math.cos(i);v.x=y*l,v.y=-g*n+m,v.z=y*f,c.push(v.x,v.y,v.z),a.set(l,b,f).normalize(),h.push(a.x,a.y,a.z),d.push(t,1-g),u.push(p++)}f.push(u)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){let n=f[t][e],r=f[t+1][e],i=f[t+1][e+1],a=f[t][e+1];u.push(n,r,a),u.push(r,i,a),y+=6}l.addGroup(g,y,0),g+=y})(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(u),this.setAttribute("position",new aL(c,3)),this.setAttribute("normal",new aL(h,3)),this.setAttribute("uv",new aL(d,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new uG(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class uV extends uW{constructor(e){super(e),this.uuid=rW(),this.type="Shape",this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){let n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){let n=e.holes[t];this.holes.push(new uW().fromJSON(n))}return this}}let uX={triangulate:function(e,t,n=2){let r,i,a,o,s,l,u,c=t&&t.length,h=c?t[0]*n:e.length,d=uq(e,0,h,n,!0),p=[];if(!d||d.next===d.prev)return p;if(c&&(d=function(e,t,n,r){let i,a,o,s,l,u=[];for(i=0,a=t.length;i<a;i++)o=t[i]*r,s=i<a-1?t[i+1]*r:e.length,(l=uq(e,o,s,r,!1))===l.next&&(l.steiner=!0),u.push(function(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}(l));for(u.sort(uZ),i=0;i<u.length;i++)n=function(e,t){let n=function(e,t){let n=t,r=-1/0,i,a=e.x,o=e.y;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let e=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=a&&e>
227r&&(r=e,i=n.x<n.next.x?n:n.next,e===a))return i}n=n.next}while(n!==t);if(!i)return null;let s=i,l=i.x,u=i.y,c=1/0,h;n=i;do{var d,p;a>=n.x&&n.x>=l&&a!==n.x&&uK(o<u?a:r,o,l,u,o<u?r:a,o,n.x,n.y)&&(h=Math.abs(o-n.y)/(a-n.x),u3(n,e)&&(h<c||h===c&&(n.x>i.x||n.x===i.x&&(d=i,p=n,0>uJ(d.prev,d,p.prev)&&0>uJ(p.next,d,d.next))))&&(i=n,c=h)),n=n.next}while(n!==s);return i}(e,t);if(!n)return t;let r=u5(n,e);return uY(r,r.next),uY(n,n.next)}(u[i],n);return n}(e,t,d,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(let t=n;t<h;t+=n)s=e[t],l=e[t+1],s<r&&(r=s),l<i&&(i=l),s>a&&(a=s),l>o&&(o=l);u=0!==(u=Math.max(a-r,o-i))?32767/u:0}return function e(t,n,r,i,a,o,s){if(!t)return;!s&&o&&function(e,t,n,r){let i=e;do 0===i.z&&(i.z=u$(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,a,o,s,l,u=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,u*=2}while(o>1)}(i)}(t,i,a,o);let l=t,u,c;for(;t.prev!==t.next;){if(u=t.prev,c=t.next,o?function(e,t,n,r){let i=e.prev,a=e.next;if(uJ(i,e,a)>=0)return!1;let o=i.x,s=e.x,l=a.x,u=i.y,c=e.y,h=a.y,d=o<s?o<l?o:l:s<l?s:l,p=u<c?u<h?u:h:c<h?c:h,f=o>s?o>l?o:l:s>l?s:l,m=u>c?u>h?u:h:c>h?c:h,g=u$(d,p,t,n,r),v=u$(f,m,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=g&&b&&b.z<=v;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&uK(o,u,s,c,l,h,y.x,y.y)&&uJ(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=d&&b.x<=f&&b.y>=p&&b.y<=m&&b!==i&&b!==a&&uK(o,u,s,c,l,h,b.x,b.y)&&uJ(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=g;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&uK(o,u,s,c,l,h,y.x,y.y)&&uJ(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=d&&b.x<=f&&b.y>=p&&b.y<=m&&b!==i&&b!==a&&uK(o,u,s,c,l,h,b.x,b.y)&&uJ(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}(t,i,a,o):function(e){let t=e.prev,n=e.next;if(uJ(t,e,n)>=0)return!1;let r=t.x,i=e.x,a=n.x,o=t.y,s=e.y,l=n.y,u=r<i?r<a?r:a:i<a?i:a,c=o<s?o<l?o:l:s<l?s:l,h=r>i?r>a?r:a:i>a?i:a,d=o>s?o>l?o:l:s>l?s:l,p=n.next;for(;p!==t;){if(p.x>=u&&p.x<=h&&p.y>=c&&p.y<=d&&uK(r,o,i,s,a,l,p.x,p.y)&&uJ(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(t)){n.push(u.i/r|0),n.push(t.i/r|0),n.push(c.i/r|0),u6(t),t=c.next,l=c.next;continue}if((t=c)===l){s?1===s?e(t=function(e,t,n){let r=e;do{let i=r.prev,a=r.next.next;!uQ(i,a)&&u0(i,r,r.next,a)&&u3(i,a)&&u3(a,i)&&(t.push(i.i/n|0),t.push(r.i/n|0),t.push(a.i/n|0),u6(r),u6(r.next),r=e=a),r=r.next}while(r!==e);return uY(r)}(uY(t),n,r),n,r,i,a,o,2):2===s&&function(t,n,r,i,a,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){var l,u;if(s.i!==t.i&&(l=s,u=t,l.next.i!==u.i&&l.prev.i!==u.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&u0(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(l,u)&&(u3(l,u)&&u3(u,l)&&function(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}(l,u)&&(uJ(l.prev,l,u.prev)||uJ(l,u.prev,u))||uQ(l,u)&&uJ(l.prev,l,l.next)>0&&uJ(u.prev,u,u.next)>0))){let l=u5(s,t);s=uY(s,s.next),l=uY(l,l.next),e(s,n,r,i,a,o,0),e(l,n,r,i,a,o,0);return}t=t.next}s=s.next}while(s!==t)}(t,n,r,i,a,o):e(uY(t),n,r,i,a,o,1);break}}}(d,p,n,r,i,u,0),p}};function uq(e,t,n,r,i){let a,o;if(i===function(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(a=t;a<n;a+=r)o=u4(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=u4(a,e[a],e[a+1],o);return o&&uQ(o,o.next)&&(u6(o),o=o.next),o}function uY(e,t){if(!e)return e;t||(t=e);let n=e,r;do if(r=!1,!n.steiner&&(uQ(n,n.next)||0===uJ(n.prev,n,n.next))){if(u6(n),(n=t=n.prev)===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function uZ(e,t){return e.x-t.x}function u$(e,t,n,r,i){return(e=((e=((e=((e=((e=(e-n)*i|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-r)*i|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function uK(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function uJ(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function uQ(e,t){return e.x===t.x&&e.y===t.y}function u0(e,t,n,r){let i=u2(uJ(e,t,n)),a=u2(uJ(e,t,r)),o=u2(uJ(n,r,e)),s=u2(uJ(n,r,t));return!!(i!==a&&o!==s||0===i&&u1(e,n,t)||0===a&&u1(e,r,t)||0===o&&u1(n,e,r)||0===s&&u1(n,t,r))}function u1(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function u2(e){return e>0?1:e<0?-1:0}function u3(e,t){return 0>uJ(e.prev,e,e.next)?uJ(e,t,e.next)>=0&&uJ(e,e.prev,t)>=0:0>uJ(e,t,e.prev)||0>uJ(e,e.next,t)}function u5(e,t){let n=new u8(e.i,e.x,e.y),r=new u8(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function u4(e,t,n,r){let i=new u8(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function u6(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function u8(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class u7{static area(e){let t=e.length,n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return .5*n}static isClockWise(e){return 0>u7.area(e)}static triangulateShape(e,t){let n=[],r=[],i=[];u9(e),ce(n,e);let a=e.length;t.forEach(u9);for(let e=0;e<t.length;e++)r.push(a),a+=t[e].length,ce(n,t[e]);let o=uX.triangulate(n,r);for(let e=0;e<o.length;e+=3)i.push(o.slice(e,e+3));return i}}function u9(e){let t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function ce(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class ct extends aH{constructor(e=new uV([new rY(.5,.5),new rY(-.5,.5),new rY(-.5,-.5),new rY(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let n=this,r=[],i=[];for(let a=0,o=e.length;a<o;a++)!function(e){let a,o,s,l,u=[],c=void 0!==t.curveSegments?t.curveSegments:12,h=void 0!==t.steps?t.steps:1,d=void 0!==t.depth?t.depth:1,p=void 0===t.bevelEnabled||t.bevelEnabled,f=void 0!==t.bevelThickness?t.bevelThickness:.2,m=void 0!==t.bevelSize?t.bevelSize:f-.1,g=void 0!==t.bevelOffset?t.bevelOffset:0,v=void 0!==t.bevelSegments?t.bevelSegments:3,y=t.extrudePath,b=void 0!==t.UVGenerator?t.UVGenerator:cn,x,_=!1;
227y&&(x=y.getSpacedPoints(h),_=!0,p=!1,a=y.computeFrenetFrames(h,!1),o=new ih,s=new ih,l=new ih),p||(v=0,f=0,m=0,g=0);let w=e.extractPoints(c),M=w.shape,E=w.holes;if(!u7.isClockWise(M)){M=M.reverse();for(let e=0,t=E.length;e<t;e++){let t=E[e];u7.isClockWise(t)&&(E[e]=t.reverse())}}let S=u7.triangulateShape(M,E),T=M;for(let e=0,t=E.length;e<t;e++){let t=E[e];M=M.concat(t)}function A(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().addScaledVector(t,n)}let C=M.length,R=S.length;function P(e,t,n){let r,i,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,u=n.y-e.y,c=o*o+s*s;if(Math.abs(o*u-s*l)>Number.EPSILON){let h=Math.sqrt(c),d=Math.sqrt(l*l+u*u),p=t.x-s/h,f=t.y+o/h,m=((n.x-u/d-p)*u-(n.y+l/d-f)*l)/(o*u-s*l),g=(r=p+o*m-e.x)*r+(i=f+s*m-e.y)*i;if(g<=2)return new rY(r,i);a=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(u)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(c)):(r=o,i=s,a=Math.sqrt(c/2))}return new rY(r/a,i/a)}let I=[];for(let e=0,t=T.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),I[e]=P(T[e],T[n],T[r]);let O=[],L,D=I.concat();for(let e=0,t=E.length;e<t;e++){let t=E[e];L=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),L[e]=P(t[e],t[r],t[i]);O.push(L),D=D.concat(L)}for(let e=0;e<v;e++){let t=e/v,n=f*Math.cos(t*Math.PI/2),r=m*Math.sin(t*Math.PI/2)+g;for(let e=0,t=T.length;e<t;e++){let t=A(T[e],I[e],r);k(t.x,t.y,-n)}for(let e=0,t=E.length;e<t;e++){let t=E[e];L=O[e];for(let e=0,i=t.length;e<i;e++){let i=A(t[e],L[e],r);k(i.x,i.y,-n)}}}let N=m+g;for(let e=0;e<C;e++){let t=p?A(M[e],D[e],N):M[e];_?(s.copy(a.normals[0]).multiplyScalar(t.x),o.copy(a.binormals[0]).multiplyScalar(t.y),l.copy(x[0]).add(s).add(o),k(l.x,l.y,l.z)):k(t.x,t.y,0)}for(let e=1;e<=h;e++)for(let t=0;t<C;t++){let n=p?A(M[t],D[t],N):M[t];_?(s.copy(a.normals[e]).multiplyScalar(n.x),o.copy(a.binormals[e]).multiplyScalar(n.y),l.copy(x[e]).add(s).add(o),k(l.x,l.y,l.z)):k(n.x,n.y,d/h*e)}for(let e=v-1;e>=0;e--){let t=e/v,n=f*Math.cos(t*Math.PI/2),r=m*Math.sin(t*Math.PI/2)+g;for(let e=0,t=T.length;e<t;e++){let t=A(T[e],I[e],r);k(t.x,t.y,d+n)}for(let e=0,t=E.length;e<t;e++){let t=E[e];L=O[e];for(let e=0,i=t.length;e<i;e++){let i=A(t[e],L[e],r);_?k(i.x,i.y+x[h-1].y,x[h-1].x+n):k(i.x,i.y,d+n)}}}function U(e,t){let i=e.length;for(;--i>=0;){let a=i,o=i-1;o<0&&(o=e.length-1);for(let e=0,i=h+2*v;e<i;e++){let i=C*e,s=C*(e+1);!function(e,t,i,a){F(e),F(t),F(a),F(t),F(i),F(a);let o=r.length/3,s=b.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);z(s[0]),z(s[1]),z(s[3]),z(s[1]),z(s[2]),z(s[3])}(t+a+i,t+o+i,t+o+s,t+a+s)}}}function k(e,t,n){u.push(e),u.push(t),u.push(n)}function B(e,t,i){F(e),F(t),F(i);let a=r.length/3,o=b.generateTopUV(n,r,a-3,a-2,a-1);z(o[0]),z(o[1]),z(o[2])}function F(e){r.push(u[3*e+0]),r.push(u[3*e+1]),r.push(u[3*e+2])}function z(e){i.push(e.x),i.push(e.y)}(function(){let e=r.length/3;if(p){let e=0*C;for(let t=0;t<R;t++){let n=S[t];B(n[2]+e,n[1]+e,n[0]+e)}e=C*(h+2*v);for(let t=0;t<R;t++){let n=S[t];B(n[0]+e,n[1]+e,n[2]+e)}}else{for(let e=0;e<R;e++){let t=S[e];B(t[2],t[1],t[0])}for(let e=0;e<R;e++){let t=S[e];B(t[0]+C*h,t[1]+C*h,t[2]+C*h)}}n.addGroup(e,r.length/3-e,0)})(),function(){let e=r.length/3,t=0;U(T,0),t+=T.length;for(let e=0,n=E.length;e<n;e++){let n=E[e];U(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}()}(e[a]);this.setAttribute("position",new aL(r,3)),this.setAttribute("uv",new aL(i,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,r=e.length;t<r;t++){let r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);return n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){let n=[];for(let r=0,i=e.shapes.length;r<i;r++){let i=t[e.shapes[r]];n.push(i)}let r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=new uH[r.type]().fromJSON(r)),new ct(n,e.options)}}let cn={generateTopUV:function(e,t,n,r,i){let a=t[3*n],o=t[3*n+1],s=t[3*r],l=t[3*r+1],u=t[3*i],c=t[3*i+1];return[new rY(a,o),new rY(s,l),new rY(u,c)]},generateSideWallUV:function(e,t,n,r,i,a){let o=t[3*n],s=t[3*n+1],l=t[3*n+2],u=t[3*r],c=t[3*r+1],h=t[3*r+2],d=t[3*i],p=t[3*i+1],f=t[3*i+2],m=t[3*a],g=t[3*a+1],v=t[3*a+2];return Math.abs(s-c)<Math.abs(o-u)?[new rY(o,1-l),new rY(u,1-h),new rY(d,1-f),new rY(m,1-v)]:[new rY(s,1-l),new rY(c,1-h),new rY(p,1-f),new rY(g,1-v)]}};class cr extends aH{constructor(e=new uV([new rY(0,.5),new rY(-.5,-.5),new rY(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};let n=[],r=[],i=[],a=[],o=0,s=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(o,s,t),o+=s,s=0;function l(e){let o=r.length/3,l=e.extractPoints(t),u=l.shape,c=l.holes;!1===u7.isClockWise(u)&&(u=u.reverse());for(let e=0,t=c.length;e<t;e++){let t=c[e];!0===u7.isClockWise(t)&&(c[e]=t.reverse())}
227let h=u7.triangulateShape(u,c);for(let e=0,t=c.length;e<t;e++){let t=c[e];u=u.concat(t)}for(let e=0,t=u.length;e<t;e++){let t=u[e];r.push(t.x,t.y,0),i.push(0,0,1),a.push(t.x,t.y)}for(let e=0,t=h.length;e<t;e++){let t=h[e],r=t[0]+o,i=t[1]+o,a=t[2]+o;n.push(r,i,a),s+=3}}this.setIndex(n),this.setAttribute("position",new aL(r,3)),this.setAttribute("normal",new aL(i,3)),this.setAttribute("uv",new aL(a,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){let r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){let n=[];for(let r=0,i=e.shapes.length;r<i;r++){let i=t[e.shapes[r]];n.push(i)}return new cr(n,e.curveSegments)}}class ci extends aE{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new a_(0xffffff),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new a_(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new rY(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new iJ,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ca extends ci{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new rY(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return rG(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new a_(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new a_(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new a_(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function co(e,t,n){return e&&(n||e.constructor!==t)?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}function cs(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function cl(e,t,n,r){let i=1,a=e[0];for(;void 0!==a&&void 0===a[r];)a=e[i++];if(void 0===a)return;let o=a[r];if(void 0!==o)if(Array.isArray(o))do void 0!==(o=a[r])&&(t.push(a.time),n.push.apply(n,o)),a=e[i++];while(void 0!==a);else if(void 0!==o.toArray)do void 0!==(o=a[r])&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(void 0!==a);else do void 0!==(o=a[r])&&(t.push(a.time),n.push(o)),a=e[i++];while(void 0!==a)}class cu{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let a;n:{r:if(!(e<r)){for(let a=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(!(e>=i)){let o=t[1];e<o&&(n=2,i=o);for(let a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(r=i,e>=(i=t[--n-1]))break t}a=n,n=0;break n}break e}for(;n<a;){let r=n+a>>>1;e<t[r]?a=r:n=r+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class cc extends cu{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,n){let r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:i=e,o=2*t-n;break;case 2402:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=e,s=2*n-t;break;case 2402:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}let l=(n-t)*.5,u=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*u,this._offsetNext=a*u}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=this._offsetPrev,c=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,b=d*m-d*f;for(let e=0;e!==o;++e)i[e]=g*a[u+e]+v*a[l+e]+y*a[s+e]+b*a[c+e];return i}}class ch extends cu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,u=(n-t)/(r-t),c=1-u;for(let e=0;e!==o;++e)i[e]=a[l+e]*c+a[s+e]*u;return i}}class cd extends cu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class cp{constructor(e,t,n,r){if(void 0===e)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=co(t,this.TimeBufferType),this.values=co(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t,n=e.constructor;if(n.toJSON!==this.toJSON)t=n.toJSON(e);else{t={name:e.name,times:co(e.times,Array),values:co(e.values,Array)};let n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t}InterpolantFactoryMethodDiscrete(e){return new cd(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new ch(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new cc(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){let t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t);return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){let t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){let n=this.times,r=n.length,i=0,a=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){var e;let t=!0,n=this.getValueSize();n-Math.floor(n)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let r=this.times,i=this.values,a=r.length;0===a&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let e=0;e!==a;e++){let n=r[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!==o&&o>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,o),t=!1;break}o=n}if(void 0!==i&&ArrayBuffer.isView(e=i)&&!(e instanceof DataView))for(let e=0,n=i.length;e!==n;++e){let n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=2302===this.getInterpolation(),i=e.length-1,a=1;for(let o=1;o<i;++o){let i=!1,s=e[o];if(s!==e[o+1]&&(1!==o||s!==e[0]))if(r)i=!0;else{let e=o*n,r=e-n,a=e+n;for(let o=0;o!==n;++o){let n=t[e+o];if(n!==t[r+o]||n!==t[a+o]){i=!0;break}}}if(i){if(o!==a){e[a]=e[o];let r=o*n,i=a*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++a}}if(i>0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}cp.prototype.TimeBufferType=Float32Array,cp.prototype.ValueBufferType=Float32Array,cp.prototype.DefaultInterpolation=2301;class cf extends cp{constructor(e,t,n){super(e,t,n)}}cf.prototype.ValueTypeName="bool",cf.prototype.ValueBufferType=Array,cf.prototype.DefaultInterpolation=2300,cf.prototype.InterpolantFactoryMethodLinear=void 0,cf.prototype.InterpolantFactoryMethodSmooth=void 0;class cm extends cp{}cm.prototype.ValueTypeName="color";class cg extends cp{}cg.prototype.ValueTypeName="number";class cv extends cu{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),l=e*o;for(let e=l+o;l!==e;l+=4)ic.slerpFlat(i,0,a,l-o,a,l,s);return i}}class cy extends cp{InterpolantFactoryMethodLinear(e){return new cv(this.times,this.values,this.getValueSize(),e)}}cy.prototype.ValueTypeName="quaternion",cy.prototype.InterpolantFactoryMethodSmooth=void 0;class cb extends cp{constructor(e,t,n){super(e,t,n)}}cb.prototype.ValueTypeName="string",cb.prototype.ValueBufferType=Array,cb.prototype.DefaultInterpolation=2300,cb.prototype.InterpolantFactoryMethodLinear=void 0,cb.prototype.InterpolantFactoryMethodSmooth=void 0;class cx extends cp{}cx.prototype.ValueTypeName="vector";class c_{constructor(e="",t=-1,n=[],r=2500){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=rW(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push((function(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return cg;
227case"vector":case"vector2":case"vector3":case"vector4":return cx;case"color":return cm;case"quaternion":return cy;case"bool":case"boolean":return cf;case"string":return cb}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){let t=[],n=[];cl(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)})(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(cp.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e<i;e++){let o=[],s=[];o.push((e+i-1)%i,e,(e+1)%i),s.push(0,1,0);let l=function(e){let t=e.length,n=Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort(function(t,n){return e[t]-e[n]}),n}(o);o=cs(o,1,l),s=cs(s,1,l),r||0!==o[0]||(o.push(i),s.push(s[0])),a.push(new cg(".morphTargetInfluences["+t[e].name+"]",o,s).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;Array.isArray(e)||(n=e.geometry&&e.geometry.animations||e.animations);for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){let r={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){let n=e[t],a=n.name.match(i);if(a&&a.length>1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let n=function(e,t,n,r,i){if(0!==n.length){let a=[],o=[];cl(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode,s=e.length||-1,l=e.hierarchy||[];for(let e=0;e<l.length;e++){let i=l[e].keys;if(i&&0!==i.length)if(i[0].morphTargets){let e,t={};for(e=0;e<i.length;e++)if(i[e].morphTargets)for(let n=0;n<i[e].morphTargets.length;n++)t[i[e].morphTargets[n]]=-1;for(let n in t){let t=[],a=[];for(let r=0;r!==i[e].morphTargets.length;++r){let r=i[e];t.push(r.time),a.push(+(r.morphTarget===n))}r.push(new cg(".morphTargetInfluence["+n+"]",t,a))}s=t.length*a}else{let a=".bones["+t[e].name+"]";n(cx,a+".position",i,"pos",r),n(cy,a+".quaternion",i,"rot",r),n(cx,a+".scale",i,"scl",r)}}return 0===r.length?null:new this(i,s,r,o)}resetDuration(){let e=this.tracks,t=0;for(let n=0,r=e.length;n!==r;++n){let e=this.tracks[n];t=Math.max(t,e.times[e.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}let cw={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class cM{constructor(e,t,n){let r,i=this,a=!1,o=0,s=0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){s++,!1===a&&void 0!==i.onStart&&i.onStart(e,o,s),a=!0},this.itemEnd=function(e){o++,void 0!==i.onProgress&&i.onProgress(e,o,s),o===s&&(a=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return r?r(e):e},this.setURLModifier=function(e){return r=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){let t=l.indexOf(e);return -1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){let n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}let cE=new cM;class cS{constructor(e){this.manager=void 0!==e?e:cE,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let n=this;return new Promise(function(r,i){n.load(e,r,t,i)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}cS.DEFAULT_MATERIAL_NAME="__DEFAULT";let cT={};
227class cA extends Error{constructor(e,t){super(e),this.response=t}}class cC extends cS{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let i=cw.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout(()=>{t&&t(i),this.manager.itemEnd(e)},0),i;if(void 0!==cT[e])return void cT[e].push({onLoad:t,onProgress:n,onError:r});cT[e]=[],cT[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;let n=cT[e],r=t.body.getReader(),i=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),a=i?parseInt(i):0,o=0!==a,s=0;return new Response(new ReadableStream({start(e){!function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{let r=new ProgressEvent("progress",{lengthComputable:o,loaded:s+=i.byteLength,total:a});for(let e=0,t=n.length;e<t;e++){let t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}},t=>{e.error(t)})}()}}))}throw new cA(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>new DOMParser().parseFromString(e,o));case"json":return e.json();default:if(void 0===o)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=new TextDecoder(t&&t[1]?t[1].toLowerCase():void 0);return e.arrayBuffer().then(e=>n.decode(e))}}}).then(t=>{cw.add(e,t);let n=cT[e];delete cT[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onLoad&&r.onLoad(t)}}).catch(t=>{let n=cT[e];if(void 0===n)throw this.manager.itemError(e),t;delete cT[e];for(let e=0,r=n.length;e<r;e++){let r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class cR extends cS{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=cw.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a;let o=rJ("img");function s(){u(),cw.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){u(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function u(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}class cP extends cS{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new lJ,o=new cC(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(i.withCredentials),o.load(e,function(e){let n;try{n=i.parse(e)}catch(e){if(void 0===r)return void console.error(e);r(e)}void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:1001,a.wrapT=void 0!==n.wrapT?n.wrapT:1001,a.magFilter=void 0!==n.magFilter?n.magFilter:1006,a.minFilter=void 0!==n.minFilter?n.minFilter:1006,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.colorSpace&&(a.colorSpace
227=n.colorSpace),void 0!==n.flipY&&(a.flipY=n.flipY),void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=1008),1===n.mipmapCount&&(a.minFilter=1006),void 0!==n.generateMipmaps&&(a.generateMipmaps=n.generateMipmaps),a.needsUpdate=!0,t&&t(a,n)},n,r),a}}class cI extends cS{constructor(e){super(e)}load(e,t,n,r){let i=new ii,a=new cR(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)},n,r),i}}class cO extends aa{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new a_(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}let cL=new ij,cD=new ih,cN=new ih;class cU{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new rY(512,512),this.map=null,this.mapPass=null,this.matrix=new ij,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ov,this._frameExtents=new rY(1,1),this._viewportCount=1,this._viewports=[new ia(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,n=this.matrix;cD.setFromMatrixPosition(e.matrixWorld),t.position.copy(cD),cN.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(cN),t.updateMatrixWorld(),cL.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(cL),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(cL)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class ck extends cU{constructor(){super(new os(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,n=2*rj*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;(n!==t.fov||r!==t.aspect||i!==t.far)&&(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class cB extends cO{constructor(e,t,n=0,r=Math.PI/3,i=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(aa.DEFAULT_UP),this.updateMatrix(),this.target=new aa,this.distance=n,this.angle=r,this.penumbra=i,this.decay=a,this.map=null,this.shadow=new ck}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}let cF=new ij,cz=new ih,cH=new ih;class cj extends cU{constructor(){super(new os(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new rY(4,2),this._viewportCount=6,this._viewports=[new ia(2,1,1,1),new ia(0,1,1,1),new ia(3,1,1,1),new ia(1,1,1,1),new ia(3,0,1,1),new ia(1,0,1,1)],this._cubeDirections=[new ih(1,0,0),new ih(-1,0,0),new ih(0,0,1),new ih(0,0,-1),new ih(0,1,0),new ih(0,-1,0)],this._cubeUps=[new ih(0,1,0),new ih(0,1,0),new ih(0,1,0),new ih(0,1,0),new ih(0,0,1),new ih(0,0,-1)]}updateMatrices(e,t=0){let n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),cz.setFromMatrixPosition(e.matrixWorld),n.position.copy(cz),cH.copy(n.position),cH.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(cH),n.updateMatrixWorld(),r.makeTranslation(-cz.x,-cz.y,-cz.z),cF.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(cF)}}class cW extends cO{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new cj}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class cG extends cU{constructor(){super(new oL(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}
227}class cV extends cO{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(aa.DEFAULT_UP),this.updateMatrix(),this.target=new aa,this.shadow=new cG}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class cX{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),"undefined"!=typeof TextDecoder)return new TextDecoder().decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");return -1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e))?e:t+e}}class cq extends cS{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=cw.get(e);if(void 0!==a)return(i.manager.itemStart(e),a.then)?void a.then(n=>{t&&t(n),i.manager.itemEnd(e)}).catch(e=>{r&&r(e)}):(setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0),a);let o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader;let s=fetch(e,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))}).then(function(n){return cw.add(e,n),t&&t(n),i.manager.itemEnd(e),n}).catch(function(t){r&&r(t),cw.remove(e),i.manager.itemError(e),i.manager.itemEnd(e)});cw.add(e,s),i.manager.itemStart(e)}}let cY="\\[\\]\\.:\\/",cZ=RegExp("["+cY+"]","g"),c$="[^"+cY+"]",cK="[^"+cY.replace("\\.","")+"]",cJ=/((?:WC+[\/:])*)/.source.replace("WC",c$),cQ=/(WCOD+)?/.source.replace("WCOD",cK),c0=RegExp("^"+cJ+cQ+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",c$)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",c$)+"$"),c1=["material","materials","bones","map"];class c2{constructor(e,t,n){let r=n||c3.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class c3{constructor(e,t,n){this.path=t,this.parsedPath=n||c3.parseTrackName(t),this.node=c3.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new c3.Composite(e,t,n):new c3(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(cZ,"")}static parseTrackName(e){let t=c0.exec(e);if(null===t)throw Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){let e=n.nodeName.substring(r+1);-1!==c1.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){let n=function(e){for(let r=0;r<e.length;r++){let i=e[r];if(i.name===t||i.uuid===t)return i;let a=n(i.children);if(a)return a}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 4,392 bytes, line 227
227_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=c3.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}let a=e[r];if(void 0===a)return void console.error("THREE.PropertyBinding: Trying to update property for track: "+t.nodeName+"."+r+" but it wasn't found.",e);let o=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}s=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=i}else void 0!==a.fromArray&&void 0!==a.toArray?(s=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(s=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=r;this.getValue=this.GetterByBindingType[s],this.setValue=this.SetterByBindingTypeAndVersioning[s][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}c3.Composite=c2,c3.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},c3.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},c3.prototype.GetterByBindingType=[c3.prototype._getValue_direct,c3.prototype._getValue_array,c3.prototype._getValue_arrayElement,c3.prototype._getValue_toArray],c3.prototype.SetterByBindingTypeAndVersioning=[[c3.prototype._setValue_direct,c3.prototype._setValue_direct_setNeedsUpdate,c3.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[c3.prototype._setValue_array,c3.prototype._setValue_array_setNeedsUpdate,c3.prototype._setValue_array_setMatr
227ixWorldNeedsUpdate],[c3.prototype._setValue_arrayElement,c3.prototype._setValue_arrayElement_setNeedsUpdate,c3.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[c3.prototype._setValue_fromArray,c3.prototype._setValue_fromArray_setNeedsUpdate,c3.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];let c5=new ij;class c4{constructor(e,t,n=0,r=1/0){this.ray=new iH(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new iQ,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return c5.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(c5),this}intersectObject(e,t=!0,n=[]){return c8(e,this,n,t),n.sort(c6),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)c8(e[r],this,n,t);return n.sort(c6),n}}function c6(e,t){return e.distance-t.distance}function c8(e,t,n,r){let i=!0;if(e.layers.test(t.layers)&&!1===e.raycast(t,n)&&(i=!1),!0===i&&!0===r){let r=e.children;for(let e=0,i=r.length;e<i;e++)c8(r[e],t,n,!0)}}class c7{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(rG(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}let c9=new rY;class he{constructor(e=new rY(Infinity,Infinity),t=new rY(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=c9.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=Infinity,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x)&&!(e.x>this.max.x)&&!(e.y<this.min.y)&&!(e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x)&&!(e.min.x>this.max.x)&&!(e.max.y<this.min.y)&&!(e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,c9).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}function ht(e,{minZoom:t,maxZoom:n}={minZoom:0,maxZoom:Number.MAX_SAFE_INTEGER}){let r=Math.max(t,Math.min(e,n));return r<10&&(r=10-(10-r)*1.5),Math.pow(1.62,r-15.54)}
227function hn(e,{minZoom:t,maxZoom:n}={minZoom:0,maxZoom:Number.MAX_SAFE_INTEGER}){let r=Math.log(e)/Math.log(1.62)+15.54;return r<10&&(r=10-(10-r)/1.5),Math.max(t,Math.min(r,n))}function hr(e){let t,n;return e>=15?(t=-3e3,n=3e3):e>=10?(t=-2e4,n=2e4):e>=5?(t=-5e5,n=5e5):e>=1.5?(t=-6e6,n=6e6):e>=0&&(t=-1e8,n=1e8),{near:t,far:n}}function hi(e,t=0){let n=e.extractPoints(1).shape;n.length>2&&n[n.length-1].equals(n[0])&&n.pop();let r=[];for(let e=0,t=n.length,i=t-1,a=e+1;e<t;e++,i++,a++)i===t&&(i=0),a===t&&(a=0),r[e]=function(e,t,n){var r,i,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,u=n.y-e.y,c=o*o+s*s;if(Math.abs(o*u-s*l)>Number.EPSILON){var h=Math.sqrt(c),d=Math.sqrt(l*l+u*u),p=t.x-s/h,f=t.y+o/h,m=((n.x-u/d-p)*u-(n.y+l/d-f)*l)/(o*u-s*l),g=(r=p+o*m-e.x)*r+(i=f+s*m-e.y)*i;if(g<=2)return new rY(r,i);a=Math.sqrt(g/2)}else{var v=!1;o>Number.EPSILON?l>Number.EPSILON&&(v=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(v=!0):Math.sign(s)===Math.sign(u)&&(v=!0),v?(r=-s,i=o,a=Math.sqrt(c)):(r=o,i=s,a=Math.sqrt(c/2))}return new rY(r/a,i/a)}(n[e],n[i],n[a]);return new uV(r.map((e,r)=>e.multiplyScalar(t).add(n[r])))}function ha(e){if(!e)return 0;let t=e.length,n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r][0]*e[i][1]-e[i][0]*e[r][1];return .5*n}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"165"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="165");let ho=new Map;function hs(e,t,n=!1,r=!1,i=0){let a=`${e} - ${t} - ${n} - ${r} - ${i}`;if(!ho.has(a))switch(e){case"basic":{let e=new on({vertexShader:`
228            void main() {
229              gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
230            }`,fragmentShader:`
231            uniform vec3 color;
232            uniform float alpha;
233
234            void main() {
235              gl_FragColor = vec4(color, alpha);
236
237              #include <tonemapping_fragment>
238              #include <colorspace_fragment>
239            }`,uniforms:{color:{value:new a_(t)},alpha:{value:1}},side:2,transparent:n,vertexColors:r,polygonOffset:!!i,polygonOffsetFactor:-1,polygonOffsetUnits:-i,userData:{type:a}});ho.set(a,e);break}case"lambert":{let e=new on({vertexShader:`
240            varying vec3 vColor;
241            varying vec3 vNormal;
242
243            #ifndef USE_COLOR
244              uniform vec3 color;
245            #endif
246
247            void main() {
248              vColor = color;
249              vNormal = normalize(normalMatrix * normal);
250              gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
251            }`,fragmentShader:`
252            varying vec3 vColor;
253            varying vec3 vNormal;
254
255            uniform vec3 skyColor;
256            uniform vec3 groundColor;
257            uniform float brightness;
258            uniform float alpha;
259
260            void main() {
261              float verticalFactor = 0.5 * (vNormal.y + 1.0);
262              vec3 baseColor = mix(groundColor, skyColor, verticalFactor);
263              vec3 finalColor = brightness * baseColor * vColor;
264              gl_FragColor = vec4(finalColor, alpha);
265
266              #include <tonemapping_fragment>
267              #include <colorspace_fragment>
268            }`,uniforms:{color:{value:new a_(t)},skyColor:{value:new a_("#ffffff")},groundColor:{value:new a_("#eeeeee")},brightness:{value:1.17},alpha:{value:1}},side:2,transparent:n,vertexColors:r,polygonOffset:!!i,polygonOffsetFactor:-1,polygonOffsetUnits:-i,userData:{type:a}});ho.set(a,e)}}return ho.get(a)}var hl=Object.defineProperty,hu=Object.defineProperties,hc=Object.getOwnPropertyDescriptors,hh=Object.getOwnPropertySymbols,hd=Object.prototype.hasOwnProperty,hp=Object.prototype.propertyIsEnumerable,hf=(e,t,n)=>t in e?hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hm=(e,t)=>{for(var n in t||(t={}))hd.call(t,n)&&hf(e,n,t[n]);if(hh)for(var n of hh(t))hp.call(t,n)&&hf(e,n,t[n]);return e},hg=(e,t)=>
268hu(e,hc(t)),hv=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},hy=(e,t,n)=>(hv(e,t,"read from private field"),n?n.call(e):t.get(e)),hb=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},hx=(e,t,n,r)=>(hv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);let h_={floor:!1,floorColor:"#606060",floorMinZoom:0,floorMaxZoom:1e3,roof:!1,roofColor:"#202020",roofHeight:2.5,roofMinZoom:0,roofMaxZoom:1e3,walls:!1,wallsColor:"#a0a0a0",wallsTopColor:null,wallsInsideColor:null,wallsHeight:2.5,wallsWidth:.1,wallsMinZoom:0,wallsMaxZoom:1e3,solid:!1,priority:0};class hw{constructor(e,{styles:t,mapProjection:n,originGeometry:r,doors:i=[],userData:a={}}={}){hb(this,o,null),hb(this,s,null),hb(this,l,null),hb(this,u,null),hb(this,c,null),hb(this,h,null),hb(this,d,function(){var e,t,n,r;let{styles:i,doors:a,userData:d,originGeometry:p}=hy(this,s),m=hy(this,l);if(!i.floor&&!i.roof&&!i.walls)return;let g=hy(this,f).call(this,hy(this,o));if(i.floor||i.roof){let e=new cr(g,0);if(e.deleteAttribute("normal"),e.deleteAttribute("uv"),e.parameters.shapes=null,e.rotateX(rq.degToRad(90)),i.floor){let t=i.floorMinZoom>0||i.floorMaxZoom<1e3,n=hs("basic",i.floorColor,t);n.depthWrite=!1;let r=new a4(e,n);r.matrixAutoUpdate=!1,r.updateMatrix(),r.renderOrder=t?-i.priority:i.priority,r.userData=hg(hm({},d),{part:"floor",minZoom:i.floorMinZoom,maxZoom:i.floorMaxZoom}),m.add(r),hx(this,u,r)}if(i.roof){let t=i.roofMinZoom>0||i.roofMaxZoom<1e3,n=hs("basic",i.roofColor,t,!1,i.priority),r=e.clone();r.translate(0,i.roofHeight+.01,0);let a=new a4(r,n);a.matrixAutoUpdate=!1,a.updateMatrix(),a.renderOrder=t?-i.priority:i.priority,a.userData=hg(hm({},d),{part:"roof",minZoom:i.roofMinZoom,maxZoom:i.roofMaxZoom}),m.add(a),hx(this,c,a)}}if(i.walls){let o=d.category.endsWith("-walls"),s=null;try{s=o?g:hy(this,v).call(this,g,{doors:a,wallsWidth:i.wallsWidth,solid:i.solid})}catch(e){console.log(`Walls skipped for the ${d.id}`)}if(s){let a=i.wallsMinZoom>0||i.wallsMaxZoom<1e3,l=i.wallsColor.toLowerCase(),u=null!=(t=null==(e=i.wallsTopColor)?void 0:e.toLowerCase())?t:l,c=null!=(r=null==(n=i.wallsInsideColor)?void 0:n.toLowerCase())?r:l,v=u!==l,y=c!==l&&(o&&p||i.walls&&!i.solid)&&["unit","fixture"].includes(d.type),b=(o||i.walls&&!i.solid)&&(v||y),x=hs("lambert",l,a,b,i.priority),_=new ct(s,{curveSegments:0,steps:1,depth:i.wallsHeight,bevelEnabled:!1}),w=[];if(y){let e=(o&&p?hy(this,f).call(this,p):g).map(e=>e.extractPoints(0).shape),t=_.getAttribute("position"),n=new rY,r=new rY,i=new rY,a=new rY;for(let o=0;o<t.count;o++){let s=t.getX(o),l=t.getY(o);n.set(s,l);let u=e.some(e=>{for(let t=0;t<e.length-1;t++){let o=e[t],s=e[t+1];r.subVectors(s,o),i.subVectors(n,o);let l=r.dot(i)/r.dot(r);if(l=Math.max(0,Math.min(1,l)),a.addVectors(o,r.multiplyScalar(l)),.01>n.distanceTo(a))return!0}return!1});w.push(!u)}}if(b){let e=new a_(l),t=new a_(u),n=new a_(c),r=[],i=_.getAttribute("normal");for(let a=0;a<i.count;a++)v&&-1===i.getZ(a)?r.push(t.r,t.g,t.b):y&&w[a]?r.push(n.r,n.g,n.b):r.push(e.r,e.g,e.b);_.setAttribute("color",new aL(r,3))}_.deleteAttribute("uv"),_.parameters.shapes=null,_.rotateX(rq.degToRad(90)),_.translate(0,i.wallsHeight,0);let M=new a4(_,x);M.renderOrder=a?-i.priority:i.priority,M.userData=hg(hm({},d),{part:"walls",minZoom:i.wallsMinZoom,maxZoom:i.wallsMaxZoom}),m.add(M),hx(this,h,M)}}}),hb(this,p,function(e){if(!hy(this,u))return;let{styles:t}=hy(this,s),n=t.floorMinZoom>0||t.floorMaxZoom<1e3;hy(this,u).material=hs("basic",e,n),hy(this,u).material.depthWrite=!1}),hb(this,f,function({type:e,coordinates:t}){let n=hy(this,s).mapProjection,r=e=>{let t=e.map(e=>n.projectToOrigin(e));return 0>ha(t)||t.reverse(),t};switch(e){case"Polygon":{let e=r(t[0]),n=t.slice(1).map(e=>r(e));return[hy(this,m).call(this,e,n)]}case"MultiPolygon":return t.map(e=>{let t=r(e[0]),n=e.slice(1).map(r);return hy(this,m).call(this,t,n)});default:throw Error("Expect Polygon or MultiPolygon geometry")}}),hb(this,m,function(e,t){let n=new uV;n.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++)n.lineTo(e[t][0],e[t][1]);
268return t.forEach(e=>{let t=new uW;t.moveTo(e[0][0],e[0][1]);for(let n=1;n<e.length;n++)t.lineTo(e[n][0],e[n][1]);n.holes.push(t)}),n}),hb(this,g,function(e,{width:t}){let[n,r]=e,i=r.clone().sub(n).normalize(),a=-i.y*t,o=i.x*t;n.addScaledVector(i.clone().negate(),t),r.addScaledVector(i.clone(),t);let s=new uV;return s.moveTo(n.x-a,n.y-o),s.lineTo(n.x+a,n.y+o),s.lineTo(r.x+a,r.y+o),s.lineTo(r.x-a,r.y-o),s}),hb(this,v,function(e,{doors:t,wallsWidth:n,solid:r}){let i=hy(this,s).mapProjection,a=t.reduce((e,t)=>{let r=t.geometry.coordinates;for(let t=0;t<r.length-1;t++){let a=new rY(...i.projectToOrigin(r[t])),o=new rY(...i.projectToOrigin(r[t+1]));if(0===t){let e=o.clone().sub(a).normalize();a.addScaledVector(e,3*n)}if(t===r.length-2){let e=o.clone().sub(a).normalize();o.addScaledVector(e.negate(),3*n)}e.push([a,o])}return e},[]);return e.flatMap(e=>hy(this,y).call(this,e,{doors:a,wallsWidth:n,solid:r}))}),hb(this,y,function(e,{doors:t=[],wallsWidth:n,solid:r}){let i=[];if(i.push({regions:[e.extractPoints().shape.map(({x:e,y:t})=>[e,t])],inverted:!1,part:"external"}),r&&e.holes.length&&e.holes.forEach(e=>{i.push({regions:[e.getPoints().map(({x:e,y:t})=>[e,t])],inverted:!1,part:"hole"})}),!r){let r=hi(e,-n);i.push({regions:[r.extractPoints().shape.map(({x:e,y:t})=>[e,t])],inverted:!1,part:"internal"}),t.forEach(e=>{i.push({regions:[hy(this,g).call(this,e,{width:n+.1}).extractPoints().shape.map(({x:e,y:t})=>[e,t])],inverted:!1,part:"door"})})}let a=rA.segments(i[0]);for(let e=1;e<i.length;e++){let t=i[e];try{let e=rA.segments(t),n=rA.combine(a,e);a=rA.selectDifference(n)}catch(r){let{id:e,type:n}=hy(this,s).userData;console.warn(`Failed to make a "${t.part}" of the "${n}" ${e}`)}}let o=rA.polygon(a),{type:l,coordinates:u}=rA.polygonToGeoJSON(o),c=e=>{if(.05>ha(e[0]))return null;let t=e[0].map(([e,t])=>new rY(e,t)),n=e.slice(1).map(e=>new uW(e.map(([e,t])=>new rY(e,t)))),r=new uV(t);return r.holes=n,r};return"Polygon"===l?[c(u)].filter(Boolean):"MultiPolygon"===l?u.map(c).filter(Boolean):null}),hx(this,s,{styles:hm(hm({},h_),t),mapProjection:n,doors:i,originGeometry:r,userData:a}),hx(this,l,new lS),hy(this,l).matrixAutoUpdate=!1,hx(this,o,e),hy(this,d).call(this)}get threeObject(){return hy(this,l)}set floorColor(e){e&&hy(this,p).call(this,e)}resetFloorColor(){hy(this,p).call(this,hy(this,s).styles.floorColor)}dispose(){hx(this,o,null),hx(this,s,null),hx(this,l,null),hx(this,u,null),hx(this,c,null),hx(this,h,null)}}function hM(e){let t,n,r,i=-1,a=0;for(let o=0;o<e.length;++o){let s=e[o];if(void 0===t&&(t=s.array.constructor),t!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=s.itemSize),n!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=s.normalized),r!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===i&&(i=s.gpuType),i!==s.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;a+=s.count*n}let o=new t(a),s=new aP(o,n,r),l=0;for(let t=0;t<e.length;++t){let r=e[t];if(r.isInterleavedBufferAttribute){let e=l/n;for(let t=0,i=r.count;t<i;t++)for(let i=0;i<n;i++){let n=r.getComponent(t,i);s.setComponent(t+e,i,n)}}else o.set(r.array,l);l+=r.count*n}return void 0!==i&&(s.gpuType=i),s}function hE(e,t){if(0===t)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(2!==t&&1!==t)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let n=e.getIndex();if(null===n){let t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}let r=n.count-2,i=[];if(2===t)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let a=e.clone();return a.setIndex(i),a.clearGroups(),a}}o=new WeakMap,s=new WeakMap,l=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,d=new WeakMap,p=new WeakMap,f=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakMap;var hS={exports:{}};!function(e){var t={single_source_shortest_paths:function(e,n,r){var i,a,o,s,l,u,c,h={},d={};d[n]=0;var p=t.PriorityQueue.make();for(p.push(n,0);!p.empty();)for(o in a=(i=p.pop()).value,s=i.cost,l=e[a]||{})l.hasOwnProperty(o)&&(u=s+l[o],c=d[o],(void 0===d[o]||c>u)&&(d[o]=u,p.push(o,u),h[o]=a));if(void 0!==r&&void 0===d[r])throw Error("Could not find a path from "+n+" to "+r+".");return h},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,n,r){var i=t.single_source_shortest_paths(e,n,r);return t.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var n,r=t.PriorityQueue,i={};for(n in e=e||{},r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i.queue=[],i.sorter=e.sorter||r.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t}(hS);var hT=hS.exports;function hA(e,t,n){let r=e instanceof rY?e:new rY(e[0],e[1]),i=t instanceof rY?t:new rY(t[0],t[1]),a=n instanceof rY?n:new rY(n[0],n[1]),o=a.clone().sub(i),s=r.clone().sub(i),l=o.length(),u=s.dot(o),c=o.multiplyScalar(u/l**2).add(i),h=i.x<a.x?i.x:a.x,d=i.x>a.x?i.x:a.x,p=i.y<a.y?i.y:a.y,f=i.y>a.y?i.y:a.y;if(c.x<h||d<c.x||c.y<p||f<c.y){let e=r.distanceTo(i),t=r.distanceTo(a);return{closestPoint:e<t?i:a,distance:e<t?e:t}}return{closestPoint:c,distance:r.distanceTo(c)}}let hC=(e,t)=>Math.pow(t.lat-e.lat,2)+Math.pow(t.lng-e.lng,2),hR=(e,t=[])=>{let{routes:n}=Mr;if(!n.routePoints.length)return null;let{ordinal:r,latLng:i}=e;if(!n.levelRoutePoints[r])return null;let[a,o]=n.levelRoutePoints[r],s=a+o-1,l=1/0,u=null;for(let e=a;
268e<=s;e++){if(t.includes(e))continue;let r=n.routePoints[e],a=hC(i,{lat:r[0],lng:r[1]});a<l&&(l=a,u=e)}return u};function hP(e,t){let n=e[0],r=e[1],i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e][0],s=t[e][1],l=t[a][0],u=t[a][1];s>r!=u>r&&n<(l-o)*(r-s)/(u-s)+o&&(i=!i)}return i}let hI=e=>e.reduce((t,n,r)=>{if(r+1===e.length)return t;let i=Mr.routes.links[Number(n)],a=e[r+1],o=i.find(e=>e.i.toString()===a);return o?Array.isArray(o.d)?t+o.d[0]:t+o.d:t},0);var hO=Object.defineProperty,hL=Object.defineProperties,hD=Object.getOwnPropertyDescriptors,hN=Object.getOwnPropertySymbols,hU=Object.prototype.hasOwnProperty,hk=Object.prototype.propertyIsEnumerable,hB=(e,t,n)=>t in e?hO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hF=(e,t)=>{for(var n in t||(t={}))hU.call(t,n)&&hB(e,n,t[n]);if(hN)for(var n of hN(t))hk.call(t,n)&&hB(e,n,t[n]);return e},hz=(e,t)=>hL(e,hD(t));let hH=(e,t,n,r)=>{let i=null==r?void 0:r.reduce((r,i)=>{var a;switch(i.type){case"skipUnits":{let{origins:n,destinations:a,units:o}=i;if(Array.isArray(n)&&!n.includes(e.occupantId)||Array.isArray(a)&&!a.includes(t.occupantId))break;null==o||o.forEach(e=>{var t;let n=Mr.units.get(e);null==(t=null==n?void 0:n.routePoints)||t.forEach(e=>r.add(e))});break}case"skipRoutePoints":{let{origins:n,destinations:a,routePoints:o}=i;if(Array.isArray(n)&&!n.includes(e.occupantId)||Array.isArray(a)&&!a.includes(t.occupantId))break;null==o||o.forEach(e=>r.add(e));break}case"excludeElevatorsByDefault":if(!n)for(let e of Mr.units.values())"elevator"===e.category&&(null==(a=e.routePoints)||a.forEach(e=>r.add(e)));break;case"blockFromSection":case"limitToSection":break;default:console.warn(`Route rule "${i.type}" not found`)}return r},new Set);return((e,t)=>Mr.routes.links.reduce((n,r,i)=>(n[i]=hF({},r.reduce((n,r)=>(null==t?void 0:t.has(r.i))?n:Array.isArray(r.d)?e?n:hz(hF({},n),{[r.i]:r.d[0]}):hz(hF({},n),{[r.i]:r.d}),{})),n),{}))(n,i)},hj=(e,t,n)=>{let r=(i=[])=>{let a=hR(e,i);if(!Number.isFinite(a))return null;try{return hT.find_path(n,a.toString(),t.toString()),a}catch(e){return r([...i,a])}};return r()},hW=(e,t,n)=>{var r,i;let{latLng:a,ordinal:o}=e,{routes:s}=Mr,{levelRoutePolygons:l}=s,u=null==(i=null==(r=null==t?void 0:t.occupant)?void 0:r.routePoints)?void 0:i[0];if(!u)return hR(e);let c=[a.lat,a.lng],h=null==l?void 0:l[o],d=null==h?void 0:h.filter(({polygon:e})=>hP(c,e)),p=null==d?void 0:d.flatMap(({routePoints:e})=>e),f=p?Array.from(new Set(p)):null;if(!f)return hj(e,u,n);let m=d.some(({isRoom:e})=>e)?f:f.filter(e=>{let t=Mr.routes.links[e];return t.length>1&&t.every(e=>Number.isFinite(e.d))});for(let{routePoint:e}of m.map(e=>{let t=Mr.routes.routePoints[Number(e)];return{routePoint:e,distance:function(e,t){let[n,r]=e,[i,a]=t,o=Math.abs(i-n),s=Math.abs(a-r);return o*o+s*s}(c,t)}}).sort((e,t)=>e.distance-t.distance))try{let t=hT.find_path(n,e.toString(),u.toString()),r=e;return t.map(Number).forEach(e=>{m.includes(e)&&(r=e)}),r}catch(e){continue}return(null==d?void 0:d.length)?null:hj(e,u,n)},hG=e=>{let t=Object.entries(Mr.routes.levelRoutePoints).find(([t,n])=>{let[r,i]=n;return r<=e&&e<r+i});return t?t[0]:null},hV=(e,t,n,r)=>{var i,a;let o="__your-location__"===e.occupantId,s="__your-location__"===t.occupantId,l=(o?[hW(e,t,r)]:null!=(i=e.occupant.routePoints)?i:[]).filter(Number.isFinite);if(0===l.length)throw Error(`Can't find the route points or links for the POI "${e.occupantId}"`);let u=(s?[hW(t,e,r)]:null!=(a=t.occupant.routePoints)?a:[]).filter(Number.isFinite);if(0===u.length)throw Error(`Can't find the route points or links for the POI "${t.occupantId}"`);let c=null,h=1/0;for(let e of l)for(let t of u)try{let n=hT.find_path(r,e.toString(),t.toString()),i=hI(n);i<h&&(c=n,h=i)}catch(e){continue}if(!c)throw Error(`Can't find a path from ${e.occupantId} to ${t.occupantId}"`);let d=c.reduce((e,t,n)=>{let r=n===c.length-1,i=0===n?null:c[n-1],a=r?null:c[n+1];if(!i||!a)return e.push(t),e;let o=hG(i),s=hG(t),l=hG(a);return s!==o&&s!==l?console.warn(`Connection restored for the points ${i} and ${a}`):e.push(t),e},[]);if("__your-location__"===e.occupantId&&d.length>=2){let t=d,{latLng:n}=e,r=[n.lat,n.lng];for(let e=0;e<t.length-1;e++){let{distance:n}=hA(r,Mr.routes.routePoints[Number(t[e])],Mr.routes.routePoints[Number(t[e+1])]);n<1e-7&&(d=t.slice(e+1))}}return d},hX=e=>{let t=Object.entries(Mr.routes.levelRoutePoints).find(([t,n])=>{let[r,i]=n;return r<=e&&e<r+i});return t?t[0]:null};var hq=Object.defineProperty,hY=Object.defineProperties,hZ=Object.getOwnPropertyDescriptors,h$=Object.getOwnPropertySymbols,hK=Object.prototype.hasOwnProperty,hJ=Object.prototype.propertyIsEnumerable,hQ=(e,t,n)=>t in e?hq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h0=(e,t)=>{for(var n in t||(t={}
268))hK.call(t,n)&&hQ(e,n,t[n]);if(h$)for(var n of h$(t))hJ.call(t,n)&&hQ(e,n,t[n]);return e},h1=(e,t)=>hY(e,hZ(t));let h2=e=>{let t=Object.entries(Mr.routes.levelRoutePoints).find(([t,n])=>{let[r,i]=n;return r<=e&&e<r+i});return t?parseInt(t[0],10):null};var h3=Object.defineProperty,h5=Object.getOwnPropertySymbols,h4=Object.prototype.hasOwnProperty,h6=Object.prototype.propertyIsEnumerable,h8=(e,t,n)=>t in e?h3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h7=(e,t)=>{for(var n in t||(t={}))h4.call(t,n)&&h8(e,n,t[n]);if(h5)for(var n of h5(t))h6.call(t,n)&&h8(e,n,t[n]);return e};let h9=(e,t,n={})=>{let{debug:r=!1,avoidStairs:i=!1,extraTimeOptions:a=[],routeRules:o}=n,s=((e,t,n,r)=>{let i=[];for(let a of(i.push(hH(e,t,n,r)),!n&&(null==r?void 0:r.some(({type:e})=>"excludeElevatorsByDefault"===e))&&i.push(hH(e,t,n,r.filter(e=>"excludeElevatorsByDefault"!==e.type))),i))try{return hV(e,t,n,a)}catch(e){if(i.indexOf(a)===i.length-1)throw e}})(e,t,i,o),l=function(e){if(!e)return null;let{routePoints:t,levelRoutePoints:n}=Mr.routes,r=Object.entries(n).map(([e,[t,n]])=>({ordinal:parseInt(e),start:t,end:t+n}));return e.map(e=>{let[n,i]=t[e],{ordinal:a}=r.find(({start:t,end:n})=>t<=e&&e<n);return{lat:n,lng:i,ordinal:a,point:parseInt(e)}})}(s),u=hI(s),c=((e,t,n)=>{var r,i,a,o,s,l;let{units:u,occupants:c,levels:h}=Mr,d=c.filter(e=>e.isPoint),p=new RegExp(/^(escalator|elevator|stairs|shuttle|the walkway|transition)/i),f=[...d,...u.values()].filter(e=>e.category&&(p.test(e.category)||p.test(e.category.name))).filter(e=>null!==e.routePoints),m=e=>{let t=f.find(t=>t.routePoints&&t.routePoints.includes(Number(e)));return t||console.warn(`The route point ${e||""} was not found in the Units or Points geo data`),t},g=e.reduce((t,r,i)=>{var a;let o=hX(r),s=i>0?e[i-1]:null,l=s?hX(s):o;if(o===l)return t;let u=m(r);if(!u)return t;let c=m(s)||{},{levelId:d,id:p,name:f,category:g}=c,{levelId:v}=u,y=h.get(v),b=null!=(a=null==y?void 0:y.name)?a:"",x=f||(null==g?void 0:g.name)||g||"";return n&&console.log(s,r,c,u),[...t,{routePoint:r,level:d,targetLevel:v,targetLevelName:b,targetName:x,targetId:p,isTransitionPoint:!0,transition:[c,u]}]},[]),v=e[e.length-1],y=null!=(i=null==(r=t.occupant)?void 0:r.levelId)?i:null,b=null!=(s=null==(o=null==(a=t.occupant)?void 0:a.display)?void 0:o.name)?s:"";return[...g,{routePoint:v,level:y,targetLevel:y,targetName:b,targetId:null==(l=t.occupant)?void 0:l.id,isTransitionPoint:!1}]})(s,t,r),h=((e,t,n,r=!1)=>{let i=((e,t)=>t.map((n,r)=>{let i=r===t.length-1,a=0===r?0:e.indexOf(t[r-1].routePoint),o=i?e.length:e.indexOf(n.routePoint);return e.slice(a,o)}))(e,t),a=[];if(n){let e=n.reduce((e,t)=>(t.routes&&t.routes.forEach(t=>{e.push(t.start),e.push(t.end)}),e),[]);a=Mr.occupants.filter(t=>e.includes(t.id)).map(e=>e.routePoints[0].toString())}let o=t.map((e,t)=>{let n=i[t],{result:r}=n.reduce((e,t,r)=>{let{state:i,coordinates:o,result:s}=e,l=Mr.routes.routePoints[Number(t)],u=a.includes(t);if(n.length===r+1)return h1(h0({},e),{result:[...s,{type:i,coordinates:[...o,l]}]});switch(i){case"init":return h1(h0({},e),{state:u?"extraTime":"regular",coordinates:[l]});case"regular":if(u)return{state:"extraTime",coordinates:[l],result:[...s,{type:"regular",coordinates:[...o,l]}]};return h1(h0({},e),{coordinates:[...o,l]});case"extraTime":if(u)return{state:"regular",coordinates:[l],result:[...s,{type:"extraTime",coordinates:[...o,l]}]};return h1(h0({},e),{coordinates:[...o,l]});default:return e}},{state:"init",coordinates:[],result:[]});return{ordinal:h2(i[t][0]),points:r}});return r&&(console.log(e.map(e=>({point:e,ordinal:h2(e)}))),console.log(t)),o})(s,c,a,r);if("__your-location__"===e.occupantId&&h[0].points[0].coordinates[0][0]!==e.latLng.lat&&h[0].points[0].coordinates[0][1]!==e.latLng.lng){let t=h[0].points[0].coordinates,n=[e.latLng.lat,e.latLng.lng];t.unshift(n)}return h.forEach((e,t)=>{c[t]=h7(h7({},c[t]),e)}),{path:s,coordinates:l,length:u,steps:c}},de=(e,t={})=>{let n=[];for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1];if(i.occupantId===a.occupantId)continue;let o=h9(i,a,t);n.push(o)}let r=n.reduce((e,n,r)=>{var i;
268return(n.steps.forEach(e=>{e.routeIdx=r}),0===r)?e:{length:e.length+n.length,path:[...e.path,...n.path.slice(1)],coordinates:[...e.coordinates,...n.coordinates.slice(1)],steps:[...e.steps,...n.steps],startStepIdx:null!=(i=t.startStepIdx)?i:0}},n[0]);return r.id=e.reduce((e,t)=>e+"__"+t.occupantId,"")+"__"+t.avoidStairs,r},dt=2*Math.PI*6378137/2;function dn([e,t]){let n=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return n=n*dt/180,[t*dt/180,-n]}function dr(e,t){let[n,r]=dn(e),[i,a]=dn(t),o=Math.abs(i-n),s=Math.abs(a-r);return Math.round(10*Math.sqrt(o*o+s*s))/10}function di(e,t){let n=Math.min(e[0],t[0]),r=Math.min(e[1],t[1]);return[n+Math.abs(t[0]-e[0])/2,r+Math.abs(t[1]-e[1])/2]}var da="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ds="object"==typeof self&&self&&self.Object===Object&&self,dl=da||ds||Function("return this")(),du=dl.Symbol,dc=Object.prototype,dh=dc.hasOwnProperty,dd=dc.toString,dp=du?du.toStringTag:void 0,df=Object.prototype.toString,dm=du?du.toStringTag:void 0;function dg(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":dm&&dm in Object(e)?function(e){var t=dh.call(e,dp),n=e[dp];try{e[dp]=void 0;var r=!0}catch(e){}var i=dd.call(e);return r&&(t?e[dp]=n:delete e[dp]),i}(e):df.call(e)}function dv(e){return null!=e&&"object"==typeof e}function dy(e){return"symbol"==typeof e||dv(e)&&"[object Symbol]"==dg(e)}var db=0/0;function dx(e){return"number"==typeof e?e:dy(e)?db:+e}function d_(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var dw=Array.isArray,dM=1/0,dE=du?du.prototype:void 0,dS=dE?dE.toString:void 0;function dT(e){if("string"==typeof e)return e;if(dw(e))return d_(e,dT)+"";if(dy(e))return dS?dS.call(e):"";var t=e+"";return"0"==t&&1/e==-dM?"-0":t}function dA(e,t){return function(n,r){var i;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=dT(n),r=dT(r)):(n=dx(n),r=dx(r)),i=e(n,r)}return i}}var dC=dA(function(e,t){return e+t},0),dR=/\s/;function dP(e){for(var t=e.length;t--&&dR.test(e.charAt(t)););return t}var dI=/^\s+/;function dO(e){return e?e.slice(0,dP(e)+1).replace(dI,""):e}function dL(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var dD=0/0,dN=/^[-+]0x[0-9a-f]+$/i,dU=/^0b[01]+$/i,dk=/^0o[0-7]+$/i,dB=parseInt;function dF(e){if("number"==typeof e)return e;if(dy(e))return dD;if(dL(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=dL(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=dO(e);var n=dU.test(e);return n||dk.test(e)?dB(e.slice(2),n?2:8):dN.test(e)?dD:+e}var dz=1/0;function dH(e){return e?(e=dF(e))===dz||e===-dz?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}function dj(e){var t=dH(e),n=t%1;return t==t?n?t-n:t:0}function dW(e){return e}function dG(e){if(!dL(e))return!1;var t=dg(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var dV=dl["__core-js_shared__"],dX=function(){var e=/[^.]+$/.exec(dV&&dV.keys&&dV.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),dq=Function.prototype.toString;function dY(e){if(null!=e){try{return dq.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var dZ=/^\[object .+?Constructor\]$/,d$=Object.prototype,dK=Function.prototype.toString,dJ=d$.hasOwnProperty,dQ=RegExp("^"+dK.call(dJ).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d0(e){return!!dL(e)&&(!dX||!(dX in e))&&(dG(e)?dQ:dZ).test(dY(e))}function d1(e,t){var n=null==e?void 0:e[t];return d0(n)?n:void 0}var d2=d1(dl,"WeakMap"),d3=d2&&new d2,d5=d3?function(e,t){return d3.set(e,t),e}:dW,d4=Object.create,d6=function(){function e(){}return function(t){if(!dL(t))return{};if(d4)return d4(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function d8(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=d6(e.prototype),r=e.apply(n,t);return dL(r)?r:n}}function d7(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var d9=Math.max;function pe(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,l=t.length,u=d9(a-o,0),c=Array(l+u),h=!r;++s<l;)c[s]=t[s];for(;++i<o;)(h||i<a)&&(c[n[i]]=e[i]);for(;u--;)c[s++]=e[i++];return c}
268var pt=Math.max;function pn(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,l=-1,u=t.length,c=pt(a-s,0),h=Array(c+u),d=!r;++i<c;)h[i]=e[i];for(var p=i;++l<u;)h[p+l]=t[l];for(;++o<s;)(d||i<a)&&(h[p+n[o]]=e[i++]);return h}function pr(){}function pi(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=0xffffffff,this.__views__=[]}function pa(){}pi.prototype=d6(pr.prototype),pi.prototype.constructor=pi;var po=d3?function(e){return d3.get(e)}:pa,ps={},pl=Object.prototype.hasOwnProperty;function pu(e){for(var t=e.name+"",n=ps[t],r=pl.call(ps,t)?n.length:0;r--;){var i=n[r],a=i.func;if(null==a||a==e)return i.name}return t}function pc(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function ph(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function pd(e){if(e instanceof pi)return e.clone();var t=new pc(e.__wrapped__,e.__chain__);return t.__actions__=ph(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}pc.prototype=d6(pr.prototype),pc.prototype.constructor=pc;var pp=Object.prototype.hasOwnProperty;function pf(e){if(dv(e)&&!dw(e)&&!(e instanceof pi)){if(e instanceof pc)return e;if(pp.call(e,"__wrapped__"))return pd(e)}return new pc(e)}function pm(e){var t=pu(e),n=pf[t];if("function"!=typeof n||!(t in pi.prototype))return!1;if(e===n)return!0;var r=po(n);return!!r&&e===r[0]}pf.prototype=pr.prototype,pf.prototype.constructor=pf;var pg=Date.now;function pv(e){var t=0,n=0;return function(){var r=pg(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var py=pv(d5),pb=/\{\n\/\* \[wrapped with (.+)\] \*/,px=/,? & /,p_=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function pw(e){return function(){return e}}var pM=function(){try{var e=d1(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),pE=pv(pM?function(e,t){return pM(e,"toString",{configurable:!0,enumerable:!1,value:pw(t),writable:!0})}:dW);function pS(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function pT(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return -1}function pA(e){return e!=e}function pC(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1}(e,t,n):pT(e,pA,n)}function pR(e,t){return!!(null==e?0:e.length)&&pC(e,t,0)>-1}var pP=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function pI(e,t,n){var r,i,a=t+"";return pE(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(p_,"{\n/* [wrapped with "+t+"] */\n")}(a,(i=(r=a.match(pb))?r[1].split(px):[],pS(pP,function(e){var t="_."+e[0];n&e[1]&&!pR(i,t)&&i.push(t)}),i.sort())))}function pO(e,t,n,r,i,a,o,s,l,u){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var h=[e,t,i,c?a:void 0,c?o:void 0,c?void 0:a,c?void 0:o,s,l,u],d=n.apply(void 0,h);return pm(e)&&py(d,h),d.placeholder=r,pI(d,e,t)}function pL(e){return e.placeholder}var pD=/^(?:0|[1-9]\d*)$/;function pN(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&pD.test(e))&&e>-1&&e%1==0&&e<t}var pU=Math.min,pk="__lodash_placeholder__";function pB(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n];(o===t||o===pk)&&(e[n]=pk,a[i++]=n)}return a}function pF(e,t,n,r,i,a,o,s,l,u){var c=128&t,h=1&t,d=2&t,p=24&t,f=512&t,m=d?void 0:d8(e);function g(){for(var v=arguments.length,y=Array(v),b=v;b--;)y[b]=arguments[b];if(p)var x=pL(g),_=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(y,x);if(r&&(y=pe(y,r,i,p)),a&&(y=pn(y,a,o,p)),v-=_,p&&v<u){var w=pB(y,x);return pO(e,t,pF,g.placeholder,n,y,w,s,l,u-v)}var M=h?n:this,E=d?M[e]:e;return v=y.length,s?y=function(e,t){for(var n=e.length,r=pU(t.length,n),i=ph(e);r--;){var a=t[r];e[r]=pN(a,n)?i[a]:void 0}return e}(y,s):f&&v>1&&y.reverse(),c&&l<v&&(y.length=l),this&&this!==dl&&this instanceof g&&(E=m||d8(E)),E.apply(M,y)}return g}var pz="__lodash_placeholder__",pH=Math.min,pj=Math.max;function pW(e,t,n,r,i,a,o,s){var l=2&t;if(!l&&"function"!=typeof e)throw TypeError("Expected a function");var u=r?r.length:0;if(u||(t&=-97,r=i=void 0),o=void 0===o?o:pj(dj(o),0),s=void 0===s?s:dj(s),u-=i?i.length:0,64&t){var c=r,h=i;r=i=void 0}var d=l?void 0:po(e),p=[e,t,n,r,i,c,h,a,o,s];if(d&&function(e,t){var n=e[1],r=t[1],i=n|r,a=i<131,o=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;
268if(a||o){1&r&&(e[2]=t[2],i|=1&n?0:4);var s=t[3];if(s){var l=e[3];e[3]=l?pe(l,s,t[4]):s,e[4]=l?pB(e[3],pz):t[4]}(s=t[5])&&(l=e[5],e[5]=l?pn(l,s,t[6]):s,e[6]=l?pB(e[5],pz):t[6]),(s=t[7])&&(e[7]=s),128&r&&(e[8]=null==e[8]?t[8]:pH(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}}(p,d),e=p[0],t=p[1],n=p[2],r=p[3],i=p[4],(s=p[9]=void 0===p[9]?l?0:e.length:pj(p[9]-u,0))||!(24&t)||(t&=-25),t&&1!=t)8==t||16==t?S=function(e,t,n){var r=d8(e);function i(){for(var a=arguments.length,o=Array(a),s=a,l=pL(i);s--;)o[s]=arguments[s];var u=a<3&&o[0]!==l&&o[a-1]!==l?[]:pB(o,l);return(a-=u.length)<n?pO(e,t,pF,i.placeholder,void 0,o,u,void 0,void 0,n-a):d7(this&&this!==dl&&this instanceof i?r:e,this,o)}return i}(e,t,s):32!=t&&33!=t||i.length?S=pF.apply(void 0,p):(f=e,m=t,g=n,v=r,y=1&m,b=d8(f),S=function e(){for(var t=-1,n=arguments.length,r=-1,i=v.length,a=Array(i+n),o=this&&this!==dl&&this instanceof e?b:f;++r<i;)a[r]=v[r];for(;n--;)a[r++]=arguments[++t];return d7(o,y?g:this,a)});else var f,m,g,v,y,b,x,_,w,M,E,S=(x=e,_=t,w=n,M=1&_,E=d8(x),function e(){return(this&&this!==dl&&this instanceof e?E:x).apply(M?w:this,arguments)});return pI((d?d5:py)(S,p),e,t)}function pG(e,t,n){return t=n?void 0:t,t=e&&null==t?e.length:t,pW(e,128,void 0,void 0,void 0,void 0,t)}function pV(e,t,n){"__proto__"==t&&pM?pM(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function pX(e,t){return e===t||e!=e&&t!=t}var pq=Object.prototype.hasOwnProperty;function pY(e,t,n){var r=e[t];pq.call(e,t)&&pX(r,n)&&(void 0!==n||t in e)||pV(e,t,n)}function pZ(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),i?pV(n,s,l):pY(n,s,l)}return n}var p$=Math.max;function pK(e,t,n){return t=p$(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=p$(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),d7(e,this,s)}}function pJ(e,t){return pE(pK(e,t,dW),e+"")}function pQ(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function p0(e){return null!=e&&pQ(e.length)&&!dG(e)}function p1(e,t,n){if(!dL(n))return!1;var r=typeof t;return("number"==r?!!(p0(n)&&pN(t,n.length)):"string"==r&&t in n)&&pX(n[t],e)}function p2(e){return pJ(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&p1(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var p3=Object.prototype;function p5(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||p3)}function p4(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function p6(e){return dv(e)&&"[object Arguments]"==dg(e)}var p8=Object.prototype,p7=p8.hasOwnProperty,p9=p8.propertyIsEnumerable,fe=p6(function(){return arguments}())?p6:function(e){return dv(e)&&p7.call(e,"callee")&&!p9.call(e,"callee")};function ft(){return!1}var fn="object"==typeof exports&&exports&&!exports.nodeType&&exports,fr=fn&&e&&!e.nodeType&&e,fi=fr&&fr.exports===fn?dl.Buffer:void 0,fa=(fi?fi.isBuffer:void 0)||ft,fo={};function fs(e){return function(t){return e(t)}}fo["[object Float32Array]"]=fo["[object Float64Array]"]=fo["[object Int8Array]"]=fo["[object Int16Array]"]=fo["[object Int32Array]"]=fo["[object Uint8Array]"]=fo["[object Uint8ClampedArray]"]=fo["[object Uint16Array]"]=fo["[object Uint32Array]"]=!0,fo["[object Arguments]"]=fo["[object Array]"]=fo["[object ArrayBuffer]"]=fo["[object Boolean]"]=fo["[object DataView]"]=fo["[object Date]"]=fo["[object Error]"]=fo["[object Function]"]=fo["[object Map]"]=fo["[object Number]"]=fo["[object Object]"]=fo["[object RegExp]"]=fo["[object Set]"]=fo["[object String]"]=fo["[object WeakMap]"]=!1;var fl="object"==typeof exports&&exports&&!exports.nodeType&&exports,fu=fl&&e&&!e.nodeType&&e,fc=fu&&fu.exports===fl&&da.process,fh=function(){try{var e=fu&&fu.require&&fu.require("util").types;if(e)return e;return fc&&fc.binding&&fc.binding("util")}catch(e){}}(),fd=fh&&fh.isTypedArray,fp=fd?fs(fd):function(e){return dv(e)&&pQ(e.length)&&!!fo[dg(e)]},ff=Object.prototype.hasOwnProperty;function fm(e,t){var n=dw(e),r=!n&&fe(e),i=!n&&!r&&fa(e),a=!n&&!r&&!i&&fp(e),o=n||r||i||a,s=o?p4(e.length,String):[],l=s.length;for(var u in e)(t||ff.call(e,u))&&!(o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||pN(u,l)))&&s.push(u);return s}function fg(e,t){return function(n){return e(t(n))}}var fv=fg(Object.keys,Object),fy=Object.prototype.hasOwnProperty;function fb(e){if(!p5(e))return fv(e);var t=[];for(var n in Object(e))fy.call(e,n)&&"constructor"!=n&&t.push(n);return t}function fx(e){return p0(e)?fm(e):fb(e)}var f_=Object.prototype.hasOwnProperty,fw=p2(function(e,t){if(p5(t)||p0(t))return void pZ(t,fx(t),e);for(var n in t)f_.call(t,n)&&pY(e,n,t[n])}),fM=Object.prototype.hasOwnProperty;function fE(e){return p0(e)?fm(e,!0):function(e){if(!dL(e)){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}var r=p5(e),i=[];for(var a in e)"constructor"==a&&(r||!fM.call(e,a))||i.push(a);return i}(e)}var fS=p2(function(e,t){pZ(t,fE(t),e)}),fT=p2(function(e,t,n,r){pZ(t,fE(t),e,r)}),fA=p2(function(e,t,n,r){pZ(t,fx(t),e,r)}),fC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fR=/^\w*$/;function fP(e,t){if(dw(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||dy(e))||fR.test(e)||!fC.test(e)||null!=t&&e in Object(t)}var fI=d1(Object,"create"),fO=Object.prototype.hasOwnProperty,fL=Object.prototype.hasOwnProperty;function fD(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function fN(e,t){for(var n=e.length;n--;)if(pX(e[n][0],t))return n;return -1}fD.prototype.clear=function(){this.__data__=fI?fI(null):{},this.size=0},fD.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},fD.prototype.get=function(e){var t=this.__data__;if(fI){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return fO.call(t,e)?t[e]:void 0},fD.prototype.has=function(e){var t=this.__data__;return fI?void 0!==t[e]:fL.call(t,e)},fD.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=fI&&void 0===t?"__lodash_hash_undefined__":t,this};var fU=Array.prototype.splice;function fk(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}fk.prototype.clear=function(){this.__data__=[],this.size=0},fk.prototype.delete=function(e){var t=this.__data__,n=fN(t,e);return!(n<0)&&(n==t.length-1?t.pop():fU.call(t,n,1),--this.size,!0)},fk.prototype.get=function(e){var t=this.__data__,n=fN(t,e);return n<0?void 0:t[n][1]},fk.prototype.has=function(e){return fN(this.__data__,e)>-1},fk.prototype.set=function(e,t){var n=this.__data__,r=fN(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var fB=d1(dl,"Map");function fF(e,t){var n,r=e.__data__;return("string"==(n=typeof t)||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t)?r["
268string"==typeof t?"string":"hash"]:r.map}function fz(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function fH(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(fH.Cache||fz),n}fz.prototype.clear=function(){this.size=0,this.__data__={hash:new fD,map:new(fB||fk),string:new fD}},fz.prototype.delete=function(e){var t=fF(this,e).delete(e);return this.size-=!!t,t},fz.prototype.get=function(e){return fF(this,e).get(e)},fz.prototype.has=function(e){return fF(this,e).has(e)},fz.prototype.set=function(e,t){var n=fF(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},fH.Cache=fz;var fj=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fW=/\\(\\)?/g,fG=function(e){var t=fH(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(fj,function(e,n,r,i){t.push(r?i.replace(fW,"$1"):n||e)}),t});function fV(e){return null==e?"":dT(e)}function fX(e,t){return dw(e)?e:fP(e,t)?[e]:fG(fV(e))}var fq=1/0;function fY(e){if("string"==typeof e||dy(e))return e;var t=e+"";return"0"==t&&1/e==-fq?"-0":t}function fZ(e,t){t=fX(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[fY(t[n++])];return n&&n==r?e:void 0}function f$(e,t,n){var r=null==e?void 0:fZ(e,t);return void 0===r?n:r}function fK(e,t){for(var n=-1,r=t.length,i=Array(r),a=null==e;++n<r;)i[n]=a?void 0:f$(e,t[n]);return i}function fJ(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var fQ=du?du.isConcatSpreadable:void 0;function f0(e){return dw(e)||fe(e)||!!(fQ&&e&&e[fQ])}function f1(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=f0),i||(i=[]);++a<o;){var s=e[a];t>0&&n(s)?t>1?f1(s,t-1,n,r,i):fJ(i,s):r||(i[i.length]=s)}return i}function f2(e){return(null==e?0:e.length)?f1(e,1):[]}function f3(e){return pE(pK(e,void 0,f2),e+"")}var f5=f3(fK),f4=fg(Object.getPrototypeOf,Object),f6=Object.prototype,f8=Function.prototype.toString,f7=f6.hasOwnProperty,f9=f8.call(Object);function me(e){if(!dv(e)||"[object Object]"!=dg(e))return!1;var t=f4(e);if(null===t)return!0;var n=f7.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&f8.call(n)==f9}function mt(e){if(!dv(e))return!1;var t=dg(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!me(e)}var mn=pJ(function(e,t){try{return d7(e,void 0,t)}catch(e){return mt(e)?e:Error(e)}});function mr(e,t){var n;if("function"!=typeof t)throw TypeError("Expected a function");return e=dj(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var mi=pJ(function(e,t,n){var r=1;if(n.length){var i=pB(n,pL(mi));r|=32}return pW(e,r,t,n,i)});mi.placeholder={};var ma=f3(function(e,t){return pS(t,function(t){pV(e,t=fY(t),mi(e[t],e))}),e}),mo=pJ(function(e,t,n){var r=3;if(n.length){var i=pB(n,pL(mo));r|=32}return pW(t,r,e,n,i)});function ms(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function ml(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:ms(e,t,n)}mo.placeholder={};var mu=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function mc(e){return mu.test(e)}var mh="\ud800-\udfff",md="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",mp="\ud83c[\udffb-\udfff]",mf="[^"+mh+"]",mm="(?:\ud83c[\udde6-\uddff]){2}",mg="[\ud800-\udbff][\udc00-\udfff]",mv="(?:"+md+"|"+mp+")?",my="[\\ufe0e\\ufe0f]?",mb="(?:\\u200d(?:"+[mf,mm,mg].join("|")+")"+my+mv+")*",mx=RegExp(mp+"(?="+mp+")|"+("(?:"+[mf+md+"?",md,mm,mg,"["+mh+"]"].join("|"))+")"+(my+mv+mb),"g");function m_(e){return mc(e)?e.match(mx)||[]:e.split("")}function mw(e){return function(t){var n=mc(t=fV(t))?m_(t):void 0,r=n?n[0]:t.charAt(0),i=n?ml(n,1).join(""):t.slice(1);return r[e]()+i}}var mM=mw("toUpperCase");function mE(e){return mM(fV(e).toLowerCase())}function mS(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function mT(e){return function(t){return null==e?void 0:e[t]}}var mA=mT({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}
268),mC=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mR=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function mP(e){return(e=fV(e))&&e.replace(mC,mA).replace(mR,"")}var mI=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,mO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,mL="\ud800-\udfff",mD="\\u2700-\\u27bf",mN="a-z\\xdf-\\xf6\\xf8-\\xff",mU="A-Z\\xc0-\\xd6\\xd8-\\xde",mk="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mB="['’]",mF="["+mk+"]",mz="["+mN+"]",mH="[^"+mL+mk+"\\d+"+mD+mN+mU+"]",mj="(?:\ud83c[\udde6-\uddff]){2}",mW="[\ud800-\udbff][\udc00-\udfff]",mG="["+mU+"]",mV="(?:"+mz+"|"+mH+")",mX="(?:"+mG+"|"+mH+")",mq="(?:"+mB+"(?:d|ll|m|re|s|t|ve))?",mY="(?:"+mB+"(?:D|LL|M|RE|S|T|VE))?",mZ="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\ud83c[\udffb-\udfff])?",m$="[\\ufe0e\\ufe0f]?",mK="(?:\\u200d(?:"+["[^"+mL+"]",mj,mW].join("|")+")"+m$+mZ+")*",mJ="(?:"+["["+mD+"]",mj,mW].join("|")+")"+(m$+mZ+mK),mQ=RegExp([mG+"?"+mz+"+"+mq+"(?="+[mF,mG,"$"].join("|")+")",mX+"+"+mY+"(?="+[mF,mG+mV,"$"].join("|")+")",mG+"?"+mV+"+"+mq,mG+"+"+mY,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",mJ].join("|"),"g");function m0(e,t,n){if(e=fV(e),void 0===(t=n?void 0:t)){var r;return(r=e,mO.test(r))?e.match(mQ)||[]:e.match(mI)||[]}return e.match(t)||[]}var m1=RegExp("['’]","g");function m2(e){return function(t){return mS(m0(mP(t).replace(m1,"")),e,"")}}var m3=m2(function(e,t,n){return t=t.toLowerCase(),e+(n?mE(t):t)}),m5=dl.isFinite,m4=Math.min;function m6(e){var t=Math[e];return function(e,n){if(e=dF(e),(n=null==n?0:m4(dj(n),292))&&m5(e)){var r=(fV(e)+"e").split("e");return+((r=(fV(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(r[1]-n))}return t(e)}}var m8=m6("ceil");function m7(e){var t=pf(e);return t.__chain__=!0,t}var m9=Math.ceil,ge=Math.max;function gt(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function gn(e){var t=this.__data__=new fk(e);this.size=t.size}function gr(e,t){return e&&pZ(t,fx(t),e)}gn.prototype.clear=function(){this.__data__=new fk,this.size=0},gn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},gn.prototype.get=function(e){return this.__data__.get(e)},gn.prototype.has=function(e){return this.__data__.has(e)},gn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof fk){var r=n.__data__;if(!fB||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new fz(r)}return n.set(e,t),this.size=n.size,this};var gi="object"==typeof exports&&exports&&!exports.nodeType&&exports,ga=gi&&e&&!e.nodeType&&e,go=ga&&ga.exports===gi?dl.Buffer:void 0,gs=go?go.allocUnsafe:void 0;function gl(e,t){if(t)return e.slice();var n=e.length,r=gs?gs(n):new e.constructor(n);return e.copy(r),r}function gu(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function gc(){return[]}var gh=Object.prototype.propertyIsEnumerable,gd=Object.getOwnPropertySymbols,gp=gd?function(e){return null==e?[]:gu(gd(e=Object(e)),function(t){return gh.call(e,t)})}:gc,gf=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)fJ(t,gp(e)),e=f4(e);return t}:gc;function gm(e,t,n){var r=t(e);return dw(e)?r:fJ(r,n(e))}function gg(e){return gm(e,fx,gp)}function gv(e){return gm(e,fE,gf)}var gy=d1(dl,"DataView"),gb=d1(dl,"Promise"),gx=d1(dl,"Set"),g_="[object Map]",gw="[object Promise]",gM="[object Set]",gE="[object WeakMap]",gS="[object DataView]",gT=dY(gy),gA=dY(fB),gC=dY(gb),gR=dY(gx),gP=dY(d2),gI=dg;(gy&&gI(new gy(new ArrayBuffer(1)))!=gS||fB&&gI(new fB)!=g_||gb&&gI(gb.resolve())!=gw||gx&&gI(new gx)!=gM||d2&&gI(new d2)!=gE)&&(gI=function(e){var t=dg(e),n="[object Object]"==t?e.constructor:void 0,r=n?dY(n):"";if(r)switch(r){case gT:return gS;case gA:return g_;case gC:return gw;case gR:return gM;case gP:return gE}return t});var gO=gI,gL=Object.prototype.hasOwnProperty,gD=dl.Uint8Array;function gN(e){var t=new e.constructor(e.byteLength);return new gD(t).set(new gD(e)),t}
268var gU=/\w*$/,gk=du?du.prototype:void 0,gB=gk?gk.valueOf:void 0;function gF(e,t){var n=t?gN(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function gz(e){return"function"!=typeof e.constructor||p5(e)?{}:d6(f4(e))}var gH=fh&&fh.isMap,gj=gH?fs(gH):function(e){return dv(e)&&"[object Map]"==gO(e)},gW=fh&&fh.isSet,gG=gW?fs(gW):function(e){return dv(e)&&"[object Set]"==gO(e)},gV="[object Arguments]",gX="[object Function]",gq="[object Object]",gY={};function gZ(e,t,n,r,i,a){var o,s=1&t,l=2&t,u=4&t;if(n&&(o=i?n(e,r,i,a):n(e)),void 0!==o)return o;if(!dL(e))return e;var c=dw(e);if(c){if(h=e.length,d=new e.constructor(h),h&&"string"==typeof e[0]&&gL.call(e,"index")&&(d.index=e.index,d.input=e.input),o=d,!s)return ph(e,o)}else{var h,d,p,f,m,g=gO(e),v=g==gX||"[object GeneratorFunction]"==g;if(fa(e))return gl(e,s);if(g==gq||g==gV||v&&!i){if(o=l||v?{}:gz(e),!s)return l?(f=(p=o)&&pZ(e,fE(e),p),pZ(e,gf(e),f)):(m=gr(o,e),pZ(e,gp(e),m))}else{if(!gY[g])return i?e:{};o=function(e,t,n){var r,i,a=e.constructor;switch(t){case"[object ArrayBuffer]":return gN(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return r=n?gN(e.buffer):e.buffer,new e.constructor(r,e.byteOffset,e.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return gF(e,n);case"[object Map]":case"[object Set]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return(i=new e.constructor(e.source,gU.exec(e))).lastIndex=e.lastIndex,i;case"[object Symbol]":return gB?Object(gB.call(e)):{}}}(e,g,s)}}a||(a=new gn);var y=a.get(e);if(y)return y;a.set(e,o),gG(e)?e.forEach(function(r){o.add(gZ(r,t,n,r,e,a))}):gj(e)&&e.forEach(function(r,i){o.set(i,gZ(r,t,n,i,e,a))});var b=u?l?gv:gg:l?fE:fx,x=c?void 0:b(e);return pS(x||e,function(r,i){x&&(r=e[i=r]),pY(o,i,gZ(r,t,n,i,e,a))}),o}function g$(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new fz;++t<n;)this.add(e[t])}function gK(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function gJ(e,t){return e.has(t)}function gQ(e,t,n,r,i,a){var o=1&n,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var h=-1,d=!0,p=2&n?new g$:void 0;for(a.set(e,t),a.set(t,e);++h<s;){var f=e[h],m=t[h];if(r)var g=o?r(m,f,h,t,e,a):r(f,m,h,e,t,a);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!gK(t,function(e,t){if(!gJ(p,t)&&(f===e||i(f,e,n,r,a)))return p.push(t)})){d=!1;break}}else if(!(f===m||i(f,m,n,r,a))){d=!1;break}}return a.delete(e),a.delete(t),d}function g0(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function g1(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}gY[gV]=gY["[object Array]"]=gY["[object ArrayBuffer]"]=gY["[object DataView]"]=gY["[object Boolean]"]=gY["[object Date]"]=gY["[object Float32Array]"]=gY["[object Float64Array]"]=gY["[object Int8Array]"]=gY["[object Int16Array]"]=gY["[object Int32Array]"]=gY["[object Map]"]=gY["[object Number]"]=gY[gq]=gY["[object RegExp]"]=gY["[object Set]"]=gY["[object String]"]=gY["[object Symbol]"]=gY["[object Uint8Array]"]=gY["[object Uint8ClampedArray]"]=gY["[object Uint16Array]"]=gY["[object Uint32Array]"]=!0,gY["[object Error]"]=gY[gX]=gY["[object WeakMap]"]=!1,g$.prototype.add=g$.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},g$.prototype.has=function(e){return this.__data__.has(e)};var g2=du?du.prototype:void 0,g3=g2?g2.valueOf:void 0,g5=Object.prototype.hasOwnProperty,g4="[object Arguments]",g6="[object Array]",g8="[object Object]",g7=Object.prototype.hasOwnProperty;function g9(e,t,n,r,i){return e===t||(null!=e&&null!=t&&(dv(e)||dv(t))?function(e,t,n,r,i,a){var o=dw(e),s=dw(t),l=o?g6:gO(e),u=s?g6:gO(t);l=l==g4?g8:l,u=u==g4?g8:u;var c=l==g8,h=u==g8,d=l==u;if(d&&fa(e)){if(!fa(t))return!1;o=!0,c=!1}if(d&&!c)return a||(a=new gn),o||fp(e)?gQ(e,t,n,r,i,a):function(e,t,n,r,i,a,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!a(new gD(e),new gD(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return pX(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=g0;case"[object Set]":var l=1&r;if(s||(s=g1),e.size!=t.size&&!l)break;var u=o.get(e);if(u)return u==t;r|=2,o.set(e,t);var c=gQ(s(e),s(t),r,i,a,o);return o.delete(e),c;case"[object Symbol]":if(g3)return g3.call(e)==g3.call(t)}return!1}(e,t,l,n,r,i,a);if(!(1&n)){var p=c&&g7.call(e,"__wrapped__"),f=h&&g7.call(t,"__wrapped__");
268if(p||f){var m=p?e.value():e,g=f?t.value():t;return a||(a=new gn),i(m,g,n,r,a)}}return!!d&&(a||(a=new gn),function(e,t,n,r,i,a){var o=1&n,s=gg(e),l=s.length;if(l!=gg(t).length&&!o)return!1;for(var u=l;u--;){var c=s[u];if(!(o?c in t:g5.call(t,c)))return!1}var h=a.get(e),d=a.get(t);if(h&&d)return h==t&&d==e;var p=!0;a.set(e,t),a.set(t,e);for(var f=o;++u<l;){var m=e[c=s[u]],g=t[c];if(r)var v=o?r(g,m,c,t,e,a):r(m,g,c,e,t,a);if(!(void 0===v?m===g||i(m,g,n,r,a):v)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var y=e.constructor,b=t.constructor;y!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(p=!1)}return a.delete(e),a.delete(t),p}(e,t,n,r,i,a))}(e,t,n,r,g9,i):e!=e&&t!=t)}function ve(e,t,n,r){var i=n.length,a=i,o=!r;if(null==e)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var l=(s=n[i])[0],u=e[l],c=s[1];if(o&&s[2]){if(void 0===u&&!(l in e))return!1}else{var h=new gn;if(r)var d=r(u,c,l,e,t,h);if(!(void 0===d?g9(c,u,3,r,h):d))return!1}}return!0}function vt(e){for(var t=fx(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,i==i&&!dL(i)]}return t}function vn(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}function vr(e){var t=vt(e);return 1==t.length&&t[0][2]?vn(t[0][0],t[0][1]):function(n){return n===e||ve(n,e,t)}}function vi(e,t){return null!=e&&t in Object(e)}function va(e,t,n){t=fX(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=fY(t[r]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&pQ(i)&&pN(o,i)&&(dw(e)||fe(e))}function vo(e,t){return null!=e&&va(e,t,vi)}function vs(e,t){var n;return fP(e)&&(n=t)==n&&!dL(n)?vn(fY(e),t):function(n){var r=f$(n,e);return void 0===r&&r===t?vo(n,e):g9(t,r,3)}}function vl(e){return function(t){return null==t?void 0:t[e]}}function vu(e){return fP(e)?vl(fY(e)):function(t){return fZ(t,e)}}function vc(e){return"function"==typeof e?e:null==e?dW:"object"==typeof e?dw(e)?vs(e[0],e[1]):vr(e):vu(e)}function vh(e,t,n){var r=n.length;if(null==e)return!r;for(e=Object(e);r--;){var i=n[r],a=t[i],o=e[i];if(void 0===o&&!(i in e)||!a(o))return!1}return!0}function vd(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function vp(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var l=o[e?s:++i];if(!1===n(a[l],l,a))break}return t}}var vf=vp();function vm(e,t){return e&&vf(e,t,fx)}function vg(e,t){return function(n,r){if(null==n)return n;if(!p0(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&!1!==r(o[a],a,o););return n}}var vv=vg(vm);function vy(e,t,n,r){return vv(e,function(e,i,a){t(r,e,n(e),a)}),r}function vb(e,t){return function(n,r){var i=dw(n)?vd:vy,a=t?t():{};return i(n,e,vc(r),a)}}var vx=Object.prototype.hasOwnProperty,v_=vb(function(e,t,n){vx.call(e,n)?++e[n]:pV(e,n,1)});function vw(e,t,n){var r=pW(e,8,void 0,void 0,void 0,void 0,void 0,t=n?void 0:t);return r.placeholder=vw.placeholder,r}function vM(e,t,n){var r=pW(e,16,void 0,void 0,void 0,void 0,void 0,t=n?void 0:t);return r.placeholder=vM.placeholder,r}vw.placeholder={},vM.placeholder={};var vE=function(){return dl.Date.now()},vS=Math.max,vT=Math.min;function vA(e,t,n){var r,i,a,o,s,l,u=0,c=!1,h=!1,d=!0;if("function"!=typeof e)throw TypeError("Expected a function");function p(t){var n=r,a=i;return r=i=void 0,u=t,o=e.apply(a,n)}function f(e){var n=e-l,r=e-u;return void 0===l||n>=t||n<0||h&&r>=a}function m(){var e,n,r,i=vE();if(f(i))return g(i);s=setTimeout(m,(e=i-l,n=i-u,r=t-e,h?vT(r,a-n):r))}function g(e){return(s=void 0,d&&r)?p(e):(r=i=void 0,o)}function v(){var e,n=vE(),a=f(n);if(r=arguments,i=this,l=n,a){if(void 0===s)return u=e=l,s=setTimeout(m,t),c?p(e):o;if(h)return clearTimeout(s),s=setTimeout(m,t),p(l)}return void 0===s&&(s=setTimeout(m,t)),o}return t=dF(t)||0,dL(n)&&(c=!!n.leading,a=(h="maxWait"in n)?vS(dF(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),v.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},v.flush=function(){return void 0===s?o:g(vE())},v}var vC=Object.prototype,vR=vC.hasOwnProperty,vP=pJ(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&p1(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=fE(a),s=-1,l=o.length;++s<l;){var u=o[s],c=e[u];(void 0===c||pX(c,vC[u])&&!vR.call(e,u))&&(e[u]=a[u])}return e});function vI(e,t,n){(void 0===n||pX(e[t],n))&&(void 0!==n||t in e)||pV(e,t,n)}function vO(e){return dv(e)&&p0(e)}function vL(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function vD(e){return pZ(e,fE(e))}function vN(e,t,n,r,i){e!==t&&vf(t,function(a,o){if(i||(i=new gn),dL(a))!function(e,t,n,r,i,a,o){var s=vL(e,n),l=vL(t,n),u=o.get(l);if(u)return vI(e,n,u);var c=a?a(s,l,n+"",e,t,o):void 0,h=void 0===c;if(h){var d=dw(l),p=!d&&fa(l),f=!d&&!p&&fp(l);c=l,d||p||f?dw(s)?c=s:vO(s)?c=ph(s):p?(h=!1,c=gl(l,!0)):f?(h=!1,c=gF(l,!0)):c=[]:me(l)||fe(l)?(c=s,fe(s)?c=vD(s):(!dL(s)||dG(s))&&(c=gz(l))):h=!1}h&&(o.set(l,c),i(c,l,r,a,o),o.delete(l)),vI(e,n,c)}(e,t,o,n,vN,r,i);else{var s=r?r(vL(e,o),a,o+"",e,t,i):void 0;void 0===s&&(s=a),vI(e,o,s)}},fE)}function vU(e,t,n,r,i,a){return dL(e)&&dL(t)&&(a.set(t,e),vN(e,t,void 0,vU,a),a.delete(t)),e}var vk=p2(function(e,t,n,r){vN(e,t,n,r)}),vB=pJ(function(e){return e.push(void 0,vU),d7(vk,void 0,e)});function vF(e,t,n){if("function"!=typeof e)throw TypeError("Expected a function");return setTimeout(function(){e.apply(void 0,n)},t)}var vz=pJ(function(e,t){return vF(e,1,t)}),vH=pJ(function(e,t,n){return vF(e,dF(t)||0,n)});
268function vj(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function vW(e,t,n,r){var i=-1,a=pR,o=!0,s=e.length,l=[],u=t.length;if(!s)return l;n&&(t=d_(t,fs(n))),r?(a=vj,o=!1):t.length>=200&&(a=gJ,o=!1,t=new g$(t));i:for(;++i<s;){var c=e[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,o&&h==h){for(var d=u;d--;)if(t[d]===h)continue i;l.push(c)}else a(t,h,r)||l.push(c)}return l}var vG=pJ(function(e,t){return vO(e)?vW(e,f1(t,1,vO,!0)):[]});function vV(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var vX=pJ(function(e,t){var n=vV(t);return vO(n)&&(n=void 0),vO(e)?vW(e,f1(t,1,vO,!0),vc(n)):[]}),vq=pJ(function(e,t){var n=vV(t);return vO(n)&&(n=void 0),vO(e)?vW(e,f1(t,1,vO,!0),void 0,n):[]}),vY=dA(function(e,t){return e/t},1);function vZ(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?ms(e,r?0:a,r?a+1:i):ms(e,r?a+1:0,r?i:a)}function v$(e){return"function"==typeof e?e:dW}var vK=vp(!0);function vJ(e,t){return e&&vK(e,t,fx)}var vQ=vg(vJ,!0);function v0(e){return function(t){var n,r,i=gO(t);return"[object Map]"==i?g0(t):"[object Set]"==i?(n=-1,r=Array(t.size),t.forEach(function(e){r[++n]=[e,e]}),r):d_(e(t),function(e){return[e,t[e]]})}}var v1=v0(fx),v2=v0(fE),v3=mT({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),v5=/[&<>"']/g,v4=RegExp(v5.source);function v6(e){return(e=fV(e))&&v4.test(e)?e.replace(v5,v3):e}var v8=/[\\^$.*+?()[\]{}|]/g,v7=RegExp(v8.source);function v9(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function ye(e,t){var n=!0;return vv(e,function(e,r,i){return n=!!t(e,r,i)}),n}function yt(e){return e?gt(dj(e),0,0xffffffff):0}function yn(e,t){var n=[];return vv(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function yr(e){return function(t,n,r){var i=Object(t);if(!p0(t)){var a=vc(n);t=fx(t),n=function(e){return a(i[e],e,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var yi=Math.max;function ya(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:dj(n);return i<0&&(i=yi(r+i,0)),pT(e,vc(t),i)}var yo=yr(ya);function ys(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}var yl=Math.max,yu=Math.min;function yc(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=r-1;return void 0!==n&&(i=dj(n),i=n<0?yl(r+i,0):yu(i,r-1)),pT(e,vc(t),i,!0)}var yh=yr(yc);function yd(e,t){var n=-1,r=p0(e)?Array(e.length):[];return vv(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function yp(e,t){return(dw(e)?d_:yd)(e,vc(t))}var yf=1/0,ym=1/0,yg=m6("floor");function yv(e){return f3(function(t){var n=t.length,r=n,i=pc.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw TypeError("Expected a function");if(i&&!o&&"wrapper"==pu(a))var o=new pc([],!0)}for(r=o?r:n;++r<n;){var s=pu(a=t[r]),l="wrapper"==s?po(a):void 0;o=l&&pm(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?o[pu(l[0])].apply(o,l[3]):1==a.length&&pm(a)?o[s]():o.thru(a)}return function(){var e=arguments,r=e[0];if(o&&1==e.length&&dw(r))return o.plant(r).value();for(var i=0,a=n?t[i].apply(this,e):r;++i<n;)a=t[i].call(this,a);return a}})}var yy=yv(),yb=yv(!0);function yx(e,t){return gu(t,function(t){return dG(e[t])})}var y_=Object.prototype.hasOwnProperty,yw=vb(function(e,t,n){y_.call(e,n)?e[n].push(t):pV(e,n,[t])});function yM(e,t){return e>t}function yE(e){return function(t,n){return("string"!=typeof t||"string"!=typeof n)&&(t=dF(t),n=dF(n)),e(t,n)}}var yS=yE(yM),yT=yE(function(e,t){return e>=t}),yA=Object.prototype.hasOwnProperty;function yC(e,t){return null!=e&&yA.call(e,t)}var yR=Math.max,yP=Math.min;function yI(e){return"string"==typeof e||!dw(e)&&dv(e)&&"[object String]"==dg(e)}function yO(e,t){return d_(t,function(t){return e[t]})}function yL(e){return null==e?[]:yO(e,fx(e))}var yD=Math.max,yN=Math.max,yU=Math.min;function yk(e,t,n){for(var r=n?vj:pR,i=e[0].length,a=e.length,o=a,s=Array(a),l=1/0,u=[];o--;){var c=e[o];o&&t&&(c=d_(c,fs(t))),l=yU(c.length,l),s[o]=!n&&(t||i>=120&&c.length>=120)?new g$(o&&c):void 0}c=e[0];var h=-1,d=s[0];i:for(;++h<i&&u.length<l;){var p=c[h],f=t?t(p):p;if(p=n||0!==p?p:0,!(d?gJ(d,f):r(u,f,n))){for(o=a;--o;){var m=s[o];if(!(m?gJ(m,f):r(e[o],f,n)))continue i}d&&d.push(f),u.push(p)}}return u}function yB(e){return vO(e)?e:[]}var yF=pJ(function(e){var t=d_(e,yB);return t.length&&t[0]===e[0]?yk(t):[]}),yz=pJ(function(e){var t=vV(e),n=d_(e,yB);return t===vV(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?yk(n,vc(t)):[]}),yH=pJ(function(e){var t=vV(e),n=d_(e,yB);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?yk(n,void 0,t):[]});function yj(e,t){return function(n,r){var i,a;return i=t(r),a={},vm(n,function(t,n,r){e(a,i(t),n,r)}),a}}var yW=Object.prototype.toString,yG=yj(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=yW.call(t)),e[t]=n},pw(dW)),yV=Object.prototype,yX=yV.hasOwnProperty,yq=yV.toString,yY=yj(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=yq.call(t)),yX.call(e,t)?e[t].push(n):e[t]=[n]},vc);function yZ(e,t){return t.length<2?e:fZ(e,ms(t,0,-1))}function y$(e,t,n){t=fX(t,e);var r=null==(e=yZ(e,t))?e:e[fY(vV(t))];return null==r?void 0:d7(r,e,n)}var yK=pJ(y$),yJ=pJ(function(e,t,n){var r=-1,i="function"==typeof t,a=p0(e)?Array(e.length):[];return vv(e,function(e){a[++r]=i?d7(t,e,n):y$(e,t,n)}),a}),yQ=fh&&fh.isArrayBuffer,y0=yQ?fs(yQ):function(e){return dv(e)&&"[object ArrayBuffer]"==dg(e)},y1=fh&&fh.isDate,y2=y1?fs(y1):function(e){return dv(e)&&"[object Date]"==dg(e)},y3=Object.prototype.hasOwnProperty,y5=dl.isFinite;function y4(e){return"number"==typeof e&&e==dj(e)}function y6(e){return"number"==typeof e||dv(e)&&"[object Number]"==dg(e)}var y8=dV?dG:ft;function y7(e){return null==e}var y9=fh&&fh.isRegExp,be=y9?fs(y9):function(e){return dv(e)&&"[object RegExp]"==dg(e)},bt=Array.prototype.join,bn=m2(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),br=vb(function(e,t,n){pV(e,n,t)}),bi=Math.max,ba=Math.min,bo=m2(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),bs=mw("toLowerCase");function bl(e,t){return e<t}var bu=yE(bl),bc=yE(function(e,t){return e<=t});function bh(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(null!=o&&(void 0===s?o==o&&!dy(o):n(o,s)))var s=o,l=a}return l}function bd(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);void 0!==a&&(n=void 0===n?a:n+a)}return n}var bp=0/0;function bf(e,t){var n=null==e?0:e.length;return n?bd(e,t)/n:bp}
268var bm=p2(function(e,t,n){vN(e,t,n)}),bg=pJ(function(e,t){return function(n){return y$(n,e,t)}}),bv=pJ(function(e,t){return function(n){return y$(e,n,t)}}),by=dA(function(e,t){return e*t},1);function bb(e){if("function"!=typeof e)throw TypeError("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var bx=du?du.iterator:void 0;function b_(e){if(!e)return[];if(p0(e))return yI(e)?m_(e):ph(e);if(bx&&e[bx]){for(var t,n=e[bx](),r=[];!(t=n.next()).done;)r.push(t.value);return r}var i=gO(e);return("[object Map]"==i?g0:"[object Set]"==i?g1:yL)(e)}function bw(e,t){var n=e.length;if(n)return pN(t+=t<0?n:0,n)?e[t]:void 0}function bM(e,t){return t=fX(t,e),null==(e=yZ(e,t))||delete e[fY(vV(t))]}function bE(e){return me(e)?void 0:e}var bS=f3(function(e,t){var n={};if(null==e)return n;var r=!1;t=d_(t,function(t){return t=fX(t,e),r||(r=t.length>1),t}),pZ(e,gv(e),n),r&&(n=gZ(n,7,bE));for(var i=t.length;i--;)bM(n,t[i]);return n});function bT(e,t,n,r){if(!dL(e))return e;t=fX(t,e);for(var i=-1,a=t.length,o=a-1,s=e;null!=s&&++i<a;){var l=fY(t[i]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)break;if(i!=o){var c=s[l];void 0===(u=r?r(c,l,s):void 0)&&(u=dL(c)?c:pN(t[i+1])?[]:{})}pY(s,l,u),s=s[l]}return e}function bA(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=fZ(e,o);n(s,o)&&bT(a,fX(o,e),s)}return a}function bC(e,t){if(null==e)return{};var n=d_(gv(e),function(e){return[e]});return t=vc(t),bA(e,n,function(e,n){return t(e,n[0])})}function bR(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,a=dy(e),o=void 0!==t,s=null===t,l=t==t,u=dy(t);if(!s&&!u&&!a&&e>t||a&&o&&l&&!s&&!u||r&&o&&l||!n&&l||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!l)return -1}return 0}function bP(e,t,n){t=t.length?d_(t,function(e){return dw(e)?function(t){return fZ(t,1===e.length?e[0]:e)}:e}):[dW];var r=-1;t=d_(t,fs(vc));var i=yd(e,function(e,n,i){return{criteria:d_(t,function(t){return t(e)}),index:++r,value:e}}),a=i.length;for(i.sort(function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var l=bR(i[r],a[r]);if(l){if(r>=s)return l;return l*("desc"==n[r]?-1:1)}}return e.index-t.index}(e,t,n)});a--;)i[a]=i[a].value;return i}function bI(e){return f3(function(t){return t=d_(t,fs(vc)),pJ(function(n){var r=this;return e(t,function(e){return d7(e,r,n)})})})}var bO=bI(d_),bL=Math.min,bD=pJ(function(e,t){var n=(t=1==t.length&&dw(t[0])?d_(t[0],fs(vc)):d_(f1(t,1),fs(vc))).length;return pJ(function(r){for(var i=-1,a=bL(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return d7(e,this,r)})}),bN=bI(v9),bU=bI(gK),bk=Math.floor;function bB(e,t){var n="";if(!e||t<1||t>0x1fffffffffffff)return n;do t%2&&(n+=e),(t=bk(t/2))&&(e+=e);while(t);return n}var bF=vl("length"),bz="\ud800-\udfff",bH="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",bj="\ud83c[\udffb-\udfff]",bW="[^"+bz+"]",bG="(?:\ud83c[\udde6-\uddff]){2}",bV="[\ud800-\udbff][\udc00-\udfff]",bX="(?:"+bH+"|"+bj+")?",bq="[\\ufe0e\\ufe0f]?",bY="(?:\\u200d(?:"+[bW,bG,bV].join("|")+")"+bq+bX+")*",bZ=RegExp(bj+"(?="+bj+")|"+("(?:"+[bW+bH+"?",bH,bG,bV,"["+bz+"]"].join("|"))+")"+(bq+bX+bY),"g");function b$(e){return mc(e)?function(e){for(var t=bZ.lastIndex=0;bZ.test(e);)++t;return t}(e):bF(e)}var bK=Math.ceil;function bJ(e,t){var n=(t=void 0===t?" ":dT(t)).length;if(n<2)return n?bB(t,e):t;var r=bB(t,bK(e/b$(t)));return mc(t)?ml(m_(r),0,e).join(""):r.slice(0,e)}var bQ=Math.ceil,b0=Math.floor,b1=/^\s+/,b2=dl.parseInt,b3=pJ(function(e,t){var n=pB(t,pL(b3));return pW(e,32,void 0,t,n)});b3.placeholder={};var b5=pJ(function(e,t){var n=pB(t,pL(b5));return pW(e,64,void 0,t,n)});b5.placeholder={};var b4=vb(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]}),b6=f3(function(e,t){return null==e?{}:bA(e,t,function(t,n){return vo(e,n)})});function b8(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return -1}var b7=Array.prototype.splice;function b9(e,t,n,r){var i=r?b8:pC,a=-1,o=t.length,s=e;for(e===t&&(t=ph(t)),n&&(s=d_(e,fs(n)));++a<o;)for(var l=0,u=t[a],c=n?n(u):u;(l=i(s,c,l,r))>-1;)s!==e&&b7.call(s,l,1),b7.call(e,l,1);return e}function xe(e,t){return e&&e.length&&t&&t.length?b9(e,t):e}var xt=pJ(xe),xn=Array.prototype.splice;function xr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;pN(i)?xn.call(e,i,1):bM(e,i)}}return e}var xi=f3(function(e,t){var n=null==e?0:e.length,r=fK(e,t);return xr(e,d_(t,function(e){return pN(e,n)?+e:e}).sort(bR)),r}),xa=Math.floor,xo=Math.random;function xs(e,t){return e+xa(xo()*(t-e+1))}var xl=parseFloat,xu=Math.min,xc=Math.random,xh=Math.ceil,xd=Math.max;function xp(e){return function(t,n,r){r&&"number"!=typeof r&&p1(t,n,r)&&(n=r=void 0),t=dH(t),void 0===n?(n=t,t=0):n=dH(n),r=void 0===r?t<n?1:-1:dH(r);for(var i=t,a=n,o=r,s=-1,l=xd(xh((a-i)/(o||1)),0),u=Array(l);l--;)u[e?l:++s]=i,i+=o;return u}}var xf=xp(),xm=xp(!0),xg=f3(function(e,t){return pW(e,256,void 0,void 0,void 0,t)});function xv(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function xy(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}var xb=Array.prototype.reverse;function xx(e){return null==e?e:xb.call(e)}var x_=m6("round");function xw(e){var t=e.length;return t?e[xs(0,t-1)]:void 0}function xM(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n<t;){var a=xs(n,i),o=e[a];e[a]=e[n],e[n]=o}return e.length=t,e}var xE=m2(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()});function xS(e,t){var n;return vv(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}var xT=pJ(function(e,t){if(null==e)return[];var n=t.length;return n>1&&p1(e,t[0],t[1])?t=[]:n>2&&p1(t[0],t[1],t[2])&&(t=[t[0]]),bP(e,f1(t,1),[])}),xA=Math.floor,xC=Math.min;function xR(e,t,n,r){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var o=(t=n(t))!=t,s=null===t,l=dy(t),u=void 0===t;i<a;){var c=xA((i+a)/2),h=n(e[c]),d=void 0!==h,p=null===h,f=h==h,m=dy(h);if(o)var g=r||f;else g=u?f&&(r||d):s?f&&d&&(r||!p):l?f&&d&&!p&&(r||!m):!p&&!m&&(r?h<=t:h<t);g?i=c+1:a=c}return xC(a,0xfffffffe)}function xP(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=0x7fffffff){for(;r<i;){var a=r+i>>>1,o=e[a];null!==o&&!dy(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return xR(e,t,dW,n)}function xI(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!pX(s,l)){var l=s;a[i++]=0===o?0:o}}return a}var xO=Math.max,xL=m2(function(e,t,n){return e+(n?" ":"")+mM(t)}),xD=dA(function(e,t){return e-t},0),xN=Object.prototype,xU=xN.hasOwnProperty;function xk(e,t,n,r){return void 0===e||pX(e,xN[n])&&!xU.call(r,n)?t:e}var xB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function xF(e){return"\\"+xB[e]}var xz=/<%=([\s\S]+?)%>/g,xH={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:xz,variable:"",imports:{_:{escape:v6}}},xj=/\b__p \+= '';/g,xW=/\b(__p \+=) '' \+/g,xG=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xV=/[()=,{}\[\]\/\s]/,xX=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,xq=/($^)/,xY=/['\n\r\u2028\u2029\\]/g,xZ=Object.prototype.hasOwnProperty;function x$(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return dL(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),vA(e,t,{leading:r,maxWait:t,trailing:i})}function xK(e,t){return t(e)}var xJ=Math.min;function xQ(e,t){var n=e;return n instanceof pi&&(n=n.value()),mS(t,function(e,t){return t.func.apply(t.thisArg,fJ([e],t.args))},n)}function x0(){return xQ(this.__wrapped__,this.__actions__)}function x1(e,t){for(var n=e.length;n--&&pC(t,e[n],0)>-1;);return n}function x2(e,t){for(var n=-1,r=e.length;++n<r&&pC(t,e[n],0)>-1;);return n}var x3=/^\s+/,x5=/\w*$/,x4=mT({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),x6=/&(?:amp|lt|gt|quot|#39);/g,x8=RegExp(x6.source),x7=gx&&1/g1(new gx([,-0]))[1]==1/0?function(e){return new gx(e)}:pa;function x9(e,t,n){var r=-1,i=pR,a=e.length,o=!0,s=[],l=s;if(n)o=!1,i=vj;else if(a>=200){var u=t?null:x7(e);if(u)return g1(u);o=!1,i=gJ,l=new g$}else l=t?[]:s;i:for(;++r<a;){var c=e[r],h=t?t(c):c;
268if(c=n||0!==c?c:0,o&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue i;t&&l.push(h),s.push(c)}else i(l,h,n)||(l!==s&&l.push(h),s.push(c))}return s}var _e=pJ(function(e){return x9(f1(e,1,vO,!0))}),_t=pJ(function(e){var t=vV(e);return vO(t)&&(t=void 0),x9(f1(e,1,vO,!0),vc(t))}),_n=pJ(function(e){var t=vV(e);return t="function"==typeof t?t:void 0,x9(f1(e,1,vO,!0),void 0,t)});function _r(e,t){return e&&e.length?x9(e,vc(t)):[]}var _i=0,_a=Math.max;function _o(e){if(!(e&&e.length))return[];var t=0;return e=gu(e,function(e){if(vO(e))return t=_a(e.length,t),!0}),p4(t,function(t){return d_(e,vl(t))})}function _s(e,t){if(!(e&&e.length))return[];var n=_o(e);return null==t?n:d_(n,function(e){return d7(t,void 0,e)})}function _l(e,t,n,r){return bT(e,t,n(fZ(e,t)),r)}var _u=m2(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),_c=pJ(function(e,t){return vO(e)?vW(e,t):[]}),_h=f3(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return fK(t,e)};return!(t>1)&&!this.__actions__.length&&r instanceof pi&&pN(n)?((r=r.slice(n,+n+ +!!t)).__actions__.push({func:xK,args:[i],thisArg:void 0}),new pc(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)});function _d(e,t,n){var r=e.length;if(r<2)return r?x9(e[0]):[];for(var i=-1,a=Array(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=vW(a[i]||o,e[s],t,n));return x9(f1(a,1),t,n)}var _p=pJ(function(e){return _d(gu(e,vO))}),_f=pJ(function(e){var t=vV(e);return vO(t)&&(t=void 0),_d(gu(e,vO),vc(t))}),_m=pJ(function(e){var t=vV(e);return t="function"==typeof t?t:void 0,_d(gu(e,vO),void 0,t)}),_g=pJ(_o);function _v(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}var _y=pJ(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,_s(e,n)}),_b={chunk:function(e,t,n){t=(n?p1(e,t,n):void 0===t)?1:ge(dj(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var i=0,a=0,o=Array(m9(r/t));i<r;)o[a++]=ms(e,i,i+=t);return o},compact:function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i},concat:function(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return fJ(dw(n)?ph(n):[n],f1(t,1))},difference:vG,differenceBy:vX,differenceWith:vq,drop:function(e,t,n){var r=null==e?0:e.length;return r?ms(e,(t=n||void 0===t?1:dj(t))<0?0:t,r):[]},dropRight:function(e,t,n){var r=null==e?0:e.length;return r?ms(e,0,(t=r-(t=n||void 0===t?1:dj(t)))<0?0:t):[]},dropRightWhile:function(e,t){return e&&e.length?vZ(e,vc(t),!0,!0):[]},dropWhile:function(e,t){return e&&e.length?vZ(e,vc(t),!0):[]},fill:function(e,t,n,r){var i=null==e?0:e.length;if(!i)return[];n&&"number"!=typeof n&&p1(e,t,n)&&(n=0,r=i);var a=n,o=r,s=e.length;for((a=dj(a))<0&&(a=-a>s?0:s+a),(o=void 0===o||o>s?s:dj(o))<0&&(o+=s),o=a>o?0:yt(o);a<o;)e[a++]=t;return e},findIndex:ya,findLastIndex:yc,flatten:f2,flattenDeep:function(e){return(null==e?0:e.length)?f1(e,ym):[]},flattenDepth:function(e,t){return(null==e?0:e.length)?f1(e,t=void 0===t?1:dj(t)):[]},fromPairs:function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},head:function(e){return e&&e.length?e[0]:void 0},indexOf:function(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:dj(n);return i<0&&(i=yN(r+i,0)),pC(e,t,i)},initial:function(e){return(null==e?0:e.length)?ms(e,0,-1):[]},intersection:yF,intersectionBy:yz,intersectionWith:yH,join:function(e,t){return null==e?"":bt.call(e,t)},lastIndexOf:function(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=r;return void 0!==n&&(i=(i=dj(n))<0?bi(r+i,0):ba(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--&&e[r]!==t;);return r}(e,t,i):pT(e,pA,i,!0)},nth:function(e,t){return e&&e.length?bw(e,dj(t)):void 0},pull:xt,pullAll:xe,pullAllBy:function(e,t,n){return e&&e.length&&t&&t.length?b9(e,t,vc(n)):e},pullAllWith:function(e,t,n){return e&&e.length&&t&&t.length?b9(e,t,void 0,n):e},pullAt:xi,remove:function(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],a=e.length;for(t=vc(t);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return xr(e,i),n},reverse:xx,slice:function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&p1(e,t,n)?(t=0,n=r):(t=null==t?0:dj(t),n=void 0===n?r:dj(n)),ms(e,t,n
268)):[]},sortedIndex:function(e,t){return xP(e,t)},sortedIndexBy:function(e,t,n){return xR(e,t,vc(n))},sortedIndexOf:function(e,t){var n=null==e?0:e.length;if(n){var r=xP(e,t);if(r<n&&pX(e[r],t))return r}return -1},sortedLastIndex:function(e,t){return xP(e,t,!0)},sortedLastIndexBy:function(e,t,n){return xR(e,t,vc(n),!0)},sortedLastIndexOf:function(e,t){if(null==e?0:e.length){var n=xP(e,t,!0)-1;if(pX(e[n],t))return n}return -1},sortedUniq:function(e){return e&&e.length?xI(e):[]},sortedUniqBy:function(e,t){return e&&e.length?xI(e,vc(t)):[]},tail:function(e){var t=null==e?0:e.length;return t?ms(e,1,t):[]},take:function(e,t,n){return e&&e.length?ms(e,0,(t=n||void 0===t?1:dj(t))<0?0:t):[]},takeRight:function(e,t,n){var r=null==e?0:e.length;return r?ms(e,(t=r-(t=n||void 0===t?1:dj(t)))<0?0:t,r):[]},takeRightWhile:function(e,t){return e&&e.length?vZ(e,vc(t),!1,!0):[]},takeWhile:function(e,t){return e&&e.length?vZ(e,vc(t)):[]},union:_e,unionBy:_t,unionWith:_n,uniq:function(e){return e&&e.length?x9(e):[]},uniqBy:_r,uniqWith:function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?x9(e,void 0,t):[]},unzip:_o,unzipWith:_s,without:_c,xor:_p,xorBy:_f,xorWith:_m,zip:_g,zipObject:function(e,t){return _v(e||[],t||[],pY)},zipObjectDeep:function(e,t){return _v(e||[],t||[],bT)},zipWith:_y},_x={countBy:v_,every:function(e,t,n){var r=dw(e)?v9:ye;return n&&p1(e,t,n)&&(t=void 0),r(e,vc(t))},filter:function(e,t){return(dw(e)?gu:yn)(e,vc(t))},find:yo,findLast:yh,flatMap:function(e,t){return f1(yp(e,t),1)},flatMapDeep:function(e,t){return f1(yp(e,t),yf)}
268,flatMapDepth:function(e,t,n){return n=void 0===n?1:dj(n),f1(yp(e,t),n)},forEach:function(e,t){return(dw(e)?pS:vv)(e,v$(t))},forEachRight:function(e,t){return(dw(e)?function(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}:vQ)(e,v$(t))},groupBy:yw,includes:function(e,t,n,r){e=p0(e)?e:yL(e),n=n&&!r?dj(n):0;var i=e.length;return n<0&&(n=yD(i+n,0)),yI(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&pC(e,t,n)>-1},invokeMap:yJ,keyBy:br,map:yp,orderBy:function(e,t,n,r){return null==e?[]:(dw(t)||(t=null==t?[]:[t]),dw(n=r?void 0:n)||(n=null==n?[]:[n]),bP(e,t,n))},partition:b4,reduce:function(e,t,n){var r=dw(e)?mS:xv,i=arguments.length<3;return r(e,vc(t),n,i,vv)},reduceRight:function(e,t,n){var r=dw(e)?xy:xv,i=arguments.length<3;return r(e,vc(t),n,i,vQ)},reject:function(e,t){return(dw(e)?gu:yn)(e,bb(vc(t)))},sample:function(e){return(dw(e)?xw:function(e){return xw(yL(e))})(e)},sampleSize:function(e,t,n){return t=(n?p1(e,t,n):void 0===t)?1:dj(t),(dw(e)?function(e,t){return xM(ph(e),gt(t,0,e.length))}:function(e,t){var n=yL(e);return xM(n,gt(t,0,n.length))})(e,t)},shuffle:function(e){return(dw(e)?function(e){return xM(ph(e))}:function(e){return xM(yL(e))})(e)},size:function(e){if(null==e)return 0;if(p0(e))return yI(e)?b$(e):e.length;var t=gO(e);return"[object Map]"==t||"[object Set]"==t?e.size:fb(e).length},some:function(e,t,n){var r=dw(e)?gK:xS;return n&&p1(e,t,n)&&(t=void 0),r(e,vc(t))},sortBy:xT},__={after:function(e,t){if("function"!=typeof t)throw TypeError("Expected a function");return e=dj(e),function(){if(--e<1)return t.apply(this,arguments)}},ary:pG,before:mr,bind:mi,bindKey:mo,curry:vw,curryRight:vM,debounce:vA,defer:vz,delay:vH,flip:function(e){return pW(e,512)},memoize:fH,once:function(e){return mr(2,e)},overArgs:bD,partial:b3,partialRight:b5,rearg:xg,rest:function(e,t){if("function"!=typeof e)throw TypeError("Expected a function");return pJ(e,t=void 0===t?t:dj(t))},spread:function(e,t){if("function"!=typeof e)throw TypeError("Expected a function");return t=null==t?0:xO(dj(t),0),pJ(function(n){var r=n[t],i=ml(n,0,t);return r&&fJ(i,r),d7(e,this,i)})},throttle:x$,unary:function(e){return pG(e,1)},wrap:function(e,t){return b3(v$(t),e)}},_w={castArray:function(){if(!arguments.length)return[];var e=arguments[0];return dw(e)?e:[e]},clone:function(e){return gZ(e,4)},cloneDeep:function(e){return gZ(e,5)},cloneDeepWith:function(e,t){return gZ(e,5,t="function"==typeof t?t:void 0)},cloneWith:function(e,t){return gZ(e,4,t="function"==typeof t?t:void 0)},conformsTo:function(e,t){return null==t||vh(e,t,fx(t))},eq:pX,gt:yS,gte:yT,isArguments:fe,isArray:dw,isArrayBuffer:y0,isArrayLike:p0,isArrayLikeObject:vO,isBoolean:function(e){return!0===e||!1===e||dv(e)&&"[object Boolean]"==dg(e)},isBuffer:fa,isDate:y2,isElement:function(e){return dv(e)&&1===e.nodeType&&!me(e)},isEmpty:function(e){if(null==e)return!0;if(p0(e)&&(dw(e)||"string"==typeof e||"function"==typeof e.splice||fa(e)||fp(e)||fe(e)))return!e.length;var t=gO(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(p5(e))return!fb(e).length;for(var n in e)if(y3.call(e,n))return!1;return!0},isEqual:function(e,t){return g9(e,t)},isEqualWith:function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?g9(e,t,void 0,n):!!r},isError:mt,isFinite:function(e){return"number"==typeof e&&y5(e)},isFunction:dG,isInteger:y4,isLength:pQ,isMap:gj,isMatch:function(e,t){return e===t||ve(e,t,vt(t))},isMatchWith:function(e,t,n){return n="function"==typeof n?n:void 0,ve(e,t,vt(t),n)},isNaN:function(e){return y6(e)&&e!=+e},isNative:function(e){if(y8(e))throw Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return d0(e)},isNil:y7,isNull:function(e){return null===e},isNumber:y6,isObject:dL,isObjectLike:dv,isPlainObject:me,isRegExp:be,isSafeInteger:function(e){return y4(e)&&e>=-0x1fffffffffffff&&e<=0x1fffffffffffff},isSet:gG,isString:yI,isSymbol:dy,isTypedArray:fp,isUndefined:function(e){return void 0===e},isWeakMap:function(e){return dv(e)&&"[object WeakMap]"==gO(e)},isWeakSet:function(e){return dv(e)&&"[object WeakSet]"==dg(e)}
268,lt:bu,lte:bc,toArray:b_,toFinite:dH,toInteger:dj,toLength:yt,toNumber:dF,toPlainObject:vD,toSafeInteger:function(e){return e?gt(dj(e),-0x1fffffffffffff,0x1fffffffffffff):0===e?e:0},toString:fV},_M={add:dC,ceil:m8,divide:vY,floor:yg,max:function(e){return e&&e.length?bh(e,dW,yM):void 0},maxBy:function(e,t){return e&&e.length?bh(e,vc(t),yM):void 0},mean:function(e){return bf(e,dW)},meanBy:function(e,t){return bf(e,vc(t))},min:function(e){return e&&e.length?bh(e,dW,bl):void 0},minBy:function(e,t){return e&&e.length?bh(e,vc(t),bl):void 0},multiply:by,round:x_,subtract:xD,sum:function(e){return e&&e.length?bd(e,dW):0},sumBy:function(e,t){return e&&e.length?bd(e,vc(t)):0}},_E={clamp:function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=dF(n))==n?n:0),void 0!==t&&(t=(t=dF(t))==t?t:0),gt(dF(e),t,n)},inRange:function(e,t,n){var r,i,a;return t=dH(t),void 0===n?(n=t,t=0):n=dH(n),(r=e=dF(e))>=yP(i=t,a=n)&&r<yR(i,a)},random:function(e,t,n){if(n&&"boolean"!=typeof n&&p1(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=dH(e),void 0===t?(t=e,e=0):t=dH(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=xc();return xu(e+i*(t-e+xl("1e-"+((i+"").length-1))),t)}return xs(e,t)}},_S={assign:fw,assignIn:fS,assignInWith:fT,assignWith:fA,at:f5,create:function(e,t){var n=d6(e);return null==t?n:gr(n,t)},defaults:vP,defaultsDeep:vB,findKey:function(e,t){return ys(e,vc(t),vm)},findLastKey:function(e,t){return ys(e,vc(t),vJ)},forIn:function(e,t){return null==e?e:vf(e,v$(t),fE)},forInRight:function(e,t){return null==e?e:vK(e,v$(t),fE)},forOwn:function(e,t){return e&&vm(e,v$(t))},forOwnRight:function(e,t){return e&&vJ(e,v$(t))},functions:function(e){return null==e?[]:yx(e,fx(e))},functionsIn:function(e){return null==e?[]:yx(e,fE(e))},get:f$,has:function(e,t){return null!=e&&va(e,t,yC)},hasIn:vo,invert:yG,invertBy:yY,invoke:yK,keysIn:fE,mapKeys:function(e,t){var n={};return t=vc(t),vm(e,function(e,r,i){pV(n,t(e,r,i),e)}),n},mapValues:function(e,t){var n={};return t=vc(t),vm(e,function(e,r,i){pV(n,r,t(e,r,i))}),n},merge:bm,mergeWith:vk,omit:bS,omitBy:function(e,t){return bC(e,bb(vc(t)))},pick:b6,pickBy:bC,result:function(e,t,n){t=fX(t,e);var r=-1,i=t.length;for(i||(i=1,e=void 0);++r<i;){var a=null==e?void 0:e[fY(t[r])];void 0===a&&(r=i,a=n),e=dG(a)?a.call(e):a}return e},set:function(e,t,n){return null==e?e:bT(e,t,n)},setWith:function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:bT(e,t,n,r)},toPairs:v1,toPairsIn:v2,transform:function(e,t,n){var r=dw(e),i=r||fa(e)||fp(e);if(t=vc(t),null==n){var a=e&&e.constructor;n=i?r?new a:[]:dL(e)&&dG(a)?d6(f4(e)):{}}return(i?pS:vm)(e,function(e,r,i){return t(n,e,r,i)}),n},unset:function(e,t){return null==e||bM(e,t)},update:function(e,t,n){return null==e?e:_l(e,t,v$(n))},updateWith:function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:_l(e,t,v$(n),r)},values:yL,valuesIn:function(e){return null==e?[]:yO(e,fE(e))}},_T={at:_h,chain:m7,commit:function(){return new pc(this.value(),this.__chain__)},lodash:pf,next:function(){void 0===this.__values__&&(this.__values__=b_(this.value()));var e=this.__index__>=this.__values__.length,t=e?void 0:this.__values__[this.__index__++];return{done:e,value:t}},plant:function(e){for(var t,n=this;n instanceof pr;){var r=pd(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},reverse:function(){var e=this.__wrapped__;if(e instanceof pi){var t=e;return this.__actions__.length&&(t=new pi(this)),(t=t.reverse()).__actions__.push({func:xK,args:[xx],thisArg:void 0}),new pc(t,this.__chain__)}return this.thru(xx)},tap:function(e,t){return t(e),e},thru:xK,toIterator:function(){return this},toJSON:x0,value:x0,valueOf:x0,wrapperChain:function(){return m7(this)}},_A={camelCase:m3,capitalize:mE,deburr:mP,endsWith:function(e,t,n){e=fV(e),t=dT(t);var r=e.length,i=n=void 0===n?r:gt(dj(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},escape:v6,escapeRegExp:function(e){return(e=fV(e))&&v7.test(e)?e.replace(v8,"\\$&"):e},kebabCase:bn,lowerCase:bo,lowerFirst:bs,pad:function(e,t,n){e=fV(e);var r=(t=dj(t))?b$(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return bJ(b0(i),n)+e+bJ(bQ(i),n)},padEnd:function(e,t,n){e=fV(e);var r=(t=dj(t))?b$(e):0;return t&&r<t?e+bJ(t-r,n):e},padStart:function(e,t,n){e=fV(e);var r=(t=dj(t))?b$(e):0;return t&&r<t?bJ(t-r,n)+e:e},parseInt:function(e,t,n){return n||null==t?t=0:t&&(t*=1),b2(fV(e).replace(b1,""),t||0)},repeat:function(e,t,n){return t=(n?p1(e,t,n):void 0===t)?1:dj(t),bB(fV(e),t)},replace:function(){var e=arguments,t=fV(e[0]);return e.length<3?t:t.replace(e[1],e[2])},snakeCase:xE,split:function(e,t,n){return(n&&"number"!=typeof n&&p1(e,t,n)&&(t=n=void 0),n=void 0===n?0xffffffff:n>>>
2680)?(e=fV(e))&&("string"==typeof t||null!=t&&!be(t))&&!(t=dT(t))&&mc(e)?ml(m_(e),0,n):e.split(t,n):[]},startCase:xL,startsWith:function(e,t,n){return e=fV(e),n=null==n?0:gt(dj(n),0,e.length),t=dT(t),e.slice(n,n+t.length)==t},template:function(e,t,n){var r=xH.imports._.templateSettings||xH;n&&p1(e,t,n)&&(t=void 0),e=fV(e),t=fT({},t,r,xk);var i,a,o=fT({},t.imports,r.imports,xk),s=fx(o),l=yO(o,s),u=0,c=t.interpolate||xq,h="__p += '",d=RegExp((t.escape||xq).source+"|"+c.source+"|"+(c===xz?xX:xq).source+"|"+(t.evaluate||xq).source+"|$","g"),p=xZ.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(d,function(t,n,r,o,s,l){return r||(r=o),h+=e.slice(u,l).replace(xY,xF),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t}),h+="';\n";var f=xZ.call(t,"variable")&&t.variable;if(f){if(xV.test(f))throw Error("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(xj,""):h).replace(xW,"$1").replace(xG,"$1;"),h="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=mn(function(){return Function(s,p+"return "+h).apply(void 0,l)});if(m.source=h,mt(m))throw m;return m},templateSettings:xH,toLower:function(e){return fV(e).toLowerCase()},toUpper:function(e){return fV(e).toUpperCase()},trim:function(e,t,n){if((e=fV(e))&&(n||void 0===t))return dO(e);if(!e||!(t=dT(t)))return e;var r=m_(e),i=m_(t),a=x2(r,i),o=x1(r,i)+1;return ml(r,a,o).join("")},trimEnd:function(e,t,n){if((e=fV(e))&&(n||void 0===t))return e.slice(0,dP(e)+1);if(!e||!(t=dT(t)))return e;var r=m_(e),i=x1(r,m_(t))+1;return ml(r,0,i).join("")},trimStart:function(e,t,n){if((e=fV(e))&&(n||void 0===t))return e.replace(x3,"");if(!e||!(t=dT(t)))return e;var r=m_(e),i=x2(r,m_(t));return ml(r,i).join("")},truncate:function(e,t){var n=30,r="...";if(dL(t)){var i="separator"in t?t.separator:i;n="length"in t?dj(t.length):n,r="omission"in t?dT(t.omission):r}var a=(e=fV(e)).length;if(mc(e)){var o=m_(e);a=o.length}if(n>=a)return e;var s=n-b$(r);if(s<1)return r;var l=o?ml(o,0,s).join(""):e.slice(0,s);if(void 0===i)return l+r;if(o&&(s+=l.length-s),be(i)){if(e.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,fV(x5.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var h=u.index;l=l.slice(0,void 0===h?s:h)}}else if(e.indexOf(dT(i),s)!=s){var d=l.lastIndexOf(i);d>-1&&(l=l.slice(0,d))}return l+r},unescape:function(e){return(e=fV(e))&&x8.test(e)?e.replace(x6,x4):e},upperCase:_u,upperFirst:mM,words:m0},_C={attempt:mn,bindAll:ma,cond:function(e){var t=null==e?0:e.length;return e=t?d_(e,function(e){if("function"!=typeof e[1])throw TypeError("Expected a function");return[vc(e[0]),e[1]]}):[],pJ(function(n){for(var r=-1;++r<t;){var i=e[r];if(d7(i[0],this,n))return d7(i[1],this,n)}})},conforms:function(e){var t,n;return n=fx(t=gZ(e,1)),function(e){return vh(e,t,n)}},constant:pw,defaultTo:function(e,t){return null==e||e!=e?t:e},flow:yy,flowRight:yb,iteratee:function(e){return vc("function"==typeof e?e:gZ(e,1))},matches:function(e){return vr(gZ(e,1))},matchesProperty:function(e,t){return vs(e,gZ(t,1))},method:bg,methodOf:bv,noop:pa,nthArg:function(e){return e=dj(e),pJ(function(t){return bw(t,e)})},over:bO,overEvery:bN,overSome:bU,property:vu,propertyOf:function(e){return function(t){return null==e?void 0:fZ(e,t)}},range:xf,rangeRight:xm,stubArray:gc,stubFalse:ft,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(e,t){if((e=dj(e))<1||e>0x1fffffffffffff)return[];var n=0xffffffff,r=xJ(e,0xffffffff);t=v$(t),e-=0xffffffff;for(var i=p4(r,t);++n<e;)t(n);return i},toPath:function(e){return dw(e)?d_(e,fY):dy(e)?[e]:ph(fG(fV(e)))},uniqueId:function(e){var t=++_i;return fV(e)+t}},_R=Math.max,_P=Math.min,_I=Math.min,_O=Array.prototype,_L=Object.prototype.hasOwnProperty,_D=du?du.iterator:void 0,_N=Math.max,_U=Math.min,_k=(i=function(e,t,n){var r=fx(t),i=yx(t,r),a=!(dL(n)&&"chain"in n)||!!n.chain,o=dG(e);return pS(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=ph(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,fJ([this.value()],arguments))})}),e},function(e,t,n){if(null==n){var r=dL(t),a=r&&fx(t),o=a&&a.length&&yx(t,a);(o?o.length:r)||(n=t,t=e,e=this)}return i(e,t,n)});pf.after=__.after,pf.ary=__.ary,pf.assign=_S.assign,pf.assignIn=_S.assignIn,pf.assignInWith=_S.assignInWith,pf.assignWith=_S.assignWith,pf.at=_S.at,pf.before=__.before,pf.bind=__.bind,pf.bindAll=_C.bindAll,pf.bindKey=__.bindKey,pf.castArray=_w.c
268astArray,pf.chain=_T.chain,pf.chunk=_b.chunk,pf.compact=_b.compact,pf.concat=_b.concat,pf.cond=_C.cond,pf.conforms=_C.conforms,pf.constant=_C.constant,pf.countBy=_x.countBy,pf.create=_S.create,pf.curry=__.curry,pf.curryRight=__.curryRight,pf.debounce=__.debounce,pf.defaults=_S.defaults,pf.defaultsDeep=_S.defaultsDeep,pf.defer=__.defer,pf.delay=__.delay,pf.difference=_b.difference,pf.differenceBy=_b.differenceBy,pf.differenceWith=_b.differenceWith,pf.drop=_b.drop,pf.dropRight=_b.dropRight,pf.dropRightWhile=_b.dropRightWhile,pf.dropWhile=_b.dropWhile,pf.fill=_b.fill,pf.filter=_x.filter,pf.flatMap=_x.flatMap,pf.flatMapDeep=_x.flatMapDeep,pf.flatMapDepth=_x.flatMapDepth,pf.flatten=_b.flatten,pf.flattenDeep=_b.flattenDeep,pf.flattenDepth=_b.flattenDepth,pf.flip=__.flip,pf.flow=_C.flow,pf.flowRight=_C.flowRight,pf.fromPairs=_b.fromPairs,pf.functions=_S.functions,pf.functionsIn=_S.functionsIn,pf.groupBy=_x.groupBy,pf.initial=_b.initial,pf.intersection=_b.intersection,pf.intersectionBy=_b.intersectionBy,pf.intersectionWith=_b.intersectionWith,pf.invert=_S.invert,pf.invertBy=_S.invertBy,pf.invokeMap=_x.invokeMap,pf.iteratee=_C.iteratee,pf.keyBy=_x.keyBy,pf.keys=fx,pf.keysIn=_S.keysIn,pf.map=_x.map,pf.mapKeys=_S.mapKeys,pf.mapValues=_S.mapValues,pf.matches=_C.matches,pf.matchesProperty=_C.matchesProperty,pf.memoize=__.memoize,pf.merge=_S.merge,pf.mergeWith=_S.mergeWith,pf.method=_C.method,pf.methodOf=_C.methodOf,pf.mixin=_k,pf.negate=bb,pf.nthArg=_C.nthArg,pf.omit=_S.omit,pf.omitBy=_S.omitBy,pf.once=__.once,pf.orderBy=_x.orderBy,pf.over=_C.over,pf.overArgs=__.overArgs,pf.overEvery=_C.overEvery,pf.overSome=_C.overSome,pf.partial=__.partial,pf.partialRight=__.partialRight,pf.partition=_x.partition,pf.pick=_S.pick,pf.pickBy=_S.pickBy,pf.property=_C.property,pf.propertyOf=_C.propertyOf,pf.pull=_b.pull,pf.pullAll=_b.pullAll,pf.pullAllBy=_b.pullAllBy,pf.pullAllWith=_b.pullAllWith,pf.pullAt=_b.pullAt,pf.range=_C.range,pf.rangeRight=_C.rangeRight,pf.rearg=__.rearg,pf.reject=_x.reject,pf.remove=_b.remove,pf.rest=__.rest,pf.reverse=_b.reverse,pf.sampleSize=_x.sampleSize,pf.set=_S.set,pf.setWith=_S.setWith,pf.shuffle=_x.shuffle,pf.slice=_b.slice,pf.sortBy=_x.sortBy,pf.sortedUniq=_b.sortedUniq,pf.sortedUniqBy=_b.sortedUniqBy,pf.split=_A.split,pf.spread=__.spread,pf.tail=_b.tail,pf.take=_b.take,pf.takeRight=_b.takeRight,pf.takeRightWhile=_b.takeRightWhile,pf.takeWhile=_b.takeWhile,pf.tap=_T.tap,pf.throttle=__.throttle,pf.thru=xK,pf.toArray=_w.toArray,pf.toPairs=_S.toPairs,pf.toPairsIn=_S.toPairsIn,pf.toPath=_C.toPath,pf.toPlainObject=_w.toPlainObject,pf.transform=_S.transform,pf.unary=__.unary,pf.union=_b.union,pf.unionBy=_b.unionBy,pf.unionWith=_b.unionWith,pf.uniq=_b.uniq,pf.uniqBy=_b.uniqBy,pf.uniqWith=_b.uniqWith,pf.unset=_S.unset,pf.unzip=_b.unzip,pf.unzipWith=_b.unzipWith,pf.update=_S.update,pf.updateWith=_S.updateWith,pf.values=_S.values,pf.valuesIn=_S.valuesIn,pf.without=_b.without,pf.words=_A.words,pf.wrap=__.wrap,pf.xor=_b.xor,pf.xorBy=_b.xorBy,pf.xorWith=_b.xorWith,pf.zip=_b.zip,pf.zipObject=_b.zipObject,pf.zipObjectDeep=_b.zipObjectDeep,pf.zipWith=_b.zipWith,pf.entries=_S.toPairs,pf.entriesIn=_S.toPairsIn,pf.extend=_S.assignIn,pf.extendWith=_S.assignInWith,_k(pf,pf),pf.add=_M.add,pf.attempt=_C.attempt,pf.camelCase=_A.camelCase,pf.capitalize=_A.capitalize,pf.ceil=_M.ceil,pf.clamp=_E.clamp,pf.clone=_w.clone,pf.cloneDeep=_w.cloneDeep,pf.cloneDeepWith=_w.cloneDeepWith,pf.cloneWith=_w.cloneWith,pf.conformsTo=_w.conformsTo,pf.deburr=_A.deburr,pf.defaultTo=_C.defaultTo,pf.divide=_M.divide,pf.endsWith=_A.endsWith,pf.eq=_w.eq,pf.escape=_A.escape,pf.escapeRegExp=_A.escapeRegExp,pf.every=_x.every,pf.find=_x.find,pf.findIndex=_b.findIndex,pf.findKey=_S.findKey,pf.findLast=_x.findLast,pf.findLastIndex=_b.findLastIndex,pf.findLastKey=_S.findLastKey,pf.floor=_M.floor,pf.forEach=_x.forEach,pf.forEachRight=_x.forEachRight,pf.forIn=_S.forIn,pf.forInRight=_S.forInRight,pf.forOwn=_S.forOwn,pf.forOwnRight=_S.forOwnRight,pf.get=_S.get,pf.gt=_w.gt,pf.gte=_w.gte,pf.has=_S.has,pf.hasIn=_S.hasIn,pf.head=_b.head,pf.identity=dW,pf.includes=_x.includes,pf.indexOf=_b.indexOf,pf.inRange=_E.inRange,pf.invoke=_S.invoke,pf.isArguments=_w.isArguments,pf.isArray=dw,pf.isArrayBuffer=_w.isArrayBuffer,pf.isArrayLike=_w.isArrayLike,pf.isArrayLikeObject=_w.isArrayLikeObject,pf.isBoolean=_w.isBoolean,pf.isBuffer=_w.isBuffer,pf.isDate=_w.isDate,pf.isElement=_w.isElement,pf.isEmpty=_w.isEmpty,pf.isEqual=_w.isEqual,pf.isEqualWith=_w.isEqualWith,pf.isError=_w.isError,pf.isFinite=_w.isFinite,pf.isFunction=_w.isFunction,pf.isInteger=_w.isInteger,pf.isLength=_w.isLength,pf.
268isMap=_w.isMap,pf.isMatch=_w.isMatch,pf.isMatchWith=_w.isMatchWith,pf.isNaN=_w.isNaN,pf.isNative=_w.isNative,pf.isNil=_w.isNil,pf.isNull=_w.isNull,pf.isNumber=_w.isNumber,pf.isObject=dL,pf.isObjectLike=_w.isObjectLike,pf.isPlainObject=_w.isPlainObject,pf.isRegExp=_w.isRegExp,pf.isSafeInteger=_w.isSafeInteger,pf.isSet=_w.isSet,pf.isString=_w.isString,pf.isSymbol=_w.isSymbol,pf.isTypedArray=_w.isTypedArray,pf.isUndefined=_w.isUndefined,pf.isWeakMap=_w.isWeakMap,pf.isWeakSet=_w.isWeakSet,pf.join=_b.join,pf.kebabCase=_A.kebabCase,pf.last=vV,pf.lastIndexOf=_b.lastIndexOf,pf.lowerCase=_A.lowerCase,pf.lowerFirst=_A.lowerFirst,pf.lt=_w.lt,pf.lte=_w.lte,pf.max=_M.max,pf.maxBy=_M.maxBy,pf.mean=_M.mean,pf.meanBy=_M.meanBy,pf.min=_M.min,pf.minBy=_M.minBy,pf.stubArray=_C.stubArray,pf.stubFalse=_C.stubFalse,pf.stubObject=_C.stubObject,pf.stubString=_C.stubString,pf.stubTrue=_C.stubTrue,pf.multiply=_M.multiply,pf.nth=_b.nth,pf.noop=_C.noop,pf.now=({now:vE}).now,pf.pad=_A.pad,pf.padEnd=_A.padEnd,pf.padStart=_A.padStart,pf.parseInt=_A.parseInt,pf.random=_E.random,pf.reduce=_x.reduce,pf.reduceRight=_x.reduceRight,pf.repeat=_A.repeat,pf.replace=_A.replace,pf.result=_S.result,pf.round=_M.round,pf.sample=_x.sample,pf.size=_x.size,pf.snakeCase=_A.snakeCase,pf.some=_x.some,pf.sortedIndex=_b.sortedIndex,pf.sortedIndexBy=_b.sortedIndexBy,pf.sortedIndexOf=_b.sortedIndexOf,pf.sortedLastIndex=_b.sortedLastIndex,pf.sortedLastIndexBy=_b.sortedLastIndexBy,pf.sortedLastIndexOf=_b.sortedLastIndexOf,pf.startCase=_A.startCase,pf.startsWith=_A.startsWith,pf.subtract=_M.subtract,pf.sum=_M.sum,pf.sumBy=_M.sumBy,pf.template=_A.template,pf.times=_C.times,pf.toFinite=_w.toFinite,pf.toInteger=dj,pf.toLength=_w.toLength,pf.toLower=_A.toLower,pf.toNumber=_w.toNumber,pf.toSafeInteger=_w.toSafeInteger,pf.toString=_w.toString,pf.toUpper=_A.toUpper,pf.trim=_A.trim,pf.trimEnd=_A.trimEnd,pf.trimStart=_A.trimStart,pf.truncate=_A.truncate,pf.unescape=_A.unescape,pf.uniqueId=_C.uniqueId,pf.upperCase=_A.upperCase,pf.upperFirst=_A.upperFirst,pf.each=_x.forEach,pf.eachRight=_x.forEachRight,pf.first=_b.head,_k(
268pf,function(){var e={};return vm(pf,function(t,n){_L.call(pf.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),pf.VERSION="4.17.21",(pf.templateSettings=_A.templateSettings).imports._=pf,pS(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){pf[e].placeholder=pf}),pS(["drop","take"],function(e,t){pi.prototype[e]=function(n){n=void 0===n?1:_N(dj(n),0);var r=this.__filtered__&&!t?new pi(this):this.clone();return r.__filtered__?r.__takeCount__=_U(n,r.__takeCount__):r.__views__.push({size:_U(n,0xffffffff),type:e+(r.__dir__<0?"Right":"")}),r},pi.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),pS(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;pi.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:vc(e),type:n}),t.__filtered__=t.__filtered__||r,t}}),pS(["head","last"],function(e,t){var n="take"+(t?"Right":"");pi.prototype[e]=function(){return this[n](1).value()[0]}}),pS(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");pi.prototype[e]=function(){return this.__filtered__?new pi(this):this[n](1)}}),pi.prototype.compact=function(){return this.filter(dW)},pi.prototype.find=function(e){return this.filter(e).head()},pi.prototype.findLast=function(e){return this.reverse().find(e)},pi.prototype.invokeMap=pJ(function(e,t){return"function"==typeof e?new pi(this):this.map(function(n){return y$(n,e,t)})}),pi.prototype.reject=function(e){return this.filter(bb(vc(e)))},pi.prototype.slice=function(e,t){e=dj(e);var n=this;return n.__filtered__&&(e>0||t<0)?new pi(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=dj(t))<0?n.dropRight(-t):n.take(t-e)),n)},pi.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},pi.prototype.toArray=function(){return this.take(0xffffffff)},vm(pi.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=pf[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);i&&(pf.prototype[t]=function(){var t=this.__wrapped__,o=r?[1]:arguments,s=t instanceof pi,l=o[0],u=s||dw(t),c=function(e){var t=i.apply(pf,fJ([e],o));return r&&h?t[0]:t};u&&n&&"function"==typeof l&&1!=l.length&&(s=u=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,f=s&&!d;if(!a&&u){t=f?t:new pi(this);var m=e.apply(t,o);return m.__actions__.push({func:xK,args:[c],thisArg:void 0}),new pc(m,h)}return p&&f?e.apply(this,o):(m=this.thru(c),p?r?m.value()[0]:m.value():m)})}),pS(["pop","push","shift","sort","splice","unshift"],function(e){var t=_O[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);pf.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(dw(i)?i:[],e)}return this[n](function(n){return t.apply(dw(n)?n:[],e)})}}),vm(pi.prototype,function(e,t){var n=pf[t];if(n){var r=n.name+"";_L.call(ps,r)||(ps[r]=[]),ps[r].push({name:t,func:n})}}),ps[pF(void 0,2).name]=[{name:"wrapper",func:void 0}],pi.prototype.clone=function(){var e=new pi(this.__wrapped__);return e.__actions__=ph(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ph(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ph(this.__views__),e},pi.prototype.reverse=function(){if(this.__filtered__){var e=new pi(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},pi.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=dw(e),r=t<0,i=n?e.length:0,a=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=_P(t,e+o);break;case"takeRight":e=_R(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=a.start,s=a.end,l=s-o,u=r?s:o-1,c=this.__iteratees__,h=c.length,d=0,p=_I(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return xQ(e,this.__actions__);var f=[];i:for(;l--&&d<p;){for(var m=-1,g=e[u+=t];++m<h;){var v=c[m],y=v.iteratee,b=v.type,x=y(g);if(2==b)g=x;else if(!x)if(1==b)continue i;else break i}f[d++]=g}return f},pf.prototype.at=_T.at,pf.prototype.chain=_T.wrapperChain,pf.prototype.commit=_T.commit,pf.prototype.next=_T.next,pf.prototype.plant=_T.plant,pf.prototype.reverse=_T.reverse,pf.prototype.toJSON=pf.prototype.valueOf=pf.prototype.value=_T.value,pf.prototype.first=pf.prototype.head,_D&&(pf.prototype[_D]=_T.toIterator);let _B=e=>{if(!e)return null;let{id:t,name:n,coordinates:r,ordinalId:i,accessPoint:a}=e;return{occupantId:t,occupant:e,name:n,latLng:a?{lat:a[0],lng:a[1]}:{lat:r[0],lng:r[1]},ordinal:a?a[2]:i}},_F=e=>_B(Mr.occupants.find(t=>t.name===e)),_z=(e,t)=>"__your-location__"===e&&t&&Number.isFinite(t.ordinal)&&Number.isFinite(t.latitude)&&Number.isFinite(t.longitude)?_B({id:e,name:"Your location",level:{ordinal:parseInt(t.ordinal)},coordinates:[t.latitude,t.longitude],type:"occupant"}):_B(Mr.occupants.find(t=>
268t.id===e)),_H=({stops:e,sourceId:t,sourceName:n,destinationId:r,destinationName:i,userLocation:a})=>{let o=[{type:"empty"},{type:"empty"}];if(e)return e.forEach((e,t)=>{if(y7(e)||y7(e.id)||""===e.id){o[t]={type:"empty"};return}let{id:n,name:r}=e,i=n?_z(n,a):r?_F(r):null;i||console.error(`The destination "${n||r}" was not found`),o[t]=null!=i?i:{type:"empty"}}),o;let s=t?_z(t,a):n?_F(n):null;(t||n)&&!s&&console.error(`The destination "${t||n}" was not found`);let l=r?_z(r,a):i?_F(i):null;return(r||i)&&!l&&console.error(`The destination "${r||i}" was not found`),s&&(o[0]=s),l&&(o[1]=l),o};function _j(e,t,n){let[r,i]=dn(e),a=new rY(r,i),o=n.steps.reduce((e,n)=>Number.isFinite(n.ordinal)&&n.ordinal===t?e.concat(n.points.flatMap(({coordinates:e})=>e).map(e=>new rY(...dn(e)))):e,[]);if(0===o.length)return{point:null,distance:null};let{closestPoint:s,distance:l}=o.reduce((e,t,n)=>{if(n===o.length-1)return e;let{closestPoint:r,distance:i}=hA(a,t,o[n+1]);return i<e.distance?{closestPoint:r,distance:i}:e},{closestPoint:null,distance:Number.MAX_VALUE});return{point:s&&[s.x,s.y],distance:l}}let _W=({type:e,coordinates:t})=>{switch(e){case"Polygon":return[t[0]];case"MultiPolygon":return t.map(e=>e[0]);default:return[]}};var _G=Object.defineProperty,_V=Object.defineProperties,_X=Object.getOwnPropertyDescriptors,_q=Object.getOwnPropertySymbols,_Y=Object.prototype.hasOwnProperty,_Z=Object.prototype.propertyIsEnumerable,_$=(e,t,n)=>t in e?_G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_K=(e,t)=>{for(var n in t||(t={}))_Y.call(t,n)&&_$(e,n,t[n]);if(_q)for(var n of _q(t))_Z.call(t,n)&&_$(e,n,t[n]);return e},_J=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},_Q=(e,t,n)=>(_J(e,t,"read from private field"),n?n.call(e):t.get(e)),_0=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},_1=(e,t,n,r)=>(_J(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);let _2={walls:!1,wallsColor:"#a0a0a0",wallsTopColor:null,wallsHeight:2.5,wallsWidth:.1,priority:0};class _3{constructor(e,t,{styles:n,mapProjection:r,userData:i={}}){_0(this,b,null),_0(this,x,null),_0(this,_,function(e){var t,n;let{styles:r,userData:i}=_Q(this,b),a=_Q(this,x),o=e.reduce((e,t)=>{let{type:n,coordinates:r}=t.geometry;switch(n){case"Polygon":e.push(t);break;case"MultiPolygon":e.push(...r.map((e,n)=>_V(_K({},t),_X({id:`${t.id}-${n}`,geometry:{type:"Polygon",coordinates:e}}))))}return e},[]),s=new Map;o.forEach((e,t)=>{let n=e.id,r=e.geometry.coordinates[0],i=[];for(let e=t+1;e<o.length;e++){let t=o[e],n=t.geometry.coordinates[0];r.some(e=>{for(let t=0;t<n.length;t++)if(.01>dr(n[t],e))return!0;return!1})&&i.push(t)}s.set(n,{walkway:e,neighbors:i})});let l=r.wallsMinZoom>0||r.wallsMaxZoom<1e3,u=r.wallsColor.toLowerCase(),c=null!=(n=null==(t=r.wallsTopColor)?void 0:t.toLowerCase())?n:u,h=hs("lambert",u,l,!1,r.priority);s.forEach(({walkway:e,neighbors:t})=>{if(0===t.length)return;let n=e.openingIds?e.openingIds.map(e=>{let t=Mr.openings.get(e);return t||(console.warn(`Opening ${e} was not found`),null)}).filter(Boolean):[],o=null;try{o=_Q(this,E).call(this,e.geometry.coordinates[0],{neighbors:t,doors:n,wallsWidth:r.wallsWidth})}catch(t){console.log(`Walkway walls skipped for the ${e.id}`)}if(o){let e=new ct(o,{curveSegments:1,steps:1,depth:r.wallsHeight,bevelEnabled:!1});if(e.deleteAttribute("uv"),e.rotateX(rq.degToRad(90)),e.translate(0,r.wallsHeight,0),u!==c){let t=new a_(u),n=new a_(c),r=[],i=e.getAttribute("normal");for(let e=0;e<i.count;e++)1===i.getY(e)?r.push(n.r,n.g,n.b):r.push(t.r,t.g,t.b);e.setAttribute("color",new aL(r,3)),h.vertexColors=!0}let t=new a4(e,h);t.matrixAutoUpdate=!1,t.renderOrder=l?-r.priority:r.priority,t.userData=_K({part:"walls"},i),a.add(t)}})}),_0(this,w,function(e,{width:t}){let[n,r]=e,i=r.clone().sub(n).normalize(),a=-i.y*t,o=i.x*t;n.addScaledVector(i.clone().negate(),t),r.addScaledVector(i.clone(),t);let s=new uV;return s.moveTo(n.x-a,n.y-o),s.lineTo(n.x+a,n.y+o),s.lineTo(r.x+a,r.y+o),s.lineTo(r.x-a,r.y-o),s}),_0(this,M,function(e,{offset:t}){let n=_Q(this,b).mapProjection,r=e.map(e=>n.projectToOrigin(e));return 0>ha(r)||(r=r.reverse()),r.pop(),hi(new uV(r.map(([e,t])=>new rY(e,t))),t)}),_0(this,E,function(e,{neighbors:t=[],doors:n=[],wallsWidth:r}){let i={regions:[_Q(this,M).call(this,e,{offset:r/2}).extractPoints().shape.map(({x:e,y:t})=>[e,t])],inverted:!1},a=t.map(e=>({regions:[_Q(this,M).call(this,e.geometry.coordinates[0],{offset:r/2}).extractPoints().shape.map(({x:e,y:t})=>[e,t])],inverted:!1})),o=[],s=rA.segments(i);
268a.forEach(e=>{let t=rA.segments(e),n=rA.combine(s,t);o.push(rA.selectIntersect(n))});let l=o[0];o.forEach((e,n)=>{if(0!==n)try{let t=rA.combine(l,e);l=rA.selectUnion(t)}catch(e){console.log(`Walkway wall skipped for the ${t[n].id}`);return}});let u=_Q(this,b).mapProjection;n.reduce((e,t)=>{let n=t.geometry.coordinates;for(let t=0;t<n.length-1;t++){let i=new rY(...u.projectToOrigin(n[t])),a=new rY(...u.projectToOrigin(n[t+1]));if(0===t){let e=a.clone().sub(i).normalize();i.addScaledVector(e,3*r)}if(t===n.length-2){let e=a.clone().sub(i).normalize();a.addScaledVector(e.negate(),3*r)}e.push([i,a])}return e},[]).map(e=>({regions:[_Q(this,w).call(this,e,{width:r+.1}).extractPoints().shape.map(({x:e,y:t})=>[e,t])],inverted:!1})).forEach((e,t)=>{try{let t=rA.segments(e),n=rA.combine(l,t);l=rA.selectDifference(n)}catch(e){console.log(`Walkway door ${n[t].id} skipped`);return}});let c=rA.polygon(l),{type:h,coordinates:d}=rA.polygonToGeoJSON(c),p=e=>{if(.05>ha(e[0]))return null;let t=e[0].map(([e,t])=>new rY(e,t)),n=e.slice(1).map(e=>new uW(e.map(([e,t])=>new rY(e,t)))),r=new uV(t);return r.holes=n,r};return"Polygon"===h?[p(d)].filter(Boolean):"MultiPolygon"===h?d.map(p).filter(Boolean):null}),_1(this,b,{styles:_K(_K({},_2),n),mapProjection:r,userData:i}),_1(this,x,new lS),_Q(this,x).matrixAutoUpdate=!1,_Q(this,_).call(this,e,t)}get threeObject(){return _Q(this,x)}dispose(){_1(this,b,null),_1(this,x,null)}}b=new WeakMap,x=new WeakMap,_=new WeakMap,w=new WeakMap,M=new WeakMap,E=new WeakMap;var _5=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}(),_4="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,_6=void 0!==n.g&&n.g.Math===Math?n.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),_8="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(_6):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},_7=["top","right","bottom","left","width","height","size","weight"],_9="undefined"!=typeof MutationObserver,we=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function a(){n&&(n=!1,e()),r&&s()}function o(){_8(a)}function s(){var e=Date.now();if(n){if(e-i<2)return;r=!0}else n=!0,r=!1,setTimeout(o,20);i=e}return s}(this.refresh.bind(this),0)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){_4&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),_9?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){_4&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;_7.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=ne
268w e),this.instance_},e.instance_=null,e}(),wt=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},wn=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||_6},wr=ws(0,0,0,0);function wi(e){return parseFloat(e)||0}function wa(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(t,n){return t+wi(e["border-"+n+"-width"])},0)}var wo="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof wn(e).SVGGraphicsElement}:function(e){return e instanceof wn(e).SVGElement&&"function"==typeof e.getBBox};function ws(e,t,n,r){return{x:e,y:t,width:n,height:r}}var wl=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ws(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=function(e){if(!_4)return wr;if(wo(e)){var t;return ws(0,0,(t=e.getBBox()).width,t.height)}return function(e){var t,n=e.clientWidth,r=e.clientHeight;if(!n&&!r)return wr;var i=wn(e).getComputedStyle(e),a=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],a=e["padding-"+i];t[i]=wi(a)}return t}(i),o=a.left+a.right,s=a.top+a.bottom,l=wi(i.width),u=wi(i.height);if("border-box"===i.boxSizing&&(Math.round(l+o)!==n&&(l-=wa(i,"left","right")+o),Math.round(u+s)!==r&&(u-=wa(i,"top","bottom")+s)),(t=e)!==wn(t).document.documentElement){var c=Math.round(l+o)-n,h=Math.round(u+s)-r;1!==Math.abs(c)&&(l-=c),1!==Math.abs(h)&&(u-=h)}return ws(a.left,a.top,l,u)}(e)}(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),wu=function(e,t){var n,r,i,a,o,s=(n=t.x,r=t.y,i=t.width,a=t.height,wt(o=Object.create(("undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object).prototype),{x:n,y:r,width:i,height:a,top:r,right:n+i,bottom:a+r,left:n}),o);wt(this,{target:e,contentRect:s})},wc=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new _5,"function"!=typeof e)throw TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof wn(e).Element))throw TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new wl(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof wn(e).Element))throw TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new wu(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),wh="undefined"!=typeof WeakMap?new WeakMap:new _5,wd=function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var n=new wc(t,we.getInstance(),this);wh.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){wd.prototype[e]=function(){var t;return(t=wh.get(this))[e].apply(t,arguments)}});var wp=void 0!==_6.ResizeObserver?_6.ResizeObserver:wd;class wf extends aa{constructor(e=document.createElement("div")){super(),this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",()=>{this.hide()})}hide(){this.traverse(e=>{e.element instanceof Element&&null!==e.element.parentNode&&(e.element.parentNode.removeChild(e.element),e.onRemoveFromDOM&&e.onRemoveFromDOM())})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this}}wf.prototype.isCSSObject=!0;class wm{constructor(){let e,t,n,r,i,a,o=new ih,s=new ij,l=new ij,u=new ij,c=new ij,h=new ih,d=new ih,p=Math.PI/2,f={objects:new WeakMap},m=document.createElement("div");m.style.overflow="hidden",m.style.cursor="grab",m.style.outline="none",m.style.userSelect="none",m.style.zIndex=2,m.style.position="relative",m.classList.add("pcmap-markers"),this.domElement=m,this.get
268Size=function(){return{width:e,height:t}},this.setSize=function(o,s){e=o,t=s,i=e/2,a=t/2,n=.2*e,r=.2*t,m.style.width=o+"px",m.style.height=s+"px"},this.render=function(e,t){if(s.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),t.isPerspectiveCamera){let e=t.projectionMatrix.elements[5]*a;u.makeScale(e,e,e);let n=g(t.projectionMatrix.elements[8]),r=g(t.projectionMatrix.elements[9]);u.elements[8]=n*i,u.elements[9]=r*a,c.multiplyMatrices(u,t.matrixWorldInverse);let o=`${Math.ceil(e)}px`;f.objects.get(this.domElement)!==o&&(this.domElement.style.perspective=o,f.objects.set(this.domElement,o))}t.isOrthographicCamera&&c.copy(t.matrixWorldInverse),c.elements[1]=-c.elements[1],c.elements[5]=-c.elements[5],c.elements[9]=-c.elements[9],c.elements[13]=-c.elements[13],v(e,e,t)};let g=e=>Math.round(1e7*e)/1e7,v=(y,b,x)=>{if(y.isCSSObject){y.getWorldPosition(o),o.applyMatrix4(s);let v=y.rotation,b=!!(v.x||v.y||v.z),_=y.flippable,w=y.scalable,M=y.visible,E=y.readyToRender,S=y.element,T=S.parentNode===m,A=o.x*i+i,C=-o.y*a+a,R=-n<A&&A<e+n&&-r<C&&C<t+r;if(M&&R){let e="";if(b){if(l.copy(y.matrixWorld),x.isPerspectiveCamera&&!w&&l.scale(x.scale),x.isOrthographicCamera&&w){let e=x.projectionMatrix.elements[5]*a;u.makeScale(e,e,e),l.multiply(u)}_&&(h.copy(y.up).applyEuler(x.rotation),d.copy(y.up).applyEuler(y.rotation),d.angleTo(h)>p&&(u.makeRotationZ(Math.PI),l.multiply(u))),l.elements[4]=-l.elements[4],l.elements[5]=-l.elements[5],l.elements[6]=-l.elements[6],l.elements[7]=-l.elements[7],l.premultiply(c),x.isOrthographicCamera&&l.setPosition(A,C,0),e=`matrix3d(${l.elements.map(g).join(",")})`}else e=`translate(${A}px, ${C}px)`;f.objects.get(y)!==e&&(S.style.transform=e,f.objects.set(y,e))}R&&M&&(E||y.hidden?E&&y.hidden&&(S.style.visibility="",y.hidden=!1):(S.style.visibility="hidden",y.hidden=!0)),R&&M&&!T?(m.appendChild(S),y.onAddToDOM&&y.onAddToDOM()):(!M||!R)&&T&&(m.removeChild(S),y.onRemoveFromDOM&&y.onRemoveFromDOM()),y.inView!==R&&(y.inView=R,R&&y.onInView&&y.onInView(),!R&&y.onOutOfView&&y.onOutOfView()),y.userData.x=A,y.userData.y=C,y.userData.inView=R}for(var _=0,w=y.children.length;_<w;_++)v(y.children[_],b,x)}}}function wg(e,t=16){return`${e/t}em`}let wv=!!window.navigator.msSaveOrOpenBlob;var wy=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},wb=(e,t,n)=>(wy(e,t,"read from private field"),n?n.call(e):t.get(e)),wx=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},w_=(e,t,n,r)=>(wy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);let ww={BOTTOM:"B",RIGHT:"R",LEFT:"L",TOP:"T",CENTER:"C"},wM=new Map;class wE extends rF{constructor(e,{title:t,icon:n="data:,",color:r,mapProjection:i,clusterId:a=null,dotScale:o=1,iconScale:s=1,titleScale:l=1,rotateX:u=0,rotateY:c=0,rotateZ:h=0,height:d=.5,flippable:p=!0,scalable:f=!1}){super(),wx(this,S,function(){let e=wb(this,O),t=wb(this,L),n=wb(this,D),r=wb(this,J),i={dot:{width:0,height:0},icon:{width:0,height:0},title:{width:0,height:0}},a=new wp(a=>{if(!this.inView||!this.visible)return;let o=!1,s=!1,l=!1;a.forEach(({target:a,contentRect:u})=>{let{width:c,height:h}=u,d=a===e?"dot":a===t?"icon":a===n?"title":null;if(!d||1>Math.abs(i[d].width-c)&&1>Math.abs(i[d].height-h))return;i[d].width=c,i[d].height=h;let p=window.getComputedStyle(a);r[d].marginLeft=parseFloat(p.marginLeft),r[d].marginRight=parseFloat(p.marginRight),r[d].marginTop=parseFloat(p.marginTop),r[d].marginBottom=parseFloat(p.marginBottom),r[d].borderLeft=parseFloat(p.borderLeftWidth),r[d].borderRight=parseFloat(p.borderRightWidth),r[d].borderTop=parseFloat(p.borderTopWidth),r[d].borderBottom=parseFloat(p.borderBottomWidth);let{marginLeft:f,marginRight:m,marginTop:g,marginBottom:v,borderLeft:y,borderRight:b,borderTop:x,borderBottom:_}=r[d];switch(d){case"dot":r.dot.width=c+f+m+y+b,r.dot.height=h+g+v+x+_,o=!0;break;case"icon":r.icon.width=c+f+m+y+b,r.icon.height=h+g+v+x+_,r.iconSelected.width=1.625*c+f+m+y+b,r.iconSelected.height=1.625*h+g+v+x+_,s=!0;break;case"title":r.title.width=c+f+m+y+b,r.title.height=h+g+v+x+_,l=!0}}),(o||s)&&wb(this,A).call(this),(o||s||l)&&(w_(this,Z,null),w_(this,K,!0),this.dispatchEvent({type:"sizeChanged"}))});a.observe(e),a.observe(t),a.observe(n),w_(this,Q,a)}),wx(this,T,function(){let{x:e,y:t}=wb(this,N).userData;return{x:e,y:t}}),wx(this,A,function(){let e=wb(this,O),t=wb(this,L),n=wb(this,J),{width:r,height:i}=n.dot,{width:a,height:o}=n.icon;e.style.top=`${-i/2}px`,e.style.left=`${-r/2}px`,t.style.top=`${-o/2}px`,t.style.left=`${-a/2}px`}),wx(this,C,vA(function(){let e=wb(this,I),t=wb(this,U),n=wb(this,O),r=wb(this,L),i=wb(this,D),a=wb(this,J),o=wb(this,$),s=wb(this,V),l=wb(this,X),u=wb(this,q),c=wb(this,Z),h=wb(this,Y);s!==o.showDot&&(n.style.opacity=+!!s),l!==o.showIcon&&(r.style.opacity=+!!l),u!==o.showTitle&&(i.style.opacity=+!!u),h!==o.selected&&(h?(r.style.transform="scale(1.625)",t.style.opacity=1,e.style.zIndex=l?901:900):(r.style.transform="none",t.style.opacity=.5,e.style.zIndex=null)),h&&l!==o.showIcon&&(e.style.zIndex=l?901:900);let{width:d,height:p}=a.dot,{width:f,height:m}=h?a.iconSelected:a.icon,{width:g,height:v}=a.title,y=0,b=0;switch(s&&(y=d/2,b=p/2),l&&(y=f/2,b=m/2),c){case ww.BOTTOM:i.style.textAlign="center",i.style.transform=`translate(-50%, ${b}px)`;break;case ww.TOP:i.style.textAlign="center",i.style.transform=`translate(-50%, -${v+b}px)`;break;case ww.RIGHT:i.style.textAlign="left",i.style.transform=`translate(${y}px, -50%)`;break;case ww.LEFT:i.style.textAlign="right",i.style.transform=`translate(-${g+y}px, -50%)`;break;case ww.CENTER:i.style.textAlign="center",i.style.transform=`translate(-50%, -${v/2+b}px)`}w_(this,$,{showDot:s,showIcon:l,showTitle:u,titlePosition:c,selected:h})},0)),wx(this,R,void 0),wx(this,P,void 0),wx(this,I,void 0),wx(this,O,void 0),wx(this,L,void 0),wx(this,D,void 0),wx(this,N,void 0),wx(this,U,void 0),wx(this,k,.5),wx(this,B,1),wx(this,F,1),wx(this,z,null),wx(this,H,!0),wx(this,j,!1),wx(this,W,!1),wx(this,G,!1),wx(this,V,!0),wx(this,X,!0),wx(this,q,!0),wx(this,Y,!1),wx(this,Z,null),wx(this,$,{titlePosition:null,selected:!1,showDot:!0,showIcon:!0,showTitle:!0}),wx(this,K,!1),wx(this,J,{dot:{width:0,height:0},icon:{width:0,height:0},iconSelected:{width:0,height:0},title:{width:0,height:0}}),wx(this,Q,null),wx(this,ee,[]);let m=null!==a,g=f?20:1,v=document.createElement("div");v.style.cssText=`
269      width: 0px;
270      height: 0px;
271      user-select: none;
272      
273      transition: opacity 200ms ease;
274    `,v.classList.add("pcmap-marker"),m&&v.classList.add("pcmap-cluster");let y=document.createElement("div");y.style.cssText=`
275      display: ${m?"none":"block"};
276      position: absolute;
277      top: 0;
278      left: 0;
279      width: ${wg(8*o)};
280      height: ${wg(8*o)};
281      margin: ${wg(5*o)};
282      border: ${wg(2*o)} solid white;
283      border-radius: 100%;
284      box-sizing: unset;
285      background-color: ${r||"#ff9800"};
286      transition: opacity 200ms ease;
287      user-select: none;
288    `,y.classList.add("pcmap-marker-dot"),v.appendChild(y);let b=document.createElement("div");b.style.cssText=`
289      display: ${m?"none":"block"};
290      position: absolute;
291      top: 0;
292      left: 0;
293      width: ${wg(32*s)};
294      height: ${wg(32*s)};
295      margin: ${wg(5)};
296      transition: opacity 200ms ease, transform 200ms ease;
297      user-select: none;
298    `,b.classList.add("pcmap-marker-icon");let x=document.createElement("div");x.style.cssText=`
299      display: ${m?"none":"block"};
300      position: absolute;
301      top: 0;
302      left: 0;
303      width: 100%;
304      height: 100%;
305      border-radius: 100%;
306      background-color: ${r};
307      filter: blur(${wg(10)});
308      opacity: 0.5;
309      user-select: none;
310    `,b.appendChild(x);let _=((e,t)=>{let n=wM.get(e);return n?n.cloneNode(!0):e?(e.startsWith("<svg ")&&(n=function(e){var t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild}(e)),e.startsWith("data:")&&((n=document.createElement("img")).src=e,n.alt=t),wM.set(e,n),n.cloneNode(!0)):document.createElement("img")})(n,t);_.style.cssText=`
311      position: absolute;
312      top: 0;
313      left: 0;
314      width: 100%;
315      z-index: 1;
316      color: ${r};
317      overflow: visible;
318    `,b.appendChild(_),v.appendChild(b);let w=document.createElement("div"),M=`
319      position: absolute;
320      top: 0;
321      left: 0;
322      font-family: "Arial Rounded MT Bold", "Arial Rounded MT", "Helvetica Rounded", Arial, sans-serif;
323      text-align: center;
324      transition: opacity 200ms ease;
325      user-select: none;
326    `;m?M+=`
327        top: ${wg(-16,18)};
328        left: ${wg(-16,18)};
329        width: ${wg(32,18)};
330        line-height: ${wg(32,18)};
331        font-size: ${wg(Math.ceil(18*l))};
332        border-radius: 50%;
333        background-color: #ee1734;
334        color: white;
335      `:M+=`
336        width: ${wv?`${wg(75,12)}`:"max-content"};
337        max-width: ${wg(75,12)};
338        font-size: ${wg(Math.ceil(12*l*g))};
339        color: #212529;
340        text-shadow: -1px 1px 0 #fff, 1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
341      `,w.style.cssText=M,w.classList.add("pcmap-marker-title"),w.textContent=t,v.appendChild(w);let E=new wf(v),[et,en]=i.projectToOrigin(e);E.position.set(et,d,en),E.rotateX(Math.PI/180*u),E.rotateY(Math.PI/180*c),E.rotateZ(Math.PI/180*h),E.flippable=p,E.scalable=f,E.scale.setScalar(1/g),E.onInView=()=>{this.dispatchEvent({type:"inView"})},w_(this,P,e),w_(this,R,i),w_(this,N,E),w_(this,I,v),w_(this,O,y),w_(this,L,b),w_(this,D,w),w_(this,U,x),w_(this,B,s),w_(this,F,l),w_(this,z,a),w_(this,k,d),wb(this,S).call(this)}get htmlElement(){return wb(this,I)}get threeObject(){return wb(this,N)}get boundsReady(){return wb(this,K)}get bounds(){let{x:e,y:t}=wb(this,T).call(this),n=wb(this,J),r=wb(this,$).selected,i=wb(this,N).scalable?20:1,{width:a,height:o}=n.dot,{width:s,height:l}=r?n.iconSelected:n.icon,u=n.title.width/i,c=n.title.height/i;return[{showDot:!1,showIcon:!0,showTitle:!0,titlePosition:ww.BOTTOM,width:Math.max(s,u),height:l+c,top:t-l/2,bottom:t+l/2+c,left:e-Math.max(s,u)/2,right:e+Math.max(s,u)/2},{showDot:!1,showIcon:!0,showTitle:!0,titlePosition:ww.RIGHT,width:s+u,height:Math.max(l,c),top:t-Math.max(l,c)/2,bottom:t+Math.max(l,c)/2,left:e-s/2,right:e+s/2+u},{showDot:!1,showIcon:!0,showTitle:!0,titlePosition:ww.LEFT,width:s+u,height:Math.max(l,c),top:t-Math.max(l,c)/2,bottom:t+Math.max(l,c)/2,left:e-s/2-u,right:e+s/2},{showDot:!1,showIcon:!0,showTitle:!0,titlePosition:ww.TOP,width:Math.max(s,u),height:l+c,top:t-l/2-c,bottom:t+l/2,left:e-Math.max(s,u)/2,right:e+Math.max(s,u)/2},{showDot:!0,showIcon:!1,showTitle:!0,titlePosition:ww.BOTTOM,width:Math.max(a,u),height:o+c,top:t-o/2,bottom:t+o/2+c,left:e-Math.max(a,u)/2,right:e+Math.max(a,u)/2},{showDot:!0,showIcon:!1,showTitle:!0,titlePosition:ww.RIGHT,width:a+u,height:Math.max(o,c),top:t-c/2,bottom:t+c/2,left:e-a/2,right:e+a/2+u},{showDot:!0,showIcon:!1,showTitle:!0,titlePosition:ww.LEFT,width:a+u,height:Math.max(o,c),top:t-c/2,bottom:t+c/2,left:e-a/2-u,right:e+a/2},{showDot:!0,showIcon:!1,showTitle:!0,titlePosition:ww.TOP,width:Math.max(a,u),height:o+c,top:t-o/2-c,bottom:t+o/2,left:e-Math.max(a,u)/2,right:e+Math.max(a,u)/2},{showDot:!1,showIcon:!1,showTitle:!0,titlePosition:ww.CENTER,width:u,height:c,top:t-c/2,bottom:t+c/2,left:e-u/2,right:e+u/2},{showDot:!1,showIcon:!0,showTitle:!1,titlePosition:null,width:s,height:l,top:t-l/2,bottom:t+l/2,left:e-s/2,right:e+s/2},{showDot:!0,showIcon:!1,showTitle:!1,titlePosition:null,width:a,height:o,top:t-o/2,bottom:t+o/2,left:e-a/2,right:e+a/2},{showDot:!1,showIcon:!1,showTitle:!1,titlePosition:null,width:0,height:0,top:0,bottom:0,left:0,right:0}]}get isCluster(){return null!==wb(this,z)}get clusterId(){return wb(this,z)}get inView(){return wb(this,N).userData.inView}get coordinates(){return wb(this,P)}set coordinates(e){let[t,n]=wb(this,R).projectToOrigin(e),r=wb(this,k);wb(this,N).position.set(t,r,n)}get titlePositions(){return ww}get titlePosition(){return wb(this,Z)}set titlePosition(e){e!==wb(this,Z)&&(w_(this,Z,e),wb(this,C).call(this))}set titleText(e){wb(this,D).textContent=e}get selected(){return wb(this,Y)}set selected(e){e!==wb(this,Y)&&(w_(this,Y,e),wb(this,C).call(this))}get showDot(){return wb(this,V)}set showDot(e){e!==wb(this,V)&&(w_(this,V,e),wb(this,C).call(this))}get showIcon(){return wb(this,X)}set showIcon(e){e!==wb(this,X)&&(w_(this,X,e),wb(this,C).call(this))}get showTitle(){return wb(this,q)}set showTitle(e){e!==wb(this,q)&&(w_(this,q,e),wb(this,C).call(this))}get visible(){return wb(this,H)}set visible(e){wb(this,N).visible=e,w_(this,H,e)}get dimmed(){return wb(this,j)}set dimmed(e){wb(this,I).style.opacity=e?.25:"",w_(this,j,e)}set readyToRender(e){wb(this,N).readyToRender=e}get lock(){return wb(this,W)}set lock(e){w_(this,W,e)}get interactive(){return wb(this,G)}set interactive(e){let t=wb(this,I),n=wb(this,ee);if(e!==wb(this,G)){if(e){let e=!0,r=null,i=null,a=t=>{e=!0,t.changedTouches?(r=t.changedTouches[0].pageX,i=t.changedTouches[0].pageY):(r=t.pageX,i=t.pageY)},o=t=>{if(r&&i){let n=t.changedTouches?t.changedTouches[0].pageX:t.pageX,a=t.changedTouches?t.changedTouches[0].pageY:t.pageY;Math.abs(r-n)+Math.abs(i-a)>20&&(e=!1)}},s=vA(()=>{e&&this.dispatchEvent({type:"click"})},300,{leading:!0,trailing:!1});
341t.style.cursor="pointer",t.addEventListener("click",s),t.addEventListener("touchstart",a),t.addEventListener("touchmove",o),t.addEventListener("touchend",s),n.push({target:t,type:"click",handler:s}),n.push({target:t,type:"touchstart",handler:a}),n.push({target:t,type:"touchmove",handler:o}),n.push({target:t,type:"touchend",handler:s})}e||(n.forEach(({target:e,type:t,handler:n})=>{e.removeEventListener(t,n)}),n.length=0,t.style.cursor="initial"),w_(this,G,e)}}hide(){wb(this,N).hide()}addClass(e){wb(this,I).classList.add(e)}removeClass(e){wb(this,I).classList.remove(e)}dispose(){wb(this,ee).forEach(({target:e,type:t,handler:n})=>{e.removeEventListener(t,n)}),wb(this,Q)&&wb(this,Q).disconnect()}}S=new WeakMap,T=new WeakMap,A=new WeakMap,C=new WeakMap,R=new WeakMap,P=new WeakMap,I=new WeakMap,O=new WeakMap,L=new WeakMap,D=new WeakMap,N=new WeakMap,U=new WeakMap,k=new WeakMap,B=new WeakMap,F=new WeakMap,z=new WeakMap,H=new WeakMap,j=new WeakMap,W=new WeakMap,G=new WeakMap,V=new WeakMap,X=new WeakMap,q=new WeakMap,Y=new WeakMap,Z=new WeakMap,$=new WeakMap,K=new WeakMap,J=new WeakMap,Q=new WeakMap,ee=new WeakMap;var wS=Object.defineProperty,wT=Object.defineProperties,wA=Object.getOwnPropertyDescriptors,wC=Object.getOwnPropertySymbols,wR=Object.prototype.hasOwnProperty,wP=Object.prototype.propertyIsEnumerable,wI=(e,t,n)=>t in e?wS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wO=(e,t)=>{for(var n in t||(t={}))wR.call(t,n)&&wI(e,n,t[n]);if(wC)for(var n of wC(t))wP.call(t,n)&&wI(e,n,t[n]);return e},wL=(e,t)=>wT(e,wA(t)),wD=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},wN=(e,t,n)=>(wD(e,t,"read from private field"),n?n.call(e):t.get(e)),wU=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},wk=(e,t,n,r)=>(wD(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);let wB={floor:!1,floorColor:"#606060",floorMinZoom:0,floorMaxZoom:1e3,roof:!1,roofColor:"#202020",roofHeight:2.5,roofMinZoom:0,roofMaxZoom:1e3,walls:!1,wallsColor:"#a0a0a0",wallsTopColor:null,wallsInsideColor:null,wallsHeight:2.5,wallsWidth:.1,wallsMinZoom:0,wallsMaxZoom:1e3,solid:!1,priority:0};class wF{constructor(e,{styles:t,userData:n={}}={}){wU(this,et,null),wU(this,en,null),wU(this,er,null),wU(this,ei,null),wU(this,ea,null),wU(this,eo,null),wU(this,es,function(e){var t,n;let{styles:r,userData:i}=wN(this,en),a=wN(this,er);if(!r.floor&&!r.roof&&!r.walls)return;let o=e.find(e=>"ShapeGeometry"===e.type),s=e.find(e=>"WallsGeometry"===e.type);if(o&&(r.floor||r.roof)){let e=new aH;if(e.setAttribute("position",new aP(o.position,3)),r.floor){let t=r.floorMinZoom>0||r.floorMaxZoom<1e3,n=hs("basic",r.floorColor,t);n.depthWrite=!1;let o=new a4(e,n);o.matrixAutoUpdate=!1,o.updateMatrix(),o.renderOrder=t?-r.priority:r.priority,o.userData=wL(wO({},i),{part:"floor",minZoom:r.floorMinZoom,maxZoom:r.floorMaxZoom}),a.add(o),wk(this,ei,o)}if(r.roof){let t=r.roofMinZoom>0||r.roofMaxZoom<1e3,n=hs("basic",r.roofColor,t,!1,r.priority),o=e.clone();o.translate(0,r.roofHeight+.01,0);let s=new a4(o,n);s.matrixAutoUpdate=!1,s.updateMatrix(),s.renderOrder=t?-r.priority:r.priority,s.userData=wL(wO({},i),{part:"roof",minZoom:r.roofMinZoom,maxZoom:r.roofMaxZoom}),a.add(s),wk(this,ea,s)}}if(s&&r.walls){let e=new aH;e.setAttribute("position",new aP(s.position,3)),s.normal&&e.setAttribute("normal",new aP(s.normal,3)),(null==(t=s.color)?void 0:t.length)&&e.setAttribute("color",new aP(s.color,3));let o=r.wallsMinZoom>0||r.wallsMaxZoom<1e3,l=new a4(e,hs("lambert",r.wallsColor.toLowerCase(),o,!!(null==(n=s.color)?void 0:n.length),r.priority));l.renderOrder=o?-r.priority:r.priority,l.userData=wL(wO({},i),{part:"walls",minZoom:r.wallsMinZoom,maxZoom:r.wallsMaxZoom}),a.add(l),wk(this,eo,l)}}),wU(this,el,function(e){if(!wN(this,ei))return;let{styles:t}=wN(this,en),n=t.floorMinZoom>0||t.floorMaxZoom<1e3;wN(this,ei).material=hs("basic",e,n),wN(this,ei).material.depthWrite=!1}),wk(this,en,{styles:wO(wO({},wB),t),userData:n}),wk(this,er,new lS),wN(this,er).matrixAutoUpdate=!1,wN(this,es).call(this,e)}get threeObject(){return wN(this,er)}set floorColor(e){e&&wN(this,el).call(this,e)}resetFloorColor(){wN(this,el).call(this,wN(this,en).styles.floorColor)}dispose(){wk(this,et,null),wk(this,en,null),wk(this,er,null),wk(this,ei,null),wk(this,ea,null),wk(this,eo,null)}}et=new WeakMap,en=new WeakMap,er=new WeakMap,ei=new WeakMap,ea=new WeakMap,eo=new WeakMap,es=new WeakMap,el=new WeakMap;var wz=Object.defineProperty,wH=(e,t,n)=>(((e,t,n)=>t in e?wz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),n),wj=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)}
341,wW=(e,t,n)=>(wj(e,t,"read from private field"),n?n.call(e):t.get(e)),wG=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},wV=(e,t,n,r)=>(wj(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class wX{constructor(){wH(this,"add",function(e){e instanceof hw||e instanceof _3||e instanceof wF?wW(this,em).call(this,e.threeObject):wW(this,eh).add(e.threeObject),wW(this,ed).add(e)}),wH(this,"remove",function(e){e instanceof hw||e instanceof _3||e instanceof wF?wW(this,eg).call(this,e.threeObject):wW(this,eh).remove(e.threeObject),wW(this,ed).delete(e)}),wH(this,"traverse",function(e){wW(this,ed).forEach(e)}),wH(this,"toJSON",function(){return wW(this,eh).toJSON()}),wH(this,"filterMapObjects",function(e){wW(this,eh).traverse(t=>{t.visible=e(t.userData,t.visible)})}),wH(this,"dispose",function(){if(wW(this,ep))return;let e=t=>{t.children&&t.children.forEach(e),t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()};wW(this,eh).children.forEach(e),wW(this,ed).forEach(e=>{e.dispose()}),wV(this,ec,null),wV(this,eh,null),wV(this,ed,null),wV(this,ep,!0)}),wG(this,eu,!1),wG(this,ec,void 0),wG(this,eh,void 0),wG(this,ed,void 0),wG(this,ep,!1),wG(this,ef,function(e){let{material:t,renderOrder:n,userData:r}=e;return`${r.category}-${t.userData.type}-${n}-${r.part}-${r.minZoom}-${r.maxZoom}`}),wG(this,em,function(e){let t=wW(this,ec),n=[],r=e=>{Array.isArray(e)&&e.forEach(r),Array.isArray(e.children)&&e.children.forEach(r);let{material:i,geometry:a,renderOrder:o,userData:s={}}=e,{id:l,type:u,category:c,part:h,minZoom:d,maxZoom:p}=s;if(!i||!a)return;if(l&&"unit"===u&&"floor"===h)return void n.push(e);let f=wW(this,ef).call(this,e);t.has(f)||t.set(f,{geometries:new Map,material:i,renderOrder:o,userData:{ids:[],category:c,type:"grouped",part:h,minZoom:d,maxZoom:p,renderOrder:o}});let m=t.get(f);m.userData.ids.push(l),m.geometries.set(a.uuid,a)};r(e.children),n.forEach(e=>{wW(this,eh).add(e)}),wV(this,eu,!0)}),wG(this,eg,function(e){let t=wW(this,ec),n=e=>{var r;Array.isArray(e)&&e.forEach(n),Array.isArray(e.children)&&e.children.forEach(n);let{id:i,type:a,part:o}=null!=(r=e.userData)?r:{};if(i&&"unit"===a&&"floor"===o)return void wW(this,eh).remove(e);let s=wW(this,ef).call(this,e);if(!s||!t.has(s))return;let{geometries:l}=t.get(s);l.delete(e.geometry.uuid)};n(e.children),wV(this,eu,!0)}),wV(this,ec,new Map),wV(this,ed,new Set),wV(this,eh,new lS),wW(this,eh).matrixAutoUpdate=!1,wW(this,eh).addEventListener("removed",()=>{wW(this,ed).forEach(e=>{e instanceof wE&&(e.hide(),e.readyToRender=!1)})})}get threeObject(){return wW(this,eu)&&(wW(this,eh).children.filter(({userData:e})=>e&&"grouped"===e.type).forEach(e=>{wW(this,eh).remove(e)}),wW(this,ec).forEach(({material:e,geometries:t,renderOrder:n,userData:r})=>{let i=new a4(function(e,t=!1){let n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),a={},o={},s=e[0].morphTargetsRelative,l=new aH,u=0;for(let c=0;c<e.length;++c){let h=e[c],d=0;if(n!==(null!==h.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let e in h.attributes){if(!r.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===a[e]&&(a[e]=[]),a[e].push(h.attributes[e]),d++}if(d!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". Make sure all geometries have the same number of attributes."),null;if(s!==h.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let e in h.morphAttributes){if(!i.has(e))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+".  .morphAttributes must be consistent throughout all geometries."),null;void 0===o[e]&&(o[e]=[]),o[e].push(h.morphAttributes[e])}if(t){let e;if(n)e=h.index.count;else{if(void 0===h.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". The geometry must have either an index or a position attribute"),null;e=h.attributes.position.count}l.addGroup(u,e,c),u+=e}}if(n){let t=0,n=[];for(let r=0;r<e.length;++r){let i=e[r].index;for(let e=0;e<i.count;++e)n.push(i.getX(e)+t);t+=e[r].attributes.position.count}l.setIndex(n)}for(let e in a){let t=hM(a[e]);if(!t)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+e+" attribute."),null;l.setAttribute(e,t)}
341for(let e in o){let t=o[e][0].length;if(0===t)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[e]=[];for(let n=0;n<t;++n){let t=[];for(let r=0;r<o[e].length;++r)t.push(o[e][r][n]);let r=hM(t);if(!r)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+e+" morphAttribute."),null;l.morphAttributes[e].push(r)}}return l}(Array.from(t.values())),e);i.renderOrder=n,i.matrixAutoUpdate=!1,i.userData=r,wW(this,eh).add(i)}),wV(this,eu,!1)),wW(this,eh)}}eu=new WeakMap,ec=new WeakMap,eh=new WeakMap,ed=new WeakMap,ep=new WeakMap,ef=new WeakMap,em=new WeakMap,eg=new WeakMap;var wq=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},wY=(e,t,n)=>(wq(e,t,"read from private field"),n?n.call(e):t.get(e)),wZ=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},w$=(e,t,n,r)=>(wq(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);let wK=180/Math.PI;class wJ extends rF{constructor(e,{map:t,mapProjection:n,routeWidth:r,routeColor:i,routeDirectionColor:a,routeDirectionSpeed:o,routeMarkType:s,priority:l=0,animate:u=!1,cutEndings:c=!1}){super(),wZ(this,ev,void 0),wZ(this,ey,void 0),wZ(this,eb,void 0),wZ(this,ex,void 0),wZ(this,e_,void 0),wZ(this,ew,void 0),wZ(this,eM,void 0),wZ(this,eE,void 0),wZ(this,eS,void 0),wZ(this,eT,function(e,t,n){let r=new uV;r.moveTo(0,0),r.lineTo(-t/2,e/2),r.lineTo(0,e/2),r.lineTo(t/2,0),r.lineTo(0,-e/2),r.lineTo(-t/2,-e/2),r.lineTo(0,0);let i=new ct(r,{curveSegments:1,steps:1,depth:n,bevelEnabled:!1});return i.center(),i.rotateX(90*rq.DEG2RAD),i.rotateY(-90*rq.DEG2RAD),i.scale(2,2,2),i}),wZ(this,eA,function(e,t,n){return new uG(e,t,n,32)}),wZ(this,eC,function(e,t,n,r=.1){let i=new a4("arrow"===e?wY(this,eT).call(this,n,n,r):wY(this,eA).call(this,n,n,r),hs("lambert",t));i.matrixAutoUpdate=!1,i.updateMatrix(),w$(this,e_,i)}),wZ(this,eR,function(e){return e.getMapObjects(e=>e.isMesh&&e.material.userData.walkable)}),wZ(this,eP,function(e,t,n){let r=wY(this,eS);if(!r.length)return 0;let[i,a]=n.originToWorld([e.x,e.y]),o=new ih(i,50,a),s=new ih(0,-1,0),l=t.findIntersections(o,s,r);return l.length?Math.max(50-l[0].distance,0):0}),wZ(this,eI,function(e,t,n,r,i){var a;let o=new uP((a=e.map(e=>{let[t,n]=r.projectToOrigin(e);return new rY(t,n)})).reduce((e,t,n)=>{if(0===n||n===a.length-1)return e.push(t),e;let r=a[n-1],i=a[n+1],o=t.clone().sub(r).angle()*wK;return .5>Math.abs(i.clone().sub(t).angle()*wK-o)||e.push(t),e},[]).map(({x:e,y:t})=>new ih(e,t,0)));o.curveType="catmullrom",o.tension=0,o.closed=!1,o.arcLengthDivisions=600;let s=o.getLength(),l=o.getSpacedPoints(s/(2.5*t));n&&(l.pop(),l.shift());let u=l.map((e,t)=>{let n=wY(this,eP).call(this,e,i,r),a=1/l.length*t,s=o.getTangentAt(a).normalize(),u=Math.atan2(s.x,s.y),c=wY(this,e_).clone();return c.position.x=e.x,c.position.y=n+.1,c.position.z=e.y,c.rotation.y=u,c.updateMatrix(),wY(this,ex).add(c),c});w$(this,ew,u)}),wZ(this,eO,function(e=20){let t=Math.max(50,1e3-475*wY(this,eb)),n=wY(this,ew),r=Array(Math.ceil(n.length/e)).fill(1).map((t,n)=>({min:n*e,max:n*e+e,current:n*e})),i=0,a=()=>{if(w$(this,eE,requestAnimationFrame(a)),performance.now()-i<t||!wY(this,eM))return;i=performance.now();let e=hs("lambert",wY(this,ey)),o=hs("lambert",wY(this,ev));n.forEach(e=>{e.material=o}),r.forEach(t=>{let{min:r,max:i,current:a}=t;n[a]&&(n[a].material=e),t.current=a+1<i?a+1:r}),this.dispatchEvent({type:"needsUpdate"})};a()}),w$(this,eM,u),w$(this,ev,i),w$(this,ey,a),w$(this,eb,o),w$(this,ex,new lS),wY(this,ex).position.y=.002*l,w$(this,eS,wY(this,eR).call(this,t)),wY(this,eC).call(this,s,i,r,r/4),wY(this,eI).call(this,e,r,c,n,t),wY(this,eO).call(this)}set priority(e){wY(this,ex).position.y=.002*e}set routeColor(e){wY(this,ew).forEach(t=>{t.material=hs("lambert",e)}),w$(this,ev,e)}set animate(e){w$(this,eM,e)}set visible(e){wY(this,ex).visible=e}get threeObject(){return wY(this,ex)}dispose(){wY(this,eE)&&cancelAnimationFrame(wY(this,eE)),wY(this,ew)&&wY(this,ew).forEach(e=>{e.geometry.dispose()}),wY(this,e_)&&wY(this,e_).geometry.dispose()}}ev=new WeakMap,ey=new WeakMap,eb=new WeakMap,ex=new WeakMap,e_=new WeakMap,ew=new WeakMap,eM=new WeakMap,eE=new WeakMap,eS=new WeakMap,eT=new WeakMap,eA=new WeakMap,eC=new WeakMap,eR=new WeakMap,eP=new WeakMap,eI=new WeakMap,eO=new WeakMap;var wQ=Object.defineProperty,w0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};
341class w1{constructor(e){((e,t,n)=>((e,t,n)=>t in e?wQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n))(this,"containsPoint",function([e,t]){var n,r;return(w0(this,n=eL,"read from private field"),r?r.call(this):n.get(this)).containsPoint(new rY(e,t))}),((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,eL,void 0);let{minLat:t,minLng:n,maxLat:r,maxLng:i}=(e=>e.reduce((e,[t,n])=>({minLat:t<e.minLat?t:e.minLat,maxLat:t>e.maxLat?t:e.maxLat,minLng:n<e.minLng?n:e.minLng,maxLng:n>e.maxLng?n:e.maxLng}),{minLat:e[0][0],maxLat:e[0][0],minLng:e[0][1],maxLng:e[0][1]}))(e);((e,t,n,r)=>(w0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n)))(this,eL,new he(new rY(t,n),new rY(r,i)))}}eL=new WeakMap;let w2=[];for(let e=0;e<256;e++)w2[e]=(e<16?"0":"")+e.toString(16);function w3(){let e=0xffffffff*Math.random()|0,t=0xffffffff*Math.random()|0,n=0xffffffff*Math.random()|0,r=0xffffffff*Math.random()|0;return(w2[255&e]+w2[e>>8&255]+w2[e>>16&255]+w2[e>>24&255]+"-"+w2[255&t]+w2[t>>8&255]+"-"+w2[t>>16&15|64]+w2[t>>24&255]+"-"+w2[63&n|128]+w2[n>>8&255]+"-"+w2[n>>16&255]+w2[n>>24&255]+w2[255&r]+w2[r>>8&255]+w2[r>>16&255]+w2[r>>24&255]).toUpperCase()}function w5(e,t,n,r){let i=new Map,a=e=>{var t,a,o,s,l,u,c,h;if(!e.geometry||!(null==(t=e.properties.SHOW)||t))return;let d=e.properties.OCCU_ID;if(!d)return void console.warn("Occupant without ID skipped");if(i.has(d))return void console.warn(`Duplicate occupant ${d} skipped`);let p=null!=(a=e.properties.OMNI_ORDINAL)&&a,f=null!=(o=e.properties.OMNI_ORDINAL_EXCLUDE)?o:[],m=null,g=null,v=null,y=null,b=null,x=[],_=f$(e,"properties.ROUTABLE",!1);if(!p){if(g=null!=(s=e.properties.LEVEL_ID)?s:"__outdoor-level__",!(v=n.get(g)))return void console.warn(`Occupant ${d} without correct LEVEL_ID skipped`);y=e.properties.UNIT_ID,b=r.get(y),m=v.ordinal,x=((e,t)=>{let n=f$(e,"properties.RoutePoints");if(n){var r=n;let{links:e}=Mr.routes;return r.filter(t=>{let n=e[t];return n&&n.length})}let i=f$(e,"geometry.coordinates",null);if(!i)return[];let a=hR({latLng:{lat:i[1],lng:i[0]},ordinal:t.ordinal});return null!==a?[a]:[]})(e,v),_=!!(f$(e,"properties.ROUTABLE",!0)&&x&&x.length);let t=null!=(u=null==(l=null==e?void 0:e.properties)?void 0:l.RoutePoints)?u:[];if(t.length&&!x.length){let n=(null==(c=e.properties)?void 0:c.NAME)||(null==(h=e.properties)?void 0:h.CATEGORY)||"";console.warn(`Check the route points ${t.join(",")} of the occupant ${d} (${n})`)}}let w=e.properties.HEIGHT,M=e.properties.FLIPPABLE,E=e.properties.SCALABLE,S=e.properties.ROTATE_X||0,T=e.properties.ROTATE_Y||0,A=e.properties.ROTATE_Z||0;e.properties.PLANAR&&(S=-90);let C={id:d,ordinalId:m,levelId:g,level:v,unitId:y,unit:b,omniOrdinal:p,omniOrdinalExclude:f,name:e.properties.NAME||e.properties.CATEGORY||"",display:{name:e.properties.NAME||e.properties.CATEGORY||""},categoryId:e.properties.CATEGORY_ID||"",extraCategoryIds:e.properties.EXTRA_CATEGORY_IDS||[],keywords:e.properties.KEYWORDS||[],clusteringIdentifier:e.properties.CLUSTER||"",images:e.properties.IMAGES||[],icon:e.properties.ICON||"",color:e.properties.COLOR||"",order:e.properties.ORDER||1/0,height:w,rotateX:S,rotateY:T,rotateZ:A,flippable:M,scalable:E,routePoints:x,routable:_,accessPoint:e.properties.ACCESS_POINT?[e.properties.ACCESS_POINT[1],e.properties.ACCESS_POINT[0],e.properties.ACCESS_POINT[2]]:null,coordinates:[e.geometry.coordinates[1],e.geometry.coordinates[0]],rawProperties:Object.entries(e.properties).reduce((e,[t,n])=>(e[t.toLowerCase()]=n,e),{}),dispose:()=>{Object.getOwnPropertyNames(C).forEach(e=>{"dispose"!==e&&(C[e]=null)})}};if(i.set(d,C),v){let e=v.occupants||[];e.push(C),v.occupants=e}if(b){let e=b.occupants||[];e.push(C),b.occupants=e}};return e.features.forEach(a),t.features.forEach(a),i}var w4=Object.defineProperty,w6=Object.getOwnPropertySymbols,w8=Object.prototype.hasOwnProperty,w7=Object.prototype.propertyIsEnumerable,w9=(e,t,n)=>t in e?w4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let Me={features:[]},Mt={basemap:Me,venue:Me,buildings:Me,levels:Me,sections:Me,units:Me,f
341ixtures:Me,openings:Me,lines:Me,routes:{coordinates:[],level_coords:{},links:[],polygons:[],polygon_points:[],level_polys:[]},occupants:Me,points:Me},Mn={init(e,t){var n;let r=Object.entries(Mt).reduce((t,[n,r])=>(t[n]=e[n]||r,t),{}),i=function(e){e.polygons&&rm(e.polygons),e.coordinates&&rm(e.coordinates);let t=e.polygons,n=e.polygon_points,r=e.level_polys&&e.polygons&&e.polygon_points?Object.entries(e.level_polys).reduce((e,[r,i])=>{let[a,o]=i,s=a+o,l=t.slice(a,s),u=n.slice(a,s),c=l.map((e,t)=>({polygon:e,routePoints:u[t]}));return e[r]=c,e},{}):{};return{routePoints:e.coordinates,links:e.links,levelRoutePoints:e.level_coords,levelRoutePolygons:r}}(r.routes);this.routes=i;let a=function(e){if(0===e.features.length)return{id:"",name:"",category:"Venue",geometry:{type:"Polygon",coordinates:[[[0,0]]]},bounds:new w1([[0,0]])};let t=e.features[0],n=rg(t.geometry),r="Polygon"===n.type?n.coordinates[0]:n.coordinates.flatMap(e=>e[0]),i={id:t.properties.VENUE_ID,name:t.properties.NAME,category:t.properties.CATEGORY||"Venue",geometry:n,buffers:t.properties.BUFFERS,bounds:new w1(r),dispose:()=>{Object.getOwnPropertyNames(i).forEach(e=>{"dispose"!==e&&(i[e]=null)})}};return i}(r.venue),o=r.buildings.features.reduce((e,t)=>{let n=t.properties.BLDG_ID;if(e.has(n))return console.warn(`Duplicate building ${n} skipped`),e;let r={id:n,name:t.properties.NAME,display:{name:t.properties.NAME||""},category:t.properties.CATEGORY||"Building",geometry:rg(t.geometry),buffers:t.properties.BUFFERS,dispose:()=>{Object.getOwnPropertyNames(r).forEach(e=>{"dispose"!==e&&(r[e]=null)})}};return e.set(n,r),e},new Map),s=r.basemap.features.reduce((e,t)=>{let n=t.properties.BASEMAP_ID||w3();if(e.has(n))return console.warn(`Duplicate basemap part ${n} skipped`),e;let r={id:n,category:t.properties.CATEGORY||"Basemap",geometry:rg(t.geometry),buffers:t.properties.BUFFERS,dispose:()=>{Object.getOwnPropertyNames(r).forEach(e=>{"dispose"!==e&&(r[e]=null)})}};return e.set(n,r),e},new Map),l=r.lines.features.reduce((e,t)=>{let n=t.properties.OPENING_ID||w3(),r={id:n,category:t.properties.CATEGORY||"Line",geometry:rg(t.geometry),dispose:()=>{Object.getOwnPropertyNames(r).forEach(e=>{"dispose"!==e&&(r[e]=null)})}};return e.set(n,r),e},new Map),u=r.units.features.reduce((e,t)=>{var n,r;let{units:i,levels:a}=e;if(!t.properties.BUFFERS&&!(null==(r=null==(n=t.geometry)?void 0:n.coordinates)?void 0:r.length))return e;let o=t.properties.UNIT_ID||w3(),s=t.properties.LEVEL_ID;if(i.has(o))return console.warn(`Duplicate unit ${o} skipped`),e;if(!s)return console.warn(`Unit ${o} without LEVEL_ID skipped`),e;let l={id:o,levelId:s,openingIds:t.properties.OPENING_IDS,category:t.properties.CATEGORY,routePoints:t.properties.RoutePoints||null,geometry:rg(t.geometry),buffers:t.properties.BUFFERS,rawProperties:t.properties,dispose:()=>{Object.getOwnPropertyNames(l).forEach(e=>{"dispose"!==e&&(l[e]=null)})}};i.set(o,l);let u=a.get(s)||[];return u.push(l),a.set(s,u),e},{units:new Map,levels:new Map}),c=r.sections.features.reduce((e,t)=>{var n,r;let{sections:i,levels:a}=e;if(!t.properties.BUFFERS&&!(null==(r=null==(n=t.geometry)?void 0:n.coordinates)?void 0:r.length))return e;let o=t.properties.SECTION_ID||w3(),s=t.properties.LEVEL_ID;if(i.has(o))return console.warn(`Duplicate section ${o} skipped`),e;if(!s)return console.warn(`Section ${o} without LEVEL_ID skipped`),e;let l={id:o,levelId:s,openingIds:t.properties.OPENING_IDS,category:t.properties.CATEGORY,subCategory:t.properties.SUB_CATEGORY||null,name:t.properties.NAME,geometry:rg(t.geometry),buffers:t.properties.BUFFERS,dispose:()=>{Object.getOwnPropertyNames(l).forEach(e=>{"dispose"!==e&&(l[e]=null)})}};i.set(o,l);let u=a.get(s)||[];return u.push(l),a.set(s,u),e},{sections:new Map,levels:new Map}),h=r.fixtures.features.reduce((e,t)=>{var n,r;let{fixtures:i,levels:a}=e;if(!t.properties.BUFFERS&&!(null==(r=null==(n=t.geometry)?void 0:n.coordinates)?void 0:r.length))return e;let o=t.properties.FIXTURE_ID||w3(),s=t.properties.LEVEL_ID;if(i.has(o))return console.warn(`Duplicate fixture ${o} skipped`),e;if(!s)return console.warn(`Fixture ${o}
341 without LEVEL_ID skipped`),e;let l={id:o,levelId:s,originId:t.properties.ORIGIN_ID,category:t.properties.CATEGORY,geometry:rg(t.geometry),buffers:t.properties.BUFFERS,dispose:()=>{Object.getOwnPropertyNames(l).forEach(e=>{"dispose"!==e&&(l[e]=null)})}};i.set(o,l);let u=a.get(s)||[];return u.push(l),a.set(s,u),e},{fixtures:new Map,levels:new Map}),d=r.openings.features.reduce((e,t)=>{var n,r;let{openings:i,levels:a}=e;if(!t.buffers&&!(null==(r=null==(n=t.geometry)?void 0:n.coordinates)?void 0:r.length))return e;let o=t.properties.OPENING_ID||w3(),s=t.properties.LEVEL_ID;if(!s)return console.warn(`Opening ${o} without LEVEL_ID skipped`),e;let l={id:o,levelId:s,category:t.properties.CATEGORY||"Opening",geometry:rg(t.geometry),dispose:()=>{Object.getOwnPropertyNames(l).forEach(e=>{"dispose"!==e&&(l[e]=null)})}};i.set(o,l);let u=a.get(s)||[];return u.push(l),a.set(s,u),e},{openings:new Map,levels:new Map}),p=(n=r.levels,n.features.reduce((e,t,n)=>{if(0===n){let t={id:"__outdoor-level__",name:"Outdoor",shortName:"L0",ordinal:0,category:"__outdoor-level__",dispose:function(){Object.getOwnPropertyNames(this).forEach(e=>{"dispose"!==e&&(this[e]=null)})}};e.set(t.id,t);let n={id:"__dynamic__",name:"",shortName:"L0",ordinal:0,category:"__dynamic__",dispose:function(){Object.getOwnPropertyNames(this).forEach(e=>{"dispose"!==e&&(this[e]=null)})}};e.set(n.id,n)}let r=t.properties.LEVEL_ID,i=f$(t,"properties.BLDG_ID",null),a=o.get(i);if(e.has(r))return console.warn(`Duplicate level ${r} skipped`),e;let s={id:r,building:a,openingIds:t.properties.OPENING_IDS,category:t.properties.CATEGORY||"Level",name:t.properties.NAME,shortName:t.properties.SHORT_NAME,display:{name:t.properties.NAME||""},ordinal:t.properties.ORDINAL,geometry:rg(t.geometry),buffers:t.properties.BUFFERS,dispose:()=>{Object.getOwnPropertyNames(s).forEach(e=>{"dispose"!==e&&(s[e]=null)})}};return e.set(r,s),e},new Map)),f=w5(r.occupants,r.points,p,u.units),m=Array.from(f.values()),g=m.filter(e=>e.omniOrdinal);p.forEach((e,t)=>{e.units=u.levels.get(t),e.sections=c.levels.get(t),e.fixtures=h.levels.get(t),e.openings=d.levels.get(t)});let v=new Map([...new Set([...p.values()].map(e=>e.ordinal))].map(e=>[e,{id:e,name:"",venue:a,buildings:o,basemap:s,lines:l,levels:[],occupants:[],occupantsMap:new Map}]));for(let e of(p.forEach((e,t)=>{let n=v.get(e.ordinal);n&&(n.name=e.shortName||`L${t}`,n.levels.push(e),n.occupants.push(...e.occupants||[]),v.set(e.ordinal,n))}),v.forEach(e=>{var t;e.occupants.push(...g.filter(t=>!t.omniOrdinalExclude.includes(e.id)).map(e=>((e,t)=>{for(var n in t||(t={}))w8.call(t,n)&&w9(e,n,t[n]);if(w6)for(var n of w6(t))w7.call(t,n)&&w9(e,n,t[n]);return e})({},e))),e.occupantsMap=new Map(e.occupants.map(e=>[e.id,e])),e.routePolygons=null==(t=i.levelRoutePolygons)?void 0:t[e.id]}),p.forEach(e=>{var t;null==(t=e.units)||t.forEach(t=>{let{routePoints:n,geometry:r}=t;(null==n?void 0:n.length)&&("Polygon"===r.type?[r.coordinates[0]]:"MultiPolygon"===r.type?r.coordinates.map(e=>e[0]):[]).forEach(t=>{var r;let a=null!=(r=i.levelRoutePolygons[e.ordinal])?r:[];a.push({polygon:t,routePoints:n,isRoom:!0}),i.levelRoutePolygons[e.ordinal]=a})})}),h.fixtures.values()))e.originId&&(e.originUnit=u.units.get(e.originId));this.ordinals=v,this.venue=a,this.buildings=o,this.basemap=s,this.lines=l,this.levels=p,this.occupants=m,this.occupantsMap=f,this.units=u.units,this.sections=c.sections,this.fixtures=h.fixtures,this.openings=d.openings,this.styles=t||{}},update(e){e&&e.occupants&&e.points&&(this.occupants=w5(e.occupants,e.points,this.levels,this.units))}},Mr={init(e,t){e.manifest&&(this.parser="IMDF"),"AVF"===this.parser&&Mn.init.call(this,e,t)},update(){},dispose(){let e=e=>{e.dispose&&e.dispose()};this.venue.dispose(),this.buildings.forEach(e),this.levels.forEach(e),this.sections.forEach(e),this.units.forEach(e),this.fixtures.forEach(e),this.openings.forEac
341h(e),this.lines.forEach(e),this.occupants.forEach(e),this.ordinals.forEach(e),this.venue=null,this.buildings=null,this.levels=null,this.sections=null,this.units=null,this.fixtures=null,this.openings=null,this.lines=null,this.routes=null,this.occupants=null,this.occupantsMap=null,this.ordinals=null,this.styles=null},parser:"AVF",venue:null,buildings:new Map,levels:new Map,sections:new Map,units:new Map,fixtures:new Map,openings:new Map,lines:new Map,routes:{routePoints:[],links:[],levelRoutePoints:{}},occupants:[],occupantsMap:new Map,ordinals:new Map,styles:{}};var Mi=Object.defineProperty,Ma=Object.defineProperties,Mo=Object.getOwnPropertyDescriptors,Ms=Object.getOwnPropertySymbols,Ml=Object.prototype.hasOwnProperty,Mu=Object.prototype.propertyIsEnumerable,Mc=(e,t,n)=>t in e?Mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mh=(e,t)=>{for(var n in t||(t={}))Ml.call(t,n)&&Mc(e,n,t[n]);if(Ms)for(var n of Ms(t))Mu.call(t,n)&&Mc(e,n,t[n]);return e};let Md={language:"en",showQRCode:!0,showOpeningState:!1,showCategoriesAlways:!1,showLevelsAlways:!1,keepSearchListsOpened:!1,venueTimeZone:"Europe/Lisbon",ordinal:0,center:[47.451615,8.562151],minZoom:10,maxZoom:23,zoom:18,zoomSpeed:1,minRotation:-360,maxRotation:360,rotation:0,rotationSpeed:1,minTilt:0,maxTilt:45,tilt:0,maxBounds:[[-90,-180],[90,180]],damping:!1,dampingFactor:.25,dotDistanceThreshold:12,clusterDistanceThreshold:32,backgroundColor:"#d0d0d0",unitFloorHighlightColor:"#adbfde",unitFloorHighlighting:!0,nonHighlightedMarkers:"hidden",basemap:null,markersProvider:"internal",routeWidth:1.5,routeColor:"#5A5AFC",routeExtraTimeColor:"#F76F7B",routeExtraTimeDirectionColor:"#FF0000",routeInactiveColor:"#E2E0FF",routeDirectionColor:"#FF0000",routeDirectionSpeed:1.88,routeMarkType:"pebble",routeRules:null,routeMaxZoom:22,routePointZoom:22,routeStartPointZoom:22,routeStickingThreshold:10,routeInactiveVisible:!1,routePointsHighlight:!1,routeStartStepThreshold:50,routeArriveStepThreshold:50,routeFromStepThreshold:50,routeFollowStepThreshold:0,searchAlongRouteMaxDistance:20,allowHeadingMode:!0,lockRotationInHeadingMode:!1,lockPanningInFollowMeMode:!1,applyOrdinalOptionsOnOrdinalChange:!1,ordinalsOptions:[],extraTimeOptions:[],makeRouteHandler:null,getRouteSteps:null,getRouteTimeString:null,getRoutePaddings:()=>({paddingTop:200,paddingLeft:100,paddingRight:100,paddingBottom:100}),getMapPaddings:()=>({paddingTop:50,paddingLeft:50,paddingRight:50,paddingBottom:50}),userPositionOnlyInVenue:!1,disableHeadingFilter:!1,debug:!1,components:{Router:null}},Mp=rc.createContext();function Mf({options:e,children:t}){void 0!==e.timeZoneOffset&&console.warn('The option "timeZoneOffset" is obsolete in favour of "venueTimeZone".');let n=rc.useMemo(()=>({options:{language:f$(e,"language",Md.language),showQRCode:f$(e,"showQRCode",Md.showQRCode),showOpeningState:f$(e,"showOpeningState",Md.showOpeningState),showCategoriesAlways:f$(e,"showCategoriesAlways",Md.showCategoriesAlways),showLevelsAlways:f$(e,"showLevelsAlways",Md.showLevelsAlways),keepSearchListsOpened:f$(e,"keepSearchListsOpened",Md.keepSearchListsOpened),ordinal:parseInt(f$(e,"ordinal",Md.ordinal),10),venueTimeZone:f$(e,"venueTimeZone",Md.venueTimeZone),center:f$(e,"center",Md.center),minZoom:f$(e,"minZoom",Md.minZoom),maxZoom:f$(e,"maxZoom",Md.maxZoom),zoom:f$(e,"zoom",Md.zoom),zoomSpeed:f$(e,"zoomSpeed",Md.zoomSpeed),minRotation:f$(e,"minRotation",Md.minRotation),maxRotation:f$(e,"maxRotation",Md.maxRotation),rotation:f$(e,"rotation",Md.rotation),rotationSpeed:f$(e,"rotationSpeed",Md.rotationSpeed),minTilt:f$(e,"minTilt",Md.minTilt),maxTilt:f$(e,"maxTilt",Md.maxTilt),tilt:f$(e,"tilt",Md.tilt),backgroundColor:f$(e,"backgroundColor",Md.backgroundColor),unitFloorHighlightColor:f$(e,"unitFloorHighlightColor",Md.unitFloorHighlightColor),unitFloorHighlighting:f$(e,"unitFloorHighlighting",Md.unitFloorHighlighting),nonHighlightedMarkers:f$(e,"nonHighlightedMarkers",Md.nonHighlightedMarkers),maxBounds:f$(e,"maxBounds",Md.maxBounds),damping:f$(e,"damping",Md.damping),dampingFactor:f$(e,"dampingFactor",Md.dampingFactor),dotDistanceThreshold:f$(e,"dotDistanceThreshold",Md.dotDistanceThreshold),clusterDistanceThreshold:f$(e,"clusterDistanceThreshold",Md.clusterDistanceThreshold),basemap:f$(e,"basemap",Md.basemap),markersProvider:f$(e,"markersProvider",Md.markersProvider),routeWidth:f$(e,"routeWidth",Md.routeWidth),routeC
341olor:f$(e,"routeColor",Md.routeColor),routeExtraTimeColor:f$(e,"routeExtraTimeColor",Md.routeExtraTimeColor),routeExtraTimeDirectionColor:f$(e,"routeExtraTimeDirectionColor",Md.routeExtraTimeDirectionColor),routeInactiveColor:f$(e,"routeInactiveColor",Md.routeInactiveColor),routeDirectionColor:f$(e,"routeDirectionColor",Md.routeDirectionColor),routeDirectionSpeed:f$(e,"routeDirectionSpeed",Md.routeDirectionSpeed),routeMarkType:f$(e,"routeMarkType",Md.routeMarkType),routeRules:f$(e,"routeRules",Md.routeRules),routeMaxZoom:f$(e,"routeMaxZoom",Md.routeMaxZoom),routePointZoom:f$(e,"routePointZoom",Md.routePointZoom),routeStartPointZoom:f$(e,"routeStartPointZoom",Md.routeStartPointZoom),routeStickingThreshold:f$(e,"routeStickingThreshold",Md.routeStickingThreshold),routeInactiveVisible:f$(e,"routeInactiveVisible",Md.routeInactiveVisible),routePointsHighlight:f$(e,"routePointsHighlight",Md.routePointsHighlight),routeStartStepThreshold:f$(e,"routeStartStepThreshold",Md.routeStartStepThreshold),routeArriveStepThreshold:f$(e,"routeArriveStepThreshold",Md.routeArriveStepThreshold),routeFromStepThreshold:f$(e,"routeFromStepThreshold",Md.routeFromStepThreshold),routeFollowStepThreshold:f$(e,"routeFollowStepThreshold",Md.routeFollowStepThreshold),searchAlongRouteMaxDistance:f$(e,"searchAlongRouteMaxDistance",Md.searchAlongRouteMaxDistance),allowHeadingMode:f$(e,"allowHeadingMode",Md.allowHeadingMode),lockRotationInHeadingMode:f$(e,"lockRotationInHeadingMode",Md.lockRotationInHeadingMode),lockPanningInFollowMeMode:f$(e,"lockPanningInFollowMeMode",Md.lockPanningInFollowMeMode),applyOrdinalOptionsOnOrdinalChange:f$(e,"applyOrdinalOptionsOnOrdinalChange",Md.applyOrdinalOptionsOnOrdinalChange),ordinalsOptions:f$(e,"ordinalsOptions",Md.ordinalsOptions),extraTimeOptions:f$(e,"extraTimeOptions",Md.extraTimeOptions),makeRouteHandler:f$(e,"makeRouteHandler",Md.makeRouteHandler),getRouteSteps:f$(e,"getRouteSteps",Md.getRouteSteps),getRouteTimeString:f$(e,"getRouteTimeString",Md.getRouteTimeString),getRoutePaddings:f$(e,"getRoutePaddings",Md.getRoutePaddings),getMapPaddings:f$(e,"getMapPaddings",Md.getMapPaddings),userPositionOnlyInVenue:f$(e,"userPositionOnlyInVenue",Md.userPositionOnlyInVenue),disableHeadingFilter:f$(e,"disableHeadingFilter",Md.disableHeadingFilter),debug:f$(e,"debug",Md.debug),components:{Router:f$(e,"components.Router",Md.components.Router)}}}),[e]);return rc.createElement(Mp.Provider,{value:n},t)}function Mm(){let e=rc.useContext(Mp);if(!e)throw Error("useOptions must be used within a OptionsProvider");return e}function Mg(e){var t;class n extends rc.Component{render(){let t=this.props,{forwardedRef:n}=t,r=((e,t)=>{var n={};for(var r in e)Ml.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&Ms)for(var r of Ms(e))0>t.indexOf(r)&&Mu.call(e,r)&&(n[r]=e[r]);return n})(t,["forwardedRef"]);return rc.createElement(Mp.Consumer,null,t=>rc.createElement(e,Mh(Mh({ref:n},r),t)))}}return Mc(n,"symbol"!=typeof(t="displayName")?t+"":t,"withOptionsConsumer"),rc.forwardRef((e,t)=>rc.createElement(n,Ma(Mh({},e),Mo({forwardedRef:t}))))}var Mv=Object.defineProperty,My=Object.defineProperties,Mb=Object.getOwnPropertyDescriptors,Mx=Object.getOwnPropertySymbols,M_=Object.prototype.hasOwnProperty,Mw=Object.prototype.propertyIsEnumerable,MM=(e,t,n)=>t in e?Mv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ME=(e,t)=>{for(var n in t||(t={}))M_.call(t,n)&&MM(e,n,t[n]);if(Mx)for(var n of Mx(t))Mw.call(t,n)&&MM(e,n,t[n]);return e};let MS=rc.createContext();function MT({eventEmitter:e,children:t}){let n=rc.useMemo(()=>({events:e}),[e]);return rc.createElement(MS.Provider,{value:n},t)}function MA(){let e=rc.useContext(MS);if(!e)throw Error("useEvents must be used within a EventsProvider");return e}function MC(e){var t;class n extends rc.Component{render(){let t=this.props,{forwardedRef:n}=t,r=((e,t)=>{var n={};for(var r in e)M_.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&Mx)for(var r of Mx(e))0>t.indexOf(r)&&Mw.call(e,r)&&(n[r]=e[r]);return n})(t,["forwardedRef"]);return rc.createElement(MS.Consumer,null,t=>rc.createElement(e,ME(ME({ref:n},r),t)))}}return MM(n,"symbol"!=typeof(t="displayName")?t+"":t,"withEventsConsumer"),rc.forwardRef((e,t)=>
341rc.createElement(n,My(ME({},e),Mb({forwardedRef:t}))))}var MR=Object.defineProperty,MP=Object.defineProperties,MI=Object.getOwnPropertyDescriptors,MO=Object.getOwnPropertySymbols,ML=Object.prototype.hasOwnProperty,MD=Object.prototype.propertyIsEnumerable,MN=(e,t,n)=>t in e?MR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MU=(e,t)=>{for(var n in t||(t={}))ML.call(t,n)&&MN(e,n,t[n]);if(MO)for(var n of MO(t))MD.call(t,n)&&MN(e,n,t[n]);return e};let Mk=rc.createContext();function MB({children:e,dictionary:t}){let{options:n}=Mm(),{events:r}=MA(),[i,a]=rc.useState(n.language),o=rc.useCallback((e,n)=>(function e(t,n,r,i){var a,o,s,l,u,c,h,d,p,f,m,g,v;if(Array.isArray(n)){let u=n.length?n.join(";;")+";;":"",c=null!=(s=null==(a=t[u])?void 0:a[r])?s:null==(o=t[u])?void 0:o.en,h=c?c.split(";;"):n.map(n=>e(t,n,r));return null!=(l=null!=h?h:i)?l:n}let y=String(n),b=y&&`${y.slice(0,50)}${y.length>50?"...":""}`;return null!=(v=null!=(g=null!=(m=null!=(p=null!=(h=null==(u=t[b])?void 0:u[r])?h:null==(c=t[b])?void 0:c.en)?p:null==(d=t[n])?void 0:d[r])?m:null==(f=t[n])?void 0:f.en)?g:i)?v:n})(t,e,i,n),[t,i]),s=rc.useMemo(()=>({selectedLanguage:i,languages:Object.values(t).reduce((e,t)=>(Object.keys(t).forEach(t=>e.add(t)),e),new Set(["en"])),setLanguage:a,getText:o}),[t,i,o]);return rc.useEffect(()=>{r.on("Dictionary#SetLanguage",e=>{a((e.language||n.language||"en").toLowerCase())})},[r,n.language]),rc.useEffect(()=>{setTimeout(()=>{r.emit("Map#LanguageChanged",{language:i,getText:o})},50)},[i,o,r]),rc.createElement(Mk.Provider,{value:s},e)}function MF(){let e=rc.useContext(Mk);if(!e)throw Error("useDictionary must be used within a DictionaryProvider");return e}function Mz(e){var t;class n extends rc.Component{render(){let t=this.props,{forwardedRef:n}=t,r=((e,t)=>{var n={};for(var r in e)ML.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&MO)for(var r of MO(e))0>t.indexOf(r)&&MD.call(e,r)&&(n[r]=e[r]);return n})(t,["forwardedRef"]);return rc.createElement(Mk.Consumer,null,t=>rc.createElement(e,MU(MU({ref:n},r),t)))}}return MN(n,"symbol"!=typeof(t="displayName")?t+"":t,"withDictionaryConsumer"),rc.forwardRef((e,t)=>rc.createElement(n,MP(MU({},e),MI({forwardedRef:t}))))}var MH=Object.defineProperty,Mj=(e,t,n)=>(((e,t,n)=>t in e?MH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),n);class MW{constructor(e){Mj(this,"openingHours",{su:[],mo:[],tu:[],we:[],th:[],fr:[],sa:[],ph:[]}),Mj(this,"weekdays",{mo:"Monday",tu:"Tuesday",we:"Wednesday",th:"Thursday",fr:"Friday",sa:"Saturday",su:"Sunday",ph:"Public Holidays"}),e=e||"",this.parseHours(e)}getTable(){return this.openingHours}timeToOpen(e){let t=e.getDay(),n=60*e.getHours()+e.getMinutes(),r=Object.entries(this.openingHours).filter(e=>"ph"!==e[0]),i=r.slice(t).concat(r.slice(0,t));for(let e of i){let t=i.indexOf(e),r=this.parseTimes(e[1]).sort((e,t)=>e.open-t.open);if(0===t&&e[1].includes("00:00-24:00"))return 0;let a=r.find(({open:e})=>e>=n);if(0===t&&a&&a.open)return a.open-n;let o=r[0]?r[0].open:null;if(0!==t&&Number.isFinite(o))return 24*t*60-n+o}let a=i[0]&&i[0][1];return 0!==a.length?8640+(1440-n)+this.parseTimes(a).sort((e,t)=>e.open-t.open)[0].open:1/0}timeToClose(e){let t=e.getDay(),n=60*e.getHours()+e.getMinutes(),r=Object.entries(this.openingHours).filter(e=>"ph"!==e[0]),i=r.slice(t).concat(r.slice(0,t));for(let e of i){let t=i.indexOf(e),r=this.parseTimes(e[1]).sort((e,t)=>e.close-t.close);if(0===t&&0===e[1].length)return 0;let a=r.find(({close:e})=>e>=n);if(0===t&&a&&a.close)return a.close-n;let o=r[0]?r[0].close:null;if(0!==t&&Number.isFinite(o))return 24*t*60-n+o}let a=i[0]&&i[0][1];return 0===a.length||a.includes("00:00-24:00")?1/0:8640+(1440-n)+this.parseTimes(a).sort((e,t)=>e.close-t.close)[0].close}isOpenOn(e){let t=e.getDay(),n=60*e.getHours()+e.getMinutes();return Object.values(this.openingHours)[t].some(e=>{let[t,r]=e.split("-").map(e=>{let[t,n]=e.replace("+","").split(":");return 60*parseInt(t)+parseInt(n)});return(r||(r=1440),r<t)?n<r||t<n&&n<1440:t<n&&n<r})}isOpenNow(){return this.isOpenOn(new Date)}parseTable(e){this.openingHours=e}parseHours(e){(e=this.simplify(e)).split(";
341").forEach(e=>{this.parseHardPart(e)}),!1!==this.valid&&(this.valid=!0)}simplify(e){return"24/7"===e?"mo-su 00:00-24:00; ph 00:00-24:00":e.trim().toLowerCase().replace(/–/g,"-").replace(/&/g,",").replace(/\s{0,}([:;,+-])\s{0,}/g,"$1").replace(/\s{2,}/g," ")}parseHardPart(e){"24/7"===e&&(e="mo-su 00:00-24:00");let t=e.trim().split(/ |,/),n={},r=[],i=[];t.forEach(e=>{let t=this.checkDay(e),a=this.checkTime(e);t||a||(this.valid=!1),t&&(0===i.length?r=r.concat(this.parseDays(e)):(r.forEach(e=>{n[e]?n[e]=n[e].concat(i):n[e]=i}),r=this.parseDays(e),i=[])),a&&("off"===e?i=[]:i.push(e))}),0===r.length&&0!==i.length&&(r=["mo","tu","we","th","fr","sa","su"]),r.forEach(e=>{n[e]=n[e]?n[e].concat(i):i}),Object.entries(n).forEach(([e,t])=>this.openingHours[e]=Array.from(t))}parseDays(e){let t=[];return e.split(",").forEach(e=>{0===(e.match(/-/g)||[]).length?t.push(e):t=t.concat(this.calcDayRange(e))}),t}calcDayRange(e){let t={su:0,mo:1,tu:2,we:3,th:4,fr:5,sa:6},n=e.split("-"),r=t[n[0]],i=t[n[1]],a=this.calcRange(r,i,6),o=[];return a.forEach(e=>{for(let n in t)t[n]===e&&o.push(n)}),o}calcRange(e,t,n){if(e===t)return[e];let r=[e],i=e;for(;i<(e<t?t:n);)i++,r.push(i);return e>t&&(r=r.concat(this.calcRange(0,t,n))),r}checkTime(e){return!!(e.match(/^[0-9]{1,2}:[0-9]{2}\+$/)||e.match(/^[0-9]{1,2}:[0-9]{2}-[0-9]{1,2}:[0-9]{2}$/)||e.match(/^off$/))}checkDay(e){let t=new Set(Object.keys(this.weekdays));return!!(e.includes("-")&&e.split("-").every(e=>t.has(e))||t.has(e))}parseTimes(e){return e.map(e=>{let[t,n]=e.split("-").map(e=>{let[t,n]=e.replace("+","").split(":");return 60*parseInt(t)+parseInt(n)});return(Number.isFinite(n)||(n=1440),0===t&&1440===n)?{open:null,close:null}:{open:t,close:n}})}}var MG=Object.defineProperty,MV=Object.defineProperties,MX=Object.getOwnPropertyDescriptors,Mq=Object.getOwnPropertySymbols,MY=Object.prototype.hasOwnProperty,MZ=Object.prototype.propertyIsEnumerable,M$=(e,t,n)=>t in e?MG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MK=(e,t)=>{for(var n in t||(t={}))MY.call(t,n)&&M$(e,n,t[n]);if(Mq)for(var n of Mq(t))MZ.call(t,n)&&M$(e,n,t[n]);return e},MJ=(e,t)=>MV(e,MX(t));let MQ=(e,t=!0)=>{let n=Mr.styles[e];return t&&(n||console.log(`Default styles used for the ${e}`)),n||{}};function M0({ordinals:e,getText:t}){e.forEach(e=>{var n;e.display={name:t(null!=(n=e.options.name)?n:e.name)},e.occupants&&e.occupants.forEach(e=>{let n=t(e.rawProperties.name),r=t(e.category.name),i=e.extraCategories.map(e=>t(e.name)),a=e.rawProperties.hours;e.display={name:n||r||"",description:t(e.rawProperties.description)||"",area:t(e.rawProperties.area)||"",zone:t(e.rawProperties.zone)||"",url:t(e.rawProperties.url)||"",website:t(e.rawProperties.website)||"",email:t(e.rawProperties.email)||"",hours:t(a)||"",phone:t(e.rawProperties.phone)||"",category:r||"",extraCategories:i,keywords:e.rawProperties.keywords?t(e.rawProperties.keywords):[]};let o=a&&new MW(a);if(o&&o.valid){let n=o.getTable();e.display.hoursTable=Object.entries(n).reduce((e,[n,r])=>(e[n]={dayName:t(o.weekdays[n]),times:r},e),{}),e.getOpeningState=e=>{if(!e)throw Error('You must pass the "venueDateTime" as an argument to get the opening state of the occupant');let r=o.isOpenOn(e),i=o.timeToOpen(e),a=o.timeToClose(e),[s,l]=Object.entries(n)[e.getDay()],u=r?"Open":"Closed";return r&&a<=30&&(u="Closing soon"),!r&&i<=30&&(u="Opening soon"),0===n[s].length&&(u="Closed today"),{state:u,stateName:t(u),today:{day:s,dayName:t(o.weekdays[s]),times:l}}}}e.marker&&(e.marker.titleText=e.display.name),e.omniOrdinal&&(Mr.occupantsMap.get(e.id).display=e.display)}),e.levels&&e.levels.forEach(e=>{e.display={name:t(e.name),shortName:t(e.shortName)},e.building&&(e.building.display={name:t(e.building.name)})})})}var M1=Object.defineProperty,M2=Object.defineProperties,M3=Object.getOwnPropertyDescriptors,M5=Object.getOwnPropertySymbols,M4=Object.prototype.hasOwnProperty,M6=Object.prototype.propertyIsEnumerable,M8=(e,t,n)=>t in e?M1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M7=(e,t)=>{for(var n in t||(t={}))M4.call(t,n)&&M8(e,n,t[n]);if(M5)for(var n of M5(t))M6.call(t,n)&&M8(e,n,t[n]);return e},M9=(e,t)=>M2(e,M3(t));let Ee={name:"Default",fullName:"Default",fullPath:["Default"],dotScale:1,iconScale:1,titleScale:1,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAABGdBTUEAALGPC/xhBQAACxZJREFUeAHtXTlsFkcYXZsbY2zCIWSwQC5iAuFQQApCSoSNRIhEpBwVDZKbiAaFKk3qNEkDchPRINFQhVBQQCRslEiWLeEoCGMwh5E5LM5gsM1hwOS9n13jmT3+2Z1jf/D/Sau9Zr7vm/d2jp2ZnfW8spQRKCNQRiA3BCpys1zE8JkzZ2YMDw83vn79uhFBg60B5zUVFRXV2FfjOjfKMK4N4xr3j3Dej62PG877qqur+zZt2vQC5yUnJUMAwKs8ffr0J9g3AaVm7D/DvsoQYqMg4m/oasO+fevWrf9gP25It5aa3Aloa2vbiBTsxrYLoC/WSo1iZIB/D0GPYDvc3NzcrRjNSrBcCOjs7Jw/Ojr6PVLUgm21lZSpK+1F0ENVVVUHN2/e/Fg9mpmQTgno6Oj44NmzZ/vg+l487bVmkmBGC3LFEDS1zp49e/+WLVv+M6O1uBYnBJw9e7bqwYMHP8EdAj+vuFv5hQARI7DeunDhwp/Xr18/atsT6wSgjP8WidgP4OttJ8akfhBxA/r2oY44alKvrMsaAadOnVqBRPwG4HfIRt+lc6ThBNKwZ9u2bQM2/LZCQHt7+9dw+hC2kirnswIIEoawtTQ1NR3LqiMunlECzp8/P/P27du/wNgPcQbf8esHli5d+uOaNWvGTKXDGAF46hfhiT+O7VNTzpWiHuSELmw7kRvum/DPCAEs7+HMn9g+NOFUqesAAX140L4wUS9
341U6iYWT/7H0NGBbUqAT7wAPvumOvy081Jm0coBdADO/IVtQWYP3uGIyAkPsX2O4qgnazIyE+AXO3zy67Iaf0/iDSIdW7IWR5mKIFa4MMoyf6qDz2eoDrngpI8Jz1NJagLY1ESRcxxWpkyZXwxR1gnEhNgUCyvfT00A2/kw9l43NWWQVM6Jif8OpBJ8IkyqOgDZ7Ovx8fE/JmI7PEB3sbdo0SKP+1mzZhW2mTPfPHBjY2Pe8+fPCxu6ub379+973OchlZWV36R5Y1YmwO/b+RdMO+teINh1dXUF4OfMmZMKz6dPnxaIGBwcdEoG6oMhYLRBtVKerpoqKGbHmhPw+YQ3NDR4eO33YFfVRSEcCauvr/eWL1/uoWjw+vv7CzlECGThhBgRK6j+UkW9UurYpQzFv6so1AlDsAk8gUNW1lEVivvq1Svv5s2bBSKQltB90xeQlu9UurKLEuAPplyA01b782fMmOGtXbvWq621m8mGhoa8c+fOeS9e2J0kAQJuYFDno2KDOkUfM45k2QafZT2mjVgHn085CaYt2rQpxMwfBUw0k5gD/DHcASizNoxIIDZu3OhNn65cHSUmSPXmy5cvve7ubqsVNHLBCMaYVySNMSfmAA6g2wSfxc66deucg0+SSDht0wdbQuz8SQixJmIJ4NQRxNobG1PzBitclvlpm5eaZoXotE0f6ItF2etjGWkilgDO2wGD1mpEtnZsV7iRKZYu0gf6YkuIoT8HKtJELAEI3RIZw8BFtvPZPi8VoS/0yaLEYhlJgD9d0NqMNT5x06ZNs5jedKrpi81cAG9W+5iGHIskAKE4V9OKsNXDN9xSE/pkuWkaiWmIAJRZvLbLFkDs27Fc6WVynT7RN4vCycchvEMX/Cni1mYps0ezVMWmbwB/MbGV0x4iAAGb5ECmzpnFTTU7g95Odj3z2ITQN5vFUBS2Ua+fzSYSE6Vj8WL9jEWwL1686D18+FAwsWDBAm/VqlXaBNNHi2MJxPbXyY4LOYCfBYElfpliRebOnaulF30rXldXVwh8KiUhvMcwOqLrY5JtYkuMJ4cRCOA3WbhprZdKp63N3ssLFy54GJGb7L9wzHsMo9PTqeOj4Ez0SZWP8cRdgQAwRAKsiU7irl275nHosZgwDMNmFR0fVWzKGAsEQIFVAoIxXBVH5TBpipY0YWU7Oj7KumLOBYydEhDjkNJl9CoqhWOgNGGVlZoLmEhAgzk7YU0qRUg41psracYL0oSV7en4KOuKORcwFnIAyqeamEhGLuu012tq1F1LE1ZOmI6Psq6ocxljgQC8jldHRTJ1jeOxWWXlypVKXRjsUmDYrKLjo4pNGWOBALBjlQD55UnF4SDM/PnzvRUr+BlCsjAMw2YVHR9VbMoYCwRAgVUCHj9+rNSUjEsIu4wbGxsju7LZpcx7Ot3KLP/po2URMI7qirBq/86dO4V5P1mNLFu2rDBT7u7du97IyEhBzbx587wlS5ZoD6rQN9ciEzAMBxbadIKz1DjxSkf4sqSrI8o+fXMgxHhChCIIFYRwcyKUwQO8invcSk1c+SVjLBCACsIJMjdu8CP00hJXPskYCwSAHS52ZF1Y1nI6eakIfXFV/ssYCwQAkH4XoOAp8Fw9cSrpoS/0yZEIGMsEcJkvJ8KZyg5e+4umhT7QF4ciYJwbAey7L4VcQB+SxhgsEBNPAMon4aYF44LKvHNBDk8/u1MEjIUcwNUFgZCzj6v40YTO4InAZoYT2qYPDmXUx3jCpEAAl3YEQ1xd0JnwG64nT544sxcYok3adinEVl4+UyDAd6bNpVNsfVy5csWlyYIt2nTY8gnSF8I2RABYag9Cu9pzbo/OMGJaP2mLNl1LFLYhAvxFTbmuplO5dOmSk9YIWzy05VoA/j1iK9sNEYCA4wh0RA5o+5wjUQMDA7bNFGzYHvWKScQRH1vhdogA/+5hIZSjExJgExxXJMfAFYlpJAH+cr5cUdapsHi4fPmyNZvU7filK0hLb9wSyZEE+LEOBbFd7lk52qggbelVxCYWy1gCMEv4IMqs7KPoip5FBWMlafIFibryqHiZNmJILKPSyWuxBPgLWbfGRbR5nROrrl69aswEdeU4Was1aVHwWAKYei5kDQbfDLwag0NNEfuJHj3SH56gDse9nRMJJHbEcOJCxEEiAf4X3rnkAvrKmc46RRHjUkeO0pr0lTz9SiSAAbiKOJjMZQyR/TU6nXWMm0c/E3EjZsSOx0lSlAB/tY99SUps3rt+/XqmoohFD+PmKPuKrZRC34oSwEBowx4Foyd4nIf09vamKopY9DBOXkKsiJmKfSUCqAg9h3ugOJdmKd9g0/SYMqzNN+okYIkRsUoKM/meMgFcAw3KWyZHdnl869YtpR5T9nQybF5CjFTXi6OPygQwsL8a4AEe5yFs0SQN5PNezq2eA2lWTCSGqQhgBK6fD5a7eOxaCDA/UY0T3ksiKC6eievApJPYpNWVmgD+vADGdsKQ+051GGWfTtSLFa/Z6ENSBPQSMPkqy48dUhNAh5DNOJy0HZvbQVUah7CSDWZG85zHaSppxjEoxGC7j0lqtZkIoBVWNPgWaweYFz9ZT+1C+gjsUu7p6Sk0Tdnk5HEe3cxMO5bX1PqRQ0X65Isx+A8BJP4krtaJd+yfBcveOJpWLidokODjye+Rb6Q51yaAxqbaL0yQZNZ/29M0N4lTlBghgIq5fj5eQKbCT3w6WeFmLfNlEowRQMXl31jJ8BY/N0pAYI7L3CM3HMJWG1x7l/d44q39yC1zKygJUGTPYwB/AxzPrQMvyb8095gGpoVpShNPNayVHDDZePlnnpPRCB9bJ4Amy7+zDQMfXHFCQGCs/EPnAIm3e6cEBGbLvzQPkMDQ5dvDfI78FWV3wzrX1dRf1U8hGahYOfmY818PY+SqWyGKtSC5ExCkDOBX+muWNuFaM865eKCp9etGATo/PGnDvt2fAc5JyLlLyRAgI8HVBbnAHYjgClPB1oDzGoBYjT0XvQgWvhjGtWFc456Tifqx8XOrPpz38bMg+csU3CtLGYEyAmUEpjoC/wPb+bzkQH8GbgAAAABJRU5ErkJggg==",color:"#bdbdbd",dotMinZoom:1e3,iconMinZoom:1e3,titleMinZoom:1e3,showInCategoriesList:!1,showInSearchResult:!1,priority:0,clickable:!0,poiType:"occupants",display:{name:"Default",fullName:"Default",fullPath:["Default"]},occupants:[]},Et=rc.createContext(),En=(e,t,n=[],r=[])=>e.reduce((e,i)=>{let{normalized:a,flatten:o}=e,s=[...r,i.id],l=[...n,i.name],u=l.join(" - "),c=i.subCategories?En(i.subCategories,t,l,s):void 0,h=M9(M7(M7({},t),i),{subCategories:c&&c.normalized,fullPathIds:s,fullPath:l,fullName:u,occupants:[],display:{name:i.name,fullPath:l,fullName:u}});return{normalized:[...a,h],flatten:c?[...o,...c.flatten,h]:[...o,h]}},{normalized:[],flatten:[]});function Er({categories:e,children:t}){let{getText:n}=MF(),{events:r}=MA(),i=rc.useMemo(()=>{let t=e?e.find(e=>"Default"===e.name):{},n=M7(M7({},Ee),t),r=M9(M7({},n),{isDefault:!0}),{normalized:i=[],flatten:a=[]}=e?En(e,n):{},o=new Map(a.map(e=>[e.id,e]));return{categories:i,categoriesFlatten:a,getCategory:e=>o.get(e)||r}},[e]);return rc.useEffect(()=>
341{i&&i.categoriesFlatten.forEach(e=>{let{fullPath:t,keywords:r}=e,i=t.map(e=>n(e)),a=r?n(r):[];e.display={name:n(e.name),fullPath:i,fullName:i.join(" - "),keywords:a}})},[i,n]),rc.useEffect(()=>{i&&setTimeout(()=>{r.emit("Categories#Updated",{categories:i.categories,categoriesFlatten:i.categoriesFlatten})},100)},[i,r]),rc.createElement(Et.Provider,{value:i},t)}function Ei(e){var t;class n extends rc.Component{render(){let t=this.props,{forwardedRef:n}=t,r=((e,t)=>{var n={};for(var r in e)M4.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&M5)for(var r of M5(e))0>t.indexOf(r)&&M6.call(e,r)&&(n[r]=e[r]);return n})(t,["forwardedRef"]);return rc.createElement(Et.Consumer,null,t=>rc.createElement(e,M7(M7({ref:n},r),t)))}}return M8(n,"symbol"!=typeof(t="displayName")?t+"":t,"withCategoriesConsumer"),rc.forwardRef((e,t)=>rc.createElement(n,M9(M7({},e),{forwardedRef:t})))}var Ea=Object.defineProperty,Eo=Object.defineProperties,Es=Object.getOwnPropertyDescriptors,El=Object.getOwnPropertySymbols,Eu=Object.prototype.hasOwnProperty,Ec=Object.prototype.propertyIsEnumerable,Eh=(e,t,n)=>t in e?Ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ed=(e,t)=>{for(var n in t||(t={}))Eu.call(t,n)&&Eh(e,n,t[n]);if(El)for(var n of El(t))Ec.call(t,n)&&Eh(e,n,t[n]);return e},Ep=(e,t)=>Eo(e,Es(t)),Ef=(e,t,n)=>(Eh(e,"symbol"!=typeof t?t+"":t,n),n);let{Provider:Em,Consumer:Eg}=rc.createContext(),Ev=class extends rc.Component{constructor(e){super(e),Ef(this,"init",e=>{if(Ev.mapInitialized)return;Ev.mapInitialized=!0;let{options:t,categories:n,categoriesFlatten:r,events:i,mapEngine:a}=this.props,{activeOrdinal:o,mapProjection:s,ordinals:l}=this.state;if(!o)throw Error("The active ordinal has to be exist");let u={mapProjection:s,ordinal:t.ordinal,center:t.center,minZoom:t.minZoom,maxZoom:t.maxZoom,zoom:t.zoom,zoomSpeed:t.zoomSpeed,minRotation:t.minRotation,maxRotation:t.maxRotation,rotation:t.rotation,rotationSpeed:t.rotationSpeed,minTilt:t.minTilt,maxTilt:t.maxTilt,tilt:t.tilt,maxBounds:t.maxBounds,damping:t.damping,dampingFactor:t.dampingFactor,mapGroups:[o.mapOrdinal],backgroundColor:t.backgroundColor,basemap:t.basemap,markersProvider:t.markersProvider,debug:t.debug},c=new a.default(e,u);c.addEventListener("ready",()=>{this.setState({map:c,mapLoaded:!0},()=>{this.filterOrdinalObjects(o),setTimeout(()=>{this.props.events.emit("PCMap#Initialized",{ordinals:l,categories:n,categoriesFlatten:r})},100)})}),c.addEventListener("centerChange",({center:e})=>{this.center=e,i.emit("Map#ViewChange",{center:e})});let h=({zoom:e})=>{this.zoom=e,i.emit("Map#ZoomChange",{zoom:e})};c.addEventListener("zoomChangeSequence",h),c.addEventListener("zoomChange",h);let d=({rotation:e,user:t})=>{t&&"heading"===this.state.followMeMode&&this.state.setFollowMeMode(!1),this.rotation=e,i.emit("Map#RotationChange",{rotation:e})};c.addEventListener("rotationChangeSequence",d),c.addEventListener("rotationChange",d);let p=({tilt:e})=>{this.tilt=e,i.emit("Map#TiltChange",{tilt:e})};c.addEventListener("tiltChangeSequence",p),c.addEventListener("tiltChange",p),c.addEventListener("userPanning",()=>{this.state.followMeMode&&this.state.setFollowMeMode(!1)}),c.addEventListener("click",e=>{let{activeOrdinalId:t}=this.state,n=e.originalEvent.composedPath().some(e=>{var t;return null==(t=e.classList)?void 0:t.contains("pcmap-marker")});delete e.originalEvent,delete e.target,this.props.events.emit("Map#Click",Ep(Ed({},e),{isClickOnMarker:n,ordinal:t})),n||(this.state.setSelectedOccupants([]),this.state.setFollowMeMode(!1))}),i.on("Map#Dispose",()=>{let{events:e}=this.props,{map:t}=this.state;t&&t.dispose(),e.removeAllListeners(),Mr.dispose(),Ev.ordinals=null,Ev.mapInitialized=!1}),i.on("Map#SetZoom",({zoom:e,options:t})=>{let{map:n}=this.state;return n?Number.isFinite(e)?void n.setZoom(e,t):void console.error("Provide a valid zoom level"):void console.error("Map was not intialized")}),i.on("Map#SetZoomRange",({min:e,max:t,options:n})=>{let{options:{minZoom:r,maxZoom:i}}=this.props,{map:a}=this.state;if(!a)return void console.error("Map was not intialized");let o=Number.isFinite(e)?e:r,s=Number.isFinite(t)?t:i;a.setZoomRange(o,s,n)}),i.on("Map#SetRotation",({rotation:e,options:t})=>{let{map:n}=this.state;return n?Number.isFinite(e)?void n.setRotation(e,t):void console.error("Provide a valid rotation angle"):void console.error("Map was not intialized")}),i.on("Map#SetRotationRange",({min:e,max:t,options:n})=>{let{options:{minRotation:r,maxRotation:i}}=this.props,{map:a}=this.state;if(!a)return void console.error("Map was not intialized");let o=Number.isFinite(e)?e:r,s=Number.isFinite(t)?t:i;a.setRotationRange(o,s,n)}),i.on("Map#SetTilt",({tilt:e,options:t})=>{let{map:n}=this.state;return n?Number.isFinite(e)?void n.setTilt(e,t):void console.error("Provide a valid tilt angle"):void console.error("Map was not intialized")}),i.on("Map#SetTiltRange",({min:e,max:t,options:n})=>{let{options:{minTilt:r,maxTilt:i}}=this.props,{map:a}=this.state;if(!a)return void console.error("Map was not intialized");let o=Number.isFinite(e)?e:r,s=Number.isFinite(t)?t<90?t:90:i;a.setTiltRange(o,s,n)}),i.on("Map#SetView",({center:e,options:t={}})=>{let{map:n}=this.state;return n?e&&Number.isFinite(e[0])&&Number.isFinite(e[1])?void this.state.setView(e,t):void console.error("Provide a valid center coordinates"):void console.error("Map was not intialized")}),i.on("Ordinal#Show",({ordinalId:e,applyOrdinalOptions:t})=>{let{mapLoaded:n,ordinals:r,setActiveOrdinal:i,applyOrdinalOptions:a}=this.state,o=r.get(e);return n?o?void(i(o.id,{fitMap:!1}),t&&a(o)):void console.error("Ordinal was not found"):void console.error("Map was not intialized")}),i.on("GeoData#Update",()=>{this.setState({geoDataTimestamp:Date.now()})}),i.on("Map#SelectOccupants",({occupants:e,callback:t})=>{let{ordinals:n}=this.state;this.state.setSelectedOccupants(null!=e?e:[]),t&&t(Array.from(n.values()).flatMap(e=>e.occupants).filter(t=>e.includes(t.id)))}),i.on("Map#Filter",({predicate:e})=>{let{activeOrdinal:t}=this.state;this.setState({filterMapObjectsPredicate:e},()=>{this.filterOrdinalObjects(t)})}),i.on("Map#Dim",({predicate:e})=>{let{map:t}=this.state;t.dimMapObjects(e)}),i.on("Map#Hide3dBuildings",()=>{let{map:e}=this.state;("MapboxEngine"===e.type||"MapsIndoorsEngine"===e.type)&&e.hideBasemapBuildings()}),i.on("Map#GetMapbox",e=>{let{map:t}=this.state;("MapboxEngine"===t.type||"MapsIndoorsEngine"===t.type)&&e(t.basemap)}),i.on("Map#Show3dBuildings",()=>{let{map:e}=this.state;("MapboxEngine"===e.type||"MapsIndoorsEngine"===e.type)&&e.showBasemapBuildings()}),i.on("Map#CaptureScreenshot",({onComplete:e})=>{let{map:t}=this.state;t.captureScreenshot({onComplete:e})})}),Ef(this,"filterOrdinalObjects",e=>{let{map:t,filterMapObjectsPredicate:n}=this.state,r=this.zoom;e.mapOrdinal.filterMapObjects((e,t)=>{let{type:i}=e;return i&&"function"==typeof n?n(Ep(Ed({},e),{zoom:r,visible:t})):t}),t.refresh()}),Ef(this,"showOrdinal",(e,t)=>{let{map:n,activeOrdinalId:r,activeOrdinal:i,ordinals:a}=this.state,{fitMap:o=!1}=t;if(!n||r===e)return;let s=a.get(e);s&&(i&&n.removeMapGroup(i.mapOrdinal),n.addMapGroup(s.mapOrdinal),o&&n.fitBounds(s.bounds))});let t=new e.mapProjection.default({origin:e.options.center}),n=Ev.ordinals;n||(console.time("Create ordinals"),n=function({mapProjection:e,getCategory:t,ordinalsOptions:n}){let{basemap:r,buildings:i}=Mr.ordinals.values().next().value,a=function(e,{mapProjection:t}){let n=[];
341return e.forEach(e=>{let r=MQ(e.category);(r.floor||r.roof||r.walls)&&(e.buffers?e.mapObject=new wF(e.buffers,{styles:r,userData:{id:e.id,category:e.category,type:"basemap"}}):e.geometry&&(e.mapObject=new hw(e.geometry,{mapProjection:t,styles:r,userData:{id:e.id,category:e.category,type:"basemap"}})),n.push(e.mapObject))}),n}(r,{mapProjection:e}),o=function(e,{mapProjection:t}){let n=[];return e.forEach(e=>{let r=MQ(e.category);(r.floor||r.roof||r.walls)&&(e.buffers?e.mapObject=new wF(e.buffers,{styles:r,userData:{id:e.id,category:e.category,type:"building"}}):e.geometry&&(e.mapObject=new hw(e.geometry,{mapProjection:t,styles:r,userData:{id:e.id,category:e.category,type:"building"}})),n.push(e.mapObject))}),n}(i,{mapProjection:e});return Mr.ordinals.forEach(r=>{var i;r.mapOrdinal=new wX,function(e,t,{mapProjection:n,getCategory:r}){e&&e.forEach(e=>{e.category=r(e.categoryId),e.extraCategories=e.extraCategoryIds.map(r).filter(e=>!e.isDefault),e.omniOrdinal?(e.category.occupants.every(t=>t.id!==e.id)&&e.category.occupants.push(e),e.extraCategories.forEach(t=>{t.occupants.every(t=>t.id!==e.id)&&t.occupants.push(e)})):(e.category.occupants.push(e),e.extraCategories.forEach(t=>{t.occupants.push(e)})),e.omniOrdinal&&(Mr.occupantsMap.get(e.id).category=e.category),e.category.poiType&&(e.isPoint="amenities"===e.category.poiType);let i=new wE(e.coordinates,{title:e.rawProperties.name,category:e.category.id,icon:e.icon||e.category.icon,color:e.color||e.category.color,dotScale:e.category.dotScale,iconScale:e.category.iconScale,titleScale:e.category.titleScale,flippable:e.flippable,scalable:e.scalable,rotateX:e.rotateX,rotateY:e.rotateY,rotateZ:e.rotateZ,height:e.height,mapProjection:n});i.addClass(`pcmap-marker-${e.id}`),i.addClass(`pcmap-category-${e.category.id}`),e.isPoint&&i.addClass("pcmap-marker-point"),i.interactive=e.category.clickable,e.marker=i,t.add(i)})}(r.occupants,r.mapOrdinal,{mapProjection:e,getCategory:t}),o.forEach(e=>{r.mapOrdinal.add(e)}),a.forEach(e=>{r.mapOrdinal.add(e)}),function(e,t,{mapProjection:n}){e.forEach(e=>{if(["__outdoor-level__","__dynamic__"].includes(e.id))return;let r=MQ(e.category);if(e.buffers)e.mapObject=new wF(e.buffers,{styles:r,userData:{id:e.id,category:e.category,type:"level"}});else if(e.geometry){let t=[];r.walls&&!r.solid&&e.openingIds&&e.openingIds.forEach(e=>{let n=Mr.openings.get(e);if(!n)return void console.warn(`Opening ${e} was not found`);t.push(n)}),e.mapObject=new hw(e.geometry,{mapProjection:n,styles:r,doors:t,userData:{id:e.id,category:e.category,type:"level"}})}t.add(e.mapObject),function(e,t,n,{mapProjection:r}){if(!e)return;let i=(e=e&&Array.from(e.values())).some(e=>e.buffers);e.forEach(e=>{var a;let o=["walkway","walkway_airside"].includes(null==(a=null==e?void 0:e.category)?void 0:a.toLowerCase());if(o&&!i)return;let s=MQ(e.category);if(e.occupants&&!o&&(s=e.occupants.reduce((e,t)=>{if(!t.category)return e;let n=MQ(t.category.id,!1),r=MQ(t.category.fullName,!1);return MJ(MK(MK(MK({},e),n),r),{priority:e.priority})},s)),s.floor||s.roof||s.walls){if(e.buffers)e.mapObject=new wF(e.buffers,{styles:s,userData:{id:e.id,category:e.category,type:"unit"}});else if(e.geometry){let n=[];s.walls&&!s.solid&&t&&e.openingIds&&e.openingIds.forEach(e=>{let t=Mr.openings.get(e);if(!t)return void console.warn(`Opening ${e} was not found`);n.push(t)}),e.mapObject=new hw(e.geometry,{mapProjection:r,styles:s,doors:n,userData:{id:e.id,category:e.category,type:"unit"}})}n.add(e.mapObject)}})}(e.units,e.openings,t,{mapProjection:n}),function(e,t,n,{mapProjection:r}){e&&e.forEach(e=>{let i=MQ(`${e.category}${e.subCategory?"-"+e.subCategory:""}`);if(i.floor||i.roof||i.walls){if(e.buffers)e.mapObject=new wF(e.buffers,{styles:i,userData:{id:e.id,category:e.category,type:"section"}});else if(e.geometry){let n=[];i.walls&&!i.solid&&t&&e.openingIds&&e.openingIds.forEach(e=>{let t=Mr.openings.get(e);if(!t)return void console.warn(`Opening ${e} was not found`);n.push(t)}),e.mapObject=new hw(e.geometry,{mapProjection:r,styles:i,doors:n,userData:{id:e.id,category:e.category,type:"section"}})}n.add(e.mapObject)}})}(e.sections,e.openings,t,{mapProjection:n}),function(e,t,{mapProjection:n}
341){e&&e.forEach(e=>{var r;let i=MQ(e.category);if(i.floor||i.roof||i.walls){if(e.buffers)e.mapObject=new wF(e.buffers,{styles:i,userData:{id:e.id,category:e.category,type:"fixture"}});else if(e.geometry){if(e.originUnit){let t=MQ(e.originUnit.category);i=MJ(MK({},i),{priority:t.priority})}e.mapObject=new hw(e.geometry,{originGeometry:null==(r=e.originUnit)?void 0:r.geometry,mapProjection:n,styles:i,userData:{id:e.id,category:e.category,type:"fixture"}})}t.add(e.mapObject)}})}(e.fixtures,t,{mapProjection:n}),function(e,t,n,{mapProjection:r}){let i=MQ("Walkway");if(!e||(e=Array.from(e.values())).some(e=>e.buffers))return;let a=e&&e.filter(e=>{var t;return(null==(t=null==e?void 0:e.category)?void 0:t.toLowerCase())==="walkway"});if(a&&a.length&&i.walls){let e=new _3(a,t,{mapProjection:r,styles:i,userData:{id:a.map(({id:e})=>e),category:a[0].category}});n.add(e)}a&&(i.floor||i.roof)&&a.forEach(e=>{let t=new hw(e.geometry,{mapProjection:r,styles:MJ(MK({},i),{walls:!1}),userData:{id:e.id,category:e.category,type:"unit"}});n.add(t)})}(e.units,e.openings,t,{mapProjection:n})})}(r.levels,r.mapOrdinal,{mapProjection:e}),r.options=null!=(i=n.find(e=>e.id===r.id))?i:{},r.dispose=()=>{Object.getOwnPropertyNames(r).forEach(e=>{var t;"function"==typeof(null==(t=r[e])?void 0:t.dispose)&&r[e].dispose(),r[e]=null})}}),Mr.ordinals}({ordinalsOptions:e.options.ordinalsOptions,mapProjection:t,getCategory:e.getCategory}),console.timeEnd("Create ordinals"),M0({ordinals:n,getText:e.getText}),Ev.ordinals=n);let r=e.options.ordinal,i=n.get(r);this.center=e.options.center,this.zoom=e.options.zoom,this.tilt=e.options.tilt,this.rotation=e.options.rotation,this.state={map:null,mapLoaded:!1,mapProjection:t,ordinals:n,activeOrdinalId:r,activeOrdinal:i,geoDataTimestamp:Date.now(),initMap:this.init.bind(this),filterMapObjectsPredicate:null,setZoom:(e,t={})=>{let{map:n}=this.state;n&&n.setZoom(e,t)},setView:(...e)=>{let{map:t}=this.state;t&&(this.state.setFollowMeMode(!1),t.setView(...e))},fitPoints:(...e)=>{let{map:t}=this.state;t&&(this.state.setFollowMeMode(!1),t.fitPoints(...e))},refresh:()=>{let{map:e}=this.state;e&&e.refresh()},setActiveOrdinal:vA((e,t={})=>{let{map:n,ordinals:r,activeOrdinalId:i}=this.state,{callback:a,fitMap:o,keepFollowMeMode:s}=t;if(i===e){a&&a();return}s||this.state.setFollowMeMode(!1),"MapsIndoorsEngine"===n.type&&n.basemap.mapsIndoors.setFloor(e),this.showOrdinal(e,{fitMap:o}),this.filterOrdinalObjects(r.get(e));let l=r.get(e);this.setState({activeOrdinalId:e,activeOrdinal:l},()=>{a&&a(),this.props.events.emit("Map#OrdinalChanged",{ordinal:e,title:l.display.name})})},100),applyOrdinalOptions:e=>{var t,n,r;let{options:i}=this.props,{map:a}=this.state;if(!a)return;let o=null!=(t=e.options.center)?t:i.center,s=null!=(n=e.options.zoom)?n:i.zoom,l=null!=(r=e.options.rotation)?r:i.rotation;this.state.setView(o,{zoom:s,rotation:l})},selectedOccupants:[],setSelectedOccupants:e=>{let{options:t,events:n}=this.props,{selectedOccupants:r}=this.state;if(!g9(e,r)){if(t.unitFloorHighlighting){let n=e.map(e=>{var t;return null==(t=Mr.occupantsMap.get(e))?void 0:t.unit}).filter(e=>null==e?void 0:e.mapObject);r.map(e=>{var t;return null==(t=Mr.occupantsMap.get(e))?void 0:t.unit}).filter(e=>(null==e?void 0:e.mapObject)&&!n.includes(e)).forEach(e=>{e.mapObject.resetFloorColor()}),n.forEach(e=>{e.mapObject.floorColor=t.unitFloorHighlightColor})}this.setState({selectedOccupants:e},()=>{r.length&&n.emit("Occupants#Unselected",r),e.length&&n.emit("Occupants#Selected",e)}),this.state.setFollowMeMode(!1)}},followMeMode:!1,setFollowMeMode:e=>{e!==this.state.followMeMode&&(this.props.options.lockRotationInHeadingMode&&(this.state.map.rotationDisabled="heading"===e),this.props.options.lockPanningInFollowMeMode&&(this.state.map.panningDisabled=!!e),this.setState({followMeMode:e},()=>{this.props.events.emit("Map#ModeChange",{followMe:e})}))},pins:[],setPins:e=>this.setState({pins:e||[]})}}UNSAFE_componentWillUpdate(e,t){let{selectedLanguage:n,getText:r}=e,{ordinals:i}=t;n!==this.props.selectedLanguage&&M0({ordinals:i,getText:r})}componentDidUpdate(){let{events:e}=this.props;e.emit("Map#StateChanged",{ordinalId:this.state.activeOrdinalId,center:this.center,zoom:this.zoom,rotation:this.rotation,tilt:this.tilt})}componentWillUnmount(){let{events:e}=this.props;e.emit("Map#Dispose")}render(){let{children:e}=this.props;return rc.createElement(Em,{value:this.state},e)}};Ef(Ev,"ordinals",null),Ef(Ev,"mapInitialized",!1);let Ey=MC(Mz(Ei(Mg(Ev)))),Eb=e=>{class t extends rc.Component{render(){let t=this.props,{forwardedRef:n}
341=t,r=((e,t)=>{var n={};for(var r in e)Eu.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&El)for(var r of El(e))0>t.indexOf(r)&&Ec.call(e,r)&&(n[r]=e[r]);return n})(t,["forwardedRef"]);return rc.createElement(Eg,null,t=>rc.createElement(e,Ed(Ed({ref:n},r),t)))}}return Ef(t,"displayName","withMapConsumer"),rc.forwardRef((e,n)=>rc.createElement(t,Ep(Ed({},e),{forwardedRef:n})))};var Ex=Object.defineProperty,E_=Object.defineProperties,Ew=Object.getOwnPropertyDescriptors,EM=Object.getOwnPropertySymbols,EE=Object.prototype.hasOwnProperty,ES=Object.prototype.propertyIsEnumerable,ET=(e,t,n)=>t in e?Ex(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EA=(e,t)=>{for(var n in t||(t={}))EE.call(t,n)&&ET(e,n,t[n]);if(EM)for(var n of EM(t))ES.call(t,n)&&ET(e,n,t[n]);return e},EC=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ER=(e,t,n)=>(EC(e,t,"read from private field"),n?n.call(e):t.get(e)),EP=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},EI=(e,t,n,r)=>(EC(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),EO=(e,t,n)=>(EC(e,t,"access private method"),n);class EL{constructor(e){EP(this,eG),EP(this,eX),EP(this,eY),EP(this,e$),EP(this,eD,void 0),EP(this,eN,0),EP(this,eU,0),EP(this,ek,null),EP(this,eB,0),EP(this,eF,!1),EP(this,ez,null),EP(this,eH,{debug:!1,filter:!0}),EP(this,ej,void 0),EP(this,eW,void 0),EI(this,eH,EA(EA({},ER(this,eH)),e)),EI(this,ej,function(){let e=function(e=16){let t=null,n=Array(e).fill(0);return e=>(null===t&&(t=e),n.shift(),n.push(e),t=n.reduce((e,t)=>e+t,0)/n.length)}(16);return t=>e(t)}()),EI(this,eW,function(){let e=null,t=null;return n=>{(null===e||null===t)&&(e=n,t=n);let r=t-n;return e-=r=r<-180?r+360:r>180?r-360:r,t=n,e}}())}set gpsLocation(e){EI(this,eD,e),EO(this,eG,eV).call(this,e)}set routePoints(e){EI(this,ez,e?e.map(([e,t])=>new rY(e,t)):null)}}eD=new WeakMap,eN=new WeakMap,eU=new WeakMap,ek=new WeakMap,eB=new WeakMap,eF=new WeakMap,ez=new WeakMap,eH=new WeakMap,ej=new WeakMap,eW=new WeakMap,eG=new WeakSet,eV=function(e){let{latitude:t,longitude:n,heading:r,accuracy:i}=e,{filter:a,routeStickingThreshold:o=10}=ER(this,eH);if(!t||!n||!i)return;let s=EO(this,eX,eq).call(this,t,n);if(s&&s.distance<o?(EI(this,eN,s.point[0]),EI(this,eU,s.point[1]),EI(this,eB,i),EI(this,eF,!0)):(EI(this,eN,t),EI(this,eU,n),EI(this,eB,i),EI(this,eF,!1)),!y7(r)){let e=ER(this,eW).call(this,r);a&&(e=ER(this,ej).call(this,e)),EI(this,ek,e)}EO(this,e$,eK).call(this)},eX=new WeakSet,eq=function(e,t){var n;if(!(null==(n=ER(this,ez))?void 0:n.length))return null;let r=ER(this,ez),i=new rY(e,t),{closestPoint:a,distance:o}=r.reduce((e,t,n)=>{if(n===r.length-1)return e;let{closestPoint:a,distance:o}=hA(i,t,r[n+1]);return o<e.distance?{closestPoint:a,distance:o}:e},{closestPoint:null,distance:Number.MAX_VALUE});return a?{point:[a.x,a.y],distance:EO(this,eY,eZ).call(this,o)}:null},eY=new WeakSet,eZ=function(e){return 111139*e},e$=new WeakSet,eK=function(){let{onLocationChange:e}=ER(this,eH);e&&e(E_(EA({},ER(this,eD)),Ew({latitude:ER(this,eN),longitude:ER(this,eU),heading:ER(this,ek),accuracy:ER(this,eB),stickToRoute:ER(this,eF)})))};var ED=Object.defineProperty,EN=Object.defineProperties,EU=Object.getOwnPropertyDescriptors,Ek=Object.getOwnPropertySymbols,EB=Object.prototype.hasOwnProperty,EF=Object.prototype.propertyIsEnumerable,Ez=(e,t,n)=>t in e?ED(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EH=(e,t)=>{for(var n in t||(t={}))EB.call(t,n)&&Ez(e,n,t[n]);if(Ek)for(var n of Ek(t))EF.call(t,n)&&Ez(e,n,t[n]);return e},Ej=(e,t)=>EN(e,EU(t));let EW=rc.createContext();function EG(e){var t;class n extends rc.Component{render(){let t=this.props,{forwardedRef:n}=t,r=((e,t)=>{var n={};for(var r in e)EB.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&Ek)for(var r of Ek(e))0>t.indexOf(r)&&EF.call(e,r)&&(n[r]=e[r]);return n})(t,["forwardedRef"]);return rc.createElement(EW.Consumer,null,t=>rc.createElement(e,EH(EH({ref:n},r),t)))}}return Ez(n,"symbol"!=typeof(t="displayName")?t+"":t,"withUserLocationConsumer"),rc.forwardRef((e,t)=>
341rc.createElement(n,Ej(EH({},e),{forwardedRef:t})))}let EV=Eb(function(e){let{map:t,activeOrdinal:n,ordinals:r,children:i}=e,{options:a}=Mm(),{events:o}=MA(),[s,l]=rc.useState(null),[u,c]=rc.useState(null),[h,d]=rc.useState(null),p=rc.useRef(null);rc.useEffect(()=>{let e=({location:e})=>{var t,i;if(!e||!e.latitude||!e.longitude)return;let o=null!=(t=null==s?void 0:s.heading)?t:null,u=null==e?void 0:e.heading,c=Number.isFinite(u)?u:o,h=Ej(EH({},e),{ordinal:r.has(e.ordinal)?e.ordinal:null!=(i=null==n?void 0:n.id)?i:a.ordinal,heading:c});if(a.userPositionOnlyInVenue&&n){let t=n.venue.bounds,r=[e.latitude,e.longitude];h=t.containsPoint(r)?h:null}((null==h?void 0:h.latitude)!==(null==s?void 0:s.latitude)||(null==h?void 0:h.longitude)!==(null==s?void 0:s.longitude)||(null==h?void 0:h.ordinal)!==(null==s?void 0:s.ordinal)||(null==h?void 0:h.heading)!==(null==s?void 0:s.heading)||(null==h?void 0:h.accuracy)!==(null==s?void 0:s.accuracy))&&l(h)};return o.on("User#SetUserLocation",e),()=>{o.off("User#SetUserLocation",e)}},[o,a,n,r,s]),rc.useEffect(()=>{s&&(p.current||(p.current=new EL({filter:!a.disableHeadingFilter,routeStickingThreshold:a.routeStickingThreshold,onLocationChange:e=>{c(e)}})),p.current.routePoints=((e,t)=>{if(!e)return null;let n=e.steps.filter(n=>{var r;return n.routeIdx===(null!=(r=e.currentRouteIdx)?r:0)&&n.ordinal===t}).reduce((e,t)=>e.concat(t.points.flatMap(e=>e.coordinates)),[]);return n.length?n:null})(h,s.ordinal),p.current.gpsLocation=EH({accuracy:100},s))},[s,h,a]),rc.useEffect(()=>{o.emit("Map#StateChanged",{userLocation:s})},[o,s]),rc.useLayoutEffect(()=>{var e;let n=null==(e=null==t?void 0:t.container)?void 0:e.parentNode;n&&(u?n.classList.add("pcmap--user-location"):n.classList.remove("pcmap--user-location"))},[t,u]);let f=rc.useMemo(()=>[null==u?void 0:u.latitude,null==u?void 0:u.longitude,null==u?void 0:u.ordinal,null==u?void 0:u.accuracy].every(Number.isFinite)?{latitude:u.latitude,longitude:u.longitude,ordinal:u.ordinal,accuracy:u.accuracy,stickToRoute:u.stickToRoute}:null,[null==u?void 0:u.latitude,null==u?void 0:u.longitude,null==u?void 0:u.ordinal,null==u?void 0:u.accuracy,null==u?void 0:u.stickToRoute]),m=rc.useMemo(()=>{var e,t;return{userLocation:f,userHeading:null!=(e=null==u?void 0:u.heading)?e:null,isUserLocationAvailable:!!f,isUserHeadingAvailable:!!(null!=(t=null==u?void 0:u.heading)?t:null),setUserLocationRoute:e=>d(e)}},[f,null==u?void 0:u.heading]);return rc.createElement(EW.Provider,{value:m},i)});var EX={exports:{}};!function(e,t){var n=function(){var e,t,n,r,i,a,o,s=function(e,t){var n=e,r=l[t],i=null,a=0,o=null,s=[],c={},y=function(e,t){i=function(e){for(var t=Array(e),n=0;n<e;n+=1){t[n]=Array(e);for(var r=0;r<e;r+=1)t[n][r]=null}return t}(a=4*n+17),b(0,0),b(a-7,0),b(0,a-7),M(),_(),S(e,t),n>=7&&E(e),null==o&&(o=C(n,r,s)),T(o,t)},b=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1)&&!(a<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||a<=t+r||(0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4?i[e+n][t+r]=!0:i[e+n][t+r]=!1)},x=function(){for(var e=0,t=0,n=0;n<8;n+=1){y(!0,n);var r=u.getLostPoint(c);(0==n||e>r)&&(e=r,t=n)}return t},_=function(){for(var e=8;e<a-8;e+=1)null==i[e][6]&&(i[e][6]=e%2==0);for(var t=8;t<a-8;t+=1)null==i[6][t]&&(i[6][t]=t%2==0)},M=function(){for(var e=u.getPatternPosition(n),t=0;t<e.length;t+=1)for(var r=0;r<e.length;r+=1){var a=e[t],o=e[r];if(null==i[a][o])for(var s=-2;s<=2;s+=1)for(var l=-2;l<=2;l+=1)-2==s||2==s||-2==l||2==l||0==s&&0==l?i[a+s][o+l]=!0:i[a+s][o+l]=!1}},E=function(e){for(var t=u.getBCHTypeNumber(n),r=0;r<18;r+=1){var o=!e&&(t>>r&1)==1;i[Math.floor(r/3)][r%3+a-8-3]=o}for(var r=0;r<18;r+=1){var o=!e&&(t>>r&1)==1;i[r%3+a-8-3][Math.floor(r/3)]=o}},S=function(e,t){for(var n=r<<3|t,o=u.getBCHTypeInfo(n),s=0;s<15;s+=1){var l=!e&&(o>>s&1)==1;s<6?i[s][8]=l:s<8?i[s+1][8]=l:i[a-15+s][8]=l}for(var s=0;s<15;s+=1){var l=!e&&(o>>s&1)==1;s<8?i[8][a-s-1]=l:s<9?i[8][15-s-1+1]=l:i[8][15-s-1]=l}i[a-8][8]=!e},T=function(e,t){for(var n=-1,r=a-1,o=7,s=0,l=u.getMaskFunction(t),c=a-1;c>0;c-=2)for(6==c&&(c-=1);;){for(var h=0;h<2;h+=1)if(null==i[r][c-h]){var d=!1;s<e.length&&(d=(e[s]>>>o&1)==1),l(r,c-h)&&(d=!d),i[r][c-h]=d,-1==(o-=1)&&(s+=1,o=7)}if((r+=n)<0||a<=r){r-=n,n=-n;break}}},A=function(e,t){for(var n=0,r=0,i=0,a=Array(t.length),o=Array(t.length),s=0;s<t.length;s+=1){var l=t[s].dataCount,c=t[s].totalCount-l;r=Math.max(r,l),i=Math.max(i,c),a[s]=Array(l);for(var d=0;d<a[s].length;d+=1)a[s][d]=255&e.getBuffer()[d+n];n+=l;var p=u.getErrorCorrectPolynomial(c),f=h(a[s],p.getLength()-1).mod(p);o[s]=Array(p.getLength()-1);for(var d=0;d<o[s].length;d+=1){var m=d+f.getLength()-o[s].length;o[s][d]=m>=0?f.getAt(m):0}}for(var g=0,d=0;d<t.length;d+=1)g+=t[d].totalCount;for(var v=Array(g),y=0,d=0;d<r;d+=1)for(var s=0;s<t.length;s+=1)d<a[s].length&&(v[y]=a[s][d],y+=1);for(var d=0;d<i;d+=1)for(var s=0;s<t.length;s+=1)d<o[s].length&&(v[y]=o[s][d],y+=1);return v},C=function(e,t,n){for(var r=d.getRSBlocks(e,t),i=p(),a=0;a<n.length;a+=1){var o=n[a];i.put(o.getMode(),4),i.put(o.getLength(),u.getLengthInBits(o.getMode(),e)),o.write(i)}for(var s=0,a=0;a<r.length;a+=1)s+=r[a].dataCount;if(i.getLengthInBits()>8*s)throw"code length overflow. ("+i.getLengthInBits()+">"+8*s+")";for(i.getLengthInBits()+4<=8*s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*s)&&(i.put(236,8),!(i.getLengthInBits()>=8*s));){;i.put(17,8)}return A(i,r)};c.addData=function(e,t){var n=null;switch(t=t||"Byte"){case"Numeric":n=f(e);break;case"Alphanumeric":n=m(e);break;case"Byte":n=g(e);break;case"Kanji":n=v(e);break;default:throw"mode:"+t}s.push(n),o=null},c.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+","+t;return i[e][t]},c.getModuleCount=function(){return a},c.make=function(){if(n<1){for(var e=1;e<40;e++){for(var t=d.getRSBlocks(e,r),i=p(),a=0;a<s.length;a++){var o=s[a];i.put(o.getMode(),4),i.put(o.getLength(),u.getLengthInBits(o.getMode(),e)),o.write(i)}for(var l=0,a=0;a<t.length;a++)l+=t[a].dataCount;if(i.getLengthInBits()<=8*l)break}n=e}y(!1,x())},c.createTableTag=function(e,t){e=e||2;var n="";n+='<table style=" border-width: 0px; border-style: none; border-collapse: collapse; padding: 0px; margin: '+(t=void 0===t?4*e:t)+'px;"><tbody>';for(var r=0;r<c.getModuleCount();r+=1){n+="<tr>";for(var i=0;i<c.getModuleCount();i+=1)n+='<td style=" border-width: 0px; border-style: none; border-collapse: collapse; padding: 0px; margin: 0px; width: '+e+"px;"+(" height: "+e)+"px; background-color: "+(c.isDark(r,i)?"#000000":"#ffffff")+';"/>';n+="</tr>"}return n+"</tbody></table>"},c.createSvgTag=function(e,t,n,r){var i={};"object"==typeof arguments[0]&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e=e||2,t=void 0===t?4*e:t,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;var a,o,s,l,u=c.getModuleCount()*e+2*t,h="";for(l="l"+e+",0 0,"+e+" -"+e+",0 0,-"+e+"z ",h+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',h+=i.scalable?"":' width="'+u+'px" height="'+u+'px"',h+=' viewB
341ox="0 0 '+u+" "+u+'" ',h+=' preserveAspectRatio="xMinYMin meet"',h+=r.text||n.text?' role="img" aria-labelledby="'+R([r.id,n.id].join(" ").trim())+'"':"",h+=">",h+=r.text?'<title id="'+R(r.id)+'">'+R(r.text)+"</title>":"",h+=n.text?'<description id="'+R(n.id)+'">'+R(n.text)+"</description>":"",h+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',h+='<path d="',o=0;o<c.getModuleCount();o+=1)for(a=0,s=o*e+t;a<c.getModuleCount();a+=1)c.isDark(o,a)&&(h+="M"+(a*e+t)+","+s+l);return h+='" stroke="transparent" fill="black"/>',h+="</svg>"},c.createDataURL=function(e,t){e=e||2,t=void 0===t?4*e:t;var n=c.getModuleCount()*e+2*t,r=t,i=n-t;return w(n,n,function(t,n){if(!(r<=t)||!(t<i)||!(r<=n)||!(n<i))return 1;var a=Math.floor((t-r)/e),o=Math.floor((n-r)/e);return+!c.isDark(o,a)})},c.createImgTag=function(e,t,n){e=e||2,t=void 0===t?4*e:t;var r=c.getModuleCount()*e+2*t,i="";return i+="<img",i+=' src="',i+=c.createDataURL(e,t),i+='"',i+=' width="',i+=r,i+='"',i+=' height="',i+=r,i+='"',n&&(i+=' alt="',i+=R(n),i+='"'),i+="/>"};var R=function(e){for(var t="",n=0;n<e.length;n+=1){var r=e.charAt(n);switch(r){case"<":t+="&lt;";break;case">":t+="&gt;";break;case"&":t+="&amp;";break;case'"':t+="&quot;";break;default:t+=r}}return t},P=function(e){e=void 0===e?2:e;var t,n,r,i,a,o=+c.getModuleCount()+2*e,s=e,l=o-e,u={"██":"█","█ ":"▀"," █":"▄","  ":" "},h={"██":"▀","█ ":"▀"," █":" ","  ":" "},d="";for(t=0;t<o;t+=2){for(n=0,r=Math.floor((t-s)/1),i=Math.floor((t+1-s)/1);n<o;n+=1)a="█",s<=n&&n<l&&s<=t&&t<l&&c.isDark(r,Math.floor((n-s)/1))&&(a=" "),s<=n&&n<l&&s<=t+1&&t+1<l&&c.isDark(i,Math.floor((n-s)/1))?a+=" ":a+="█",d+=e<1&&t+1>=l?h[a]:u[a];d+="\n"}return o%2&&e>0?d.substring(0,d.length-o-1)+Array(o+1).join("▀"):d.substring(0,d.length-1)};return c.createASCII=function(e,t){if((e=e||1)<2)return P(t);e-=1,t=void 0===t?2*e:t;var n,r,i,a,o=c.getModuleCount()*e+2*t,s=t,l=o-t,u=Array(e+1).join("██"),h=Array(e+1).join("  "),d="",p="";for(n=0;n<o;n+=1){for(r=0,i=Math.floor((n-s)/e),p="";r<o;r+=1)a=1,s<=r&&r<l&&s<=n&&n<l&&c.isDark(i,Math.floor((r-s)/e))&&(a=0),p+=a?u:h;for(i=0;i<e;i+=1)d+=p+"\n"}return d.substring(0,d.length-1)},c.renderTo2dContext=function(e,t){t=t||2;for(var n=c.getModuleCount(),r=0;r<n;r++)for(var i=0;i<n;i++)e.fillStyle=c.isDark(r,i)?"black":"white",e.fillRect(r*t,i*t,t,t)},c};s.stringToBytesFuncs={default:function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t.push(255&r)}return t}},s.stringToBytes=s.stringToBytesFuncs.default,s.createStringToBytes=function(e,t){var n=function(){for(var n=x(e),r=function(){var e=n.read();if(-1==e)throw"eof";return e},i=0,a={};;){var o=n.read();if(-1==o)break;var s=r(),l=r(),u=r(),c=String.fromCharCode(o<<8|s),h=l<<8|u;a[c]=h,i+=1}if(i!=t)throw i+" != "+t;return a}();return function(e){for(var t=[],r=0;r<e.length;r+=1){var i=e.charCodeAt(r);if(i<128)t.push(i);else{var a=n[e.charAt(r)];"number"==typeof a?(255&a)==a?t.push(a):(t.push(a>>>8),t.push(255&a)):t.push(63)}}return t}};var l={L:1,M:0,Q:3,H:2},u=(e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t={},n=function(e){for(var t=0;0!=e;)t+=1,e>>>=1;return t},t.getBCHTypeInfo=function(e){for(var t=e<<10;n(t)-n(1335)>=0;)t^=1335<<n(t)-n(1335);return(e<<10|t)^21522},t.getBCHTypeNumber=function(e){for(var t=e<<12;n(t)-n(7973)>=0;)t^=7973<<n(t)-n(7973);return e<<12|t},t.getPatternPosition=function(t){return e[t-1]},t.getMaskFunction=function(e){switch(e){case 0:return function(e,t){return(e+t)%2==0};case 1:return function(e,t){return e%2==0}
341;case 2:return function(e,t){return t%3==0};case 3:return function(e,t){return(e+t)%3==0};case 4:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case 5:return function(e,t){return e*t%2+e*t%3==0};case 6:return function(e,t){return(e*t%2+e*t%3)%2==0};case 7:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw"bad maskPattern:"+e}},t.getErrorCorrectPolynomial=function(e){for(var t=h([1],0),n=0;n<e;n+=1)t=t.multiply(h([1,c.gexp(n)],0));return t},t.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+e}if(t<27)switch(e){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+e}if(t<41)switch(e){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+e}throw"type:"+t},t.getLostPoint=function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r+=1)for(var i=0;i<t;i+=1){for(var a=0,o=e.isDark(r,i),s=-1;s<=1;s+=1)if(!(r+s<0)&&!(t<=r+s))for(var l=-1;l<=1;l+=1)i+l<0||t<=i+l||(0!=s||0!=l)&&o==e.isDark(r+s,i+l)&&(a+=1);a>5&&(n+=3+a-5)}for(var r=0;r<t-1;r+=1)for(var i=0;i<t-1;i+=1){var u=0;e.isDark(r,i)&&(u+=1),e.isDark(r+1,i)&&(u+=1),e.isDark(r,i+1)&&(u+=1),e.isDark(r+1,i+1)&&(u+=1),(0==u||4==u)&&(n+=3)}for(var r=0;r<t;r+=1)for(var i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(var i=0;i<t;i+=1)for(var r=0;r<t-6;r+=1)e.isDark(r,i)&&!e.isDark(r+1,i)&&e.isDark(r+2,i)&&e.isDark(r+3,i)&&e.isDark(r+4,i)&&!e.isDark(r+5,i)&&e.isDark(r+6,i)&&(n+=40);for(var c=0,i=0;i<t;i+=1)for(var r=0;r<t;r+=1)e.isDark(r,i)&&(c+=1);return n+10*(Math.abs(100*c/t/t-50)/5)},t),c=function(){for(var e=Array(256),t=Array(256),n=0;n<8;n+=1)e[n]=1<<n;for(var n=8;n<256;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(var n=0;n<255;n+=1)t[e[n]]=n;var r={};return r.glog=function(e){if(e<1)throw"glog("+e+")";return t[e]},r.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},r}();function h(e,t){if(void 0===e.length)throw e.length+"/"+t;var n=function(){for(var n=0;n<e.length&&0==e[n];)n+=1;for(var r=Array(e.length-n+t),i=0;i<e.length-n;i+=1)r[i]=e[i+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){for(var t=Array(r.getLength()+e.getLength()-1),n=0;n<r.getLength();n+=1)for(var i=0;i<e.getLength();i+=1)t[n+i]^=c.gexp(c.glog(r.getAt(n))+c.glog(e.getAt(i)));return h(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;for(var t=c.glog(r.getAt(0))-c.glog(e.getAt(0)),n=Array(r.getLength()),i=0;i<r.getLength();i+=1)n[i]=r.getAt(i);for(var i=0;i<e.getLength();i+=1)n[i]^=c.gexp(c.glog(e.getAt(i))+t);return h(n,0).mod(e)},r}var d=(r=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],i=function(e,t){var n={};return n.totalCount=e,n.dataCount=t,n},a={},o=function(e,t){switch(t){case l.L:return r[(e-1)*4+0];case l.M:return r[(e-1)*4+1];case l.Q:return r[(e-1)*4+2];case l.H:return r[(e-1)*4+3];default:return}},a.getRSBlocks=function(e,t){var n=o(e,t);if(void 0===n)throw"bad rs block @ typeNumber:"+e+"/errorCorrectionLevel:"+t;for(var r=n.length/3,a=[],s=0;s<r;s+=1)for(var l=n[3*s+0],u=n[3*s+1],c=n[3*s+2],h=0;h<l;h+=1)a.push(i(u,c));return a},a),p=function(){var e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){return(e[Math.floor(t/8)]>>>7-t%8&1)==1},n.put=function(e,t){for(var r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},f=function(e){var t={};t.getMode=function(){return 1},t.getLength=function(t){return e.length},t.write=function(t){for(var r=0;r+2<e.length;)t.put(n(e.substring(r,r+3)),10),r+=3;r<e.length&&(e.length-r==1?t.put(n(e.substring(r,r+1)),4):e.length-r==2&&t.put(n(e.substring(r,r+2)),7))};var n=function(e){for(var t=0,n=0;n<e.length;n+=1)t=10*t+r(e.charAt(n));return t},r=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-48;throw"illegal char :"+e};return t},m=function(e){var t={};t.getMode=function(){return 2},t.getLength=function(t){return e.length},t.write=function(t){for(var r=0;r+1<e.length;)t.put(45*n(e.charAt(r))+n(e.charAt(r+1)),11),r+=2;r<e.length&&t.put(n(e.charAt(r)),6)};var n=function(e){if("0"<=e&&e<="9")return e.charCodeAt(0)-48;if("A"<=e&&e<="Z")return e.charCodeAt(0)-65+10;switch(e){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+e}};return t},g=function(e){var t=s.stringToBytes(e),n={};return n.getMode=function(){return 4},n.getLength=function(e){return t.length},n.write=function(e){for(var n=0;n<t.length;n+=1)e.put(t[n],8)},n},v=function(e){var t=s.stringToBytesFuncs.SJIS;if(!t)throw"sjis not supported.";var n=t("友");
341if(2!=n.length||(n[0]<<8|n[1])!=38726)throw"sjis not supported.";var r=t(e),i={};return i.getMode=function(){return 8},i.getLength=function(e){return~~(r.length/2)},i.write=function(e){for(var t=0;t+1<r.length;){var n=(255&r[t])<<8|255&r[t+1];if(33088<=n&&n<=40956)n-=33088;else if(57408<=n&&n<=60351)n-=49472;else throw"illegal char at "+(t+1)+"/"+n;n=(n>>>8&255)*192+(255&n),e.put(n,13),t+=2}if(t<r.length)throw"illegal char at "+(t+1)},i},y=function(){var e=[],t={};return t.writeByte=function(t){e.push(255&t)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n=n||0,r=r||e.length;for(var i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(var n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){var t="";t+="[";for(var n=0;n<e.length;n+=1)n>0&&(t+=","),t+=e[n];return t+"]"},t},b=function(){var e=0,t=0,n=0,r="",i={},a=function(e){r+=String.fromCharCode(o(63&e))},o=function(e){if(e<0);else if(e<26)return 65+e;else if(e<52)return 97+(e-26);else if(e<62)return 48+(e-52);else if(62==e)return 43;else if(63==e)return 47;throw"n:"+e};return i.writeByte=function(r){for(e=e<<8|255&r,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0)for(var i=3-n%3,o=0;o<i;o+=1)r+="="},i.toString=function(){return r},i},x=function(e){var t=0,n=0,r=0,i={};i.read=function(){for(;r<8;){if(t>=e.length){if(0==r)return -1;throw"unexpected end of file./"+r}var i=e.charAt(t);if(t+=1,"="==i)return r=0,-1;i.match(/^\s$/)||(n=n<<6|a(i.charCodeAt(0)),r+=6)}var o=n>>>r-8&255;return r-=8,o};var a=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(43==e)return 62;if(47==e)return 63;else throw"c:"+e};return i},_=function(e,t){var n=Array(e*t),r={};r.setPixel=function(t,r,i){n[r*e+t]=i},r.write=function(n){n.writeString("GIF87a"),n.writeShort(e),n.writeShort(t),n.writeByte(128),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(0),n.writeByte(255),n.writeByte(255),n.writeByte(255),n.writeString(","),n.writeShort(0),n.writeShort(0),n.writeShort(e),n.writeShort(t),n.writeByte(0);var r=a(2);n.writeByte(2);for(var i=0;r.length-i>255;)n.writeByte(255),n.writeBytes(r,i,255),i+=255;n.writeByte(r.length-i),n.writeBytes(r,i,r.length-i),n.writeByte(0),n.writeString(";")};var i=function(e){var t=0,n=0,r={};return r.write=function(r,i){if(r>>>i!=0)throw"length over";for(;t+i>=8;)e.writeByte(255&(r<<t|n)),i-=8-t,r>>>=8-t,n=0,t=0;n=r<<t|n,t+=i},r.flush=function(){t>0&&e.writeByte(n)},r},a=function(e){for(var t=1<<e,r=(1<<e)+1,a=e+1,s=o(),l=0;l<t;l+=1)s.add(String.fromCharCode(l));s.add(String.fromCharCode(t)),s.add(String.fromCharCode(r));var u=y(),c=i(u);c.write(t,a);var h=0,d=String.fromCharCode(n[0]);for(h+=1;h<n.length;){var p=String.fromCharCode(n[h]);h+=1,s.contains(d+p)?d+=p:(c.write(s.indexOf(d),a),4095>s.size()&&(s.size()==1<<a&&(a+=1),s.add(d+p)),d=p)}return c.write(s.indexOf(d),a),c.write(r,a),c.flush(),u.toByteArray()},o=function(){var e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw"dup key:"+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return void 0!==e[t]},n};return r},w=function(e,t,n){for(var r=_(e,t),i=0;i<t;i+=1)for(var a=0;a<e;a+=1)r.setPixel(a,i,n(a,i));var o=y();r.write(o);for(var s=b(),l=o.toByteArray(),u=0;u<l.length;u+=1)s.writeByte(l[u]);return s.flush(),"data:image/gif;base64,"+s};return s}();n.stringToBytesFuncs["UTF-8"]=function(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t},e.exports=n}(EX);var Eq=EX.exports,EY=Object.prototype.hasOwnProperty,EZ=Array.isArray,E$=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),EK=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(EZ(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}},EJ=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},EQ={assign:function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],o=Object.keys(a),s=0;s<o.length;++s){var l=o[s],u=a[l];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:a,prop:l}),n.push(u))}return EK(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");
341if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n){if(0===e.length)return e;var r=e;if("symbol"==typeof e?r=Symbol.prototype.toString.call(e):"string"!=typeof e&&(r=String(e)),"iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var i="",a=0;a<r.length;++a){var o=r.charCodeAt(a);if(45===o||46===o||95===o||126===o||o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122){i+=r.charAt(a);continue}if(o<128){i+=E$[o];continue}if(o<2048){i+=E$[192|o>>6]+E$[128|63&o];continue}if(o<55296||o>=57344){i+=E$[224|o>>12]+E$[128|o>>6&63]+E$[128|63&o];continue}a+=1,i+=E$[240|(o=65536+((1023&o)<<10|1023&r.charCodeAt(a)))>>18]+E$[128|o>>12&63]+E$[128|o>>6&63]+E$[128|63&o]}return i},isBuffer:function(e){return!!e&&"object"==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(EZ(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(EZ(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!EY.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var i=t;return(EZ(t)&&!EZ(n)&&(i=EJ(t,r)),EZ(t)&&EZ(n))?(n.forEach(function(n,i){if(EY.call(t,i)){var a=t[i];a&&"object"==typeof a&&n&&"object"==typeof n?t[i]=e(a,n,r):t.push(n)}else t[i]=n}),t):Object.keys(n).reduce(function(t,i){var a=n[i];return EY.call(t,i)?t[i]=e(t[i],a,r):t[i]=a,t},i)}},E0=String.prototype.replace,E1=/%20/g,E2={RFC1738:"RFC1738",RFC3986:"RFC3986"},E3=EQ.assign({default:E2.RFC3986,formatters:{RFC1738:function(e){return E0.call(e,E1,"+")},RFC3986:function(e){return String(e)}}},E2),E5=Object.prototype.hasOwnProperty,E4={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},E6=Array.isArray,E8=Array.prototype.push,E7=function(e,t){E8.apply(e,E6(t)?t:[t])},E9=Date.prototype.toISOString,Se=E3.default,St={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:EQ.encode,encodeValuesOnly:!1,format:Se,formatter:E3.formatters[Se],indices:!1,serializeDate:function(e){return E9.call(e)},skipNulls:!1,strictNullHandling:!1},Sn=function e(t,n,r,i,a,o,s,l,u,c,h,d,p){var f,m,g=t;if("function"==typeof s?g=s(n,g):g instanceof Date?g=c(g):"comma"===r&&E6(g)&&(g=EQ.maybeMap(g,function(e){return e instanceof Date?c(e):e}).join(",")),null===g){if(i)return o&&!d?o(n,St.encoder,p,"key"):n;g=""}if("string"==typeof(f=g)||"number"==typeof f||"boolean"==typeof f||"symbol"==typeof f||"bigint"==typeof f||EQ.isBuffer(g))return o?[h(d?n:o(n,St.encoder,p,"key"))+"="+h(o(g,St.encoder,p,"value"))]:[h(n)+"="+h(String(g))];var v=[];if(void 0===g)return v;if(E6(s))m=s;else{var y=Object.keys(g);m=l?y.sort(l):y}for(var b=0;b<m.length;++b){var x=m[b],_=g[x];a&&null===_||E7(v,e(_,E6(g)?"function"==typeof r?r(n,x):n:n+(u?"."+x:"["+x+"]"),r,i,a,o,s,l,u,c,h,d,p))}return v},Sr=function(e){if(!e)return St;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw TypeError("Encoder has to be a function.");var t=e.charset||St.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=E3.default;if(void 0!==e.format){if(!E5.call(E3.formatters,e.format))throw TypeError("Unknown format option provided.");n=e.format}var r=E3.formatters[n],i=St.filter;return("function"==typeof e.filter||E6(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:St.addQueryPrefix,allowDots:void 0===e.allowDots?St.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:St.charsetSentinel,delimiter:void 0===e.delimiter?St.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:St.encode,encoder:"function"==typeof e.encoder?e.encoder:St.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:St.encodeValuesOnly,filter:i,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:St.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:St.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:St.strictNullHandling}},Si=Object.prototype.hasOwnProperty,Sa=Array.isArray,So={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:EQ.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Ss=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},Sl=function(e,t){var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=t.parameterLimit===1/0?void 0:t.parameterLimit,a=r.
341split(t.delimiter,i),o=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l<a.length;++l)0===a[l].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[l]?s="utf-8":"utf8=%26%2310003%3B"===a[l]&&(s="iso-8859-1"),o=l,l=a.length);for(l=0;l<a.length;++l)if(l!==o){var l,u,c,h=a[l],d=h.indexOf("]="),p=-1===d?h.indexOf("="):d+1;-1===p?(u=t.decoder(h,So.decoder,s,"key"),c=t.strictNullHandling?null:""):(u=t.decoder(h.slice(0,p),So.decoder,s,"key"),c=EQ.maybeMap(Ss(h.slice(p+1),t),function(e){return t.decoder(e,So.decoder,s,"value")})),c&&t.interpretNumericEntities&&"iso-8859-1"===s&&(c=c.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})),h.indexOf("[]=")>-1&&(c=Sa(c)?[c]:c),Si.call(n,u)?n[u]=EQ.combine(n[u],c):n[u]=c}return n},Su=function(e,t,n,r){for(var i=r?t:Ss(t,n),a=e.length-1;a>=0;--a){var o,s=e[a];if("[]"===s&&n.parseArrays)o=[].concat(i);else{o=n.plainObjects?Object.create(null):{};var l="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(l,10);n.parseArrays||""!==l?!isNaN(u)&&s!==l&&String(u)===l&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[])[u]=i:o[l]=i:o={0:i}}i=o}return i},Sc=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,o=n.depth>0&&/(\[[^[\]]*])/.exec(i),s=o?i.slice(0,o.index):i,l=[];if(s){if(!n.plainObjects&&Si.call(Object.prototype,s)&&!n.allowPrototypes)return;l.push(s)}for(var u=0;n.depth>0&&null!==(o=a.exec(i))&&u<n.depth;){if(u+=1,!n.plainObjects&&Si.call(Object.prototype,o[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(o[1])}return o&&l.push("["+i.slice(o.index)+"]"),Su(l,t,n,r)}},Sh=function(e){if(!e)return So;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?So.charset:e.charset;return{allowDots:void 0===e.allowDots?So.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:So.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:So.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:So.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:So.comma,decoder:"function"==typeof e.decoder?e.decoder:So.decoder,delimiter:"string"==typeof e.delimiter||EQ.isRegExp(e.delimiter)?e.delimiter:So.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:So.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:So.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:So.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:So.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:So.strictNullHandling}},Sd={parse:function(e,t){var n=Sh(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof e?Sl(e,n):e,i=n.plainObjects?Object.create(null):{},a=Object.keys(r),o=0;o<a.length;++o){var s=a[o],l=Sc(s,r[s],n,"string"==typeof e);i=EQ.merge(i,l,n)}return EQ.compact(i)},stringify:function(e,t){var n,r,i=e,a=Sr(t);"function"==typeof a.filter?i=(0,a.filter)("",i):E6(a.filter)&&(n=a.filter);var o=[];if("object"!=typeof i||null===i)return"";r=t&&t.arrayFormat in E4?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var s=E4[r];n||(n=Object.keys(i)),a.sort&&n.sort(a.sort);for(var l=0;l<n.length;++l){var u=n[l];a.skipNulls&&null===i[u]||E7(o,Sn(i[u],u,s,a.strictNullHandling,a.skipNulls,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.formatter,a.encodeValuesOnly,a.charset))}var c=o.join(a.delimiter),h=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&("iso-8859-1"===a.charset?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),c.length>0?h+c:""}},Sp=Object.defineProperty,Sf=Object.defineProperties,Sm=Object.getOwnPropertyDescriptors,Sg=Object.getOwnPropertySymbols,Sv=Object.prototype.hasOwnProperty,Sy=Object.prototype.propertyIsEnumerable,Sb=(e,t,n
341)=>t in e?Sp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sx=Object.defineProperty,S_=Object.defineProperties,Sw=Object.getOwnPropertyDescriptors,SM=Object.getOwnPropertySymbols,SE=Object.prototype.hasOwnProperty,SS=Object.prototype.propertyIsEnumerable,ST=(e,t,n)=>t in e?Sx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,SA=(e,t)=>{for(var n in t||(t={}))SE.call(t,n)&&ST(e,n,t[n]);if(SM)for(var n of SM(t))SS.call(t,n)&&ST(e,n,t[n]);return e},SC=(e,t)=>S_(e,Sw(t));let SR=e=>e.reduce((e,t)=>{let n=e[e.length-1];return n&&n[0]===t[0]&&n[1]===t[1]||e.push(t),e},[]),SP=(e,t)=>1e-6>Math.abs(e-t),SI=async(e,t={})=>{let{avoidStairs:n=!1,startStepIdx:r=0,extraTimeOptions:i=[]}=t,a=e[0],o=e[e.length-1],s=e.slice(1,e.length-1),l=e.reduce((e,t)=>e+"__"+t.occupantId,"")+"__"+n,u=new window.mapsindoors.services.DirectionsService,c=await u.getRoute({origin:SC(SA({},a.latLng),{floor:a.ordinal}),destination:SC(SA({},o.latLng),{floor:o.ordinal}),stops:s.map(e=>SC(SA({},e.latLng),{floor:e.ordinal})),avoidStairs:n});if(!c)throw Error("No route found");let h=SR(c.legs.reduce((e,t)=>e.concat(t.geometry.coordinates),[]));return{id:l,coordinates:h,length:c.legs.reduce((e,t)=>e+t.distance.value,0),steps:c.legs.reduce((e,t,n,r)=>{var a;let l,u=r[n+1],c=e[e.length-1],h=(l=SR(t.geometry.coordinates).map(e=>e.reverse()),i.reduce((e,t)=>{var n;if((null==(n=t.points)?void 0:n.length)!==3)return console.warn("The extra time option must contain three points: [start, inArea, end] or [start, null, end]"),e;let r=[];for(let n of e){let{type:e,coordinates:i}=n;if("extraTime"===e){r.push(n);continue}let[a,o,s]=t.points,l=a?i.findIndex(([e,t])=>SP(a[0],e)&&SP(a[1],t)):-1,u=o?i.findIndex(([e,t])=>SP(o[0],e)&&SP(o[1],t)):-1,c=s?i.findIndex(([e,t])=>SP(s[0],e)&&SP(s[1],t)):-1;if(-1!==l&&-1!==c){let e=l<c?l:c,n=l<c?c:l;r.push({type:"regular",coordinates:i.slice(0,e+1)},{type:"extraTime",coordinates:i.slice(e,n+1),extraTimeArea:t},{type:"regular",coordinates:i.slice(n)})}else if((-1!==l||-1!==c)&&-1!==u){let e=-1!==l?l:c;e<u?r.push({type:"regular",coordinates:i.slice(0,e+1)},{type:"extraTime",coordinates:i.slice(e,u+1),extraTimeArea:t}):r.push({type:"extraTime",coordinates:i.slice(u,e+1),extraTimeArea:t},{type:"regular",coordinates:i.slice(e)})}else r.push(n)}return r},[{type:"regular",coordinates:l}])),d=h.map((e,t)=>"extraTime"===e.type?t:-1).filter(e=>-1!==e&&e>0&&e<h.length-1);d.forEach((n,r)=>{var i,a,o;let s=null!=(i=d[r-1])?i:null;e.push({routeIdx:null!=(a=null==c?void 0:c.routeIdx)?a:0,isTransitionPoint:!1,ordinal:t.end_location.zLevel,points:null===s?h.slice(n-1,n):h.slice(s,n),targetName:null==(o=h[n].extraTimeArea)?void 0:o.name})});let p={routeIdx:null!=(a=null==c?void 0:c.routeIdx)?a:0,isTransitionPoint:!1,ordinal:t.end_location.zLevel,points:d.length?h.slice(d.pop()):h};if("stop_reached"===t.leg_start_reason&&(p.routeIdx+=1),"floor_change"===t.leg_end_reason&&(p.isTransitionPoint=!0,p.targetName=(e=>{switch(e.toLowerCase()){case"steps":return"Stairs";case"escalator":return"Escalator";case"elevator":return"Elevator";case"ladder":return"Ladder";case"wheelchairramp":return"Wheelchair ramp";case"wheelchairlift":return"Wheelchair lift";default:return e}})(u.steps[0].highway),p.targetLevel=u.end_location.zLevel,p.targetLevelName=u.end_location.floor_name),"stop_reached"===t.leg_end_reason){let e=s[p.routeIdx];p.targetName=e.name}return"route_end"===t.leg_end_reason&&(p.targetName=o.name),e.push(p),e},[]),startStepIdx:r}};var SO=Object.defineProperty,SL=Object.defineProperties,SD=Object.getOwnPropertyDescriptors,SN=Object.getOwnPropertySymbols,SU=Object.prototype.hasOwnProperty,Sk=Object.prototype.propertyIsEnumerable,SB=(e,t,n)=>t in e?SO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,SF=(e,t)=>{for(var n in t||(t={}))SU.call(t,n)&&SB(e,n,t[n]);if(SN)for(var n of SN(t))Sk.call(t,n)&&SB(e,n,t[n]);return e},Sz=(e,t)=>SL(e,SD(t));let SH=e=>{let{targetId:t,targetName:n,level:r,ordinal:i,routePoint:a,points:o}=e,s=o[0].coordinates[0];return{occupantId:t,occupant:{routePoints:[parseInt(a,10)],levelId:r,display:{name:n}},name:n,latLng:s,ordinal:i}},Sj=rc.createContext(),SW=[{type:"empty"},{type:"empty"}],SG={isDirectionsOpen:!1,stops:SW,avoidStairs:!1,userRoute:null,route:null,routeQRCode:null,steps:null,stepIdx:0,isRouteFromUserLocation:!1},SV=(e,t)=>SF(SF({},e),t),SX=MC(Mg(Eb(EG(Mz(function(e){let{children:t,map:n,mapLoaded:r,ordinals:i,activeOrdinal:a,events:o,getText:s,isUserHeadingAvailable:l,setUserLocationRoute:u,setFollowMeMode:c,options:{debug:h,extraTimeOptions:d,routeRules:p,getRouteSteps:f,makeRouteHandler:m,routeStartStepThreshold:g,routeArriveStepThreshold:v,routeFromStepThreshold:y,routeFollowStepThreshold:b}}=e,[x,_]=rc.useReducer(SV,SG),[w,M]=rc.useState(e.userLocation),E=rc.useRef({userLocation:w,mapLoaded:r,activeOrdinal:a});rc.useEffect(()=>{_({message:null})},[x.stops,x.avoidStairs]);let S=rc.useCallback(e=>{_({stops:e,message:null}),o.emit("Directions#Change",{stops:e,avoidStairs:x.avoidStairs})},[x.avoidStairs,o]),T=rc.useCallback(e=>{_({avoidStairs:e}),o.emit("Directions#Change",{stops:x.stops,avoidStairs:e})},[x.stops,o]),A=rc.useCallback(e=>{_({stepIdx:e})},[]),C=rc.useCallback(async e=>{var t,n;let{points:r,avoidStairs:a,startStepIdx:s}=e,l=null!=(t=e.userLocation)?t:E.current.userLocation;
341r.forEach(e=>{"__your-location__"===e.occupantId&&(e.latLng={lat:null==l?void 0:l.latitude,lng:null==l?void 0:l.longitude},e.ordinal=null==l?void 0:l.ordinal)});let u=[...null!=p?p:[],...null!=(n=e.routeRules)?n:[]];u.forEach(e=>{var t,n,a,o;switch(e.type){case"limitToSection":{let{section:a,include:o,includeSections:s,applyForStartPoint:l,message:u}=e;a||console.warn('Bad route rule configuration. The "section" is missed.');let c=null,h=null,d=[];for(let e of i.values())for(let r of null!=(t=e.levels)?t:[])for(let t of null!=(n=r.sections)?n:[])(null==s?void 0:s.includes(t.id))&&d.push({ordinal:e.id,polygons:_W(t.geometry)}),a===t.id&&(c=e.id,h=_W(t.geometry));if(!h)break;let p=r[0],f=c===p.ordinal&&h.some(e=>hP([p.latLng.lat,p.latLng.lng],e));if(!f&&!l)break;let m=r.slice(1).find(({occupantId:e,latLng:t,ordinal:n})=>{if((null==o?void 0:o.includes(e))||s&&d.some(e=>n===e.ordinal&&e.polygons.some(e=>hP([t.lat,t.lng],e))))return!1;let r=n===c&&h.some(e=>hP([t.lat,t.lng],e));return f?!r:l&&r});if(m){let e=Error(null!=u?u:"Not all destinations are allowed");throw e.destination=m,e.source=p,e}break}case"blockFromSection":{let{section:t,destinations:n,message:s}=e;if(!t||!n||!Array.isArray(n)){console.warn("Bad route rule configuration for blockFromSection");break}let l=null,u=null;for(let e of i.values())for(let n of null!=(a=e.levels)?a:[])for(let r of null!=(o=n.sections)?o:[])if(t===r.id){l=e.id,u=_W(r.geometry);break}if(!u)break;for(let e=0;e<r.length-1;e++){let t=r[e],i=r[e+1];if(l===t.ordinal&&u.some(e=>hP([t.latLng.lat,t.latLng.lng],e))&&n.includes(i.occupantId)){let e=Error(null!=s?s:"Destination is not accessible from this section");throw e.destination=i,e.source=t,e}}}}});let c=window.mapsindoors?await SI(r,{avoidStairs:a,extraTimeOptions:d,startStepIdx:s}):de(r,{avoidStairs:a,extraTimeOptions:d,routeRules:u,startStepIdx:s,debug:h}),f=((e,{avoidStairs:t})=>{let{origin:n,pathname:r,search:i}=window.location,a=Sd.parse(i.replace(/^\?/,""));Object.keys(a).forEach(e=>{0===e.indexOf("pcm_")&&delete a[e]});let o=Sd.stringify(Sf(((e,t)=>{for(var n in t||(t={}))Sv.call(t,n)&&Sb(e,n,t[n]);if(Sg)for(var n of Sg(t))Sy.call(t,n)&&Sb(e,n,t[n]);return e})({},a),Sm({pcm_s:e.map(e=>e.occupantId),pcm_as:Number(t)})),{arrayFormat:"comma",addQueryPrefix:!0});var s=`${n}${r}${o}`;let l=Eq(0,"L");return l.addData(s),l.make(),l.createSvgTag(100)})(r,{avoidStairs:a});return o.emit("Route#Built",{path:c.coordinates,length:c.length,stops:r,avoidStairs:a,qrcode:f}),{route:c,routeQRCode:f}},[o,i,h,d,p]),R=rc.useCallback(e=>{var t;let n=E.current.userLocation,r=(null==e?void 0:e.stops)||(null==e?void 0:e.sourceId)||(null==e?void 0:e.sourceName)||(null==e?void 0:e.destinationId)||(null==e?void 0:e.destinationName)?_H({stops:null==e?void 0:e.stops,sourceId:null==e?void 0:e.sourceId,sourceName:null==e?void 0:e.sourceName,destinationId:null==e?void 0:e.destinationId,destinationName:null==e?void 0:e.destinationName,userLocation:n}):[];if(r.some(e=>"empty"===e.type))return void console.error("Some points are empty:",r);C({points:r,avoidStairs:null!=(t=null==e?void 0:e.avoidStairs)&&t,routeRules:null==e?void 0:e.routeRules})},[C]),P=rc.useCallback(({points:e,avoidStairs:t,startStepIdx:n,userLocation:r,routeRules:i})=>{let a={points:e,avoidStairs:t,startStepIdx:n,userLocation:r,routeRules:i},l=({route:n,routeQRCode:r})=>{_({isDirectionsOpen:!0,route:n,routeQRCode:r,steps:null,stepIdx:0,stops:e,avoidStairs:t,isRouteFromUserLocation:"__your-location__"===e[0].occupantId,message:null}),o.emit("Directions#Open"),o.emit("Route#Open",{path:n.coordinates,steps:n.steps,stops:e,avoidStairs:t,qrcode:r})};C(a).then(e=>{m?m(e,a,C,l):l(e)}).catch(e=>{var t,n,r,i,a,o;console.error(e);let l=s(e.message);_({message:{type:"error",text:l===e.message?s("Unfortunately that route is not possible"):l.replaceAll("{{destination}}",null==(r=null==(n=null==(t=e.destination)?void 0:t.occupant)?void 0:n.display)?void 0:r.name).replaceAll("{{source}}",null==(o=null==(a=null==(i=e.source)?void 0:i.occupant)?void 0:a.display)?void 0:o.name)}})})},[o,C,m,s]),I=rc.useCallback(e=>{var t;let n=E.current.userLocation,r=x.stops,i=(null==e?void 0:e.stops)||(null==e?void 0:e.sourceId)||(null==e?void 0:e.sourceName)||(null==e?void 0:e.destinationId)||(null==e?void 0:e.destinationName)?_H({stops:null==e?void 0:e.stops,sourceId:null==e?void 0:e.sourceId,sourceName:null==e?void 0:e.sourceName,destinationId:null==e?void 0:e.destinationId,destinationName:null==e?void 0:e.destinationName,userLocation:n}):r;i.some(e=>"empty"===e.type)||(P({points:i,avoidStairs:null!=(t=null==e?void 0:e.avoidStairs)?t:x.avoidStairs,routeRules:null==e?void 0:e.routeRules}),"__your-location__"===i[0].occupantId&&setTimeout(()=>{c(!l||"heading")},500))},[x.stops,x.avoidStairs,P,l,c]),O=rc.useCallback(()=>{_({route:null,routeQRCode:null,userRoute:null}),o.emit("Route#Close",{stops:x.stops,avoidStairs:x.avoidStairs})},[x.stops,x.avoidStairs,o]),L=rc.useCallback(({stop:e,showRoute:t})=>{let n=x.route,r=x.stops,i=x.avoidStairs,a=E.current.userLocation;if(!n)return;let{currentStepIdx:o,currentRouteIdx:s}=n,l=_H({stops:[e],userLocation:a}).filter(e=>"empty"!==e.type),u=[...r];u.splice(s+1,0,...l);
341let c=u.reduce((e,t,n)=>{var r;return(null==(r=e[n-1])?void 0:r.occupantId)===t.occupantId?e:e.push(t)&&e},[]);t?P({points:c,avoidStairs:i,startStepIdx:o}):(O(),S(c))},[x.route,x.stops,x.avoidStairs,P,O,S]),D=rc.useCallback(()=>{_({isDirectionsOpen:!x.isDirectionsOpen}),o.emit(`Directions#${!x.isDirectionsOpen?"Open":"Close"}`)},[x.isDirectionsOpen,o]),N=rc.useCallback(({stops:e,sourceId:t,sourceName:n,destinationId:r,destinationName:i,avoidStairs:a})=>{let s=_H({stops:e,sourceId:t,sourceName:n,destinationId:r,destinationName:i,userLocation:E.current.userLocation});_({stops:null!=s?s:x.stops,avoidStairs:null!=a?a:x.avoidStairs}),o.emit("Directions#Change",{stops:null!=s?s:x.stops,avoidStairs:null!=a?a:x.avoidStairs})},[x.stops,x.avoidStairs,o]),U=rc.useCallback(()=>{_({stops:SG.stops,avoidStairs:SG.avoidStairs})},[]),k=rc.useCallback(()=>{_({isDirectionsOpen:!1,stops:SW,route:null,userRoute:null}),o.emit("Directions#Close")},[o]),B=rc.useCallback(({stops:e,sourceId:t,sourceName:n,destinationId:r,destinationName:i,avoidStairs:a})=>{let s=_H({stops:e,sourceId:t,sourceName:n,destinationId:r,destinationName:i,userLocation:E.current.userLocation});_({isDirectionsOpen:!0,route:null,userRoute:null,stops:null!=s?s:x.stops,avoidStairs:null!=a?a:x.avoidStairs}),o.emit("Directions#Change",{stops:null!=s?s:x.stops,avoidStairs:null!=a?a:x.avoidStairs}),o.emit("Directions#Open")},[x.stops,x.avoidStairs,o]);rc.useEffect(()=>{var e;if(!x.route)return void _({steps:null,stepIdx:0});let t=((e,t,n,r,i)=>{let{routeStartStepThreshold:a,routeArriveStepThreshold:o,routeFromStepThreshold:s,routeFollowStepThreshold:l}=i,u=e=>`<b>${n(e)}</b>`,c="Start route at {{point}}",h="From {{prevPoint}} follow the route to {{point}}",d="Follow the route to {{point}}",p="Take {{point}} to {{level}}",f="Arrive at {{point}}",m=e.reduce((i,m,g)=>{var v,y,b,x,_;let w=g>0?e[g-1]:null,M=m.points[0].coordinates[0],E=m.points[m.points.length-1].coordinates[m.points[m.points.length-1].coordinates.length-1],S=m.points.flatMap(e=>e.coordinates),T=S.reduce((e,t,n)=>0===n?e:e+dr(S[n-1],t),0);if(0===g&&T>a&&!r){let e=c.replace("{{point}}",null==(v=t[0])?void 0:v.occupantId),r={stepIdx:g,routeIdx:m.routeIdx,point:M,titleDictionaryKey:e,title:n(e,n(c).replace("{{point}}",u(null!=(b=null==(y=t[0])?void 0:y.name)?b:"")))};i.push(r)}if(0!==g&&T>s){let e=h.replace("{{point}}",m.targetId).replace("{{prevPoint}}",null!=(x=null==w?void 0:w.targetId)?x:""),t={stepIdx:g,routeIdx:m.routeIdx,point:M,titleDictionaryKey:e,title:n(e,n(h).replace("{{point}}",u(m.targetName)).replace("{{prevPoint}}",u(null!=(_=null==w?void 0:w.targetName)?_:"")))};i.push(t)}if(0===g||T>l||r){let e=d.replace("{{point}}",m.targetId),t={stepIdx:g,routeIdx:m.routeIdx,titleDictionaryKey:e,title:n(e,n(d).replace("{{point}}",u(m.targetName)))};i.push(t)}if(m.isTransitionPoint){let e=p.replace("{{point}}",m.targetId).replace("{{level}}",m.targetLevel),t={stepIdx:g,routeIdx:m.routeIdx,point:E,titleDictionaryKey:e,title:n(e,n(p).replace("{{point}}",u(m.targetName)).replace("{{level}}",u(m.targetLevelName)))};i.push(t)}if(g===e.length-1&&T>o){let e=f.replace("{{point}}",m.targetId),t={stepIdx:g,routeIdx:m.routeIdx,point:E,titleDictionaryKey:e,title:n(e,n(f).replace("{{point}}",u(m.targetName)))};i.push(t)}return i},[]);return m.forEach((e,t)=>{e.idx=t,e.title=e.title.replace(/<\w+>/g,"<b>").replace(/<\/\w+>/g,"</b>")}),m})(x.route.steps,x.stops,s,x.isRouteFromUserLocation,{routeStartStepThreshold:g,routeArriveStepThreshold:v,routeFromStepThreshold:y,routeFollowStepThreshold:b});_({steps:f?f(t):t,stepIdx:null!=(e=x.route.startStepIdx)?e:0})},[x.route,x.stops,x.isRouteFromUserLocation,s,f,g,v,y,b]),rc.useEffect(()=>{let e=E.current.activeOrdinal,t=E.current.userLocation,n=x.isRouteFromUserLocation,r=x.stops,i=x.route,o=x.steps,s=null==o?void 0:o[x.stepIdx],l=i&&s?i.steps[s.stepIdx]:null;if(!s||!i||!l||!n||!w)return void _({userRoute:null});let u=r[0];u.latLng={lat:w.latitude,lng:w.longitude},u.ordinal=w.ordinal;let c=de([u,SH(l)],{avoidStairs:x.avoidStairs,extraTimeOptions:d}),h=null==c?void 0:c.steps[0];if(h.ordinal===l.ordinal&&h.routePoint===l.routePoint)return void _({userRoute:c});if(h.ordinal===l.ordinal&&h.routePoint!==l.routePoint)return void P({points:r,avoidStairs:x.avoidStairs,userLocation:w});if((w.ordinal!==t.ordinal||a.id!==e.id)&&w.ordinal===a.id&&h.ordinal!==l.ordinal){for(let e=x.stepIdx;e>=0;
341e--){let t=o[e],n=i.steps[t.stepIdx];if(w.ordinal!==n.ordinal||!t.titleDictionaryKey.startsWith("Follow the route"))continue;let a=r[0];a.latLng={lat:w.latitude,lng:w.longitude},a.ordinal=w.ordinal;let s=de([a,SH(n)],{avoidStairs:x.avoidStairs,extraTimeOptions:d}),l=s.steps[0];if(l.routePoint===n.routePoint)return void _({userRoute:s,stepIdx:e});if(l.routePoint!==n.routePoint)continue}P({points:r,avoidStairs:x.avoidStairs,userLocation:w})}},[x.avoidStairs,x.stops,x.route,x.steps,x.stepIdx,x.isRouteFromUserLocation,w,a,d,P]),rc.useEffect(()=>{if(!x.route||!x.steps)return;let e=x.steps[x.stepIdx];x.route.currentStepIdx=x.stepIdx,x.route.currentRouteIdx=e.routeIdx,o.emit("Route#StepChange",{stepIndex:x.stepIdx,step:e})},[x.route,x.stepIdx,x.steps,o]),rc.useEffect(()=>{var e;u(null!=(e=x.userRoute)?e:x.route)},[x.route,x.userRoute,u]);let F=rc.useMemo(()=>x$(e=>M(e),500),[]);rc.useEffect(()=>{F(e.userLocation)},[e.userLocation,F]),rc.useEffect(()=>{if(!r||r===E.current.mapLoaded)return;let e=new URLSearchParams(window.location.search),t=e.get("pcm_s"),n=e.get("pcm_f"),i=e.get("pcm_t"),a=e.get("pcm_as");return t?void I({stops:t.split(",").map(e=>({id:e.trim()})),avoidStairs:!!parseInt(a)}):n&&i?void I({stops:[{id:n},{id:i}],avoidStairs:!!parseInt(a)}):n||i?void B({stops:[{id:n},{id:i}],avoidStairs:!!parseInt(a)}):void 0},[B,I,r]),rc.useEffect(()=>{E.current=Sz(SF({},E.current),{userLocation:w,mapLoaded:r,activeOrdinal:a})},[w,r,a]),rc.useEffect(()=>(o.on("Directions#Set",N),o.on("Directions#Show",B),o.on("Directions#Hide",k),o.on("Directions#Clear",U),o.on("Route#Build",R),o.on("Route#Show",I),o.on("Route#Hide",O),o.on("Route#AddDestination",L),()=>{o.off("Directions#Set",N),o.off("Directions#Show",B),o.off("Directions#Hide",k),o.off("Directions#Clear",U),o.off("Route#Build",R),o.off("Route#Show",I),o.off("Route#Hide",O),o.off("Route#AddDestination",L)}),[o,N,B,k,U,R,I,O,L]),rc.useLayoutEffect(()=>{var e;let t=null==(e=null==n?void 0:n.container)?void 0:e.parentNode;t&&(x.isDirectionsOpen?t.classList.add("pcmap--directions"):t.classList.remove("pcmap--directions"),x.route?t.classList.add("pcmap--route"):t.classList.remove("pcmap--route"),x.stops.length>2?t.classList.add("pcmap--multi-point"):t.classList.remove("pcmap--multi-point"))},[n,x.isDirectionsOpen,x.route,x.stops]);let z=rc.useMemo(()=>Sz(SF({},x),{route:x.route&&x.steps?x.route:null,setStepIdx:A,setStops:S,setAvoidStairs:T,toggleDirections:D,closeDirections:k,showRoute:I,hideRoute:O}),[x,A,S,T,D,k,I,O]);return rc.createElement(Sj.Provider,{value:z},t)}))))),Sq=e=>{class t extends rc.Component{render(){let t=this.props,{forwardedRef:n}=t,r=((e,t)=>{var n={};for(var r in e)SU.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&SN)for(var r of SN(e))0>t.indexOf(r)&&Sk.call(e,r)&&(n[r]=e[r]);return n})(t,["forwardedRef"]);return rc.createElement(Sj.Consumer,null,t=>rc.createElement(e,SF(SF({ref:n},r),t)))}}return((e,t,n)=>SB(e,"symbol"!=typeof t?t+"":t,n))(t,"displayName","withDirectionsConsumer"),rc.forwardRef((e,n)=>rc.createElement(t,Sz(SF({},e),{forwardedRef:n})))};var SY=Object.defineProperty,SZ=Object.defineProperties,S$=Object.getOwnPropertyDescriptors,SK=Object.getOwnPropertySymbols,SJ=Object.prototype.hasOwnProperty,SQ=Object.prototype.propertyIsEnumerable,S0=(e,t,n)=>t in e?SY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S1=(e,t)=>{for(var n in t||(t={}))SJ.call(t,n)&&S0(e,n,t[n]);if(SK)for(var n of SK(t))SQ.call(t,n)&&S0(e,n,t[n]);return e},S2=(e,t)=>SZ(e,S$(t)),S3=(e,t,n)=>(S0(e,"symbol"!=typeof t?t+"":t,n),n);let{Provider:S5,Consumer:S4}=rc.createContext();class S6 extends rc.Component{constructor(){super(...arguments),S3(this,"state",{filteredOccupants:null,highlightAsSelected:!1,nonHighlightedMarkers:this.props.options.nonHighlightedMarkers,filterOccupants:(e,t={})=>{var n,r,i,a;if(!e&&this.state.filteredOccupants){this.setState({filteredOccupants:null}),this.props.events.emit("Markers#Unfiltered");return}if(!e)return;let o=null==(n=null==t?void 0:t.highlight)||n,s=null!=(r=null==t?void 0:t.highlightAsSelected)&&r,l=null!=(i=null==t?void 0:t.nonHighlightedMarkers)?i:this.props.options.nonHighlightedMarkers,u=null!=(a=null==t?void 0:t.showFilteredMarkers)?a:!this.props.route,c=Mr.occupants,{userLocation:h}=this.props;if(t.addDistanceToUserPosition&&h){let{ordinal:e,latitude:t,longitude:n}=h;c=c.map(r=>S2(S1({},r),{distanceToUserPosition:r.ordinalId===e?dr(r.coordinates,[t,n]):Number.MAX_SAFE_INTEGER}))}if(t.addDistanceToPOIs&&Array.isArray(t.addDistanceToPOIs)){let e=t.addDistanceToPOIs.map(e=>{let t=c.find(t=>
341t.id===e);return t||console.error(`Can't find POI with ID ${e}`),t}).filter(Boolean);c=c.map(t=>S2(S1({},t),{distanceToPOIs:e.map(e=>t.ordinalId===e.ordinalId?dr(t.coordinates,e.coordinates):Number.MAX_SAFE_INTEGER)}))}if(t.addDistanceToRoute){let{stops:e,sourceId:n,sourceName:r,destinationId:i,destinationName:a,avoidStairs:o=!1}=t.addDistanceToRoute,{route:s}=t.addDistanceToRoute,{userLocation:l}=this.props;s||(s=de(_H({stops:e,sourceId:n,sourceName:r,destinationId:i,destinationName:a,userLocation:l}),{avoidStairs:o,extraTimeOptions:this.props.options.extraTimeOptions,routeRules:this.props.options.routeRules})),c=c.map(e=>{let t=_j(e.coordinates,e.ordinalId,s);return S2(S1({},e),{distanceToRoute:t.distance})})}let d=c.filter(e);this.setState({highlightAsSelected:s,nonHighlightedMarkers:l,filteredOccupants:o?d.reduce((e,t)=>e.set(t.id,t)&&e,new Map):null},()=>{u&&this.state.fitMapToFilteredOccupants(),this.props.events.emit("Markers#Filtered",{markers:d})})},fitMapToFilteredOccupants:(e={})=>{var t,n;let{fitPoints:r,activeOrdinalId:i,setActiveOrdinal:a,options:{getMapPaddings:o,maxZoom:s}}=this.props,{filteredOccupants:l}=this.state,{keepActiveOrdinal:u}=e;if(!l||0===l.size)return;let c=Array.from(l.values()).reduce((e,t)=>{var n;let r=t.ordinalId,i=null!=(n=e.get(r))?n:[];return i.push(t),e.set(r,i),e},new Map),h=i,d=c.get(i);if(d||u){if(!d)return}else h=null!=(n=null==(t=(d=Array.from(c.values()).reduce((e,t)=>t.length>e.length?t:e,[]))[0])?void 0:t.ordinalId)?n:i;let p=d.map(e=>e.coordinates),f=o&&o()||{},m=f.paddingTop?f.paddingTop:0,g=f.paddingLeft?f.paddingLeft:0,v=f.paddingRight?f.paddingRight:0,y=f.paddingBottom?f.paddingBottom:0;i!==h&&a(h,{callback:()=>{r(p,{paddingTop:m,paddingLeft:g,paddingRight:v,paddingBottom:y,maxZoom:s})}}),r(p,{paddingTop:m,paddingLeft:g,paddingRight:v,paddingBottom:y,maxZoom:s})}})}componentDidMount(){this.props.events.on("Markers#Filter",({filters:e,options:t})=>e?"function"!=typeof e?void console.error("First argument must be a filter function"):void this.state.filterOccupants(e,t):void this.state.filterOccupants(null)),this.props.events.on("Map#OrdinalChanged",()=>{this.props.route||this.state.fitMapToFilteredOccupants({keepActiveOrdinal:!0})})}render(){return rc.createElement(S5,{value:this.state},this.props.children)}}let S8=MC(Mg(Sq(Eb(Ei(EG(S6)))))),S7=e=>{class t extends rc.Component{render(){let t=this.props,{forwardedRef:n}=t,r=((e,t)=>{var n={};for(var r in e)SJ.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&SK)for(var r of SK(e))0>t.indexOf(r)&&SQ.call(e,r)&&(n[r]=e[r]);return n})(t,["forwardedRef"]);return rc.createElement(S4,null,t=>rc.createElement(e,S1(S1({ref:n},r),t)))}}return S3(t,"displayName","withFiltersConsumer"),rc.forwardRef((e,n)=>rc.createElement(t,S2(S1({},e),{forwardedRef:n})))};function S9(e){return Array.isArray?Array.isArray(e):"[object Array]"===To(e)}let Te=1/0;function Tt(e){return"string"==typeof e}function Tn(e){return"number"==typeof e}function Tr(e){return"object"==typeof e}function Ti(e){return null!=e}function Ta(e){return!e.trim().length}function To(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let Ts=Object.prototype.hasOwnProperty;class Tl{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=Tu(e);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Tu(e){let t=null,n=null,r=null,i=1;if(Tt(e)||S9(e))r=e,t=Tc(e),n=Th(e);else{if(!Ts.call(e,"name"))throw Error("Missing name property in key");let a=e.name;if(r=a,Ts.call(e,"weight")&&(i=e.weight)<=0)throw Error(`Property 'weight' in key '${a}' must be a positive integer`);t=Tc(a),n=Th(a)}return{path:t,id:n,weight:i,src:r}}function Tc(e){return S9(e)?e:e.split(".")}function Th(e){return S9(e)?e.join("."):e}var Td={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(e,t){let n=[],r=!1,i=(e,t,a)=>{if(Ti(e))if(t[a]){var o,s;let l=e[t[a]];if(!Ti(l))return;if(a===t.length-1&&(Tt(l)||Tn(l)||!0===(o=l)||!1===o||Tr(s=o)&&null!==s&&"[object Boolean]"==To(o)))n.push(null==l?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-Te?"-0":t}(l));else if(S9(l)){r=!0;for(let e=0,n=l.length;e<n;e+=1)i(l[e],t,a+1)}else t.length&&i(l,t,a+1)}else n.push(e)};return i(e,Tt(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1};let Tp=/[^ ]+/g;class Tf{constructor({getFn:e=Td.getFn}={}){this.norm=function(e=3){let t=new Map,n=Math.pow(10,e);return{get(e){let r=e.match(Tp).length;if(t.has(r))return t.get(r);let i=parseFloat(Math.round(1/Math.sqrt(r)*n)/n);return t.set(r,i),i},clear(){t.clear()}}}(3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,Tt(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();Tt(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!Ti(e)||Ta(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(e,t){let n={i:t,$:{}};this.keys.forEach((t,r)=>{let i=this.getFn(e,t.path);if(Ti(i)){if(S9(i)){let e=[],t=[{nestedArrIndex:-1,value:i}];for(;t.length;){let{nestedArrIndex:n,value:r}=t.pop();if(Ti(r))if(Tt(r)&&!Ta(r)){let t={v:r,i:n,n:this.norm.get(r)};e.push(t)}else S9(r)&&r.forEach((e,n)=>{t.push({nestedArrIndex:n,value:e})})}n.$[r]=e}else if(!Ta(i)){let e={v:i,n:this.norm.get(i)};n.$[r]=e}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Tm(e,t,{getFn:n=Td.getFn}={}){let r=new Tf({getFn:n});return r.setKeys(e.map(Tu)),r.setSources(t),r.create(),r}function Tg(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:i=Td.distance,ignoreLocation:a=Td.ignoreLocation}={}){let o=t/e.length;if(a)return o;let s=Math.abs(r-n);return i?o+s/i:s?1:o}class Tv{constructor(e,{location:t=Td.location,threshold:n=Td.threshold,distance:r=Td.distance,includeMatches:i=Td.includeMatches,findAllMatches:a=Td.findAllMatches,minMatchCharLength:o=Td.minMatchCharLength,isCaseSensitive:s=Td.isCaseSensitive,ignoreLocation:l=Td.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreLocation:l},this.pattern=s?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;let u=(e,t)=>
341{this.chunks.push({pattern:e,alphabet:function(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}(e),startIndex:t})},c=this.pattern.length;if(c>32){let e=0,t=c%32,n=c-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=c-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,includeMatches:n}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return n&&(t.indices=[[0,e.length-1]]),t}let{location:r,distance:i,threshold:a,findAllMatches:o,minMatchCharLength:s,ignoreLocation:l}=this.options,u=[],c=0,h=!1;this.chunks.forEach(({pattern:t,alphabet:d,startIndex:p})=>{let{isMatch:f,score:m,indices:g}=function(e,t,n,{location:r=Td.location,distance:i=Td.distance,threshold:a=Td.threshold,findAllMatches:o=Td.findAllMatches,minMatchCharLength:s=Td.minMatchCharLength,includeMatches:l=Td.includeMatches,ignoreLocation:u=Td.ignoreLocation}={}){let c;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let h=t.length,d=e.length,p=Math.max(0,Math.min(r,d)),f=a,m=p,g=s>1||l,v=g?Array(d):[];for(;(c=e.indexOf(t,m))>-1;)if(f=Math.min(Tg(t,{currentLocation:c,expectedLocation:p,distance:i,ignoreLocation:u}),f),m=c+h,g){let e=0;for(;e<h;)v[c+e]=1,e+=1}m=-1;let y=[],b=1,x=h+d,_=1<<h-1;for(let r=0;r<h;r+=1){let a=0,s=x;for(;a<s;)Tg(t,{errors:r,currentLocation:p+s,expectedLocation:p,distance:i,ignoreLocation:u})<=f?a=s:x=s,s=Math.floor((x-a)/2+a);x=s;let l=Math.max(1,p-s+1),c=o?d:Math.min(p+s,d)+h,w=Array(c+2);w[c+1]=(1<<r)-1;for(let a=c;a>=l;a-=1){let o=a-1,s=n[e.charAt(o)];if(g&&(v[o]=+!!s),w[a]=(w[a+1]<<1|1)&s,r&&(w[a]|=(y[a+1]|y[a])<<1|1|y[a+1]),w[a]&_&&(b=Tg(t,{errors:r,currentLocation:o,expectedLocation:p,distance:i,ignoreLocation:u}))<=f){if(f=b,(m=o)<=p)break;l=Math.max(1,2*p-m)}}if(Tg(t,{errors:r+1,currentLocation:p,expectedLocation:p,distance:i,ignoreLocation:u})>f)break;y=w}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=function(e=[],t=Td.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&-1===r?r=a:o||-1===r||((i=a-1)-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}(v,s);e.length?l&&(w.indices=e):w.isMatch=!1}return w}(e,t,d,{location:r+p,distance:i,threshold:a,findAllMatches:o,minMatchCharLength:s,includeMatches:n,ignoreLocation:l});f&&(h=!0),c+=m,f&&g&&(u=[...u,...g])});let d={isMatch:h,score:h?c/this.chunks.length:1};return h&&n&&(d.indices=u),d}}class Ty{constructor(e){this.pattern=e}static isMultiMatch(e){return Tb(e,this.multiRegex)}static isSingleMatch(e){return Tb(e,this.singleRegex)}search(){}}function Tb(e,t){let n=e.match(t);return n?n[1]:null}class Tx extends Ty{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}}class T_ extends Ty{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}}class Tw extends Ty{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}}class TM extends Ty{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}}class TE extends Ty{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[e.length-this.pattern.length,e.length-1]}}}class TS extends Ty{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}}class TT extends Ty{constructor(e,{location:t=Td.location,threshold:n=Td.threshold,distance:r=Td.distance,includeMatches:i=Td.includeMatches,findAllMatches:a=Td.findAllMatches,minMatchCharLength:o=Td.minMatchCharLength,isCaseSensitive:s=Td.isCaseSensitive,ignoreLocation:l=Td.ignoreLocation}={}){super(e),this._bitapSearch=new Tv(e,{location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class TA extends Ty{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,n=0,r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);let a=!!r.length;return{isMatch:a,score:+!a,indices:r}}}let TC=[Tx,TA,Tw,TM,TS,TE,T_,TT],TR=TC.length,TP=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/,TI=new Set([TT.type,TA.type]);class TO{constructor(e,{isCaseSensitive:t=Td.isCaseSensitive,includeMatches:n=Td.includeMatches,minMatchCharLength:r=Td.minMatchCharLength,ignoreLocation:i=Td.ignoreLocation,findAllMatches:a=Td.findAllMatches,location:o=Td.location,threshold:s=Td.threshold,distance:l=Td.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:n,minMatchCharLength:r,findAllMatches:a,ignoreLocation:i,location:o,threshold:s,distance:l},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map(e=>{let n=e.trim().split(TP).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<TR;){let e=TC[o],n=e.isMultiMatch(i);n&&(r.push(new e(n,t)),a=!0)}if(!a)for(o=-1;++o<TR;){let e=TC[o],n=e.isSingleMatch(i);if(n){r.push(new e(n,t));break}}}return r})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r}=this.options;e=r?e:e.toLowerCase();let i=0,a=[],o=0;for(let r=0,s=t.length;r<s;r+=1){let s=t[r];a.length=0,i=0;for(let t=0,r=s.length;t<r;t+=1){let r=s[t],{isMatch:l,indices:u,score:c}=r.search(e);if(l){if(i+=1,o+=c,n){let e=r.constructor.type;TI.has(e)?a=[...a,...u]:a.push(u)}}else{o=0,i=0,a.length=0;break}}
341if(i){let e={isMatch:!0,score:o/i};return n&&(e.indices=a),e}}return{isMatch:!1,score:1}}}let TL=[];function TD(e,t){for(let n=0,r=TL.length;n<r;n+=1){let r=TL[n];if(r.condition(e,t))return new r(e,t)}return new Tv(e,t)}let TN={AND:"$and",OR:"$or"},TU={PATH:"$path",PATTERN:"$val"},Tk=e=>!!(e[TN.AND]||e[TN.OR]),TB=e=>({[TN.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function TF(e,t,{auto:n=!0}={}){let r=e=>{let i=Object.keys(e),a=!!e[TU.PATH];if(!a&&i.length>1&&!Tk(e))return r(TB(e));if(!S9(e)&&Tr(e)&&!Tk(e)){let r=a?e[TU.PATH]:i[0],o=a?e[TU.PATTERN]:e[r];if(!Tt(o))throw Error(`Invalid value for key ${r}`);let s={keyId:Th(r),pattern:o};return n&&(s.searcher=TD(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];S9(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return Tk(e)||(e=TB(e)),r(e)}function Tz(e,t){let n=e.matches;t.matches=[],Ti(n)&&n.forEach(e=>{if(!Ti(e.indices)||!e.indices.length)return;let{indices:n,value:r}=e,i={indices:n,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)})}function TH(e,t){t.score=e.score}class Tj{constructor(e,t={},n){this.options={...Td,...t},this.options.useExtendedSearch,this._keyStore=new Tl(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Tf))throw Error("Incorrect 'index' type");this._myIndex=t||Tm(this.options.keys,this._docs,{getFn:this.options.getFn})}add(e){Ti(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let n=0,r=this._docs.length;n<r;n+=1){let i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,r-=1,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){let{includeMatches:n,includeScore:r,shouldSort:i,sortFn:a,ignoreFieldNorm:o}=this.options,s=Tt(e)?Tt(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return!function(e,{ignoreFieldNorm:t=Td.ignoreFieldNorm}){e.forEach(e=>{let n=1;e.matches.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=Math.pow(0===i&&a?Number.EPSILON:i,(a||1)*(t?1:r))}),e.score=n})}(s,{ignoreFieldNorm:o}),i&&s.sort(a),Tn(t)&&t>-1&&(s=s.slice(0,t)),function(e,t,{includeMatches:n=Td.includeMatches,includeScore:r=Td.includeScore}={}){let i=[];return n&&i.push(Tz),r&&i.push(TH),e.map(e=>{let{idx:n}=e,r={item:t[n],refIndex:n};return i.length&&i.forEach(t=>{t(e,r)}),r})}(s,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){let t=TD(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:e,i:n,n:i})=>{if(!Ti(e))return;let{isMatch:a,score:o,indices:s}=t.searchIn(e);a&&r.push({item:e,idx:n,matches:[{score:o,value:e,norm:i,indices:s}]})}),r}_searchLogical(e){let t=TF(e,this.options),n=(e,t,r)=>{if(!e.children){let{keyId:n,searcher:i}=e,a=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i});return a&&a.length?[{idx:r,item:t,matches:a}]:[]}switch(e.operator){case TN.AND:{let i=[];for(let a=0,o=e.children.length;a<o;a+=1){let o=n(e.children[a],t,r);if(!o.length)return[];i.push(...o)}return i}case TN.OR:{let i=[];for(let a=0,o=e.children.length;a<o;a+=1){let o=n(e.children[a],t,r);if(o.length){i.push(...o);break}}return i}}},r=this._myIndex.records,i={},a=[];return r.forEach(({$:e,i:r})=>{if(Ti(e)){let o=n(t,e,r);o.length&&(i[r]||(i[r]={idx:r,item:e,matches:[]},a.push(i[r])),o.forEach(({matches:e})=>{i[r].matches.push(...e)}))}}),a}_searchObjectList(e){let t=TD(e,this.options),{keys:n,records:r}=this._myIndex,i=[];return r.forEach(({$:e,i:r})=>{if(!Ti(e))return;let a=[];n.forEach((n,r)=>{a.push(...this._findMatches({key:n,value:e[r],searcher:t}))}),a.length&&i.push({idx:r,item:e,matches:a})}),i}_findMatches({key:e,value:t,searcher:n}){if(!Ti(t))return[];let r=[];if(S9(t))t.forEach(({v:t,i:i,n:a})=>{if(!Ti(t))return;let{isMatch:o,score:s,indices:l}=n.searchIn(t);o&&r.push({score:s,key:e,value:t,idx:i,norm:a,indices:l})});else{let{v:i,n:a}=t,{isMatch:o,score:s,indices:l}=n.searchIn(i);o&&r.push({score:s,key:e,value:i,norm:a,indices:l})}return r}}Tj.version="6.4.6",Tj.createIndex=Tm,Tj.parseIndex=function(e,{getFn:t=Td.getFn}={}){let{keys:n,records:r}=e,i=new Tf({getFn:t});return i.setKeys(n),i.setIndexRecords(r),i},Tj.config=Td,Tj.parseQuery=TF,function(...e){TL.push(...e)}(TO);var TW=Object.defineProperty,TG=Object.defineProperties,TV=Object.getOwnPropertyDescriptors,TX=Object.getOwnPropertySymbols,Tq=Object.prototype.hasOwnProperty,TY=Object.prototype.propertyIsEnumerable,TZ=(e,t,n)=>t in e?TW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T$=(e,t)=>{for(var n in t||(t={}))Tq.call(t,n)&&TZ(e,n,t[n]);if(TX)for(var n of TX(t))TY.call(t,n)&&TZ(e,n,t[n]);return e};let TK=rc.createContext(),TJ=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}),TQ=Eb(function({children:e,ordinals:t}){let{getText:n}=MF(),r=rc.useMemo(()=>{let e=_r([...t.values()].flatMap(e=>e.occupants).filter(e=>e.category.showInSearchResult),"id").map(e=>{let t=e.id,r=mP(n(e.name)),i=e.category.fullPath.map(e=>mP(n(e))),a=e.extraCategories.flatMap(e=>e.fullPath.map(e=>mP(n(e)))),o=Array.from(new Set(r.match(/[\p{L}\d]+/gu))).filter(e=>e.length>1),s=n(e.keywords),l=e.category.keywords?n(e.category.keywords):[],u=s.concat(l).flatMap(e=>e.match(/[\p{L}\d]+/gu));return{id:t,name:r,nameParts:o,startWithNameParts:o,fuzzyNameParts:o,category:i,extraCategories:a,occupantKeywords:s,categoryKeywords:l,allKe
341ywordsParts:u,occupant:e}}).sort((e,t)=>TJ.compare(e.name,t.name)),r={shouldSort:!0,includeScore:!0,includeMatches:!0,isCaseSensitive:!1,findAllMatches:!0,useExtendedSearch:!0,ignoreLocation:!0,ignoreFieldNorm:!1,fieldNormWeight:2,threshold:.2,maxPatternLength:36,minMatchCharLength:2,keys:[{name:"id",weight:1e4},{name:"name",weight:1e4},{name:"occupantKeywords",weight:5e3},{name:"nameParts",weight:1e3},{name:"fuzzyNameParts",weight:100},{name:"startWithNameParts",weight:100},{name:"category",weight:300},{name:"categoryKeywords",weight:300},{name:"extraCategories",weight:100},{name:"allKeywordsParts",weight:100}]};return new Tj(e,r,Tj.createIndex(r.keys,e))},[t,n]),i=rc.useCallback(e=>{if(!e)return[];let t=Array.from(new Set((e=mP(e).trim()).match(/[\p{L}\d|$]+/gu))),n=[{id:`="${e}"`}],i=[{name:`="${e}"`}],a=[{occupantKeywords:`="${e}"`}],o=t.map(e=>({nameParts:`="${e}"`})),s=[{name:`^"${e}"`}],l=t.map(e=>({startWithNameParts:`^"${e}"`})),u=t.map(e=>({category:`^"${e}"`})),c=[{categoryKeywords:`="${e}"`}],h=t.map(e=>({extraCategories:`^"${e}"`})),d=t.map(e=>({allKeywordsParts:`^"${e}"`})),p=t.map(e=>({fuzzyNameParts:`"${e}"`})),f={$or:n.concat(i).concat(a).concat(s).concat(o).concat(u).concat(c).concat(h).concat(d).concat(l).concat(p)};return r.search(f).map(e=>e.item.occupant).sort((e,t)=>e.order<t.order?-1:+(e.order>t.order))},[r]),a=rc.useMemo(()=>({searchOccupants:i}),[i]);return rc.createElement(TK.Provider,{value:a},e)});function T0(e){let t=rc.useCallback(t=>{let n=window.matchMedia(e);return n.addEventListener("change",t),()=>{n.removeEventListener("change",t)}},[e]);return rc.useSyncExternalStore(t,()=>window.matchMedia(e).matches,()=>{throw Error("useMediaQuery is a client-only hook")})}function T1(){let e=(0,rh.useTheme)(),t=T0(e.mq.portrait),n=T0(e.mq.landscape),r=(0,rc.useRef)({isPortrait:t,isLandscape:n});return(0,rc.useEffect)(()=>{r.current={isPortrait:t,isLandscape:n}},[t,n]),{ref:r,isPortrait:t,isLandscape:n}}let T2=[{showDot:!1,showIcon:!0,showTitle:!0,minimization:!1},{showDot:!0,showIcon:!1,showTitle:!0,minimization:!0},{showDot:!1,showIcon:!1,showTitle:!0,minimization:!0},{showDot:!1,showIcon:!0,showTitle:!1,minimization:!0},{showDot:!0,showIcon:!1,showTitle:!1,minimization:!0},{showDot:!1,showIcon:!1,showTitle:!1,minimization:!0,nothing:!0}],T3=(e,t)=>
341{let n=Math.min(e.right,t.right)-Math.max(e.left,t.left),r=Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top);return n>=0&&r>=0?n*r:0},T5=!!window.navigator.msSaveOrOpenBlob,T4=!window.URL||!window.URL.createObjectURL,T6=T5||T4?function(e){e.forEach(e=>{let t=e.bounds.reduce(({top:e,bottom:t,left:n,right:r},i)=>({top:Math.min(e,i.top),bottom:Math.max(t,i.bottom),left:Math.min(n,i.left),right:Math.max(r,i.right)}),{top:e.bounds[0].top,bottom:e.bounds[0].bottom,left:e.bounds[0].left,right:e.bounds[0].right});e.maxBounds=t}),e.sort((e,t)=>e.maxBounds.left-t.maxBounds.left);let t=new Map(e.map(e=>[e.id,{marker:e,intersections:new Map,intersectionArea:0}]));for(let n=0;n<e.length;n++){let r=e[n],i=t.get(r.id);for(let a=n+1;a<e.length;a++){let n=e[a],o=t.get(n.id);if(r.maxBounds.right<n.maxBounds.left)break;let s=T3(r.maxBounds,n.maxBounds);!(s<=0)&&(!r.selected&&r.priority<=n.priority&&(i.intersections.set(n.id,n),i.intersectionArea+=s),!n.selected&&n.priority<=r.priority&&(o.intersections.set(r.id,r),o.intersectionArea+=s),r.selected&&n.selected&&(i.intersections.set(n.id,n),i.intersectionArea+=s,o.intersections.set(r.id,r),o.intersectionArea+=s))}}let n=[],r=(e,n)=>{e.forEach((e,i)=>{if(n.has(e))return;n.add(e),e.cluster=n;let{intersections:a}=t.get(i);r(a,n)})};return t.forEach(({marker:e,intersections:t})=>{!e.cluster&&(e.cluster=new Set([e]),r(t,e.cluster),e.cluster.size>1&&n.push(e.cluster))}),n.forEach(e=>{Array.from([...e.values()].reduce((e,t)=>{let n=e.get(t.priority)||[];return n.push(t),e.set(t.priority,n),e},new Map).entries()).sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0])).map(e=>e[1]).forEach(e=>{let n=e.sort((e,n)=>t.get(e.id).intersectionArea-t.get(n.id).intersectionArea),r=e.sort((e,n)=>{let r=t.get(e.id).intersectionArea;return t.get(n.id).intersectionArea-r});T2.forEach(e=>{(e.minimization?r:n).forEach(n=>{if(e.nothing&&n.bounds.some(({showDot:e,showTitle:t})=>e&&!t)||50>(e=>{let{intersections:n}=t.get(e.id);return[...n.values()].reduce((t,n)=>t+T3(e.bestBounds,n.bestBounds),0)})(n))return;let{intersections:r}=t.get(n.id),{bestBounds:i,intersectionArea:a}=n.bounds.filter(t=>t.showDot===e.showDot&&t.showIcon===e.showIcon&&t.showTitle===e.showTitle).reduce((e,t)=>{let n=[...r.values()].reduce((e,n)=>e+T3(t,n.bestBounds),0);return n<e.intersectionArea?{bestBounds:t,intersectionArea:n}:e},{bestBounds:n.bounds[0],intersectionArea:1/0});n.bestBounds=i,n.intersectionArea=a})})})}),e}:function(){let e,t,n=new Blob(['const t=[{showDot:!1,showIcon:!0,showTitle:!0,minimization:!1},{showDot:!0,showIcon:!1,showTitle:!0,minimization:!0},{showDot:!1,showIcon:!1,showTitle:!0,minimization:!0},{showDot:!1,showIcon:!0,showTitle:!1,minimization:!0},{showDot:!0,showIcon:!1,showTitle:!1,minimization:!0},{showDot:!1,showIcon:!1,showTitle:!1,minimization:!0,nothing:!0}],e=(t,e)=>{const o=Math.min(t.right,e.right)-Math.max(t.left,e.left),s=Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top);return o>=0&&s>=0?o*s:0};function o(o){o.forEach(t=>{const e=t.bounds.reduce(({top:t,bottom:e,left:o,right:s},n)=>({top:Math.min(t,n.top),bottom:Math.max(e,n.bottom),left:Math.min(o,n.left),right:Math.max(s,n.right)}),{top:t.bounds[0].top,bottom:t.bounds[0].bottom,left:t.bounds[0].left,right:t.bounds[0].right});t.maxBounds=e}),o.sort((t,e)=>t.maxBounds.left-e.maxBounds.left);const s=new Map(o.map(t=>[t.id,{marker:t,intersections:new Map,intersectionArea:0}]));for(let t=0;t<o.length;t++){const n=o[t],i=s.get(n.id);for(let r=t+1;r<o.length;r++){const t=o[r],a=s.get(t.id);if(n.maxBounds.right<t.maxBounds.left)break;const c=e(n.maxBounds,t.maxBounds);c<=0||(!n.selected&&n.priority<=t.priority&&(i.intersections.set(t.id,t),i.intersectionArea+=c),!t.selected&&t.priority<=n.priority&&(a.intersections.set(n.id,n),a.intersectionArea+=c),n.selected&&t.selected&&(i.intersections.set(t.id,t),i.intersectionArea+=c,a.intersections.set(n.id,n),a.intersectionArea+=c))}}const n=[],i=(t,e)=>{t.forEach((t,o)=>{if(e.has(t))return;
341e.add(t),t.cluster=e;const{intersections:n}=s.get(o);i(n,e)})};s.forEach(({marker:t,intersections:e})=>{t.cluster||(t.cluster=new Set([t]),i(e,t.cluster),t.cluster.size>1&&n.push(t.cluster))});return n.forEach(o=>{const n=[...o.values()].reduce((t,e)=>{const o=t.get(e.priority)||[];return o.push(e),t.set(e.priority,o),t},new Map);Array.from(n.entries()).sort((t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0).map(t=>t[1]).forEach(o=>{const n=o.sort((t,e)=>s.get(t.id).intersectionArea-s.get(e.id).intersectionArea),i=o.sort((t,e)=>{const o=s.get(t.id).intersectionArea;return s.get(e.id).intersectionArea-o});t.forEach(t=>{(t.minimization?i:n).forEach(o=>{if(t.nothing&&o.bounds.some(({showDot:t,showTitle:e})=>t&&!e))return;if((t=>{const{intersections:o}=s.get(t.id);return[...o.values()].reduce((o,s)=>o+e(t.bestBounds,s.bestBounds),0)})(o)<50)return;const{intersections:n}=s.get(o.id),i=o.bounds.filter(e=>e.showDot===t.showDot&&e.showIcon===t.showIcon&&e.showTitle===t.showTitle),{bestBounds:r,intersectionArea:a}=i.reduce((t,o)=>{const s=[...n.values()].reduce((t,s)=>t+e(o,s.bestBounds),0);return s<t.intersectionArea?{bestBounds:o,intersectionArea:s}:t},{bestBounds:o.bounds[0],intersectionArea:1/0});o.bestBounds=r,o.intersectionArea=a})})})}),o}self.onmessage=function(t){const{type:e,payload:s}=t.data,{timestamp:n,markersBounds:i}=JSON.parse(s);if("getOptimizedMarkersBounds"===e){const t=o(i),e=JSON.stringify({timestamp:n,optimizedMarkersBounds:t});self.postMessage({type:"setOptimizedMarkersBounds",payload:e})}}']),r=new Worker(window.URL.createObjectURL(n));return r.onmessage=({data:n})=>{let{type:r,payload:i}=n,{timestamp:a,optimizedMarkersBounds:o}=JSON.parse(i);"setOptimizedMarkersBounds"===r&&a===e&&(t=o)},async n=>{let i=Date.now();e=i,t=null;let a=new Promise((n,r)=>{let a=()=>{setTimeout(()=>{e===i?Array.isArray(t)?n(t):a():r("The data is out of date")},100)};a()}),o=JSON.stringify({timestamp:i,markersBounds:n});return r.postMessage({type:"getOptimizedMarkersBounds",payload:o}),a}}(),T8=(e,t)=>Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2),T7=(e,{dotDistanceThreshold:t,clusterDistanceThreshold:n})=>{let r=[],i=[];for(let a=0;a<e.length;a++)if(!i.includes(a)){r.push(e[a]);for(let r=a+1;r<e.length;r++){if(i.includes(r))continue;let o=0;if(o=e[a].ids.length>1&&e[r].ids.length>1?n:e[a].ids.length>1||e[r].ids.length>1?n/2+.2*n:t,T8(e[a].center,e[r].center)<=o){e[a].center=di(e[a].center,e[r].center),e[a].ids=e[a].ids.concat(e[r].ids),i.push(r);break}}}return r},T9=async({map:e,mapProjection:t,events:n,zoom:r,activeOrdinal:i,selectedOccupants:a,filteredOccupants:o,customMarkers:s,dotDistanceThreshold:l,clusterDistanceThreshold:u,nonHighlightedMarkers:c,highlightAsSelected:h})=>{let d,p=new Set(a),f=i.occupants.map(e=>{let{id:t,category:n,marker:i,coordinates:a}=e;if(!i.inView||!i.boundsReady||i.lock)return null;let s=p.has(t),l=null==o?void 0:o.has(t),u=!1,h=!1,d=!1;if(s)u=!1,h=!0,d=!0;else if(l)u=!0,h=!0,d=!0;else if(!1===l&&"hidden"===c)u=!1,h=!1,d=!1;else{let e=n.dotMinZoom||0,t=n.dotMaxZoom||1e3;u=e<=r&&r<=t;let i=n.iconMinZoom||0,a=n.iconMaxZoom||1e3;h=i<=r&&r<=a;let o=n.titleMinZoom||0,s=n.titleMaxZoom||1e3;d=o<=r&&r<=s}return{id:t,marker:i,coordinates:a,priority:l?Number.MAX_VALUE:n.priority,highlighted:l,selected:s,showDot:u,showIcon:h,showTitle:d,clusteringIdentifier:s?"selected":l?"highlighted":e.clusteringIdentifier||n.clusteringIdentifier||"default"}}).filter(Boolean).concat(s.filter(({ordinal:e})=>
341!Number.isFinite(e)||e===i.id)),m=new Map(f.map(e=>[e.id,e])),g=f.filter(({showDot:e,showIcon:t,showTitle:n})=>e||t||n).map(({id:e,priority:t=0,highlighted:n,selected:r,marker:i,showDot:a,showIcon:o,showTitle:s})=>{let l=i.bounds;n&&h&&(l=l.filter(e=>e.showIcon||e.showDot&&!e.showTitle)),a||(l=l.filter(e=>!e.showDot)),o||(l=l.filter(e=>!e.showIcon)),s||(l=l.filter(e=>!e.showTitle)),(a||o)&&(l=l.filter(e=>!(!e.showDot&&!e.showIcon&&e.showTitle)));let u=l.find(e=>e.showIcon&&e.showTitle&&e.titlePosition===i.titlePositions.RIGHT)||l[0];return{id:e,priority:t,bounds:l,bestBounds:u,selected:r||n&&h}});try{let e=await T6(g);d=new Map(e.map(e=>[e.id,e]))}catch(e){return}if(f.forEach(({id:e,marker:t,highlighted:n,selected:r,showDot:i,showIcon:a,showTitle:o})=>{let s=d.get(e),l=s?s.bestBounds:null;l&&(i=l.showDot,a=l.showIcon,o=l.showTitle),t.selected=r||n&&h,t.visible=i||a||o,t.showDot=i,t.showIcon=a,t.showTitle=o,t.dimmed=!t.selected&&t.visible&&!1===n&&"semi-visible"===c,t.readyToRender=!0,l&&(t.titlePosition=!o||a||i?l.titlePosition:t.titlePositions.CENTER),n?t.addClass("pcmap-marker--highlighted"):!1===n?t.addClass("pcmap-marker--non-highlighted"):(t.removeClass("pcmap-marker--highlighted"),t.removeClass("pcmap-marker--non-highlighted")),r?t.addClass("pcmap-marker--selected"):t.removeClass("pcmap-marker--selected")}),l>=0){let e=f.filter(({marker:e})=>e.showDot&&!e.showTitle&&!e.showIcon).reduce((e,t)=>{let n=t.clusteringIdentifier,r=e.get(n)||[];return r.push(t),e.set(n,r),e},new Map),r=new Map;e.forEach((e,t)=>{let n=function(e,t){let n,{dotDistanceThreshold:r=12,clusterDistanceThreshold:i=32}=t||{},a=e.map(({id:e,bounds:t})=>({center:[t.left+t.width/2,t.top+t.height/2],ids:[e]}));do n=a.length,a=T7(a,{dotDistanceThreshold:r,clusterDistanceThreshold:i});while(a.length!==n);return a.filter(e=>e.ids.length>1).map(({center:e,ids:t})=>({center:e,ids:t,id:function(e){let t=0;if(0===e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t>>>0}(t.join(":"))}))}(e.map(({id:e})=>{var t,n;return{id:e,bounds:null!=(n=null==(t=d.get(e))?void 0:t.bestBounds)?n:null}}),{dotDistanceThreshold:"highlighted"===t?48:l,clusterDistanceThreshold:"highlighted"===t?32:u});n.forEach(e=>{e.groupName=t,e.occupants=e.ids.map(e=>i.occupantsMap.get(e)).filter(Boolean),e.highlighted=o?"highlighted"===t:null}
341),n.forEach(e=>{r.set(e.id,e)})}),r.forEach(e=>{e.coordinates=e.ids.reduce((e,t)=>{let n=m.get(t);return n?e?di(e,n.coordinates):n.coordinates:e},null)}),i.mapOrdinal.traverse(e=>{if(!e.isCluster)return;let t=r.get(e.clusterId);t?(t.marker=e,t.marker.coordinates=t.coordinates):(i.mapOrdinal.remove(e),e.dispose())}),r.forEach(e=>{if(e.occupants.forEach(({marker:e})=>{e.visible=!1}),e.marker)return;let r=new wE(e.coordinates,{clusterId:e.id,title:e.ids.length,titleScale:e.highlighted&&h?1.5:1,selected:e.highlighted,mapProjection:t});r.readyToRender=!0,r.visible=!0,r.interactive=!0,r.showDot=!1,r.showIcon=!1,r.dimmed=!1===e.highlighted&&"semi-visible"===c,r.addClass(`pcmap-cluster-${e.groupName.replace(/\W+/g,"_").toLowerCase()}`),r.addClass(`pcmap-cluster-${e.id}`),r.addEventListener("click",()=>{n.emit("Cluster#Click",{id:e.id,coordinates:e.coordinates,clusteringIdentifier:e.groupName,occupants:e.occupants})}),i.mapOrdinal.add(r)})}e.refresh()},Ae=(()=>{let e;return x$((...t)=>{cancelAnimationFrame(e),e=requestAnimationFrame(()=>{T9(...t)})},100,{leading:!1,trailing:!0})})();var At=Mg(MC(function({map:e,mapProjection:t,options:n,highlightAsSelected:r,nonHighlightedMarkers:i,filteredOccupants:a,selectedOccupants:o,setSelectedOccupants:s,ordinals:l,activeOrdinal:u,events:c}){let[h,d]=rc.useState(n.zoom),[p,f]=rc.useState(n.tilt),[m,g]=rc.useState(n.rotation),[v,y]=rc.useState(!1),[b,x]=rc.useState(Date.now()),[_,w]=rc.useState([]);rc.useEffect(()=>{let e=({id:e,latitude:t,longitude:n,ordinal:r})=>{if(!e||!r&&!(t&&n))return;let{occupant:i,currentOrdinal:a,askedOrdinal:o}=Array.from(l.values()).reduce((t,n)=>{let i=n.occupantsMap.get(e),a=i?n:t.currentOrdinal,o=n.id===r?n:t.askedOrdinal;return{occupant:null!=i?i:t.occupant,currentOrdinal:a,askedOrdinal:o}},{occupant:null,currentOrdinal:null,askedOrdinal:null});o&&o!==a&&(i.ordinalId=r,o.occupantsMap.set(i.id,i),o.occupants=Array.from(o.occupantsMap.values()),o.mapOrdinal.add(i.marker),a.occupantsMap.delete(i.id),a.occupants=Array.from(a.occupantsMap.values()),a.mapOrdinal.remove(i.marker)),Number.isFinite(t)&&Number.isFinite(n)&&(i.coordinates=[t,n],i.marker.coordinates=i.coordinates),x(Date.now())};return c.on("Occupant#SetLocation",e),()=>{c.off("Occupant#SetLocation",e)}},[c,l]),rc.useEffect(()=>{let n=[],r=({marker:e})=>{var r,i,a,o,s,l,u,c,h,d,p;if(!e||!e.id||n.some(({id:t})=>t===e.id)||!Number.isFinite(e.latitude)||!Number.isFinite(e.longitude))return;let f=[e.latitude,e.longitude],m=new wE(f,{title:null!=(r=e.title)?r:"",icon:null!=(i=e.icon)?i:"",color:null!=(a=e.color)?a:"",mapProjection:t,rotateX:e.rotateX,rotateY:e.rotateY,rotateZ:e.rotateZ,height:e.height,flippable:e.flippable,scalable:e.scalable});m.addClass(null!=(o=e.cssClass)?o:"pcmap-custom-marker"),n.push({coordinates:f,id:e.id,marker:m,ordinal:e.ordinal,priority:null!=(s=e.priority)?s:0,highlighted:null!=(l=e.highlighted)&&l,selected:null!=(u=e.selected)&&u,showDot:null==(c=e.showDot)||c,showIcon:null==(h=e.showIcon)||h,showTitle:null==(d=e.showTitle)||d,clusteringIdentifier:null!=(p=e.clusteringIdentifier)?p:"__custom-markers__"}),w([...n])},i=({marker:t})=>{let r=n.find(({id:e})=>t.id===e);r&&("string"==typeof t.title&&(r.marker.titleText=t.title),Number.isFinite(t.latitude)&&Number.isFinite(t.longitude)&&(r.marker.coordinates=[t.latitude,t.longitude],e.refresh()),Number.isFinite(t.ordinal)&&(r.ordinal=t.ordinal,w([...n])))},a=({marker:e})=>{let t="object"==typeof e?e.id:e,r=n.findIndex(({id:e})=>e===t);n.splice(r,1),w([...n])};return c.on("Markers#AddMarker",r),c.on("Markers#UpdateMarker",i),c.on("Markers#RemoveMarker",a),()=>{c.off("Markers#AddMarker",r),c.off("Markers#UpdateMarker",i),c.off("Markers#RemoveMarker",a)}},[e,c,t]),rc.useEffect(()=>{let t=_.filter(({ordinal:e})=>!Number.isFinite(e)||e===u.id);return t.forEach(({marker:e})=>{u.mapOrdinal.add(e)}),e.refresh(),()=>{t.forEach(({marker:e})=>{u.mapOrdinal.remove(e)})}},[e,u,_]),rc.useEffect(()=>{if(!e)return;let t=x$(({zoom:e})=>{d(e)},150,{leading:!1,trailing:!0});e.addEventListener("zoomChangeSequence",t);let n=({zoom:e})=>{d(e)};e.addEventListener("zoomChange",n);let r=e=>
341{e.user||(y(!0),l.forEach(e=>{e.occupants.forEach(e=>{e.marker.selected||(e.marker.lock=!0)})}))};e.addEventListener("zoomChangeBegin",r);let i=e=>{e.user||(y(!1),l.forEach(e=>{e.occupants.forEach(e=>{e.marker.lock=!1})}))};e.addEventListener("zoomChangeEnd",i);let a=vA(({rotation:e})=>{g(e)},50,{leading:!1,trailing:!0});e.addEventListener("rotationChangeSequence",a);let o=({rotation:e})=>{g(e)};e.addEventListener("rotationChange",o);let s=vA(({tilt:e})=>{f(e)},50,{leading:!1,trailing:!0});e.addEventListener("tiltChangeSequence",s);let u=({tilt:e})=>{f(e)};return e.addEventListener("tiltChange",u),()=>{e.removeEventListener("zoomChange",n),e.removeEventListener("zoomChangeSequence",t),e.removeEventListener("zoomChangeBegin",r),e.removeEventListener("zoomChangeEnd",i),e.removeEventListener("rotationChange",o),e.removeEventListener("tiltChange",u),e.removeEventListener("rotationChangeSequence",a),e.removeEventListener("tiltChangeSequence",s)}},[e,l]),rc.useLayoutEffect(()=>{v||Ae({map:e,mapProjection:t,events:c,zoom:h,activeOrdinal:u,selectedOccupants:o,filteredOccupants:a,highlightAsSelected:r,nonHighlightedMarkers:i,customMarkers:_,dotDistanceThreshold:n.dotDistanceThreshold,clusterDistanceThreshold:n.clusterDistanceThreshold})},[e,t,c,h,m,p,u,o,a,r,i,b,_,n.dotDistanceThreshold,n.clusterDistanceThreshold,v]),rc.useEffect(()=>{let e=new Set;return u.occupants.forEach(t=>{let{id:n,marker:r}=t,i=()=>{s(o.includes(n)?[]:[n]),c.emit("Marker#Click",t)};e.add({marker:r,clickHandler:i}),r.addEventListener("click",i)}),()=>{e.forEach(t=>{let{marker:n,clickHandler:r}=t;n.removeEventListener("click",r),e.delete(t)})}},[u,o,s,c]);let M=rc.useCallback(vA(()=>{x(Date.now())},50,{leading:!1,trailing:!0}),[x]);return rc.useEffect(()=>{let e=new Set;return u.occupants.forEach(({marker:t})=>{let n=()=>{M()},r=()=>{M()};e.add({marker:t,type:"sizeChanged",handler:n}),e.add({marker:t,type:"inView",handler:r}),t.addEventListener("sizeChanged",n),t.addEventListener("inView",r)}),()=>{e.forEach(({marker:t,type:n,handler:r})=>{t.removeEventListener(n,r),e.delete(r)})}},[u,M]),null}));function An(e){let{events:t}=MA(),{map:n,activeOrdinal:r,filteredOccupants:i,selectedOccupants:a,setSelectedOccupants:o}=e;return(0,rc.useEffect)(()=>{if(n){if(!i){n.basemap.mapsIndoors.filter(null),n.basemap.mapsIndoors.highlight(null);return}(async()=>{let e=(await window.mapsindoors.services.LocationsService.getLocations({})).filter(e=>"poi"!==e.properties.locationType||i.has(e.properties.externalId));n.basemap.mapsIndoors.filter(e.map(e=>e.id),!1),n.basemap.mapsIndoors.highlight(e.filter(e=>"poi"===e.properties.locationType).map(e=>e.id),!1)})()}},[n,i]),(0,rc.useEffect)(()=>{if(n)return(null==a?void 0:a.length)?((async()=>{let e=await window.mapsindoors.services.LocationsService.getLocationsByExternalId(a),t=i?await window.mapsindoors.services.LocationsService.getLocationsByExternalId(Array.from(i.keys().toArray())):[];n.basemap.mapsIndoors.setDisplayRule(e.map(e=>e.id),{iconSize:{width:40,height:40}}),n.basemap.mapsIndoors.highlight([...e.map(e=>e.id),...t.map(e=>e.id)],!1)})(),()=>{(async()=>{let e=await window.mapsindoors.services.LocationsService.getLocationsByExternalId(a),t=i?await window.mapsindoors.services.LocationsService.getLocationsByExternalId(Array.from(i.keys().toArray())):[];n.basemap.mapsIndoors.setDisplayRule(e.map(e=>e.id),null),n.basemap.mapsIndoors.highlight(t.map(e=>e.id))})()}):void n.basemap.mapsIndoors.deselectLocation()},[n,a,i]),(0,rc.useEffect)(()=>{if(!n)return;let e=e=>{let n=e.properties.externalId,i=r.occupantsMap.get(n);i&&(o(a.includes(i.id)?[]:[i.id]),t.emit("Marker#Click",i))};return n.basemap.mapsIndoors.on("click",e),()=>{n.basemap.mapsIndoors.off("click",e)}},[n,r,t,a,o]),null}let Ar=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
342  <circle cx="12px" cy="14.4187px" r="0.38" fill="#3884f340" style="transform-origin: 12px 14.4187px; transition: transform 1s ease-out;" />
343  <path fill="#3884F3" d="M11.752.3006a.3504.3504 0 0 1 .527 0l6.3738 7.2677c.1987.2266.0378.5817-.2636.5817H5.6418c-.3014 0-.4623-.355-.2636-.5817L11.752.3006Z"/>
344  <path fill="#fff" d="M11.7481 1.726a.3506.3506 0 0 1 .5271 0l5.2978 6.041c.1987.2265.0378.5816-.2635.5816H6.7139c-.3014 0-.4623-.355-.2636-.5816l5.2978-6.041Z"/>
345  <path fill="#3884F3" d="M11.7481 3.5489a.3506.3506 0 0 1 .5271 0l5.2978 6.0409c.1987.2265.0378.5816-.2635.5816H6.7139c-.3014 0-.4623-.355-.2636-.5816l5.2978-6.041Z"/>
346  <path fill="#3884F3" d="M21.593 14.4187c0 5.2916-4.2897 9.5813-9.5813 9.5813-5.2916 0-9.5813-4.2897-9.5813-9.5813 0-5.2916 4.2897-9.5813 9.5813-9.5813 5.2916 0 9.5813 4.2897 9.5813 9.5813Z"/>
347  <path fill="#fff" d="M20.1909 14.4187c0 4.5172-3.6619 8.1792-8.1792 8.1792-4.5172 0-8.1791-3.662-8.1791-8.1792s3.6619-8.1792 8.1791-8.1792c4.5173 0 8.1792 3.662 8.1792 8.1792Z"/>
348  <path fill="#3884F3" d="M18.4382 14.4187c0 3.5493-2.8772 6.4265-6.4265 6.4265-3.5492 0-6.4265-2.8772-6.4265-6.4265 0-3.5492 2.8773-6.4265 6.4265-6.4265 3.5493 0 6.4265 2.8773 6.4265 6.4265Z" style="
349    transform-origin: 12px 14.4187px;
350  ">
351    <animateTransform
352      attributeName="transform"
353      type="scale"
354      begin="0s"
355      dur="2s"
356      values="1;0.8;1"
357      repeatCount="indefinite"
358      additive="sum"
359    />
360  </path>
361</svg>`;function Ai(e){let{map:t,mapProjection:n,activeOrdinal:r,location:i,heading:a}=e,[o,s]=rc.useState(null),l=rc.useRef(null);return rc.useEffect(()=>{if(!t)return;let e=new wE([0,0],{icon:Ar,category:"user-location",title:"",color:"",mapProjection:n,height:.1,rotateX:-90,flippable:!1,scalable:!1});e.addClass("pcmap-user-location"),l.current=e.htmlElement.querySelector(".pcmap-marker-icon"),s(e)},[t,n]),rc.useEffect(()=>{let e=Number.isFinite(i.ordinal)&&r.id===i.ordinal;if(t&&o&&e)return o.readyToRender=!0,r.mapOrdinal.add(o),t.refresh(),()=>{r.mapOrdinal.remove(o)}},[t,o,n,r,i.ordinal]),rc.useEffect(()=>{t&&o&&i&&(l.current.style.transform=`rotateZ(${null!=a?a:0}deg)`,l.current.style.transition="opacity 200ms, transform 1000ms",o.coordinates=[i.latitude,i.longitude],t.refresh())},[t,o,i,a]),rc.useEffect(()=>{if(!t||!o||!Number.isFinite(i.accuracy))return;let e=l.current.querySelector("circle"),n=()=>{let n=((e,t)=>{switch(t.type){case"MapboxEngine":return e*(.0048*Math.pow(1.7415,t.zoom)/40);case"MapEngine":return e*(.0111*Math.pow(1.6146,t.zoom)/25)}})(Math.min(40,i.accuracy),t);e.style.transform=`scale(${n})`};return n(),t.addEventListener("zoomChange",n),t.addEventListener("zoomChangeSequence",n),()=>{t.removeEventListener("zoomChange",n),t.removeEventListener("zoomChangeSequence",n)}},[t,o,i.accuracy]),null}let Aa=rh.default.div`
362  width: 100%;
363  height: 100%;
364  overflow: hidden;
365`;var Ao=S7(Mg(Eb(EG(function(e){let{initMap:t,map:n,mapLoaded:r,mapProjection:i,zoom:a,rotation:o,tilt:s,geoDataTimestamp:l,ordinals:u,activeOrdinal:c,selectedOccupants:h,setSelectedOccupants:d,filteredOccupants:p,highlightAsSelected:f,nonHighlightedMarkers:m,userLocation:g,userHeading:v,options:y}=e,b=rc.useRef(null);return rc.useEffect(()=>{b&&t(b.current)},[b,t]),rc.createElement(rc.Fragment,null,rc.createElement(Aa,{ref:b}),r&&n&&"internal"===y.markersProvider&&rc.createElement(At,{key:l,map:n,mapProjection:i,zoom:a,rotation:o,tilt:s,ordinals:u,activeOrdinal:c,selectedOccupants:h,setSelectedOccupants:d,filteredOccupants:p,highlightAsSelected:f,nonHighlightedMarkers:m}),r&&n&&"mapsindoors"===y.markersProvider&&rc.createElement(An,{map:n,activeOrdinal:c,setSelectedOccupants:d,selectedOccupants:h,filteredOccupants:p}),r&&g&&c&&rc.createElement(Ai,{map:n,mapProjection:i,location:g,heading:v,activeOrdinal:c}))}))));function As(){return(As=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var Al=function(e){return rc.createElement("svg",As({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 256 512"},e),eJ||(eJ=rc.createElement("path",{fill:"currentColor",d:"M24.7 38.1 5 57.9a12 12 0 0 0 0 17L185.6 256 5 437.1a12 12 0 0 0 0 17l19.8 19.8a12 12 0 0 0 17 0L251 264.5a12 12 0 0 0 0-17L41.7 38.1a12 12 0 0 0-17 0z"})))};function Au(){return(Au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var Ac={exports:{}},Ah={exports:{}},Ad={};Ac.exports=(function(){if(e4)return e5;e4=1;var e=e3?e2:(e3=1,e2="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,e5=function(){function r(t,n,r,i,a,o){if(o!==e){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function i(){return r}r.isRequired=r;var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a}})()();var Ap={};function Af(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function Am(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function Ag(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n,r=getComputedStyle(e,null);return Am(r.overflowY,t)||Am(r.overflowX,t)||!!(n=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e))&&(n.clientHeight<e.scrollHeight||n.clientWidth<e.scrollWidth)}return!1}function Av(e,t,n,r,i,a,o,s){return a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0}!function(){if(!e6){e6=1;var e=60103,t=60106,n=60107,r=60108,i=60114,a=60109,o=60110,s=60112,l=60113,u=60120,c=60115,h=60116,d=60121,p=60122,f=60117,m=60129,g=60131;if("function"==typeof Symbol&&Symbol.for){var v=Symbol.for;e=v("react.element"),t=v("react.portal"),n=v("react.fragment"),r=v("react.strict_mode"),i=v("react.profiler"),a=v("react.provider"),o=v("react.context"),s=v("react.forward_ref"),l=v("react.suspense"),u=v("react.suspense_list"),c=v("react.memo"),h=v("react.lazy"),d=v("react.block"),p=v("react.server.block"),f=v("react.fundamental"),m=v("react.debug_trace_mode"),g=v("react.legacy_hidden")}var y=a,b=e,x=s,_=n,w=h,M=c,E=t,S=i,T=r,A=l;Ap.ContextConsumer=o,Ap.ContextProvider=y,Ap.Element=b,Ap.ForwardRef=x,Ap.Fragment=_,Ap.Lazy=w,Ap.Memo=M,Ap.Portal=E,Ap.Profiler=S,Ap.StrictMode=T,Ap.Suspense=A,Ap.isAsyncMode=function(){return!1},Ap.isConcurrentMode=function(){return!1},Ap.isContextConsumer=function(e){return C(e)===o},Ap.isContextProvider=function(e){return C(e)===a},Ap.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},Ap.isForwardRef=function(e){return C(e)===s},Ap.isFragment=function(e){return C(e)===n},Ap.isLazy=function(e){return C(e)===h},Ap.isMemo=function(e){return C(e)===c},Ap.isPortal=function(e){return C(e)===t},Ap.isProfiler=function(e){return C(e)===i},Ap.isStrictMode=function(e){return C(e)===r},Ap.isSuspense=function(e){return C(e)===l},Ap.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===i||e===m||e===r||e===l||e===u||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===c||e.$$typeof===a||e.$$typeof===o||e.$$typeof===s||e.$$typeof===f||e.$$typeof===d||e[0]===p)||!1},Ap.typeOf=C}function C(d){if("object"==typeof d&&null!==d){var p=d.$$typeof;switch(p){case e:switch(d=d.type){case n:case i:case r:case l:case u:return d;default:switch(d=d&&d.$$typeof){case o:case s:case h:case c:case a:return d;default:return p}}case t:return p}}}}();var Ay=function(e,t){var n=window,r=t.scrollMode,i=t.block,a=t.inline,o=t.boundary,s=t.skipOverflowHiddenElements,l="function"==typeof o?o:function(e){return e!==o};if(!Af(e))throw TypeError("Invalid target");for(var u,c,h=document.scrollingElement||document.documentElement,d=[],p=e;Af(p)&&l(p);){if((p=null==(c=(u=p).parentElement)?u.getRootNode().host||null:c)===h){d.push(p);break}null!=p&&p===document.body&&Ag(p)&&!Ag(document.documentElement)||null!=p&&Ag(p,s)&&d.push(p)}
365for(var f=n.visualViewport?n.visualViewport.width:innerWidth,m=n.visualViewport?n.visualViewport.height:innerHeight,g=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,y=e.getBoundingClientRect(),b=y.height,x=y.width,_=y.top,w=y.right,M=y.bottom,E=y.left,S="start"===i||"nearest"===i?_:"end"===i?M:_+b/2,T="center"===a?E+x/2:"end"===a?w:E,A=[],C=0;C<d.length;C++){var R=d[C],P=R.getBoundingClientRect(),I=P.height,O=P.width,L=P.top,D=P.right,N=P.bottom,U=P.left;if("if-needed"===r&&_>=0&&E>=0&&M<=m&&w<=f&&_>=L&&M<=N&&E>=U&&w<=D)break;var k=getComputedStyle(R),B=parseInt(k.borderLeftWidth,10),F=parseInt(k.borderTopWidth,10),z=parseInt(k.borderRightWidth,10),H=parseInt(k.borderBottomWidth,10),j=0,W=0,G="offsetWidth"in R?R.offsetWidth-R.clientWidth-B-z:0,V="offsetHeight"in R?R.offsetHeight-R.clientHeight-F-H:0,X="offsetWidth"in R?0===R.offsetWidth?0:O/R.offsetWidth:0,q="offsetHeight"in R?0===R.offsetHeight?0:I/R.offsetHeight:0;if(h===R)j="start"===i?S:"end"===i?S-m:"nearest"===i?Av(v,v+m,m,F,H,v+S,v+S+b,b):S-m/2,W="start"===a?T:"center"===a?T-f/2:"end"===a?T-f:Av(g,g+f,f,B,z,g+T,g+T+x,x),j=Math.max(0,j+v),W=Math.max(0,W+g);else{j="start"===i?S-L-F:"end"===i?S-N+H+V:"nearest"===i?Av(L,N,I,F,H+V,S,S+b,b):S-(L+I/2)+V/2,W="start"===a?T-U-B:"center"===a?T-(U+O/2)+G/2:"end"===a?T-D+z+G:Av(U,D,O,B,z+G,T,T+x,x);var Y=R.scrollLeft,Z=R.scrollTop;S+=Z-(j=Math.max(0,Math.min(Z+j/q,R.scrollHeight-I/q+V))),T+=Y-(W=Math.max(0,Math.min(Y+W/X,R.scrollWidth-O/X+G)))}A.push({el:R,top:j,left:W})}return A},Ab=function(){return(Ab=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;let Ax=0;function A_(e){return"function"==typeof e?e:Aw}function Aw(){}function AM(e,t){e&&Ay(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}
365).forEach(e=>{let{el:t,top:n,left:r}=e;t.scrollTop=n,t.scrollLeft=r})}function AE(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function AS(e,t){let n;function r(){n&&clearTimeout(n)}function i(){for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];r(),n=setTimeout(()=>{n=null,e(...a)},t)}return i.cancel=r,i}function AT(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(t=>(t&&t(e,...r),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault))}}function AA(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{t.forEach(t=>{"function"==typeof t?t(e):t&&(t.current=e)})}}function AC(e){let{isOpen:t,resultCount:n,previousResultCount:r}=e;return t?n?n!==r?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function AR(e,t){return(e=Array.isArray(e)?e[0]:e)||!t?e:t}let AP=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function AI(e){void 0===e&&(e={});let t={};return AP.forEach(n=>{e.hasOwnProperty(n)&&(t[n]=e[n])}),t}function AO(e,t){return void 0!==e[t]}function AL(e){let{key:t,keyCode:n}=e;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function AD(e,t,n,r,i){if(void 0===i&&(i=!0),0===n)return -1;let a=n-1;("number"!=typeof t||t<0||t>=n)&&(t=e>0?-1:a+1);let o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);let s=AN(e,o,n,r,i);return -1===s?t>=n?-1:t:s}function AN(e,t,n,r,i){let a=r(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(let e=t+1;e<n;e++)if(!r(e).hasAttribute("disabled"))return e}else for(let e=t-1;e>=0;e--)if(!r(e).hasAttribute("disabled"))return e;return i?e>0?AN(1,0,n,r,!1):AN(-1,n-1,n,r,!1):-1}function AU(e,t,n,r){return void 0===r&&(r=!0),t.some(t=>t&&(AE(t,e,n)||r&&AE(t,n.document.activeElement,n)))}let Ak=AS(e=>{AF(e).textContent=""},500);function AB(e,t){let n=AF(t);e&&(n.textContent=e,Ak(t))}function AF(e){void 0===e&&(e=document);let t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t)),t}var Az=Object.freeze({__proto__:null,unknown:0,mouseUp:1,itemMouseEnter:2,keyDownArrowUp:3,keyDownArrowDown:4,keyDownEscape:5,keyDownEnter:6,keyDownHome:7,keyDownEnd:8,clickItem:9,blurInput:10,changeInput:11,keyDownSpaceButton:12,clickButton:13,blurButton:14,controlledPropUpdatedSelectedItem:15,touchEnd:16});let AH=(()=>{class e extends rc.Component{constructor(e){var t;super(e),t=this,this.id=this.props.id||"downshift-"+String(Ax++),this.menuId=this.props.menuId||this.id+"-menu",this.labelId=this.props.labelId||this.id+"-label",this.inputId=this.props.inputId||this.id+"-input",this.getItemId=this.props.getItemId||(e=>this.id+"-item-"+e),this.input=null,this.items=[],this.itemCount=null,this.previousResultCount=0,this.timeoutIds=[],this.internalSetTimeout=(e,t)=>{let n=setTimeout(()=>{this.timeoutIds=this.timeoutIds.filter(e=>e!==n),e()},t);this.timeoutIds.push(n)},this.setItemCount=e=>{this.itemCount=e},this.unsetItemCount=()=>{this.itemCount=null},this.setHighlightedIndex=function(e,n){void 0===e&&(e=t.props.defaultHighlightedIndex),void 0===n&&(n={}),n=AI(n),t.internalSetState({highlightedIndex:e,...n})},this.clearSelection=e=>{this.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:this.props.defaultHighlightedIndex,isOpen:this.props.defaultIsOpen},e)},this.selectItem=(e,t,n)=>{t=AI(t),this.internalSetState({isOpen:this.props.defaultIsOpen,highlightedIndex:this.props.defaultHighlightedIndex,selectedItem:e,inputValue:this.props.itemToString(e),...t},n)},this.selectItemAtIndex=(e,t,n)=>{let r=this.items[e];null!=r&&this.selectItem(r,t,n)},this.selectHighlightedItem=(e,t)=>
365this.selectItemAtIndex(this.getState().highlightedIndex,e,t),this.internalSetState=(e,t)=>{let n,r,i={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&this.props.onInputValueChange(e.inputValue,{...this.getStateAndHelpers(),...e}),this.setState(t=>{t=this.getState(t);let o=a?e(t):e;n=(o=this.props.stateReducer(t,o)).hasOwnProperty("selectedItem");let s={};return n&&o.selectedItem!==t.selectedItem&&(r=o.selectedItem),o.type=o.type||0,Object.keys(o).forEach(e=>{t[e]!==o[e]&&(i[e]=o[e]),"type"!==e&&(o[e],AO(this.props,e)||(s[e]=o[e]))}),a&&o.hasOwnProperty("inputValue")&&this.props.onInputValueChange(o.inputValue,{...this.getStateAndHelpers(),...o}),s},()=>{A_(t)(),Object.keys(i).length>1&&this.props.onStateChange(i,this.getStateAndHelpers()),n&&this.props.onSelect(e.selectedItem,this.getStateAndHelpers()),void 0!==r&&this.props.onChange(r,this.getStateAndHelpers()),this.props.onUserAction(i,this.getStateAndHelpers())})},this.rootRef=e=>this._rootNode=e,this.getRootProps=function(e,n){let{refKey:r="ref",ref:i,...a}=void 0===e?{}:e,{suppressRefError:o=!1}=void 0===n?{}:n;t.getRootProps.called=!0,t.getRootProps.refKey=r,t.getRootProps.suppressRefError=o;let{isOpen:s}=t.getState();return{[r]:AA(i,t.rootRef),role:"combobox","aria-expanded":s,"aria-haspopup":"listbox","aria-owns":s?t.menuId:null,"aria-labelledby":t.labelId,...a}},this.keyDownHandlers={ArrowDown(e){if(e.preventDefault(),this.getState().isOpen){let t=e.shiftKey?5:1;this.moveHighlightedIndex(t,{type:4})}else this.internalSetState({isOpen:!0,type:4},()=>{let e=this.getItemCount();if(e>0){let{highlightedIndex:t}=this.getState(),n=AD(1,t,e,e=>this.getItemNodeFromIndex(e));this.setHighlightedIndex(n,{type:4})}})},ArrowUp(e){if(e.preventDefault(),this.getState().isOpen){let t=e.shiftKey?-5:-1;this.moveHighlightedIndex(t,{type:3})}else this.internalSetState({isOpen:!0,type:3},()=>{let e=this.getItemCount();if(e>0){let{highlightedIndex:t}=this.getState(),n=AD(-1,t,e,e=>this.getItemNodeFromIndex(e));this.setHighlightedIndex(n,{type:3})}})},Enter(e){if(229===e.which)return;let{isOpen:t,highlightedIndex:n}=this.getState();if(t&&null!=n){e.preventDefault();let t=this.items[n],r=this.getItemNodeFromIndex(n);if(null==t||r&&r.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}},Escape(e){e.preventDefault(),this.reset({type:5,...!this.state.isOpen&&{selectedItem:null,inputValue:""}})}}
365,this.buttonKeyDownHandlers={...this.keyDownHandlers," "(e){e.preventDefault(),this.toggleMenu({type:12})}},this.inputKeyDownHandlers={...this.keyDownHandlers,Home(e){let{isOpen:t}=this.getState();if(!t)return;e.preventDefault();let n=this.getItemCount();if(n<=0||!t)return;let r=AN(1,0,n,e=>this.getItemNodeFromIndex(e),!1);this.setHighlightedIndex(r,{type:7})},End(e){let{isOpen:t}=this.getState();if(!t)return;e.preventDefault();let n=this.getItemCount();if(n<=0||!t)return;let r=AN(-1,n-1,n,e=>this.getItemNodeFromIndex(e),!1);this.setHighlightedIndex(r,{type:8})}},this.getToggleButtonProps=function(e){let{onClick:n,onPress:r,onKeyDown:i,onKeyUp:a,onBlur:o,...s}=void 0===e?{}:e,{isOpen:l}=t.getState(),u={onClick:AT(n,t.buttonHandleClick),onKeyDown:AT(i,t.buttonHandleKeyDown),onKeyUp:AT(a,t.buttonHandleKeyUp),onBlur:AT(o,t.buttonHandleBlur)};return{type:"button",role:"button","aria-label":l?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0,...s.disabled?{}:u,...s}},this.buttonHandleKeyUp=e=>{e.preventDefault()},this.buttonHandleKeyDown=e=>{let t=AL(e);
365this.buttonKeyDownHandlers[t]&&this.buttonKeyDownHandlers[t].call(this,e)},this.buttonHandleClick=e=>{e.preventDefault(),this.props.environment.document.activeElement===this.props.environment.document.body&&e.target.focus(),this.internalSetTimeout(()=>this.toggleMenu({type:13}))},this.buttonHandleBlur=e=>{let t=e.target;this.internalSetTimeout(()=>{this.isMouseDown||null!=this.props.environment.document.activeElement&&this.props.environment.document.activeElement.id===this.inputId||this.props.environment.document.activeElement===t||this.reset({type:14})})},this.getLabelProps=e=>({htmlFor:this.inputId,id:this.labelId,...e}),this.getInputProps=function(e){let{onKeyDown:n,onBlur:r,onChange:i,onInput:a,onChangeText:o,...s}=void 0===e?{}:e,l={},{inputValue:u,isOpen:c,highlightedIndex:h}=t.getState();return s.disabled||(l={onChange:AT(i,a,t.inputHandleChange),onKeyDown:AT(n,t.inputHandleKeyDown),onBlur:AT(r,t.inputHandleBlur)}),{"aria-autocomplete":"list","aria-activedescendant":c&&"number"==typeof h&&h>=0?t.getItemId(h):null,"aria-controls":c?t.menuId:null,"aria-labelledby":t.labelId,autoComplete:"off",value:u,id:t.inputId,...l,...s}},this.inputHandleKeyDown=e=>{let t=AL(e);t&&this.inputKeyDownHandlers[t]&&this.inputKeyDownHandlers[t].call(this,e)},this.inputHandleChange=e=>{this.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:this.props.defaultHighlightedIndex})},this.inputHandleBlur=()=>{this.internalSetTimeout(()=>{let e=this.props.environment.document&&!!this.props.environment.document.activeElement&&!!this.props.environment.document.activeElement.dataset&&this.props.environment.document.activeElement.dataset.toggle&&this._rootNode&&this._rootNode.contains(this.props.environment.document.activeElement);this.isMouseDown||e||this.reset({type:10})})},this.menuRef=e=>{this._menuNode=e},this.getMenuProps=function(e,n){let{refKey:r="ref",ref:i,...a}=void 0===e?{}:e,{suppressRefError:o=!1}=void 0===n?{}:n;return t.getMenuProps.called=!0,t.getMenuProps.refKey=r,t.getMenuProps.suppressRefError=o,{[r]:AA(i,t.menuRef),role:"listbox","aria-labelledby":a&&a["aria-label"]?null:t.labelId,id:t.menuId,...a}},this.getItemProps=function(e){let{onMouseMove:n,onMouseDown:r,onClick:i,onPress:a,index:o,item:s,...l}=void 0===e?{}:e;void 0===o?(t.items.push(s),o=t.items.indexOf(s)):t.items[o]=s;let u={onMouseMove:AT(n,()=>{o!==t.getState().highlightedIndex&&(t.setHighlightedIndex(o,{type:2}),t.avoidScrolling=!0,t.internalSetTimeout(()=>t.avoidScrolling=!1,250))}),onMouseDown:AT(r,e=>{e.preventDefault()}),onClick:AT(i,()=>{t.selectItemAtIndex(o,{type:9})})},c=l.disabled?{onMouseDown:u.onMouseDown}:u;return{id:t.getItemId(o),role:"option","aria-selected":t.getState().highlightedIndex===o,...c,...l}},this.clearItems=()=>{this.items=[]},this.reset=function(e,n){void 0===e&&(e={}),e=AI(e),t.internalSetState(n=>{let{selectedItem:r}=n;return{isOpen:t.props.defaultIsOpen,highlightedIndex:t.props.defaultHighlightedIndex,inputValue:t.props.itemToString(r),...e}},n)},this.toggleMenu=function(e,n){void 0===e&&(e={}),e=AI(e),t.internalSetState(n=>{let{isOpen:r}=n;return{isOpen:!r,...r&&{highlightedIndex:t.props.defaultHighlightedIndex},...e}},()=>{let{isOpen:r,highlightedIndex:i}=t.getState();r&&t.getItemCount()>0&&"number"==typeof i&&t.setHighlightedIndex(i,e),A_(n)()})},this.openMenu=e=>{this.internalSetState({isOpen:!0},e)},this.closeMenu=e=>{this.internalSetState({isOpen:!1},e)},this.updateStatus=AS(()=>{let e=this.getState(),t=this.items[e.highlightedIndex],n=this.getItemCount(),r=this.props.getA11yStatusMessage({itemToString:this.props.itemToString,previousResultCount:this.previousResultCount,resultCount:n,highlightedItem:t,...e});this.previousResultCount=n,AB(r,this.props.environment.document)},200);let{defaultHighlightedIndex:n,initialHighlightedIndex:r=n,defaultIsOpen:i,initialIsOpen:a=i,initialInputValue:o="",initialSelectedItem:s=null}=this.props,l=this.getState({highlightedIndex:r,isOpen:a,inputValue:o,selectedItem:s});null!=l.selectedItem&&void 0===this.props.initialInputValue&&(l.inputValue=this.props.itemToString(l.selectedItem)),this.state=l}
365internalClearTimeouts(){this.timeoutIds.forEach(e=>{clearTimeout(e)}),this.timeoutIds=[]}getState(e){var t,n;return void 0===e&&(e=this.state),t=e,n=this.props,Object.keys(t).reduce((e,r)=>(e[r]=AO(n,r)?n[r]:t[r],e),{})}getItemCount(){let e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e}getItemNodeFromIndex(e){return this.props.environment.document.getElementById(this.getItemId(e))}scrollHighlightedItemIntoView(){{let e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)}}moveHighlightedIndex(e,t){let n=this.getItemCount(),{highlightedIndex:r}=this.getState();if(n>0){let i=AD(e,r,n,e=>this.getItemNodeFromIndex(e));this.setHighlightedIndex(i,t)}}getStateAndHelpers(){let{highlightedIndex:e,inputValue:t,selectedItem:n,isOpen:r}=this.getState(),{itemToString:i}=this.props,{id:a}=this,{getRootProps:o,getToggleButtonProps:s,getLabelProps:l,getMenuProps:u,getInputProps:c,getItemProps:h,openMenu:d,closeMenu:p,toggleMenu:f,selectItem:m,selectItemAtIndex:g,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,reset:_,setItemCount:w,unsetItemCount:M,internalSetState:E}=this;return{getRootProps:o,getToggleButtonProps:s,getLabelProps:l,getMenuProps:u,getInputProps:c,getItemProps:h,reset:_,openMenu:d,closeMenu:p,toggleMenu:f,selectItem:m,selectItemAtIndex:g,selectHighlightedItem:v,setHighlightedIndex:y,clearSelection:b,clearItems:x,setItemCount:w,unsetItemCount:M,setState:E,itemToString:i,id:a,highlightedIndex:e,inputValue:t,isOpen:r,selectedItem:n}}componentDidMount(){{let e=()=>{this.isMouseDown=!0},t=e=>{this.isMouseDown=!1,!AU(e.target,[this._rootNode,this._menuNode],this.props.environment)&&this.getState().isOpen&&this.reset({type:1},()=>this.props.onOuterClick(this.getStateAndHelpers()))},n=()=>{this.isTouchMove=!1},r=()=>{this.isTouchMove=!0},i=e=>{let t=AU(e.target,[this._rootNode,this._menuNode],this.props.environment,!1);this.isTouchMove||t||!this.getState().isOpen||this.reset({type:16},()=>this.props.onOuterClick(this.getStateAndHelpers()))},{environment:a}=this.props;a.addEventListener("mousedown",e),a.addEventListener("mouseup",t),a.addEventListener("touchstart",n),a.addEventListener("touchmove",r),a.addEventListener("touchend",i),this.cleanup=()=>{this.internalClearTimeouts(),this.updateStatus.cancel(),a.removeEventListener("mousedown",e),a.removeEventListener("mouseup",t),a.removeEventListener("touchstart",n),a.removeEventListener("touchmove",r),a.removeEventListener("touchend",i)}}}shouldScroll(e,t){let{highlightedIndex:n}=void 0===this.props.highlightedIndex?this.getState():this.props,{highlightedIndex:r}=void 0===t.highlightedIndex?e:t;return n&&this.getState().isOpen&&!e.isOpen||n!==r}componentDidUpdate(e,t){AO(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()}componentWillUnmount(){this.cleanup()}render(){let e=AR(this.props.children,Aw);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;let t=AR(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:"string"==typeof t.type?(0,rc.cloneElement)(t,this.getRootProps(t.props)):void 0:null}}return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:AC,itemToString:e=>null==e?"":String(e),onStateChange:Aw,onInputValueChange:Aw,onUserAction:Aw,onChange:Aw,onSelect:Aw,onOuterClick:Aw,selectedItemChanged:(e,t)=>e!==t,environment:"undefined"==typeof window?{}:window,stateReducer:(e,t)=>t,suppressRefError:!1,scrollIntoView:AM},e.stateChangeTypes=Az,e})();AS((e,t)=>{AB(e(),t)},200);let Aj={itemToString:function(e){return e?String(e):""},stateReducer:function(e,t){return t.changes},getA11ySelectionMessage:function(e){let{selectedItem:t,itemToString:n}=e;return t?n(t)+" has been selected.":""},scrollIntoView:AM,circularNavigation:!1,environment:"undefined"==typeof window?{}:window};Ac.exports.array.isRequired,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.bool,Ac.exports.number,Ac.exports.number,Ac.exports.number,Ac.exports.bool,Ac.exports.bool,Ac.exports.bool,Ac.exports.any,Ac.exports.any,Ac.exports.any,Ac.exports.string,A
365c.exports.string,Ac.exports.string,Ac.exports.func,Ac.exports.string,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.shape({addEventListener:Ac.exports.func,removeEventListener:Ac.exports.func,document:Ac.exports.shape({getElementById:Ac.exports.func,activeElement:Ac.exports.any,body:Ac.exports.any})}),Ab(Ab({},Aj),{getA11yStatusMessage:function(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(1===n?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}}),Ac.exports.array.isRequired,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.bool,Ac.exports.number,Ac.exports.number,Ac.exports.number,Ac.exports.bool,Ac.exports.bool,Ac.exports.bool,Ac.exports.any,Ac.exports.any,Ac.exports.any,Ac.exports.string,Ac.exports.string,Ac.exports.string,Ac.exports.string,Ac.exports.string,Ac.exports.string,Ac.exports.func,Ac.exports.string,A
365c.exports.string,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.shape({addEventListener:Ac.exports.func,removeEventListener:Ac.exports.func,document:Ac.exports.shape({getElementById:Ac.exports.func,activeElement:Ac.exports.any,body:Ac.exports.any})}),({...Aj,getA11yStatusMessage:AC,circularNavigation:!0}),Ac.exports.array,Ac.exports.array,Ac.exports.array,Ac.exports.func,Ac.exports.func,Ac.exports.func,Ac.exports.number,Ac.exports.number,Ac.exports.number,Ac.exports.func,Ac.exports.func,Ac.exports.string,Ac.exports.string,Ac.exports.shape({addEventListener:Ac.exports.func,removeEventListener:Ac.exports.func,document:Ac.exports.shape({getElementById:Ac.exports.func,activeElement:Ac.exports.any,body:Ac.exports.any})}),Aj.itemToString,Aj.stateReducer,Aj.environment;let AW=rh.default.li`
366  padding: 0 1.36666em;
367  font-weight: bold;
368  cursor: pointer;
369
370  > div {
371    display: flex;
372    align-items: center;
373    min-height: 3.5em;
374    padding: 0.83333em 0;
375    border-bottom: 1px solid #d9dce7;
376  }
377
378  &:last-child {
379    > div {
380      border: none;
381    }
382  }
383
384  :hover {
385    color: #1415fa;
386    background-color: #f7f7fb;
387  }
388`,AG=rh.default.div`
389  position: relative;
390  flex-shrink: 0;
391  width: 2.2222em;
392  height: 2.2222em;
393  margin-right: 1em;
394
395  &:before {
396    content: '';
397    position: absolute;
398    top: 0px;
399    left: 0px;
400    width: 100%;
401    height: 100%;
402    border-radius: 100%;
403    background-color: ${({color:e})=>e};
404    filter: blur(5px);
405    opacity: 0.5;
406    z-index: 1;
407  }
408
409  svg,
410  img {
411    position: absolute;
412    top: 0;
413    left: 0;
414    flex-shrink: 0;
415    height: 2.222222em;
416    color: ${({color:e})=>e};
417    z-index: 2;
418  }
419`;function AV(){return(AV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var AX=function(e){return rc.createElement("svg",AV({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 300 300"},e),e8||(e8=rc.createElement("circle",{cx:150,cy:150,r:115,stroke:"currentColor",strokeWidth:20})),e7||(e7=rc.createElement("path",{fill:"currentColor",d:"M211.62 150a61.62 61.62 0 1 1-123.24 0 61.62 61.62 0 0 1 123.24 0Z"})),e9||(e9=rc.createElement("path",{stroke:"currentColor",strokeWidth:21,d:"M150.5 300v-30m0-240V0M30 150.5H0m300 0h-30"})))},Aq=Object.defineProperty,AY=Object.getOwnPropertySymbols,AZ=Object.prototype.hasOwnProperty,A$=Object.prototype.propertyIsEnumerable,AK=(e,t,n)=>t in e?Aq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let AJ=(0,rh.default)(AX)`
420  transform: scale(0.8);
421  color: #657096;
422`,AQ=(0,rh.default)(AG)`
423  img {
424    opacity: 1;
425  }
426`;var A0=Mz(({getItemProps:e,getText:t})=>rc.createElement(AW,((e,t)=>{for(var n in t||(t={}))AZ.call(t,n)&&AK(e,n,t[n]);if(AY)for(var n of AY(t))A$.call(t,n)&&AK(e,n,t[n]);return e})({className:"pcmap-search-item pcmap-search-item__your-location"},e({item:{id:"__your-location__"}})),rc.createElement("div",null,rc.createElement(AQ,{className:"pcmap-search-item__icon"},rc.createElement(AJ,null)),t("Your location"))));function A1(){return(A1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var A2=Object.defineProperty,A3=Object.getOwnPropertySymbols,A5=Object.prototype.hasOwnProperty,A4=Object.prototype.propertyIsEnumerable,A6=(e,t,n)=>t in e?A2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let A8=(0,rh.default)(AW)`
427  color: #939ab5;
428
429  :hover {
430    color: #657096;
431
432    svg {
433      color: #818aaa;
434    }
435  }
436`,A7=(0,rh.default)(function(e){return rc.createElement("svg",A1({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},e),te||(te=rc.createElement("circle",{cx:10,cy:10,r:10,fill:"currentColor"})),tt||(tt=rc.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.25,d:"m11.5 6-4 4 4 4"})))})`
437  padding: 0.41666em;
438  color: #b2b7ca;
439`;var A9=Mz(({getItemProps:e,getText:t})=>rc.createElement(A8,((e,t)=>
439{for(var n in t||(t={}))A5.call(t,n)&&A6(e,n,t[n]);if(A3)for(var n of A3(t))A4.call(t,n)&&A6(e,n,t[n]);return e})({className:"pcmap-search-item pcmap-search-item__back"},e({item:{id:"back"}})),rc.createElement("div",null,rc.createElement(AG,{className:"pcmap-search-item__icon"},rc.createElement(A7,{className:"pcmap-search-item__icon"})),t("Back")))),Ce=Object.defineProperty,Ct=Object.getOwnPropertySymbols,Cn=Object.prototype.hasOwnProperty,Cr=Object.prototype.propertyIsEnumerable,Ci=(e,t,n)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let Ca=e=>!!(e.occupants.some(e=>e.routable)||e.subCategories&&e.subCategories.some(e=>Ca(e))),Co=e=>!!(e.occupants.length||e.subCategories&&e.subCategories.some(e=>Co(e)));function Cs(e){let{getItemProps:t,categories:n,showOnlyRoutable:r}=e;return n.filter(e=>{let t=e.showInCategoriesList;return t&=Co(e),r&&(t&=Ca(e)),t}).map(e=>rc.createElement(AW,((e,t)=>{for(var n in t||(t={}))Cn.call(t,n)&&Ci(e,n,t[n]);if(Ct)for(var n of Ct(t))Cr.call(t,n)&&Ci(e,n,t[n]);return e})({key:e.id,className:"pcmap-search-item"},t({key:e.id,item:e})),rc.createElement("div",null,rc.createElement(AG,{className:"pcmap-search-item__icon",color:e.color},/^<svg /g.test(e.icon)?rc.createElement("div",{dangerouslySetInnerHTML:{__html:e.icon}}):rc.createElement("img",{src:e.icon,alt:e.display.name})),e.display.name)))}var Cl=Object.defineProperty,Cu=Object.getOwnPropertySymbols,Cc=Object.prototype.hasOwnProperty,Ch=Object.prototype.propertyIsEnumerable,Cd=(e,t,n)=>t in e?Cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let Cp=rh.default.div`
440  margin-top: 0.3em;
441  font-size: 0.83333em;
442  font-weight: normal;
443  color: #636f99;
444
445  span {
446    white-space: nowrap;
447  }
448`,Cf=rh.default.div`
449  margin-top: 0.3em;
450  font-size: 0.83333em;
451  font-weight: normal;
452  color: ${({color:e})=>e};
453`,Cm=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});var Cg=Mg(function(e){var t;class n extends rc.Component{render(){let t=this.props,{forwardedRef:n}=t,r=((e,t)=>{var n={};for(var r in e)Tq.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&TX)for(var r of TX(e))0>t.indexOf(r)&&TY.call(e,r)&&(n[r]=e[r]);return n})(t,["forwardedRef"]);return rc.createElement(TK.Consumer,null,t=>rc.createElement(e,T$(T$({ref:n},r),t)))}}return TZ(n,"symbol"!=typeof(t="displayName")?t+"":t,"withSearchEngineConsumer"),rc.forwardRef((e,t)=>rc.createElement(n,TG(T$({},e),TV({forwardedRef:t}))))}(Ei(Eb(Mg(function(e){let{ordinals:t,category:n,searchQuery:r,route:i,getItemProps:a,getCategory:o,searchOccupants:s,showOnlyRoutable:l,options:{venueTimeZone:u,showOpeningState:c,searchAlongRouteMaxDistance:h}}=e,[d,p]=rc.useState(null),f=new Date(new Date().toLocaleString("en-US",{timeZone:u})),m=function(e,t,n=!0,r=!0){let i=rc.useRef(e);return rc.useLayoutEffect(()=>{i.current=e}),rc.useMemo(()=>vA((...e)=>i.current(...e),300,{leading:n,trailing:r}),[300,n,r])}(e.filterOccupants,300,!1,!0);return rc.useEffect(()=>{let e=null;if(r?e=s(r):n&&(e=((e,t,n)=>{if(!t)return[];let r=e=>{let t=e.subCategories?e.subCategories.flatMap(r):[];return[e.id,...t]};return r(t).map(n).flatMap(e=>e.occupants).sort((e,t)=>Cm.compare(e.display.name,t.display.name))})(0,n,o)),l&&(e=e.filter(e=>e.routable)),i&&(e=e.filter(e=>{let{distance:t}=_j(e.coordinates,e.ordinalId,i);return Number.isFinite(t)&&t<=h})),r){let t=new Set(e.map(({id:e})=>e));m(({id:e})=>t.has(e))}p(e)},[r,n,i,t,o,s,m,h,l]),d&&d.map(e=>{var t,n;let r=f$(e,"display.name",null),i=f$(e,"level.display.name",null),o=f$(e,"level.building.display.name",null),s=f$(e,"display.zone",null),l=f$(e,"display.area",null),u=f$(e,"display.hours",null),h=f$(e,"rawProperties.hours",null),d=e.icon||e.category.icon,p=e.color||e.category.color,m=null==(t=null==h?void 0:h.trim())?void 0:t.startsWith("<"),g=c&&e.getOpeningState?e.getOpeningState(f):null,v=null==g?void 0:g.state,y=null==g?void 0:g.stateName;!v&&!m&&h&&c&&(v=h.toLowerCase().match(/close/g)?"Closed":h.toLowerCase().match(/open/g)?"Open":"Unknown",y=u),v=null==(n=null==v?void 0:v.toLowerCase())?void 0:n.replace(" ","_");let b=[];return o&&b.push(o),i&&b.push(i),(s||l)&&(b=[],s&&b.push(s),l&&b.pu
453sh(l),i&&b.push(i)),rc.createElement(AW,((e,t)=>{for(var n in t||(t={}))Cc.call(t,n)&&Cd(e,n,t[n]);if(Cu)for(var n of Cu(t))Ch.call(t,n)&&Cd(e,n,t[n]);return e})({key:e.id,className:"pcmap-search-item"},a({key:e.id,item:e})),rc.createElement("div",null,rc.createElement(AG,{className:"pcmap-search-item__icon",color:p},/^<svg /g.test(d)?rc.createElement("div",{dangerouslySetInnerHTML:{__html:d}}):rc.createElement("img",{src:d,alt:r})),rc.createElement("div",{className:"pcmap-search-item__header"},r,rc.createElement(Cp,{className:"pcmap-search-item__location"},b.map((e,t)=>rc.createElement(rc.Fragment,{key:e+t},t>0?" - ":"",rc.createElement("span",null,e)))),v&&rc.createElement(Cf,{className:`pcmap-search-item__state pcmap-search-item__state--${v}`,color:v.includes("close")?"#ed3227":v.includes("open")?"#438428":"#f57c00"},y))))})})))));function Cv(){return(Cv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function Cy(){return(Cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var Cb=Object.defineProperty,Cx=Object.defineProperties,C_=Object.getOwnPropertyDescriptors,Cw=Object.getOwnPropertySymbols,CM=Object.prototype.hasOwnProperty,CE=Object.prototype.propertyIsEnumerable,CS=(e,t,n)=>t in e?Cb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CT=(e,t)=>{for(var n in t||(t={}))CM.call(t,n)&&CS(e,n,t[n]);if(Cw)for(var n of Cw(t))CE.call(t,n)&&CS(e,n,t[n]);return e},CA=(e,t)=>Cx(e,C_(t));let CC=(0,rh.css)`
454  box-shadow: 0px 4px 96px rgba(10, 10, 130, 0.09),
455    0px 2px 16px rgba(10, 10, 130, 0.08), 0px 1px 2px rgba(10, 10, 130, 0.24);
456  border-color: transparent;
457  border-radius: 6px;
458`,CR=(0,rh.css)`
459  border-radius: calc(3em / 2);
460`,CP=rh.default.div`
461  font-size: 1em;
462  overflow: hidden;
463  border: 1px solid #d9dce7;
464  ${({isOpen:e})=>e?CC:CR};
465  transition: border-radius 150ms, box-shadow 150ms;
466`,CI=rh.default.div(()=>(0,rh.css)`
467    position: relative;
468    display: flex;
469
470    input {
471      flex: auto 1 0;
472      font-size: 1em;
473      width: 100%;
474      height: 3em;
475      padding-left: ${wg(18)};
476      padding-right: ${wg(32)};
477      border: 0;
478      border-radius: 0;
479      appearance: none;
480      outline: none;
481      user-select: text !important;
482
483      ::-ms-clear {
484        display: none;
485      }
486    }
487  `),CO=rh.default.div`
488  position: absolute;
489  width: 100%;
490  height: 100%;
491`,CL=rh.default.ul`
492  max-height: 50vh;
493  padding: 0.3125em 0;
494  margin: 0;
495  font-size: ${wg(14)};
496  background-color: white;
497  list-style: none;
498  overflow-y: auto;
499  justify-content: ${({shortList:e})=>e?"space-around":"flex-start"};
500`,CD=(0,rh.default)(function(e){return rc.createElement("svg",Cv({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 11 11"},e),tn||(tn=rc.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:1.3,d:"M10.2 10.2.7.8m9.5 0L.7 10.2 10.2.8z"})))})`
501  align-self: center;
502  flex-shrink: 0;
503  width: 0.6875em;
504  height: 0.6875em;
505  padding: ${wg(15)} ${wg(20)} ${wg(15)} ${wg(10)};
506  transform: translateX(-100%);
507  box-sizing: content-box;
508  color: #657096;
509  cursor: pointer;
510`,CN=(0,rh.default)(function(e){return rc.createElement("svg",Cy({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 13 13"},e),tr||(tr=rc.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"m9 9.1 3.1 3m-1.6-6.4a4.9 4.9 0 1 1-9.8 0 4.9 4.9 0 0 1 9.8 0z"})))})`
511  align-self: center;
512  flex-shrink: 0;
513  width: 0.8125em;
514  height: 0.8125em;
515  padding-right: ${wg(20)};
516  transform: translateX(-100%);
517  box-sizing: content-box;
518  color: #657096;
519`,CU=(0,rh.default)(AX)`
520  align-self: center;
521  flex-shrink: 0;
522  width: ${wg(20)};
523  height: ${wg(20)};
524  padding: ${wg(15)} ${wg(15)} ${wg(15)} ${wg(10)};
525  transform: translateX(-100%);
526  box-sizing: content-box;
527  color: #657096;
528  cursor: pointer;
529`,Ck=e=>{var t;let{showList:n,selectedOccupant:r,selectedCategory:i,searchQuery:a}=e;return{isOpen:n||!1,searchQuery:a,selectedOccupant:null!=r?r:null,selectedCategory:null!=(t=null!=i?i:null==r?void 0:r.category)?t:null}},CB=(e,t)=>"set"===t.type?CT(CT({},e),t.payload):e,CF=e=>{if("__your-location__"===e.id)return"your-location";if("back"===e.id)return"back";if(e.poiType)return"category";if(e.category)return"occupant";throw Error("The item type is not found")};function Cz(e){var t,n,r,i,a;let{className:o,forwardedRef:s,route:l,placeholder:u,appendLeft:c,appendRight:h,showOnlyRoutable:d,showYourLocationOption:p=!0,showYourLocationButton:f,onClear:m,categories:g,getCategory:v,getText:y,userLocation:b,filterOccupants:x,onFocus:_,options:{searchAlongRouteMaxDistance:w}}
529=e,[M,E]=rc.useState(null),[S,T]=rc.useState(null),[A,C]=rc.useState(null),[R,P]=rc.useReducer(CB,e,Ck),I=e=>P({type:"set",payload:e}),O=void 0===e.searchQuery?R.searchQuery:e.searchQuery,L=t=>{void 0===e.searchQuery?I({searchQuery:t}):e.onSearchQueryChange&&e.onSearchQueryChange(t)},D=void 0===e.selectedOccupant?R.selectedOccupant:e.selectedOccupant,N=t=>{void 0===e.selectedOccupant?I({selectedOccupant:t}):e.onOccupantSelect&&e.onOccupantSelect(t)},U=void 0===e.selectedCategory?R.selectedCategory:e.selectedCategory,k=t=>{void 0===e.selectedCategory?I({selectedCategory:t}):e.onCategorySelect&&e.onCategorySelect(t)},B=void 0===e.showList?R.isOpen:e.showList,F=U?U.fullPathIds[U.fullPathIds.length-2]:null,z=F?v(F):null,H=(null==(t=null==U?void 0:U.subCategories)?void 0:t.length)?U.subCategories:null,j=()=>{k(null),N(null),x(null)},W=rc.useCallback(e=>{let t=e=>{let n=e.subCategories?e.subCategories.flatMap(t):[];return[e.id,...n]},n=new Set(t(e));x(e=>{let t=n.has(e.categoryId)||e.extraCategoryIds.some(e=>n.has(e));return l&&(t&=Number.isFinite(e.distanceToRoute)&&e.distanceToRoute<=w),d&&(t&=e.routable),t},{highlight:!0,addDistanceToRoute:l&&{route:l}})},[x,d,l,w]);rc.useEffect(()=>{U&&!D?W(U):(U||l)&&!D||x(null)},[U,D,x,W,l]),rc.useEffect(()=>{if(!A||!_)return;let e=()=>{_(M),M===document.activeElement&&(A.style.display="none")},t=()=>{A.style.display="block"};return A.addEventListener("click",e),M.addEventListener("blur",t),()=>{A.removeEventListener("click",e),M.removeEventListener("blur",t)}},[A,M,_]),rc.useEffect(()=>()=>{x(null)},[x]);let G=e=>{if(e){switch(CF(e)){case"category":N(null),k(e);break;case"back":N(null),k(z);break;case"occupant":N(e);break;case"your-location":N({id:"__your-location__",name:"Your location",display:{name:y("Your location")},level:{ordinal:b.ordinal},coordinates:[b.latitude,b.longitude]});break;default:return}M.blur(),S&&(S.scrollTop=0)}};return rc.createElement(CP,{ref:s,className:"pcmap-search-input "+(B?"pcmap-search-input--opened ":"")+o,isOpen:B},c,rc.createElement(AH,{isOpen:B,inputValue:null!=(a=null!=(i=null!=O?O:null==(n=null==D?void 0:D.display)?void 0:n.name)?i:null==(r=null==U?void 0:U.display)?void 0:r.name)?a:"",selectedItem:D||U,onSelect:G,onStateChange:t=>{var n;t.type===AH.stateChangeTypes.keyDownEscape&&(L(null),j()),void 0!==t.isOpen&&(n=t.isOpen,void 0===e.onListShow?I({isOpen:n}):n&&e.onListShow?e.onListShow():!n&&e.onListHide&&e.onListHide()),t.isOpen&&U&&W(U)},itemToString:e=>{var t,n;return null!=(n=null==(t=null==e?void 0:e.display)?void 0:t.name)?n:""},stateReducer:(e,t)=>((t.selectedItem&&["category","back"].includes(CF(t.selectedItem))||e.selectedItem&&["category","back"].includes(CF(e.selectedItem)))&&(t.isOpen=!0),t.type===AH.stateChangeTypes.mouseUp&&e.selectedItem&&["category","back"].includes(CF(e.selectedItem))&&(t.isOpen=!1),t.selectedItem&&["occupant","your-location"].includes(CF(t.selectedItem))&&(t.isOpen=!1),t.type!==AH.stateChangeTypes.touchEnd&&t.type!==AH.stateChangeTypes.blurInput&&(t.type!==AH.stateChangeTypes.mouseUp||e.selectedItem)||(t.inputValue=e.inputValue),t.type===AH.stateChangeTypes.keyDownEscape&&(t.selectedItem=null,t.inputValue="",t.isOpen=!0),t.type!==AH.stateChangeTypes.controlledPropUpdatedSelectedItem||t.inputValue||delete t.inputValue,t)},({getInputProps:e,getMenuProps:t,getItemProps:n,isOpen:r,openMenu:i,closeMenu:a,clearSelection:o})=>rc.createElement("div",{className:"pcmap-search-input__combobox"},rc.createElement(CI,{className:"pcmap-search-input__input",extraPadding:f},rc.createElement("input",CT({ref:e=>E(e),type:"search",placeholder:u},e({onFocus:i,onBlur:a,onChange:e=>{var t;L(t=e.currentTarget.value),t||j()}}))),_&&rc.createElement(CO,{ref:e=>C(e)}),f&&b?rc.createElement(CU,{className:"pcmap-search-input__select-your-location",onClick:()=>G({id:"__your-location__"})}):U||D||O?rc.createElement(CD,{className:"pcmap-search-input__clear",onClick:()=>{L(null),j(),o(),m&&m()}}):rc.createElement(CN,{className:"pcmap-search-input__glass"})),r&&rc.createElement(CL,CA(CT({className:`pcmap-search-list pcmap-search-list--${U&&!H||O?"occupants":"categories"} ${U?`pcmap-search-list-category-${U.id}`:""}`,shortList:H&&H.length<5},t({},{suppressRefError:!0})),{ref:e=>T(e)}),p&&b&&!U&&!O&&rc.createElement(A0,{key:"your-location",getItemProps:n}),U&&rc.createElement(A9,{getItemProps:n}),U&&!H||O?rc.createElement(Cg,{route:l,category:U,searchQuery:O,getItemProps:n,filterOccupants:x,showOnlyRoutable:d}):rc.createElement(Cs,{showOnlyRoutable:d,categories:H||g,getItemProps:n})))),h)}var CH=Mz(S7(Ei(Eb(EG(Mg(rc.forwardRef((e,t)=>
529rc.createElement(Cz,CA(CT({},e),{forwardedRef:t})))))))));let Cj=rh.default.div(()=>(0,rh.css)`
530    display: flex;
531
532    @media ${({theme:e})=>e.mq.portrait} {
533      position: fixed;
534      left: 0;
535      flex-direction: column;
536      justify-content: center;
537      width: 100%;
538      height: 100%;
539      padding-top: ${wg(20)};
540      padding-bottom: ${wg(10)};
541      border-top-right-radius: ${wg(10)};
542      border-top-left-radius: ${wg(10)};
543      box-shadow: 0px 4px 96px rgba(10, 10, 130, 0.09),
544        0px 2px 16px rgba(10, 10, 130, 0.08),
545        0px 1px 2px rgba(10, 10, 130, 0.24);
546      background-color: white;
547      will-change: transform;
548      transition: ${CK};
549
550      * {
551        user-select: none;
552      }
553    }
554  `),CW=(0,rh.keyframes)`
555  0%, 100% {
556    transform: translateY(0);
557  }
558  50% {
559    transform: translateY(-5px);
560  }
561`,CG=rh.default.div`
562  animation: ${CW} 2s infinite;
563`,CV=rh.default.div(({flip:e})=>(0,rh.css)`
564    position: absolute;
565    bottom: ${wg(-2)};
566    left: 50%;
567    animation: ${((e,t)=>(0,rh.keyframes)`
568  0% {
569    transform: scaleY(${e});
570    opacity: 1;
571  }
572  25% {
573    transform: scaleY(${e});
574    opacity: 0;
575  }
576  75% {
577    transform: scaleY(${t});
578    opacity: 0;
579  }
580  100% {
581    transform: scaleY(${t});
582    opacity: 1;
583  }
584`)(e?1:-1,e?-1:1)} 500ms forwards;
585  `),CX=(0,rh.default)(function(e){return rc.createElement("svg",Au({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 445 228"},e),eQ||(eQ=rc.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M197.305 8.932c14.686-11.91 35.704-11.91 50.39 0l182.5 148c17.158 13.915 19.788 39.104 5.873 56.263-13.915 17.158-39.105 19.788-56.263 5.873L222.5 91.5 65.195 219.068c-17.159 13.915-42.348 11.285-56.263-5.873-13.915-17.159-11.285-42.348 5.873-56.263l182.5-148Z",clipRule:"evenodd"})))})`
586  width: ${wg(18)};
587  color: #d0d0d0;
588  transform: translateX(-50%);
589`,Cq=rh.default.div`
590  position: absolute;
591  top: -${wg(40)};
592  left: 0;
593  width: 100%;
594  height: ${wg(20)};
595  padding-top: ${wg(40)};
596  z-index: 1;
597  box-sizing: content-box;
598
599  ::before {
600    content: '';
601    display: block;
602    width: ${wg(40)};
603    height: ${wg(7)};
604    background-color: transparent;
605    margin: ${wg(5)} auto;
606    border-radius: ${wg(7)};
607  }
608`,CY=(0,rh.default)(CH)`
609  height: 100%;
610
611  input {
612    padding: 0 2.5em 0 1.25em;
613  }
614
615  @media ${({theme:e})=>e.mq.portrait} {
616    width: 100%;
617    border: none;
618    border-radius: 0;
619    box-shadow: none;
620
621    input {
622      height: 2.5em;
623      border-radius: ${wg(10)};
624      background-color: #f3f2f2;
625      user-select: auto;
626    }
627
628    .pcmap-search-input__input {
629      width: 90%;
630      margin: 0 auto;
631    }
632
633    .pcmap-search-list {
634      font-size: 0.75em;
635    }
636
637    .pcmap-search-list--categories {
638      display: flex;
639
640      .pcmap-search-item {
641        margin: 0 ${({itemMargin:e})=>wg(e)};
642
643        :hover {
644          background-color: unset;
645        }
646
647        > div {
648          flex-direction: column;
649          border: 0;
650          text-align: center;
651          white-space: break-spaces;
652        }
653      }
654
655      .pcmap-search-item__icon {
656        margin: 0 0 ${wg(5)};
657      }
658    }
659
660    .pcmap-search-list--occupants {
661      border-top: 1px solid #cccccc;
662      margin-top: ${wg(10)};
663      padding-bottom: ${wg(50)};
664    }
665  }
666`,CZ=(0,rh.default)(Al)`
667  position: absolute;
668  top: ${wg(77)};
669  right: ${wg(5)};
670  width: ${wg(10)};
671  color: gainsboro;
672`,C$=(0,rh.default)(Al)`
673  position: absolute;
674  top: ${wg(77)};
675  left: ${wg(5)};
676  width: ${wg(10)};
677  transform: rotate(180deg);
678  color: gainsboro;
679`,CK="transform 300ms ease",CJ="categories",CQ="middle",C0="high";var C1=Mz(MC(Mg(Eb(Ei(function(e){let{className:t,closeDirections:n,route:r,options:{keepSearchListsOpened:i,showCategoriesAlways:a},getText:o,events:s,setSelectedOccupants:l,getCategory:u}=e,{isPortrait:c}=T1(),{CATEGORIES_STATES:h,OCCUPANTS_STATES:d}=rc.useMemo(()=>({CATEGORIES_STATES:a?[CJ]:["low",CJ],OCCUPANTS_STATES:["low",CQ,C0]}),[a]),[p,f]=rc.useState(!1),[m,g]=rc.useState(null),[v,y]=rc.useState(null),[b,x]=rc.useState(null),[_,w]=rc.useState(a?CJ:"low"),[M,E]=rc.useState(h),[S,T]=rc.useState(0),[A,C]=rc.useState(0),[R,P]=rc.useState(0),[I,O]=rc.useState({low:0,[CJ]:0,[CQ]:0,[C0]:0}),[L,D]=rc.useState(!1),[N,U]=rc.useState(!0),[k,B]=rc.useState(null),F=rc.useRef(0),[z,H]=rc.useState(null),j=z&&z.parentElement,W=z&&z.querySelector(".pcmap-search-input__input"),G=z&&z.querySelector("input"),V=z&&z.querySelector(".pcmap-search-list"),X=rc.useCallback(()=>
679{if(V.classList.contains("pcmap-search-list--occupants")){U(!1),D(!1);return}let e=V.scrollWidth-V.clientWidth-50,t=V.scrollLeft;U(t<e),D(50<t)},[V]);rc.useEffect(()=>{if(!c||!j||!V)return;let e=new wp(x$(e=>{e.forEach(({target:e,contentRect:t})=>{let{height:n}=t;if(e===j&&T(n),e===V&&V.classList.contains("pcmap-search-list--categories")&&C(n),e===G){let e=z.getBoundingClientRect();P(W.getBoundingClientRect().bottom-e.top+10)}})}),100,{leading:!1,trailing:!0});return e.observe(j),e.observe(V),e.observe(G),()=>{e.disconnect()}},[j,V,W,G,z,c]),rc.useEffect(()=>{if(!c||!V||!G)return;let e=new MutationObserver(e=>{if(e.some(e=>"class"===e.attributeName)){let e=V.classList.contains("pcmap-search-list--occupants"),t=G===document.activeElement;e&&_!==C0&&w(CQ),e||t||w(CJ),X(),E(e?d:h)}});return e.observe(V,{attributes:!0}),()=>{e.disconnect()}},[_,V,X,G,c,h,d]),rc.useEffect(()=>{if(z)return z.classList.add(`pcmap-search-box--${_}`),()=>{z.classList.remove(`pcmap-search-box--${_}`)}},[z,_]),rc.useEffect(()=>{c&&O({low:0,[CJ]:-A,[CQ]:-(S/2),[C0]:-(S-R)})},[S,A,R,c]),rc.useLayoutEffect(()=>{if(c&&z&&V)switch(F.current=I[_],z.style.top=`calc(100% - ${R}px)`,z.style.transform=`translateY(${F.current}px)`,_){case"low":break;case CJ:case CQ:V.style.maxHeight="50vh";break;case C0:V.style.maxHeight=`${S-R}px`,G.value||(z.style.top=0,z.style.transform="")}},[_,I,S,R,z,V,G,c]),rc.useEffect(()=>{G&&G.value||_!==C0&&E(h)},[_,G,h]),rc.useEffect(()=>{if(!c||!z||!k)return;let e=e=>{"low"===_&&(e.composedPath().some(e=>{var t;return e.getAttribute&&(null==(t=e.getAttribute("class"))?void 0:t.includes("pcmap-search-input__clear"))})||(e.stopPropagation(),e.preventDefault(),w(M.includes(CJ)?CJ:CQ)))},t=0,n=e=>{z.style.top=`calc(100% - ${R}px)`,z.style.transform=`translateY(${F.current}px)`,z.style.transition="none",t=e.changedTouches[0].pageY,G.blur()},r=e=>{e.preventDefault(),e.stopPropagation();let n=t-e.changedTouches[0].pageY;F.current=((e,t)=>{let n=e-t,r=M[0],i=M[M.length-1];return n>I[r]?I[r]:n<I[i]?I[i]:n})(I[_],n),z.style.transform=`translateY(${F.current}px)`},i=()=>{z.style.transition=CK;let e=(e=>{let t=I[_];if(50>Math.abs(t-e))return _;if(e<t){let t=M.indexOf(_);if(-1===t)return M[M.length-1];let n=M.slice(t+1);return 0===n.length?_:n.reduce((t,n,r)=>0===r?t:e<I[t]-50?n:t,n[0])}{let t=M.indexOf(_);if(-1===t)return M[M.length-1];let n=M.slice(0,t).reverse();return 0===n.length?_:n.reduce((t,n,r)=>0===r?t:e>I[t]+50?n:t,n[0])}})(F.current);F.current=I[e],z.style.transform=`translateY(${F.current}px)`,e!==_&&setTimeout(()=>{w(e)},100)};return z.addEventListener("click",e,!0),k.addEventListener("touchstart",n),k.addEventListener("touchmove",r),k.addEventListener("touchend",i),G.addEventListener("touchstart",n),G.addEventListener("touchmove",r),G.addEventListener("touchend",i),()=>{z.removeEventListener("click",e,!0),k.removeEventListener("touchstart",n),k.removeEventListener("touchmove",r),k.removeEventListener("touchend",i),G.removeEventListener("touchstart",n),G.removeEventListener("touchmove",r),G.removeEventListener("touchend",i)}},[_,M,I,c,z,k,G,R]),rc.useEffect(()=>{if(!c||!V||!V.classList.contains("pcmap-search-list--categories"))return;let e=x$(X,200);return V.addEventListener("scroll",e,{passive:!0}),()=>{V.removeEventListener("scroll",e,{passive:!0})}},[V,X,c]),rc.useEffect(()=>{if(!s)return;let e=e=>{e||g(null);let t=u(e);"Default"!==t.name&&(g(t),f(!1),setTimeout(()=>{w("low")},0))};return s.on("SearchBox#SelectCategory",e),()=>{s.off("SearchBox#SelectCategory",e)}},[s,u]),rc.useEffect(()=>{if(!s)return;let e=e=>{x(e),g(null),y(null),f(!0)};return s.on("SearchBox#Query",e),()=>{s.off("SearchBox#Query",e)}},[s]);let q=_===C0||_===CJ;return rc.createElement(Cj,{key:c,ref:e=>H(e),className:`pcmap-search-box ${t||""}`},c&&rc.createElement(Cq,{ref:e=>B(e),className:"pcmap-search-box__expand"},rc.createElement(CV,{flip:q},rc.createElement(CG,null,rc.createElement(CX,null)))),rc.createElement(CY,{itemMargin:5,className:"pcmap-search-box__input",route:r,placeholder:o(r?"Search along route...":"Search..."),showList:!!c||!!i||p,onListShow:()=>{n(),f(!0)},onListHide:()=>{f(!1)},searchQuery:b,onSearchQueryChange:e=>{x(e)},selectedOccupant:v,onOccupantSelect:e=>{if(l(e?[e.id]:[]),!e){y(null),s.emit("SearchBox#OccupantUnselected");return}y(e),s.emit("SearchBox#OccupantSelected",e),a&&"__your-location__"===e.id||w("low")},selectedCategory:m,onCategorySelect:e=>{if(!e){g(null),s.emit("SearchBox#CategoryUnselected");return}g(e),s.emit("SearchBox#CategorySelected",e)},onFocus:e=>{z.style.transition="none",(0,rd.flushSync)(()=>{w(C0),E([...new Set([...M,C0])])}),e.focus()}}),c&&L&&rc.createElement(C$,{className:"pcmap-search-box__scroll-left"}),c&&N&&rc.createElement(CZ,{className:"pcmap-search-box__scroll-right"}))})))));function C2(){return(C2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function C3(){return(C3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}let C5=rh.default.div`
680  display: flex;
681  justify-content: space-between;
682  padding: ${wg(18)} ${wg(20)};
683
684  > div {
685    line-height: 1.5;
686  }
687`,C4=rh.default.div`
688  font-weight: bold;
689`,C6=rh.default.div`
690  line-height: 1;
691  display: flex;
692  align-items: center;
693  margin-top: ${wg(5)};
694`,C8=rh.default.a.attrs({role:"button"})`
695  display: flex;
696  justify-content: center;
697  align-items: center;
698  align-self: center;
699  padding: ${wg(10)} 1.75em;
700  border-radius: 1.75em;
701  line-height: 1.5;
702  color: white !important;
703  background-color: #0a0a82;
704  box-shadow: 0px 2px 16px rgba(10, 10, 130, 0.08),
705    0px 1px 2px rgba(10, 10, 130, 0.16);
706  cursor: pointer;
707`,C7=(0,rh.default)(C8)`
708  @media ${({theme:e})=>e.mq.landscape} {
709    align-self: center;
710  }
711`,C9=(0,rh.default)(C8)`
712  display: none;
713  margin: ${wg(15)} ${wg(17)};
714  font-weight: bold;
715  text-align: center;
716  background-color: #2f2f2f;
717  color: white !important;
718
719  @media ${({theme:e})=>e.mq.landscape} {
720    display: block;
721  }
722`,Re=rh.default.div`
723  display: flex;
724  justify-content: space-between;
725  align-items: center;
726  width: 100%;
727  min-height: 4.425em;
728  padding: 0.2em;
729  text-align: center;
730  color: white;
731  background-color: #1415fa;
732
733  a:first-child {
734    transform: rotate(180deg);
735  }
736`,Rt=rh.default.a.attrs({role:"button"})`
737  flex-grow: 0;
738  height: 100%;
739  ${({disabled:e})=>e?"opacity: 0.7":""};
740  cursor: pointer;
741
742  > img {
743    height: 100%;
744  }
745`,Rn=rh.default.span`
746  flex-grow: 1;
747`,Rr=(0,rh.default)(function(e){return rc.createElement("svg",C2({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 30 30"},e),ti||(ti=rc.createElement("circle",{cx:15,cy:15,r:15,fill:"#F7F7FB"})),ta||(ta=rc.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:2,d:"M12.94 11 18 15.5 12.94 20"})))})`
748  width: 2.142857em;
749  height: 100%;
750  margin: 0 ${wg(8)};
751  color: #1415fa;
752`,Ri=(0,rh.default)(function(e){return rc.createElement("svg",C3({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 15 15"},e),to||(to=rc.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:1.1,d:"M6.93 8.29 4.1 4.62a.22.22 0 0 1 .3-.3l3.67 2.83a.81.81 0 1 1-1.14 1.14z"})),ts||(ts=rc.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:1.1,d:"M2.9 2.9A6.5 6.5 0 1 0 7.5 1v2.82"})))})`
753  width: 0.928571em;
754  margin-right: 0.357142em;
755  color: #5b5b70;
756`,Ra=(e,t)=>Math.pow(1.5,Math.floor(t-e));var Ro=Mz(Mg(Eb(function(e){let{stops:t,avoidStairs:n,route:r,steps:i,stepIdx:a,setStepIdx:o,userRoute:s,map:l,mapProjection:u,ordinals:c,setActiveOrdinal:h,setSelectedOccupants:d,fitPoints:p,refresh:f,onQRCodeShow:m,onEnd:g,options:{maxZoom:v,showQRCode:y,extraTimeOptions:b,getRouteTimeString:x,routeMaxZoom:_,routePointZoom:w,routeStartPointZoom:M,routeColor:E,routeExtraTimeColor:S,routeExtraTimeDirectionColor:T,routeInactiveColor:A,routeInactiveVisible:C,routeDirectionColor:R,routeDirectionSpeed:P,routeMarkType:I,routePointsHighlight:O,getRoutePaddings:L,components:{Router:D}},getText:N}=e,U="__your-location__"===t[0].occupantId,k=t.slice(1).some(e=>"__your-location__"===e.occupantId),[B,F]=rc.useState(e.options.routeWidth*Ra(l.zoom,v)),[z,H]=rc.useState(null),[j,W]=rc.useState(null),[G,V]=rc.useState(" "),X=rc.useRef(null),q=i[a],Y=z&&z[q.stepIdx],Z=j&&j[0],$=t[t.length-1],K=r.steps[q.stepIdx],J=q.stepIdx>0?r.steps[q.stepIdx-1]:null,Q=rc.useCallback((e,t)=>{let{routeWidth:n,routeColor:r,routeExtraTimeColor:i,routeDirectionColor:a,routeExtraTimeDirectionColor:o,routeDirectionSpeed:s,routeMarkType:h}=t,d=()=>f();return e.steps.map(e=>{let t=c.get(e.ordinal),p=e.points.map(({type:e,coordinates:c})=>{if(c.length<2)return{type:e,dispose:()=>{}};let p=new wJ(c,{map:l,mapProjection:u,routeWidth:n,routeColor:"extraTime"===e?i:r,routeDirectionColor:"extraTime"===e?o:a,routeDirectionSpeed:s,routeMarkType:h,cutEndings:"extraTime"===e});return p.addEventListener("needsUpdate",d),t.mapOrdinal.add(p),{type:e,mapRoute:p,dispose:()=>{p&&(p.removeEventListener("needsUpdate",d),t.mapOrdinal.remove(p),p.dispose())}}});return{ordinalId:e.ordinal,mapRoutes:p,coordinates:e.points,routeIdx:e.routeIdx}})},[c,l,u,f]);rc.useEffect(()=>{if(!s)return;let e=Q(s,{routeWidth:B,routeColor:E,routeExtraTimeColor:S,routeExtraTimeDirectionColor:T,routeDirectionColor:R,routeDirectionSpeed:P,routeMarkType:I});return e.forEach(e=>{e.mapRoutes.forEach(({mapRoute:e})=>{e&&(e.priority=1,e.animate=!0)})}),W(e),()=>{e.forEach(e=>{e.mapRoutes.forEach(e=>e.dispose())}),f()}},[s,B,E,S,T,R,P,I,Q,f]),rc.useEffect(()=>{if(!r)return;let e=Q(r,{routeWidth:B,routeColor:E,routeExtraTimeColor:S,routeExtraTimeDirectionColor:T,routeDirectionColor:R,routeDirectionSpeed:P,routeMarkType:I});return H(e),()=>
756{e.forEach(e=>{e.mapRoutes.forEach(e=>e.dispose())}),f()}},[r,B,E,S,T,R,P,I,Q,f,U]),rc.useEffect(()=>{let t=x$(({zoom:t})=>{let n=Ra(t,v);F(e.options.routeWidth*n)},100,{leading:!1,trailing:!0});return l.addEventListener("zoomChangeSequence",t),l.addEventListener("zoomChange",t),()=>{l.removeEventListener("zoomChangeSequence",t),l.removeEventListener("zoomChange",t)}},[l,v,e.options.routeWidth]);let ee=rc.useCallback((e,t,{maxZoom:n})=>{h(e,{callback:()=>{var e,r,i,a,o;let s=null!=(e=L&&L())?e:{},l=null!=(r=s.paddingTop)?r:0,u=null!=(i=s.paddingLeft)?i:0;p(t,{paddingTop:l,paddingLeft:u,paddingRight:null!=(a=s.paddingRight)?a:0,paddingBottom:null!=(o=s.paddingBottom)?o:0,maxZoom:n})}})},[L,h,p]);rc.useEffect(()=>{if(z){if((null==Z?void 0:Z.ordinalId)===(null==Y?void 0:Y.ordinalId))return void z.forEach(e=>{e.ordinalId===Z.ordinalId&&e.mapRoutes.forEach(({mapRoute:e})=>{e&&(e.animate=!1,e.visible=!1)})});z.forEach(e=>{if(Y.ordinalId!==e.ordinalId)return;let t=Y.routeIdx===e.routeIdx;e.mapRoutes.forEach(({type:e,mapRoute:n})=>{n&&(n.priority=+!!t,n.routeColor=t?"extraTime"===e?S:E:A,n.animate=t,n.visible=!!C||t)})})}},[Y,z,Z,E,S,A,C]),rc.useEffect(()=>{if(!Y)return;if(!Number.isFinite(Y.ordinalId))return void console.error("The ordinal of path is required");if(U&&!Z)return;if(U&&Z.ordinalId===Y.ordinalId){let e=e=>{let t=e[e.length-1];return t.coordinates[t.coordinates.length-1]},t=e(K.points),n=e(Z.coordinates);if(t[0]!==n[0]||t[1]!==n[1])return}if(q===X.current)return;if(X.current=q,(null==Z?void 0:Z.ordinalId)===Y.ordinalId){let e=q.point?[q.point]:Z.coordinates.flatMap(({coordinates:e})=>e),t=0===q.idx?M:_;ee(Z.ordinalId,e,{maxZoom:t});return}let e=q.point?[q.point]:Y.coordinates.flatMap(({coordinates:e})=>e),t=0===q.idx?M:q.point?w:_;ee(Y.ordinalId,e,{maxZoom:t})},[q,Y,Z,K,_,w,M,U,ee]),rc.useEffect(()=>{var e,n;if(O)d([J?J.isTransitionPoint?null==(n=null==(e=J.transition)?void 0:e[1])?void 0:n.id:J.targetId:t[0].occupantId,K.targetId])},[O,t,K,J,d]),rc.useEffect(()=>{(async()=>{let{length:e,path:t}=r;if("function"==typeof x){let n=b?(e=>{let t=Mr.occupants.filter(e=>e.isPoint),n=[...Mr.units,...t];return e.map(e=>{let t={name:e.name,ids:[]},{categories:r,includeIds:i,excludeIds:a}=e;if(r){let e=r.reduce((e,t)=>[...e,...n.filter(e=>"object"==typeof e.category?e.category.name===t:e.category===t).map(e=>({id:e.id,routePoints:e.routePoints||[]})).filter(e=>e.routePoints&&e.routePoints.length>0)],[]);t.ids=[...t.ids,...e]}if(i){let e=n.filter(e=>i.includes(e.id)).map(e=>({id:e.id,routePoints:e.routePoints||[]})).filter(e=>e.routePoints&&e.routePoints.length>0);t.ids=[...t.ids,...e]}return a&&(t.ids=t.ids.filter(e=>!a.includes(e.id))),t})})(b).reduce((e,n)=>{let r=n.ids.filter(e=>e.routePoints.some(e=>t.includes(e.toString())));return r&&r.length>0?[...e,{name:n.name,ids:r.map(e=>e.id)}]:e},[]):null;V(await x(e,n));return}let n=10*Math.ceil(e/10),i=Math.ceil(n/1.1/60),a=i-i%2;V(`${n} m / ${a}-${a+2} min`)})()},[r,b,x]);let et=e=>{if("next"===e&&a===i.length-1||"prev"===e&&0===a)return;let t="next"===e?a+1:a-1,n=i[t],r=z[n.stepIdx];if((null==Z?void 0:Z.ordinalId)===(null==r?void 0:r.ordinalId)&&n.titleDictionaryKey.startsWith("From"))return void o("next"===e?a+2:a-2);o(t)};if(D)return rc.createElement(D,{t:N,stops:t,avoidStairs:n,route:r,steps:i,stepIdx:a,showQRCode:y,onQRCodeShow:m,onPrevStep:()=>et("prev"),onNextStep:()=>et("next"),onSetStep:e=>o(e),onEnd:g});let en=t.length>2?"End destination: {{point}}":"Route to {{point}}";return rc.createElement(rc.Fragment,null,rc.createElement(C5,{className:"pcmap-route"},rc.createElement("div",null,rc.createElement(C4,{className:"pcmap-route__destination"},N(en).replace("{{point}}",N($.name))),rc.createElement(C6,{className:"pcmap-route__info"},rc.createElement(Ri,null),G)),rc.createElement(C7,{className:"pcmap-route__end",onClick:g},N("End"))),y&&!U&&!k&&rc.createElement(C9,{className:"pcmap-route__showqrcode",onClick:m},N("Send route to phone")),rc.createElement(Re,{className:"pcmap-route__switcher"},rc.createElement(Rt,{className:"pcmap-route__prev-step",disabled:0===a,onClick:()=>et("prev")},rc.createElement(Rr,null)),rc.createElement(Rn,{dangerouslySetInnerHTML:{__html:q.title}}
756),rc.createElement(Rt,{className:"pcmap-route__next-step",disabled:a===i.length-1,onClick:()=>et("next")},rc.createElement(Rr,null))))})));let Rs=rh.default.div`
757  position: absolute;
758  top: 0;
759  left: 0;
760  display: block;
761  width: 100vw;
762  height: 100vh;
763  background-color: rgba(0, 0, 0, 0.45);
764  z-index: 10000;
765`,Rl=({children:e,className:t})=>rc.createElement(Rs,{className:`pcmap-shadowbox ${t||""}`},e);function Ru(){return(Ru=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}let Rc=rh.default.div`
766  position: absolute;
767  top: 50%;
768  left: 50%;
769  transform: translate(-50%, -50%);
770  width: ${wg(270)};
771  padding: ${wg(30)} ${wg(15)} ${wg(15)};
772  text-align: center;
773  background-color: white;
774  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
775`,Rh=(0,rh.default)(function(e){return rc.createElement("svg",Ru({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 352 512"},e),tl||(tl=rc.createElement("path",{fill:"currentColor",d:"m242.7 256 100-100a31.5 31.5 0 0 0 0-44.5l-22.2-22.3a31.5 31.5 0 0 0-44.4 0L176 189.2 76 89.3a31.5 31.5 0 0 0-44.5 0L9.2 111.5a31.5 31.5 0 0 0 0 44.4l100 100.1-100 100a31.5 31.5 0 0 0 0 44.5l22.3 22.3a31.5 31.5 0 0 0 44.4 0l100.1-100 100 100a31.5 31.5 0 0 0 44.5 0l22.3-22.2a31.5 31.5 0 0 0 0-44.5L242.8 256z"})))})`
776  position: absolute;
777  top: 0;
778  right: 0;
779  width: 1em;
780  height: 1em;
781  margin: ${wg(8)};
782  color: #b7b7b7;
783  cursor: pointer;
784`,Rd=rh.default.div`
785  font-weight: bold;
786`,Rp=rh.default.div`
787  svg {
788    width: ${wg(210)};
789    height: ${wg(210)};
790  }
791`;function Rf(e){let{routeQRCode:t,onClose:n,className:r}=e,{getText:i}=MF();return t?rc.createElement(Rl,{className:r},rc.createElement(Rc,{className:"pcmap-qrcode"},rc.createElement(Rh,{className:"pcmap-qrcode__close",onClick:n}),rc.createElement(Rd,{className:"pcmap-qrcode__message"},i("Scan QR code to open the route on your mobile device")),rc.createElement(Rp,{className:"pcmap-qrcode__image",dangerouslySetInnerHTML:{__html:t}}))):null}function Rm(e,t){return(Rm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Rg(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Rm(e,t)}function Rv(){return(Rv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function Ry(e){return(Ry="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rb(Object(n),!0).forEach(function(t){!function(e,t,n){var r;(r=function(e,t){if("object"!=Ry(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ry(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==Ry(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rb(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function R_(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Rw="function"==typeof Symbol&&Symbol.observable||"@@observable",RM=function(){return Math.random().toString(36).substring(7).split("").join(".")},RE={INIT:"@@redux/INIT"+RM(),REPLACE:"@@redux/REPLACE"+RM(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+RM()}};function RS(e,t){return function(){return t(e.apply(this,arguments))}}function RT(e,t){if("function"==typeof e)return RS(e,t);if("object"!=typeof e||null===e)throw Error(R_(16));var n={};for(var r in e){var i=e[r];"function"==typeof i&&(n[r]=RS(i,t))}return n}function RA(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var RC=rc.createContext(null),RR=function(e){e()},RP={notify:function(){},get:function(){return[]}};function RI(e,t){var n,r=RP;function i(){o.onStateChange&&o.onStateChange()}function a(){if(!n){var a,o,s;n=t?t.addNestedSub(i):e.subscribe(i),a=RR,o=null,s=null,r={clear:function(){o=null,s=null},notify:function(){a(function(){for(var e=o;e;)e.callback(),e=e.next})},get:function(){for(var e=[],t=o;t;)e.push(t),t=t.next;return e},subscribe:function(e){var t=!0,n=s={callback:e,next:null,prev:s};return n.prev?n.prev.next=n:o=n,function(){t&&null!==o&&(t=!1,n.next?n.next.prev=n.prev:s=n.prev,n.prev?n.prev.next=n.next:o=n.next)}}}}}var o={addNestedSub:function(e){return a(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return!!n},trySubscribe:a,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=RP)},getListeners:function(){return r}};return o}var RO="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?rc.useLayoutEffect:rc.useEffect;function RL(e){var t=e.store,n=e.context,r=e.children,i=(0,rc.useMemo)(function(){var e=RI(t);return{store:t,subscription:e}},[t]),a=(0,rc.useMemo)(function(){return t.getState()},[t]);return RO(function(){var e=i.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}},[i,a]),rc.createElement((n||RC).Provider,{value:i},r)}function RD(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var RN=e1?Ah.exports:(e1=1,Ah.exports=function(){if(e0)return Ad;e0=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case l:case u:case r:case a:case i:case h:return e;default:switch(e=e&&e.$$typeof){case s:case c:case f:case p:case o:return e;default:return d}}case n:return d}}}function x(e){return b(e)===u}return Ad.AsyncMode=l,Ad.ConcurrentMode=u,Ad.ContextConsumer=s,Ad.ContextProvider=o,Ad.Element=t,Ad.ForwardRef=c,Ad.Fragment=r,Ad.Lazy=f,Ad.Memo=p,Ad.Portal=n,Ad.Profiler=a,Ad.StrictMode=i,Ad.Suspense=h,Ad.isAsyncMode=function(e){return x(e)||b(e)===l},Ad.isConcurrentMode=x,Ad.isContextConsumer=function(e){return b(e)===s},Ad.isContextProvider=function(e){return b(e)===o},Ad.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ad.isForwardRef=function(e){return b(e)===c},Ad.isFragment=function(e){return b(e)===r},Ad.isLazy=function(e){return b(e)===f},Ad.isMemo=function(e){return b(e)===p},Ad.isPortal=function(e){return b(e)===n},Ad.isProfiler=function(e){return b(e)===a},Ad.isStrictMode=function(e){return b(e)===i},Ad.isSuspense=function(e){return b(e)===h},Ad.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===a||e===i||e===h||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===o||e.$$typeof===s||e.$$typeof===c||e.$$typeof===g||e.$$typeof===v||e.$$typeof===y||e.$$typeof===m)},Ad.typeOf=b,Ad}
791(),Ah.exports),RU={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Rk={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},RB={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},RF={};function Rz(e){return RN.isMemo(e)?RB:RF[e.$$typeof]||RU}RF[RN.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},RF[RN.Memo]=RB;var RH=Object.defineProperty,Rj=Object.getOwnPropertyNames,RW=Object.getOwnPropertySymbols,RG=Object.getOwnPropertyDescriptor,RV=Object.getPrototypeOf,RX=Object.prototype,Rq=function e(t,n,r){if("string"!=typeof n){if(RX){var i=RV(n);i&&i!==RX&&e(t,i,r)}var a=Rj(n);RW&&(a=a.concat(RW(n)));for(var o=Rz(t),s=Rz(n),l=0;l<a.length;++l){var u=a[l];if(!Rk[u]&&!(r&&r[u])&&!(s&&s[u])&&!(o&&o[u])){var c=RG(n,u);try{RH(t,u,c)}catch(e){}}}}return t},RY={exports:{}},RZ={};RY.exports=function(){if(tu)return RZ;tu=1;var e=60103,t=60106,n=60107,r=60108,i=60114,a=60109,o=60110,s=60112,l=60113,u=60120,c=60115,h=60116,d=60121,p=60122,f=60117,m=60129,g=60131;if("function"==typeof Symbol&&Symbol.for){var v=Symbol.for;e=v("react.element"),t=v("react.portal"),n=v("react.fragment"),r=v("react.strict_mode"),i=v("react.profiler"),a=v("react.provider"),o=v("react.context"),s=v("react.forward_ref"),l=v("react.suspense"),u=v("react.suspense_list"),c=v("react.memo"),h=v("react.lazy"),d=v("react.block"),p=v("react.server.block"),f=v("react.fundamental"),m=v("react.debug_trace_mode"),g=v("react.legacy_hidden")}function y(d){if("object"==typeof d&&null!==d){var p=d.$$typeof;switch(p){case e:switch(d=d.type){case n:case i:case r:case l:case u:return d;default:switch(d=d&&d.$$typeof){case o:case s:case h:case c:case a:return d;default:return p}}case t:return p}}}var b=a,x=e,_=s,w=n,M=h,E=c,S=t,T=i,A=r,C=l;return RZ.ContextConsumer=o,RZ.ContextProvider=b,RZ.Element=x,RZ.ForwardRef=_,RZ.Fragment=w,RZ.Lazy=M,RZ.Memo=E,RZ.Portal=S,RZ.Profiler=T,RZ.StrictMode=A,RZ.Suspense=C,RZ.isAsyncMode=function(){return!1},RZ.isConcurrentMode=function(){return!1},RZ.isContextConsumer=function(e){return y(e)===o},RZ.isContextProvider=function(e){return y(e)===a},RZ.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},RZ.isForwardRef=function(e){return y(e)===s},RZ.isFragment=function(e){return y(e)===n},RZ.isLazy=function(e){return y(e)===h},RZ.isMemo=function(e){return y(e)===c},RZ.isPortal=function(e){return y(e)===t},RZ.isProfiler=function(e){return y(e)===i},RZ.isStrictMode=function(e){return y(e)===r},RZ.isSuspense=function(e){return y(e)===l},RZ.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===i||e===m||e===r||e===l||e===u||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===c||e.$$typeof===a||e.$$typeof===o||e.$$typeof===s||e.$$typeof===f||e.$$typeof===d||e[0]===p)||!1},RZ.typeOf=y,RZ}();var R$=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],RK=["reactReduxForwardedRef"],RJ=[],RQ=[null,null];function R0(e,t){var n=e[1];return[t.payload,n+1]}function R1(e,t,n){RO(function(){return e.apply(void 0,t)},n)}function R2(e,t,n,r,i,a,o){e.current=r,t.current=i,n.current=!1,a.current&&(a.current=null,o())}function R3(e,t,n,r,i,a,o,s,l,u){if(e){var c=!1,h=null,d=function(){if(!c){var e,n,d=t.getState();try{e=r(d,i.current)}catch(e){n=e,h=e}n||(h=null),e===a.current?o.current||l():(a.current=e,s.current=e,o.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=d,n.trySubscribe(),d(),function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,h)throw h}}}var R5=function(){return[null,0]};function R4(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,i=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,a=n.methodName,o=void 0===a?"connectAdvanced":a,s=n.renderCountProp,l=void 0===s?void 0:s,u=n.shouldHandleStateChanges,c=void 0===u||u,h=n.storeKey,d=void 0===h?"store":h,p=(n.withRef,n.forwardRef),f=void 0!==p&&p,m=n.context,g=RD(n,R$),v=void 0===m?RC:m;return function(t){var n=t.displayName||t.name||"Component",r=i(n),a=Rv({},g,{getDisplayName:i,methodName:o,renderCountProp:l,shouldHandleStateChanges:c,storeKey:d,displayName:r,wrappedComponentName:n,WrappedComponent:t}),s=g.pure,u=s?rc.useMemo:function(e){return e()};function h(n){var r=(0,rc.useMemo)(function(){var e=n.reactReduxForwardedRef,t=RD(n,RK);return[n.context,e,t]},[n]),i=r[0],o=r[1],s=r[2],l=(0,rc.useMemo)(function(){return i&&i.Consumer&&RY.exports.isContextConsumer(rc.createElement(i.Consumer,null))?i:v},[i,v]),h=(0,rc.useContext)(l),d=!!n.store&&!!n.store.getState&&!!n.store.dispatch;h&&h.store;var p=d?n.store:h.store,f=(0,rc.useMemo)(function(){return e(p.dispatch,a)},[p]),m=(0,rc.useMemo)(function(){if(!c)return RQ;var e=RI(p,d?null:h.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[p,d,h]),g=m[0],y=m[1],b=(0,rc.useMemo)(function(){return d?h:Rv({},h,{subscription:g})},[d,h,g]),x=(0,rc.useReducer)(R0,RJ,R5),_=x[0][0],w=x[1];if(_&&_.error)throw _.error;var M=(0,rc.useRef)(),E=(0,rc.useRef)(s),S=(0,rc.useRef)(),T=(0,rc.useRef)(!1),A=u(function(){return S.current&&s===E.current?S.current:f(p.getState(),s)},[p,_,s]);R1(R2,[E,M,T,s,A,S,y]),R1(R3,[c,p,g,f,E,M,T,S,y,w],[p,g,f]);var C=(0,rc.useMemo)(function(){return rc.createElement(t,Rv({},A,{ref:o}))},[o,t,A]);return(0,rc.useMemo)(function(){return c?rc.createElement(l.Provider,{value:b},C):C},[l,C,b])}var p=s?rc.memo(h):h;if(p.WrappedComponent=t,p.displayName=h.displayName=r,f){var m=rc.forwardRef(function(e,t){return rc.createElement(p,Rv({},e,{reactReduxForwardedRef:t}))});return m.displayName=r,m.WrappedComponent=t,Rq(m,t)}return Rq(p,t)}}function R6(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function R8(e,t){if(R6(e,t))return!0;
791if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!R6(e[n[i]],t[n[i]]))return!1;return!0}function R7(e){return function(t,n){var r=e(t,n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function R9(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function Pe(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=R9(e);var i=r(t,n);return"function"==typeof i&&(r.mapToProps=i,r.dependsOnOwnProps=R9(i),i=r(t,n)),i},r}}var Pt=[function(e){return"function"==typeof e?Pe(e,"mapDispatchToProps"):void 0},function(e){return e?void 0:R7(function(e){return{dispatch:e}})},function(e){return e&&"object"==typeof e?R7(function(t){var n={};for(var r in e)!function(r){var i=e[r];"function"==typeof i&&(n[r]=function(){return t(i.apply(void 0,arguments))})}(r);return n}):void 0}],Pn=[function(e){return"function"==typeof e?Pe(e,"mapStateToProps"):void 0},function(e){return e?void 0:R7(function(){return{}})}];function Pr(e,t,n){return Rv({},n,e,t)}var Pi=[function(e){return"function"==typeof e?function(t,n){n.displayName;var r,i=n.pure,a=n.areMergedPropsEqual,o=!1;return function(t,n,s){var l=e(t,n,s);return o?i&&a(l,r)||(r=l):(o=!0,r=l),r}}:void 0},function(e){return e?void 0:function(){return Pr}}],Pa=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Po(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,i=t.initMergeProps,a=RD(t,Pa),o=n(e,a),s=r(e,a),l=i(e,a);return(a.pure?function(e,t,n,r,i){var a,o,s,l,u,c=i.areStatesEqual,h=i.areOwnPropsEqual,d=i.areStatePropsEqual,p=!1;return function(i,f){var m,g,v,y,b,x;return p?(m=i,b=!h(g=f,o),x=!c(m,a,g,o),(a=m,o=g,b&&x)?(s=e(a,o),t.dependsOnOwnProps&&(l=t(r,o)),u=n(s,l,o)):b?(e.dependsOnOwnProps&&(s=e(a,o)),t.dependsOnOwnProps&&(l=t(r,o)),u=n(s,l,o)):x?(y=!d(v=e(a,o),s),s=v,y&&(u=n(s,l,o)),u):u):(s=e(a=i,o=f),l=t(r,o),u=n(s,l,o),p=!0,u)}}:function(e,t,n,r){return function(i,a){return n(e(i,a),t(r,a),a)}})(o,s,l,e,a)}var Ps=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function Pl(e,t,n){for(var r=t.length-1;r>=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Pu(e,t){return e===t}var Pc=function(e){var t={},n=t.connectHOC,r=void 0===n?R4:n,i=t.mapStateToPropsFactories,a=void 0===i?Pn:i,o=t.mapDispatchToPropsFactories,s=void 0===o?Pt:o,l=t.mergePropsFactories,u=void 0===l?Pi:l,c=t.selectorFactory,h=void 0===c?Po:c;return function(e,t,n,i){void 0===i&&(i={});var o=i,l=o.pure,c=o.areStatesEqual,d=o.areOwnPropsEqual,p=void 0===d?R8:d,f=o.areStatePropsEqual,m=void 0===f?R8:f,g=o.areMergedPropsEqual,v=void 0===g?R8:g,y=RD(o,Ps),b=Pl(e,a,"mapStateToProps"),x=Pl(t,s,"mapDispatchToProps"),_=Pl(n,u,"mergeProps");return r(h,Rv({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:!!e,initMapStateToProps:b,initMapDispatchToProps:x,initMergeProps:_,pure:void 0===l||l,areStatesEqual:void 0===c?Pu:c,areOwnPropsEqual:p,areStatePropsEqual:m,areMergedPropsEqual:v},y))}}();function Ph(e,t){var n=(0,rc.useState)(function(){return{inputs:t,result:e()}})[0],r=(0,rc.useRef)(!0),i=(0,rc.useRef)(n),a=r.current||t&&i.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,i.current.inputs)?i.current:{inputs:t,result:e()};return(0,rc.useEffect)(function(){r.current=!1,i.current=a},[a]),a.result}RR=rd.unstable_batchedUpdates;var Pd=function(e,t){return Ph(function(){return e},t)},Pp=function(e){var t=e.top,n=e.right,r=e.bottom,i=e.left;return{top:t,right:n,bottom:r,left:i,width:n-i,height:r-t,x:i,y:t,center:{x:(n+i)/2,y:(r+t)/2}}}
791,Pf=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},Pm=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},Pg={top:0,right:0,bottom:0,left:0},Pv=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?Pg:n,i=e.border,a=void 0===i?Pg:i,o=e.padding,s=void 0===o?Pg:o,l=Pp(Pf(t,r)),u=Pp(Pm(t,a)),c=Pp(Pm(u,s));return{marginBox:l,borderBox:Pp(t),paddingBox:u,contentBox:c,margin:r,border:a,padding:s}},Py=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&function(e,t){if(!e)throw Error("Invariant failed")}(!1),n},Pb=function(e,t){var n=e.borderBox,r=e.border,i=e.margin,a=e.padding;return Pv({borderBox:{top:n.top+t.y,left:n.left+t.x,bottom:n.bottom+t.y,right:n.right+t.x},border:r,margin:i,padding:a})},Px=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),Pb(e,t)},P_=function(e,t){return Pv({borderBox:e,margin:{top:Py(t.marginTop),right:Py(t.marginRight),bottom:Py(t.marginBottom),left:Py(t.marginLeft)},padding:{top:Py(t.paddingTop),right:Py(t.paddingRight),bottom:Py(t.paddingBottom),left:Py(t.paddingLeft)},border:{top:Py(t.borderTopWidth),right:Py(t.borderRightWidth),bottom:Py(t.borderBottomWidth),left:Py(t.borderLeftWidth)}})},Pw=function(e){return P_(e.getBoundingClientRect(),window.getComputedStyle(e))},PM=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function PE(e,t){if(e.length!==t.length)return!1;for(var n,r,i=0;i<e.length;i++)if(!((n=e[i])===(r=t[i])||PM(n)&&PM(r))&&1)return!1;return!0}function PS(e,t){void 0===t&&(t=PE);var n,r,i=[],a=!1;return function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return a&&n===this&&t(o,i)||(r=e.apply(this,o),a=!0,n=this,i=o),r}}var PT=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];t=i,n||(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function PA(e,t){}PA.bind(null,"warn");PA.bind(null,"error");function PC(){}function PR(e,t,n){var r=t.map(function(t){var r,i=(r=t.options,Rv({},n,{},r));return e.addEventListener(t.eventName,t.fn,i),function(){e.removeEventListener(t.eventName,t.fn,i)}});return function(){r.forEach(function(e){e()})}}var PP="Invariant failed";function PI(e){this.message=e}function PO(e,t){if(!e)if(0)throw new PI(PP+": "+(t||""));else throw new PI(PP)}PI.prototype.toString=function(){return this.message};var PL=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).callbacks=null,t.unbind=PC,t.onWindowError=function(e){var n=t.getCallbacks();n.isDragging()&&n.tryAbort(),e.error instanceof PI&&e.preventDefault()},t.getCallbacks=function(){if(!t.callbacks)throw Error("Unable to find AppCallbacks in <ErrorBoundary/>");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}Rg(t,e);var n=t.prototype;return n.componentDidMount=function(){this.unbind=PR(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(e){if(e instanceof PI)return void this.setState({});throw e},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(rc.Component),PD=function(e){return e+1},PN=function(e,t){var n=e.droppableId===t.droppableId,r=PD(e.index),i=PD(t.index);return n?"\n      You have moved the item from position "+r+"\n      to position "+i+"\n    ":"\n    You have moved the item from position "+r+"\n    in list "+e.droppableId+"\n    to list "+t.droppableId+"\n    in position "+i+"\n  "},PU=function(e,t,n){return t.droppableId===n.droppableId?"\n      The item "+e+"\n      has been combined with "+n.draggableId:"\n      The item "+e+"\n      in list "+t.droppableId+"\n      has been combined with "+n.draggableId+"\n      in list "+n.droppableId+"\n    "},Pk=function(e){return"\n  The item has returned to its starting position\n  of "+PD(e.index)+"\n"},PB={dragHandleUsageInstructions:"\n  Press space bar to start a drag.\n  When dragging you can use the arrow keys to move the item around and escape to cancel.\n  Some screen readers may require you to be in focus mode or to use your pass through key\n",onDragStart:function(e){return"\n  You have lifted an item in position "+PD(e.source.index)+"\n"},onDragUpdate:function(e){var t=e.destination;if(t)return PN(e.source,t);
791var n=e.combine;return n?PU(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},onDragEnd:function(e){if("CANCEL"===e.reason)return"\n      Movement cancelled.\n      "+Pk(e.source)+"\n    ";var t=e.destination,n=e.combine;return t?"\n      You have dropped the item.\n      "+PN(e.source,t)+"\n    ":n?"\n      You have dropped the item.\n      "+PU(e.draggableId,e.source,n)+"\n    ":"\n    The item has been dropped while not over a drop area.\n    "+Pk(e.source)+"\n  "}},PF={x:0,y:0},Pz=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},PH=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},Pj=function(e,t){return e.x===t.x&&e.y===t.y},PW=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},PG=function(e,t,n){var r;return void 0===n&&(n=0),(r={})[e]=t,r["x"===e?"y":"x"]=n,r},PV=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},PX=function(e,t){return Math.min.apply(Math,t.map(function(t){return PV(e,t)}))},Pq=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},PY=function(e,t){var n=Pp({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n},PZ=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},P$=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},PK=function(e,t,n){if(n&&n.increasedBy){var r;return Rv({},e,((r={})[t.end]=e[t.end]+n.increasedBy[t.line],r))}return e},PJ=function(e){var t,n,r=e.page,i=e.withPlaceholder,a=e.axis,o=e.frame,s=(n=PK((t=r.marginBox,o?PZ(t,o.scroll.diff.displacement):t),a,i),o&&o.shouldClipSubject?PY(o.pageMarginBox,n):Pp(n));return{page:r,withPlaceholder:i,active:s}},PQ=function(e,t){e.frame||PO(!1);var n=e.frame,r=PH(t,n.scroll.initial),i=PW(r),a=Rv({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}}),o=PJ({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:a});return Rv({},e,{frame:a,subject:o})};function P0(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function P1(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;n<e.length;n++)if(t(e[n]))return n;return -1}function P2(e,t){if(e.find)return e.find(t);var n=P1(e,t);if(-1!==n)return e[n]}function P3(e){return Array.prototype.slice.call(e)}var P5=PS(function(e){return e.reduce(function(e,t){return e[t.descriptor.id]=t,e},{})}),P4=PS(function(e){return e.reduce(function(e,t){return e[t.descriptor.id]=t,e},{})}),P6=PS(function(e){return P0(e)}),P8=PS(function(e){return P0(e)}),P7=PS(function(e,t){return P8(t).filter(function(t){return e===t.descriptor.droppableId}).sort(function(e,t){return e.descriptor.index-t.descriptor.index})});function P9(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function Ie(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var It=PS(function(e,t){return t.filter(function(t){return t.descriptor.id!==e.descriptor.id})}),In=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,i=e.insideDestination,a=e.previousImpact;if(!r.isCombineEnabled||!P9(a))return null;function o(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return Rv({},a,{at:t})}var s=a.displaced.all,l=s.length?s[0]:null;if(t)return l?o(l):null;var u=It(n,i);if(!l)return u.length?o(u[u.length-1].descriptor.id):null;var c=P1(u,function(e){return e.descriptor.id===l});-1===c&&PO(!1);var h=c-1;return h<0?null:o(u[h].descriptor.id)},Ir=function(e,t){return e.descriptor.droppableId===t.descriptor.id},Ii={point:PF,value:0},Ia={invisible:{},visible:{},all:[]},Io={displaced:Ia,displacedBy:Ii,at:null},Is=function(e,t){return function(n){return e<=n&&n<=t}},Il=function(e){var t=Is(e.top,e.bottom),n=Is(e.left,e.right);return function(r){if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;var i=t(r.top)||t(r.bottom),a=n(r.left)||n(r.right);if(i&&a)return!0;var o=r.top<e.top&&r.bottom>e.bottom,s=r.left<e.left&&r.right>e.right;return!!o&&!!s||o&&a||s&&i}},Iu=function(e){var t=Is(e.top,e.bottom),n=Is(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)}},Ic={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Ih={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},Id=function(e){var t=e.target,n=e.destination,r=e.viewport,i=e.withDroppableDisplacement,a=e.isVisibleThroughFrameFn,o=i?PZ(t,n.frame?n.frame.scroll.diff.displacement:PF):t;return!!n.subject.active&&a(n.subject.active)(o)&&a(r)(o)},Ip=function(e){return Id(Rv({},e,{isVisibleThroughFrameFn:Iu}))},If=function(e){var t;return Id(Rv({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var n=Is(e.top,e.bottom),r=Is(e.left,e.right);return function(e){return t===Ic?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)}})}))},Im=function(e,t,n){if("boolean"==typeof n)return n;if(!t)return!0;var r=t.invisible,i=t.visible;if(r[e])return!1;var a=i[e];return!a||a.shouldAnimate};function Ig(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,i=e.viewport,a=e.forceShouldAnimate,o=e.last;return t.reduce(function(e,t){var s=Pp(Pf(t.page.marginBox,{top:r.point.y,right:0,bottom:0,left:r.point.x})),l=t.descriptor.id;if(e.all.push(l),!Id(Rv({},{target:s,destination:n,viewport:i,withDroppableDisplacement:!0},{isVisibleThroughFrameFn:Il})))return e.invisible[t.descriptor.id]=!0,e;var u=Im(l,o,a);return e.visible[l]={draggableId:l,shouldAnimate:u},e},{all:[],visible:{}
791,invisible:{}})}function Iv(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,i=e.destination,a=function(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(t,{inHomeList:n});return{displaced:Ia,displacedBy:r,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:a}}}}function Iy(e){var t=e.draggable,n=e.insideDestination,r=e.destination,i=e.viewport,a=e.displacedBy,o=e.last,s=e.index,l=e.forceShouldAnimate,u=Ir(t,r);if(null==s)return Iv({insideDestination:n,inHomeList:u,displacedBy:a,destination:r});var c=P2(n,function(e){return e.descriptor.index===s});if(!c)return Iv({insideDestination:n,inHomeList:u,displacedBy:a,destination:r});var h=It(t,n),d=n.indexOf(c);return{displaced:Ig({afterDragging:h.slice(d),destination:r,displacedBy:a,last:o,viewport:i.frame,forceShouldAnimate:l}),displacedBy:a,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:s}}}}function Ib(e,t){return!!t.effected[e]}var Ix=function(e){var t=e.isMovingForward,n=e.destination,r=e.draggables,i=e.combine,a=e.afterCritical;if(!n.isCombineEnabled)return null;var o=i.draggableId,s=r[o].descriptor.index;return Ib(o,a)?t?s:s-1:t?s+1:s},I_=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,i=e.location;if(!r.length)return null;var a=i.index,o=t?a+1:a-1,s=r[0].descriptor.index,l=r[r.length-1].descriptor.index;return o<s||o>(n?l:l+1)?null:o},Iw=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,i=e.draggables,a=e.destination,o=e.insideDestination,s=e.previousImpact,l=e.viewport,u=e.afterCritical,c=s.at;if(c||PO(!1),"REORDER"===c.type){var h=I_({isMovingForward:t,isInHomeList:n,location:c.destination,insideDestination:o});return null==h?null:Iy({draggable:r,insideDestination:o,destination:a,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:h})}var d=Ix({isMovingForward:t,destination:a,displaced:s.displaced,draggables:i,combine:c.combine,afterCritical:u});return null==d?null:Iy({draggable:r,insideDestination:o,destination:a,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:d})},IM=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,i=e.displacedBy,a=!!(t.visible[r]||t.invisible[r]);return Ib(r,n)?a?PF:PW(i.point):a?i.point:PF},IE=function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,i=Ie(n);i||PO(!1);var a=i.draggableId;return Pz(r[a].page.borderBox.center,IM({displaced:n.displaced,afterCritical:t,combineWith:a,displacedBy:n.displacedBy}))},IS=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},IT=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},IA=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return PG(t.line,n.marginBox[t.end]+IS(t,r),IT(t,n.marginBox,r))},IC=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return PG(t.line,n.marginBox[t.start]-(r.margin[t.end]+r.borderBox[t.size]/2),IT(t,n.marginBox,r))},IR=function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return PG(t.line,n.contentBox[t.start]+IS(t,r),IT(t,n.contentBox,r))},IP=function(e){var t=e.impact,n=e.draggable,r=e.draggables,i=e.droppable,a=e.afterCritical,o=P7(i.descriptor.id,r),s=n.page,l=i.axis;if(!o.length)return IR({axis:l,moveInto:i.page,isMoving:s});var u=t.displaced,c=t.displacedBy,h=u.all[0];if(h){var d=r[h];return Ib(h,a)?IC({axis:l,moveRelativeTo:d.page,isMoving:s}):IC({axis:l,moveRelativeTo:Pb(d.page,c.point),isMoving:s})}var p=o[o.length-1];return p.descriptor.id===n.descriptor.id?s.borderBox.center:Ib(p.descriptor.id,a)?IA({axis:l,moveRelativeTo:Pb(p.page,PW(a.displacedBy.point)),isMoving:s}):IA({axis:l,moveRelativeTo:p.page,isMoving:s})},II=function(e,t){var n=e.frame;return n?Pz(t,n.scroll.diff.displacement):t},IO=function(e){var t=e.impact,n=e.draggable,r=e.droppable,i=e.draggables,a=e.afterCritical,o=n.page.borderBox.center,s=t.at;return r&&s?"REORDER"===s.type?IP({impact:t,draggable:n,draggables:i,droppable:r,afterCritical:a}):IE({impact:t,draggables:i,afterCritical:a}):o},IL=function(e){var t=IO(e),n=e.droppable;return n?II(n,t):t},ID=function(e,t){var n=PH(t,e.scroll.initial),r=PW(n);return{frame:Pp({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function IN(e,t){return e.map(function(e){return t[e]})}var IU=function(e){var t=e.impact,n=e.viewport,r=e.destination,i=e.draggables,a=e.maxScrollChange,o=ID(n,Pz(n.scroll.current,a)),s=r.frame?PQ(r,Pz(r.frame.scroll.current,a)):r,l=t.displaced,u=Ig({afterDragging:IN(l.all,i),destination:r,displacedBy:t.displacedBy,viewport:o.frame,last:l,forceShouldAnimate:!1}),c=Ig({afterDragging:IN(l.all,i),destination:s,displacedBy:t.displacedBy,viewport:n.frame,last:l,forceShouldAnimate:!1}),h={},d={},p=[l,u,c];return l.all.forEach(function(e){var t=function(e,t){for(var n=0;n<t.length;n++){var r=t[n].visible[e];if(r)return r}return null}(e,p);if(t){d[e]=t;return}h[e]=!0}),Rv({},t,{displaced:{all:l.all,invisible:h,visible:d}})},Ik=function(e){var t,n=e.pageBorderBoxCenter,r=e.draggable,i=PH((t=e.viewport,Pz(t.scroll.diff.displacement,n)),r.page.borderBox.center);return Pz(r.client.borderBox.center,i)},IB=function(e){var t=e.draggable,n=e.destination,r=e.newPageBorderBoxCenter,i=e.viewport,a=e.withDroppableDisplacement,o=e.onlyOnMainAxis,s=PH(r,t.page.borderBox.center),l={target:PZ(t.page.borderBox,s),destination:n,withDroppableDisplacement:a,viewport:i};return void 0!==o&&o?If(l):Ip(l)},IF=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,i=e.draggables,a=e.previousImpact,o=e.viewport,s=e.previousPageBorderBoxCenter,l=e.previousClientSelection,u=e.afterCritical;if(!r.isEnabled)return null;var c=P7(r.descriptor.id,i),h=Ir(n,r),d=In({isMovingForward:t,draggable:n,destination:r,insideDestination:c,previousImpact:a})||Iw({isMovingForward:t,isInHomeList:h,draggable:n,draggables:i,destination:r,insideDestination:c,previousImpact:a,viewport:o,afterCritical:u});if(!d)return null;var p=IL({impact:d,draggable:n,droppable:r,draggables:i,afterCritical:u});if(IB({draggable:n,destination:r,newPageBorderBoxCenter:p,viewport:o.frame,
791withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Ik({pageBorderBoxCenter:p,draggable:n,viewport:o}),impact:d,scrollJumpRequest:null};var f=PH(p,s);return{clientSelection:l,impact:IU({impact:d,viewport:o,destination:r,draggables:i,maxScrollChange:f}),scrollJumpRequest:f}},Iz=function(e){var t=e.subject.active;return t||PO(!1),t},IH=function(e){var t=e.isMovingForward,n=e.pageBorderBoxCenter,r=e.source,i=e.droppables,a=e.viewport,o=r.subject.active;if(!o)return null;var s=r.axis,l=Is(o[s.start],o[s.end]),u=P6(i).filter(function(e){return e!==r}).filter(function(e){return e.isEnabled}).filter(function(e){return!!e.subject.active}).filter(function(e){return Il(a.frame)(Iz(e))}).filter(function(e){var n=Iz(e);return t?o[s.crossAxisEnd]<n[s.crossAxisEnd]:n[s.crossAxisStart]<o[s.crossAxisStart]}).filter(function(e){var t=Iz(e),n=Is(t[s.start],t[s.end]);return l(t[s.start])||l(t[s.end])||n(o[s.start])||n(o[s.end])}).sort(function(e,n){var r=Iz(e)[s.crossAxisStart],i=Iz(n)[s.crossAxisStart];return t?r-i:i-r}).filter(function(e,t,n){return Iz(e)[s.crossAxisStart]===Iz(n[0])[s.crossAxisStart]});if(!u.length)return null;if(1===u.length)return u[0];var c=u.filter(function(e){return Is(Iz(e)[s.start],Iz(e)[s.end])(n[s.line])});return 1===c.length?c[0]:c.length>1?c.sort(function(e,t){return Iz(e)[s.start]-Iz(t)[s.start]})[0]:u.sort(function(e,t){var r=PX(n,P$(Iz(e))),i=PX(n,P$(Iz(t)));return r!==i?r-i:Iz(e)[s.start]-Iz(t)[s.start]})[0]},Ij=function(e,t){var n=e.page.borderBox.center;return Ib(e.descriptor.id,t)?PH(n,t.displacedBy.point):n},IW=function(e,t){var n=e.page.borderBox;return Ib(e.descriptor.id,t)?PZ(n,PW(t.displacedBy.point)):n},IG=function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,i=e.insideDestination,a=e.afterCritical;return i.filter(function(e){return Ip({target:IW(e,a),destination:r,viewport:n.frame,withDroppableDisplacement:!0})}).sort(function(e,n){var i=PV(t,II(r,Ij(e,a))),o=PV(t,II(r,Ij(n,a)));return i<o?-1:o<i?1:e.descriptor.index-n.descriptor.index})[0]||null},IV=PS(function(e,t){var n=t[e.line];return{value:n,point:PG(e.line,n)}}),IX=function(e,t,n){var r=e.axis;if("virtual"===e.descriptor.mode)return PG(r.line,t[r.line]);var i=e.subject.page.contentBox[r.size],a=P7(e.descriptor.id,n).reduce(function(e,t){return e+t.client.marginBox[r.size]},0)+t[r.line]-i;return a<=0?null:PG(r.line,a)},Iq=function(e,t){return Rv({},e,{scroll:Rv({},e.scroll,{max:t})})},IY=function(e,t,n){var r=e.frame;Ir(t,e)&&PO(!1),e.subject.withPlaceholder&&PO(!1);var i=IV(e.axis,t.displaceBy).point,a=IX(e,i,n),o={placeholderSize:i,increasedBy:a,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){var s=PJ({page:e.subject.page,withPlaceholder:o,axis:e.axis,frame:e.frame});return Rv({},e,{subject:s})}var l=a?Pz(r.scroll.max,a):r.scroll.max,u=Iq(r,l),c=PJ({page:e.subject.page,withPlaceholder:o,axis:e.axis,frame:u});return Rv({},e,{subject:c,frame:u})},IZ=function(e){var t=e.subject.withPlaceholder;t||PO(!1);var n=e.frame;if(!n){var r=PJ({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return Rv({},e,{subject:r})}var i=t.oldFrameMaxScroll;i||PO(!1);var a=Iq(n,i),o=PJ({page:e.subject.page,axis:e.axis,frame:a,withPlaceholder:null});return Rv({},e,{subject:o,frame:a})},I$=function(e){var t,n=e.previousPageBorderBoxCenter,r=e.moveRelativeTo,i=e.insideDestination,a=e.draggable,o=e.draggables,s=e.destination,l=e.viewport,u=e.afterCritical;if(!r){if(i.length)return null;var c={displaced:Ia,displacedBy:Ii,at:{type:"REORDER",destination:{droppableId:s.descriptor.id,index:0}}},h=IL({impact:c,draggable:a,droppable:s,draggables:o,afterCritical:u}),d=Ir(a,s)?s:IY(s,a,o);return IB({draggable:a,destination:d,newPageBorderBoxCenter:h,viewport:l.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?c:null}var p=n[s.axis.line]<=r.page.borderBox.center[s.axis.line],f=(t=r.descriptor.index,r.descriptor.id===a.descriptor.id||p?t:t+1),m=IV(s.axis,a.displaceBy);return Iy({draggable:a,insideDestination:i,destination:s,viewport:l,displacedBy:m,last:Ia,index:f})},IK=function(e){var t=e.isMovingForward,n=e.previousPageBorderBoxCenter,r=e.draggable,i=e.isOver,a=e.draggables,o=e.droppables,s=e.viewport,l=e.afterCritical,u=IH({isMovingForward:t,pageBorderBoxCenter:n,source:i,droppables:o,viewport:s});if(!u)return null;var c=P7(u.descriptor.id,a),h=IG({pageBorderBoxCenter:n,viewport:s,destination:u,insideDestination:c,afterCritical:l}),d=I$({previousPageBorderBoxCenter:n,destination:u,draggable:r,draggables:a,moveRelativeTo:h,insideDestination:c,viewport:s,afterCritical:l});return d?{clientSelection:Ik({pageBorderBoxCenter:IL({impact:d,draggable:r,droppable:u,draggables:a,afterCritical:l}),draggable:r,viewport:s}),impact:d,scrollJumpRequest:null}:null},IJ=function(e){var t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},IQ=function(e,t){var n=IJ(e);return n?t[n]:null},I0=function(e){var t=e.state,n=e.type,r=IQ(t.impact,t.dimensions.droppables),i=!!r,a=t.dimensions.droppables[t.critical.droppable.
791id],o=r||a,s=o.axis.direction,l="vertical"===s&&("MOVE_UP"===n||"MOVE_DOWN"===n)||"horizontal"===s&&("MOVE_LEFT"===n||"MOVE_RIGHT"===n);if(l&&!i)return null;var u="MOVE_DOWN"===n||"MOVE_RIGHT"===n,c=t.dimensions.draggables[t.critical.draggable.id],h=t.current.page.borderBoxCenter,d=t.dimensions,p=d.draggables,f=d.droppables;return l?IF({isMovingForward:u,previousPageBorderBoxCenter:h,draggable:c,destination:o,draggables:p,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):IK({isMovingForward:u,previousPageBorderBoxCenter:h,draggable:c,isOver:o,draggables:p,droppables:f,viewport:t.viewport,afterCritical:t.afterCritical})};function I1(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function I2(e){var t=Is(e.top,e.bottom),n=Is(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}var I3=function(e,t){return Pp(PZ(e,t))},I5=function(e,t){var n=e.frame;return n?I3(t,n.scroll.diff.value):t};function I4(e){var t=e.displaced,n=e.id;return!!(t.visible[n]||t.invisible[n])}var I6=function(e){var t,n,r,i,a=e.pageBorderBoxWithDroppableScroll,o=e.draggable,s=e.destination,l=e.insideDestination,u=e.last,c=e.viewport,h=e.afterCritical,d=s.axis,p=IV(s.axis,o.displaceBy),f=p.value,m=a[d.start],g=a[d.end],v=P2(It(o,l),function(e){var t=e.descriptor.id,n=e.page.borderBox.center[d.line],r=Ib(t,h),i=I4({displaced:u,id:t});return r?i?g<=n:m<n-f:i?g<=n+f:m<n}),y=(n=(t={draggable:o,closest:v,inHomeList:Ir(o,s)}).draggable,r=t.closest,i=t.inHomeList,r?i&&r.descriptor.index>n.descriptor.index?r.descriptor.index-1:r.descriptor.index:null);return Iy({draggable:o,insideDestination:l,destination:s,viewport:c,last:u,displacedBy:p,index:y})},I8=function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,r=e.previousImpact,i=e.destination,a=e.insideDestination,o=e.afterCritical;if(!i.isCombineEnabled)return null;var s=i.axis,l=IV(i.axis,t.displaceBy),u=l.value,c=n[s.start],h=n[s.end],d=P2(It(t,a),function(e){var t=e.descriptor.id,n=e.page.borderBox,i=n[s.size]/4,a=Ib(t,o),l=I4({displaced:r.displaced,id:t});return a?l?h>n[s.start]+i&&h<n[s.end]-i:c>n[s.start]-u+i&&c<n[s.end]-u-i:l?h>n[s.start]+u+i&&h<n[s.end]+u-i:c>n[s.start]+i&&c<n[s.end]-i});return d?{displacedBy:l,displaced:r.displaced,at:{type:"COMBINE",combine:{draggableId:d.descriptor.id,droppableId:i.descriptor.id}}}:null},I7=function(e){var t,n,r,i,a,o,s,l,u,c,h=e.pageOffset,d=e.draggable,p=e.draggables,f=e.droppables,m=e.previousImpact,g=e.viewport,v=e.afterCritical,y=I3(d.page.borderBox,h),b=(l=(t={pageBorderBox:y,draggable:d,droppables:f}).pageBorderBox,u=t.draggable,(c=P6(t.droppables).filter(function(e){if(!e.isEnabled)return!1;var t=e.subject.active;if(!t||!(l.left<t.right)||!(l.right>t.left)||!(l.top<t.bottom)||!(l.bottom>t.top))return!1;if(I2(t)(l.center))return!0;var n=e.axis,r=t.center[n.crossAxisLine],i=l[n.crossAxisStart],a=l[n.crossAxisEnd],o=Is(t[n.crossAxisStart],t[n.crossAxisEnd]),s=o(i),u=o(a);return!s&&!u||(s?i<r:a>r)})).length?1===c.length?c[0].descriptor.id:(r=(n={pageBorderBox:l,draggable:u,candidates:c}).pageBorderBox,i=n.draggable,a=n.candidates,o=i.page.borderBox.center,(s=a.map(function(e){var t=e.axis,n=PG(e.axis.line,r.center[t.line],e.page.borderBox.center[t.crossAxisLine]);return{id:e.descriptor.id,distance:PV(o,n)}}).sort(function(e,t){return t.distance-e.distance}))[0]?s[0].id:null):null);if(!b)return Io;var x=f[b],_=P7(x.descriptor.id,p),w=I5(x,y);return I8({pageBorderBoxWithDroppableScroll:w,draggable:d,previousImpact:m,destination:x,insideDestination:_,afterCritical:v})||I6({pageBorderBoxWithDroppableScroll:w,draggable:d,destination:x,insideDestination:_,last:m.displaced,viewport:g,afterCritical:v})},I9=function(e,t){var n;return Rv({},e,((n={})[t.descriptor.id]=t,n))},Oe=function(e){var t=e.previousImpact,n=e.impact,r=e.droppables,i=IJ(t),a=IJ(n);if(!i||i===a)return r;var o=r[i];return o.subject.withPlaceholder?I9(r,IZ(o)):r},Ot=function(e){var t=e.draggable,n=e.draggables,r=e.droppables,i=e.previousImpact,a=e.impact,o=Oe({previousImpact:i,impact:a,droppables:r}),s=IJ(a);if(!s)return o;var l=r[s];return Ir(t,l)||l.subject.withPlaceholder?o:I9(o,IY(l,t,n))},On=function(e){var t=e.state,n=e.clientSelection,r=e.dimensions,i=e.viewport,a=e.impact,o=e.scrollJumpRequest,s=i||t.viewport,l=r||t.dimensions,u=n||t.current.client.selection,c=PH(u,t.initial.client.selection),h={offset:c,selection:u,borderBoxCenter:Pz(t.initial.client.borderBoxCenter,c)},d={selection:Pz(h.selection,s.scroll.current),borderBoxCenter:Pz(h.borderBoxCenter,s.scroll.current),offset:Pz(h.offset,s.scroll.diff.value)},p={client:h,page:d};if("COLLECTING"===t.phase)return Rv({phase:"COLLECTING"},t,{dimensions:l,viewport:s,current:p});var f=l.draggables[t.critical.draggable.id],m=a||I7({pageOffset:d.offset,draggable:f,draggables:l.draggables,droppables:l.droppables,previousImpact:t.impact,viewport:s,afterCritical:t.afterCritical}),g=Ot({draggable:f,impact:m,previousImpact:t.impact,draggables:l.draggables,droppables:l.droppables});return Rv({},t,{current:p,dimensions:{draggables:l.draggables,droppables:g},impact:m,viewport:s,scrollJumpRequest:o||null,forceShouldAnimate:!o&&null})},Or=function(e){var t,n=e.impact,r=e.viewport,i=e.draggables,a=e.destination,o=e.forceShouldAnimate,s=n.displaced,l=Ig
791({afterDragging:(t=s.all,t.map(function(e){return i[e]})),destination:a,displacedBy:n.displacedBy,viewport:r.frame,forceShouldAnimate:o,last:s});return Rv({},n,{displaced:l})},Oi=function(e){var t=e.impact,n=e.draggable,r=e.droppable,i=e.draggables,a=e.viewport;return Ik({pageBorderBoxCenter:IL({impact:t,draggable:n,draggables:i,droppable:r,afterCritical:e.afterCritical}),draggable:n,viewport:a})},Oa=function(e){var t=e.state,n=e.dimensions,r=e.viewport;"SNAP"!==t.movementMode&&PO(!1);var i=t.impact,a=r||t.viewport,o=n||t.dimensions,s=o.draggables,l=o.droppables,u=s[t.critical.draggable.id],c=IJ(i);c||PO(!1);var h=l[c],d=Or({impact:i,viewport:a,destination:h,draggables:s}),p=Oi({impact:d,draggable:u,droppable:h,draggables:s,viewport:a,afterCritical:t.afterCritical});return On({impact:d,clientSelection:p,state:t,dimensions:o,viewport:a})},Oo=function(e){var t,n=e.draggable,r=e.home,i=e.draggables,a=e.viewport,o=IV(r.axis,n.displaceBy),s=P7(r.descriptor.id,i),l=s.indexOf(n);-1===l&&PO(!1);var u=s.slice(l+1),c=u.reduce(function(e,t){return e[t.descriptor.id]=!0,e},{}),h={inVirtualList:"virtual"===r.descriptor.mode,displacedBy:o,effected:c};return{impact:{displaced:Ig({afterDragging:u,destination:r,displacedBy:o,last:null,viewport:
791a.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:{index:(t=n.descriptor).index,droppableId:t.droppableId}}},afterCritical:h}},Os=function(e){},Ol=function(e){},Ou=function(e){var t=e.draggable,n=e.offset,r=e.initialWindowScroll,i=Pb(t.client,n),a=Px(i,r);return Rv({},t,{placeholder:Rv({},t.placeholder,{client:i}),client:i,page:a})},Oc=function(e){var t=e.frame;return t||PO(!1),t},Oh=function(e){var t=e.additions,n=e.updatedDroppables,r=e.viewport,i=r.scroll.diff.value;return t.map(function(e){var t=Pz(i,Oc(n[e.descriptor.droppableId]).scroll.diff.value);return Ou({draggable:e,offset:t,initialWindowScroll:r.scroll.initial})})},Od=function(e){var t=e.state,n=e.published;Os();var r=n.modified.map(function(e){return PQ(t.dimensions.droppables[e.droppableId],e.scroll)}),i=Rv({},t.dimensions.droppables,{},P5(r)),a=P4(Oh({additions:n.additions,updatedDroppables:i,viewport:t.viewport})),o=Rv({},t.dimensions.draggables,{},a);n.removals.forEach(function(e){delete o[e]});var s={droppables:i,draggables:o},l=IJ(t.impact),u=l?s.droppables[l]:null,c=Oo({draggable:s.draggables[t.critical.draggable.id],home:s.droppables[t.critical.droppable.id],draggables:o,viewport:t.viewport}),h=c.impact,d=c.afterCritical,p=u&&u.isCombineEnabled?t.impact:h,f=I7({pageOffset:t.current.page.offset,draggable:s.draggables[t.critical.draggable.id],draggables:s.draggables,droppables:s.droppables,previousImpact:p,viewport:t.viewport,afterCritical:d});Ol();var m=Rv({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:f,onLiftImpact:h,dimensions:s,afterCritical:d,forceShouldAnimate:!1});return"COLLECTING"===t.phase?m:Rv({phase:"DROP_PENDING"},m,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1})},Op=function(e){return"SNAP"===e.movementMode},Of=function(e,t,n){var r,i=(r=e.dimensions,{draggables:r.draggables,droppables:I9(r.droppables,t)});return!Op(e)||n?On({state:e,dimensions:i}):Oa({state:e,dimensions:i})};function Om(e){return e.isDragging&&"SNAP"===e.movementMode?Rv({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var Og={phase:"IDLE",completed:null,shouldFlush:!1},Ov=function(e,t){if(void 0===e&&(e=Og),"FLUSH"===t.type)return Rv({},Og,{shouldFlush:!0});if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&PO(!1);var n=t.payload,r=n.critical,i=n.clientSelection,a=n.viewport,o=n.dimensions,s=n.movementMode,l=o.draggables[r.draggable.id],u=o.droppables[r.droppable.id],c={selection:i,borderBoxCenter:l.client.borderBox.center,offset:PF},h={client:c,page:{selection:Pz(c.selection,a.scroll.initial),borderBoxCenter:Pz(c.selection,a.scroll.initial),offset:Pz(c.selection,a.scroll.diff.value)}},d=P6(o.droppables).every(function(e){return!e.isFixedOnPage}),p=Oo({draggable:l,home:u,draggables:o.draggables,viewport:a}),f=p.impact;return{phase:"DRAGGING",isDragging:!0,critical:r,movementMode:s,dimensions:o,initial:h,current:h,isWindowScrollAllowed:d,impact:f,afterCritical:p.afterCritical,onLiftImpact:f,viewport:a,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&PO(!1),Rv({phase:"COLLECTING"},e,{phase:"COLLECTING"}));if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&PO(!1),Od({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;I1(e)||PO(!1);var m=t.payload.client;return Pj(m,e.current.client.selection)?e:On({state:e,clientSelection:m,impact:Op(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"COLLECTING"===e.phase)return Om(e);I1(e)||PO(!1);var g=t.payload,v=g.id,y=g.newScroll,b=e.dimensions.droppables[v];return b?Of(e,PQ(b,y),!1):e}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;I1(e)||PO(!1);var x=t.payload,_=x.id,w=x.isEnabled,M=e.dimensions.droppables[_];return M||PO(!1),M.isEnabled===w&&PO(!1),Of(e,Rv({},M,{isEnabled:w}),!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;I1(e)||PO(!1);var E=t.payload,S=E.id,T=E.isCombineEnabled,A=e.dimensions.droppables[S];
791return A||PO(!1),A.isCombineEnabled===T&&PO(!1),Of(e,Rv({},A,{isCombineEnabled:T}),!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;I1(e)||PO(!1),e.isWindowScrollAllowed||PO(!1);var C=t.payload.newScroll;if(Pj(e.viewport.scroll.current,C))return Om(e);var R=ID(e.viewport,C);return Op(e)?Oa({state:e,viewport:R}):On({state:e,viewport:R})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!I1(e))return e;var P=t.payload.maxScroll;if(Pj(P,e.viewport.scroll.max))return e;var I=Rv({},e.viewport,{scroll:Rv({},e.viewport.scroll,{max:P})});return Rv({phase:"DRAGGING"},e,{viewport:I})}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&PO(!1);var O=I0({state:e,type:t.type});return O?On({state:e,impact:O.impact,clientSelection:O.clientSelection,scrollJumpRequest:O.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){var L=t.payload.reason;return"COLLECTING"!==e.phase&&PO(!1),Rv({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:L})}if("DROP_ANIMATE"===t.type){var D=t.payload,N=D.completed,U=D.dropDuration,k=D.newHomeClientOffset;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&PO(!1),{phase:"DROP_ANIMATING",completed:N,dropDuration:U,newHomeClientOffset:k,dimensions:e.dimensions}}return"DROP_COMPLETE"===t.type?{phase:"IDLE",completed:t.payload.completed,shouldFlush:!1}:e},Oy=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},Ob=function(){return{type:"COLLECTION_STARTING",payload:null}},Ox=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},O_=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},Ow=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},OM=function(e){return{type:"MOVE",payload:e}},OE=function(){return{type:"MOVE_UP",payload:null}},OS=function(){return{type:"MOVE_DOWN",payload:null}},OT=function(){return{type:"MOVE_RIGHT",payload:null}},OA=function(){return{type:"MOVE_LEFT",payload:null}},OC=function(){return{type:"FLUSH",payload:null}},OR=function(e){return{type:"DROP_COMPLETE",payload:e}},OP=function(e){return{type:"DROP",payload:e}},OI=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}},OO={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},OL={opacity:{drop:0,combining:.7},scale:{drop:.75}},OD={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ON=OD.outOfTheWay+"s "+OO.outOfTheWay,OU={fluid:"opacity "+ON,snap:"transform "+ON+", opacity "+ON,drop:function(e){var t=e+"s "+OO.drop;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+ON,placeholder:"height "+ON+", width "+ON+", margin "+ON},Ok=function(e){return Pj(e,PF)?null:"translate("+e.x+"px, "+e.y+"px)"},OB={moveTo:Ok,drop:function(e,t){var n=Ok(e);return n?t?n+" scale("+OL.scale.drop+")":n:null}},OF=OD.minDropTime,Oz=OD.maxDropTime,OH=Oz-OF,Oj=function(e){var t=e.current,n=e.destination,r=e.reason,i=PV(t,n);if(i<=0)return OF;if(i>=1500)return Oz;var a=OF+i/1500*OH;return Number(("CANCEL"===r?.6*a:a).toFixed(2))},OW=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,i=e.viewport,a=e.afterCritical,o=r.draggables,s=r.droppables,l=IJ(t),u=l?s[l]:null,c=s[n.descriptor.droppableId];return PH(Oi({impact:t,draggable:n,draggables:o,afterCritical:a,droppable:u||c,viewport:i}),n.client.borderBox.center)},OG=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,i=e.home,a=e.viewport,o=e.onLiftImpact;return r.at&&"DROP"===n?"REORDER"===r.at.type?{impact:r,didDropInsideDroppable:!0}:{impact:Rv({},r,{displaced:Ia}),didDropInsideDroppable:!0}:{impact:Or({draggables:t,impact:o,destination:i,viewport:a,forceShouldAnimate:!0}),didDropInsideDroppable:!1}},OV=function(e){var t=e.getState,n=e.dispatch;return function(e){return function(r){if("DROP"!==r.type)return void e(r);var i=t(),a=r.payload.reason;if("COLLECTING"===i.phase)return void n({type:"DROP_PENDING",payload:{reason:a}});if("IDLE"!==i.phase){"DROP_PENDING"===i.phase&&i.isWaiting&&PO(!1),"DRAGGING"!==i.phase&&"DROP_PENDING"!==i.phase&&PO(!1);var o=i.critical,s=i.dimensions,l=s.draggables[i.critical.draggable.id],u=OG({reason:a,lastImpact:i.impact,afterCritical:i.afterCritical,onLiftImpact:i.onLiftImpact,home:i.dimensions.droppables[i.critical.droppable.
791id],viewport:i.viewport,draggables:i.dimensions.draggables}),c=u.impact,h=u.didDropInsideDroppable,d=h?P9(c):null,p=h?Ie(c):null,f={index:o.draggable.index,droppableId:o.droppable.id},m={draggableId:l.descriptor.id,type:l.descriptor.type,source:f,reason:a,mode:i.movementMode,destination:d,combine:p},g=OW({impact:c,draggable:l,dimensions:s,viewport:i.viewport,afterCritical:i.afterCritical}),v={critical:i.critical,afterCritical:i.afterCritical,result:m,impact:c};if(!(!Pj(i.current.client.offset,g)||m.combine))return void n(OR({completed:v}));var y=Oj({current:i.current.client.offset,destination:g,reason:a});n({type:"DROP_ANIMATE",payload:{newHomeClientOffset:g,dropDuration:y,completed:v}})}}}},OX=function(){return{x:window.pageXOffset,y:window.pageYOffset}},Oq=function(e){var t=function(e){var t=e.onWindowScroll,n=PT(function(){t(OX())}),r={eventName:"scroll",options:{passive:!0,capture:!1},fn:function(e){(e.target===window||e.target===window.document)&&n()}},i=PC;function a(){return i!==PC}return{start:function(){a()&&PO(!1),i=PR(window,[r])},stop:function(){a()||PO(!1),n.cancel(),i(),i=PC},isActive:a}}({onWindowScroll:function(t){e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return function(e){return function(n){t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&("DROP_COMPLETE"===n.type||"DROP_ANIMATE"===n.type||"FLUSH"===n.type)&&t.stop(),e(n)}}},OY=function(e){var t=!1,n=!1,r=setTimeout(function(){n=!0}),i=function(i){!t&&(n||(t=!0,e(i),clearTimeout(r)))};return i.wasCalled=function(){return t},i},OZ=function(){var e=[],t=function(t){var n=P1(e,function(e){return e.timerId===t});-1===n&&PO(!1),e.splice(n,1)[0].callback()};return{add:function(n){var r=setTimeout(function(){return t(r)});e.push({timerId:r,callback:n})},flush:function(){if(e.length){var t=[].concat(e);e.length=0,t.forEach(function(e){clearTimeout(e.timerId),e.callback()})}}}},O$=function(e,t){if(e===t)return!0;var n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r},OK=function(e,t){Os(),t(),Ol()},OJ=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},OQ=function(e,t,n,r){if(!e)return void n(r(t));var i=OY(n);e(t,{announce:i}),i.wasCalled()||n(r(t))},O0=function(e,t){var n=OZ(),r=null,i=function(n){r||PO(!1),r=null,OK("onDragEnd",function(){return OQ(e().onDragEnd,n,t,PB.onDragEnd)})};return{beforeCapture:function(t,n){r&&PO(!1),OK("onBeforeCapture",function(){var r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})})},beforeStart:function(t,n){r&&PO(!1),OK("onBeforeDragStart",function(){var r=e().onBeforeDragStart;r&&r(OJ(t,n))})},start:function(i,a){r&&PO(!1);var o=OJ(i,a);r={mode:a,lastCritical:i,lastLocation:o.source,lastCombine:null},n.add(function(){OK("onDragStart",function(){return OQ(e().onDragStart,o,t,PB.onDragStart)})})},update:function(i,a){var o,s,l=P9(a),u=Ie(a);r||PO(!1);var c=!O$(i,r.lastCritical);c&&(r.lastCritical=i);var h=(o=r.lastLocation,(null!=o||null!=l)&&(null==o||null==l||o.droppableId!==l.droppableId||o.index!==l.index));h&&(r.lastLocation=l);var d=(s=r.lastCombine,(null!=s||null!=u)&&(null==s||null==u||s.draggableId!==u.draggableId||s.droppableId!==u.droppableId));if(d&&(r.lastCombine=u),c||h||d){var p=Rv({},OJ(i,r.mode),{combine:u,destination:l});n.add(function(){OK("onDragUpdate",function(){return OQ(e().onDragUpdate,p,t,PB.onDragUpdate)})})}},flush:function(){r||PO(!1),n.flush()},drop:i,abort:function(){r&&i(Rv({},OJ(r.lastCritical,r.mode),{combine:null,destination:null,reason:"CANCEL"}))}}},O1=function(e,t){var n=O0(e,t);return function(e){return function(t){return function(r){if("BEFORE_INITIAL_CAPTURE"===r.type)return void n.beforeCapture(r.payload.draggableId,r.payload.movementMode);if("INITIAL_PUBLISH"===r.type){var i=r.payload.critical;n.beforeStart(i,r.payload.movementMode),t(r),n.start(i,r.payload.movementMode);return}if("DROP_COMPLETE"===r.type){var a=r.payload.completed.result;n.flush(),t(r),n.drop(a);return}if(t(r),"FLUSH"===r.type)return void n.abort();var o=e.getState();"DRAGGING"===o.phase&&n.update(o.critical,o.impact)}}}},O2=function(e){return function(t){return function(n){if("DROP_ANIMATION_FINISHED"!==n.type)return void t(n);var r=e.getState();"DROP_ANIMATING"!==r.phase&&PO(!1),e.dispatch(OR({completed:r.completed}))}}},O3=function(e){var t=null,n=null;return function(r){return function(i){if(("FLUSH"===i.type||"DROP_COMPLETE"===i.type||"DROP_ANIMATION_FINISHED"===i.type)&&(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(i),"DROP_ANIMATE"===i.type){var a={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch(OI())}};n=requestAnimationFrame(function(){n=null,t=PR(window,[a])})}}}},O5=function(e){var t=!1;return function(){return function(n){return function(r){if("INITIAL_PUBLISH"===r.type){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),t){if("FLUSH"===r.type){t=!1,e.tryRestoreFocusRecorded();return}if("DROP_COMPLETE"===r.type){t=!1;var i=r.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}},O4=function(e){return function(t){return function(n){if(t(n),"PUBLISH_WHILE_DRAGGING"===n.type){var r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(OP({reason:r.reason})))}}}},O6=function(e){var t=e.dimensionMarshal,n=e.focusMarshal,r=e.styleMarshal,i=e.getResponders,a=e.announce,o=e.autoScroller;return function e(t,n,r){if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw Error(R_(0));if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw Error(R_(1));return r(e)(t,n)}if("function"!=typeof t)throw Error(R_(2));var i,a=t,o=n,s=[],l=s,u=!1;function c(){l===s&&(l=s.slice())}function h(){if(u)throw Error(R_(3));return o}function d(e){if("function"!=typeof e)throw Error(R_(4));if(u)throw Error(R_(5));var t=!0;return c(),l.push(e),function(){if(t){if(u)throw Error(R_(6));t=!1,c();var n=l.indexOf(e);l.splice(n,1),s=null}}}function p(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw Error(R_(7));if(void 0===e.type)throw Error(R_(8));if(u)throw Error(R_(9));try{u=!0,o=a(o,e)}finally{u=!1}for(var t=s=l,n=0;n<t.length;n++)(0,t[n])();return e}return p({type:RE.INIT}),(i={dispatch:p,subscribe:d,getState:h,replaceReducer:function(e){if("function"!=typeof e)throw Error(R_(10));a=e,p({type:RE.REPLACE})}})[Rw]=function(){var e;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw Error(R_(11));function t(){e.next&&e.next(h())}return t(),{unsubscribe:d(t)}}})[Rw]=function(){return this},e},i}(Ov,RA(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw Error(R_(15))},i={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},a=t.map(function(e){return e(i)});return r=RA.apply(void 0,a)(n.dispatch),Rx(Rx({},n),{},{dispatch:r})}}}(function(){return function(e){return function(t){"INITIAL_PUBLISH"===t.type&&r.dragging(),"DROP_ANIMATE"===t.type&&r.dropping(t.payload.completed.result.reason),("FLUSH"===t.type||"DROP_COMPLETE"===t.type)&&r.resting(),e(t)}}},function(){return function(e){return function(n){("DROP_COMPLETE"===n.type||"FLUSH"===n.type||"DROP_ANIMATE"===n.type)&&t.stopPublishing(),e(n)}}}
791,function(e){var n=e.getState,r=e.dispatch;return function(e){return function(i){if("LIFT"!==i.type)return void e(i);var a=i.payload,o=a.id,s=a.clientSelection,l=a.movementMode,u=n();"DROP_ANIMATING"===u.phase&&r(OR({completed:u.completed})),"IDLE"!==n().phase&&PO(!1),r(OC()),r({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:o,movementMode:l}});var c=t.startPublishing({draggableId:o,scrollOptions:{shouldPublishImmediately:"SNAP"===l}});r({type:"INITIAL_PUBLISH",payload:{critical:c.critical,dimensions:c.dimensions,clientSelection:s,movementMode:l,viewport:c.viewport}})}}},OV,O2,O3,O4,function(e){return function(t){return function(n){if("DROP_COMPLETE"===n.type||"DROP_ANIMATE"===n.type||"FLUSH"===n.type){o.stop(),t(n);return}if("INITIAL_PUBLISH"===n.type){t(n);var r=e.getState();"DRAGGING"!==r.phase&&PO(!1),o.start(r);return}t(n),o.scroll(e.getState())}}},Oq,O5(n),O1(i,a))))},O8=function(){return{additions:{},removals:{},modified:{}}},O7=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,i=PH({x:n,y:t},{x:e.width,y:r});return{x:Math.max(0,i.x),y:Math.max(0,i.y)}},O9=function(){var e=document.documentElement;return e||PO(!1),e},Le=function(){var e=O9();return O7({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},Lt=function(){var e=OX(),t=Le(),n=e.y,r=e.x,i=O9();return{frame:Pp({top:n,left:r,right:r+i.clientWidth,bottom:n+i.clientHeight}),scroll:{initial:e,current:e,max:t,diff:{value:PF,displacement:PF}}}},Ln=function(e){var t=e.critical,n=e.scrollOptions,r=e.registry;Os();var i=Lt(),a=i.scroll.current,o=t.droppable,s=r.droppable.getAllByType(o.type).map(function(e){return e.callbacks.getDimensionAndWatchScroll(a,n)}),l={draggables:P4(r.draggable.getAllByType(t.draggable.type).map(function(e){return e.getDimension(a)})),droppables:P5(s)};return Ol(),{dimensions:l,critical:t,viewport:i}};function Lr(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode}var Li=function(e,t){var n,r,i,a,o,s,l=null,u=(r=(n={callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}).registry,i=n.callbacks,a=O8(),o=null,s=function(){o||(i.collectionStarting(),o=requestAnimationFrame(function(){o=null,Os();var e=a,t=e.additions,n=e.removals,s=e.modified,l=Object.keys(t).map(function(e){return r.draggable.getById(e).getDimension(PF)}).sort(function(e,t){return e.descriptor.index-t.descriptor.index}),u=Object.keys(s).map(function(e){var t=r.droppable.getById(e).callbacks.getScrollWhileDragging();return{droppableId:e,scroll:t}}),c={additions:l,removals:Object.keys(n),modified:u};a=O8(),Ol(),i.publish(c)}))},{add:function(e){var t=e.descriptor.id;a.additions[t]=e,a.modified[e.descriptor.droppableId]=!0,a.removals[t]&&delete a.removals[t],s()},remove:function(e){var t=e.descriptor;a.removals[t.id]=!0,a.modified[t.droppableId]=!0,a.additions[t.id]&&delete a.additions[t.id],s()},stop:function(){o&&(cancelAnimationFrame(o),o=null,a=O8())}}),c=function(t){l||PO(!1);var n=l.critical.draggable;"ADDITION"===t.type&&Lr(e,n,t.value)&&u.add(t.value),"REMOVAL"===t.type&&Lr(e,n,t.value)&&u.remove(t.value)};return{updateDroppableIsEnabled:function(n,r){e.droppable.exists(n)||PO(!1),l&&t.updateDroppableIsEnabled({id:n,isEnabled:r})},updateDroppableIsCombineEnabled:function(n,r){l&&(e.droppable.exists(n)||PO(!1),t.updateDroppableIsCombineEnabled({id:n,isCombineEnabled:r}))},scrollDroppable:function(t,n){l&&e.droppable.getById(t).callbacks.scroll(n)},updateDroppableScroll:function(n,r){l&&(e.droppable.exists(n)||PO(!1),t.updateDroppableScroll({id:n,newScroll:r}))},startPublishing:function(t){l&&PO(!1);var n=e.draggable.getById(t.draggableId),r=e.droppable.getById(n.descriptor.droppableId),i={draggable:n.descriptor,droppable:r.descriptor};return l={critical:i,unsubscribe:e.subscribe(c)},Ln({critical:i,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(l){u.stop();var t=l.critical.droppable;e.droppable.getAllByType(t.type).forEach(function(e){return e.callbacks.dragStopped()}),l.unsubscribe(),l=null}}}},La=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason},Lo=function(e){window.scrollBy(e.x,e.y)},Ls=PS(function(e){return P6(e).filter(function(e){return!!e.isEnabled&&!!e.frame})}),Ll=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var i=r[n];return i.frame?i:null}return P2(Ls(r),function(e){return e.frame||PO(!1),I2(e.frame.pageMarginBox)(t)})},Lu={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(e){return Math.pow(e,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},Lc=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,i=n-t;return 0===i?0:(r-t)/i},Lh=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return Lu.maxPixelScroll;if(e===t.startScrollingFrom)return 1;var n=Lc({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e});return Math.ceil(Lu.maxPixelScroll*Lu.ease(1-n))},Ld=Lu.durationDampening.accelerateAt,Lp=Lu.durationDampening.stopDampeningAt,Lf=function(e,t){var n=Date.now()-t;if(n>=Lp)return e;if(n<Ld)return 1;var r=Lc({startOfRange:Ld,endOfRange:Lp,current:n});return Math.ceil(e*Lu.ease(r))}
791,Lm=function(e){var t=e.distanceToEdge,n=e.thresholds,r=e.dragStartTime,i=e.shouldUseTimeDampening,a=Lh(t,n);return 0===a?0:i?Math.max(Lf(a,r),1):a},Lg=function(e){var t,n,r=e.container,i=e.distanceToEdges,a=e.dragStartTime,o=e.axis,s=e.shouldUseTimeDampening,l={startScrollingFrom:(t=r)[(n=o).size]*Lu.startFromPercentage,maxScrollValueAt:t[n.size]*Lu.maxScrollAtPercentage};return i[o.end]<i[o.start]?Lm({distanceToEdge:i[o.end],thresholds:l,dragStartTime:a,shouldUseTimeDampening:s}):-1*Lm({distanceToEdge:i[o.start],thresholds:l,dragStartTime:a,shouldUseTimeDampening:s})},Lv=function(e){var t=e.container,n=e.subject,r=e.proposedScroll,i=n.height>t.height,a=n.width>t.width;return a||i?a&&i?null:{x:a?0:r.x,y:i?0:r.y}:r},Ly=Pq(function(e){return 0===e?0:e}),Lb=function(e){var t=e.dragStartTime,n=e.container,r=e.subject,i=e.center,a=e.shouldUseTimeDampening,o={top:i.y-n.top,right:n.right-i.x,bottom:n.bottom-i.y,left:i.x-n.left},s=Lg({container:n,distanceToEdges:o,dragStartTime:t,axis:Ic,shouldUseTimeDampening:a}),l=Ly({x:Lg({container:n,distanceToEdges:o,dragStartTime:t,axis:Ih,shouldUseTimeDampening:a}),y:s});if(Pj(l,PF))return null;var u=Lv({container:n,subject:r,proposedScroll:l});return u?Pj(u,PF)?null:u:null},Lx=Pq(function(e){return 0===e?0:e>0?1:-1}),L_=function(){var e=function(e,t){return e<0?e:e>t?e-t:0};return function(t){var n=t.current,r=t.max,i=Pz(n,t.change),a={x:e(i.x,r.x),y:e(i.y,r.y)};return Pj(a,PF)?null:a}}(),Lw=function(e){var t=e.max,n=e.current,r=e.change,i={x:Math.max(n.x,t.x),y:Math.max(n.y,t.y)},a=Lx(r),o=L_({max:i,current:n,change:a});return!o||0!==a.x&&0===o.x||0!==a.y&&0===o.y},LM=function(e,t){return Lw({current:e.scroll.current,max:e.scroll.max,change:t})},LE=function(e,t){if(!LM(e,t))return null;var n=e.scroll.max;return L_({current:e.scroll.current,max:n,change:t})},LS=function(e,t){var n=e.frame;return!!n&&Lw({current:n.scroll.current,max:n.scroll.max,change:t})},LT=function(e,t){var n=e.frame;return n&&LS(e,t)?L_({current:n.scroll.current,max:n.scroll.max,change:t}):null},LA=function(e){var t=e.viewport,n=e.subject,r=e.center,i=e.dragStartTime,a=e.shouldUseTimeDampening,o=Lb({dragStartTime:i,container:t.frame,subject:n,center:r,shouldUseTimeDampening:a});return o&&LM(t,o)?o:null},LC=function(e){var t=e.droppable,n=e.subject,r=e.center,i=e.dragStartTime,a=e.shouldUseTimeDampening,o=t.frame;if(!o)return null;var s=Lb({dragStartTime:i,container:o.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:a});return s&&LS(t,s)?s:null},LR=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,i=e.scrollWindow,a=e.scrollDroppable,o=t.current.page.borderBoxCenter,s=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var l=LA({dragStartTime:n,viewport:t.viewport,subject:s,center:o,shouldUseTimeDampening:r});if(l)return void i(l)}var u=Ll({center:o,destination:IJ(t.impact),droppables:t.dimensions.droppables});if(u){var c=LC({dragStartTime:n,droppable:u,subject:s,center:o,shouldUseTimeDampening:r});c&&a(u.descriptor.id,c)}},LP=function(e){var t=e.scrollWindow,n=e.scrollDroppable,r=PT(t),i=PT(n),a=null,o=function(e){a||PO(!1);var t=a,n=t.shouldUseTimeDampening;LR({state:e,scrollWindow:r,scrollDroppable:i,dragStartTime:t.dragStartTime,shouldUseTimeDampening:n})};return{start:function(e){Os(),a&&PO(!1);var t=Date.now(),n=!1,r=function(){n=!0};LR({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:r,scrollDroppable:r}),a={dragStartTime:t,shouldUseTimeDampening:n},Ol(),n&&o(e)},stop:function(){a&&(r.cancel(),i.cancel(),a=null)},scroll:o}},LI=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow,i=function(e,n){t({client:Pz(e.current.client.selection,n)})},a=function(e,t){if(!LS(e,t))return t;var r=LT(e,t);if(!r)return n(e.descriptor.id,t),null;var i=PH(t,r);return n(e.descriptor.id,i),PH(t,i)},o=function(e,t,n){if(!e||!LM(t,n))return n;var i=LE(t,n);if(!i)return r(n),null;var a=PH(n,i);return r(a),PH(n,a)};return function(e){var t=e.scrollJumpRequest;if(t){var n=IJ(e.impact);n||PO(!1);var r=a(e.dimensions.droppables[n],t);if(r){var s=e.viewport,l=o(e.isWindowScrollAllowed,s,r);l&&i(e,l)}}}},LO=function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,i=LP({scrollWindow:n,scrollDroppable:t}),a=LI({move:r,scrollWindow:n,scrollDroppable:t});return{scroll:function(e){if("DRAGGING"===e.phase){if("FLUID"===e.movementMode)return void i.scroll(e);e.scrollJumpRequest&&a(e)}},start:i.start,stop:i.stop}},LL="data-rbd",LD=function(){var e=LL+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}}(),LN=function(){var e=LL+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),LU=function(){var e=LL+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),Lk={contextId:LL+"-scroll-container-context-id"},LB=function(e,t){return e.map(function(e){var n=e.styles[t];return n?e.selector+" { "+n+" }":""}).join(" ")},LF=function(e){var t,n,r=function(t){return"["+t+'="'+e+'"]'},i=(t="\n      cursor: -webkit-grab;\n      cursor: grab;\n    ",{selector:r(LD.contextId),styles:{always:"\n          -webkit-touch-callout: none;\n          -webkit-tap-highlight-color: rgba(0,0,0,0);\n          touch-action: manipulation;\n        ",resting:t,dragging:"pointer-events: none;",dropAnimating:t}}),a=[(n="\n      transition: "+OU.outOfTheWay+";\n    ",{selector:r(LN.contextId),styles:{dragging:n,dropAnimating:n,userCancel:n}}),i,{selector:r(LU.contextId),styles:{always:"overflow-anchor: n
791one;"}},{selector:"body",styles:{dragging:"\n        cursor: grabbing;\n        cursor: -webkit-grabbing;\n        user-select: none;\n        -webkit-user-select: none;\n        -moz-user-select: none;\n        -ms-user-select: none;\n        overflow-anchor: none;\n      "}}];return{always:LB(a,"always"),resting:LB(a,"resting"),dragging:LB(a,"dragging"),dropAnimating:LB(a,"dropAnimating"),userCancel:LB(a,"userCancel")}},Lz="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?rc.useLayoutEffect:rc.useEffect,LH=function(){var e=document.querySelector("head");return e||PO(!1),e},Lj=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t},LW=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function LG(e){return e instanceof LW(e).HTMLElement}function LV(e,t){var n="["+LD.contextId+'="'+e+'"]',r=P3(document.querySelectorAll(n));if(!r.length)return null;var i=P2(r,function(e){return e.getAttribute(LD.draggableId)===t});return i&&LG(i)?i:null}function LX(){var e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach(function(t){return t(e)})}function r(t){return e.draggables[t]||null}function i(t){return e.droppables[t]||null}return{draggable:{register:function(t){e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:function(t,n){var r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var i=t.descriptor.id,a=r(i);a&&t.uniqueId===a.uniqueId&&(delete e.draggables[i],n({type:"REMOVAL",value:t}))},getById:function(e){var t=r(e);return t||PO(!1),t},findById:r,exists:function(e){return!!r(e)},getAllByType:function(t){return P0(e.draggables).filter(function(e){return e.descriptor.type===t})}},droppable:{register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var n=i(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=i(e);return t||PO(!1),t},findById:i,exists:function(e){return!!i(e)},getAllByType:function(t){return P0(e.droppables).filter(function(e){return e.descriptor.type===t})}},subscribe:function(e){return t.push(e),function(){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var Lq=rc.createContext(null),LY=function(){var e=document.body;return e||PO(!1),e},LZ={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},L$=0,LK={separator:"::"};function LJ(e,t){return void 0===t&&(t=LK),Ph(function(){return""+e+t.separator+L$++},[t.separator,e])}var LQ=rc.createContext(null),L0={react:"^16.8.5 || ^17.0.0 || ^18.0.0"},L1=/(\d+)\.(\d+)\.(\d+)/,L2=function(e){var t=L1.exec(e);return null==t&&PO(!1),{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),raw:e}},L3=function(e,t){var n=L2(e),r=L2(t);if(r.major>n.major||!(r.major<n.major)&&(r.minor>n.minor||!(r.minor<n.minor)&&r.patch>=n.patch))return},L5=function(e){var t=e.doctype;t&&(t.name.toLowerCase(),t.publicId)};function L4(e){}function L6(e,t){}function L8(e){var t=(0,rc.useRef)(e);return(0,rc.useEffect)(function(){t.current=e}),t}var L7=((tc={})[13]=!0,tc[9]=!0,tc),L9=function(e){L7[e.keyCode]&&e.preventDefault()},De=function(){var e="visibilitychange";return"undefined"==typeof document?e:P2([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],function(e){return"on"+e in document})||e}(),Dt={type:"IDLE"};function Dn(){}var Dr=((th={})[34]=!0,th[33]=!0,th[36]=!0,th[35]=!0,th),Di={type:"IDLE"},Da={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0},Do=function(){var e="matches";return"undefined"==typeof document?e:P2([e,"msMatchesSelector","webkitMatchesSelector"],function(e){return e in Element.prototype})||e}();function Ds(e){e.preventDefault()}function Dl(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!!r()&&t===n}function Du(e){var t=e.lockAPI,n=e.store,r=e.registry,i=e.draggableId;if(t.isClaimed())return!1;var a=r.draggable.findById(i);
791return!!a&&!!a.options.isEnabled&&!!La(n.getState(),i)}var Dc=[function(e){var t=(0,rc.useRef)(Dt),n=(0,rc.useRef)(PC),r=Ph(function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&0===t.button&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&!t.altKey){var r=e.findClosestDraggableId(t);if(r){var i=e.tryGetLock(r,o,{sourceEvent:t});if(i){t.preventDefault();var a={x:t.clientX,y:t.clientY};n.current(),u(i,a)}}}}}},[e]),i=Ph(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(t.defaultPrevented)return;var n=e.findClosestDraggableId(t);if(n){var r=e.findOptionsForDraggable(n);r&&!r.shouldRespectForcePress&&e.canGetLock(n)&&t.preventDefault()}}}},[e]),a=Pd(function(){n.current=PR(window,[i,r],{passive:!1,capture:!0})},[i,r]),o=Pd(function(){"IDLE"!==t.current.type&&(t.current=Dt,n.current(),a())},[a]),s=Pd(function(){var e=t.current;o(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[o]),l=Pd(function(){var e,r,i,a,l;n.current=PR(window,(r=(e={cancel:s,completed:o,getPhase:function(){return t.current},setPhase:function(e){t.current=e}}).cancel,i=e.completed,a=e.getPhase,l=e.setPhase,[{eventName:"mousemove",fn:function(e){var t,n=e.button,r=e.clientX,i=e.clientY;if(0===n){var o={x:r,y:i},s=a();if("DRAGGING"===s.type){e.preventDefault(),s.actions.move(o);return}"PENDING"!==s.type&&PO(!1),t=s.point,(Math.abs(o.x-t.x)>=5||Math.abs(o.y-t.y)>=5)&&(e.preventDefault(),l({type:"DRAGGING",actions:s.actions.fluidLift(o)}))}}},{eventName:"mouseup",fn:function(e){var t=a();if("DRAGGING"!==t.type)return void r();e.preventDefault(),t.actions.drop({shouldBlockNextClick:!0}),i()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===a().type&&e.preventDefault(),r()}},{eventName:"keydown",fn:function(e){if("PENDING"===a().type)return void r();if(27===e.keyCode){e.preventDefault(),r();return}L9(e)}},{eventName:"resize",fn:r},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===a().type&&r()}},{eventName:"webkitmouseforcedown",fn:function(e){var t=a();if("IDLE"===t.type&&PO(!1),t.actions.shouldRespectForcePress())return void r();e.preventDefault()}},{eventName:De,fn:r}]),{capture:!0,passive:!1})},[s,o]),u=Pd(function(e,n){"IDLE"!==t.current.type&&PO(!1),t.current={type:"PENDING",point:n,actions:e},l()},[l]);Lz(function(){return a(),function(){n.current()}},[a])},function(e){var t=(0,rc.useRef)(Dn),n=Ph(function(){return{eventName:"keydown",fn:function(n){if(!n.defaultPrevented&&32===n.keyCode){var i=e.findClosestDraggableId(n);if(i){var a=e.tryGetLock(i,l,{sourceEvent:n});if(a){n.preventDefault();var o=!0,s=a.snapLift();t.current(),t.current=PR(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:function(r){if(27===r.keyCode){r.preventDefault(),n();return}if(32===r.keyCode){r.preventDefault(),t(),e.drop();return}if(40===r.keyCode){r.preventDefault(),e.moveDown();return}if(38===r.keyCode){r.preventDefault(),e.moveUp();return}if(39===r.keyCode){r.preventDefault(),e.moveRight();return}if(37===r.keyCode){r.preventDefault(),e.moveLeft();return}if(Dr[r.keyCode])return void r.preventDefault();L9(r)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:De,fn:n}]}(s,l),{capture:!0,passive:!1})}}}function l(){o||PO(!1),o=!1,t.current(),r()}}}},[e]),r=Pd(function(){t.current=PR(window,[n],{passive:!1,capture:!0})},[n]);Lz(function(){return r(),function(){t.current()}},[r])},function(e){var t=(0,rc.useRef)(Di),n=(0,rc.useRef)(PC),r=Pd(function(){return t.current},[]),i=Pd(function(e){t.current=e},[]),a=Ph(function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var i=e.tryGetLock(r,s,{sourceEvent:t});if(i){var a=t.touches[0],o=a.clientX,l=a.clientY;n.current(),h(i,{x:o,y:l})}}}}}},[e]),o=Pd(function(){n.current=PR(window,[a],{capture:!0,passive:!1})},[a]),s=Pd(function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),i(Di),n.current(),o())},[o,i]),l=Pd(function(){var e=t.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()},[s]),u=Pd(function(){var e,t,i,a,o,u={capture:!0,passive:!1},c={cancel:l,completed:s,getPhase:r},h=PR(window,(e=c.cancel,t=c.completed,i=c.getPhase,[{eventName:"touchmove",options:{capture:!1},fn:function(t){var n=i();if("DRAGGING"!==n.type)return void e();n.hasMoved=!0;var r=t.touches[0],a=r.clientX,o=r.clientY;t.preventDefault(),n.actions.move({x:a,y:o})}},{eventName:"touchend",fn:function(n){var r=i();if("DRAGGING"!==r.type)return void e();n.preventDefault(),r.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:function(t){if("DRAGGING"!==i().type)return void e();t.preventDefault(),e()}},{eventName:"touchforcechange",fn:function(t){var n=i();"IDLE"===n.type&&PO(!1);var r=t.touches[0];if(r&&r.force>=.15){var a=n.actions.shouldRespectForcePress();
791if("PENDING"===n.type){a&&e();return}if(a)return n.hasMoved?void t.preventDefault():void e();t.preventDefault()}}},{eventName:De,fn:e}]),u),d=PR(window,(a=c.cancel,o=c.getPhase,[{eventName:"orientationchange",fn:a},{eventName:"resize",fn:a},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){if("DRAGGING"!==o().type)return void a();27===e.keyCode&&e.preventDefault(),a()}},{eventName:De,fn:a}]),u);n.current=function(){h(),d()}},[l,r,s]),c=Pd(function(){var e=r();"PENDING"!==e.type&&PO(!1),i({type:"DRAGGING",actions:e.actions.fluidLift(e.point),hasMoved:!1})},[r,i]),h=Pd(function(e,t){"IDLE"!==r().type&&PO(!1),i({type:"PENDING",point:t,actions:e,longPressTimerId:setTimeout(c,120)}),u()},[u,r,i,c]);Lz(function(){return o(),function(){n.current();var e=r();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),i(Di))}},[r,o,i]),Lz(function(){return PR(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])},[])}];function Dh(e){return e.current||PO(!1),e.current}function Dd(e){var t,n,r,i,a,o,s,l,u,c,h,d,p,f,m,g,v,y,b,x,_,w,M,E,S,T,A=e.contextId,C=e.setCallbacks,R=e.sensors,P=e.nonce,I=e.dragHandleUsageInstructions,O=(0,rc.useRef)(null);L6(function(){L3(L0.react,rc.version),L5(document)},[]);var L=L8(e),D=Pd(function(){var e;return{onBeforeCapture:(e=L.current).onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}},[L]),N=(n=Ph(function(){return"rbd-announcement-"+t},[t=A]),r=(0,rc.useRef)(null),(0,rc.useEffect)(function(){var e=document.createElement("div");return r.current=e,e.id=n,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),Rv(e.style,LZ),LY().appendChild(e),function(){setTimeout(function(){var t=LY();t.contains(e)&&t.removeChild(e),e===r.current&&(r.current=null)})}},[n]),Pd(function(e){var t=r.current;if(t){t.textContent=e;return}},[])),U=(a=(i={contextId:A,text:I}).contextId,o=i.text,l=Ph(function(){var e;return"rbd-hidden-text-"+(e={contextId:a,uniqueId:s}).contextId+"-"+e.uniqueId},[s=LJ("hidden-text",{separator:"-"}),a]),(0,rc.useEffect)(function(){var e=document.createElement("div");return e.id=l,e.textContent=o,e.style.display="none",LY().appendChild(e),function(){var t=LY();t.contains(e)&&t.removeChild(e)}},[l,o]),l),k=(u=Ph(function(){return LF(A)},[A]),c=(0,rc.useRef)(null),h=(0,rc.useRef)(null),d=Pd(PS(function(e){var t=h.current;t||PO(!1),t.textContent=e}),[]),Lz(function(){(c.current||h.current)&&PO(!1);var e=Lj(P),t=Lj(P);return c.current=e,h.current=t,e.setAttribute(LL+"-always",A),t.setAttribute(LL+"-dynamic",A),LH().appendChild(e),LH().appendChild(t),p(u.always),d(u.resting),function(){var e=function(e){var t=e.current;t||PO(!1),LH().removeChild(t),e.current=null};e(c),e(h)}},[P,p=Pd(function(e){var t=c.current;t||PO(!1),t.textContent=e},[]),d,u.always,u.resting,A]),f=Pd(function(){return d(u.dragging)},[d,u.dragging]),Ph(function(){return{dragging:f,dropping:m,resting:g}},[f,m=Pd(function(e){if("DROP"===e)return void d(u.dropAnimating);d(u.userCancel)},[d,u.dropAnimating,u.userCancel]),g=Pd(function(){h.current&&d(u.resting)},[d,u.resting])])),B=Pd(function(e){Dh(O).dispatch(e)},[]),F=Ph(function(){return RT({publishWhileDragging:Oy,updateDroppableScroll:Ox,updateDroppableIsEnabled:O_,updateDroppableIsCombineEnabled:Ow,collectionStarting:Ob},B)},[B]),z=(v=Ph(LX,[]),(0,rc.useEffect)(function(){return function(){requestAnimationFrame(v.clean)}},[v]),v),H=Ph(function(){return Li(z,F)},[z,F]),j=Ph(function(){return LO(Rv({scrollWindow:Lo,scrollDroppable:H.scrollDroppable},RT({move:OM},B)))},[H.scrollDroppable,B]),W=(y=(0,rc.useRef)({}),b=(0,rc.useRef)(null),x=(0,rc.useRef)(null),_=(0,rc.useRef)(!1),w=Pd(function(e,t){var n={id:e,focus:t};return y.current[e]=n,function(){var t=y.current;t[e]!==n&&delete t[e]}},[]),M=Pd(function(e){var t=LV(A,e);t&&t!==document.activeElement&&t.focus()},[A]),E=Pd(function(e,t){b.current===e&&(b.current=t)},[]),S=Pd(function(){!x.current&&_.current&&(x.current=requestAnimationFrame(function(){x.current=null;var e=b.current;e&&M(e)}))},[M]),T=Pd(function(e){b.current=null;var t=document.activeElement;t&&t.getAttribute(LD.draggableId)===e&&(b.current=e)},[]),Lz(function(){return _.current=!0,function(){_.current=!1;var e=x.current;e&&cancelAnimationFrame(e)}},[]),Ph(function(){return{register:w,tryRecordFocus:T,tryRestoreFocusRecorded:S,tryShiftRecord:E}},[w,T,S,E])),G=Ph(function(){return O6({announce:N,autoScroller:j,dimensionMarshal:H,focusMarshal:W,getResponders:D,styleMarshal:k})},[N,j,H,W,D,k]);O.current=G;var V=Pd(function(){var e=Dh(O);"IDLE"!==e.getState().phase&&e.dispatch(OC())},[]),X=Pd(function(){var e=Dh(O).getState();return e.isDragging||"DROP_ANIMATING"===e.phase},[]);C(Ph(function(){return{isDragging:X,tryAbort:V}},[X,V]));var q=Pd(function(e){return La(Dh(O).getState(),e)},[]),Y=Pd(function(){return I1(Dh(O).getState())},[]),Z=Ph(function(){return{marshal:H,focus:W,contextId:A,canLift:q,isMovementAllowed:Y,dragHandleUsageInstructionsId:U,registry:z}},[A,H,U,W,q,Y,z]);return!function(e){var t=e.contextId,n=e.store,r=e.registry,i=e.customSensors,a=[].concat(e.enableDefaultSensors?Dc:[],i||[]),o=(0,rc.useState)(function(){var e=null;function t(){e||PO(!1),e=null}return{isClaimed:function(){return!!e},isActive:function(t){return t===e},claim:function(t){e&&PO(!1);var n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}})[0],s=Pd(function(e,t){e.isDragging&&!t.isDragging&&o.tryAbandon()},[o]);Lz(function(){var e=n.getState();return n.subscribe(function(){var t=n.getState();s(e,t),e=t})},[o,n,s]),Lz(function(){return o.tryAbandon},[o.tryAbandon]);for(var l=Pd(function(e){return Du({lockAPI:o,registry:r,store:n,draggableId:e})},[o,r,n]),u=Pd(function(e,i,a){return function(e){var t,n,r,i,a=e.lockAPI,o=e.contextId,s=e.store,l=e.registry,u=e.draggableId,c=e.forceSensorStop,h=e.sourceEvent;if(!Du({lockAPI:a,store:s,registry:l,draggableId:u}))return null;var d=l.draggable.getById(u),p=(t=d.descriptor.id,n="["+LN.contextId+'="'+o+'"]',(r=P2(P3(document.querySelectorAll(n)),function(e){return e.getAttribute(LN.id)===t}))&&LG(r)?r:null);if(!p||h&&!d.options.canDragInteractiveElements&&LG(i=h.target)&&function e(t,n){if(null==n)return!1;if(Da[n.tagName.toLowerCase()])return!0;var r=n.getAttribute("contenteditable");return"true"===r||""===r||n!==t&&e(t,n.parentElement)}(p,i))return null;var f=a.claim(c||PC),m="PRE_DRAG";function g(){return d.options.shouldRespectForcePress}function v(){return a.isActive(f)}var y=(function(e,t){Dl({expected:e,phase:m,isLockActive:v,shouldWarn:!0})&&s.dispatch(t())}).bind(null,"DRAGGING");function b(e){function t(){a.release(),m="COMPLETED"}function n(n,r){void 0===r&&(r={shouldBlockNextClick:!1}),e.cleanup(),r.shouldBlockNextClick&&setTimeout(PR(window,[{eventName:"click",fn:Ds,options:{once:!0,passive:!1,capture:!0}}])),t(),s.dispatch(OP({reason:n}))}return"PRE_DRAG"!==m&&(t(),"PRE_DRAG"!==m&&PO(!1)),s.dispatch({type:"LIFT",payload:e.liftActionArgs}),m="DRAGGING",Rv({isActive:function(){return Dl({expected:"DRAGGING",phase:m,isLockActive:v,shouldWarn:!1})},shouldRespectForcePress:g,drop:function(e){return n("DROP",e)},cancel:function(e){return n("CANCEL",e)}},e.actions)}return{isActive:function(){return Dl({expected:"PRE_DRAG",phase:m,isLockActive:v,shouldWarn:!1})},shouldRespectForcePress:g,fluidLift:function(e){var t=PT(function(e){y(function(){return OM({client:e})})}),n=b({liftActionArgs:{id:u,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return Rv({},n,{move:t})},snapLift:function(){return b({liftActionArgs:{id:u,clientSelection:Pp(p.getBoundingClientRect()).center,movementMode:"SNAP"}
791,cleanup:PC,actions:{moveUp:function(){return y(OE)},moveRight:function(){return y(OT)},moveDown:function(){return y(OS)},moveLeft:function(){return y(OA)}}})},abort:function(){Dl({expected:"PRE_DRAG",phase:m,isLockActive:v,shouldWarn:!0})&&a.release()}}}({lockAPI:o,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:i,sourceEvent:a&&a.sourceEvent?a.sourceEvent:null})},[t,o,r,n]),c=Pd(function(e){var n;return(n=function(e,t){var n=t.target;if(!(n instanceof LW(n).Element))return null;var r="["+LD.contextId+'="'+e+'"]',i=n.closest?n.closest(r):function e(t,n){return null==t?null:t[Do](n)?t:e(t.parentElement,n)}(n,r);return i&&LG(i)?i:null}(t,e))?n.getAttribute(LD.draggableId):null},[t]),h=Pd(function(e){var t=r.draggable.findById(e);return t?t.options:null},[r.draggable]),d=Pd(function(){o.isClaimed()&&(o.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch(OC()))},[o,n]),p=Pd(o.isClaimed,[o]),f=Ph(function(){return{canGetLock:l,tryGetLock:u,findClosestDraggableId:c,findOptionsForDraggable:h,tryReleaseLock:d,isLockClaimed:p}},[l,u,c,h,d,p]),m=0;m<a.length;m++)a[m](f)}({contextId:A,store:G,registry:z,customSensors:R,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,rc.useEffect)(function(){return V},[V]),rc.createElement(LQ.Provider,{value:Z},rc.createElement(RL,{context:Lq,store:G},e.children))}var Dp=0;function Df(e){var t=Ph(function(){return""+Dp++},[]),n=e.dragHandleUsageInstructions||PB.dragHandleUsageInstructions;return rc.createElement(PL,null,function(r){return rc.createElement(Dd,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd},e.children)})}var Dm=function(e){return function(t){return e===t}},Dg=Dm("scroll"),Dv=Dm("auto");Dm("visible");var Dy=function(e,t){return t(e.overflowX)||t(e.overflowY)},Db=function(e){var t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return Dy(n,Dg)||Dy(n,Dv)},Dx=function(e){return{x:e.scrollLeft,y:e.scrollTop}},D_=function(e){var t=e.descriptor,n=e.isEnabled,r=e.isCombineEnabled,i=e.isFixedOnPage,a=e.direction,o=e.client,s=e.page,l=e.closest,u=function(){if(!l)return null;var e=l.scrollSize,t=l.client,n=O7({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:n,diff:{value:PF,displacement:PF}}}}(),c="vertical"===a?Ic:Ih,h=PJ({page:s,withPlaceholder:null,axis:c,frame:u});return{descriptor:t,isCombineEnabled:r,isFixedOnPage:i,axis:c,isEnabled:n,client:o,page:s,frame:u,subject:h}},Dw=function(e,t){var n=Pw(e);if(!t||e!==t)return n;var r=n.paddingBox.top-t.scrollTop,i=n.paddingBox.left-t.scrollLeft,a=r+t.scrollHeight;return Pv({borderBox:Pf({top:r,right:i+t.scrollWidth,bottom:a,left:i},n.border),margin:n.margin,border:n.border,padding:n.padding})},DM=function(e){var t=e.ref,n=e.descriptor,r=e.env,i=e.windowScroll,a=e.direction,o=e.isDropDisabled,s=e.isCombineEnabled,l=e.shouldClipSubject,u=r.closestScrollable,c=Dw(t,u),h=Px(c,i),d=function(){if(!u)return null;var e=Pw(u),t={scrollHeight:u.scrollHeight,scrollWidth:u.scrollWidth};return{client:e,page:Px(e,i),scroll:Dx(u),scrollSize:t,shouldClipSubject:l}}();
791return D_({descriptor:n,isEnabled:!o,isCombineEnabled:s,isFixedOnPage:r.isFixedOnPage,direction:a,client:c,page:h,closest:d})},DE={passive:!1},DS={passive:!0},DT=function(e){return e.shouldPublishImmediately?DE:DS};function DA(e){var t=(0,rc.useContext)(e);return t||PO(!1),t}var DC=function(e){return e&&e.env.closestScrollable||null};function DR(){}var DP={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}},DI=function(e){var t=e.isAnimatingOpenOnMount,n=e.placeholder,r=e.animate;return t||"close"===r?DP:{height:n.client.borderBox.height,width:n.client.borderBox.width,margin:n.client.margin}},DO=function(e){var t=e.isAnimatingOpenOnMount,n=e.placeholder,r=e.animate,i=DI({isAnimatingOpenOnMount:t,placeholder:n,animate:r});return{display:n.display,boxSizing:"border-box",width:i.width,height:i.height,marginTop:i.margin.top,marginRight:i.margin.right,marginBottom:i.margin.bottom,marginLeft:i.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==r?OU.placeholder:null}},DL=rc.memo(function(e){var t=(0,rc.useRef)(null),n=Pd(function(){t.current&&(clearTimeout(t.current),t.current=null)},[]),r=e.animate,i=e.onTransitionEnd,a=e.onClose,o=e.contextId,s=(0,rc.useState)("open"===e.animate),l=s[0],u=s[1];(0,rc.useEffect)(function(){return l?"open"!==r?(n(),u(!1),DR):t.current?DR:(t.current=setTimeout(function(){t.current=null,u(!1)}),n):DR},[r,l,n]);var c=Pd(function(e){"height"===e.propertyName&&(i(),"close"===r&&a())},[r,a,i]),h=DO({isAnimatingOpenOnMount:l,animate:e.animate,placeholder:e.placeholder});return rc.createElement(e.placeholder.tagName,{style:h,"data-rbd-placeholder-context-id":o,onTransitionEnd:c,ref:e.innerRef})}),DD=rc.createContext(null);function DN(e){e&&LG(e)||PO(!1)}function DU(e){return"boolean"==typeof e}function Dk(e,t){t.forEach(function(t){return t(e)})}var DB=[function(e){var t=e.props;t.droppableId||PO(!1),"string"!=typeof t.droppableId&&PO(!1)},function(e){var t=e.props;DU(t.isDropDisabled)||PO(!1),DU(t.isCombineEnabled)||PO(!1),DU(t.ignoreContainerClipping)||PO(!1)},function(e){DN((0,e.getDroppableRef)())}],DF=[function(e){var t=e.props,n=e.getPlaceholderRef;if(t.placeholder&&n())return}],Dz=[function(e){e.props.renderClone||PO(!1)},function(e){(0,e.getPlaceholderRef)()&&PO(!1)}],DH=function(e){function t(){for(var t,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state={isVisible:!!t.props.on,data:t.props.on,animate:t.props.shouldAnimate&&t.props.on?"open":"none"},t.onClose=function(){"close"===t.state.animate&&t.setState({isVisible:!1})},t}return Rg(t,e),t.getDerivedStateFromProps=function(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!e.on,data:e.on,animate:"none"}},t.prototype.render=function(){if(!this.state.isVisible)return null;var e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)},t}(rc.PureComponent),Dj={dragging:5e3,dropAnimating:4500};function DW(e){e.preventDefault()}var DG=function(e,t){return e===t},DV=function(e){var t=e.combine,n=e.destination;return n?n.droppableId:t?t.droppableId:null};function DX(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var Dq={mapped:{type:"SECONDARY",offset:PF,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:DX(null)}},DY=Pc(function(){var e,t,n,r,i,a,o,s,l=(e=PS(function(e,t){return{x:e,y:t}}),t=PS(function(e,t,n,r,i){return{isDragging:!0,isClone:t,isDropAnimating:!!i,dropAnimation:i,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null}}),n=PS(function(e,n,r,i,a,o,s){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:a,combineWith:o,mode:n,offset:e,dimension:r,forceShouldAnimate:s,snapshot:t(n,i,a,o,null)}}}),function(r,i){if(r.isDragging){if(r.critical.draggable.id!==i.draggableId)return null;var a,o=r.current.client.offset,s=r.dimensions.draggables[i.draggableId],l=IJ(r.impact),u=(a=r.impact).at&&"COMBINE"===a.at.type?a.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(o.x,o.y),r.movementMode,s,i.isClone,l,u,c)}if("DROP_ANIMATING"===r.phase){var h=r.completed;if(h.result.draggableId!==i.draggableId)return null;var d=i.isClone,p=r.dimensions.draggables[i.draggableId],f=h.result,m=f.mode,g=DV(f),v=f.combine?f.combine.draggableId:null,y={duration:r.dropDuration,curve:OO.drop,moveTo:r.newHomeClientOffset,opacity:v?OL.opacity.drop:null,
791scale:v?OL.scale.drop:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:p,dropping:y,draggingOver:g,combineWith:v,mode:m,forceShouldAnimate:null,snapshot:t(m,d,g,v,y)}}}return null}),u=(r=PS(function(e,t){return{x:e,y:t}}),i=PS(DX),a=PS(function(e,t,n){return void 0===t&&(t=null),{mapped:{type:"SECONDARY",offset:e,combineTargetFor:t,shouldAnimateDisplacement:n,snapshot:i(t)}}}),o=function(e){return e?a(PF,e,!0):null},s=function(e,t,n,i){var s=n.displaced.visible[e],l=!!(i.inVirtualList&&i.effected[e]),u=Ie(n),c=u&&u.draggableId===e?t:null;if(!s){if(!l)return o(c);if(n.displaced.invisible[e])return null;var h=PW(i.displacedBy.point);return a(r(h.x,h.y),c,!0)}if(l)return o(c);var d=n.displacedBy.point;return a(r(d.x,d.y),c,s.shouldAnimate)},function(e,t){if(e.isDragging)return e.critical.draggable.id===t.draggableId?null:s(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){var n=e.completed;return n.result.draggableId===t.draggableId?null:s(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null});return function(e,t){return l(e,t)||u(e,t)||Dq}},{dropAnimationFinished:OI},null,{context:Lq,pure:!0,areStatePropsEqual:DG})(function(e){var t,n,r,i,a,o,s,l,u,c,h,d,p,f=(0,rc.useRef)(null),m=Pd(function(e){f.current=e},[]),g=Pd(function(){return f.current},[]),v=DA(LQ),y=v.contextId,b=v.dragHandleUsageInstructionsId,x=v.registry,_=DA(DD),w=_.type,M=_.droppableId,E=Ph(function(){return{id:e.draggableId,index:e.index,type:w,droppableId:M}},[e.draggableId,e.index,w,M]),S=e.children,T=e.draggableId,A=e.isEnabled,C=e.shouldRespectForcePress,R=e.canDragInteractiveElements,P=e.isClone,I=e.mapped,O=e.dropAnimationFinished;L6(function(){var t,n=e.draggableId;n||PO(!1),"string"!=typeof n&&PO(!1),t=e.index,(Number.isInteger?Number.isInteger(t):"number"==typeof t&&isFinite(t)&&Math.floor(t)===t)||PO(!1),"DRAGGING"!==e.mapped.type&&(DN(g()),e.isEnabled&&(LV(y,n)||PO(!1)))}),L4(function(){var e=(0,rc.useRef)(P);L6(function(){P!==e.current&&PO(!1)},[P])}),P||(t=Ph(function(){return{descriptor:E,registry:x,getDraggableRef:g,canDragInteractiveElements:R,shouldRespectForcePress:C,isEnabled:A}},[E,x,g,R,C,A]),n=LJ("draggable"),r=t.descriptor,i=t.registry,a=t.getDraggableRef,o=t.canDragInteractiveElements,s=t.shouldRespectForcePress,u=Ph(function(){return{canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:l}},[o,l=t.isEnabled,s]),c=Pd(function(e){var t,n,i,o,s=a();return s||PO(!1),void 0===(t=e)&&(t=PF),n=window.getComputedStyle(s),o=Px(i=P_(s.getBoundingClientRect(),n),t),{descriptor:r,placeholder:{client:i,tagName:s.tagName.toLowerCase(),display:n.display},displaceBy:{x:i.marginBox.width,y:i.marginBox.height},client:i,page:o}},[r,a]),h=Ph(function(){return{uniqueId:n,descriptor:r,options:u,getDimension:c}},[r,c,u,n]),d=(0,rc.useRef)(h),p=(0,rc.useRef)(!0),Lz(function(){return i.draggable.register(d.current),function(){return i.draggable.unregister(d.current)}},[i.draggable]),Lz(function(){if(p.current){p.current=!1;return}var e=d.current;d.current=h,i.draggable.update(h,e)},[h,i.draggable]));var L=Ph(function(){return A?{tabIndex:0,role:"button","aria-describedby":b,"data-rbd-drag-handle-draggable-id":T,"data-rbd-drag-handle-context-id":y,draggable:!1,onDragStart:DW}:null},[y,b,T,A]),D=Pd(function(e){"DRAGGING"===I.type&&I.dropping&&"transform"===e.propertyName&&O()},[O,I]),N=Ph(function(){var e,t,n,r,i,a,o,s;return{innerRef:m,draggableProps:{"data-rbd-draggable-context-id":y,"data-rbd-draggable-id":T,style:"DRAGGING"===I.type?(e=I.dimension.client,t=I.offset,n=I.combineWith,r=I.dropping,i=!!n,a=null!=I.forceShouldAnimate?I.forceShouldAnimate:"SNAP"===I.mode,s=(o=!!r)?OB.drop(t,i):OB.moveTo(t),{position:"fixed",top:e.marginBox.top,left:e.marginBox.left,boxSizing:"border-box",width:e.borderBox.width,height:e.borderBox.height,transition:r?OU.drop(r.duration):a?OU.snap:OU.fluid,transform:s,opacity:i?o?OL.opacity.drop:OL.opacity.combining:null,zIndex:o?Dj.dropAnimating:Dj.dragging,pointerEvents:"none"}):{transform:OB.moveTo(I.offset),transition:I.shouldAnimateDisplacement?null:"none"},onTransitionEnd:"DRAGGING"===I.type&&I.dropping?D:null},dragHandleProps:L}},[y,L,T,I,D,m]),U=Ph(function(){return{draggableId:E.id,type:E.type,source:{index:E.index,droppableId:E.droppableId}}},[E.droppableId,E.id,E.index,E.type]);return S(N,I.snapshot,U)});function DZ(e){return DA(DD).isUsingCloneFor!==e.draggableId||e.isClone?rc.createElement(DY,e):null}function D$(e){var t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return rc.createElement(DZ,Rv({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}var DK=function(e,t){return e===t.droppable.type},DJ=function(e,t){return t.draggables[e.draggable.id]},DQ=Pc(function(){var e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t=Rv({},e,{shouldAnimatePlaceholder:!1}),n=PS(function(e){return{draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}}),r=PS(function(r,i,a,o,s,l){var u=s.descriptor.id;if(s.descriptor.droppableId===r){var c=l?{render:l,dragging:n(s.descriptor)}:null;return{placeholder:s.placeholder,shouldAnimatePlaceholder:!1,snapshot:{isDraggingOver:a,draggingOverWith:a?u:null,draggingFromThisWith:u,isUsingPlaceholder:!0},useClone:c}}return i?o?{placeholder:s.placeholder,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:a,draggingOverWith:u,draggingFromThisWith:null,isUsingPlaceholder:!0},useClone:null}:e:t});return function(n,i){var a=i.droppableId,o=i.type,s=!i.isDropDisabled,l=i.renderClone;if(n.isDragging){var u=n.critical;if(!DK(o,u))return t;var c=DJ(u,n.dimensions),h=IJ(n.impact)===a;return r(a,s,h,h,c,l)}if("DROP_ANIMATING"===n.phase){var d=n.completed;if(!DK(o,d.critical))return t;var p=DJ(d.critical,n.dimensions);return r(a,s,DV(d.result)===a,IJ(d.impact)===a,p,l)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){var f=n.completed;if(!DK(o,f.critical))return t;var m=IJ(f.impact)===a,g=!!(f.impact.at&&"COMBINE"===f.impact.at.type),v=f.critical.droppable.
791id===a;if(m)return g?e:t;if(v)return e}return t}},{updateViewportMaxScroll:function(e){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}}},null,{context:Lq,pure:!0,areStatePropsEqual:DG})(function(e){var t,n,r,i,a,o,s,l,u,c,h,d,p,f,m,g,v,y,b,x,_,w=(0,rc.useContext)(LQ);w||PO(!1);var M=w.contextId,E=w.isMovementAllowed,S=(0,rc.useRef)(null),T=(0,rc.useRef)(null),A=e.children,C=e.droppableId,R=e.type,P=e.mode,I=e.direction,O=e.ignoreContainerClipping,L=e.isDropDisabled,D=e.isCombineEnabled,N=e.snapshot,U=e.useClone,k=e.updateViewportMaxScroll,B=e.getContainerForClone,F=Pd(function(){return S.current},[]),z=Pd(function(e){S.current=e},[]),H=Pd(function(){return T.current},[]),j=Pd(function(e){T.current=e},[]);t={props:e,getDroppableRef:F,getPlaceholderRef:H},L6(function(){Dk(t,DB),"standard"===t.props.mode&&Dk(t,DF),"virtual"===t.props.mode&&Dk(t,Dz)});var W=Pd(function(){E()&&k({maxScroll:Le()})},[E,k]);n={droppableId:C,type:R,mode:P,direction:I,isDropDisabled:L,isCombineEnabled:D,ignoreContainerClipping:O,getDroppableRef:F},r=(0,rc.useRef)(null),i=DA(LQ),a=LJ("droppable"),o=i.registry,s=i.marshal,l=L8(n),u=Ph(function(){return{id:n.droppableId,type:n.type,mode:n.mode}},[n.droppableId,n.mode,n.type]),c=(0,rc.useRef)(u),h=Ph(function(){return PS(function(e,t){r.current||PO(!1),s.updateDroppableScroll(u.id,{x:e,y:t})})},[u.id,s]),d=Pd(function(){var e=r.current;return e&&e.env.closestScrollable?Dx(e.env.closestScrollable):PF},[]),f=Ph(function(){return PT(p)},[p=Pd(function(){var e=d();h(e.x,e.y)},[d,h])]),m=Pd(function(){var e=r.current,t=DC(e);if(e&&t||PO(!1),e.scrollOptions.shouldPublishImmediately)return void p();f()},[f,p]),g=Pd(function(e,t){r.current&&PO(!1);var n=l.current,a=n.getDroppableRef();a||PO(!1);var o={closestScrollable:function e(t){return null==t||t===document.body||t===document.documentElement?null:Db(t)?t:e(t.parentElement)}(a),isFixedOnPage:function e(t){return!!t&&("fixed"===window.getComputedStyle(t).position||e(t.parentElement))}(a)},s={ref:a,descriptor:u,env:o,scrollOptions:t};r.current=s;var c=DM({ref:a,descriptor:u,env:o,windowScroll:e,direction:n.direction,isDropDisabled:n.isDropDisabled,isCombineEnabled:n.isCombineEnabled,shouldClipSubject:!n.ignoreContainerClipping}),h=o.closestScrollable;return h&&(h.setAttribute(Lk.contextId,i.contextId),h.addEventListener("scroll",m,DT(s.scrollOptions))),c},[i.contextId,u,m,l]),v=Pd(function(){var e=r.current,t=DC(e);return e&&t||PO(!1),Dx(t)},[]),x=Ph(function(){return{getDimensionAndWatchScroll:g,getScrollWhileDragging:v,dragStopped:y,scroll:b}},[y=Pd(function(){var e=r.current;e||PO(!1);var t=DC(e);r.current=null,t&&(f.cancel(),t.removeAttribute(Lk.contextId),t.removeEventListener("scroll",m,DT(e.scrollOptions)))},[m,f]),g,v,b=Pd(function(e){var t=r.current;t||PO(!1);var n=DC(t);n||PO(!1),n.scrollTop+=e.y,n.scrollLeft+=e.x},[])]),_=Ph(function(){return{uniqueId:a,descriptor:u,callbacks:x}},[x,u,a]),Lz(function(){return c.current=_.descriptor,o.droppable.register(_),function(){r.current&&y(),o.droppable.unregister(_)}},[x,u,y,_,s,o.droppable]),Lz(function(){r.current&&s.updateDroppableIsEnabled(c.current.id,!n.isDropDisabled)},[n.isDropDisabled,s]),Lz(function(){r.current&&s.updateDroppableIsCombineEnabled(c.current.id,n.isCombineEnabled)}
791,[n.isCombineEnabled,s]);var G=rc.createElement(DH,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},function(e){var t=e.onClose,n=e.data,r=e.animate;return rc.createElement(DL,{placeholder:n,onClose:t,innerRef:j,animate:r,contextId:M,onTransitionEnd:W})}),V=Ph(function(){return{innerRef:z,placeholder:G,droppableProps:{"data-rbd-droppable-id":C,"data-rbd-droppable-context-id":M}}},[M,C,G,z]),X=U?U.dragging.draggableId:null,q=Ph(function(){return{droppableId:C,type:R,isUsingCloneFor:X}},[C,X,R]);return rc.createElement(DD.Provider,{value:q},A(V,N),function(){if(!U)return null;var e=U.dragging,t=U.render,n=rc.createElement(DZ,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(n,r){return t(n,r,e)});return rd.createPortal(n,B())}())});function D0(){return(D0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function D1(){return(D1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function D2(){return(D2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function D3(){return(D3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}DQ.defaultProps={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||PO(!1),document.body}};var D5=Object.defineProperty,D4=Object.defineProperties,D6=Object.getOwnPropertyDescriptors,D8=Object.getOwnPropertySymbols,D7=Object.prototype.hasOwnProperty,D9=Object.prototype.propertyIsEnumerable,Ne=(e,t,n)=>t in e?D5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nt=(e,t)=>{for(var n in t||(t={}))D7.call(t,n)&&Ne(e,n,t[n]);if(D8)for(var n of D8(t))D9.call(t,n)&&Ne(e,n,t[n]);return e},Nn=(e,t)=>D4(e,D6(t));let Nr=(0,rh.default)(CH)`
792  position: relative;
793  display: flex;
794  align-items: center;
795  overflow: visible;
796  border: 0;
797  border-radius: 0;
798  box-shadow: none;
799
800  & > div:nth-child(2) {
801    flex-grow: 1;
802  }
803
804  input {
805    width: 100%;
806    height: calc(${wg(48)} - ${wg(7)});
807    margin: ${wg(5)};
808    border-radius: calc(${wg(54)} / 2);
809    border: 1px solid transparent;
810    flex-shrink: 0;
811    background-color: #f3f2f2;
812  }
813
814  ul {
815    position: fixed;
816    top: ${wg(283)};
817    left: 0;
818    width: 100%;
819    max-height: ${wg(300)};
820    z-index: 1;
821    border-bottom: 1px solid #d9dce7;
822  }
823
824  &.pcmap-search-input--opened input {
825    border: 1px solid #d9dce7;
826    background-color: white;
827  }
828
829  .pcmap-search-input__glass {
830    display: none;
831  }
832
833  @media ${({theme:e})=>e.mq.landscape} {
834    input {
835      height: calc(${wg(54)} - ${wg(10)});
836      border-radius: calc(${wg(54)} / 2);
837    }
838
839    ul {
840      left: ${wg(24,14)};
841      width: ${wg(350,14)};
842    }
843  }
844`,Ni=rh.default.div`
845  display: flex;
846  align-items: center;
847`,Na=rh.default.div`
848  display: flex;
849  flex-direction: column;
850  flex-grow: 1;
851`,No=rh.default.div`
852  position: relative;
853  max-height: calc(3.3em * 3.5);
854  overflow-y: auto;
855
856  @media ${({theme:e})=>e.mq.landscape} {
857    height: auto;
858    max-height: calc(3.3em * 5.5);
859  }
860
861  ::-webkit-scrollbar {
862    display: none;
863  }
864`,Ns=rh.default.div`
865  position: relative;
866  height: 3.3em;
867`,Nl=rh.default.div`
868  padding: 0.5em 0;
869  ${({$invisible:e})=>e?"visibility: hidden; pointer-events: none;":""}
870`,Nu=(0,rh.default)(function(e){return rc.createElement("svg",D0({"aria-hidden":"true",viewBox:"0 0 24 24"},e),td||(td=rc.createElement("path",{fill:"currentColor",d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})))})`
871  width: 1.5em;
872  margin: 0 1em;
873  color: #0a0a82;
874`,Nc=(0,rh.default)(function(e){return rc.createElement("svg",D1({"aria-hidden":"true",viewBox:"0 0 24 24"},e),tp||(tp=rc.createElement("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20zm0 18a8.01 8.01 0 0 1 0-16 8.01 8.01 0 0 1 0 16zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"})))})`
875  width: 3.5em;
876  padding: 0 1em;
877  color: #0a0a82;
878  cursor: pointer;
879`,Nh=(0,rh.default)(function(e){return rc.createElement("svg",D2({"aria-hidden":"true",viewBox:"0 0 24 24"},e),tf||(tf=rc.createElement("path",{fill:"currentColor",d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18a8.01 8.01 0 0 1 0-16 8.01 8.01 0 0 1 0 16z"})))})`
880  width: 1.5em;
881  margin: 0 2em 0 1em;
882  color: #0a0a82;
883  cursor: pointer;
884`,Nd=rh.default.div`
885  display: flex;
886  align-items: center;
887  height: 3.3em;
888  font-weight: 500;
889  color: #525d84;
890  cursor: pointer;
891`,Np=(0,rh.default)(function(e){return rc.createElement("svg",D3({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 17"},e),tm||(tm=rc.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"m10.56 11.42 2.66 3.19 2.65-3.19M6.31 5.58 3.66 2.39 1 5.58"})),tg||(tg=rc.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M6.84.8a4.77 4.77 0 0 1 6.38 4.51v9.3m-3.19 1.59a4.77 4.77 0 0 1-6.37-4.51v-9.3"})))})`
892  width: 3.3em;
893  padding: 2.5em 1em;
894  margin-left: 0.3em;
895  color: #0a0a82;
896  cursor: pointer;
897  ${({$invisible:e})=>e?"visibility: hidden; pointer-events: none;":""}
898`,Nf=e=>{var{children:t}=e,n=((e,t)=>{var n={};for(var r in e)D7.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&D8)for(var r of D8(e))0>t.indexOf(r)&&D9.call(e,r)&&(n[r]=e[r]);return n})(e,["children"]);let[r,i]=rc.useState(!1);return(rc.useEffect(()=>{let e=requestAnimationFrame(()=>i(!0));return()=>{cancelAnimationFrame(e),i(!1)}},[]),r)?rc.createElement(DQ,Nt({},n),t):null};function Nm({stop:e,index:t,onDelete:n,onChange:r,onOpen:i,onClose:a}){var o;let{getText:s}=MF(),[l,u]=rc.useState(null),{showList:c}=((e,t=!1)=>{let[n,r]=rc.useState(t),i=e&&e.querySelector("input");return rc.useEffect(()=>{if(!i||n)return;let e=e=>{e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),r(!0)};return i.addEventListener("mousedown",e,!0),()=>{i.removeEventListener("mousedown",e,!0)}},[i,n]),rc.useEffect(()=>{if(!e||!n)return;let t=t=>{t.composedPath().some(t=>t===e)||r(!1)};return document.addEventListener("click",t,!0),()=>{document.removeEventListener("click",t,!0)}},[e,n]),rc.useEffect(()=>{if(!e||!n)return;let t=e&&e.querySelector("ul");if(!t)return;let{bottom:r,left:i}=e.getBoundingClientRect();t.style.top=`${r}px`,t.style.left=`${i}px`;let a=()=>{let{bottom:n,left:r}=e.getBoundingClientRect();t.style.top=`${n}px`,t.style.left=`${r}px`};return window.addEventListener("scroll",a,{passive:!0}),()=>{window.removeEventListener("scroll",a,{passive:!0})}},[e,n]),{showList:n}})(l,"new"===e.type);return rc.useEffect(()=>{c?i&&i():a&&a()},[c,i,a]),"__your-location__"===e.occupantId&&(e.occupant.display={name:s("Your location")}),rc.createElement(D$,{isDragDisabled:c||"__your-location__"===e.occupantId,draggableId:(null!=(o=e.occupantId)?o:e.type)+t,index:t},i=>{var a;return rc.createElement(Ns,Nn(Nt({ref:i.innerRef},i.draggableProps),{className:"pcmap-stops__item"}),rc.createElement(Nr,{ref:e=>e&&u(e),className:"pcmap-directions__input",showList:c,showOnlyRoutable:!0,showYourLocationOption:0===t&&"__your-location__"!==e.occupantId,showYourLocationButton:0===t&&"__your-location__"!==e.occupantId,placeholder:s(0===t?"Choose start point":"Choose destination"),selectedOccupant:null!=(a=e.occupant)?a:null,onOccupantSelect:e=>{e&&r(t,e)},onClear:()=>{r(t,null)},appendLeft:rc.createElement(Nl,Nn(Nt({},i.dragHandleProps),{className:"pcmap-stops__drag-area",$invisible:0===t&&"__your-location__"===e.occupantId}),rc.createElement(Nu,null)),appendRight:n&&rc.createElement(Nc,{className:"pcmap-stops__delete",onClick:()=>n(t)})}))})}function Ng({stops:e,onChange:t}){let{getText:n}=MF(),{events:r}=MA(),[i,a]=rc.useState(!1),o=n=>{t(e.filter((e,t)=>
898t!==n))},s=(n,i)=>{t(e.map((e,t)=>t!==n?e:i?_B(i):{type:"empty"})),i&&r.emit("Directions#OccupantSelected",i)},l=()=>{t([...e,{type:"new"}])},u=()=>{"__your-location__"!==e[0].occupantId&&t([e[1],e[0]])};return rc.createElement(Df,{onDragEnd:n=>{n.destination&&n.destination.index!==n.source.index&&(0!==n.destination.index||"__your-location__"!==e[0].occupantId)&&t(((e,t,n)=>{let r=Array.from(e),[i]=r.splice(t,1);return r.splice(n,0,i),r})(e,n.source.index,n.destination.index))}},rc.createElement(Nf,{droppableId:"list"},t=>rc.createElement(No,Nn(Nt({ref:t.innerRef},t.droppableProps),{className:"pcmap-stops"}),rc.createElement(Ni,null,rc.createElement(Na,{className:"pcmap-stops__list"},e.map((t,n)=>{var r;return rc.createElement(Nm,{key:(null!=(r=t.occupantId)?r:t.type)+n,stop:t,index:n,onDelete:e.length>2&&o,onChange:s,onOpen:0===n&&(()=>a(!0)),onClose:0===n&&(()=>a(!1))})}),t.placeholder),2===e.length&&rc.createElement(Np,{className:"pcmap-stops__swap",$invisible:i||"__your-location__"===e[0].occupantId,onClick:u})),e.length<10&&e.every(e=>!["empty","new"].includes(e.type))&&rc.createElement(Nd,{className:"pcmap-stops__add-destination",onClick:l},rc.createElement(Nh,null),n("Add destination")))))}function Nv(){return(Nv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var Ny=function(e){return rc.createElement("svg",Nv({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 30 30"},e),tv||(tv=rc.createElement("path",{fill:"currentColor",d:"M24.58 8.42c.56.56.56 1.46 0 2.02L13.15 21.87c-.56.55-1.46.55-2.02 0l-5.71-5.72a1.43 1.43 0 1 1 2.02-2.02l4.66 4.7 10.46-10.4a1.42 1.42 0 0 1 2.02 0Z"})),ty||(ty=rc.createElement("rect",{width:28,height:28,x:1,y:1,stroke:"currentColor",strokeWidth:2,rx:4})))};function Nb(){return(Nb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var Nx=function(e){return rc.createElement("svg",Nb({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 30 30"},e),tb||(tb=rc.createElement("rect",{width:28,height:28,x:1,y:1,stroke:"currentColor",strokeWidth:2,rx:4})))};let N_=rh.default.section`
899  background-color: white;
900  border-radius: 0;
901  box-shadow: 0px 4px 96px rgba(10, 10, 130, 0.09),
902    0px 2px 16px rgba(10, 10, 130, 0.08), 0px 1px 2px rgba(10, 10, 130, 0.24);
903
904  @media ${({theme:e})=>e.mq.landscape} {
905    border-radius: 6px;
906  }
907`,Nw=rh.default.header`
908  display: flex;
909  justify-content: space-between;
910  align-items: center;
911  padding: ${wg(18)} ${wg(20)} ${wg(15)} ${wg(20)};
912`,NM=rh.default.button`
913  padding: 0;
914  color: #0a0a82;
915  background-color: transparent;
916  cursor: pointer;
917  border: none;
918  appearance: none;
919`,NE=rh.default.button`
920  padding: ${wg(10)} ${wg(24)};
921  border-radius: ${wg(24)};
922  border: none;
923  color: white;
924  background-color: #0a0a82;
925  box-shadow: 0px 2px 16px rgba(10, 10, 130, 0.08),
926    0px 1px 2px rgba(10, 10, 130, 0.16);
927  visibility: ${({disabled:e})=>e?"hidden":"visible"};
928  cursor: pointer;
929  appearance: none;
930`,NS=rh.default.div`
931  padding: 0 0 ${wg(15)};
932`,NT=rh.default.div`
933  display: flex;
934  justify-content: flex-start;
935  align-items: center;
936  margin: ${wg(14)} 0 ${wg(5)};
937  padding: 0 ${wg(18)};
938`,NA=rh.default.div`
939  padding: ${wg(5)} ${wg(10)};
940  border: 1px solid;
941  margin: 0 ${wg(20)} ${wg(10)} ${wg(20)};
942  border-radius: ${wg(5)};
943  color: #e12c29;
944  background-color: #ffe3e3;
945`,NC=rh.default.svg`
946  width: ${wg(18)};
947  margin-right: ${wg(10)};
948  color: #0a0a82;
949`,NR=rh.default.input.attrs({type:"checkbox"})`
950  width: 0;
951  margin: 0;
952  appearance: none;
953  background-color: #fff;
954`,NP=rh.default.label`
955  display: flex;
956  align-items: center;
957  margin-top: ${wg(2)};
958  line-height: 1;
959  cursor: pointer;
960`;var NI=Mz(Mg(Sq(function(e){let{stops:t,setStops:n,avoidStairs:r,setAvoidStairs:i,showRoute:a,hideRoute:o,route:s,steps:l,stepIdx:u,setStepIdx:c,routeQRCode:h,userRoute:d,className:p,onClose:f,getText:m,message:g}=e,[v,y]=rc.useState(!1);return rc.createElement(rc.Fragment,null,rc.createElement(N_,{className:`pcmap-directions ${p||""}`},!s&&rc.createElement(rc.Fragment,null,rc.createElement(Nw,{className:"pcmap-directions__header"},rc.createElement(NM,{className:"pcmap-directions__close",onClick:f},m("Close")),rc.createElement(NE,{className:"pcmap-directions__go",disabled:!t||t.reduce((e,t)=>
960e.add(t.occupantId),new Set).size<2||t.some(e=>["empty","new"].includes(e.type)),onClick:()=>{a()}},m("Start"))),rc.createElement(NS,{className:"pcmap-directions__form"},g&&rc.createElement(NA,null,g.text),rc.createElement(Ng,{stops:t,onChange:e=>n(e)}),rc.createElement(NT,{className:"pcmap-directions__avoid-escalators"},rc.createElement(NP,{htmlFor:"avoidStairs"},rc.createElement(NR,{id:"avoidStairs",checked:r,onChange:()=>i(!r)}),rc.createElement(NC,{as:r?Ny:Nx}),m("Avoid escalators and stairs"))))),s&&rc.createElement(Ro,{key:s.id,stops:t,avoidStairs:r,route:s,steps:l,stepIdx:u,setStepIdx:c,userRoute:d,onEnd:o,onQRCodeShow:()=>y(!0)})),v&&h&&rc.createElement(Rf,{routeQRCode:h,onClose:()=>y(!1)}))}))),NO=Object.defineProperty,NL=Object.getOwnPropertySymbols,ND=Object.prototype.hasOwnProperty,NN=Object.prototype.propertyIsEnumerable,NU=(e,t,n)=>t in e?NO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let Nk=rh.default.button`
961  position: relative;
962  width: ${wg(40)};
963  height: ${wg(40)};
964  line-height: 1;
965  border: 0;
966  color: ${({active:e})=>e?"white":"#0A0A82"};
967  background-color: transparent;
968  appearance: none;
969  cursor: pointer;
970
971  ::before {
972    content: '';
973    position: absolute;
974    top: 0;
975    left: 0;
976    width: 100%;
977    height: 100%;
978    border-radius: 50%;
979    background-color: #d9dce7;
980    opacity: 0.2;
981    transition: transform 150ms;
982    z-index: -1;
983  }
984
985  :hover {
986    ::before {
987      transform: scale(1.4);
988    }
989  }
990
991  :focus {
992    outline: none;
993  }
994`,NB=rh.default.div`
995  position: absolute;
996  top: 50%;
997  left: 50%;
998  transform: translate(-50%, -50%);
999  width: 100%;
1000  height: 100%;
1001  display: flex;
1002  justify-content: center;
1003  align-items: center;
1004  border-radius: 50%;
1005  background-color: ${({active:e})=>e?"#636F99":"white"};
1006  box-shadow: 0px 6px 32px rgba(10, 10, 130, 0.08),
1007    0px 4px 16px rgba(10, 10, 130, 0.08), 0px 1px 4px rgba(10, 10, 130, 0.24);
1008  user-select: none;
1009`;function NF(e){var{children:t,active:n}=e,r=((e,t)=>{var n={};for(var r in e)ND.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&NL)for(var r of NL(e))0>t.indexOf(r)&&NN.call(e,r)&&(n[r]=e[r]);return n})(e,["children","active"]);return rc.createElement(Nk,((e,t)=>{for(var n in t||(t={}))ND.call(t,n)&&NU(e,n,t[n]);if(NL)for(var n of NL(t))NN.call(t,n)&&NU(e,n,t[n]);return e})({active:n},r),rc.createElement(NB,{active:n},t))}function Nz(){return(Nz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}let NH=rh.default.div`
1010  display: flex;
1011  flex-direction: column;
1012  justify-content: space-between;
1013`,Nj=rh.default.div`
1014  position: absolute;
1015  ${({expandToTop:e})=>e?`bottom: ${wg(48)};`:`top: ${wg(48)};`}
1016  left: 50%;
1017  transform: translateX(-50%);
1018  display: flex;
1019  flex-direction: column;
1020  max-height: ${wg(300)};
1021  height: ${({show:e})=>e?"auto":"0"};
1022  border-radius: calc(${wg(55)} / 2);
1023  background-color: white;
1024  overflow: hidden;
1025
1026  @media ${({theme:e})=>e.mq.landscape} {
1027    height: ${({show:e})=>e?"auto":"0"};
1028    max-height: unset;
1029  }
1030`,NW=rh.default.div`
1031  height: 100%;
1032  overflow-y: auto;
1033
1034  ::-webkit-scrollbar {
1035    display: none;
1036  }
1037`,NG=(0,rh.default)(function(e){return rc.createElement("svg",Nz({xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",viewBox:"0 0 448 512"},e),tx||(tx=rc.createElement("path",{fill:"currentColor",d:"M6.1 359.3 25.9 379a12 12 0 0 0 17 0L224 198.4 405.1 379a12 12 0 0 0 17 0l19.8-19.8a12 12 0 0 0 0-17L232.5 133a12 12 0 0 0-17 0L6.1 342.3a12 12 0 0 0 0 17z"})))})`
1038  width: ${wg(15)};
1039  height: ${wg(40)};
1040  margin: 0 auto;
1041  color: #bdbdbd;
1042  opacity: ${({$show:e})=>+!!e};
1043  transition: opacity 200ms;
1044`,NV=(0,rh.default)(NG)``,NX=(0,rh.default)(NG)`
1045  transform: rotate(180deg);
1046`,Nq=rh.default.ul`
1047  display: block;
1048  min-width: ${wg(55)};
1049  margin: 0;
1050  padding: 0;
1051  color: #0a0a82;
1052  background-color: white;
1053  box-shadow: 0px 2px 16px rgba(10, 10, 130, 0.08),
1054    0px 1px 2px rgba(10, 10, 130, 0.16);
1055  list-style: none;
1056  white-space: nowrap;
1057  overflow: hidden;
1058
1059  @media ${({theme:e})=>e.mq.landscape} {
1060    li:first-child {
1061      margin-top: ${wg(16)};
1062    }
1063
1064    li:last-child {
1065      margin-bottom: ${wg(16)};
1066    }
1067  }
1068`,NY=rh.default.li`
1069  padding: ${wg(10)};
1070  text-align: center;
1071  cursor: pointer;
1072  color: ${({selected:e})=>e?"white":"inherit"};
1073  background-color: ${({selected:e})=>e?"#1415FA":"inherit"};
1074
1075  &:hover {
1076    background-color: ${({selected:e})=>e?"#1415FA":"#F7F7FB"};
1077  }
1078`;var NZ=Mz(Mg(Eb(function(e){let[t,n]=rc.useState(!1),[r,i]=rc.useState(!1),[a,o]=rc.useState(!1),[s,l]=rc.useState(!1),u=rc.useRef(null),{className:c,map:h,ordinals:d,activeOrdinal:p,activeOrdinalId:f,setActiveOrdinal:m,applyOrdinalOptions:g,expandToTop:v,options:{applyOrdinalOptionsOnOrdinalChange:y,showLevelsAlways:b}}=e,{isPortrait:x}=T1();rc.useEffect(()=>{b||t&&!r?setTimeout(()=>i(!0),500):!t&&r&&i(!1)},[t,r,b]),rc.useEffect(()=>{if(!t||!h)return;let e=h.container,r=e=>{e.composedPath().some(e=>"string"==typeof e.className&&(e.className.includes("pcmap-levels-list")||e.className.includes("pcmap-levels-button")))||(n(!1),i(!1))};return e.addEventListener("click",r),e.addEventListener("touchstart",r),()=>{e.removeEventListener("click",r),e.removeEventListener("touchstart",r)}},[h,t]);let _=x$(e=>{let t=e.target,n=t.scrollHeight-t.clientHeight-10,r=t.scrollTop;l(r<n),o(10<r)},200);return rc.createElement(NH,{className:`pcmap-levels-control ${c||""}`},rc.createElement(NF,{className:`pcmap-levels-button ${b||t?"pcmap-levels-button--activated":""}`,active:b||t,onClick:()=>{n(!t),i(!1)}},p.display.name),rc.createElement(Nj,{show:b||t,expandToTop:v,className:`pcmap-levels-list-container ${b||t?"pcmap-levels-list--opened":""}`},x&&rc.createElement(NV,{onClick:()=>{let e=u.current;e.scrollTop-=50},$show:a}),rc.createElement(NW,{ref:u,className:"pcmap-levels-list__scrollable",onScroll:_},rc.createElement(Nq,{className:"pcmap-levels-list"},[...d.values()].filter(e=>!e.options.hidden).sort((e,t)=>Number(t.id)-Number(e.id)).map(e=>{let t=e.id===f;return rc.createElement(NY,{className:`pcmap-levels-item ${t?"pcmap-levels-item--selected":""}`,key:e.id,selected:t,onClick:()=>r&&void(n(!1),m(e.id,{fitMap:!1,callback:()=>{y&&g(e)}}))},e.display.name)}))),x&&rc.createElement(NX,{onClick:()=>{let e=u.current;e.scrollTop+=50},$show:s})))}
1078)));let N$=rh.default.div`
1079  display: flex;
1080  flex-direction: column;
1081  justify-content: space-between;
1082`,NK=rh.default.ul`
1083  position: absolute;
1084  ${({expandToTop:e})=>e?`bottom: ${wg(48)};`:`top: ${wg(48)};`}
1085  left: 50%;
1086  transform: translateX(-50%);
1087  display: block;
1088  min-width: ${wg(55)};
1089  margin: 0;
1090  padding: 0;
1091  border-radius: calc(${wg(55)} / 2);
1092  color: #0a0a82;
1093  background-color: white;
1094  box-shadow: 0px 2px 16px rgba(10, 10, 130, 0.08),
1095    0px 1px 2px rgba(10, 10, 130, 0.16);
1096  list-style: none;
1097  white-space: nowrap;
1098  overflow: hidden;
1099  transition: height ${500}ms;
1100  height: ${({show:e})=>e?"auto":"0"};
1101
1102  li:first-child {
1103    margin-top: ${wg(16)};
1104  }
1105
1106  li:last-child {
1107    margin-bottom: ${wg(16)};
1108  }
1109`,NJ=rh.default.li`
1110  padding: ${wg(10)};
1111  text-align: center;
1112  cursor: pointer;
1113  color: ${({selected:e})=>e?"white":"inherit"};
1114  background-color: ${({selected:e})=>e?"#1415FA":"inherit"};
1115
1116  &:hover {
1117    background-color: ${({selected:e})=>e?"#1415FA":"#F7F7FB"};
1118  }
1119`;var NQ=Mz(function(e){let[t,n]=rc.useState(!1),[r,i]=rc.useState(!1),{className:a,expandToTop:o,selectedLanguage:s,languages:l,setLanguage:u}=e;return rc.useEffect(()=>{t&&!r?setTimeout(()=>i(!0),500):!t&&r&&i(!1)},[t,r]),rc.useEffect(()=>{if(!t)return;let e=document.querySelector(".pcmap");if(!e)return;let r=e=>{e.composedPath().some(e=>"string"==typeof e.className&&e.className.includes("pcmap-languages-list"))||(n(!1),i(!1))};return e.addEventListener("click",r),()=>{e.removeEventListener("click",r)}},[t]),rc.createElement(N$,{className:`pcmap-languages-control ${a||""}`},rc.createElement(NF,{className:`pcmap-languages-button ${t?"pcmap-languages-button--activated":""}`,active:t,onClick:()=>{n(!t),i(!1)}},s.toUpperCase()),rc.createElement(NK,{show:t,expandToTop:o,className:"pcmap-languages-list"},[...l.values()].map(e=>{let t=e===s;return rc.createElement(NJ,{className:`pcmap-languages-item ${t?"pcmap-languages-item--selected":""}`,key:e,selected:t,onClick:()=>r&&void(n(!1),u(e))},e.toUpperCase())})))});function N0(){return(N0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var N1=function(e){return rc.createElement("svg",N0({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},e),t_||(t_=rc.createElement("path",{fill:"currentColor",d:"M560 160c-2 0-4 .4-6 1.2L384 224l-10.3-3.6C397 185.5 416 149.2 416 123 416 55 358.7 0 288 0S160 55.1 160 123c0 11.8 4 25.8 10.4 40.6L20.1 216C8 220.8 0 232.6 0 245.7V496c0 9.2 7.5 16 16 16 2 0 4-.4 6-1.2L192 448l172 60.7c13 4.3 27 4.4 40 .2L555.9 456c12.2-4.9 20.1-16.6 20.1-29.7V176c0-9.2-7.5-16-16-16zM176 419.8 31.9 473l-1.3-226.9L176 195.6zM288 32c52.9 0 96 40.8 96 91 0 27-38.1 88.9-96 156.8-57.9-67.9-96-129.8-96-156.8 0-50.2 43.1-91 96-91zm80 444.2-160-56.5V228.8c24.4 35.3 52.1 68 67.7 85.7 3.2 3.7 7.8 5.5 12.3 5.5s9-1.8 12.3-5.5c12.8-14.5 33.7-39.1 54.3-66.9l13.4 4.7zm32 .2V252.2L544.1 199l1.3 226.9zM312 128c0-13.3-10.8-24-24-24s-24 10.7-24 24c0 13.2 10.8 24 24 24s24-10.7 24-24z"})))};let N2=rh.default.svg`
1120  width: ${wg(17)};
1121  color: inherit;
1122`;var N3=Eb(function(e){let{options:t}=Mm(),{ordinal:n,center:r,zoom:i,rotation:a,tilt:o}=t,{className:s,setActiveOrdinal:l,setView:u,map:c}=e;return rc.createElement(NF,{className:`pcmap-home-button ${s||""}`,onClick:()=>{l(n,{fitMap:!1,callback:()=>{c&&u(r,{zoom:i,rotation:a,tilt:o})}})}},rc.createElement(N2,{as:N1}))});function N5(){return(N5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function N4(){return(N4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}let N6=(0,rh.default)(function(e){return rc.createElement("svg",N5({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 120 120"},e),tw||(tw=rc.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M62 117.3c0 2.9 4 3.8 5.2 1.1L119 3.9c1-2.4-1.4-4.7-3.7-3.6L2.6 53.3c-2.7 1.3-1.7 5.3 1.2 5.3l55.5-1.4c1.6 0 2.8 1.2 2.8 2.7l-.1 57.4ZM71 78c-.1 3 4 3.8 5.
11221 1l26-58.1c1-2.3-1.4-4.6-3.7-3.6L41 43.7c-2.7 1.2-1.8 5.2 1.2 5.2l26-.8c1.6 0 2.9 1.2 2.9 2.8l-.3 27Z",clipRule:"evenodd"})))})`
1123  width: ${wg(23)};
1124  margin: ${wg(3)} ${wg(3)} 0 0;
1125  color: inherit;
1126`,N8=(0,rh.default)(function(e){return rc.createElement("svg",N4({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 120 120"},e),tM||(tM=rc.createElement("path",{fill:"currentColor",d:"M56.2 2.1a2 2 0 0 1 2-2.1h1c1.2 0 2.1 1 2.1 2.1v16.5a2 2 0 0 1-2 2.1h-1a2 2 0 0 1-2.1-2V2Z"})),tE||(tE=rc.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M91.6 119.4c1.6 1.6 4.2-.1 3.4-2.3l-34.2-91a2.1 2.1 0 0 0-4 0L24.1 117c-.7 2.2 2 3.8 3.5 2.2L57.3 88c.8-.8 2.1-.8 3 0l31.3 31.5ZM75 93c1.6 1.6 4.3-.1 3.4-2.3l-17.6-46a2.1 2.1 0 0 0-4 0l-17 45.8c-.7 2.2 2 3.9 3.6 2.2L57.3 78a2 2 0 0 1 3 0L75 93Z",clipRule:"evenodd"})))})`
1127  width: ${wg(26)};
1128  color: inherit;
1129`;var N7=Eb(Mg(EG(function(e){let{className:t,map:n,activeOrdinal:r,setActiveOrdinal:i,userLocation:a,userHeading:o,followMeMode:s,setFollowMeMode:l,options:u}=e,c=rc.useRef({followMeMode:s}),[h,d]=rc.useState(!1);return(rc.useEffect(()=>{if(!a||!r)return;let e=[a.latitude,a.longitude],t=r.venue.bounds.containsPoint(e);u.userPositionOnlyInVenue&&!t?(l(!1),d(!1)):h||d(!0)},[u,r,a,h,l]),rc.useEffect(()=>{var e;if(!s||!a||!n||!r)return;s!==c.current.followMeMode&&("heading"===s?n.setRotationRange(-1/0,1/0):"heading"===c.current.followMeMode&&n.setRotationRange(u.minRotation,u.maxRotation),c.current.followMeMode=s);let t=[a.latitude,a.longitude],l={animate:!0};"heading"===s&&Number.isFinite(o)&&(l.rotation=(null==(e=u.basemap)?void 0:e.provider)==="mb"?o:-o),(dr(n.center,t)>2||"heading"===s)&&n.setView(t,l),r.id!==a.ordinal&&i(a.ordinal,{keepFollowMeMode:!0})},[n,u,s,a,o,r,i]),rc.useEffect(()=>{n&&(n.followMouseOnZoom=!s)},[n,s]),h)?rc.createElement(NF,{className:`pcmap-followme-button ${s?"pcmap-followme-button--enabled":""} ${t||""}`,active:s,onClick:()=>{if(a){if(u.allowHeadingMode&&Number.isFinite(o))return void l(!0===s?"heading":!s);l(!s)}}},"heading"===s?rc.createElement(N8,null):rc.createElement(N6,null)):null})));function N9(){return(N9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var Ue=function(e){return rc.createElement("svg",N9({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},e),tS||(tS=rc.createElement("path",{stroke:"currentColor",strokeWidth:1.5,d:"M9.3.9v16.2M.9 8.7h16.2"})))};function Ut(){return(Ut=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var Un=function(e){return rc.createElement("svg",Ut({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 2"},e),tT||(tT=rc.createElement("path",{stroke:"currentColor",strokeWidth:1.5,d:"M.9 1.3h16.2"})))};let Ur=rh.default.div`
1130  display: flex;
1131  flex-direction: column;
1132  justify-content: space-between;
1133  height: ${wg(88)};
1134`,Ui=(0,rh.default)(NF)`
1135  color: ${({disabled:e})=>e?"lightgrey":"#0a0a82"};
1136`,Ua=rh.default.svg`
1137  width: ${wg(17)};
1138  color: inherit;
1139`;var Uo=Eb(Mg(function({className:e,map:t,options:n}){let[r,i]=rc.useState(n.zoom),{minZoom:a,maxZoom:o,zoomSpeed:s}=n;return rc.useEffect(()=>{if(!t)return;let e=vA(({zoom:e})=>{i(e)},500,{leading:!1,trailing:!0});return t.addEventListener("zoomChangeSequence",e),t.addEventListener("zoomChange",e),()=>{t.removeEventListener("zoomChangeSequence",e),t.removeEventListener("zoomChange",e)}},[t]),rc.createElement(Ur,{className:`${e} pcmap-zoom-control`},rc.createElement(Ui,{className:"pcmap-zoom-button pcmap-zoom-plus",disabled:o<=r,onClick:()=>{t.setZoom(r+s,{animate:!0,easing:"easeOutExpo",duration:500}),i(r+s)}},rc.createElement(Ua,{as:Ue})),rc.createElement(Ui,{className:"pcmap-zoom-button pcmap-zoom-minus",disabled:r<=a,onClick:()=>{t.setZoom(r-s,{animate:!0,easing:"easeOutExpo",duration:500}),i(r-s)}},rc.createElement(Ua,{as:Un})))}));let Us=(0,rh.default)(NI)`
1140  position: absolute;
1141  top: 0;
1142  left: 0;
1143  width: 100vw;
1144  z-index: 1000;
1145
1146  @media ${({theme:e})=>e.mq.landscape} {
1147    top: ${wg(32)};
1148    left: ${wg(24)};
1149    width: ${wg(350)};
1150  }
1151`,Ul=(0,rh.default)(C1)`
1152  position: absolute;
1153  z-index: 1000;
1154
1155  @media ${({theme:e})=>e.mq.landscape} {
1156    top: ${wg(32)};
1157    left: ${wg(24)};
1158    bottom: auto;
1159
1160    > div {
1161      width: ${wg(310)};
1162    }
1163  }
1164`,Uu=(0,rh.default)(N7)`
1165  display: block;
1166  position: absolute;
1167  top: ${({isMobileRoute:e})=>e?"50%":`${wg(130)}`};
1168  right: ${wg(24)};
1169  z-index: 998;
1170
1171  @media ${({theme:e})=>e.mq.landscape} {
1172    top: ${wg(80)};
1173  }
1174`,Uc=(0,rh.default)(NZ)`
1175  position: absolute;
1176  ${({placeBottom:e})=>e?`bottom: ${wg(30)}; top: auto;`:`top: ${wg(80)}; bottom: auto;`}
1177  right: ${wg(24)};
1178  z-index: 999;
1179
1180  @media ${({theme:e})=>e.mq.landscape} {
1181    bottom: ${wg(128)};
1182    top: auto;
1183  }
1184`,Uh=(0,rh.default)(NQ)`
1185  position: absolute;
1186  top: ${wg(30)};
1187  bottom: auto;
1188  right: ${wg(24)};
1189  z-index: 999;
1190`,Ud=(0,rh.default)(N3)(({placeBottom:e})=>(0,rh.css)`
1191    display: none;
1192    position: absolute !important;
1193    ${e?`bottom: ${wg(30)}; top: auto;`:`top: ${wg(80)}; bottom: auto;`}
1194    right: ${wg(24)};
1195    z-index: 998;
1196
1197    @media ${({theme:e})=>e.mq.landscape} {
1198      bottom: ${wg(176)};
1199      top: auto;
1200    }
1201  `),Up=(0,rh.default)(Uo)`
1202  display: none;
1203  position: absolute;
1204  bottom: ${wg(32)};
1205  right: ${wg(24)};
1206  z-index: 998;
1207
1208  @media ${({theme:e})=>e.mq.landscape} {
1209    display: flex;
1210  }
1211`,Uf=rh.default.div.attrs({className:"pcmap-vendor-label"})`
1212  position: absolute;
1213  bottom: ${({placeBottom:e})=>e?`${wg(10)}`:`${wg(80)}`};
1214  left: ${wg(10)};
1215  height: ${wg(20)};
1216  z-index: 400;
1217
1218  img {
1219    height: 100%;
1220  }
1221
1222  @media ${({theme:e})=>e.mq.landscape} {
1223    bottom: ${wg(10)};
1224  }
1225`;var Um=Eb(Sq(function(e){let{mapLoaded:t,isDirectionsOpen:n,route:r,toggleDirections:i,closeDirections:a}=e,{isPortrait:o,isLandscape:s}=T1();return rc.createElement(rc.Fragment,null,rc.createElement(Ao,null),t&&rc.createElement(rc.Fragment,null,n?rc.createElement(Us,{onClose:a}):rc.createElement(Ul,{key:"search-box",onDirectionsToggle:i,closeDirections:a}),o&&r&&rc.createElement(Ul,{key:"search-box-along-route",onDirectionsToggle:i,closeDirections:a,route:r}),rc.createElement(Up,null),rc.createElement(Uu,{isMobileRoute:o&&r}
1225),rc.createElement(Uc,{placeBottom:s,expandToTop:s}),rc.createElement(Uh,null),rc.createElement(Ud,{placeBottom:s||o&&n}),rc.createElement(Uf,{placeBottom:n},rc.createElement("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJIAAAAjCAYAAAB/7VNeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAACSoAMABAAAAAEAAAAjAAAAAK65xpUAAAIDaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4xNDY8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MzU8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KrKoeTwAADTBJREFUeAHtmwmQFNUdh2eXMxxyyBVQzgAa5FJURExEuYIHSgRFiVWxEghoENQYYyXGWCYxaqyyEkE0WKuoIFiKQIyAAVQUCwUUXS8OkUvO5YZlgSXf15ne9M7OzC6HqXJ3/lUf/e7p9/r3/u/16yUrlsaOHj1aacmSJc0OHDhw8ZEjRy46fPjwWRQ/hfRsroWwD77Iysp6k7x5u3fvXjtkyJAC0jJWwUYgK1l/77333uz+/fs3RRzD4Vpoo6gQTLLiMfIOk/EVvEyZSXl5ebkI6kjSwpnEcjkCJZQxderUSq1ateqLF7q/oKCgK70uUSbVSCCoIwjpc/IfpO7LAwYM2J2qbCa9fI1AMZHMnz+/cq1ata45ePDg3xHSqak8UGlDgKC2UuaxQ4cOjUNMhjNWzkfAvU5gcRFdxcN//EREZGMIsCGXsZUrV75x1qxZ9YIfyPxTrkegSEi1a9fuVFhY+BgiqnO8nig6UrRhO6OrVKnSb8KECVWieZlw+RuBQEgsRdnwZ7xRI65pe2k++5/Ynj17Yrylxfbu3RvEk9VDSM3hptatW5+RttFM5rd+BII9Eq/4/RHCqwgjC6+UqlP5lPkMAS1dvXr1xh07dtRlL3U2QulYrVq12g0aNIg1bdo0VqdOnVilSpWK2qDOIdock5+fP2ngwIF7ijIygXI1ApXjvRnDA8/irMj9TWIHyTq6nvTx8NSgQYM2hwVGjhxZj7QrWA5H7dq169yNGzdmt2jRIibVq1cPipFfBWFdXrVq1YUkLA/rZq7lawSyFy9e3IQuXaIn4qEn9k4RbSLx9wsXLvxL7969i0RkwfHjx+/YunXrcwTvgkUIKrZixYrYypUrY/v377dIYLRxIXul5kRK/EC8SObyLR+BrKVLlw7lQT/PoWOw70noj0vRZA4YR6U7YBw8eHClJk2aDKed3yLGprytxdq2bRvjPCqGgIIm8XZ31qxZ8/GePXsmW96qUehSSNyUryctF/IhmSnMutApTm2uW+CTODu5JrPOJDpBwolRlfBQmANfQyr7Dhnd4K14AX/vkng42cWD2jVgH9LZd8l0oq2E7SkKDiJ9Nvg1IZ25r2gJ58IUSGWtyPBLRdELF2Fn/wrYAIcgaq5eHcH+NwPHaRl8AAWV8UQd9UTZ2dmeUCd6pS3kPZ1ORDQSmzZt2pGbb775TZawt4kOVpQbNmyI1a9fP+beSaP9lvxWLYLJhGShifA+OPiaD60RrIE7YDVErSaRi2EEWNaH5ZnVOXAdKKh/gEtq4mebW0l7JQ6XmEcUvwIF+QdIdZDq4P8NukAWWG8YOMg+kMZxHFzNB/MaeG/pzHseDOMhmZAU+u9gGzjG6b4a1Cd/JPwQXgfrJLMrSbwFPo5nhv2pRvw5UIThGaDj6/j0gk9hHVwAN4FiGlsZoTgbAgGFYjKOoaujeYhj8X+j6f/dt2/fqi5duqyylG9z7JliO3fuDDbfeiV+pyFLX/U0rdjh6yEUmg+mJYyGJ+HHEHqYGoQd+J+Cef+EHRCaArwGrOvseQGiYnLQEm0fCbb5DtheMi9ovbCur7drwTqaD6A/DADFfSzWksI94V/wPhyGqPUgYp8U8LuQTkhNyO8LH4FieQpS2SwyxkYynZx9YDj4G0+D4zIEzoTbYDmEv+/YdoXDPqwiC5eheIKfO7b16tUrsVNF5aOBnJycfJaufE7GY40bNw68kUcD7ps0vFFdRFklWqeUcCH5eqF7YC9cC5qz/2y4AR6GZyEqIqKBN1JgL4JL5oVQmu2mwCNwJ3QAl4j/l7Xkh76G1nAqJNrlJPgA7Xe6+3KCKTrFOAl+BHqzspqimQ5TQYG0Be1iUHSfQSgigsESaPqhEkJyedO4erZUz29vQUIp/3joiPACoSCYWL169WLulTibCmqSt4Nw1CuU0mJRtkp0pjpAWuht3C/MDFKS/+MPvwRfgHWTPSCSi5ltvgqKt2mxnG8uUpem9WZz4DSwf1FzWekNj4NewYmUyk4hox/kgP3eD9Y9VnuTCnreBvGKaiD0xPGk4hfFkhcm+eBF48FnQ30E8f0wP92Vsq3Il8B43Y/hoWJeNfLXsXTaseMxZ0ooaDt3DkwuQ0P+3iJwgM8qQ3mLPAQua7dAuqWY7JNizWllL8wH77MZRMWiN/0KXNLqgMJKZoqxG+gc3gH3N9a5GtKKgPxEs/9Rz7OY+BXQDsLnQPB/xrPNzjXKgw7w/Cf0SiQ3JDzsf8VThrJYFs+njfOiJTioDIV5mHaWs28K9zjRYqWFHVQ3jrpVB0tPYTsboCy2kkKF0KgshSmj+O4Af/NKiD5UoifdnHwKaTN8AHqdqPfsS/wN8L5WQKoJoQiHwDRwO7IH3Ag3BN+2jsWcqArGNrRnwfF+FG4Dl/5g9eEaWDYC8CaD9UwxuU9SAHEx6XaHzJ49WzWmtJkzZ3bCk11HnTbJCpH+EW2vOI4/enP2XQ+d4RnwoTorHfSymnsfB6VWWStQbh24vN0HZfLIlDte+x4VFckOeBt8SI1As//nQSgkhZFMSHoh27HuKxDaegIfwmVhQhmuCtkxXwur4uWduHfDn6AL+Cyehv7gM4lV7tix4yo+kbxP+FwTNL2SB5TsabKINsdrPYCYVPz0fv36ucwExv6pat26dS/gjW0sYulDouWLjHq+9ivSGZwjhTdVlJ8QqE18JByMp7usXAQO6m/AjumRFIazrKxWk4LO0KL7LmPFOZSbDI/AVaDX+CasBY1+AqEHsb8ub5+Cy5r9VtguNcshmSiqku4Spoii97mJ+CL4OZwGCitqXYncGk/I5uoyq3DVwxTYBqG53Dkm80DROiYPwAyvgZoQzQQeeCAkvZICqFGjRnA6jZjcK51J2jgqDJs7d+4bxL9EOPWJd+fMqBcfcU+DYiIiL/jmRrmVtD8PAW4xLY3pNRzUgkiZlwh78+EAmPc11IMGEO0o0aTWilTFfCxeLGzIgeoMzsTRYeJJvNqP6rAdfFDaEtAr6H1c1t6DcBKYdjckmmMxEO6D8xMy68Tj/bhOTMjTObSMpOUR1hMrpF2R9G
1225jQSek2IxTRNOOBkBDL8yxnt5NgB4K9kmJys8yHWclCEKcgoP5kS2DUC86M8EhhUrErG+0jLJVTeYvLLZaRPKL7vAvCdTlZKQWxFT6Ea+ExSGfVyLwA9HKfpyuYIs96Y2A++ECXwsm002nMwfMBhraAwE/ASaV3mA4HQFsDDUEB6Jk1vZFjoRAvh0RzgivYS2EK+HuhvUFgbBg5jusn1JkEP9CdxXr06OGN/hqxhDdcJCaXOf5WKfBQvtEpME+u+fof4ztb8Gck1LOZYmY5bBHX1/hG54w7WaZnewl0rbr+VKaHuww6gm8dm+B4bC2VfgF6pbOOp4E0dVxuEoXkvTaCq2ED6IELQXN5+xi6GolbLa43wCgYmoTrSNOLOSnSjRfZKc0JGTzQJCVsN/jfIEHe5s2b5+BxHjQxWpi0YIlSUB426qUUjqfXeqRUhuicZTmU11WfTPNHdb0z4T64AmpC1JyB18ON8C4sgBOxuVQeD4rpZJrLrpM36pGM279BoGj01FH7iEiPSEJfwnrxdyJpicFVJNiWZZ1gx2p6rdHQDKKCcq/kGC8IljYCMf62+mBubu7DfLVvgxcZZlqiKSopzRCar/vTWNLmxL1daVWONd+BywGXOTvpZnIpOOiNoTO4lk+EOaDbP1F7iAa6QZsTbShS3wejx9kWSTPoPV8Jb0G4hBEMTCE5eUL7GYEnoZgDCDPjV8fJ/VUncGwcq2Ox1yl8O7gKLIIP4QzoA9NhRjF1jhs3rmDMmDGLWLpU/OlQwvRGfvbwLyRTGWL7N3mPDh06NDdVmYT0AuJbwEEK3XhCkRJRXeqnoLdwI+1DcUlQTK/AE6A3VFCJtouEz8Gy2iEw7JqvR0hm3pcP1vb0conmg9wP6+GrxMwUcZc1+7wpId/+OB7ef3RPY7GNsBfsu6YzeAGS9dP80HYQ+BLsZx54ryvA+y3N/M3ZsBIaQlvwHhzjyVDyTQuhZC1btuwcri9SoAUUM//4bfv27cHX/WIZ8Qj11lHm7vbt208p63e6ZO1k0r5dIxBd74I7x5sc5Q1uOZFfIorUbidJP+Pln6GNmRkRJRmgcpxUQkj2tUOHDgXbtm2bR/CP4BJSqiEiy73ABvypESNGuHRkrAKNQFIh2X9PsNkr5SAQN6zpNnK+xbl/eI2Dx/GjRo1abf2MVawRSCkkh6F79+6bEclfCbrRSmdLEdE4PJFvBhmrgCOQVkiOR7du3dZwHHA/QfdNJQyhfUn+xHbt2rkUpvVcJSpnEsrNCJQqJDbOhfzJ7BLEcg9hX0ujloeQcvg/a89mNtfRYal44VKF5JAgknw23wsIeigXnGsgoP0sZzPYXD/BH/57ppCxCjwCZRKS49OnT59dbL6nIqAn8EyeFM/jY+4jiCjxMK0CD2fF7Xrp3zsSxob/KNmev3QcxH83em/48OGvJ2RnohV0BP4DDKh/+TUVnO4AAAAASUVORK5CYII=",alt:"Point Maps"}))))}));function Ug({options:e,eventEmitter:t}){let[n,r]=rc.useState(null),[i,a]=rc.useState(null);return rc.useEffect(()=>{var t;switch(null==(t=e.basemap)?void 0:t.provider){case"mi":Promise.all([Promise.resolve().then(function(){return Uq}),Promise.resolve().then(function(){return U6})]).then(([e,t])=>{r(e),a(t)}).catch(e=>{console.error("Failed to initialize the MapsIndoorsEngine"),console.error(e)});break;case"mb":Promise.all([Promise.resolve().then(function(){return kf}),Promise.resolve().then(function(){return U6})]).then(([e,t])=>{r(e),a(t)}).catch(e=>{console.error("Failed to initialize the MapboxEngine"),console.error(e)});break;default:Promise.all([Promise.resolve().then(function(){return FB}),Promise.resolve().then(function(){return Fq})]).then(([e,t])=>{r(e),a(t)}).catch(e=>{console.error("Failed to initialize the MapEngine"),console.error(e)})}},[e]),rc.createElement(MT,{eventEmitter:t},rc.createElement(Mf,{options:e},rc.createElement(MB,{dictionary:e.dictionary},rc.createElement(Er,{categories:e.categories},n&&i&&rc.createElement(Ey,{mapEngine:n,mapProjection:i},rc.createElement(EV,null,rc.createElement(SX,null,rc.createElement(S8,null,rc.createElement(TQ,null,rc.createElement(Um,null))))))))))}var Uv=Object.defineProperty,Uy=Object.getOwnPropertySymbols,Ub=Object.prototype.hasOwnProperty,Ux=Object.prototype.propertyIsEnumerable,U_=(e,t,n)=>t in e?Uv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uw=(e,t)=>{for(var n in t||(t={}))Ub.call(t,n)&&U_(e,n,t[n]);if(Uy)for(var n of Uy(t))Ux.call(t,n)&&U_(e,n,t[n]);return e},UM=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},UE=(e,t,n)=>(UM(e,t,"read from private field"),n?n.call(e):t.get(e)),US=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},UT=(e,t,n,r)=>(UM(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class UA{constructor(e){((e,t,n)=>U_(e,"symbol"!=typeof t?t+"":t,n))(this,"state",{}),US(this,tA,null),US(this,tC,null),US(this,tR,!1),console.group("%cPoint-Consulting:","color: #81beff; font-weight: bold;"),console.log("%cPCMap library %c(version: 444.8.4, date: Tue, 25 Nov 2025 11:43:28 GMT)","color: #81ffbe","color: #888"),console.groupEnd(),UT(this,tA,e);let{geoData:t,styles:n,dictionary:r}=UE(this,tA);if(!t)throw Error("You must provide the GeoJSON data as a geoData option");Mr.init(t,n,r),UT(this,tC,new rf),UE(this,tC).on("Map#StateChanged",e=>{this.state=Uw(Uw({},this.state),e)})}mapComponent(){let e=UE(this,tA),t=UE(this,tC);return(0,rc.memo)(function(){return rc.createElement("div",{className:"pcmap pcmap--ready"},rc.createElement(Ug,{options:e,eventEmitter:t}))})}once(...e){var t;null==(t=UE(this,tC))||t.once(...e)}on(...e){var t;null==(t=UE(this,tC))||t.on(...e)}
1225off(...e){var t;null==(t=UE(this,tC))||t.removeListener(...e)}getOccupant(e){return Mr.occupantsMap.get(e)}getOccupants(e){return Array.from(Mr.occupantsMap.values()).filter(e)}setOccupantLocation(e,t){UE(this,tC).emit("Occupant#SetLocation",Uw({id:e},t))}setSearchBoxCategory(e){UE(this,tC).emit("SearchBox#SelectCategory",e)}setSearchBoxQuery(e){UE(this,tC).emit("SearchBox#Query",e)}setDirections(e){UE(this,tC).emit("Directions#Set",e)}showDirections(e){UE(this,tC).emit("Directions#Show",e)}hideDirections(){UE(this,tC).emit("Directions#Hide")}clearDirections(){UE(this,tC).emit("Directions#Clear")}buildRoute(e){return new Promise((t,n)=>{setTimeout(()=>n("Route buiding timeout"),1e3),UE(this,tC).once("Route#Built",e=>t(e)),UE(this,tC).emit("Route#Build",e)})}showRoute(e){UE(this,tC).emit("Route#Show",e)}hideRoute(){UE(this,tC).emit("Route#Hide")}addDestination(e){UE(this,tC).emit("Route#AddDestination",e)}showOrdinal(e,t={}){let{applyOrdinalOptions:n=!1}=t;UE(this,tC).emit("Ordinal#Show",{ordinalId:e,applyOrdinalOptions:n})}filterMarkers(e,t){UE(this,tC).emit("Markers#Filter",{filters:e,options:t})}addMarker(e){UE(this,tC).emit("Markers#AddMarker",{marker:e})}updateMarker(e){UE(this,tC).emit("Markers#UpdateMarker",{marker:e})}removeMarker(e){UE(this,tC).emit("Markers#RemoveMarker",{marker:e})}filterMapObjects(e){UE(this,tC).emit("Map#Filter",{predicate:e})}dimMapObjects(e){UE(this,tC).emit("Map#Dim",{predicate:e})}hide3dBuildings(){UE(this,tC).emit("Map#Hide3dBuildings")}show3dBuildings(){UE(this,tC).emit("Map#Show3dBuildings")}getMapbox(e){UE(this,tC).emit("Map#GetMapbox",e)}updateGeoData(e){UE(this,tC).emit("GeoData#Update",{rawGeoData:e})}setUserPosition(e){UE(this,tC).emit("User#SetUserLocation",{location:e})}setUserLocation(e){UE(this,tC).emit("User#SetUserLocation",{location:e})}setZoom(e,t){UE(this,tC).emit("Map#SetZoom",{zoom:e,options:t})}setZoomRange(e,t,n){UE(this,tC).emit("Map#SetZoomRange",{min:e,max:t,options:n})}setView(e,t){UE(this,tC).emit("Map#SetView",{center:e,options:t})}setRotation(e,t){UE(this,tC).emit("Map#SetRotation",{rotation:e,options:t})}setRotationRange(e,t,n){UE(this,tC).emit("Map#SetRotationRange",{min:e,max:t,options:n})}setTilt(e,t){UE(this,tC).emit("Map#SetTilt",{tilt:e,options:t})}setTiltRange(e,t,n){UE(this,tC).emit("Map#SetTiltRange",{min:e,max:t,options:n})}selectMarkers(e,t){UE(this,tC).emit("Map#SelectOccupants",{occupants:e,callback:t})}setLanguage(e){UE(this,tC).emit("Dictionary#SetLanguage",{language:e})}captureScreenshot({onComplete:e}){UE(this,tC).emit("Map#CaptureScreenshot",{onComplete:e})}dispose(){UE(this,tR)||(UT(this,tR,!0),UE(this,tC).emit("Map#Dispose"),setTimeout(()=>{UE(this,tC).eventNames().forEach(e=>{UE(this,tC).removeAllListeners(e)}),UT(this,tA,null),UT(this,tC,null),this.state=null}))}}tA=new WeakMap,tC=new WeakMap,tR=new WeakMap,!function(e,t){var n;(n=function(){function e(e){return i.appendChild(e.dom),e}function t(e){for(var t=0;t<i.children.length;t++)i.children[t].style.display=t===e?"block":"none";r=e}var r=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(e){e.preventDefault(),t(++r%i.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,l=e(new n.Panel("FPS","#0ff","#002")),u=e(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=e(new n.Panel("MB","#f08","#201"));return t(0),{REVISION:16,dom:i,addPanel:e,showPanel:t,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(u.update(e-a,200),e>
1225o+1e3&&(l.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:t}}).Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,l=48*o,u=3*o,c=2*o,h=3*o,d=15*o,p=74*o,f=30*o,m=document.createElement("canvas");m.width=s,m.height=l,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*o+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=n,g.fillRect(0,0,s,l),g.fillStyle=t,g.fillText(e,u,c),g.fillRect(h,d,p,f),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(h,d,p,f),{dom:m,update:function(l,v){r=Math.min(r,l),i=Math.max(i,l),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,d),g.fillStyle=t,g.fillText(a(l)+" "+e+" ("+a(r)+"-"+a(i)+")",u,c),g.drawImage(m,h+o,d,p-o,f,h,d,p-o,f),g.fillRect(h+p-o,d,o,f),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(h+p-o,d,o,a((1-l/v)*f))}}},e.exports=n}({exports:{}});var UC=Object.defineProperty,UR=Object.defineProperties,UP=Object.getOwnPropertyDescriptors,UI=Object.getOwnPropertySymbols,UO=Object.prototype.hasOwnProperty,UL=Object.prototype.propertyIsEnumerable,UD=(e,t,n)=>t in e?UC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UN=(e,t)=>{for(var n in t||(t={}))UO.call(t,n)&&UD(e,n,t[n]);if(UI)for(var n of UI(t))UL.call(t,n)&&UD(e,n,t[n]);return e},UU=(e,t)=>UR(e,UP(t)),Uk=(e,t,n)=>(UD(e,"symbol"!=typeof t?t+"":t,n),n),UB=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},UF=(e,t,n)=>(UB(e,t,"read from private field"),n?n.call(e):t.get(e)),Uz=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},UH=(e,t,n,r)=>(UB(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);let Uj=e=>1.64*Math.pow(Math.sqrt(e),1.64),UW=e=>Math.round(1e3*Math.pow(Math.pow(e/1.64,.6097560975609756),2))/1e3,UG=new Set,UV=window.fetch;window.fetch=function(...e){let t=e[0],n=UV.apply(this,e);if("string"==typeof t&&t.startsWith("https://api.mapsindoors.com/")){UG.add(n);let e=()=>UG.delete(n);n.then(e,e)}return n};class UX extends rF{constructor(e,{mapProjection:t,mapGroups:r,basemap:i,markersProvider:a,ordinal:o=0,center:s=[0,0],minZoom:l=0,maxZoom:u=Number.MAX_SAFE_INTEGER,zoom:c=20,zoomSpeed:h=1,minRotation:d=-1/0,maxRotation:p=1/0,rotation:f=0,rotationSpeed:m=1,minTilt:g=0,maxTilt:v=45,tilt:y=0,maxBounds:b=[[-1/0,-1/0],[1/0,1/0]],damping:x=!1,dampingFactor:_=.25,debug:w=!1}={}){if(super(),Uk(this,"refresh",function(){UH(this,t2,!0)}),Uk(this,"addMapGroup",function(e){this.addMapGroups([e])}),Uk(this,"addMapGroups",function(e){UF(this,t6).call(this,e),UH(this,t2,!0)}),Uk(this,"removeMapGroup",function(e){this.removeMapGroups([e])}),Uk(this,"removeMapGroups",function(e){e&&(e.forEach(e=>{UF(this,tK).remove(e.threeObject)}),UH(this,t2,!0))}),Uk(this,"setZoom",function(e,t={}){let n=t.animate||!1,r=t.duration||1e3,i=t.onAnimationEnd,a=Math.min(Math.max(t.minZoom||UF(this,tP).minZoom,e),t.maxZoom||UF(this,tP).maxZoom);if(a===UF(this,tD)){n&&i&&i();return}UF(this,tZ).once("zoomend",e=>e.api&&i&&i()),UF(this,tZ).easeTo({zoom:Uj(a),animate:n,duration:r},{api:!0})}),Uk(this,"setZoomRange",function(e,t,n={}){UF(this,tP).minZoom=e,UF(this,tP).maxZoom=t;let r=UF(this,tD),i=Math.min(Math.max(e,r),t);if(i===r||!n.animate){UF(this,tZ).setMinZoom(Uj(e)),UF(this,tZ).setMaxZoom(Uj(t)),this.setZoom(i);return}this.setZoom(i,UU(UN({},n),{onAnimationEnd:()=>{UF(this,tZ).setMinZoom(Uj(e)),UF(this,tZ).setMaxZoom(Uj(t)),n.onAnimationEnd&&n.onAnimationEnd()}}))}),Uk(this,"setRotation",function(e,t={}){let n=t.animate||!1,r=t.duration||1e3,i=t.onAnimationEnd,{minRotation:a,maxRotation:o}=UF(this,tP),s=Math.min(Math.max(a,e),o);if(s===UF(this,tU)){n&&i&&i();return}UF(this,tZ).once("rotateend",e=>e.api&&i&&i()),UF(this,tZ).easeTo({bearing:s,animate:n,duration:r},{api:!0})}),Uk(this,"setRotationRange",function(e,t,n={}){UF(this,tP).minRotation=e,UF(this,tP).maxRotation=t;let r=UF(this,tU),i=Math.min(Math.max(e,r),t);if(e===t?(UF(this,tZ).keyboard.disableRotation(),UF(this,tZ).touchZoomRotate.disableRotation(),UF(this,tZ).dragRotate.disable()):(UF(this,tZ).keyboard.enableRotation(),UF(this,tZ).touchZoomRotate.enableRotation(),UF(this,tZ).dragRotate.enable()),i===r||!n.animate)return void this.setRotation(i);this.setRotation(i,UU(UN({},n),{onAnimationEnd:()=>{n.onAnimationEnd&&n.onAnimationEnd()}}))}),Uk(this,"setTilt",function(e,t={}){let n=t.animate||!1,r=t.duration||1e3,i=t.onAnimationEnd,{minTilt:a,maxTilt:o}=UF(this,tP),s=Math.min(Math.max(a,e),o);if(s===UF(this,tB)){n&&i&&i();return}UF(this,tZ).once("pitchend",e=>e.api&&i&&i()),UF(this,tZ).easeTo({pitch:s,animate:n,duration:r},{api:!0})}),Uk(this,"setTiltRange",function(e,t,n={}){UF(this,tP).minTilt=e,UF(this,tP).maxTilt=t;let r=UF(this,tB),i=Math.min(Math.max(e,r),t);if(i===r||!n.animate){UF(this,tZ).setMinPitch(e),UF(this,tZ).setMaxPitch(t),this.setTilt(i);return}this.setTilt(i,UU(UN({},n),{onAnimationEnd:()=>{UF(this,tZ).setMinPitch(e),UF(this,tZ).setMaxPitch(t),n.onAnimationEnd&&n.onAnimationEnd()}}))}),Uk(this,"setView",function(e,t={}){var n,r,i,a,o,s,l,u;let c=t.zoom||UF(this,tD),h=t.rotation||UF(this,tU),d=t.tilt||UF(this,tB),p=t.animate||!1,f=t.duration||500;UF(this,tZ).easeTo({center:[...e].reverse(),bearing:h,pitch:d,zoom:Uj(c),animate:p,duration:f,padding:{top:null!=(r=null==(n=t.paddings)?void 0:n.paddingTop)?r:0,bottom:null!=(a=null==(i=t.paddings)?void 0:i.paddingBottom)?a:0,left:null!=(s=null==(o=t.paddings)?void 0:o.paddingLeft)?s:0,right:null!=(u=null==(l=t.paddings)?void 0:l.paddingRight)?u:0}},{api:!0})}),Uk(this,"fitBounds",function(e,t={}){console.warn("PCMap: fitBounds() not implemented",e,t)}),Uk(this,"fitPoints",function(e,t={}){let{padding:n=0,paddingTop:r=0,paddingBottom:i=0,paddingLeft:a=0,paddingRight:o=0,maxZoom:s}=t,l=n||r,u=n||i,c=n||a,h=n||o,d=new(UF(this,tY)).LngLatBounds;
1225e.forEach(e=>d.extend([...e].reverse())),UF(this,tZ).setPadding({top:l,bottom:u,left:c,right:h}).fitBounds(d,{bearing:UF(this,tU),pitch:UF(this,tB),linear:!0,maxZoom:Uj(s)},{api:!0})}),Uk(this,"findIntersections",function(e,t,n){let r=UF(this,tK),i=UF(this,tQ);return i.set(e,t),n=n||r.children,i.intersectObjects(n)}),Uk(this,"getMapObjects",function(e){let t=UF(this,tK),n=[];return t.traverse(t=>{e(t)&&n.push(t)}),n}),Uk(this,"filterMapObjects",function(e){UF(this,tK).traverse(t=>{t.visible=e(t.userData)}),UH(this,t2,!0)}),Uk(this,"dimMapObjects",function(e){UF(this,tK).traverse(t=>{if(!t||!t.userData||!t.material)return;let n=e(t.userData);Number.isFinite(n)&&(t.material.isShaderMaterial?t.material.uniforms.alpha.value=n:t.material.opacity=n)}),UH(this,t2,!0)}),Uk(this,"hideBasemapBuildings",function(){UH(this,t$,!1),UF(this,t9).call(this)}),Uk(this,"showBasemapBuildings",function(){UH(this,t$,!0),UF(this,t9).call(this)}),Uk(this,"captureScreenshot",function(){console.warn("PCMap: captureScreenshot not implemented")}),Uk(this,"dispose",function(){if(UF(this,t3))return;UH(this,t3,!0);let e=UF(this,tz);UF(this,tV).disconnect(),UF(this,t1).forEach(({type:t,handler:n,useCapture:r})=>{e.removeEventListener(t,n,r)}),UF(this,tK).traverse(e=>{e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()}),UF(this,tX).renderLists.dispose(),UF(this,tX).dispose(),UH(this,tK,null),UH(this,tJ,null),UH(this,tX,null),UH(this,t0,null),UF(this,tZ).remove(),UH(this,tZ,null),UH(this,tY,null)}),Uz(this,tP,{}),Uz(this,tI,void 0),Uz(this,tO,void 0),Uz(this,tL,!1),Uz(this,tD,void 0),Uz(this,tN,!1),Uz(this,tU,void 0),Uz(this,tk,!1),Uz(this,tB,void 0),Uz(this,tF,!1),Uz(this,tz,void 0),Uz(this,tH,void 0),Uz(this,tj,void 0),Uz(this,tW,void 0),Uz(this,tG,void 0),Uz(this,tV,void 0),Uz(this,tX,void 0),Uz(this,tq,void 0),Uz(this,tY,void 0),Uz(this,tZ,void 0),Uz(this,t$,!0),Uz(this,tK,void 0),Uz(this,tJ,void 0),Uz(this,tQ,void 0),Uz(this,t0,void 0),Uz(this,t1,[]),Uz(this,t2,!1),Uz(this,t3,!1),Uz(this,t5,function(){var e;let t=UF(this,tY),n=UF(this,tz),r=UF(this,tP),i=new window.mapsindoors.mapView.MapboxV3View(UN({element:n,accessToken:r.basemap.accessToken,center:[...r.center].reverse(),zoom:Uj(r.zoom),minZoom:Uj(r.minZoom),maxZoom:Uj(r.maxZoom),pitch:r.tilt,minPitch:r.minTilt,maxPitch:r.maxTilt,bearing:r.rotation,antialias:!0,interactive:!0,showMapMarkers:!1,mapsIndoorsTransitionLevel:1},null!=(e=r.basemap.initialSettings)?e:{})),a=new window.mapsindoors.MapsIndoors({mapView:i,floor:r.ordinal,floorSelectionMode:"manual",buildingSelectionMode:"manual"}),o=i.getMap();o.mapsIndoors=a,a.addListener("ready",()=>{let e=a.getSolutionConfig(),{hover:t,highlight:n,selection:i,hoverHighlight:s,hoverSelection:l}=e.stateDisplayRules;t.polygonLightnessFactor=0,t.extrusionLightnessFactor=0,t.iconScale=1,n.polygonLightnessFactor=0,n.extrusionLightnessFactor=0,n.badgeVisible=!1,n.zoomFrom=0,n.labelZoomFrom=0,n.iconScale=1,s.polygonLightnessFactor=0,s.extrusionLightnessFactor=0,s.badgeVisible=!1,s.iconScale=1,i.polygonLightnessFactor=0,i.extrusionLightnessFactor=0,i.icon=null,i.iconSize=null,i.iconPlacement=null,i.labelStyleTextSize=null,i.labelVisible=!0,l.polygonLightnessFactor=0,l.extrusionLightnessFactor=0,l.icon=null,l.iconSize=null,l.iconPlacement=null,l.labelVisible=!0,l.labelZoomFrom=0,a.setSolutionConfig(e),o.setZoom(Uj(r.zoom)),o.setMinZoom(Uj(r.minZoom)),o.setMaxZoom(Uj(r.maxZoom))});let s=vA(()=>{o.off("render",s),UG.size>0?Promise.allSettled(Array.from(UG)).then(()=>{o.on("render",s)}):this.dispatchEvent({type:"ready"})},300,{leading:!1,trailing:!0});o.on("render",s),r.minRotation===r.maxRotation&&(o.keyboard.disableRotation(),o.touchZoomRotate.disableRotation(),o.dragRotate.disable());let l=o.getCanvas(),u=l.getContext("webgl2"),c=o.getCanvasContainer(),h=[...r.center].reverse(),d=t.MercatorCoordinate.fromLngLat(h,0),p=d.x,f=d.y,m=d.z,g=d.meterInMercatorCoordinateUnits(),v=new ij().makeScale(g,-g,g),y=new ij().makeRotationX(Math.PI/2),b=new ij().multiplyMatrices(v,y).setPosition(p,f,m);o.on("load",()=>{UF(this,t4).call(this),o.addLayer({id:"pcmap",type:"custom",slot:"middle",renderingMode:"3d",onAdd:()=>{o.moveLayer("pcmap","MI_WALLS_LAYER")},render:(e,t)=>{var n;if(!UF(this,tX))return;UF(this,t0)&&UF(this,t0).begin();let r=UF(this,tJ),i=o.transform,a=i.worldSize,s=i.pixelsPerMeter;r.matrixWorldInverse.fromArray(i.getWorldToCameraMatrix()),r.matrixWorld.copy(r.matrixWorldInverse).invert(),v.makeScale(1/a,1/a,s/a),r.projectionMatrix.fromArray(t).multiply(v).multiply(r.matrixWorld),v.makeScale(a,a,a/s),r.matrixWorldInverse.multiply(v).multiply(b),r.matrixWorld.copy(r.matrixWorldInverse).invert(),r.matrixWorld.decompose(r.position,r.quaternion,r.scale),UF(this,t7).call(this),UF(this,tX).resetState(),UF(this,tX).render(U
1225F(this,tK),UF(this,tJ)),null==(n=UF(this,tq))||n.render(UF(this,tK),UF(this,tJ)),UF(this,t0)&&UF(this,t0).end()}})}),o.on("style.load",()=>{UF(this,t9).call(this)}),o.on("resize",()=>{UF(this,t4).call(this)}).on("zoomstart",e=>{let{zoom:t}=e.target.transform;UH(this,tD,UW(t)),this.dispatchEvent({type:"zoomChangeBegin",zoom:UF(this,tD),user:!e.api})}).on("zoomend",e=>{let{zoom:t}=e.target.transform;UH(this,tD,UW(t)),this.dispatchEvent({type:"zoomChangeEnd",zoom:UF(this,tD),user:!e.api})}).on("zoom",e=>{let{zoom:t}=e.target.transform;UH(this,tD,UW(t)),this.dispatchEvent({type:"zoomChangeSequence",zoom:UF(this,tD),user:!e.api})}).on("rotate",e=>{let{bearing:t}=e.target.transform;UH(this,tU,t),this.dispatchEvent({type:"rotationChangeSequence",rotation:UF(this,tU),user:!e.api})}).on("pitch",e=>{let{pitch:t}=e.target.transform;UH(this,tB,t),this.dispatchEvent({type:"tiltChangeSequence",tilt:UF(this,tB),user:!e.api})}).on("move",e=>{let{center:t}=e.target.transform;UH(this,tO,UF(this,tI).project([t.lat,t.lng])),this.dispatchEvent({type:"centerChange",center:[t.lat,t.lng],user:!e.api})}).on("click",e=>{let t=UF(this,tK),n=UF(this,tJ),i=UF(this,tQ),a=UF(this,tH),o=UF(this,tj),s=e.lngLat,l=e.originalEvent,u=Math.max((e=l.changedTouches?l.changedTouches[0]:l).clientX-UF(this,tW),0),c=Math.max(e.clientY-UF(this,tG),0),h={type:"click",originalEvent:l,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,x:u,y:c,latitude:s.lat,longitude:s.lng},d=new rY(u/a*2-1,-(c/o*2)+1);i.setFromCamera(d,n);let p=i.intersectObjects(t.children,!0),f=p.find(({object:{userData:e}})=>e&&"unit"===e.type&&"floor"===e.part);f&&(h.unit={id:f.object.userData.id,category:f.object.userData.category}),this.dispatchEvent(h),r.debug&&console.log(p.map(e=>e.object.userData))});let x=new lk,_=new os;_.matrixAutoUpdate=!1,_.matrixWorldAutoUpdate=!1;let w=new c4,M=new lU({canvas:l,context:u,antialias:!0});if(M.outputColorSpace=rI,M.toneMapping=1,M.toneMappingExposure=1,M.autoClear=!1,"internal"===r.markersProvider){let e=new wm;e.domElement.style.position="absolute",e.domElement.style.top=0,e.domElement.style.zIndex=0,e.domElement.style.fontSize="16px",c.appendChild(e.domElement),UH(this,tq,e)}let E=new wp(vA(()=>{o.resize()},100));E.observe(n),UH(this,tV,E),UH(this,tX,M),UH(this,tZ,o),UH(this,tK,x),UH(this,tJ,_),UH(this,tQ,w)}),Uz(this,t4,function(){var e;let t=UF(this,tZ).getCanvas(),n=t.clientWidth,r=t.clientHeight,i=t.getBoundingClientRect(),a=i.left,o=i.top;null==(e=UF(this,tq))||e.setSize(n,r),UH(this,tH,n),UH(this,tj,r),UH(this,tW,a),UH(this,tG,o),UH(this,t2,!0)}),Uz(this,t6,function(e){e&&e.filter(Boolean).forEach(e=>{e.threeObject.renderOrder=1,UF(this,tK).add(e.threeObject)})}),Uz(this,t8,function(e,t){let n=t-1;return e<=n?1:t<=e?0:1-(e-n)/1}),Uz(this,t7,function(){let e=UF(this,tD);UF(this,tK).traverse(t=>{var n,r;if(!t||!t.userData||!t.material)return;let i=null!=(n=t.userData.minZoom)?n:0,a=null!=(r=t.userData.maxZoom)?r:1e3;if(i<=0&&a>=1e3)return;let o=e<=i?1-UF(this,t8).call(this,e,i):e<=a?UF(this,t8).call(this,e,a):a<e?0:null;Number.isFinite(o)&&(t.material.isShaderMaterial?t.material.uniforms.alpha.value=o:t.material.opacity=o)})}),Uz(this,t9,function(){var e,t,n,r,i,a,o;let s=UF(this,tP),l=UF(this,tZ),u=UF(this,t$),c=null==(e=s.basemap)?void 0:e.customStyle,h=l.getStyle();"function"==typeof(null==(t=s.basemap)?void 0:t.prepareStyle)&&s.basemap.prepareStyle(h);let d=null==(a=null==(i=null==(r=null==(n=h.imports)?void 0:n[0])?void 0:r.data)?void 0:i.layers)?void 0:a.find(e=>"building-models"===e.id);if(!d)return void l.setStyle(h);d.paint["model-opacity"]=["interpolate",["linear"],["zoom"],...u?null!=(o=null==c?void 0:c.opacity)?o:[14.2,0,14.5,1]:[14.2,0,14.5,0]],(null==c?void 0:c.minZoom)&&(d.minzoom=c.minZoom),(null==c?void 0:c.scale)&&(d.paint["model-scale"]=["interpolate",["linear"],["zoom"],...c.scale]);let p=d.paint["model-color"];if(null==c?void 0:c.roofColor){let e=p.findIndex(e=>"roof"===e);p[e+1]=c.roofColor}if(null==c?void 0:c.wallColor){let e=p.findIndex(e=>"wall"===e);p[e+1]=c.wallColor}if(null==c?void 0:c.windowColor){let e=p.findIndex(e=>"window"===e);p[e+1]=c.windowColor}l.setStyle(h)}),Uz(this,ne,function(){UF(this,tZ).triggerRepaint()}),UH(this,tP,{basemap:i,markersProvider:a,ordinal:o,center:s,minZoom:l,maxZoom:u,zoom:c,zoomSpeed:h,minRotation:d,maxRotation:p,rotation:f,rotationSpeed:m,minTilt:g,maxTilt:v,tilt:y,maxBounds:b,damping:x,dampingFactor:_,debug:w}),UH(this,tI,t),UH(this,tO,t.project(s)),UH(this,tD,c),UH(this,tU,f),UH(this,tB,y),UH(this,tz,"string"==typeof e?document.querySelector(e):e),!window.mapsindoors)throw Error("The MapsIndoors SDK cannot be found.");n.e(602).then(n.t.bind(n,11324,23)).then(e=>{window.mapboxgl=e.default,UH(this,tY,e.default),UF(this,t5).call(this),UF(this,t6).call(this,r);let t=()=>{UF(this,t2)&&(UF(this,ne).call(this),UH(this,t2,!1)),requestAnimationFrame(t)};t()})}set followMouseOnZoom(e){console.warn("PCMap: followMouseOnZoom() not implemented",e)}set rotationDisabled(e){e?(UF(this,tZ).keyboard.disableRotation(),UF(this,tZ).touchZoomRotate.disableRotation(),UF(this,tZ).dragRotate.disable()):(UF(this,tZ).keyboard.enableRotation(),UF(this,tZ).touchZoomRotate.enableRotation(),UF(this,tZ).dragRotate.enable())}set panningDisabled(e){e?UF(this,tZ).dragPan.disable():UF(this,tZ).dragPan.enable()}get basemap(){return UF(this,tZ)}get container(){return UF(this,tz)}get center(){return UF(this,tI).unproject(UF(this,tO))}get zoom(){return UF(this,tD)}get rotation(){return UF(this,tU)}get tilt(){return UF(this,tB)}get width(){return UF(this,tH)}get height(){return UF(this,tj)}get offsetLeft(){return UF(this,tW)}get offsetTop(){return UF(this,tG)}get type(){return"MapsIndoorsEngine"}}tP=new WeakMap,tI=new WeakMap,tO=new WeakMap,tL=new WeakMap,tD=new WeakMap,tN=new WeakMap,tU=new WeakMap,tk=new WeakMap,tB=new WeakMap,tF=new WeakMap,tz=new WeakMap,tH=new WeakMap,tj=new WeakMap,tW=new WeakMap,tG=new WeakMap,tV=new WeakMap,tX=new WeakMap,tq=new WeakMap,tY=new WeakMap,tZ=new WeakMap,t$=new WeakMap,tK=new WeakMap,tJ=new WeakMap,tQ=new WeakMap,t0=new WeakMap,t1=new WeakMap,t2=new WeakMap,t3=new WeakMap,t5=new WeakMap,t4=new WeakMap,t6=new WeakMap,t8=new WeakMap,t7=new WeakMap,t9=new WeakMap,ne=new WeakMap;var Uq=Object.freeze({__proto__:null,default:UX}),UY=Object.defineProperty,UZ=(e,t,n)=>(((e,t,n)=>t in e?UY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}
1225):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),n),U$=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},UK=(e,t,n)=>(U$(e,t,"read from private field"),n?n.call(e):t.get(e)),UJ=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},UQ=(e,t,n,r)=>(U$(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);let U0=2*Math.PI*6371008.8,U1=Math.PI/360,U2=360/Math.PI,U3=Math.PI/4,U5=180/Math.PI;class U4{constructor({origin:e}){UJ(this,nt,void 0),UJ(this,nn,void 0),UZ(this,"projectToOrigin",function([e,t]){let n=UK(this,nt),r=this.project([e,t]);return r[0]-=n[0],r[1]-=n[1],r}),UZ(this,"unprojectFromOrigin",function([e,t]){let n=UK(this,nt);return this.unproject([e+n[0],t+n[1]])}),UZ(this,"originToWorld",function([e,t]){let n=UK(this,nt);return[e+n[0],t+n[1]]}),UZ(this,"project",function([e,t]){if(!Number.isFinite(e)&&!Number.isFinite(t))return[e,t];let n=UK(this,nn);return[(180+t)/360/n,(180-U5*Math.log(Math.tan(U3+e*U1)))/360/n]}),UZ(this,"unproject",function([e,t]){let n=UK(this,nn);return[U2*Math.atan(Math.exp((1-t*n*2)*Math.PI))-90,e*n*360-180]});let[t,n]=e;UQ(this,nn,1/U0*(1/Math.cos(t*Math.PI/180))),UQ(this,nt,this.project(e))}get origin(){return UK(this,nt)}}nt=new WeakMap,nn=new WeakMap;var U6=Object.freeze({__proto__:null,default:U4}),U8=Object.defineProperty,U7=Object.defineProperties,U9=Object.getOwnPropertyDescriptors,ke=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,kr=(e,t,n)=>t in e?U8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ki=(e,t)=>{for(var n in t||(t={}))kt.call(t,n)&&kr(e,n,t[n]);if(ke)for(var n of ke(t))kn.call(t,n)&&kr(e,n,t[n]);return e},ka=(e,t)=>U7(e,U9(t)),ko=(e,t,n)=>(kr(e,"symbol"!=typeof t?t+"":t,n),n),ks=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},kl=(e,t,n)=>(ks(e,t,"read from private field"),n?n.call(e):t.get(e)),ku=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},kc=(e,t,n,r)=>(ks(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);let kh=e=>1.64*Math.pow(Math.sqrt(e),1.64),kd=e=>Math.round(1e3*Math.pow(Math.pow(e/1.64,.6097560975609756),2))/1e3;class kp extends rF{constructor(e,{mapProjection:t,mapGroups:r,basemap:i,backgroundColor:a,center:o=[0,0],minZoom:s=0,maxZoom:l=Number.MAX_SAFE_INTEGER,zoom:u=20,zoomSpeed:c=1,minRotation:h=-1/0,maxRotation:d=1/0,rotation:p=0,rotationSpeed:f=1,minTilt:m=0,maxTilt:g=45,tilt:v=0,maxBounds:y=[[-1/0,-1/0],[1/0,1/0]],damping:b=!1,dampingFactor:x=.25,debug:_=!1}={}){super(),ko(this,"refresh",function(){kc(this,nR,!0)}),ko(this,"addMapGroup",function(e){this.addMapGroups([e])}),ko(this,"addMapGroups",function(e){kl(this,nL).call(this,e),kc(this,nR,!0)}),ko(this,"removeMapGroup",function(e){this.removeMapGroups([e])}),ko(this,"removeMapGroups",function(e){e&&(e.forEach(e=>{kl(this,nE).remove(e.threeObject)}),kc(this,nR,!0))}),ko(this,"setZoom",function(e,t={}){let n=t.animate||!1,r=t.duration||1e3,i=t.onAnimationEnd,a=Math.min(Math.max(t.minZoom||kl(this,nr).minZoom,e),t.maxZoom||kl(this,nr).maxZoom);if(a===kl(this,ns)){n&&i&&i();return}kl(this,nw).once("zoomend",e=>e.api&&i&&i()),kl(this,nw).easeTo({zoom:kh(a),animate:n,duration:r},{api:!0})}),ko(this,"setZoomRange",function(e,t,n={}){kl(this,nr).minZoom=e,kl(this,nr).maxZoom=t;let r=kl(this,ns),i=Math.min(Math.max(e,r),t);if(i===r||!n.animate){kl(this,nw).setMinZoom(kh(e)),kl(this,nw).setMaxZoom(kh(t)),this.setZoom(i);return}this.setZoom(i,ka(ki({},n),{onAnimationEnd:()=>{kl(this,nw).setMinZoom(kh(e)),kl(this,nw).setMaxZoom(kh(t)),n.onAnimationEnd&&n.onAnimationEnd()}}))}),ko(this,"setRotation",function(e,t={}){let n=t.animate||!1,r=t.duration||1e3,i=t.onAnimationEnd,{minRotation:a,maxRotation:o}=kl(this,nr),s=Math.min(Math.max(a,e),o);if(s===kl(this,nu)){n&&i&&i();return}kl(this,nw).once("rotateend",e=>e.api&&i&&i()),kl(this,nw).easeTo({bearing:s,animate:n,duration:r},{api:!0})}),ko(this,"setRotationRange",function(e,t,n={}){kl(this,nr).minRotation=e,kl(this,nr).maxRotation=t;let r=kl(this,nu),i=Math.min(Math.max(e,r),t);if(e===t?(kl(this,nw).keyboard.disableRotation(),kl(this,nw).touchZoomRotate.disableRotation(),kl(this,nw).dragRotate.disable()):(kl(this,nw).keyboard.enableRotation(),kl(this,nw).touchZoomRotate.enableRotation(),kl(this,nw).dragRotate.enable()),i===r||!n.animate)return void this.setRotation(i);this.setRotation(i,ka(ki({},n),{onAnimationEnd:()=>{n.onAnimationEnd&&n.onAnimationEnd()}}))}),ko(this,"setTilt",function(e,t={}){let n=t.animate||!1,r=t.duration||1e3,i=t.onAnimationEnd,{minTilt:a,maxTilt:o}=kl(this,nr),s=Math.min(Math.max(a,e),o);
1225if(s===kl(this,nh)){n&&i&&i();return}kl(this,nw).once("pitchend",e=>e.api&&i&&i()),kl(this,nw).easeTo({pitch:s,animate:n,duration:r},{api:!0})}),ko(this,"setTiltRange",function(e,t,n={}){kl(this,nr).minTilt=e,kl(this,nr).maxTilt=t;let r=kl(this,nh),i=Math.min(Math.max(e,r),t);if(i===r||!n.animate){kl(this,nw).setMinPitch(e),kl(this,nw).setMaxPitch(t),this.setTilt(i);return}this.setTilt(i,ka(ki({},n),{onAnimationEnd:()=>{kl(this,nw).setMinPitch(e),kl(this,nw).setMaxPitch(t),n.onAnimationEnd&&n.onAnimationEnd()}}))}),ko(this,"setView",function(e,t={}){var n,r,i,a,o,s,l,u,c,h,d,p,f;let m=null!=(n=t.zoom)?n:kl(this,ns),g=null!=(r=t.rotation)?r:kl(this,nu),v=null!=(i=t.tilt)?i:kl(this,nh),y=null!=(a=t.animate)&&a,b=null!=(o=t.duration)?o:500;kl(this,nw).easeTo({center:[...e].reverse(),bearing:g,pitch:v,zoom:kh(m),animate:y,duration:b,padding:{top:null!=(l=null==(s=t.paddings)?void 0:s.paddingTop)?l:0,bottom:null!=(c=null==(u=t.paddings)?void 0:u.paddingBottom)?c:0,left:null!=(d=null==(h=t.paddings)?void 0:h.paddingLeft)?d:0,right:null!=(f=null==(p=t.paddings)?void 0:p.paddingRight)?f:0}},{api:!0})}),ko(this,"fitBounds",function(e,t={}){console.warn("PCMap: fitBounds() not implemented",e,t)}),ko(this,"fitPoints",function(e,t={}){let{padding:n=0,paddingTop:r=0,paddingBottom:i=0,paddingLeft:a=0,paddingRight:o=0,maxZoom:s}=t,l=n||r,u=n||i,c=n||a,h=n||o,d=new(kl(this,n_)).LngLatBounds;e.forEach(e=>d.extend([...e].reverse())),kl(this,nw).setPadding({top:l,bottom:u,left:c,right:h}).fitBounds(d,{bearing:kl(this,nu),pitch:kl(this,nh),linear:!0,maxZoom:kh(s)},{api:!0})}),ko(this,"findIntersections",function(e,t,n){let r=kl(this,nE),i=kl(this,nT);return i.set(e,t),n=n||r.children,i.intersectObjects(n)}),ko(this,"getMapObjects",function(e){let t=kl(this,nE),n=[];return t.traverse(t=>{e(t)&&n.push(t)}),n}),ko(this,"filterMapObjects",function(e){kl(this,nE).traverse(t=>{t.visible=e(t.userData)}),kc(this,nR,!0)}),ko(this,"dimMapObjects",function(e){kl(this,nE).traverse(t=>{if(!t||!t.userData||!t.material)return;let n=e(t.userData);Number.isFinite(n)&&(t.material.isShaderMaterial?t.material.uniforms.alpha.value=n:t.material.opacity=n)}),kc(this,nR,!0)}),ko(this,"hideBasemapBuildings",function(){kc(this,nM,!1),kl(this,nU).call(this)}),ko(this,"showBasemapBuildings",function(){kc(this,nM,!0),kl(this,nU).call(this)}),ko(this,"captureScreenshot",function(){console.warn("PCMap: captureScreenshot not implemented")}),ko(this,"dispose",function(){if(kl(this,nP))return;kc(this,nP,!0);let e=kl(this,np);kl(this,ny).disconnect(),kl(this,nC).forEach(({type:t,handler:n,useCapture:r})=>{e.removeEventListener(t,n,r)}),kl(this,nE).traverse(e=>{e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()}),kl(this,nb).renderLists.dispose(),kl(this,nb).dispose(),kc(this,nE,null),kc(this,nS,null),kc(this,nb,null),kc(this,nA,null),kl(this,nw).remove(),kc(this,nw,null),kc(this,n_,null)}),ku(this,nr,{}),ku(this,ni,void 0),ku(this,na,void 0),ku(this,no,!1),ku(this,ns,void 0),ku(this,nl,!1),ku(this,nu,void 0),ku(this,nc,!1),ku(this,nh,void 0),ku(this,nd,!1),ku(this,np,void 0),ku(this,nf,void 0),ku(this,nm,void 0),ku(this,ng,void 0),ku(this,nv,void 0),ku(this,ny,void 0),ku(this,nb,void 0),ku(this,nx,void 0),ku(this,n_,void 0),ku(this,nw,void 0),ku(this,nM,!0),ku(this,nE,void 0),ku(this,nS,void 0),ku(this,nT,void 0),ku(this,nA,void 0),ku(this,nC,[]),ku(this,nR,!1),ku(this,nP,!1),ku(this,nI,function(){var e;let t=kl(this,n_),n=kl(this,np),r=kl(this,nr);t.accessToken=r.basemap.accessToken;let i=new t.Map(ki({container:n,style:r.basemap.style,center:[...r.center].reverse(),maxBounds:[[...r.maxBounds[0]].reverse(),[...r.maxBounds[1]].reverse()],zoom:kh(r.zoom),minZoom:kh(r.minZoom),maxZoom:kh(r.maxZoom),pitch:r.tilt,minPitch:r.minTilt,maxPitch:r.maxTilt,bearing:r.rotation,antialias:!0,interactive:!0},null!=(e=r.basemap.initialSettings)?e:{}));r.minRotation===r.maxRotation&&(i.keyboard.disableRotation(),i.touchZoomRotate.disableRotation(),i.dragRotate.disable());let a=i.getCanvas(),o=a.getContext("webgl2"),s=i.getCanvasContainer(),l=[...r.center].reverse(),u=t.MercatorCoordinate.fromLngLat(l,0),c=u.x,h=u.y,d=u.z,p=u.meterInMercatorCoordinateUnits(),f=new ij().makeScale(p,-p,p),m=new ij().makeRotationX(Math.PI/2),g=new ij().multiplyMatrices(f,m).setPosition(c,h,d);i.on("load",()=>{kl(this,nO).call(this),i.addLayer({id:"pcmap",type:"custom",renderingMode:"3d",render:(e,t)=>{if(!kl(this,nb))return;kl(this,nA)&&kl(this,nA).begin();let n=kl(this,nS),r=i.transform,a=r.worldSize,o=r.pixelsPerMeter;n.matrixWorldInverse.fromArray(r.getWorldToCameraMatrix()),n.matrixWorld.copy(n.matrixWorldInverse).invert(),f.makeScale(1/a,1/a,o/a),n.projectionMatrix.fromArray(t).multiply(f).multiply(n.matrixWorld),f.makeScale(a,a,a/o),n.matrixWorldInverse.multiply(f).multiply(g),n.matrixWorld.copy(n.matrixWorldInverse).invert(),n.matrixWorld.decompose(n.position,n.quaternion,n.scale),kl(this,nN).call(this),kl(this,nb).resetState(),kl(this,nb).render(kl(this,nE),kl(this,nS)),kl(this,nx).render(kl(this,nE),kl(this,nS)),kl(this,nA)&&kl(this,nA).end()}}),this.dispatchEvent({type:"ready"})}),i.on("style.load",()=>{kl(this,nU).call(this)}),i.on("resize",()=>{kl(this,nO).call(this)}).on("zoomstart",e=>{let{zoom:t}=e.target.transform;kc(this,ns,kd(t)),this.dispatchEvent({type:"zoomChangeBegin",zoom:kl(this,ns),user:!e.api})}).on("zoomend",e=>{let{zoom:t}=e.target.transform;kc(this,ns,kd(t)),this.dispatchEvent({type:"zoomChangeEnd",zoom:kl(this,ns),user:!e.api})}).on("zoom",e=>{let{zoom:t}=e.target.transform;kc(this,ns,kd(t)),this.dispatchEvent({type:"zoomChangeSequence",zoom:kl(this,ns),user:!e.api})}).on("rotate",e=>{let{bearing:t}=e.target.transform;kc(this,nu,t),this.dispatchEvent({type:"rotationChangeSequence",rotation:kl(this,nu),user:!e.api})}).on("pitch",e=>{let{pitch:t}=e.target.transform;kc(this,nh,t),this.dispatchEvent({type:"tiltChangeSequence",tilt:kl(this,nh),user:!e.api})}).on("move",e=>{let{center:t}=e.target.transform;kc(this,na,kl(this,ni).project([t.lat,t.lng])),this.dispatchEvent({type:"centerChange",center:[t.lat,t.lng],user:!e.api})}).on("click",e=>{let t=kl(this,nE),n=kl(this,nS),i=kl(this,nT),a=kl(this,nf),o=kl(this,nm),s=e.lngLat,l=e.originalEvent,u=Math.max((e=l.changedTouches?l.changedTouches[0]:l).clientX-kl(this,ng),0),c=Math.max(e.clientY-kl(this,nv),0),h={type:"click",originalEvent:l,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,x:u,y:c,latitude:s.lat,longitude:s.lng},d=new rY(u/a*2-1,-(c/o*2)+1);i.setFromCamera(d,n);let p=i.intersectObjects(t.children,!0),f=p.find(({object:{userData:e}})=>e&&"unit"===e.type&&"floor"===e.part);f&&(h.unit={id:f.object.userData.id,category:f.object.userData.category}),this.dispatchEvent(h),r.debug&&console.log(p.map(e=>e.object.userData))});let v=new lk,y=new os;y.matrixAutoUpdate=!1,y.matrixWorldAutoUpdate=!1;let b=new c4,x=new lU({canvas:a,context:o,antialias:!0});
1225x.outputColorSpace=rI,x.toneMapping=1,x.toneMappingExposure=1,x.autoClear=!1;let _=new wm;_.domElement.style.position="absolute",_.domElement.style.top=0,_.domElement.style.zIndex=0,_.domElement.style.fontSize="16px",s.appendChild(_.domElement);let w=new wp(vA(()=>{i.resize()},100));w.observe(n),kc(this,ny,w),kc(this,nb,x),kc(this,nx,_),kc(this,nw,i),kc(this,nE,v),kc(this,nS,y),kc(this,nT,b)}),ku(this,nO,function(){let e=kl(this,nw).getCanvas(),t=e.clientWidth,n=e.clientHeight,r=e.getBoundingClientRect(),i=r.left,a=r.top;kl(this,nx).setSize(t,n),kc(this,nf,t),kc(this,nm,n),kc(this,ng,i),kc(this,nv,a),kc(this,nR,!0)}),ku(this,nL,function(e){e&&e.filter(Boolean).forEach(e=>{e.threeObject.renderOrder=1,kl(this,nE).add(e.threeObject)})}),ku(this,nD,function(e,t){let n=t-1;return e<=n?1:t<=e?0:1-(e-n)/1}),ku(this,nN,function(){let e=kl(this,ns);kl(this,nE).traverse(t=>{var n,r;if(!t||!t.userData||!t.material)return;let i=null!=(n=t.userData.minZoom)?n:0,a=null!=(r=t.userData.maxZoom)?r:1e3;if(i<=0&&a>=1e3)return;let o=e<=i?1-kl(this,nD).call(this,e,i):e<=a?kl(this,nD).call(this,e,a):a<e?0:null;Number.isFinite(o)&&(t.material.isShaderMaterial?t.material.uniforms.alpha.value=o:t.material.opacity=o)})}),ku(this,nU,function(){var e,t,n,r,i,a,o;let s=kl(this,nr),l=kl(this,nw),u=kl(this,nM),c=null==(e=s.basemap)?void 0:e.customStyle,h=l.getStyle();"function"==typeof(null==(t=s.basemap)?void 0:t.prepareStyle)&&s.basemap.prepareStyle(h);let d=null==(a=null==(i=null==(r=null==(n=h.imports)?void 0:n[0])?void 0:r.data)?void 0:i.layers)?void 0:a.find(e=>"building-models"===e.id);if(!d)return void l.setStyle(h);d.paint["model-opacity"]=["interpolate",["linear"],["zoom"],...u?null!=(o=null==c?void 0:c.opacity)?o:[14.2,0,14.5,1]:[14.2,0,14.5,0]],(null==c?void 0:c.minZoom)&&(d.minzoom=c.minZoom),(null==c?void 0:c.scale)&&(d.paint["model-scale"]=["interpolate",["linear"],["zoom"],...c.scale]);let p=d.paint["model-color"];if(null==c?void 0:c.roofColor){let e=p.findIndex(e=>"roof"===e);p[e+1]=c.roofColor}if(null==c?void 0:c.wallColor){let e=p.findIndex(e=>"wall"===e);p[e+1]=c.wallColor}if(null==c?void 0:c.windowColor){let e=p.findIndex(e=>"window"===e);p[e+1]=c.windowColor}l.setStyle(h)}),ku(this,nk,function(){kl(this,nw).triggerRepaint()}),kc(this,nr,{basemap:i,backgroundColor:a,center:o,minZoom:s,maxZoom:l,zoom:u,zoomSpeed:c,minRotation:h,maxRotation:d,rotation:p,rotationSpeed:f,minTilt:m,maxTilt:g,tilt:v,maxBounds:y,damping:b,dampingFactor:x,debug:_}),kc(this,ni,t),kc(this,na,t.project(o)),kc(this,ns,u),kc(this,nu,p),kc(this,nh,v),kc(this,np,"string"==typeof e?document.querySelector(e):e),n.e(602).then(n.t.bind(n,11324,23)).then(e=>{kc(this,n_,e.default),kl(this,nI).call(this),kl(this,nL).call(this,r);let t=()=>{kl(this,nR)&&(kl(this,nk).call(this),kc(this,nR,!1)),requestAnimationFrame(t)};t()})}set followMouseOnZoom(e){console.warn("PCMap: followMouseOnZoom() not implemented",e)}set rotationDisabled(e){e?(kl(this,nw).keyboard.disableRotation(),kl(this,nw).touchZoomRotate.disableRotation(),kl(this,nw).dragRotate.disable()):(kl(this,nw).keyboard.enableRotation(),kl(this,nw).touchZoomRotate.enableRotation(),kl(this,nw).dragRotate.enable())}set panningDisabled(e){e?kl(this,nw).dragPan.disable():kl(this,nw).dragPan.enable()}get basemap(){return kl(this,nw)}get container(){return kl(this,np)}get center(){return kl(this,ni).unproject(kl(this,na))}get zoom(){return kl(this,ns)}get rotation(){return kl(this,nu)}get tilt(){return kl(this,nh)}get width(){return kl(this,nf)}get height(){return kl(this,nm)}get offsetLeft(){return kl(this,ng)}get offsetTop(){return kl(this,nv)}get type(){return"MapboxEngine"}}nr=new WeakMap,ni=new WeakMap,na=new WeakMap,no=new WeakMap,ns=new WeakMap,nl=new WeakMap,nu=new WeakMap,nc=new WeakMap,nh=new WeakMap,nd=new WeakMap,np=new WeakMap,nf=new WeakMap,nm=new WeakMap,ng=new WeakMap,nv=new WeakMap,ny=new WeakMap,nb=new WeakMap,nx=new WeakMap,n_=new WeakMap,nw=new WeakMap,nM=new WeakMap,nE=new WeakMap,nS=new WeakMap,nT=new WeakMap,nA=new WeakMap,nC=new WeakMap,nR=new WeakMap,nP=new WeakMap,nI=new WeakMap,nO=new WeakMap,nL=new WeakMap,nD=new WeakMap,nN=new WeakMap,nU=new WeakMap,nk=new WeakMap;var kf=Object.freeze({__proto__:null,default:kp}),km={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},kg={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},kv=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],ky={CSS:{},springs:{}};function kb(e,t,n){return Math.min(Math.max(e,t),n)}function kx(e,t){return e.indexOf(t)>-1}function k_(e,t){return e.apply(null,t)}var kw={arr:function(e){return Array.isArray(e)},obj:function(e){return kx(Object.prototype.toString.call(e),"Object")},pth:function(e){return kw.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement}
1225,dom:function(e){return e.nodeType||kw.svg(e)},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return void 0===e},hex:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},rgb:function(e){return/^rgb/.test(e)},hsl:function(e){return/^hsl/.test(e)},col:function(e){return kw.hex(e)||kw.rgb(e)||kw.hsl(e)},key:function(e){return!km.hasOwnProperty(e)&&!kg.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function kM(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map(function(e){return parseFloat(e)}):[]}function kE(e,t){var n=kM(e),r=kb(kw.und(n[0])?1:n[0],.1,100),i=kb(kw.und(n[1])?100:n[1],.1,100),a=kb(kw.und(n[2])?10:n[2],.1,100),o=kb(kw.und(n[3])?0:n[3],.1,100),s=Math.sqrt(i/r),l=a/(2*Math.sqrt(i*r)),u=l<1?s*Math.sqrt(1-l*l):0,c=l<1?(l*s+-o)/u:-o+s;function h(e){var n=t?t*e/1e3:e;return(n=l<1?Math.exp(-n*l*s)*(+Math.cos(u*n)+c*Math.sin(u*n)):(1+c*n)*Math.exp(-n*s),0===e||1===e)?e:1-n}return t?h:function(){var t=ky.springs[e];if(t)return t;for(var n=1/6,r=0,i=0;;)if(1===h(r+=n)){if(++i>=16)break}else i=0;var a=r*n*1e3;return ky.springs[e]=a,a}}function kS(e){return void 0===e&&(e=10),function(t){return Math.ceil(kb(t,1e-6,1)*e)*(1/e)}}var kT=function(){function e(e,t,n){return(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e}function t(e,t,n){return 3*(1-3*n+3*t)*e*e+2*(3*n-6*t)*e+3*t}return function(n,r,i,a){if(0<=n&&n<=1&&0<=i&&i<=1){var o=new Float32Array(11);if(n!==r||i!==a)for(var s=0;s<11;++s)o[s]=e(.1*s,n,i);return function(s){return n===r&&i===a||0===s||1===s?s:e(function(r){for(var a=0,s=1;10!==s&&o[s]<=r;++s)a+=.1;var l=a+(r-o[--s])/(o[s+1]-o[s])*.1,u=t(l,n,i);if(u>=.001){for(var c=l,h=0;h<4;++h){var d=t(c,n,i);if(0===d)break;var p=e(c,n,i)-r;c-=p/d}return c}return 0===u?l:function(t,n,r,i,a){var o,s,l=0;do(o=e(s=n+(r-n)/2,i,a)-t)>0?r=s:n=s;while(Math.abs(o)>1e-7&&++l<10);return s}(r,a,a+.1,n,i)}(s),r,a)}}}}(),kA=function(){var e={linear:function(){return function(e){return e}}},t={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},Circ:function(){return function(e){return 1-Math.sqrt(1-e*e)}},Back:function(){return function(e){return e*e*(3*e-2)}},Bounce:function(){return function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}},Elastic:function(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var n=kb(e,1,10),r=kb(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin(2*Math.PI*(e-1-r/(2*Math.PI)*Math.asin(1/n))/r)}}};return["Quad","Cubic","Quart","Quint","Expo"].forEach(function(e,n){t[e]=function(){return function(e){return Math.pow(e,n+2)}}}),Object.keys(t).forEach(function(n){var r=t[n];e["easeIn"+n]=r,e["easeOut"+n]=function(e,t){return function(n){return 1-r(e,t)(1-n)}},e["easeInOut"+n]=function(e,t){return function(n){return n<.5?r(e,t)(2*n)/2:1-r(e,t)(-2*n+2)/2}}}),e}();function kC(e,t){if(kw.fnc(e))return e;var n=e.split("(")[0],r=kA[n],i=kM(e);switch(n){case"spring":return kE(e,t);case"cubicBezier":return k_(kT,i);case"steps":return k_(kS,i);default:return k_(r,i)}}function kR(e){try{return document.querySelectorAll(e)}catch(e){return}}function kP(e,t){for(var n=e.length,r=arguments.length>=2?arguments[1]:void 0,i=[],a=0;a<n;a++)if(a in e){var o=e[a];t.call(r,o,a,e)&&i.push(o)}return i}function kI(e){return e.reduce(function(e,t){return e.concat(kw.arr(t)?kI(t):t)},[])}function kO(e){return kw.arr(e)?e:(kw.str(e)&&(e=kR(e)||e),e instanceof NodeList||e instanceof HTMLCollection)?[].slice.call(e):[e]}function kL(e,t){return e.some(function(e){return e===t})}function kD(e){var t={};for(var n in e)t[n]=e[n];return t}function kN(e,t){var n=kD(e);for(var r in e)n[r]=t.hasOwnProperty(r)?t[r]:e[r];return n}function kU(e,t){var n=kD(e);for(var r in t)n[r]=kw.und(e[r])?t[r]:e[r];return n}function kk(e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(e);if(t)return t[1]}function kB(e,t){return kw.fnc(e)?e(t.target,t.id,t.total):e}function kF(e,t){return e.getAttribute(t)}function kz(e,t,n){if(kL([n,"deg","rad","turn"],kk(t)))return t;var r=ky.CSS[t+n];if(!kw.und(r))return r;var i=document.createElement(e.tagName),a=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;a.appendChild(i),i.style.position="absolute",i.style.width=100+n;var o=100/i.offsetWidth;a.removeChild(i);var s=o*parseFloat(t);return ky.CSS[t+n]=s,s}
1225function kH(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?kz(e,i,n):i}}function kj(e,t){return kw.dom(e)&&!kw.inp(e)&&(kF(e,t)||kw.svg(e)&&e[t])?"attribute":kw.dom(e)&&kL(kv,t)?"transform":kw.dom(e)&&"transform"!==t&&kH(e,t)?"css":null!=e[t]?"object":void 0}function kW(e){if(kw.dom(e)){for(var t,n=e.style.transform||"",r=/(\w+)\(([^)]*)\)/g,i=new Map;t=r.exec(n);)i.set(t[1],t[2]);return i}}function kG(e,t,n,r){switch(kj(e,t)){case"transform":var i,a;return i=kx(t,"scale")?1:0+(kx(t,"translate")||"perspective"===t?"px":kx(t,"rotate")||kx(t,"skew")?"deg":void 0),a=kW(e).get(t)||i,r&&(r.transforms.list.set(t,a),r.transforms.last=t),n?kz(e,a,n):a;case"css":return kH(e,t,n);case"attribute":return kF(e,t);default:return e[t]||0}}function kV(e,t){var n=/^(\*=|\+=|-=)/.exec(e);if(!n)return e;var r=kk(e)||0,i=parseFloat(t),a=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return i+a+r;case"-":return i-a+r;case"*":return i*a+r}}function kX(e,t){if(kw.col(e)){var n,r,i;return kw.rgb(e)?(n=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(e))?"rgba("+n[1]+",1)":e:kw.hex(e)?(r=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,r){return t+t+n+n+r+r}),"rgba("+parseInt((i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r))[1],16)+","+parseInt(i[2],16)+","+parseInt(i[3],16)+",1)"):kw.hsl(e)?function(e){var t,n,r,i=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(e),a=parseInt(i[1],10)/360,o=parseInt(i[2],10)/100,s=parseInt(i[3],10)/100,l=i[4]||1;function u(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0==o)t=n=r=s;else{var c=s<.5?s*(1+o):s+o-s*o,h=2*s-c;t=u(h,c,a+1/3),n=u(h,c,a),r=u(h,c,a-1/3)}return"rgba("+255*t+","+255*n+","+255*r+","+l+")"}(e):void 0}if(/\s/g.test(e))return e;var a=kk(e),o=a?e.substr(0,e.length-a.length):e;return t?o+t:o}function kq(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function kY(e){for(var t,n=e.points,r=0,i=0;i<n.numberOfItems;i++){var a=n.getItem(i);i>0&&(r+=kq(t,a)),t=a}return r}function kZ(e){var t;if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return 2*Math.PI*kF(e,"r");case"rect":return 2*kF(e,"width")+2*kF(e,"height");case"line":return kq({x:kF(e,"x1"),y:kF(e,"y1")},{x:kF(e,"x2"),y:kF(e,"y2")});case"polyline":return kY(e);case"polygon":return t=e.points,kY(e)+kq(t.getItem(t.numberOfItems-1),t.getItem(0))}}function k$(e,t){var n=t||{},r=n.el||function(e){for(var t=e.parentNode;kw.svg(t)&&kw.svg(t.parentNode);)t=t.parentNode;return t}(e),i=r.getBoundingClientRect(),a=kF(r,"viewBox"),o=i.width,s=i.height,l=n.viewBox||(a?a.split(" "):[0,0,o,s]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:o/l[2],h:s/l[3]}}function kK(e,t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=kX(kw.pth(e)?e.totalLength:e,t)+"";return{original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:kw.str(e)||t?r.split(n):[]}}function kJ(e){return kP(e?kI(kw.arr(e)?e.map(kO):kO(e)):[],function(e,t,n){return n.indexOf(e)===t})}function kQ(e){var t=kJ(e);return t.map(function(e,n){return{target:e,id:n,total:t.length,transforms:{list:kW(e)}}})}var k0={css:function(e,t,n){return e.style[t]=n},attribute:function(e,t,n){return e.setAttribute(t,n)},object:function(e,t,n){return e[t]=n},transform:function(e,t,n,r,i){if(r.list.set(t,n),t===r.last||i){var a="";r.list.forEach(function(e,t){a+=t+"("+e+") "}),e.style.transform=a}}};function k1(e,t){kQ(e).forEach(function(e){for(var n in t){var r=kB(t[n],e),i=e.target,a=kk(r),o=kG(i,n,a,e),s=kV(kX(r,a||kk(o)),o);k0[kj(i,n)](i,n,s,e.transforms,!0)}})}function k2(e,t){var n=e.length,r=function(e){return e.timelineOffset?e.timelineOffset:0},i={};return i.duration=n?Math.max.apply(Math,e.map(function(e){return r(e)+e.duration})):t.duration,i.delay=n?Math.min.apply(Math,e.map(function(e){return r(e)+e.delay})):t.delay,i.endDelay=n?i.duration-Math.max.apply(Math,e.map(function(e){return r(e)+e.duration-e.endDelay})):t.endDelay,i}var k3=0,k5=[],k4=[],k6=function(){function e(){nB=requestAnimationFrame(t)}function t(t){var n=k5.length;if(n){for(var r=0;r<n;){var i=k5[r];if(i.paused){var a=k5.indexOf(i);a>-1&&(k5.splice(a,1),n=k5.length)}else i.tick(t);r++}e()}else nB=cancelAnimationFrame(nB)}return e}();function k8(e){void 0===e&&(e={});var t,n,r,i,a,o,s,l,u,c,h=0,d=0,p=0,f=0,m=null;function g(e){var t=window.Promise&&new Promise(function(e){return m=e});return e.finished=t,t}var v=(n=kN(km,t=e),i=function(e,t){var n=[],r=t.keyframes;for(var i in r&&(t=kU(function(e){for(var t=kP(kI(e.map(function(e){return Object.keys(e)})),function(e){return kw.key(e)}).reduce(function(e,t){return 0>e.indexOf(t)&&e.push(t),e},[]),n={},r=0;r<t.length;r++)!function(r){var i=t[r];n[i]=e.map(function(e){var t={};for(var n in e)kw.key(n)?n==i&&(t.value=e[n]):t[n]=e[n];return t})}(r);return n}(r),t)),t)kw.key(i)&&n.push({name:i,tweens:function(e,t){var n=kD(t);if(/^spring/.test(n.easing)&&(n.duration=kE(n.easing)),kw.arr(e)){var r=e.length;2!==r||kw.obj(e[0])?kw.fnc(t.duration)||(n.duration=t.duration/r):e={value:e}}var i=kw.arr(e)?e:[e];return i.map(function(e,n){var r=kw.obj(e)&&!kw.pth(e)?e:{value:e};return kw.und(r.delay)&&(r.delay=n?0:t.delay),kw.und(r.endDelay)&&(r.endDelay=n===i.length-1?t.endDelay:0),r}).map(function(e){return kU(e,n)})}(t[i],e)});return n}(r=kN(kg,t),t),l=k2((o=a=kQ(t.targets),s=kP(kI(o.map(function(e){return i.map(function(t){return function(e,t){var n=kj(e.target,t.name);if(n){var r,i=t.tweens.map(function(n){var i=function(e,t){var n={};for(var r in e){var i=kB(e[r],t);
1225kw.arr(i)&&1===(i=i.map(function(e){return kB(e,t)})).length&&(i=i[0]),n[r]=i}return n.duration=parseFloat(n.duration),n.delay=parseFloat(n.delay),n}(n,e),a=i.value,o=kw.arr(a)?a[1]:a,s=kk(o),l=kG(e.target,t.name,s,e),u=r?r.to.original:l,c=kw.arr(a)?a[0]:u,h=kk(c)||kk(l),d=s||h;return kw.und(o)&&(o=u),i.from=kK(c,d),i.to=kK(kV(o,c),d),i.start=r?r.end:0,i.end=i.start+i.delay+i.duration+i.endDelay,i.easing=kC(i.easing,i.duration),i.isPath=kw.pth(a),i.isColor=kw.col(i.from.original),i.isColor&&(i.round=1),r=i,i}),a=i[i.length-1];return{type:n,property:t.name,animatable:e,tweens:i,duration:a.end,delay:i[0].delay,endDelay:a.endDelay}}}(e,t)})})),function(e){return!kw.und(e)})),r),u=k3,k3++,kU(n,{id:u,children:[],animatables:a,animations:s,duration:l.duration,delay:l.delay,endDelay:l.endDelay}));function y(){var e=v.direction;"alternate"!==e&&(v.direction="normal"!==e?"normal":"reverse"),v.reversed=!v.reversed,c.forEach(function(e){return e.reversed=v.reversed})}function b(e){return v.reversed?v.duration-e:e}function x(){h=0,d=b(v.currentTime)*(1/k8.speed)}function _(e,t){t&&t.seek(e-t.timelineOffset)}function w(e){for(var t=0,n=v.animations,r=n.length;t<r;){var i=n[t],a=i.animatable,o=i.tweens,s=o.length-1,l=o[s];s&&(l=kP(o,function(t){return e<t.end})[0]||l);for(var u=kb(e-l.start-l.delay,0,l.duration)/l.duration,c=isNaN(u)?1:l.easing(u),h=l.to.strings,d=l.round,p=[],f=l.to.numbers.length,m=void 0,g=0;g<f;g++){var y=void 0,b=l.to.numbers[g],x=l.from.numbers[g]||0;y=l.isPath?function(e,t){function n(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var r=k$(e.el,e.svg),i=n(),a=n(-1),o=n(1);switch(e.property){case"x":return(i.x-r.x)*r.w;case"y":return(i.y-r.y)*r.h;case"angle":return 180*Math.atan2(o.y-a.y,o.x-a.x)/Math.PI}}(l.value,c*b):x+c*(b-x),d&&!(l.isColor&&g>2)&&(y=Math.round(y*d)/d),p.push(y)}var _=h.length;if(_){m=h[0];for(var w=0;w<_;w++){h[w];var M=h[w+1],E=p[w];isNaN(E)||(M?m+=E+M:m+=E+" ")}}else m=p[0];k0[i.type](a.target,i.property,m,a.transforms),i.currentValue=m,t++}}function M(e){v[e]&&!v.passThrough&&v[e](v)}function E(e){var t=v.duration,n=v.delay,r=t-v.endDelay,i=b(e);v.progress=kb(i/t*100,0,100),v.reversePlayback=i<v.currentTime,c&&function(e){if(v.reversePlayback)for(var t=f;t--;)_(e,c[t]);else for(var n=0;n<f;n++)_(e,c[n])}(i),!v.began&&v.currentTime>0&&(v.began=!0,M("begin")),!v.loopBegan&&v.currentTime>0&&(v.loopBegan=!0,M("loopBegin")),i<=n&&0!==v.currentTime&&w(0),(i>=r&&v.currentTime!==t||!t)&&w(t),i>n&&i<r?(v.changeBegan||(v.changeBegan=!0,v.changeCompleted=!1,M("changeBegin")),M("change"),w(i)):v.changeBegan&&(v.changeCompleted=!0,v.changeBegan=!1,M("changeComplete")),v.currentTime=kb(i,0,t),v.began&&M("update"),e>=t&&(d=0,v.remaining&&!0!==v.remaining&&v.remaining--,v.remaining?(h=p,M("loopComplete"),v.loopBegan=!1,"alternate"===v.direction&&y()):(v.paused=!0,!v.completed&&(v.completed=!0,M("loopComplete"),M("complete"),!v.passThrough&&"Promise"in window&&(m(),g(v)))))}return g(v),v.reset=function(){var e=v.direction;v.passThrough=!1,v.currentTime=0,v.progress=0,v.paused=!0,v.began=!1,v.loopBegan=!1,v.changeBegan=!1,v.completed=!1,v.changeCompleted=!1,v.reversePlayback=!1,v.reversed="reverse"===e,v.remaining=v.loop,f=(c=v.children).length;for(var t=f;t--;)v.children[t].reset();(v.reversed&&!0!==v.loop||"alternate"===e&&1===v.loop)&&v.remaining++,w(v.reversed?v.duration:0)},v.set=function(e,t){return k1(e,t),v},v.tick=function(e){p=e,h||(h=p),E((p+(d-h))*k8.speed)},v.seek=function(e){E(b(e))},v.pause=function(){v.paused=!0,x()},v.play=function(){v.paused&&(v.completed&&v.reset(),v.paused=!1,k5.push(v),x(),nB||k6())},v.reverse=function(){y(),v.completed=!v.reversed,x()},v.restart=function(){v.reset(),v.play()},v.reset(),v.autoplay&&v.play(),v}function k7(e,t){for(var n=t.length;n--;)kL(e,t[n].animatable.target)&&t.splice(n,1)}"undefined"!=typeof document&&document.addEventListener("visibilitychange",function(){document.hidden?(k5.forEach(function(e){return e.pause()}),k4=k5.slice(0),k8.running=k5=[]):k4.forEach(function(e){return e.play()})}),k8.version="3.2.0",k8.speed=1,k8.running=k5,k8.remove=function(e){for(var t=kJ(e),n=k5.length;n--;){var r=k5[n],i=r.animations,a=r.children;k7(t,i);for(var o=a.length;o--;){var s=a[o],l=s.animations;k7(t,l),l.length||s.children.length||a.splice(o,1)}i.length||a.length||r.pause()}},k8.get=kG,k8.set=k1,k8.convertPx=kz,k8.path=function(e,t){var n=kw.str(e)?kR(e)[0]:e,r=t||100;return function(e){return{property:e,el:n,svg:k$(n),totalLength:kZ(n)*(r/100)}}},k8.setDashoffset=function(e){var t=kZ(e);return e.setAttribute("stroke-dasharray",t),t},k8.stagger=function(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?kC(t.easing):null,i=t.grid,a=t.axis,o=t.from||0,s="first"===o,l="center"===o,u="last"===o,c=kw.arr(e),h=c?parseFloat(e[0]):parseFloat(e),d=c?parseFloat(e[1]):0,p=kk(c?e[1]:e)||0,f=t.start||0+(c?h:0),m=[],g=0;return function(e,t,v){if(s&&(o=0),l&&(o=(v-1)/2),u&&(o=v-1),!m.length){for(var y=0;y<v;y++){if(i){var b=l?(i[0]-1)/2:o%i[0],x=l?(i[1]-1)/2:Math.floor(o/i[0]),_=y%i[0],w=Math.floor(y/i[0]),M=b-_,E=x-w,S=Math.sqrt(M*M+E*E);"x"===a&&(S=-M),"y"===a&&(S=-E),m.push(S)}else m.push(Math.abs(o-y));g=Math.max.apply(Math,m)}r&&(m=m.map(function(e){return r(e/g)*g})),"reverse"===n&&(m=m.map(function(e){return a?e<0?-1*e:-e:Math.abs(g-e)}))}return f+(c?(d-h)/g:h)*(Math.round(100*m[t])/100)+p}},k8.timeline=function(e){void 0===e&&(e={});var t=k8(e);return t.duration=0,t.add=function(n,r){var i=k5.indexOf(t),a=t.children;function o(e){e.passThrough=!0}i>-1&&k5.splice(i,1);for(var s=0;s<a.length;s++)o(a[s]);var l=kU(n,kN(kg,e));l.targets=l.targets||e.targets;var u=t.duration;l.autoplay=!1,l.direction=t.direction,l.timelineOffset=kw.und(r)?u:kV(r,u),o(t),t.seek(l.timelineOffset);var c=k8(l);o(c),a.push(c);var h=k2(a,e);
1225return t.delay=h.delay,t.endDelay=h.endDelay,t.duration=h.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t},k8.easing=kC,k8.penner=kA,k8.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e};var k9=function(e,t){void 0===t&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t;var n,r,i,a,o,s,l,u,c=document.createElement("div");c.style.cssText=`
1226    position: absolute;
1227    top: 0;
1228    left: 0;
1229    width: 100%;
1230    height: 100%;
1231    z-index: 1000
1232  `,this.hitTestBlockOverlay=c,this.enabled=!0,this.width=0,this.height=0,this.offsetLeft=0,this.offsetTop=0,this.maxBounds=[[-1/0,-1/0],[1/0,1/0]],this.needsUpdate=!1,this.newAzimuthalAngle=null,this.newPolarAngle=null,this.newTarget=null,this.target=new ih,this.raycaster=new c4,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.rotationDisabled=!1,this.panningDisabled=!1,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.followMouseOnZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:rC.ROTATE,MIDDLE:rC.DOLLY,RIGHT:rC.PAN},this.touches={ONE:rR.ROTATE,TWO:rR.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return w.phi},this.getAzimuthalAngle=function(){return w.theta},this.setAzimuthalAngle=function(e){this.newAzimuthalAngle=e},this.setPolarAngle=function(e){this.newPolarAngle=e},this.setTarget=function(e){this.newTarget=e},this.saveState=function(){h.target0.copy(h.target),h.position0.copy(h.object.position),h.zoom0=h.object.zoom},this.reset=function(){h.target.copy(h.target0),h.object.position.copy(h.position0),h.object.zoom=h.zoom0,h.object.updateProjectionMatrix(),h.dispatchEvent(d),h.update(),x=b.NONE},this.update=(n=new ih,i=(r=new ic().setFromUnitVectors(e.up,new ih(0,1,0))).clone().invert(),a=new ih,o=new ic,function(){var e=h.object.position;n.copy(e).sub(h.target),n.applyQuaternion(r),w.setFromVector3(n),h.autoRotate&&x===b.NONE&&F(2*Math.PI/60/60*h.autoRotateSpeed),null!==h.newAzimuthalAngle&&(w.theta=h.newAzimuthalAngle,h.newAzimuthalAngle=null),null!==h.newPolarAngle&&(w.phi=h.newPolarAngle,h.newPolarAngle=null),null!==h.newTarget&&(h.target.copy(h.newTarget),h.newTarget=null),h.enableDamping?(w.theta+=M.theta*h.dampingFactor,w.phi+=M.phi*h.dampingFactor):(w.theta+=M.theta,w.phi+=M.phi),w.theta=Math.max(h.minAzimuthAngle,Math.min(h.maxAzimuthAngle,w.theta)),w.phi=Math.max(h.minPolarAngle,Math.min(h.maxPolarAngle,w.phi)),w.makeSafe(),w.radius*=E,w.radius=Math.max(h.minDistance,Math.min(h.maxDistance,w.radius));let[[t,s],[l,u]]=h.maxBounds,c=h.enableDamping?h.target.addScaledVector(S,h.dampingFactor):h.target.add(S),p=Math.min(Math.max(t,c.x),l),v=Math.min(Math.max(s,c.z),u);return(h.target.set(p,0,v),n.setFromSpherical(w),n.applyQuaternion(i),e.copy(h.target).add(n),h.object.lookAt(h.target),!0===h.enableDamping?(M.theta*=1-h.dampingFactor,M.phi*=1-h.dampingFactor,S.multiplyScalar(1-h.dampingFactor)):(M.set(0,0,0),S.set(0,0,0)),E=1,T&&h.dispatchEvent(f),A&&(h.dispatchEvent(g),A=!1),C&&(h.dispatchEvent(m),C=!1),T||a.distanceToSquared(h.object.position)>_||8*(1-o.dot(h.object.quaternion))>_)?(h.needsUpdate=!0,h.dispatchEvent(d),a.copy(h.object.position),o.copy(h.object.quaternion),T=!1,!0):(h.needsUpdate=!1,!1)}),this.dispose=function(){h.domElement.removeEventListener("contextmenu",eu,!1),h.domElement.removeEventListener("mousedown",et,!1),h.domElement.removeEventListener("wheel",ei,!1),h.domElement.removeEventListener("touchstart",eo,!1),h.domElement.removeEventListener("touchend",el,!1),h.domElement.removeEventListener("touchmove",es,!1),document.removeEventListener("mousemove",en,!1),document.removeEventListener("mouseup",er,!1),h.domElement.removeEventListener("keydown",ea,!1)};var h=this,d={type:"change"},p={type:"userPanning"},f={type:"zoomChange"},m={type:"tiltChange"},g={type:"rotationChange"},v={type:"start"},y={type:"end"},b={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},x=b.NONE,_=1e-6,w=new c7,M=new c7,E=1,S=new ih,T=!1,A=!1,C=!1,R=new rY,P=new rY,I=new rY,O=new rY,L=new rY,D=new rY,N=new rY,U=new rY,k=new rY;function B(){return Math.pow(.95,h.zoomSpeed)}function F(e){h.rotationDisabled||(A=!0,M.theta-=e)}function z(e){C=!0,M.phi-=e}var H=(s=new ih,function(e,t){s.setFromMatrixColumn(t,0),s.multiplyScalar(-e),S.add(s)}),j=(l=new ih,function(e,t){!0===h.screenSpacePanning?l.setFromMatrixColumn(t,1):(l.setFromMatrixColumn(t,0),l.crossVectors(h.object.up,l)),l.multiplyScalar(e+e*w.phi*1.1),S.add(l)}),W=(u=new ih,function(e,t){if(!h.panningDisabled){var n=h.domElement;if(h.object.isPerspectiveCamera){var r=h.object.position;u.copy(r).sub(h.target);var i=u.length();
1232H(2*e*(i*=Math.tan(h.object.fov/2*Math.PI/180))/n.clientHeight,h.object.matrix),j(2*t*i/n.clientHeight,h.object.matrix)}else h.object.isOrthographicCamera?(H(e*(h.object.right-h.object.left)/h.object.zoom/n.clientWidth,h.object.matrix),j(t*(h.object.top-h.object.bottom)/h.object.zoom/n.clientHeight,h.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),h.enablePan=!1);h.dispatchEvent(p)}});function G(e){h.object.isPerspectiveCamera?(E/=e,T=!0):h.object.isOrthographicCamera?(h.object.zoom=Math.max(h.minZoom,Math.min(h.maxZoom,h.object.zoom*e)),h.object.updateProjectionMatrix(),T=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),h.enableZoom=!1)}function V(e){h.object.isPerspectiveCamera?(E*=e,T=!0):h.object.isOrthographicCamera?(h.object.zoom=Math.max(h.minZoom,Math.min(h.maxZoom,h.object.zoom/e)),h.object.updateProjectionMatrix(),T=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),h.enableZoom=!1)}function X(e){R.set(e.clientX,e.clientY)}function q(e){O.set(e.clientX,e.clientY)}function Y(e){let t=h.object,n=h.raycaster;n.setFromCamera(e,t);let r=n.ray.origin,i=n.ray.direction,a=-r.y/i.y;return r.clone().add(i.multiplyScalar(a))}function Z(e){if(1===e.touches.length)R.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);R.set(t,n)}}function $(e){if(1===e.touches.length)O.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);O.set(t,n)}}function K(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);N.set(0,r)}function J(e){if(1===e.touches.length)P.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);P.set(t,n)}I.subVectors(P,R).multiplyScalar(h.rotateSpeed);var r=h.domElement;F(2*Math.PI*I.x/r.clientHeight),z(2*Math.PI*I.y/r.clientHeight),R.copy(P)}function Q(e){if(1===e.touches.length)L.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);L.set(t,n)}D.subVectors(L,O).multiplyScalar(h.panSpeed),W(D.x,D.y),O.copy(L)}function ee(e){if(!(e.touches.length<2)){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);if(U.set(0,r),k.set(0,Math.pow(U.y/N.y,h.zoomSpeed)),h.followMouseOnZoom){let t=h.object,n=h.target,r=Math.max(e.touches[0].clientX-h.offsetLeft,0),i=Math.max(e.touches[0].clientY-h.offsetTop,0),a=Math.max(e.touches[1].clientX-h.offsetLeft,0),o=Math.max(e.touches[1].clientY-h.offsetTop,0),s=Math.min(i,o)+Math.abs(i-o)/2,l=Y(new rY((Math.min(r,a)+Math.abs(r-a)/2)/h.width*2-1,-(2*(s/h.height))+1));l.sub(n).setLength(l.length()*Math.abs(1-k.y)),k.y>1&&t.zoom<h.maxZoom&&(t.position.addVectors(t.position,l),n.addVectors(n,l)),k.y<1&&h.minZoom<t.zoom&&(t.position.subVectors(t.position,l),n.subVectors(n,l))}G(k.y),N.copy(U)}}function et(e){if(!1!==h.enabled){switch(e.preventDefault(),h.domElement.focus?h.domElement.focus():window.focus(),e.button){case 0:switch(h.mouseButtons.LEFT){case rC.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===h.enablePan)return;q(e),x=b.PAN}else{if(!1===h.enableRotate)return;X(e),x=b.ROTATE}break;case rC.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===h.enableRotate)return;X(e),x=b.ROTATE}else{if(!1===h.enablePan)return;q(e),x=b.PAN}break;default:x=b.NONE}break;case 1:if(h.mouseButtons.MIDDLE===rC.DOLLY){if(!1===h.enableZoom)return;N.set(e.clientX,e.clientY),x=b.DOLLY}else x=b.NONE;break;case 2:switch(h.mouseButtons.RIGHT){case rC.ROTATE:if(!1===h.enableRotate)return;X(e),x=b.ROTATE;break;case rC.PAN:if(!1===h.enablePan)return;q(e),x=b.PAN;break;default:x=b.NONE}}x!==b.NONE&&(document.addEventListener("mousemove",en,!1),document.addEventListener("mouseup",er,!1),h.dispatchEvent(v))}}function en(e){var t;if(!1!==h.enabled)switch(e.preventDefault(),h.domElement.style.cursor="grabbing",!h.domElement.contains(h.hitTestBlockOverlay)&&h.domElement.appendChild(h.hitTestBlockOverlay),x){case b.ROTATE:if(!1===h.enableRotate)return;P.set(e.clientX,e.clientY),I.subVectors(P,R).multiplyScalar(h.rotateSpeed),t=h.domElement,F(2*Math.PI*I.x/t.clientHeight),z(2*Math.PI*I.y/t.clientHeight),R.copy(P),h.update();break;case b.DOLLY:if(!1===h.enableZoom)return;U.set(e.clientX,e.clientY),k.subVectors(U,N),k.y>0?G(B()):k.y<0&&V(B()),N.copy(U),h.update();break;case b.PAN:if(!1===h.enablePan)return;L.set(e.clientX,e.clientY),D.subVectors(L,O).multiplyScalar(h.panSpeed),W(D.x,D.y),O.copy(L),h.update()}}function er(e){!1!==h.enabled&&(document.removeEventListener("mousemove",en,!1),document.removeEventListener("mouseup",er,!1),h.domElement.style.cursor="grab",h.domElement.contains(h.hitTestBlockOverlay)&&h.domElement.removeChild(h.hitTestBlockOverlay),h.dispatchEvent(y),x=b.NONE)}function ei(e){if(!1!==h.enabled&&!1!==h.enableZoom&&(x===b.NONE||x===b.ROTATE)){if(e.preventDefault(),e.stopPropagation(),h.dispatchEvent(v),h.followMouseOnZoom)!function(e){let t=h.object,n=h.target,r=Math.max(e.clientX-h.offsetLeft,0),i=Math.max(e.clientY-h.offsetTop,0),a=Y(new rY(r/h.width*2-1,-(2*(i/h.height))+1));a.sub(n).setLength(h.zoomSpeed*a.length()/20),e.deltaY<0?(t.zoom<h.maxZoom&&(t.position.addVectors(t.position,a),n.addVectors(n,a)),V(B())):e.deltaY>
12320&&(h.minZoom<t.zoom&&(t.position.subVectors(t.position,a),n.subVectors(n,a)),G(B())),h.update()}(e);else e.deltaY<0?V(B()):e.deltaY>0&&G(B()),h.update();h.dispatchEvent(y)}}function ea(e){if(!1!==h.enabled&&!1!==h.enableKeys&&!1!==h.enablePan){var t=!1;switch(e.keyCode){case h.keys.UP:W(0,h.keyPanSpeed),t=!0;break;case h.keys.BOTTOM:W(0,-h.keyPanSpeed),t=!0;break;case h.keys.LEFT:W(h.keyPanSpeed,0),t=!0;break;case h.keys.RIGHT:W(-h.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),h.update())}}function eo(e){if(!1!==h.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(h.touches.ONE){case rR.ROTATE:if(!1===h.enableRotate)return;Z(e),x=b.TOUCH_ROTATE;break;case rR.PAN:if(!1===h.enablePan)return;$(e),x=b.TOUCH_PAN;break;default:x=b.NONE}break;case 2:switch(h.touches.TWO){case rR.DOLLY_PAN:if(!1===h.enableZoom&&!1===h.enablePan)return;h.enableZoom&&K(e),h.enablePan&&$(e),x=b.TOUCH_DOLLY_PAN;break;case rR.DOLLY_ROTATE:if(!1===h.enableZoom&&!1===h.enableRotate)return;h.enableZoom&&K(e),h.enableRotate&&Z(e),x=b.TOUCH_DOLLY_ROTATE;break;default:x=b.NONE}break;default:x=b.NONE}x!==b.NONE&&h.dispatchEvent(v)}}function es(e){if(!1!==h.enabled)switch(e.preventDefault(),e.stopPropagation(),x){case b.TOUCH_ROTATE:if(!1===h.enableRotate)return;J(e),h.update();break;case b.TOUCH_PAN:if(!1===h.enablePan)return;Q(e),h.update();break;case b.TOUCH_DOLLY_PAN:if(!1===h.enableZoom&&!1===h.enablePan)return;h.enableZoom&&ee(e),h.enablePan&&Q(e),h.update();break;case b.TOUCH_DOLLY_ROTATE:if(!1===h.enableZoom&&!1===h.enableRotate)return;h.enableZoom&&ee(e),h.enableRotate&&J(e),h.update();break;default:x=b.NONE}}function el(e){!1!==h.enabled&&(h.dispatchEvent(y),x=b.NONE)}function eu(e){!1!==h.enabled&&e.preventDefault()}h.domElement.addEventListener("contextmenu",eu,!1),h.domElement.addEventListener("mousedown",et,!1),h.domElement.addEventListener("wheel",ei,!1),h.domElement.addEventListener("touchstart",eo,!1),h.domElement.addEventListener("touchend",el,!1),h.domElement.addEventListener("touchmove",es,!1),h.domElement.addEventListener("keydown",ea,!1),-1===h.domElement.tabIndex&&(h.domElement.tabIndex=0),this.update()};k9.prototype=Object.create(rF.prototype),k9.prototype.constructor=k9;var Be=function(e,t){k9.call(this,e,t),this.mouseButtons.LEFT=rC.PAN,this.mouseButtons.RIGHT=rC.ROTATE,this.touches.ONE=rR.PAN,this.touches.TWO=rR.DOLLY_ROTATE};Be.prototype=Object.create(rF.prototype),Be.prototype.constructor=Be;class Bt extends cS{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new Bs(e)}),this.register(function(e){return new Bl(e)}),this.register(function(e){return new Bv(e)}),this.register(function(e){return new By(e)}),this.register(function(e){return new Bb(e)}),this.register(function(e){return new Bc(e)}),this.register(function(e){return new Bh(e)}),this.register(function(e){return new Bd(e)}),this.register(function(e){return new Bp(e)}),this.register(function(e){return new Bo(e)}),this.register(function(e){return new Bf(e)}),this.register(function(e){return new Bu(e)}),this.register(function(e){return new Bg(e)}),this.register(function(e){return new Bm(e)}),this.register(function(e){return new Bi(e)}),this.register(function(e){return new Bx(e)}),this.register(function(e){return new B_(e)})}load(e,t,n,r){let i,a=this;if(""!==this.resourcePath)i=this.resourcePath;else if(""!==this.path){let t=cX.extractUrlBase(e);i=cX.resolveURL(t,this.path)}else i=cX.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){r?r(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},s=new cC(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(n){try{a.parse(n,i,function(n){t(n),a.manager.itemEnd(e)},o)}catch(e){o(e)}},n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i,a={},o={},s=new TextDecoder;if("string"==typeof e)i=JSON.parse(e);else if(e instanceof ArrayBuffer)if(s.decode(new Uint8Array(e,0,4))===Bw){try{a[Br.KHR_BINARY_GLTF]=new BE(e)}catch(e){r&&r(e);return}i=JSON.parse(a[Br.KHR_BINARY_GLTF].content)}else i=JSON.parse(s.decode(e));else i=e;if(void 0===i.asset||i.asset.version[0]<2){r&&r(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let l=new BV(i,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](l);t.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),o[t.name]=t,a[t.name]=!0}if(i.extensionsUsed)for(let e=0;e<i.extensionsUsed.length;++e){let t=i.extensionsUsed[e],n=i.extensionsRequired||[];
1232switch(t){case Br.KHR_MATERIALS_UNLIT:a[t]=new Ba;break;case Br.KHR_DRACO_MESH_COMPRESSION:a[t]=new BS(i,this.dracoLoader);break;case Br.KHR_TEXTURE_TRANSFORM:a[t]=new BT;break;case Br.KHR_MESH_QUANTIZATION:a[t]=new BA;break;default:n.indexOf(t)>=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(a),l.setPlugins(o),l.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}}function Bn(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let Br={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Bi{constructor(e){this.parser=e,this.name=Br.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){let t,n=this.parser,r="light:"+e,i=n.cache.get(r);if(i)return i;let a=n.json,o=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e],s=new a_(0xffffff);void 0!==o.color&&s.setRGB(o.color[0],o.color[1],o.color[2],rO);let l=void 0!==o.range?o.range:0;switch(o.type){case"directional":(t=new cV(s)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new cW(s)).distance=l;break;case"spot":(t=new cB(s)).distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,t.angle=o.spot.outerConeAngle,t.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return t.position.set(0,0,0),t.decay=2,BH(t,o),void 0!==o.intensity&&(t.intensity=o.intensity),t.name=n.createUniqueName(o.name||"light_"+e),i=Promise.resolve(t),n.cache.add(r,i),i}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){let t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then(function(e){return n._getNodeRef(t.cache,i,e)})}}class Ba{constructor(){this.name=Br.KHR_MATERIALS_UNLIT}getMaterialType(){return aS}extendParams(e,t,n){let r=[];e.color=new a_(1,1,1),e.opacity=1;let i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){let t=i.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],rO),e.opacity=t[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture,rI))}return Promise.all(r)}}class Bo{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}class Bs{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=[],a=r.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&i.push(n.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&i.push(n.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(i.push(n.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){let e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new rY(e,e)}return Promise.all(i)}}class Bl{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_DISPERSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let r=n.extensions[this.name];return t.dispersion=void 0!==r.dispersion?r.dispersion:0,Promise.resolve()}}class Bu{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=[],a=r.extensions[this.name];return void 0!==a.iridescenceFactor&&(t.iridescence=a.iridescenceFactor),void 0!==a.iridescenceTexture&&i.push(n.assignTexture(t,"iridescenceMap",a.iridescenceTexture)),void 0!==a.iridescenceIor&&(t.iridescenceIOR=a.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==a.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=a.iridescenceThicknessMinimum),void 0!==a.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=a.iridescenceThicknessMaximum),void 0!==a.iridescenceThicknessTexture&&i.push(n.assignTexture(t,"iridescenceThicknessMap",a.iridescenceThicknessTexture)),Promise.all(i)}}class Bc{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=[];t.sheenColor=new a_(0,0,0),t.sheenRoughness=0,t.sheen=1;let a=r.extensions[this.name];if(void 0!==a.sheenColorFactor){let e=a.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],rO)}return void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&i.push(n.assignTexture(t,"sheenColorMap",a.sheenColorTexture,rI)),void 0!==a.sheenRoughnessTexture&&i.push(n.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(i)}}class Bh{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=[],a=r.extensions[this.name];return void 0!==a.transmissionFactor&&(t.transmission=a.transmissionFactor),void 0!==a.transmissionTexture&&i.push(n.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(i)}}class Bd{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=[],a=r.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&i.push(n.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;let o=a.attenuationColor||[1,1,1];return t.attenuationColor=new a_().setRGB(o[0],o[1],o[2],rO),Promise.all(i)}}class Bp{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class Bf{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=[],a=r.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&i.push(n.assignTexture(t,"specularIntensityMap",a.specularTexture));let o=a.specularColorFactor||[1,1,1];return t.specularColor=new a_().setRGB(o[0],o[1],o[2],rO),void 0!==a.specularColorTexture&&i.push(n.assignTexture(t,"specularColorMap",a.specularColorTexture,rI)),Promise.all(i)}}class Bm{constructor(e){this.parser=e,this.name=Br.EXT_MATERIALS_BUMP}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=[],a=r.extensions[this.name];return t.bumpScale=void 0!==a.bumpFactor?a.bumpFactor:1,void 0!==a.bumpTexture&&i.push(n.assignTexture(t,"bumpMap",a.bumpTexture)),Promise.all(i)}}class Bg{constructor(e){this.parser=e,this.name=Br.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?ca:null}extendMaterialParams(e,t){let n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let i=[],a=r.extensions[this.name];return void 0!==a.anisotropyStrength&&(t.anisotropy=a.anisotropyStrength),void 0!==a.anisotropyRotation&&(t.anisotropyRotation=a.anisotropyRotation),void 0!==a.anisotropyTexture&&i.push(n.assignTexture(t,"anisotropyMap",a.anisotropyTexture)),Promise.all(i)}}class Bv{constructor(e){this.parser=e,this.name=Br.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let i=r.extensions[this.name],a=t.options.ktx2Loader;if(!a)if(!(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,i.source,a)}}class By{constructor(e){this.parser=e,this.name=Br.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class Bb{constructor(e){this.parser=e,this.name=Br.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);null!==e&&(s=e)}return this.detectSupport().then(function(i){if(i)return n.loadTextureImage(e,a.source,s);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdj
1232FDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class Bx{constructor(e){this.name=Br.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(!n.extensions||!n.extensions[this.name])return null;{let e=n.extensions[this.name],r=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}}}class B_{constructor(e){this.name=Br.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||void 0===n.mesh)return null;for(let e of t.meshes[n.mesh].primitives)if(e.mode!==BI.TRIANGLES&&e.mode!==BI.TRIANGLE_STRIP&&e.mode!==BI.TRIANGLE_FAN&&void 0!==e.mode)return null;let r=n.extensions[this.name].attributes,i=[],a={};for(let e in r)i.push(this.parser.getDependency("accessor",r[e]).then(t=>(a[e]=t,a[e])));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new ij,n=new ih,o=new ic,s=new ih(1,1,1),l=new ue(e.geometry,e.material,r);for(let e=0;e<r;e++)a.TRANSLATION&&n.fromBufferAttribute(a.TRANSLATION,e),a.ROTATION&&o.fromBufferAttribute(a.ROTATION,e),a.SCALE&&s.fromBufferAttribute(a.SCALE,e),l.setMatrixAt(e,t.compose(n,o,s));for(let t in a)if("_COLOR_0"===t){let e=a[t];l.instanceColor=new l2(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,a[t]);aa.prototype.copy.call(l,e),this.parser.assignFinalMaterial(l),i.push(l)}return t.isGroup?(t.clear(),t.add(...i),t):i[0]}))}}let Bw="glTF",BM={JSON:0x4e4f534a,BIN:5130562};class BE{constructor(e){this.name=Br.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,12),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Bw)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let r=this.header.length-12,i=new DataView(e,12),a=0;for(;a<r;){let t=i.getUint32(a,!0);a+=4;let r=i.getUint32(a,!0);if(a+=4,r===BM.JSON){let r=new Uint8Array(e,12+a,t);this.content=n.decode(r)}else if(r===BM.BIN){let n=12+a;this.body=e.slice(n,n+t)}a+=t}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class BS{constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Br.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},l={};for(let e in a)o[BU[e]||e.toLowerCase()]=a[e];for(let t in e.attributes){let r=BU[t]||t.toLowerCase();if(void 0!==a[t]){let i=n.accessors[e.attributes[t]],a=BO[i.componentType];l[r]=a.name,s[r]=!0===i.normalized}}return t.getDependency("bufferView",i).then(function(e){return new Promise(function(t,n){r.decodeDracoFile(e,function(e){for(let t in e.attributes){let n=e.attributes[t],r=s[t];void 0!==r&&(n.normalized=r)}t(e)},o,l,rO,n)})})}}class BT{constructor(){this.name=Br.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(void 0===t.texCoord||t.texCoord===e.channel)&&void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class BA{constructor(){this.name=Br.KHR_MESH_QUANTIZATION}}class BC extends cu{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,u=r-t,c=(n-t)/u,h=c*c,d=h*c,p=e*l,f=p-l,m=-2*d+3*h,g=d-h,v=1-m,y=g-h+c;for(let e=0;e!==o;e++){let t=a[f+e+o],n=a[f+e+s]*u,r=a[p+e+o],l=a[p+e]*u;i[e]=v*t+y*n+m*r+g*l}return i}}let BR=new ic;class BP extends BC{interpolate_(e,t,n,r){let i=super.interpolate_(e,t,n,r);return BR.fromArray(i).normalize().toArray(i),i}}let BI={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},BO={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},BL={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},BD={33071:1001,33648:1002,10497:1e3},BN={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},BU={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Bk={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},BB={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},BF={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Bz(e,t,n){for(let r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function BH(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function Bj(e){let t="",n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function BW(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}let BG=new ij;class BV{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Bn,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,r=!1,i=-1;"undefined"!=typeof navigator&&(n=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=(r=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||n||r&&i<98?this.textureLoader=new cI(this.options.manager):this.textureLoader=new cq(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new cC(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()}
1232)).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return Bz(i,a,r),BH(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){let r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){let r=e[t];void 0!==r.mesh&&(this._addNodeRef(this.meshCache,r.mesh),void 0!==r.skin&&(n[r.mesh].isSkinnedMesh=!0)),void 0!==r.camera&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;let r=n.clone(),i=(e,t)=>{let n=this.associations.get(e);for(let[r,a]of(null!=n&&this.associations.set(t,n),e.children.entries()))i(a,t.children[r])};return i(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){let r=e(t[n]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let n=[];for(let r=0;r<t.length;r++){let i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){let n=e+":"+t,r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case"mesh":r=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(!(r=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)})))throw Error("Unknown type: "+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let n=this;t=Promise.all((this.json[e+("mesh"===e?"es":"s")]||[]).map(function(t,r){return n.getDependency(e,r)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[Br.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(e,i){n.load(cX.resolveURL(t.uri,r.path),e,void 0,function(){i(Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){let n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)})}loadAccessor(e){let t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse){let e=BN[r.type],t=BO[r.componentType],n=!0===r.normalized;return Promise.resolve(new aP(new t(r.count*e),e,n))}let i=[];return void 0!==r.bufferView?i.push(this.getDependency("bufferView",r.bufferView)):i.push(null),void 0!==r.sparse&&(i.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(i).then(function(e){let i,a=e[0],o=BN[r.type],s=BO[r.componentType],l=s.BYTES_PER_ELEMENT,u=l*o,c=r.byteOffset||0,h=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,d=!0===r.normalized;if(h&&h!==u){let e=Math.floor(c/h),n="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count,u=t.cache.get(n);u||(u=new lB(new s(a,e*h,r.count*h/l),h/l),t.cache.add(n,u)),i=new lz(u,o,c%h/l,d)}else i=new aP(null===a?new s(r.count*o):new s(a,c,r.count*o),o,d);if(void 0!==r.sparse){let t=BN.SCALAR,n=BO[r.sparse.indices.componentType],l=r.sparse.indices.byteOffset||0,u=r.sparse.values.byteOffset||0,c=new n(e[1],l,r.sparse.count*t),h=new s(e[2],u,r.sparse.count*o);null!==a&&(i=new aP(i.array.slice(),i.itemSize,i.normalized));for(let e=0,t=c.length;e<t;e++){let t=c[e];if(i.setX(t,h[e*o]),o>=2&&i.setY(t,h[e*o+1]),o>=3&&i.setZ(t,h[e*o+2]),o>=4&&i.setW(t,h[e*o+3]),o>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);null!==e&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[s])return this.textureCache[s];let l=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=BL[n.magFilter]||1006,t.minFilter=BL[n.minFilter]||1008,t.wrapS=BD[n.wrapS]||1e3,t.wrapT=BD[n.wrapT]||1e3,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=l,l}loadImageSource(e,t){let n=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let i=n.images[e],a=self.URL||self.webkitURL,o=i.uri||"",s=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then(function(e){s=!0;let t=new Blob([e],{type:i.mimeType});return o=a.createObjectURL(t)});else if(void 0===i.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(e){return new Promise(function(n,i){let a=n;!0===t.isImageBitmapLoader&&(a=function(e){let t=new ii(e);t.needsUpdate=!0,n(t)}),t.load(cX.resolveURL(e,r.path),a,void 0,i)})}).then(function(e){var t;return!0===s&&a.revokeObjectURL(o),BH(e,i),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>
12320||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency("texture",n.index).then(function(a){if(!a)return null;if(void 0!==n.texCoord&&n.texCoord>0&&((a=a.clone()).channel=n.texCoord),i.extensions[Br.KHR_TEXTURE_TRANSFORM]){let e=void 0!==n.extensions?n.extensions[Br.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=i.associations.get(a);a=i.extensions[Br.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return void 0!==r&&(a.colorSpace=r),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+n.uuid,t=this.cache.get(e);t||(t=new um,aE.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e="LineBasicMaterial:"+n.uuid,t=this.cache.get(e);t||(t=new ut,aE.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e="ClonedMaterial:"+n.uuid+":";r&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return ci}loadMaterial(e){let t,n=this,r=this.json,i=this.extensions,a=r.materials[e],o={},s=a.extensions||{},l=[];if(s[Br.KHR_MATERIALS_UNLIT]){let e=i[Br.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(o,a,n))}else{let r=a.pbrMetallicRoughness||{};if(o.color=new a_(1,1,1),o.opacity=1,Array.isArray(r.baseColorFactor)){let e=r.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],rO),o.opacity=e[3]}void 0!==r.baseColorTexture&&l.push(n.assignTexture(o,"map",r.baseColorTexture,rI)),o.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,o.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(l.push(n.assignTexture(o,"metalnessMap",r.metallicRoughnessTexture)),l.push(n.assignTexture(o,"roughnessMap",r.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}!0===a.doubleSided&&(o.side=2);let u=a.alphaMode||BF.OPAQUE;if(u===BF.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,u===BF.MASK&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==aS&&(l.push(n.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new rY(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;o.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==aS&&(l.push(n.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==aS){let e=a.emissiveFactor;o.emissive=new a_().setRGB(e[0],e[1],e[2],rO)}return void 0!==a.emissiveTexture&&t!==aS&&l.push(n.assignTexture(o,"emissiveMap",a.emissiveTexture,rI)),Promise.all(l).then(function(){let r=new t(o);return a.name&&(r.name=a.name),BH(r,a),n.associations.set(r,{materials:e}),a.extensions&&Bz(i,r,a),r})}createUniqueName(e){let t=c3.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache,i=[];for(let a=0,o=e.length;a<o;a++){let o=e[a],s=function(e){let t,n=e.extensions&&e.extensions[Br.KHR_DRACO_MESH_COMPRESSION];if(t=n?"draco:"+n.bufferView+":"+n.indices+":"+Bj(n.attributes):e.indices+":"+Bj(e.attributes)+":"+e.mode,void 0!==e.targets)for(let n=0,r=e.targets.length;n<r;n++)t+=":"+Bj(e.targets[n]);return t}(o),l=r[s];if(l)i.push(l.promise);else{let e;e=o.extensions&&o.extensions[Br.KHR_DRACO_MESH_COMPRESSION]?function(e){return n[Br.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return BX(n,e,t)})}(o):BX(new aH,o,t),r[s]={primitive:o,promise:e},i.push(e)}}return Promise.all(i)}loadMesh(e){let t=this,n=this.json,r=this.extensions,i=n.meshes[e],a=i.primitives,o=[];for(let e=0,t=a.length;e<t;e++){var s;let t=void 0===a[e].material?(void 0===(s=this.cache).DefaultMaterial&&(s.DefaultMaterial=new ci({color:0xffffff,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),s.DefaultMaterial):this.getDependency("material",a[e].material);o.push(t)}return o.push(t.loadGeometries(a)),Promise.all(o).then(function(n){let o=n.slice(0,n.length-1),s=n[n.length-1],l=[];for(let n=0,u=s.length;n<u;n++){let u,c=s[n],h=a[n],d=o[n];if(h.mode===BI.TRIANGLES||h.mode===BI.TRIANGLE_STRIP||h.mode===BI.TRIANGLE_FAN||void 0===h.mode)!0===(u=!0===i.isSkinnedMesh?new l$(c,d):new a4(c,d)).isSkinnedMesh&&u.normalizeSkinWeights(),h.mode===BI.TRIANGLE_STRIP?u.geometry=hE(u.geometry,1):h.mode===BI.TRIANGLE_FAN&&(u.geometry=hE(u.geometry,2));else if(h.mode===BI.LINES)u=new up(c,d);else if(h.mode===BI.LINE_STRIP)u=new uu(c,d);else if(h.mode===BI.LINE_LOOP)u=new uf(c,d);else if(h.mode===BI.POINTS)u=new ux(c,d);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);Object.keys(u.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){let n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}(u,i),u.name=t.createUniqueName(i.name||"mesh_"+e),BH(u,i),h.extensions&&Bz(r,u,h),t.assignFinalMaterial(u),l.push(u)}for(let n=0,r=l.length;n<r;n++)t.associations.set(l[n],{meshes:e,primitives:n});if(1===l.length)return i.extensions&&Bz(r,l[0],i),l[0];let u=new lS;i.extensions&&Bz(r,u,i),t.associations.set(u,{meshes:e});for(let e=0,t=l.length;e<t;e++)u.add(l[e]);return u})}loadCamera(e){let t,n=this.json.cameras[e],r=n[n.type];return r?("perspective"===n.type?t=new os(rq.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new oL(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),BH(t,n),Promise.resolve(t)):void console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){let t=this.json.skins[e],n=[];for(let e=0,r=t.joints.length;e<r;e++)n.push(this._loadNodeShallow(t.joints[e]));return void 0!==t.inverseBindMatrices?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(e){let n=e.pop(),r=[],i=[];for(let a=0,o=e.length;a<o;a++){let o=e[a];if(o){r.push(o);let e=new ij;null!==n&&e.fromArray(n.array,16*a),i.push(e)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}return new l1(r,i)})}loadAnimation(e){let t=this.json,n=this,r=t.animations[e],i=r.name?r.name:"animation_"+e,a=[],o=[],s=[],l=[],u=[];for(let e=0,t=r.channels.length;e<t;
1232e++){let t=r.channels[e],n=r.samplers[t.sampler],i=t.target,c=i.node,h=void 0!==r.parameters?r.parameters[n.input]:n.input,d=void 0!==r.parameters?r.parameters[n.output]:n.output;void 0!==i.node&&(a.push(this.getDependency("node",c)),o.push(this.getDependency("accessor",h)),s.push(this.getDependency("accessor",d)),l.push(n),u.push(i))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(s),Promise.all(l),Promise.all(u)]).then(function(e){let t=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=[];for(let e=0,i=t.length;e<i;e++){let i=t[e],u=r[e],c=a[e],h=o[e],d=s[e];if(void 0===i)continue;i.updateMatrix&&i.updateMatrix();let p=n._createAnimationTracks(i,u,c,h,d);if(p)for(let e=0;e<p.length;e++)l.push(p[e])}return new c_(i,void 0,l)})}createNodeMesh(e){let t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then(function(e){let t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]}),t})}loadNode(e){let t=this.json.nodes[e],n=this._loadNodeShallow(e),r=[],i=t.children||[];for(let e=0,t=i.length;e<t;e++)r.push(this.getDependency("node",i[e]));let a=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([n,Promise.all(r),a]).then(function(e){let t=e[0],n=e[1],r=e[2];null!==r&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(r,BG)});for(let e=0,r=n.length;e<r;e++)t.add(n[e]);return t})}_loadNodeShallow(e){let t=this.json,n=this.extensions,r=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];let i=t.nodes[e],a=i.name?r.createUniqueName(i.name):"",o=[],s=r._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return s&&o.push(s),void 0!==i.camera&&o.push(r.getDependency("camera",i.camera).then(function(e){return r._getNodeRef(r.cameraCache,i.camera,e)})),r._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if((o=!0===i.isBone?new lK:t.length>1?new lS:1===t.length?t[0]:new aa)!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=a),BH(o,i),i.extensions&&Bz(n,o,i),void 0!==i.matrix){let e=new ij;e.fromArray(i.matrix),o.applyMatrix4(e)}else void 0!==i.translation&&o.position.fromArray(i.translation),void 0!==i.rotation&&o.quaternion.fromArray(i.rotation),void 0!==i.scale&&o.scale.fromArray(i.scale);return r.associations.has(o)||r.associations.set(o,{}),r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],r=this,i=new lS;n.name&&(i.name=r.createUniqueName(n.name)),BH(i,n),n.extensions&&Bz(t,i,n);let a=n.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(r.getDependency("node",a[e]));return Promise.all(o).then(function(e){for(let t=0,n=e.length;t<n;t++)i.add(e[t]);return r.associations=(e=>{let t=new Map;for(let[e,n]of r.associations)(e instanceof aE||e instanceof ii)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);null!=n&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a,o=[],s=e.name?e.name:e.uuid,l=[];switch(Bk[i.path]===Bk.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(s),Bk[i.path]){case Bk.weights:a=cg;break;case Bk.rotation:a=cy;break;case Bk.position:case Bk.scale:a=cx;break;default:a=1===n.itemSize?cg:cx}let u=void 0!==r.interpolation?BB[r.interpolation]:2301,c=this._getArrayFromAccessor(n);for(let e=0,n=l.length;e<n;e++){let n=new a(l[e]+"."+Bk[i.path],t.array,c,u);"CUBICSPLINE"===r.interpolation&&this._createCubicSplineTrackInterpolant(n),o.push(n)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=BW(t.constructor),n=new Float32Array(t.length);for(let r=0,i=t.length;r<i;r++)n[r]=t[r]*e;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof cy?BP:BC)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function BX(e,t,n){let r=t.attributes,i=[];for(let t in r){let a=BU[t]||t.toLowerCase();a in e.attributes||i.push(function(t,r){return n.getDependency("accessor",t).then(function(t){e.setAttribute(r,t)})}(r[t],a))}if(void 0!==t.indices&&!e.index){let r=n.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});i.push(r)}return r4.workingColorSpace!==rO&&"COLOR_0"in r&&console.warn(`THREE.GLTFLoader: Convert
1232ing vertex colors from "srgb-linear" to "${r4.workingColorSpace}" not supported.`),BH(e,t),!function(e,t,n){let r=t.attributes,i=new im;if(void 0===r.POSITION)return;{let e=n.json.accessors[r.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new ih(t[0],t[1],t[2]),new ih(a[0],a[1],a[2])),e.normalized){let t=BW(BO[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}let a=t.targets;if(void 0!==a){let e=new ih,t=new ih;for(let r=0,i=a.length;r<i;r++){let i=a[r];if(void 0!==i.POSITION){let r=n.json.accessors[i.POSITION],a=r.min,o=r.max;if(void 0!==a&&void 0!==o){if(t.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),r.normalized){let e=BW(BO[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;let o=new iL;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}(e,t,n),Promise.all(i).then(function(){return void 0!==t.targets?function(e,t,n){let r=!1,i=!1,a=!1;for(let e=0,n=t.length;e<n;e++){let n=t[e];if(void 0!==n.POSITION&&(r=!0),void 0!==n.NORMAL&&(i=!0),void 0!==n.COLOR_0&&(a=!0),r&&i&&a)break}if(!r&&!i&&!a)return Promise.resolve(e);let o=[],s=[],l=[];for(let u=0,c=t.length;u<c;u++){let c=t[u];if(r){let t=void 0!==c.POSITION?n.getDependency("accessor",c.POSITION):e.attributes.position;o.push(t)}if(i){let t=void 0!==c.NORMAL?n.getDependency("accessor",c.NORMAL):e.attributes.normal;s.push(t)}if(a){let t=void 0!==c.COLOR_0?n.getDependency("accessor",c.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(l)]).then(function(t){let n=t[0],o=t[1],s=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),a&&(e.morphAttributes.color=s),e.morphTargetsRelative=!0,e})}(e,t.targets,n):e})}let Bq=new WeakMap;class BY extends cS{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){let i=new cC(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>{this.parse(e,t,r)},n,r)}parse(e,t,n=()=>{}){this.decodeDracoFile(e,t,null,null,rI,n).catch(n)}decodeDracoFile(e,t,n,r,i=rO,a=()=>{}){let o={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:i};return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){let n,r=JSON.stringify(t);if(Bq.has(e)){let t=Bq.get(e);if(t.key===r)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(i,a).then(r=>(n=r,new Promise((r,a)=>{n._callbacks[i]={resolve:r,reject:a},n.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{n&&i&&this._releaseTask(n,i)}),Bq.set(e,{key:r,promise:o}),o}_createGeometry(e){let t=new aH;e.index&&t.setIndex(new aP(e.index.array,1));for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n],i=r.name,a=r.array,o=new aP(a,r.itemSize);"color"===i&&(this._assignVertexColorSpace(o,r.vertexColorSpace),o.normalized=a instanceof Float32Array==!1),t.setAttribute(i,o)}return t}_assignVertexColorSpace(e,t){if(t!==rI)return;let n=new a_;for(let t=0,r=e.count;t<r;t++)n.fromBufferAttribute(e,t).convertSRGBToLinear(),e.setXYZ(t,n.r,n.g,n.b)}_loadLibrary(e,t){let n=new cC(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((t,r)=>{n.load(e,t,void 0,r)})}preload(){return this._initDecoder(),this}
1232_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let r=BZ.toString(),i=["/* draco decoder */",n,"\n/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){let n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}}function BZ(){let e,t;onmessage=function(n){let r=n.data;switch(r.type){case"init":e=r.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let i=r.buffer,a=r.taskConfig;t.then(e=>{let t=e.draco,n=new t.Decoder;try{let e=function(e,t,n,r){let i,a,o=r.attributeIDs,s=r.attributeTypes,l=t.GetEncodedGeometryType(n);if(l===e.TRIANGULAR_MESH)i=new e.Mesh,a=t.DecodeArrayToMesh(n,n.byteLength,i);else if(l===e.POINT_CLOUD)i=new e.PointCloud,a=t.DecodeArrayToPointCloud(n,n.byteLength,i);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!a.ok()||0===i.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+a.error_msg());let u={index:null,attributes:[]};for(let n in o){let a,l,c=self[s[n]];if(r.useUniqueIDs)l=o[n],a=t.GetAttributeByUniqueId(i,l);else{if(-1===(l=t.GetAttributeId(i,e[o[n]])))continue;a=t.GetAttribute(i,l)}let h=function(e,t,n,r,i,a){let o=a.num_components(),s=n.num_points()*o,l=s*i.BYTES_PER_ELEMENT,u=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,a,u,l,c);let h=new i(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:r,array:h,itemSize:o}}(e,t,i,n,c,a);"color"===n&&(h.vertexColorSpace=r.vertexColorSpace),u.attributes.push(h)}return l===e.TRIANGULAR_MESH&&(u.index=function(e,t,n){let r=3*n.num_faces(),i=4*r,a=e._malloc(i);t.GetTrianglesUInt32Array(n,i,a);let o=new Uint32Array(e.HEAPF32.buffer,a,r).slice();return e._free(a),{array:o,itemSize:1}}(e,t,i)),e.destroy(i),u}(t,n,new Int8Array(i),a),o=e.attributes.map(e=>e.array.buffer);e.index&&o.push(e.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:e},o)}catch(e){console.error(e),self.postMessage({type:"error",id:r.id,error:e.message})}finally{t.destroy(n)}})}}}var B$=Uint8Array,BK=Uint16Array,BJ=Int32Array,BQ=new B$([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),B0=new B$([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),B1=new B$([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),B2=function(e,t){for(var n=new BK(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new BJ(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},B3=B2(BQ,2),B5=B3.b,B4=B3.r;B5[28]=258,B4[258]=28;
1232for(var B6=B2(B0,0).b,B8=new BK(32768),B7=0;B7<32768;++B7){var B9=(43690&B7)>>1|(21845&B7)<<1;B9=(61680&(B9=(52428&B9)>>2|(13107&B9)<<2))>>4|(3855&B9)<<4,B8[B7]=((65280&B9)>>8|(255&B9)<<8)>>1}for(var Fe=function(e,t,n){for(var r,i=e.length,a=0,o=new BK(t);a<i;++a)e[a]&&++o[e[a]-1];var s=new BK(t);for(a=1;a<t;++a)s[a]=s[a-1]+o[a-1]<<1;if(n){r=new BK(1<<t);var l=15-t;for(a=0;a<i;++a)if(e[a])for(var u=a<<4|e[a],c=t-e[a],h=s[e[a]-1]++<<c,d=h|(1<<c)-1;h<=d;++h)r[B8[h]>>l]=u}else for(a=0,r=new BK(i);a<i;++a)e[a]&&(r[a]=B8[s[e[a]-1]++]>>15-e[a]);return r},Ft=new B$(288),B7=0;B7<144;++B7)Ft[B7]=8;for(var B7=144;B7<256;++B7)Ft[B7]=9;for(var B7=256;B7<280;++B7)Ft[B7]=7;for(var B7=280;B7<288;++B7)Ft[B7]=8;for(var Fn=new B$(32),B7=0;B7<32;++B7)Fn[B7]=5;var Fr=Fe(Ft,9,1),Fi=Fe(Fn,5,1),Fa=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Fo=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},Fs=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},Fl=["unexpected EOF","invalid block type","invali
1232d length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Fu=function(e,t,n){var r=Error(t||Fl[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Fu),!n)throw r;return r},Fc=function(e,t,n,r){var i,a,o,s=e.length,l=r?r.length:0;if(!s||t.f&&!t.l)return n||new B$(0);var u=!n,c=u||2!=t.i,h=t.i;u&&(n=new B$(3*s));var d=function(e){var t=n.length;if(e>t){var r=new B$(Math.max(2*t,e));r.set(n),n=r}},p=t.f||0,f=t.p||0,m=t.b||0,g=t.l,v=t.d,y=t.m,b=t.n,x=8*s;do{if(!g){p=Fo(e,f,1);var _=Fo(e,f+1,3);if(f+=3,_)if(1==_)g=Fr,v=Fi,y=9,b=5;else if(2==_){var w=Fo(e,f,31)+257,M=Fo(e,f+10,15)+4,E=w+Fo(e,f+5,31)+1;f+=14;for(var S=new B$(E),T=new B$(19),A=0;A<M;++A)T[B1[A]]=Fo(e,f+3*A,7);f+=3*M;for(var C=Fa(T),R=(1<<C)-1,P=Fe(T,C,1),A=0;A<E;){var I=P[Fo(e,f,R)];f+=15&I;var O=I>>4;if(O<16)S[A++]=O;else{var L=0,D=0;for(16==O?(D=3+Fo(e,f,3),f+=2,L=S[A-1]):17==O?(D=3+Fo(e,f,7),f+=3):18==O&&(D=11+Fo(e,f,127),f+=7);D--;)S[A++]=L}}var N=S.subarray(0,w),U=S.subarray(w);y=Fa(N),b=Fa(U),g=Fe(N,y,1),v=Fe(U,b,1)}else Fu(1);else{var O=((f+7)/8|0)+4,k=e[O-4]|e[O-3]<<8,B=O+k;if(B>s){h&&Fu(0);break}c&&d(m+k),n.set(e.subarray(O,B),m),t.b=m+=k,t.p=f=8*B,t.f=p;continue}if(f>x){h&&Fu(0);break}}c&&d(m+131072);for(var F=(1<<y)-1,z=(1<<b)-1,H=f;;H=f){var L=g[Fs(e,f)&F],j=L>>4;if((f+=15&L)>x){h&&Fu(0);break}if(L||Fu(2),j<256)n[m++]=j;else if(256==j){H=f,g=null;break}else{var W=j-254;if(j>264){var A=j-257,G=BQ[A];W=Fo(e,f,(1<<G)-1)+B5[A],f+=G}var V=v[Fs(e,f)&z],X=V>>4;V||Fu(3),f+=15&V;var U=B6[X];if(X>3){var G=B0[X];U+=Fs(e,f)&(1<<G)-1,f+=G}if(f>x){h&&Fu(0);break}c&&d(m+131072);var q=m+W;if(m<U){var Y=l-U,Z=Math.min(U,q);for(Y+m<0&&Fu(3);m<Z;++m)n[m]=r[Y+m]}for(;m<q;++m)n[m]=n[m-U]}}t.l=g,t.p=H,t.b=m,t.f=p,g&&(p=1,t.m=y,t.d=v,t.n=b)}while(!p);return m!=n.length&&u?(i=n,(a=0)<0&&(a=0),(null==(o=m)||o>i.length)&&(o=i.length),new B$(i.subarray(a,o))):n.subarray(0,m)},Fh=new B$(0);function Fd(e,t){var n;return Fc(e.subarray((n=t&&t.dictionary,((15&e[0])!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&Fu(6,"invalid zlib data"),(e[1]>>5&1)==+!n&&Fu(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2),-4),{i:2},t&&t.out,t&&t.dictionary)}var Fp="undefined"!=typeof TextDecoder&&new TextDecoder;try{Fp.decode(Fh,{stream:!0})}catch(e){}class Ff extends cP{constructor(e){super(e),this.type=1016}parse(e){let t={l:0,c:0,lc:0};function n(e,n,r,i,a){for(;r<e;)n=n<<8|S(i,a),r+=8;t.l=n>>(r-=e)&(1<<e)-1,t.c=n,t.lc=r}let r=Array(59),i={c:0,lc:0};function a(e,t,n,r){e=e<<8|S(n,r),t+=8,i.c=e,i.lc=t}let o={c:0,lc:0};function s(e,t,n,r,s,l,u,c,h){if(e==t){r<8&&(a(n,r,s,l),n=i.c,r=i.lc);let e=n>>(r-=8);if(e=new Uint8Array([e])[0],c.value+e>h)return!1;let t=u[c.value-1];for(;e-- >0;)u[c.value++]=t}else{if(!(c.value<h))return!1;u[c.value++]=e}o.c=n,o.lc=r}function l(e){let t=65535&e;return t>32767?t-65536:t}let u={a:0,b:0};function c(e,t){let n=l(e),r=l(t),i=n+(1&r)+(r>>1),a=i-r;u.a=i,u.b=a}function h(e,t){let n=65535&t,r=(65535&e)-(n>>1)&65535;u.a=n+r-32768&65535,u.b=r}function d(e,l,u,c,h,d){let p=u.value,f=E(l,u),m=E(l,u);u.value+=4;let g=E(l,u);if(u.value+=4,f<0||f>=65537||m<0||m>=65537)throw Error("Something wrong with HUF_ENCSIZE");let v=Array(65537),y=Array(16384);for(let e=0;e<16384;e++)y[e]={},y[e].len=0,y[e].lit=0,y[e].p=null;let b=c-(u.value-p);if(!function(e,i,a,o,s,l){let u=0,c=0;for(;o<=s;o++){if(i.value-i.value>a)return!1;n(6,u,c,e,i);let r=t.l;if(u=t.c,c=t.lc,l[o]=r,63==r){if(i.value-i.value>a)throw Error("Something wrong with hufUnpackEncTable");n(8,u,c,e,i);let r=t.l+6;if(u=t.c,c=t.lc,o+r>s+1)throw Error("Something wrong with hufUnpackEncTable");for(;r--;)l[o++]=0;o--}else if(r>=59){let e=r-59+2;if(o+e>s+1)throw Error("Something wrong with hufUnpackEncTable");for(;e--;)l[o++]=0;o--}}!function(e){for(let e=0;e<=58;++e)r[e]=0;for(let t=0;t<65537;++t)r[e[t]]+=1;let t=0;for(let e=58;e>0;--e){let n=t+r[e]>>1;r[e]=t,t=n}for(let t=0;t<65537;++t){let n=e[t];n>0&&(e[t]=n|r[n]++<<6)}}(l)}(e,u,b,f,m,v),g>8*(c-(u.value-p)))throw Error("Something wrong with hufUncompress");!function(e,t,n,r){for(;t<=n;t++){let n=e[t]>>6,i=63&e[t];if(n>>i)throw Error("Invalid table entry");if(i>14){let e=r[n>>i-14];if(e.len)throw Error("Invalid table entry");if(e.lit++,e.p){let t=e.p;e.p=Array(e.lit);for(let n=0;n<e.lit-1;++n)e.p[n]=t[n]}else e.p=[,];e.p[e.lit-1]=t}else if(i){let e=0;for(let a=1<<14-i;a>0;a--){let a=r[(n<<14-i)+e];if(a.len||a.p)throw Error("Invalid table entry");a.len=i,a.lit=t,e++}}}}(v,f,m,y),function(e,t,n,r,l,u,c,h,d){let p=0,f=0,m=Math.trunc(r.value+(l+7)/8);for(;r.value<m;)for(a(p,f,n,r),p=i.c,f=i.lc;f>=14;){let l=t[p>>f-14&16383];if(l.len)f-=l.len,s(l.lit,u,p,f,n,r,h,d,c),p=o.c,f=o.lc;else{let t;if(!l.p)throw Error("hufDecode issues");for(t=0;t<l.lit;t++){let g=63&e[l.p[t]];for(;f<g&&r.value<m;)a(p,f,n,r),p=i.c,f=i.lc;if(f>=g&&e[l.p[t]]>>6==(p>>f-g&(1<<g)-1)){f-=g,s(l.p[t],u,p,f,n,r,h,d,c),p=o.c,f=o.lc;break}}if(t==l.lit)throw Error("hufDecode issues")}}let g=8-l&7;for(p>>=g,f-=g;f>0;){let e=t[p<<14-f&16383];if(e.len)f-=e.len,s(e.lit,u,p,f,n,r,h,d,c),p=o.c,f=o.lc;else throw Error("hufDecode issues")}}(v,y,e,u,g,m,d,h,{value:0})}function p(e){for(let t=1;t<e.length;t++){let n=e[t-1]+e[t]-128;e[t]=n}}function f(e,t){let n=0,r=Math.floor((e.length+1)/2),i=0,a=e.length-1;for(;!(i>a)&&(t[i++]=e[n++],!(i>a));){;t[i++]=e[r++]}}function m(e){let t=e.byteLength,n=[],r=0,i=new DataView(e);for(;t>0;){let e=i.getInt8(r++);if(e<0){let a=-e;t-=a+1;for(let e=0;e<a;e++)n.push(i.getUint8(r++))}else{t-=2;let a=i.getUint8(r++);for(let t=0;t<e+1;t++)n.push(a)}}return n}function g(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function v(e){let t=new Uint8Array(m(e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size))),n=new Uint8Array(t.length);return p(t),f(t,n),new DataView(n.buffer)}function y(e){let t=Fd(e.array.slice(e.offset.value,e.offset.value+e.size)),n=new Uint8Array(t.length);return p(t),f(t,n),new DataView(n.buffer)}function b(e){let t=e.viewer,n={value:e.offset.value},r=new Uint16Array(e.columns*e.lines*(e.inputChannels.length*e.type)),i=new Uint8Array(8192),a=0,o=Array(e.inputChannels.length);for(let t=0,n=e.inputChannels.length;t<n;t++)o[t]={},o[t].start=a,o[t].end=o[t].start,o[t].nx=e.columns,o[t].ny=e.lines,o[t].size=e.type,a+=o[t].nx*o[t].ny*o[t].size;let s=I(t,n),l=I(t,n);if(l>=8192)throw Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(s<=l)for(let e=0;e<l-s+1;e++)i[e+s]=T(t,n);let p=new Uint16Array(65536),f=function(e,t){let n=0;for(let r=0;r<65536;++r)(0==r||e[r>>3]&1<<(7&r))&&(t[n++]=r);let r=n-1;for(;n<65536;)t[n++]=0;return r}(i,p),m=E(t,n);d(e.array,t,n,m,r,a);for(let t=0;t<e.inputChannels.length;++t){let e=o[t];for(let n=0;n<o[t].size;++n)!function(e,t,n,r,i,a,o){let s,l,d=o<16384,p=n>i?i:n,f=1;for(;f<=p;)f<<=1;for(f>>=1,s=f,f>>=1;f>=1;){let o,p,m,g,v=(l=0)+a*(i-s),y=a*f,b=a*s,x=r*f,_=r*s;for(;l<=v;l+=b){let i=l,a=l+r*(n-s);for(;i<=a;i+=_){let n=i+x,r=i+y,a=r+x;d?(c(e[i+t],e[r+t]),o=u.a,m=u.b,c(e[n+t],e[a+t]),p=u.a,g=u.b,c(o,p),e[i+t]=u.a,e[n+t]=u.b,c(m,g)):(h(e[i+t],e[r+t]),o=u.a,m=u.b,h(e[n+t],e[a+t]),p=u.a,g=u.b,h(o,p),e[i+t]=u.a,e[n+t]=u.b,h(m,g)),e[r+t]=u.a,e[a+t]=u.b}if(n&f){let n=i+y;d?c(e[i+t],e[n+t]):h(e[i+t],e[n+t]),o=u.a,e[n+t]=u.b,e[i+t]=o}}if(i&f){let i=l,a=l+r*(n-s);for(;i<=a;i+=_){let n=i+x;d?c(e[i+t],e[n+t]):h(e[i+t],e[n+t]),o=u.a,e[n+t]=u.b,e[i+t]=o}}s=f,f>>=1}}
1232(r,e.start+n,e.nx,e.size,e.ny,e.nx*e.size,f)}var g=a;for(let e=0;e<g;++e)r[e]=p[r[e]];let v=0,y=new Uint8Array(r.buffer.byteLength);for(let t=0;t<e.lines;t++)for(let t=0;t<e.inputChannels.length;t++){let e=o[t],n=e.nx*e.size,i=new Uint8Array(r.buffer,2*e.end,2*n);y.set(i,v),v+=2*n,e.end+=n}return new DataView(y.buffer)}function x(e){let t=Fd(e.array.slice(e.offset.value,e.offset.value+e.size)),n=new DataView(new ArrayBuffer(e.inputChannels.length*e.lines*e.columns*e.totalBytes)),r=0,i=0,a=[,,,,];for(let o=0;o<e.lines;o++)for(let o=0;o<e.inputChannels.length;o++){let s=0;switch(e.inputChannels[o].pixelType){case 1:a[0]=r,a[1]=a[0]+e.columns,r=a[1]+e.columns;for(let r=0;r<e.columns;++r)s+=t[a[0]++]<<8|t[a[1]++],n.setUint16(i,s,!0),i+=2;break;case 2:a[0]=r,a[1]=a[0]+e.columns,a[2]=a[1]+e.columns,r=a[2]+e.columns;for(let r=0;r<e.columns;++r)s+=t[a[0]++]<<24|t[a[1]++]<<16|t[a[2]++]<<8,n.setUint32(i,s,!0),i+=4}}return n}function _(e){let t,n,r,i=e.viewer,a={value:e.offset.value},o=new Uint8Array(e.columns*e.lines*(e.inputChannels.length*e.type*2)),s={version:A(i,a),unknownUncompressedSize:A(i,a),unknownCompressedSize:A(i,a),acCompressedSize:A(i,a),dcCompressedSize:A(i,a),rleCompressedSize:A(i,a),rleUncompressedSize:A(i,a),rleRawSize:A(i,a),totalAcUncompressedCount:A(i,a),totalDcUncompressedCount:A(i,a),acCompression:A(i,a)};if(s.version<2)throw Error("EXRLoader.parse: "+F.compression+" version "+s.version+" is unsupported");let l=[],u=I(i,a)-2;for(;u>0;){let e=w(i.buffer,a),t=T(i,a),n=t>>2&3,r=new Int8Array([(t>>4)-1])[0],o=T(i,a);l.push({name:e,index:r,type:o,compression:n}),u-=e.length+3}let c=F.channels,h=Array(e.inputChannels.length);for(let t=0;t<e.inputChannels.length;++t){let n=h[t]={},r=c[t];n.name=r.name,n.compression=0,n.decoded=!1,n.type=r.pixelType,n.pLinear=r.pLinear,n.width=e.columns,n.height=e.lines}let p={idx:[,,,]};for(let t=0;t<e.inputChannels.length;++t){let e=h[t];for(let n=0;n<l.length;++n){let r=l[n];e.name==r.name&&(e.compression=r.compression,r.index>=0&&(p.idx[r.index]=t),e.offset=t)}}if(s.acCompressedSize>0)switch(s.acCompression){case 0:t=new Uint16Array(s.totalAcUncompressedCount),d(e.array,i,a,s.acCompressedSize,t,s.totalAcUncompressedCount);break;case 1:t=new Uint16Array(Fd(e.array.slice(a.value,a.value+s.totalAcUncompressedCount)).buffer),a.value+=s.totalAcUncompressedCount}s.dcCompressedSize>0&&(n=new Uint16Array(y({array:e.array,offset:a,size:s.dcCompressedSize}).buffer),a.value+=s.dcCompressedSize),s.rleRawSize>0&&(r=m(Fd(e.array.slice(a.value,a.value+s.rleCompressedSize)).buffer),a.value+=s.rleCompressedSize);let f=0,g=Array(h.length);for(let e=0;e<g.length;++e)g[e]=[];for(let t=0;t<e.lines;++t)for(let t=0;t<h.length;++t)g[t].push(f),f+=h[t].width*e.type*2;!function(e,t,n,r,i,a){let o=new DataView(a.buffer),s=n[e.idx[0]].width,l=n[e.idx[0]].height,u=Math.floor(s/8),c=Math.ceil(s/8),h=Math.ceil(l/8),d=s-(c-1)*8,p=l-(h-1)*8,f={value:0},m=[,,,],g=[,,,],v=[,,,],y=[,,,],b=[,,,];for(let n=0;n<3;++n)b[n]=t[e.idx[n]],m[n]=n<1?0:m[n-1]+c*h,g[n]=new Float32Array(64),v[n]=new Uint16Array(64),y[n]=new Uint16Array(64*c);for(let t=0;t<h;++t){let a=8;t==h-1&&(a=p);let s=8;for(let e=0;e<c;++e){e==c-1&&(s=d);for(let e=0;e<3;++e){var x,_;v[e].fill(0),v[e][0]=i[m[e]++],function(e,t,n){let r,i=1;for(;i<64;)65280==(r=t[e.value])?i=64:r>>8==255?i+=255&r:(n[i]=r,i++),e.value++}(f,r,v[e]),x=v[e],(_=g[e])[0]=P(x[0]),_[1]=P(x[1]),_[2]=P(x[5]),_[3]=P(x[6]),_[4]=P(x[14]),_[5]=P(x[15]),_[6]=P(x[27]),_[7]=P(x[28]),_[8]=P(x[2]),_[9]=P(x[4]),_[10]=P(x[7]),_[11]=P(x[13]),_[12]=P(x[16]),_[13]=P(x[26]),_[14]=P(x[29]),_[15]=P(x[42]),_[16]=P(x[3]),_[17]=P(x[8]),_[18]=P(x[12]),_[19]=P(x[17]),_[20]=P(x[25]),_[21]=P(x[30]),_[22]=P(x[41]),_[23]=P(x[43]),_[24]=P(x[9]),_[25]=P(x[11]),_[26]=P(x[18]),_[27]=P(x[24]),_[28]=P(x[31]),_[29]=P(x[40]),_[30]=P(x[44]),_[31]=P(x[53]),_[32]=P(x[10]),_[33]=P(x[19]),_[34]=P(x[23]),_[35]=P(x[32]),_[36]=P(x[39]),_[37]=P(x[45]),_[38]=P(x[52]),_[39]=P(x[54]),_[40]=P(x[20]),_[41]=P(x[22]),_[42]=P(x[33]),_[43]=P(x[38]),_[44]=P(x[46]),_[45]=P(x[51]),_[46]=P(x[55]),_[47]=P(x[60]),_[48]=P(x[21]),_[49]=P(x[34]),_[50]=P(x[37]),_[51]=P(x[47]),_[52]=P(x[50]),_[53]=P(x[56]),_[54]=P(x[59]),_[55]=P(x[61]),_[56]=P(x[35
1232]),_[57]=P(x[36]),_[58]=P(x[48]),_[59]=P(x[49]),_[60]=P(x[57]),_[61]=P(x[58]),_[62]=P(x[62]),_[63]=P(x[63]),function(e){let t=.5*Math.cos(3*3.14159/16),n=.5*Math.cos(3*3.14159/8),r=[,,,,],i=[,,,,],a=[,,,,],o=[,,,,];for(let s=0;s<8;++s){let l=8*s;r[0]=.4619398297234211*e[l+2],r[1]=n*e[l+2],r[2]=.4619398297234211*e[l+6],r[3]=n*e[l+6],i[0]=.4903926563794112*e[l+1]+t*e[l+3]+.2777854612564676*e[l+5]+.09754573032714427*e[l+7],i[1]=t*e[l+1]-.09754573032714427*e[l+3]-.4903926563794112*e[l+5]-.2777854612564676*e[l+7],i[2]=.2777854612564676*e[l+1]-.4903926563794112*e[l+3]+.09754573032714427*e[l+5]+t*e[l+7],i[3]=.09754573032714427*e[l+1]-.2777854612564676*e[l+3]+t*e[l+5]-.4903926563794112*e[l+7],a[0]=.35355362513961314*(e[l+0]+e[l+4]),a[3]=.35355362513961314*(e[l+0]-e[l+4]),a[1]=r[0]+r[3],a[2]=r[1]-r[2],o[0]=a[0]+a[1],o[1]=a[3]+a[2],o[2]=a[3]-a[2],o[3]=a[0]-a[1],e[l+0]=o[0]+i[0],e[l+1]=o[1]+i[1],e[l+2]=o[2]+i[2],e[l+3]=o[3]+i[3],e[l+4]=o[3]-i[3],e[l+5]=o[2]-i[2],e[l+6]=o[1]-i[1],e[l+7]=o[0]-i[0]}for(let s=0;s<8;++s)r[0]=.4619398297234211*e[16+s],r[1]=n*e[16+s],r[2]=.4619398297234211*e[48+s],r[3]=n*e[48+s],i[0]=.4903926563794112*e[8+s]+t*e[24+s]+.2777854612564676*e[40+s]+.09754573032714427*e[56+s],i[1]=t*e[8+s]-.09754573032714427*e[24+s]-.4903926563794112*e[40+s]-.2777854612564676*e[56+s],i[2]=.2777854612564676*e[8+s]-.4903926563794112*e[24+s]+.09754573032714427*e[40+s]+t*e[56+s],i[3]=.09754573032714427*e[8+s]-.2777854612564676*e[24+s]+t*e[40+s]-.4903926563794112*e[56+s],a[0]=.35355362513961314*(e[s]+e[32+s]),a[3]=.35355362513961314*(e[s]-e[32+s]),a[1]=r[0]+r[3],a[2]=r[1]-r[2],o[0]=a[0]+a[1],o[1]=a[3]+a[2],o[2]=a[3]-a[2],o[3]=a[0]-a[1],e[0+s]=o[0]+i[0],e[8+s]=o[1]+i[1],e[16+s]=o[2]+i[2],e[24+s]=o[3]+i[3],e[32+s]=o[3]-i[3],e[40+s]=o[2]-i[2],e[48+s]=o[1]-i[1],e[56+s]=o[0]-i[0]}(g[e])}var w=g;for(let e=0;e<64;++e){let t=w[0][e],n=w[1][e],r=w[2][e];w[0][e]=t+1.5747*r,w[1][e]=t-.1873*n-.4682*r,w[2][e]=t+1.8556*n}for(let t=0;t<3;++t)!function(e,t,n){for(let i=0;i<64;++i){var r;t[n+i]=aA.toHalfFloat((r=e[i])<=1?Math.sign(r)*Math.pow(Math.abs(r),2.2):Math.sign(r)*Math.pow(9.025013291561939,Math.abs(r)-1))}}(g[t],y[t],64*e)}let l=0;for(let r=0;r<3;++r){let i=n[e.idx[r]].type;for(let e=8*t;e<8*t+a;++e){l=b[r][e];for(let t=0;t<u;++t){let n=64*t+(7&e)*8;o.setUint16(l+0*i,y[r][n+0],!0),o.setUint16(l+2*i,y[r][n+1],!0),o.setUint16(l+4*i,y[r][n+2],!0),o.setUint16(l+6*i,y[r][n+3],!0),o.setUint16(l+8*i,y[r][n+4],!0),o.setUint16(l+10*i,y[r][n+5],!0),o.setUint16(l+12*i,y[r][n+6],!0),o.setUint16(l+14*i,y[r][n+7],!0),l+=16*i}}if(u!=c)for(let e=8*t;e<8*t+a;++e){let t=b[r][e]+8*u*2*i,n=64*u+(7&e)*8;for(let e=0;e<s;++e)o.setUint16(t+2*e*i,y[r][n+e],!0)}}}let M=new Uint16Array(s);o=new DataView(a.buffer);for(let t=0;t<3;++t){n[e.idx[t]].decoded=!0;let r=n[e.idx[t]].type;if(2==n[t].type)for(let e=0;e<l;++e){let n=b[t][e];for(let e=0;e<s;++e)M[e]=o.getUint16(n+2*e*r,!0);for(let e=0;e<s;++e)o.setFloat32(n+2*e*r,P(M[e]),!0)}}}(p,g,h,t,n,o);for(let t=0;t<h.length;++t){let n=h[t];if(!n.decoded)if(2===n.compression){let i=0,a=0;for(let s=0;s<e.lines;++s){let e=g[t][i];for(let t=0;t<n.width;++t){for(let t=0;t<2*n.type;++t)o[e++]=r[a+t*n.width*n.height];a++}i++}}else throw Error("EXRLoader.parse: unsupported channel compression")}return new DataView(o.buffer)}function w(e,t){let n=new Uint8Array(e),r=0;for(;0!=n[t.value+r];)r+=1;let i=new TextDecoder().decode(n.slice(t.value,t.value+r));return t.value=t.value+r+1,i}function M(e,t){let n=e.getInt32(t.value,!0);return t.value=t.value+4,n}function E(e,t){let n=e.getUint32(t.value,!0);return t.value=t.value+4,n}function S(e,t){let n=e[t.value];return t.value=t.value+1,n}function T(e,t){let n=e.getUint8(t.value);return t.value=t.value+1,n}let A=function(e,t){let n;return n="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,n};function C(e,t){let n=e.getFloat32(t.value,!0);return t.value+=4,n}function R(e,t){return aA.toHalfFloat(C(e,t))}function P(e){let t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:Math.pow(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}function I(e,t){let n=e.getUint16(t.value,!0);return t.value+=2,n}function O(e,t){return P(I(e,t))}function L(e,t,n,r){let i=Array(e);for(let a=0;a<e;a++){let e=1<<a,o=t/e|0;"ROUND_UP"==r&&o*e<t&&(o+=1);let s=Math.max(o,1);i[a]=(s+n-1)/n|0}return i}function D(){let e=this.offset,t={value:0};for(let n=0;n<this.tileCount;n++){let n=M(this.viewer,e),r=M(this.viewer,e);e.value+=8,this.size=E(this.viewer,e);let i=n*this.blockWidth,a=r*this.blockHeight;this.columns=i+this.blockWidth>this.width?this.width-i:this.blockWidth,this.lines=a+this.blockHeight>this.height?this.height-a:this.blockHeight;let o=this.columns*this.totalBytes,s=this.size<this.lines*o?this.uncompress(this):g(this);e.value+=this.size;
1232for(let e=0;e<this.lines;e++){let n=e*this.columns*this.totalBytes;for(let r=0;r<this.inputChannels.length;r++){let o=F.channels[r].name,l=this.channelByteOffsets[o]*this.columns,u=this.decodeChannels[o];if(void 0===u)continue;t.value=n+l;let c=(this.height-(1+a+e))*this.outLineWidth;for(let e=0;e<this.columns;e++){let n=c+(e+i)*this.outputChannels+u;this.byteArray[n]=this.getter(s,t)}}}}}function N(){let e=this.offset,t={value:0};for(let n=0;n<this.height/this.blockHeight;n++){let r=M(this.viewer,e)-F.dataWindow.yMin;this.size=E(this.viewer,e),this.lines=r+this.blockHeight>this.height?this.height-r:this.blockHeight;let i=this.columns*this.totalBytes,a=this.size<this.lines*i?this.uncompress(this):g(this);e.value+=this.size;for(let e=0;e<this.blockHeight;e++){let r=n*this.blockHeight,o=e+this.scanOrder(r);if(o>=this.height)continue;let s=e*i,l=(this.height-1-o)*this.outLineWidth;for(let e=0;e<this.inputChannels.length;e++){let n=F.channels[e].name,r=this.channelByteOffsets[n]*this.columns,i=this.decodeChannels[n];if(void 0!==i){t.value=s+r;for(let e=0;e<this.columns;e++){let n=l+e*this.outputChannels+i;this.byteArray[n]=this.getter(a,t)}}}}}}let U={value:0},k=new DataView(e),B=new Uint8Array(e),F=function(e,t,n){let r={};if(0x1312f76!=e.getUint32(0,!0))throw Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");r.version=e.getUint8(4);let i=e.getUint8(5);r.spec={singleTile:!!(2&i),longName:!!(4&i),deepFormat:!!(8&i),multiPart:!!(16&i)},n.value=8;let a=!0;for(;a;){let i=w(t,n);if(0==i)a=!1;else{let a=w(t,n),o=E(e,n),s=function(e,t,n,r,i){if("string"===r||"stringvector"===r||"iccProfile"===r){let e=new TextDecoder().decode(new Uint8Array(t).slice(n.value,n.value+i));return n.value=n.value+i,e}if("chlist"===r)return function(e,t,n,r){let i=n.value,a=[];for(;n.value<i+r-1;){let r=w(t,n),i=M(e,n),o=T(e,n);n.value+=3;let s=M(e,n),l=M(e,n);a.push({name:r,pixelType:i,pLinear:o,xSampling:s,ySampling:l})}return n.value+=1,a}(e,t,n,i);if("chromaticities"===r)return function(e,t){let n=C(e,t),r=C(e,t),i=C(e,t),a=C(e,t),o=C(e,t),s=C(e,t);return{redX:n,redY:r,greenX:i,greenY:a,blueX:o,blueY:s,whiteX:C(e,t),whiteY:C(e,t)}}(e,n);if("compression"===r)return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][T(e,n)];if("box2i"===r){let t=M(e,n),r=M(e,n);return{xMin:t,yMin:r,xMax:M(e,n),yMax:M(e,n)}}else if("envmap"===r)return["ENVMAP_LATLONG","ENVMAP_CUBE"][T(e,n)];else if("tiledesc"===r){let t=E(e,n),r=E(e,n),i=T(e,n);return{xSize:t,ySize:r,levelMode:["ONE_LEVEL","MIPMAP_LEVELS","RIPMAP_LEVELS"][15&i],roundingMode:["ROUND_DOWN","ROUND_UP"][i>>4]}}else if("lineOrder"===r)return["INCREASING_Y","DECREASING_Y","RANDOM_Y"][T(e,n)];else if("float"===r)return C(e,n);else if("v2f"===r)return[C(e,n),C(e,n)];else if("v3f"===r){let t=C(e,n);return[t,C(e,n),C(e,n)]}else if("int"===r)return M(e,n);else if("rational"===r)return[M(e,n),E(e,n)];else if("timecode"===r)return[E(e,n),E(e,n)];else return"preview"===r?(n.value+=i,"skipped"):(n.value+=i,void 0)}(e,t,n,a,o);void 0===s?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${a}'.`):r[i]=s}}if((-7&i)!=0)throw console.error("THREE.EXRHeader:",r),Error("THREE.EXRLoader: Provided file is currently unsupported.");return r}(k,e,U),z=function(e,t,n,r,i){let a={size:0,viewer:t,array:n,offset:r,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,inputChannels:e.channels,channelByteOffsets:{},scanOrder:null,totalBytes:null,columns:null,lines:null,type:null,uncompress:null,getter:null,format:null,colorSpace:rO};switch(e.compression){case"NO_COMPRESSION":a.blockHeight=1,a.uncompress=g;break;case"RLE_COMPRESSION":a.blockHeight=1,a.uncompress=v;break;case"ZIPS_COMPRESSION":a.blockHeight=1,a.uncompress=y;break;case"ZIP_COMPRESSION":a.blockHeight=16,a.uncompress=y;break;case"PIZ_COMPRESSION":a.blockHeight=32,a.uncompress=b;break;case"PXR24_COMPRESSION":a.blockHeight=16,a.uncompress=x;break;case"DWAA_COMPRESSION":a.blockHeight=32,a.uncompress=_;break;case"DWAB_COMPRESSION":a.blockHeight=256,a.uncompress=_;break;default:throw Error("EXRLoader.parse: "+e.compression+" is unsupported")}let o={};for(let t of e.channels)switch(t.name){case"Y":case"R":case"G":case"B":case"A":o[t.name]=!0,a.type=t.pixelType}let s=!1;if(o.R&&o.G&&o.B)s=!o.A,a.outputChannels=4,a.decodeChannels={R:0,G:1,B:2,A:3};else if(o.Y)a.outputChannels=1,a.decodeChannels={Y:0};else throw Error("EXRLoader.parse: file contains unsupported data channels.");if(1==a.type)switch(i){case 1015:a.getter=O;break;case 1016:a.getter=I}else if(2==a.type)switch(i){case 1015:a.getter=C;break;case 1016:a.getter=R}else throw Error("EXRLoader.parse: unsupported pixelType "+a.type+" for "+e.compression+".");a.columns=a.width;let l=a.width*a.height*a.outputChannels;switch(i){case 1015:a.byteArray=new Float32Array(l),s&&a.byteArray.fill(1,0,l);break;case 1016:a.byteArray=new Uint16Array(l),s&&a.byteArray.fill(15360,0,l);break;default:console.error("THREE.EXRLoader: unsupported type: ",i)}let u=0;for(let t of e.channels)void 0!==a.decodeChannels[t.name]&&(a.channelByteOffsets[t.name]=u),u+=2*t.pixelType;if(a.totalBytes=u,a.outLineWidth=a.width*a.outputChannels,"INCREASING_Y"===e.lineOrder?a.scanOrder=e=>e:a.scanOrder=e=>
1232a.height-1-e,4==a.outputChannels?(a.format=1023,a.colorSpace=rO):(a.format=1028,a.colorSpace=""),e.spec.singleTile){a.blockHeight=e.tiles.ySize,a.blockWidth=e.tiles.xSize;let n=function(e,t,n){let r=0;switch(e.levelMode){case"ONE_LEVEL":r=1;break;case"MIPMAP_LEVELS":r=function(e,t){let n=Math.log2(e);return"ROUND_DOWN"==t?Math.floor(n):Math.ceil(n)}(Math.max(t,n),e.roundingMode)+1;break;case"RIPMAP_LEVELS":throw Error("THREE.EXRLoader: RIPMAP_LEVELS tiles currently unsupported.")}return r}(e.tiles,a.width,a.height),i=L(n,a.width,e.tiles.xSize,e.tiles.roundingMode),o=L(n,a.height,e.tiles.ySize,e.tiles.roundingMode);a.tileCount=i[0]*o[0];for(let e=0;e<n;e++)for(let n=0;n<o[e];n++)for(let n=0;n<i[e];n++)A(t,r);a.decode=D.bind(a)}else{a.blockWidth=a.width;let e=Math.ceil(a.height/a.blockHeight);for(let n=0;n<e;n++)A(t,r);a.decode=N.bind(a)}return a}(F,k,B,U,this.type);return z.decode(),{header:F,width:z.width,height:z.height,data:z.byteArray,format:z.format,colorSpace:z.colorSpace,type:this.type}}setDataType(e){return this.type=e,this}load(e,t,n,r){return super.load(e,function(e,n){e.colorSpace=n.colorSpace,e.minFilter=1006,e.magFilter=1006,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,n)},n,r)}}var Fm=Object.defineProperty,Fg=Object.getOwnPropertySymbols,Fv=Object.prototype.hasOwnProperty,Fy=Object.prototype.propertyIsEnumerable,Fb=(e,t,n)=>t in e?Fm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fx=(e,t)=>{for(var n in t||(t={}))Fv.call(t,n)&&Fb(e,n,t[n]);if(Fg)for(var n of Fg(t))Fy.call(t,n)&&Fb(e,n,t[n]);return e},F_=Object.defineProperty,Fw=Object.defineProperties,FM=Object.getOwnPropertyDescriptors,FE=Object.getOwnPropertySymbols,FS=Object.prototype.hasOwnProperty,FT=Object.prototype.propertyIsEnumerable,FA=(e,t,n)=>t in e?F_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FC=(e,t)=>{for(var n in t||(t={}))FS.call(t,n)&&FA(e,n,t[n]);if(FE)for(var n of FE(t))FT.call(t,n)&&FA(e,n,t[n]);return e},FR=(e,t)=>Fw(e,FM(t)),FP=(e,t,n)=>(FA(e,"symbol"!=typeof t?t+"":t,n),n),FI=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},FO=(e,t,n)=>(FI(e,t,"read from private field"),n?n.call(e):t.get(e)),FL=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},FD=(e,t,n,r)=>(FI(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);let FN=Math.PI/180,FU=180/Math.PI;class Fk extends rF{constructor(e,{mapProjection:t,mapGroups:n,backgroundColor:r,center:i=[0,0],minZoom:a=0,maxZoom:o=Number.MAX_SAFE_INTEGER,zoom:s=20,zoomSpeed:l=1,minRotation:u=-1/0,maxRotation:c=1/0,rotation:h=0,rotationSpeed:d=1,minTilt:p=0,maxTilt:f=45,tilt:m=0,maxBounds:g=[[-1/0,-1/0],[1/0,1/0]],damping:v=!1,dampingFactor:y=.25,debug:b=!1}={}){super(),FP(this,"refresh",function(){FD(this,n7,!0)}),FP(this,"addMapGroup",function(e){this.addMapGroups([e])}),FP(this,"addMapGroups",function(e){FO(this,rr).call(this,e),FD(this,n7,!0)}),FP(this,"removeMapGroup",function(e){this.removeMapGroups([e])}),FP(this,"removeMapGroups",function(e){e&&(e.forEach(e=>{FO(this,n3).remove(e.threeObject)}),FD(this,n7,!0))}),FP(this,"setZoom",function(e,t={}){if(FO(this,nG))return;let n=t.animate||!1,r=t.duration||1e3,i=t.delay||0,a=t.easing||"linear",o=t.onAnimationEnd,s=Math.min(Math.max(t.minZoom||FO(this,nF).minZoom,e),t.maxZoom||FO(this,nF).maxZoom);if(s===FO(this,nW)){n&&o&&o();return}let l=e=>{FD(this,nW,e),FO(this,n5).zoom=ht(e);let{near:t,far:n}=hr(e);FO(this,n5).near=t,FO(this,n5).far=n,FO(this,n5).updateProjectionMatrix(),FD(this,n7,!0)};if(n){FD(this,nG,!0),this.dispatchEvent({type:"zoomChangeBegin",zoom:FO(this,nW)});let e={zoom:FO(this,nW)};k8({targets:e,zoom:s,duration:r,delay:i,easing:a,update:()=>{l(e.zoom),this.dispatchEvent({type:"zoomChangeSequence",zoom:e.zoom})},complete:()=>{FD(this,nG,!1),this.dispatchEvent({type:"zoomChangeSequence",zoom:s}),this.dispatchEvent({type:"zoomChangeEnd",zoom:s}),o&&o()}})}else l(s),this.dispatchEvent({type:"zoomChange",zoom:s})}),FP(this,"setZoomRange",function(e,t,n={}){FO(this,nF).minZoom=e,FO(this,nF).maxZoom=t;let r=FO(this,nW),i=Math.min(Math.max(e,r),t);if(i===r||!n.animate){FO(this,n4).minZoom=ht(e),FO(this,n4).maxZoom=ht(t),this.setZoom(i);return}FO(this,n4).minZoom=ht(1),FO(this,n4).maxZoom=ht(100),this.setZoom(i,FR(FC({},n),{onAnimationEnd:()=>{FO(this,n4).minZoom=ht(e),FO(this,n4).maxZoom=ht(t),n.onAnimationEnd&&n.onAnimationEnd()}}))}),FP(this,"setRotation",function(e,t={}){if(FO(this,nX))return;let n=t.animate||!1,r=t.duration||1e3,i=t.delay||0,a=t.easing||"linear",o=t.onAnimationEnd,{minRotation:s,maxRotation:l}=FO(this,nF),u=Math.min(Math.max(s,e),l),c=FO(this,nF).damping;if(u===FO(this,nV)){n&&o&&o();return}c&&(FO(this,n4).enableDamping=!1);let h=e=>{FD(this,nV,e),FO(this,n4).setAzimuthalAngle(FN*e),FO(this,n4).update(),FD(this,n7,!0)};if(n){FD(this,nX,!0);let e={rotation:FO(this,nV)};k8({targets:e,rotation:u,duration:r,delay:i,easing:a,update:()=>{h(e.rotation),this.dispatchEvent({type:"rotationChangeSequence",rotation:e.rotation})},complete:()=>{FD(this,nX,!1),FO(this,n4).enableDamping=c,this.dispatchEvent({type:"rotationChangeSequence",rotation:u}),o&&o()}})}else h(u),FO(this,n4).enableDamping=c,this.dispatchEvent({type:"rotationChange",rotation:u})}),FP(this,"setRotationRange",function(e,t,n={}){FO(this,nF).minRotation=e,FO(this,nF).maxRotation=t;let r=FO(this,nV),i=Math.min(Math.max(e,r),t);if(i===r||!n.animate){FO(this,n4).minAzimuthAngle=FN*e,FO(this,n4).maxAzimuthAngle=FN*t,this.setRotation(i);return}FO(this,n4).minAzimuthAngle=-360*FN,FO(this,n4).maxAzimuthAngle=360*FN,this.setRotation(i,FR(FC({},n),{onAnimationEnd:()=>{FO(this,n4).minAzimuthAngle=FN*e,FO(this,n4).maxAzimuthAngle=FN*t,n.onAnimationEnd&&n.onAnimationEnd()}}))}),FP(this,"setTilt",function(e,t={}){if(FO(this,nY))return;let n=t.animate||!1,r=t.duration||1e3,i=t.delay||0,a=t.easing||"linear",o=t.onAnimationEnd,{minTilt:s,maxTilt:l}=FO(this,nF),u=Math.min(Math.max(s,e),l),c=FO(this,nF).damping;if(u===FO(this,nq)){n&&o&&o();return}c&&(FO(this,n4).enableDamping=!1);let h=e=>{FD(this,nq,e),FO(this,n4).setPolarAngle(FN*e),FO(this,n4).update(),FD(this,n7,!0)};if(n){FD(this,nY,!0);let e={tilt:FO(this,nq)};k8({targets:e,tilt:u,duration:r,delay:i,easing:a,update:()=>{h(e.tilt),this.dispatchEvent({type:"tiltChangeSequence",tilt:e.tilt})},complete:()=>{FD(this,nY,!1),FO(this,n4).enableDamping=c,this.dispatchEvent({type:"tiltChangeSequence",tilt:u}),o&&o()}})}else h(u),FO(this,n4).enableDamping=c,this.dispatchEvent({type:"tiltChange",tilt:u})}),FP(this,"setTiltRange",function(e,t,n={}){FO(this,nF).minTilt=e,FO(this,nF).maxTilt=t;let r=FO(this,nq),i=Math.min(Math.max(e,r),t);if(i===r||!n.animate){FO(this,n4).minPolarAngle=FN*e,FO(this,n4).maxPolarAngle=FN*t,this.setTilt(i);return}FO(this,n4).minPolarAngle=0*FN,FO(this,n4).maxPolarAngle=90*FN,this.setTilt(i,FR(FC({},n),{onAnimationEnd:()=>{FO(this,n4).minPolarAngle=FN*e,FO(this,n4).maxPolarAngle=FN*t,n.onAnimationEnd&&n.onAnimationEnd()}}))}),FP(this,"setView",function(e,t={}){if(FO(this,nj))return;FD(this,nH,FO(this,nz).project(e));let[n,r]=FO(this,nH),{zoom:i,rotation:a,tilt:o,paddings:s}=t,l=t.animate||!1,u=t.duration||500,c=t.delay||0,h=t.easing||"linear",d=t.onAnimationEnd,p=t.minZoom||FO(this,nF).minZoom,f=t.maxZoom||FO(this,nF).maxZoom,m=i&&Math.min(Math.max(p,i),f),g=FO(this,nF).damping;Number.isFinite(a)&&this.setRotation(a,FR(FC({},t),{onAnimationEnd:null})),Number.isFinite(o)&&this.setTilt(o,FR(FC({},t),{onAnimationEnd:null})),g&&(FO(this,n4).enableDamping=!1);let v=()=>{let e=new ih(n,0,r);if(s){let t=s.paddingTop||0,n=s.paddingBottom||0,r=s.paddingLeft||0,i=s.paddingRight||0,a=FO(this,n$),o=FO(this,nK),l=a/2,u=o/2,c=FO(this,ra).call(this,new rY(l,u)),h=FO(this,ra).call(this,new rY(l+1,u)).sub(c).length(),d=new ih(0,1,0),p=FO(this,n4).getAzimuthalAngle(),f=new ih(1,0,0),m=new ih(0,0,1),g=f.setLength((i/2-r/2)*h).applyAxisAngle(d,p),v=m.setLength((n/2-t/2)*h).applyAxisAngle(d,p);e.add(g).add(v)}return e},y=e=>{FD(this,nW,e),FO(this,n5).zoom=ht(e),FO(this,n5).updateProjectionMatrix(),FD(this,n7,!0)},b=({x:e,z:t})=>{FO(this,n4).setTarget(new ih(e,0,t)),FO(this,n4).update(),FD(this,n7,!0)};if(l){FD(this,nj,!0);let e=FO(this,nW),t=FO(this,n4).target.clone(),n={percent:0};m&&(FD(this,nG,!0),this.dispatchEvent({type:"zoomChangeBegin",zoom:e})),k8({targets:n,percent:100,duration:u,delay:c,easing:h,update:()=>{if(m){let t=e+(m-e)*n.percent/100;y(t),this.dispatchEvent({type:"zoomChangeSequence",zoom:t})}let r=v().sub(t),i=r.length();b(r.normalize().multiplyScalar(i*n.percent/100).add(t))},complete:()=>{FD(this,nj,!1),FO(this,n4).enableDamping=g,m&&(FD(this,nG,!1),this.dispatchEvent({type:"zoomChangeSequence",zoom:m}),this.dispatchEvent({type:"zoomChangeEnd",zoom:m})),d&&d()}})}else m&&y(m),b(v()),FO(this,n4).enableDamping=g,m&&this.dispatchEvent({type:"zoomChange",zoom:m})}),FP(this,"fitBounds",function(e,t={}
1232){let n=FO(this,n5),r=FO(this,n$),i=FO(this,nK),a=FO(this,nz),{padding:o=0,paddingTop:s=0,paddingBottom:l=0,paddingLeft:u=0,paddingRight:c=0,maxZoom:h}=t,{rotation:d,tilt:p}=FO(this,nF),[[f,m],[g,v]]=e,y=o||s,b=o||l,x=o||u,_=o||c,[w,M]=a.project([f,m]),[E,S]=a.project([g,v]),T=w+(E-w)/2,A=M+(S-M)/2;this.setView(a.unproject([T,A]),{rotation:d,tilt:p});let C=FO(this,ri).call(this,new rY(w,M)),R=FO(this,ri).call(this,new rY(E,S)),P=FO(this,ri).call(this,new rY(w,S)),I=FO(this,ri).call(this,new rY(E,M)),O=new rY(Math.min(C.x,P.x,I.x,R.x),Math.min(C.y,P.y,I.y,R.y)),L=new rY(Math.max(C.x,P.x,I.x,R.x),Math.max(C.y,P.y,I.y,R.y)),D=Math.abs(L.x-O.x),N=Math.min(Math.abs(r-(x+_))/D,Math.abs(i-(y+b))/Math.abs(L.y-O.y)),U=n.zoom*N;if(this.setZoom(hn(U),{maxZoom:h}),x||_||y||b){let e=FO(this,ra).call(this,new rY(r/2+_/2-x/2,i/2+b/2-y/2));this.setView(a.unproject([e.x,e.z]),{rotation:d,tilt:p})}}),FP(this,"fitPoints",function(e,t={}){let n=FO(this,n5),r=FO(this,n$),i=FO(this,nK),a=FO(this,nz),{padding:o=0,paddingTop:s=0,paddingBottom:l=0,paddingLeft:u=0,paddingRight:c=0,maxZoom:h}=t,d=o||s,p=o||l,f=o||u,m=o||c,g=e.map(e=>a.project(e)),v=g.map(([e,t])=>FO(this,ri).call(this,new rY(e,t))),y=v.map(({x:e})=>e),b=v.map(({y:e})=>e),x=Math.min(...y),_=Math.min(...b),w=Math.min(Math.abs(r-(f+m))/Math.abs(Math.max(...y)-x),Math.abs(i-(d+p))/Math.abs(Math.max(...b)-_)),M=n.zoom*w;this.setZoom(hn(M),{maxZoom:h});let E=g.reduce((e,[t,n])=>{let r=t<e.minX?t:e.minX,i=n<e.minY?n:e.minY,a=t>e.maxX?t:e.maxX,o=n>e.maxY?n:e.maxY;return{minX:r,minY:i,maxX:a,maxY:o,centerX:r+(a-r)/2,centerY:i+(o-i)/2}},{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,centerX:0,centerY:0});this.setView(a.unproject([E.centerX,E.centerY]));let S=FO(this,ra).call(this,new rY(r/2+m/2-f/2,i/2+p/2-d/2));this.setView(a.unproject([S.x,S.z]))}),FP(this,"projectScreenToXZ",function([e,t]){return FO(this,ra).call(this,new rY(e,t))}),FP(this,"findIntersections",function(e,t,n){let r=FO(this,n3),i=FO(this,n6);return i.set(e,t),n=n||r.children,i.intersectObjects(n)}),FP(this,"getMapObjects",function(e){let t=FO(this,n3),n=[];return t.traverse(t=>{e(t)&&n.push(t)}),n}),FP(this,"filterMapObjects",function(e){FO(this,n3).traverse(t=>{t.visible=e(t.userData)}),FD(this,n7,!0)}),FP(this,"dimMapObjects",function(e){FO(this,n3).traverse(t=>{if(!t||!t.userData||!t.material)return;let n=e(t.userData);Number.isFinite(n)&&(t.material.isShaderMaterial?t.material.uniforms.alpha.value=n:t.material.opacity=n)}),FD(this,n7,!0)}),FP(this,"captureScreenshot",function({onComplete:e}){let t=FO(this,n1),n=FO(this,n5),r=FO(this,n3),i=t.getSize(new rY),a=t.getContext(),o=a.getParameter(a.MAX_TEXTURE_SIZE),s=a.getParameter(a.MAX_RENDERBUFFER_SIZE),l=.8*Math.min(o,s),u=i.width,c=Math.min(Math.floor(l/u),Math.floor(l/i.height)),h=i.width*c,d=i.height*c;FO(this,nF).debug&&(console.log(`maxTextureSize: ${o}`),console.log(`maxRenderbufferSize: ${s}`),console.log(`scaleFactor: ${c}`),console.log(`width: ${h}`),console.log(`height: ${d}`));let p=new is(h,d,{format:1023,type:1009,colorSpace:rI,anisotropy:t.capabilities.getMaxAnisotropy(),samples:5}),f=n.aspect;n.aspect=h/d,n.updateProjectionMatrix(),t.setRenderTarget(p),t.render(r,n),t.setRenderTarget(null);let m=new Uint8Array(h*d*4);t.readRenderTargetPixels(p,0,0,h,d,m);let g=new Uint8Array(h*d*4);for(let e=0;e<d;e++){let t=e*h*4,n=(d-e-1)*h*4;g.set(m.subarray(t,t+4*h),n)}let v=document.createElement("canvas");v.width=h,v.height=d;let y=v.getContext("2d"),b=y.createImageData(h,d);b.data.set(g),y.putImageData(b,0,0),v.toBlob(function(a){let o=document.createElement("a");o.href=URL.createObjectURL(a),o.download="map.png",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(o.href),p.dispose(),n.aspect=f,n.updateProjectionMatrix(),t.setSize(i.width,i.height,!1),t.render(r,n),e&&e()},"image/png")}),FP(this,"dispose",function(){if(FO(this,n9))return;let e=FO(this,nZ);FO(this,n0).disconnect(),FO(this,n8).forEach(({type:t,handler:n,useCapture:r})=>{e.removeEventListener(t,n,r)}),FO(this,n3).traverse(e=>{e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()}),FO(this,n4).dispose(),FO(this,n1).renderLists.dispose(),FO(this,n1).dispose(),FD(this,n3,null),FD(this,n5,null),FD(this,n1,null),FD(this,n9,!0)}),FL(this,nF,{}),FL(this,nz,void 0),FL(this,nH,void 0),FL(this,nj,!1),FL(this,nW,void 0),FL(this,nG,!1),FL(this,nV,void 0),FL(this,nX,!1),FL(this,nq,void 0),FL(this,nY,!1),FL(this,nZ,void 0),FL(this,n$,void 0),FL(this,nK,void 0),FL(this,nJ,void 0),FL(this,nQ,void 0),FL(this,n0,void 0),FL(this,n1,void 0),FL(this,n2,void 0),FL(this,n3,void 0),FL(this,n5,void 0),FL(this,n4,void 0),FL(this,n6,void 0),FL(this,n8,[]),FL(this,n7,!1),FL(this,n9,!1),FL(this,re,function(){let{backgroundColor:e,minZoom:t,maxZoom:n,zoomSpeed:r,minRotation:i,maxRotation:a,rotationSpeed:o,minTilt:s,maxTilt:l,maxBounds:u,damping:c,dampingFactor:h}=FO(this,nF),[d,p]=FO(this,nH),f=FO(this,nW),m=FO(this,nV),g=FO(this,nq),v=FO(this,nZ),y=v.clientWidth,b=v.clientHeight,x=v.getBoundingClientRect(),_=x.left,w=x.top,M=FO(this,nz),[E,S]=[M.project(u[0]),M.project(u[1])],T=Math.min(E[0],S[0]),A=Math.max(E[0],S[0]),C=Math.min(E[1],S[1]),R=Math.max(E[1],S[1]),P=new lU({antialias:!0}),I=window.devicePixelRatio||1;
1232P.setPixelRatio(I),P.setSize(y/I,b/I),P.outputColorSpace=rI,P.toneMapping=1,P.toneMappingExposure=1,P.domElement.style.cssText=`
1233      position: absolute;
1234      top: 0;
1235      left: 0;
1236      z-index: 1;
1237      touch-action: none;
1238    `,v.appendChild(P.domElement),v.style.position="relative";let O=new wm;O.setSize(y,b),O.domElement.style.position="absolute",O.domElement.style.top=0,O.domElement.style.touchAction="none",v.appendChild(O.domElement);let L=new lk;L.background=new a_(e),L.position.set(d,0,p);let D=y/b,{near:N,far:U}=hr(f),k=new oL(-(1e3*D)/2,1e3*D/2,500,-500,N,U);k.position.set(d,1e3,p),k.zoom=ht(f,{minZoom:t,maxZoom:n}),k.updateProjectionMatrix();let B=new Be(k,O.domElement);B.width=y,B.height=b,B.offsetLeft=_,B.offsetTop=w,B.minPolarAngle=FN*s,B.maxPolarAngle=FN*l,B.minAzimuthAngle=FN*i,B.maxAzimuthAngle=FN*a,B.minZoom=ht(t),B.maxZoom=ht(n),B.zoomSpeed=r,B.rotateSpeed=o,B.maxBounds=[[T,C],[A,R]],B.enableDamping=c,B.dampingFactor=h,B.touches={ONE:rR.PAN,TWO:rR.DOLLY_ROTATE},B.target=new ih(d,0,p),B.setAzimuthalAngle(FN*m),B.setPolarAngle(FN*g),B.update(),B.addEventListener("change",()=>{FD(this,nH,[B.target.x,B.target.z]),this.dispatchEvent({type:"centerChange",center:M.unproject(FO(this,nH))})}),B.addEventListener("zoomChange",()=>{let e=FO(this,n5),t=FO(this,nF).minZoom,n=FO(this,nF).maxZoom,r=hn(e.zoom,{minZoom:t,maxZoom:n});if(FO(this,nW)===r)return;FD(this,nW,r);let{near:i,far:a}=hr(r);(e.near!==i||e.far!==a)&&(e.near=i,e.far=a,e.updateProjectionMatrix()),this.dispatchEvent({type:"zoomChangeSequence",user:!0,zoom:r})}),B.addEventListener("rotationChange",()=>{let e=B.getAzimuthalAngle()*FU;FO(this,nV)!==e&&(FD(this,nV,e),this.dispatchEvent({type:"rotationChangeSequence",user:!0,rotation:e}))}),B.addEventListener("tiltChange",()=>{let e=B.getPolarAngle()*FU;FO(this,nq)!==e&&(FD(this,nq,e),this.dispatchEvent({type:"tiltChangeSequence",user:!0,tilt:e}))}),B.addEventListener("userPanning",()=>{this.dispatchEvent({type:"userPanning",user:!0})});let F=new c4,z=new wp(vA(FO(this,rt).bind(this),500));z.observe(v),function(e,t,n){let r=new BY;r.setDecoderPath("https://www.gstatic.com/draco/versioned/decoders/1.5.6/"),r.setDecoderConfig({type:"js"});let i=new Bt;i.setDRACOLoader(r);let a=/(Mobi|Android|iPhone|iPad|iPod)/i.test(navigator.userAgent);i.load(a?"models-mobile.glb":"models.glb",r=>{new Ff().load("envmap.exr",i=>{i.mapping=304;let a=new oG(e);a.compileEquirectangularShader();let o=a.fromEquirectangular(i).texture;a.dispose(),r.scene.traverse(function(e){"Scene"!==e.name&&(e.isGroup&&e.children.forEach(t=>{t.userData=Fx(Fx({},e.userData),t.userData)}),e.userData.gltf=!0,e.isMesh&&(e.material.envMap=o,e.material.envMapIntensity=1,e.material.transparent=!0,e.material.needsUpdate=!0))}),t.add(r.scene),n()})},e=>{},e=>{n()})}(P,L,()=>{this.refresh(),setTimeout(()=>{this.dispatchEvent({type:"ready"})},100)}),FD(this,n$,y),FD(this,nK,b),FD(this,nJ,_),FD(this,nQ,w),FD(this,n0,z),FD(this,n1,P),FD(this,n2,O),FD(this,n3,L),FD(this,n5,k),FD(this,n4,B),FD(this,n6,F)}),FL(this,rt,function(){let e=FO(this,nZ),t=e.clientWidth,n=e.clientHeight,r=e.getBoundingClientRect(),i=r.left,a=r.top,o=t/n;FO(this,n5).left=-(1e3*o)/2,FO(this,n5).right=1e3*o/2,FO(this,n5).updateProjectionMatrix(),FO(this,n4).width=t,FO(this,n4).height=n,FO(this,n4).offsetLeft=i,FO(this,n4).offsetTop=a,FO(this,n1).setSize(t,n),FO(this,n2).setSize(t,n),FD(this,n$,t),FD(this,nK,n),FD(this,nJ,i),FD(this,nQ,a),FD(this,n7,!0)}),FL(this,rn,function(){let e=FO(this,nZ),t=!0,n=null,r=null,i=e=>{t=!0,e.changedTouches?(n=e.changedTouches[0].clientX,r=e.changedTouches[0].clientY):(n=e.clientX,r=e.clientY)},a=e=>{if(n&&r){let i=e.changedTouches?e.changedTouches[0].clientX:e.clientX,a=e.changedTouches?e.changedTouches[0].clientY:e.clientY;Math.abs(n-i)+Math.abs(r-a)>20&&(t=!1)}},o=e=>{if(t){let t=FO(this,n3),n=FO(this,n5),r=FO(this,n6),i=FO(this,n$),a=FO(this,nK),o=e,s=Math.max((e=e.changedTouches?e.changedTouches[0]:e).clientX-FO(this,nJ),0),l=Math.max(e.clientY-FO(this,nQ),0),{x:u,z:c}=FO(this,ra).call(this,new rY(s,l)),[h,d]=FO(this,nz).unproject([u,c]),p={type:"click",originalEvent:o,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,x:s,y:l,latitude:h,longitude:d},f=s/i*2-1,m=-(l/a*2)+1;r.setFromCamera(new rY(f,m),n);let g=r.intersectObjects(t.children,!0),v=g.find(({object:{userData:e}})=>e&&"unit"===e.type&&"floor"===e.part);v&&(p.unit={id:v.object.userData.id,category:v.object.userData.category}),this.dispatchEvent(p),FO(this,nF).debug&&console.log(g.map(e=>e.object.userData))}};e.addEventListener("touchstart",i,!0),e.addEventListener("mousedown",i,!0),e.addEventListener("touchmove",a,!0),e.addEventListener("mousemove",a,!0),e.addEventListener("touchend",o,!0),e.addEventListener("mouseup",o,!0),FO(this,n8).push({type:"touchstart",handler:i,useCapture:!0}),FO(this,n8).push({type:"mousedown",handler:i,useCapture:!0}),FO(this,n8).push({type:"touchmove",handler:a,useCapture:!0}),FO(this,n8).push({type:"mousemove",handler:a,useCapture:!0}),FO(this,n8).push({type:"touchend",handler:o,useCapture:!0}),FO(this,n8).push({type:"mouseup",handler:o,useCapture:!0})}
1238),FL(this,rr,function(e){e&&e.filter(Boolean).forEach(e=>{e.threeObject.renderOrder=1,FO(this,n3).add(e.threeObject)})}),FL(this,ri,function(e){let t=FO(this,n5),n=FO(this,n$),r=FO(this,nK);t.updateWorldMatrix();let i=e instanceof rY?new ih(e.x,0,e.y).project(t):new ih(e.x,0,e.z).project(t);return new rY(Math.round((i.x+1)*n/2),Math.round((-i.y+1)*r/2))}),FL(this,ra,function(e){let t=FO(this,n5),n=FO(this,n6),r=FO(this,n$),i=FO(this,nK),a=new rY(e.x/r*2-1,-(2*(e.y/i))+1);n.setFromCamera(a,t);let o=n.ray.origin,s=n.ray.direction,l=-o.y/s.y;return o.clone().add(s.multiplyScalar(l))}),FL(this,ro,function(e,t){let n=t-1;return e<=n?1:t<=e?0:1-(e-n)/1}),FL(this,rs,function(){let e=FO(this,nW);FO(this,n3).traverse(t=>{var n,r;if(!t||!t.userData||!t.material)return;let i=null!=(n=t.userData.minZoom)?n:0,a=null!=(r=t.userData.maxZoom)?r:1e3;if(i<=0&&a>=1e3)return;let o=e<=i?1-FO(this,ro).call(this,e,i):e<=a?FO(this,ro).call(this,e,a):a<e?0:null;Number.isFinite(o)&&(t.material.isShaderMaterial?t.material.uniforms.alpha.value=o:t.material.opacity=o)})}),FL(this,rl,function(){FO(this,rs).call(this),FO(this,n1).render(FO(this,n3),FO(this,n5)),FO(this,n2).render(FO(this,n3),FO(this,n5))}),FD(this,nF,{backgroundColor:r,center:i,minZoom:a,maxZoom:o,zoom:s,zoomSpeed:l,minRotation:u,maxRotation:c,rotation:h,rotationSpeed:d,minTilt:p,maxTilt:f,tilt:m,maxBounds:g,damping:v,dampingFactor:y,debug:b}),FD(this,nz,t),FD(this,nH,t.project(i)),FD(this,nW,s),FD(this,nV,h),FD(this,nq,m),FD(this,nZ,"string"==typeof e?document.querySelector(e):e),FO(this,re).call(this),FO(this,rr).call(this,n),FO(this,rn).call(this);let x=()=>{let e=FO(this,n4).needsUpdate,t=FO(this,n7);e&&FO(this,n4).update(),(e||t)&&(FO(this,rl).call(this),FD(this,n7,!1)),requestAnimationFrame(x)};x()}set followMouseOnZoom(e){FO(this,n4).followMouseOnZoom=e}set rotationDisabled(e){FO(this,n4).rotationDisabled=e}set panningDisabled(e){FO(this,n4).panningDisabled=e}get container(){return FO(this,nZ)}get center(){return FO(this,nz).unproject(FO(this,nH))}get zoom(){return FO(this,nW)}get rotation(){return FO(this,nV)}get tilt(){return FO(this,nq)}get width(){return FO(this,n$)}get height(){return FO(this,nK)}get offsetLeft(){return FO(this,nJ)}get offsetTop(){return FO(this,nQ)}get type(){return"MapEngine"}}nF=new WeakMap,nz=new WeakMap,nH=new WeakMap,nj=new WeakMap,nW=new WeakMap,nG=new WeakMap,nV=new WeakMap,nX=new WeakMap,nq=new WeakMap,nY=new WeakMap,nZ=new WeakMap,n$=new WeakMap,nK=new WeakMap,nJ=new WeakMap,nQ=new WeakMap,n0=new WeakMap,n1=new WeakMap,n2=new WeakMap,n3=new WeakMap,n5=new WeakMap,n4=new WeakMap,n6=new WeakMap,n8=new WeakMap,n7=new WeakMap,n9=new WeakMap,re=new WeakMap,rt=new WeakMap,rn=new WeakMap,rr=new WeakMap,ri=new WeakMap,ra=new WeakMap,ro=new WeakMap,rs=new WeakMap,rl=new WeakMap;var FB=Object.freeze({__proto__:null,default:Fk}),FF=Object.defineProperty,Fz=(e,t,n)=>(((e,t,n)=>t in e?FF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),n),FH=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Fj=(e,t,n)=>(FH(e,t,"read from private field"),n?n.call(e):t.get(e));function FW(e){return Math.round(1e3*e)/1e3}let FG=2*Math.PI*6378137/2;function FV(e,t){let n=t/FG*180;return[n=180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2),e/FG*180]}class FX{constructor({origin:e}){((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,ru,void 0),Fz(this,"projectToOrigin",function([e,t]){let n=Fj(this,ru),[r,i]=this.project([e,t]);return[r-n[0],i-n[1]]}),Fz(this,"unprojectFromOrigin",function([e,t]){let n=Fj(this,ru),[r,i]=FV(e+n[0],t+n[1]);return[r,i]}),Fz(this,"originToWorld",function([e,t]){let n=Fj(this,ru);return[e+n[0],t+n[1]]}),Fz(this,"project",function([e,t]){let n;if(!Number.isFinite(e)&&!Number.isFinite(t))return[e,t];let[r,i]=(n=(n=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180))*FG/180,[t*FG/180,n]);return[FW(r),-FW(i)]}),Fz(this,"unproject",function([e,t]){let[n,r]=FV(e,-t);return[n,r]}),((e,t,n,r)=>(FH(e,t,"write to private field"),r?r.call(e,n):t.set(e,n)))(this,ru,this.project(e))}get origin(){return Fj(this,ru)}}ru=new WeakMap;var Fq=Object.freeze({__proto__:null,default:FX})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.