diff --git "a/index.html" "b/index.html" --- "a/index.html" +++ "b/index.html" @@ -13138,11 +13138,11 @@ div#notebook {
# Installing the dependencies within the notebook to make it easier to run on colab
-%pip install -Uqq fastai ipywidgets
+%pip install -Uqq fastai ipywidgets plotly
from fastai.basics import torch, plt
@@ -13200,7 +13200,7 @@ div#notebook {
# Function with quadratic expression ax^2 + bx + c
@@ -13243,7 +13243,7 @@ div#notebook {
# Add both multiplicative and additive noise to input x
@@ -13290,7 +13290,7 @@ div#notebook {
from ipywidgets import interact
@@ -13310,12 +13310,12 @@ div#notebook {
-
@@ -13333,7 +13333,7 @@ var element = $('#6e3cc0e5-7334-4e10-bcd0-2a4e7d0a530d');
-In [16]:
+In [6]:
def mean_absolute_error(preds, acts): return (torch.abs(preds-acts)).mean()
@@ -13378,7 +13378,7 @@ Prediction: 4.0, Actual: 4.2, Absolute Difference: 0.200
-In [17]:
+In [7]:
@interact(a=1.5, b=1.5, c=1.5)
@@ -13397,12 +13397,12 @@ Prediction: 4.0, Actual: 4.2, Absolute Difference: 0.200
-👉 If you were walking on a hill (representing the error surface), the partial derivative with respect to one direction (say, the 'a' direction) tells you the slope of the hill in that specific direction. A steep slope/gradient means a large change in error for a small change in 'a'.
For example, if we consider the partial derivative of the mean absolute error with respect to a
(while keeping b
and c
fixed), a negative value would indicate that increasing a
will lead to a decrease in the error (like walking forward-downhill in the 'a' direction). Conversely, a positive value would suggest that decreasing a
would reduce the error (ackwardly walking backwards-downhill in the 'a' direction 😄).
-With PyTorch we can use the require_grad=True
on tensors and it automatically handles the differentiation and the calculation of the gradients for us. Which tbh looks a bit like dark magic. Let's use AI to understand how it works by doing two Example on a function like $f(x) = m*x + b$ , and two different inputs (x1
and x2
)🕵️♂️
+Using AI, we can plot this hill. The following plot shows the "error surface" (MAE) for the function $f(x) = m*x + b$. By fixing one variable (e.g., b=2
), we can visualize the differentiated function in terms of m
and determine whether to increase or decrease m
to move "downhill."
@@ -13423,84 +13423,96 @@ var element = $('#1771a6fb-fef3-416d-abe9-ae15bebfbd55');
-In [18]:
+In [8]:
-#########################################
-# Example 1: Using x1 = [1.0, 2.0, 3.0]
-#########################################
-x1 = torch.tensor([1.0, 2.0, 3.0])
-m1 = torch.tensor(2.0, requires_grad=True)
-b1 = torch.tensor(1.0, requires_grad=True)
+import plotly.graph_objects as go
-# Compute f(x1) = m1 * x1 + b1
-y1 = m1 * x1 + b1
-total1 = y1.sum() # total1 = m1*(1+2+3) + b1*3 = 6*m1 + 3*b1
+def demo_mae_surface():
+ # Actual data points
+ x_actual = torch.tensor([1.0, 2.0])
+ y_actual = torch.tensor([2.0, 4.0])
-# Compute gradients for m1 and b1.
-total1.backward()
+ # Range of m and b values to explore
+ m_vals = torch.linspace(-1, 5, 100) # Explore m from -1 to 5
+ b_vals = torch.linspace(-1, 5, 100) # Explore b from -1 to 5
-print(f'Example 1 | x: {x1}, m: {m1}, b: {b1}')
-print("Example 1 | Gradient with respect to m1 (m1.grad):", m1.grad) # Expected: sum(x1) = 6.0
-print("Example 1 | Gradient with respect to b1 (b1.grad):", b1.grad) # Expected: len(x1) = 3
-print("--------------")
+ # Create a meshgrid of m and b values
+ M, B = torch.meshgrid(m_vals, b_vals, indexing='ij')
-#########################################
-# Example 2: Using x2 = [1.0, 4.0] (different size and values)
-#########################################
-x2 = torch.tensor([1.0, 4.0])
-m2 = torch.tensor(2.0, requires_grad=True)
-b2 = torch.tensor(1.0, requires_grad=True)
+ # Initialize an array to store MAE values for the surface plot
+ mae_values_surface = torch.zeros_like(M)
-# Compute f(x2) = m2 * x2 + b2
-y2 = m2 * x2 + b2
-total2 = y2.sum() # total2 = m2*(1+4) + b2*2 = 5*m2 + 2*b2
+ # Calculate MAE for each combination of m and b for the surface plot
+ for i in range(M.shape[0]):
+ for j in range(M.shape[1]):
+ m = M[i, j]
+ b = B[i, j]
+ preds = m * x_actual + b
+ mae = mean_absolute_error(preds, y_actual)
+ mae_values_surface[i, j] = mae.item() # Store the scalar value
-# Compute gradients for m2 and b2.
-total2.backward()
+ # --- Calculate MAE for fixed b to show gradient of m ---
+ fixed_b = 2.0 # Fixed b value
+ mae_values_fixed_b = []
+ for m in m_vals:
+ preds = m * x_actual + fixed_b
+ mae = mean_absolute_error(preds, y_actual)
+ mae_values_fixed_b.append(mae.item())
-print(f'Example 2 | x: {x2}, m: {m2}, b: {b2}')
-print("Example 2 | Gradient with respect to m2 (m2.grad):", m2.grad) # Expected: sum(x2) = 5.0
-print("Example 2 | Gradient with respect to b2 (b2.grad):", b2.grad) # Expected: len(x2) = 2
-print("--------------")
-# Print an explanation that details the differentiation steps.
-explanation = """
-Explanation:
-- **Example 1:**
- - We start with a list of numbers: x1 = [1.0, 2.0, 3.0].
- - We plug each number into our function, which means we multiply it by m (let's say m = 2) and then add b (let's say b = 1):
- - For 1.0: f(1.0) = 2 * 1 + 1 = 3
- - For 2.0: f(2.0) = 2 * 2 + 1 = 5
- - For 3.0: f(3.0) = 2 * 3 + 1 = 7
- - So, we end up with y1 = [3.0, 5.0, 7.0].
- - Then, we add these numbers together: 3 + 5 + 7 = 15.
- - If we look at our equation, we can say: total1 = m1*(1.0+2.0+3.0) + b1*3 = 6 * m1 + 3 * b1.
- - Now, when we want to see how changing m1 and b1 affects total1, we find:
- - Changing m1 gives us a "gradient" of 6.
- - Changing b1 gives us a "gradient" of 3.
- - So, m1.grad = 6.0 and b1.grad = 3.
+ # Create the surface plot using Plotly
+ fig = go.Figure(data=[go.Surface(z=mae_values_surface.numpy(), x=b_vals.numpy(), y=m_vals.numpy(), colorscale='RdBu', name='MAE Surface')])
-- **Example 2:**
- - Now we have a different list: x2 = [1.0, 4.0].
- - We use the same m and b:
- - For 1.0: f(1.0) = 3 (same as before).
- - For 4.0: f(4.0) = 2 * 4 + 1 = 9.
- - So, now we have y2 = [3.0, 9.0].
- - We add these: 3 + 9 = 12.
- - In terms of our equation, total2 = m2*(1.0+4.0) + b2*2 = 5 * m2 + 2 * b2.
- - For the gradients:
- - Changing m2 gives us a "gradient" of 5.
- - Changing b2 gives us a "gradient" of 2.
- - So, m2.grad = 5.0 and b2.grad = 2.
-"""
-print(explanation)
+ # Add the line plot for fixed b, offsetting z values slightly
+ z_offset_line = 0.1 # Offset to lift the line above the surface
+ fig.add_trace(go.Scatter3d(
+ x=[fixed_b] * len(m_vals), # Fixed b value for all m values
+ y=m_vals.numpy(),
+ z=[z + z_offset_line for z in mae_values_fixed_b], # Add offset to z values
+ mode='lines',
+ line=dict(color='green', width=4),
+ name=f'MAE with fixed b={fixed_b}'
+ ))
+
+ # Add annotation - Adjusted for better readability, offsetting z value slightly
+ annotation_m = 2.0
+ annotation_mae = mean_absolute_error(annotation_m * x_actual + fixed_b, y_actual).item()
+ z_offset_point = 0.1 # Offset to lift the point above the surface
+ fig.add_trace(go.Scatter3d(
+ x=[fixed_b],
+ y=[annotation_m],
+ z=[annotation_mae + z_offset_point], # Add offset to z value
+ mode='markers+text',
+ marker=dict(size=8, color='red'),
+ text=["At m=2, decrease m to go dowhill"], # Shortened text
+ textposition="top center", # Changed text position to top center
+ textfont=dict(size=10) # Reduced text size
+ ))
+
+
+ fig.update_layout(
+ title='3D Error Surface: Mean Absolute Error (MAE) for f(x) = mx + b<br>with line showing gradient of m at fixed b=2', # Added <br> for title wrapping
+ scene=dict(
+ xaxis_title='b (y-intercept)',
+ yaxis_title='m (slope)',
+ zaxis_title='MAE',
+ camera=dict(eye=dict(x=1.5, y=-1.5, z=0.8)) # Rotate perspective
+ ),
+ width=700,
+ height=700
+ )
+
+
+ fig.show()
+
+demo_mae_surface()
@@ -13509,105 +13521,7989 @@ var element = $('#1771a6fb-fef3-416d-abe9-ae15bebfbd55');
-
-
-
-
-
-
-In [20]:
+`).concat(WR(e),`
+`));var s=new U_({actual:e,expected:t,message:r,operator:i,stackStartFn:n});throw s.generatedMessage=o,s}}sf.match=function e(t,r,n){gMe(t,r,n,e,"match")};sf.doesNotMatch=function e(t,r,n){gMe(t,r,n,e,"doesNotMatch")};function mMe(){for(var e=arguments.length,t=new Array(e),r=0;r{var vE=1e3,pE=vE*60,gE=pE*60,mE=gE*24,zMt=mE*365.25;_Me.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return FMt(e);if(r==="number"&&isNaN(e)===!1)return t.long?OMt(e):qMt(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function FMt(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*zMt;case"days":case"day":case"d":return r*mE;case"hours":case"hour":case"hrs":case"hr":case"h":return r*gE;case"minutes":case"minute":case"mins":case"min":case"m":return r*pE;case"seconds":case"second":case"secs":case"sec":case"s":return r*vE;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qMt(e){return e>=mE?Math.round(e/mE)+"d":e>=gE?Math.round(e/gE)+"h":e>=pE?Math.round(e/pE)+"m":e>=vE?Math.round(e/vE)+"s":e+"ms"}function OMt(e){return JR(e,mE,"day")||JR(e,gE,"hour")||JR(e,pE,"minute")||JR(e,vE,"second")||e+" ms"}function JR(e,t,r){if(!(e{$u=bMe.exports=jj.debug=jj.default=jj;$u.coerce=HMt;$u.disable=UMt;$u.enable=NMt;$u.enabled=VMt;$u.humanize=xMe();$u.names=[];$u.skips=[];$u.formatters={};var Gj;function BMt(e){var t=0,r;for(r in e)t=(t<<5)-t+e.charCodeAt(r),t|=0;return $u.colors[Math.abs(t)%$u.colors.length]}function jj(e){function t(){if(t.enabled){var r=t,n=+new Date,i=n-(Gj||n);r.diff=i,r.prev=Gj,r.curr=n,Gj=n;for(var a=new Array(arguments.length),o=0;o{lp=AMe.exports=wMe();lp.log=WMt;lp.formatArgs=jMt;lp.save=ZMt;lp.load=TMe;lp.useColors=GMt;lp.storage=typeof chrome!="undefined"&&typeof chrome.storage!="undefined"?chrome.storage.local:XMt();lp.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function GMt(){return typeof window!="undefined"&&window.process&&window.process.type==="renderer"?!0:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}lp.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}};function jMt(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+lp.humanize(this.diff),!!t){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(a){a!=="%%"&&(n++,a==="%c"&&(i=n))}),e.splice(i,0,r)}}function WMt(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function ZMt(e){try{e==null?lp.storage.removeItem("debug"):lp.storage.debug=e}catch(t){}}function TMe(){var e;try{e=lp.storage.debug}catch(t){}return!e&&typeof process!="undefined"&&"env"in process&&(e=process.env.DEBUG),e}lp.enable(TMe());function XMt(){try{return window.localStorage}catch(e){}}});var RMe=ye((Scr,IMe)=>{var p5=tE(),V_=SMe()("stream-parser");IMe.exports=KMt;var EMe=-1,$R=0,YMt=1,kMe=2;function KMt(e){var t=e&&typeof e._transform=="function",r=e&&typeof e._write=="function";if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");V_("extending Parser into stream"),e._bytes=JMt,e._skipBytes=$Mt,t&&(e._passthrough=QMt),t?e._transform=t4t:e._write=e4t}function yE(e){V_("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=EMe,e._parserCallback=null,typeof e.push=="function"&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function JMt(e,t){p5(!this._parserCallback,'there is already a "callback" set!'),p5(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||yE(this),V_("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=$R}function $Mt(e,t){p5(!this._parserCallback,'there is already a "callback" set!'),p5(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||yE(this),V_("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=YMt}function QMt(e,t){p5(!this._parserCallback,'There is already a "callback" set!'),p5(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||yE(this),V_("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=kMe}function e4t(e,t,r){this._parserInit||yE(this),V_("write(%o bytes)",e.length),typeof t=="function"&&(r=t),LMe(this,e,null,r)}function t4t(e,t,r){this._parserInit||yE(this),V_("transform(%o bytes)",e.length),typeof t!="function"&&(t=this._parserOutput),LMe(this,e,t,r)}function CMe(e,t,r,n){return e._parserBytesLeft<=0?n(new Error("got data but not currently parsing anything")):t.length<=e._parserBytesLeft?function(){return MMe(e,t,r,n)}:function(){var i=t.slice(0,e._parserBytesLeft);return MMe(e,i,r,function(a){if(a)return n(a);if(t.length>i.length)return function(){return CMe(e,t.slice(i.length),r,n)}})}}function MMe(e,t,r,n){if(e._parserBytesLeft-=t.length,V_("%o bytes left for stream piece",e._parserBytesLeft),e._parserState===$R?(e._parserBuffers.push(t),e._parserBuffered+=t.length):e._parserState===kMe&&r(t),e._parserBytesLeft===0){var i=e._parserCallback;if(i&&e._parserState===$R&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),e._parserState!==$R&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=EMe,e._parserBuffers.splice(0),i){var a=[];t&&a.push(t),r&&a.push(r);var o=i.length>a.length;o&&a.push(PMe(n));var s=i.apply(e,a);if(!o||n===s)return n}}else return n}var LMe=PMe(CMe);function PMe(e){return function(){for(var t=e.apply(this,arguments);typeof t=="function";)t=t();return t}}});var Eu=ye(Gy=>{"use strict";var DMe=MAe().Transform,r4t=RMe();function _E(){DMe.call(this,{readableObjectMode:!0})}_E.prototype=Object.create(DMe.prototype);_E.prototype.constructor=_E;r4t(_E.prototype);Gy.ParserStream=_E;Gy.sliceEq=function(e,t,r){for(var n=t,i=0;i{"use strict";var g5=Eu().readUInt16BE,Zj=Eu().readUInt32BE;function xE(e,t){if(e.length<4+t)return null;var r=Zj(e,t);return e.length>4&15,n=e[4]&15,i=e[5]>>4&15,a=g5(e,6),o=8,s=0;sa.width||i.width===a.width&&i.height>a.height?i:a}),r=e.reduce(function(i,a){return i.height>a.height||i.height===a.height&&i.width>a.width?i:a}),n;return t.width>r.height||t.width===r.height&&t.height>r.width?n=t:n=r,n}eD.exports.readSizeFromMeta=function(e){var t={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(s4t(e,t),!!t.sizes.length){var r=l4t(t.sizes),n=1;t.transforms.forEach(function(a){var o={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},s={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(a.type==="imir"&&(a.value===0?n=s[n]:(n=s[n],n=o[n],n=o[n])),a.type==="irot")for(var l=0;l{"use strict";function tD(e,t){var r=new Error(e);return r.code=t,r}function u4t(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}function jy(e,t,r){this.input=e.subarray(t,r),this.start=t;var n=String.fromCharCode.apply(null,this.input.subarray(0,4));if(n!=="II*\0"&&n!=="MM\0*")throw tD("invalid TIFF signature","EBADDATA");this.big_endian=n[0]==="M"}jy.prototype.each=function(e){this.aborted=!1;var t=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:t}];this.ifds_to_read.length>0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}};jy.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw tD("unexpected EOF","EBADDATA");return this.big_endian?t[e]*256+t[e+1]:t[e]+t[e+1]*256};jy.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw tD("unexpected EOF","EBADDATA");return this.big_endian?t[e]*16777216+t[e+1]*65536+t[e+2]*256+t[e+3]:t[e]+t[e+1]*256+t[e+2]*65536+t[e+3]*16777216};jy.prototype.is_subifd_link=function(e,t){return e===0&&t===34665||e===0&&t===34853||e===34665&&t===40965};jy.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}};jy.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t],r;case 6:return r=this.input[t],r|(r&128)*33554430;case 3:return r=this.read_uint16(t),r;case 8:return r=this.read_uint16(t),r|(r&32768)*131070;case 4:return r=this.read_uint32(t),r;case 9:return r=this.read_uint32(t),r|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}};jy.prototype.scan_ifd=function(e,t,r){var n=this.read_uint16(t);t+=2;for(var i=0;ithis.input.length)throw tD("unexpected EOF","EBADDATA");for(var h=[],d=c,v=0;v0&&(this.ifds_to_read.push({id:a,offset:h[0]}),f=!0);var b={is_big_endian:this.big_endian,ifd:e,tag:a,format:o,count:s,entry_offset:t+this.start,data_length:u,data_offset:c+this.start,value:h,is_subifd_link:f};if(r(b)===!1){this.aborted=!0;return}t+=12}e===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})};Xj.exports.ExifParser=jy;Xj.exports.get_orientation=function(e){var t=0;try{return new jy(e,0,e.length).each(function(r){if(r.ifd===0&&r.tag===274&&Array.isArray(r.value))return t=r.value[0],!1}),t}catch(r){return-1}}});var qMe=ye((Ccr,FMe)=>{"use strict";var c4t=Eu().str2arr,f4t=Eu().sliceEq,h4t=Eu().readUInt32BE,iD=zMe(),d4t=rD(),v4t=c4t("ftyp");FMe.exports=function(e){if(f4t(e,4,v4t)){var t=iD.unbox(e,0);if(t){var r=iD.getMimeType(t.data);if(r){for(var n,i=t.end;;){var a=iD.unbox(e,i);if(!a)break;if(i=a.end,a.boxtype==="mdat")return;if(a.boxtype==="meta"){n=a.data;break}}if(n){var o=iD.readSizeFromMeta(n);if(o){var s={width:o.width,height:o.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(o.variants.length>1&&(s.variants=o.variants),o.orientation&&(s.orientation=o.orientation),o.exif_location&&o.exif_location.offset+o.exif_location.length<=e.length){var l=h4t(e,o.exif_location.offset),u=e.slice(o.exif_location.offset+l+4,o.exif_location.offset+o.exif_location.length),c=d4t.get_orientation(u);c>0&&(s.orientation=c)}return s}}}}}}});var NMe=ye((Lcr,BMe)=>{"use strict";var p4t=Eu().str2arr,g4t=Eu().sliceEq,OMe=Eu().readUInt16LE,m4t=p4t("BM");BMe.exports=function(e){if(!(e.length<26)&&g4t(e,0,m4t))return{width:OMe(e,18),height:OMe(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}});var jMe=ye((Pcr,GMe)=>{"use strict";var HMe=Eu().str2arr,UMe=Eu().sliceEq,VMe=Eu().readUInt16LE,y4t=HMe("GIF87a"),_4t=HMe("GIF89a");GMe.exports=function(e){if(!(e.length<10)&&!(!UMe(e,0,y4t)&&!UMe(e,0,_4t)))return{width:VMe(e,6),height:VMe(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}});var XMe=ye((Icr,ZMe)=>{"use strict";var Yj=Eu().readUInt16LE,x4t=0,b4t=1,WMe=16;ZMe.exports=function(e){var t=Yj(e,0),r=Yj(e,2),n=Yj(e,4);if(!(t!==x4t||r!==b4t||!n)){for(var i=[],a={width:0,height:0},o=0;oa.width||l>a.height)&&(a=u)}return{width:a.width,height:a.height,variants:i,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}});var KMe=ye((Rcr,YMe)=>{"use strict";var Kj=Eu().readUInt16BE,w4t=Eu().str2arr,T4t=Eu().sliceEq,A4t=rD(),S4t=w4t("Exif\0\0");YMe.exports=function(e){if(!(e.length<2)&&!(e[0]!==255||e[1]!==216||e[2]!==255))for(var t=2;;){for(;;){if(e.length-t<2)return;if(e[t++]===255)break}for(var r=e[t++],n;r===255;)r=e[t++];if(208<=r&&r<=217||r===1)n=0;else if(192<=r&&r<=254){if(e.length-t<2)return;n=Kj(e,t)-2,t+=2}else return;if(r===217||r===218)return;var i;if(r===225&&n>=10&&T4t(e,t,S4t)&&(i=A4t.get_orientation(e.slice(t+6,t+n))),n>=5&&192<=r&&r<=207&&r!==196&&r!==200&&r!==204){if(e.length-t0&&(a.orientation=i),a}t+=n}}});var t4e=ye((Dcr,e4e)=>{"use strict";var QMe=Eu().str2arr,JMe=Eu().sliceEq,$Me=Eu().readUInt32BE,M4t=QMe(`\x89PNG\r
+
+`),E4t=QMe("IHDR");e4e.exports=function(e){if(!(e.length<24)&&JMe(e,0,M4t)&&JMe(e,12,E4t))return{width:$Me(e,16),height:$Me(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}});var n4e=ye((zcr,i4e)=>{"use strict";var k4t=Eu().str2arr,C4t=Eu().sliceEq,r4e=Eu().readUInt32BE,L4t=k4t("8BPS\0");i4e.exports=function(e){if(!(e.length<22)&&C4t(e,0,L4t))return{width:r4e(e,18),height:r4e(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}});var s4e=ye((Fcr,o4e)=>{"use strict";function P4t(e){return e===32||e===9||e===13||e===10}function m5(e){return typeof e=="number"&&isFinite(e)&&e>0}function I4t(e){var t=0,r=e.length;for(e[0]===239&&e[1]===187&&e[2]===191&&(t=3);t]*>/,D4t=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,z4t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,F4t=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,q4t=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,a4e=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function O4t(e){var t=e.match(z4t),r=e.match(F4t),n=e.match(q4t);return{width:t&&(t[1]||t[2]),height:r&&(r[1]||r[2]),viewbox:n&&(n[1]||n[2])}}function Nm(e){return a4e.test(e)?e.match(a4e)[0]:"px"}o4e.exports=function(e){if(I4t(e)){for(var t="",r=0;r{"use strict";var c4e=Eu().str2arr,l4e=Eu().sliceEq,B4t=Eu().readUInt16LE,N4t=Eu().readUInt16BE,U4t=Eu().readUInt32LE,V4t=Eu().readUInt32BE,H4t=c4e("II*\0"),G4t=c4e("MM\0*");function nD(e,t,r){return r?N4t(e,t):B4t(e,t)}function Jj(e,t,r){return r?V4t(e,t):U4t(e,t)}function u4e(e,t,r){var n=nD(e,t+2,r),i=Jj(e,t+4,r);return i!==1||n!==3&&n!==4?null:n===3?nD(e,t+8,r):Jj(e,t+8,r)}f4e.exports=function(e){if(!(e.length<8)&&!(!l4e(e,0,H4t)&&!l4e(e,0,G4t))){var t=e[0]===77,r=Jj(e,4,t)-8;if(!(r<0)){var n=r+8;if(!(e.length-n<2)){var i=nD(e,n+0,t)*12;if(!(i<=0)&&(n+=2,!(e.length-n{"use strict";var p4e=Eu().str2arr,d4e=Eu().sliceEq,v4e=Eu().readUInt16LE,$j=Eu().readUInt32LE,j4t=rD(),W4t=p4e("RIFF"),Z4t=p4e("WEBP");function X4t(e,t){if(!(e[t+3]!==157||e[t+4]!==1||e[t+5]!==42))return{width:v4e(e,t+6)&16383,height:v4e(e,t+8)&16383,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function Y4t(e,t){if(e[t]===47){var r=$j(e,t+1);return{width:(r&16383)+1,height:(r>>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function K4t(e,t){return{width:(e[t+6]<<16|e[t+5]<<8|e[t+4])+1,height:(e[t+9]<e.length)){for(;t+8=10?r=r||X4t(e,t+8):a==="VP8L"&&o>=9?r=r||Y4t(e,t+8):a==="VP8X"&&o>=10?r=r||K4t(e,t+8):a==="EXIF"&&(n=j4t.get_orientation(e.slice(t+8,t+8+o)),t=1/0),t+=8+o}if(r)return n>0&&(r.orientation=n),r}}}});var _4e=ye((Bcr,y4e)=>{"use strict";y4e.exports={avif:qMe(),bmp:NMe(),gif:jMe(),ico:XMe(),jpeg:KMe(),png:t4e(),psd:n4e(),svg:s4e(),tiff:h4e(),webp:m4e()}});var x4e=ye((Ncr,eW)=>{"use strict";var Qj=_4e();function J4t(e){for(var t=Object.keys(Qj),r=0;r{"use strict";var $4t=x4e(),Q4t=Ly().IMAGE_URL_PREFIX,eEt=u2().Buffer;b4e.getImageSize=function(e){var t=e.replace(Q4t,""),r=new eEt(t,"base64");return $4t(r)}});var S4e=ye((Vcr,A4e)=>{"use strict";var T4e=Mr(),tEt=jT(),rEt=uo(),aD=Qa(),iEt=Mr().maxRowLength,nEt=w4e().getImageSize;A4e.exports=function(t,r){var n,i;if(r._hasZ)n=r.z.length,i=iEt(r.z);else if(r._hasSource){var a=nEt(r.source);n=a.height,i=a.width}var o=aD.getFromId(t,r.xaxis||"x"),s=aD.getFromId(t,r.yaxis||"y"),l=o.d2c(r.x0)-r.dx/2,u=s.d2c(r.y0)-r.dy/2,c,f=[l,l+i*r.dx],h=[u,u+n*r.dy];if(o&&o.type==="log")for(c=0;c{"use strict";var lEt=xa(),T2=Mr(),M4e=T2.strTranslate,uEt=Zp(),cEt=jT(),fEt=jV(),hEt=a8().STYLE;E4e.exports=function(t,r,n,i){var a=r.xaxis,o=r.yaxis,s=!t._context._exportedPlot&&fEt();T2.makeTraceGroups(i,n,"im").each(function(l){var u=lEt.select(this),c=l[0],f=c.trace,h=(f.zsmooth==="fast"||f.zsmooth===!1&&s)&&!f._hasZ&&f._hasSource&&a.type==="linear"&&o.type==="linear";f._realImage=h;var d=c.z,v=c.x0,x=c.y0,b=c.w,g=c.h,E=f.dx,k=f.dy,A,L,_,C,M,p;for(p=0;A===void 0&&p0;)L=a.c2p(v+p*E),p--;for(p=0;C===void 0&&p0;)M=o.c2p(x+p*k),p--;if(LW[0];if(re||ae){var _e=A+T/2,Me=C+F/2;G+="transform:"+M4e(_e+"px",Me+"px")+"scale("+(re?-1:1)+","+(ae?-1:1)+")"+M4e(-_e+"px",-Me+"px")+";"}}X.attr("style",G);var ke=new Promise(function(ge){if(f._hasZ)ge();else if(f._hasSource)if(f._canvas&&f._canvas.el.width===b&&f._canvas.el.height===g&&f._canvas.source===f.source)ge();else{var ie=document.createElement("canvas");ie.width=b,ie.height=g;var Te=ie.getContext("2d",{willReadFrequently:!0});f._image=f._image||new Image;var Ee=f._image;Ee.onload=function(){Te.drawImage(Ee,0,0),f._canvas={el:ie,source:f.source},ge()},Ee.setAttribute("src",f.source)}}).then(function(){var ge,ie;if(f._hasZ)ie=H(function(Ae,ze){var Ce=d[ze][Ae];return T2.isTypedArray(Ce)&&(Ce=Array.from(Ce)),Ce}),ge=ie.toDataURL("image/png");else if(f._hasSource)if(h)ge=f.source;else{var Te=f._canvas.el.getContext("2d",{willReadFrequently:!0}),Ee=Te.getImageData(0,0,b,g).data;ie=H(function(Ae,ze){var Ce=4*(ze*b+Ae);return[Ee[Ce],Ee[Ce+1],Ee[Ce+2],Ee[Ce+3]]}),ge=ie.toDataURL("image/png")}X.attr({"xlink:href":ge,height:F,width:T,x:A,y:C})});t._promises.push(ke)})}});var L4e=ye((Gcr,C4e)=>{"use strict";var dEt=xa();C4e.exports=function(t){dEt.select(t).selectAll(".im image").style("opacity",function(r){return r[0].trace.opacity})}});var D4e=ye((jcr,R4e)=>{"use strict";var P4e=Nc(),I4e=Mr(),oD=I4e.isArrayOrTypedArray,vEt=jT();R4e.exports=function(t,r,n){var i=t.cd[0],a=i.trace,o=t.xa,s=t.ya;if(!(P4e.inbox(r-i.x0,r-(i.x0+i.w*a.dx),0)>0||P4e.inbox(n-i.y0,n-(i.y0+i.h*a.dy),0)>0)){var l=Math.floor((r-i.x0)/a.dx),u=Math.floor(Math.abs(n-i.y0)/a.dy),c;if(a._hasZ?c=i.z[u][l]:a._hasSource&&(c=a._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(l,u,1,1).data),!!c){var f=i.hi||a.hoverinfo,h;if(f){var d=f.split("+");d.indexOf("all")!==-1&&(d=["color"]),d.indexOf("color")!==-1&&(h=!0)}var v=vEt.colormodel[a.colormodel],x=v.colormodel||a.colormodel,b=x.length,g=a._scaler(c),E=v.suffix,k=[];(a.hovertemplate||h)&&(k.push("["+[g[0]+E[0],g[1]+E[1],g[2]+E[2]].join(", ")),b===4&&k.push(", "+g[3]+E[3]),k.push("]"),k=k.join(""),t.extraText=x.toUpperCase()+": "+k);var A;oD(a.hovertext)&&oD(a.hovertext[u])?A=a.hovertext[u][l]:oD(a.text)&&oD(a.text[u])&&(A=a.text[u][l]);var L=s.c2p(i.y0+(u+.5)*a.dy),_=i.x0+(l+.5)*a.dx,C=i.y0+(u+.5)*a.dy,M="["+c.slice(0,a.colormodel.length).join(", ")+"]";return[I4e.extendFlat(t,{index:[u,l],x0:o.c2p(i.x0+l*a.dx),x1:o.c2p(i.x0+(l+1)*a.dx),y0:L,y1:L,color:g,xVal:_,xLabelVal:_,yVal:C,yLabelVal:C,zLabelVal:M,text:A,hovertemplateLabels:{zLabel:M,colorLabel:k,"color[0]Label":g[0]+E[0],"color[1]Label":g[1]+E[1],"color[2]Label":g[2]+E[2],"color[3]Label":g[3]+E[3]}})]}}}});var F4e=ye((Wcr,z4e)=>{"use strict";z4e.exports=function(t,r){return"xVal"in r&&(t.x=r.xVal),"yVal"in r&&(t.y=r.yVal),r.xa&&(t.xaxis=r.xa),r.ya&&(t.yaxis=r.ya),t.color=r.color,t.colormodel=r.trace.colormodel,t.z||(t.z=r.color),t}});var O4e=ye((Zcr,q4e)=>{"use strict";q4e.exports={attributes:tG(),supplyDefaults:y3e(),calc:S4e(),plot:k4e(),style:L4e(),hoverPoints:D4e(),eventData:F4e(),moduleType:"trace",name:"image",basePlotModule:Jf(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}});var N4e=ye((Xcr,B4e)=>{"use strict";B4e.exports=O4e()});var A2=ye((Ycr,U4e)=>{"use strict";var pEt=vl(),gEt=Ju().attributes,mEt=Su(),yEt=dh(),_Et=Wo().hovertemplateAttrs,xEt=Wo().texttemplateAttrs,bE=no().extendFlat,bEt=Ed().pattern,sD=mEt({editType:"plot",arrayOk:!0,colorEditType:"plot"});U4e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:yEt.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:bEt,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:bE({},pEt.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:_Et({},{keys:["label","color","value","percent","text"]}),texttemplate:xEt({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:bE({},sD,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:bE({},sD,{}),outsidetextfont:bE({},sD,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:bE({},sD,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:gEt({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}});var S2=ye((Kcr,G4e)=>{"use strict";var wEt=uo(),wE=Mr(),TEt=A2(),AEt=Ju().defaults,SEt=r0().handleText,MEt=Mr().coercePattern;function V4e(e,t){var r=wE.isArrayOrTypedArray(e),n=wE.isArrayOrTypedArray(t),i=Math.min(r?e.length:1/0,n?t.length:1/0);if(isFinite(i)||(i=0),i&&n){for(var a,o=0;o0){a=!0;break}}a||(i=0)}return{hasLabels:r,hasValues:n,len:i}}function H4e(e,t,r,n,i){var a=n("marker.line.width");a&&n("marker.line.color",i?void 0:r.paper_bgcolor);var o=n("marker.colors");MEt(n,"marker.pattern",o),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=r.paper_bgcolor)}function EEt(e,t,r,n){function i(E,k){return wE.coerce(e,t,TEt,E,k)}var a=i("labels"),o=i("values"),s=V4e(a,o),l=s.len;if(t._hasLabels=s.hasLabels,t._hasValues=s.hasValues,!t._hasLabels&&t._hasValues&&(i("label0"),i("dlabel")),!l){t.visible=!1;return}t._length=l,H4e(e,t,n,i,!0),i("scalegroup");var u=i("text"),c=i("texttemplate"),f;if(c||(f=i("textinfo",wE.isArrayOrTypedArray(u)?"text+percent":"percent")),i("hovertext"),i("hovertemplate"),c||f&&f!=="none"){var h=i("textposition");SEt(e,t,n,i,h,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var d=Array.isArray(h)||h==="auto",v=d||h==="outside";v&&i("automargin"),(h==="inside"||h==="auto"||Array.isArray(h))&&i("insidetextorientation")}else f==="none"&&i("textposition","none");AEt(t,n,i);var x=i("hole"),b=i("title.text");if(b){var g=i("title.position",x?"middle center":"top center");!x&&g==="middle center"&&(t.title.position="top center"),wE.coerceFont(i,"title.font",n.font)}i("sort"),i("direction"),i("rotation"),i("pull")}G4e.exports={handleLabelsAndValues:V4e,handleMarkerDefaults:H4e,supplyDefaults:EEt}});var lD=ye((Jcr,j4e)=>{"use strict";j4e.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}});var Z4e=ye(($cr,W4e)=>{"use strict";var kEt=Mr(),CEt=lD();W4e.exports=function(t,r){function n(i,a){return kEt.coerce(t,r,CEt,i,a)}n("hiddenlabels"),n("piecolorway",r.colorway),n("extendpiecolors")}});var y5=ye((Qcr,K4e)=>{"use strict";var LEt=uo(),tW=id(),PEt=va(),IEt={};function REt(e,t){var r=[],n=e._fullLayout,i=n.hiddenlabels||[],a=t.labels,o=t.marker.colors||[],s=t.values,l=t._length,u=t._hasValues&&l,c,f;if(t.dlabel)for(a=new Array(l),c=0;c=0});var A=t.type==="funnelarea"?x:t.sort;return A&&r.sort(function(L,_){return _.v-L.v}),r[0]&&(r[0].vTotal=v),r}function X4e(e){return function(r,n){return!r||(r=tW(r),!r.isValid())?!1:(r=PEt.addOpacity(r,r.getAlpha()),e[n]||(e[n]=r),r)}}function DEt(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,i=e.calcdata,a=n[r+"colorway"],o=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(a=Y4e(a,IEt));for(var s=0,l=0;l{"use strict";var zEt=rp().appendArrayMultiPointValues;J4e.exports=function(t,r){var n={curveNumber:r.index,pointNumbers:t.pts,data:r._input,fullData:r,label:t.label,color:t.color,value:t.v,percent:t.percent,text:t.text,bbox:t.bbox,v:t.v};return t.pts.length===1&&(n.pointNumber=n.i=t.pts[0]),zEt(n,r,t.pts),r.type==="funnelarea"&&(delete n.v,delete n.i),n}});var hD=ye((tfr,_Ee)=>{"use strict";var zp=xa(),FEt=Xu(),uD=Nc(),nEe=va(),Wy=ao(),ev=Mr(),qEt=ev.strScale,Q4e=ev.strTranslate,rW=Ll(),aEe=_v(),OEt=aEe.recordMinTextSize,BEt=aEe.clearMinTextSize,oEe=Qb().TEXTPAD,Zo=l_(),cD=$4e(),eEe=Mr().isValidTextValue;function NEt(e,t){var r=e._context.staticPlot,n=e._fullLayout,i=n._size;BEt("pie",n),uEe(t,e),gEe(t,i);var a=ev.makeTraceGroups(n._pielayer,t,"trace").each(function(o){var s=zp.select(this),l=o[0],u=l.trace;YEt(o),s.attr("stroke-linejoin","round"),s.each(function(){var c=zp.select(this).selectAll("g.slice").data(o);c.enter().append("g").classed("slice",!0),c.exit().remove();var f=[[[],[]],[[],[]]],h=!1;c.each(function(A,L){if(A.hidden){zp.select(this).selectAll("path,g").remove();return}A.pointNumber=A.i,A.curveNumber=u.index,f[A.pxmid[1]<0?0:1][A.pxmid[0]<0?0:1].push(A);var _=l.cx,C=l.cy,M=zp.select(this),p=M.selectAll("path.surface").data([A]);if(p.enter().append("path").classed("surface",!0).style({"pointer-events":r?"none":"all"}),M.call(sEe,e,o),u.pull){var P=+Zo.castOption(u.pull,A.pts)||0;P>0&&(_+=P*A.pxmid[0],C+=P*A.pxmid[1])}A.cxFinal=_,A.cyFinal=C;function T(N,W,re,ae){var _e=ae*(W[0]-N[0]),Me=ae*(W[1]-N[1]);return"a"+ae*l.r+","+ae*l.r+" 0 "+A.largeArc+(re?" 1 ":" 0 ")+_e+","+Me}var F=u.hole;if(A.v===l.vTotal){var q="M"+(_+A.px0[0])+","+(C+A.px0[1])+T(A.px0,A.pxmid,!0,1)+T(A.pxmid,A.px0,!0,1)+"Z";F?p.attr("d","M"+(_+F*A.px0[0])+","+(C+F*A.px0[1])+T(A.px0,A.pxmid,!1,F)+T(A.pxmid,A.px0,!1,F)+"Z"+q):p.attr("d",q)}else{var V=T(A.px0,A.px1,!0,1);if(F){var H=1-F;p.attr("d","M"+(_+F*A.px1[0])+","+(C+F*A.px1[1])+T(A.px1,A.px0,!1,F)+"l"+H*A.px0[0]+","+H*A.px0[1]+V+"Z")}else p.attr("d","M"+_+","+C+"l"+A.px0[0]+","+A.px0[1]+V+"Z")}mEe(e,A,l);var X=Zo.castOption(u.textposition,A.pts),G=M.selectAll("g.slicetext").data(A.text&&X!=="none"?[0]:[]);G.enter().append("g").classed("slicetext",!0),G.exit().remove(),G.each(function(){var N=ev.ensureSingle(zp.select(this),"text","",function(ie){ie.attr("data-notex",1)}),W=ev.ensureUniformFontSize(e,X==="outside"?VEt(u,A,n.font):lEe(u,A,n.font));N.text(A.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(Wy.font,W).call(rW.convertToTspans,e);var re=Wy.bBox(N.node()),ae;if(X==="outside")ae=iEe(re,A);else if(ae=cEe(re,A,l),X==="auto"&&ae.scale<1){var _e=ev.ensureUniformFontSize(e,u.outsidetextfont);N.call(Wy.font,_e),re=Wy.bBox(N.node()),ae=iEe(re,A)}var Me=ae.textPosAngle,ke=Me===void 0?A.pxmid:fD(l.r,Me);if(ae.targetX=_+ke[0]*ae.rCenter+(ae.x||0),ae.targetY=C+ke[1]*ae.rCenter+(ae.y||0),yEe(ae,re),ae.outside){var ge=ae.targetY;A.yLabelMin=ge-re.height/2,A.yLabelMid=ge,A.yLabelMax=ge+re.height/2,A.labelExtraX=0,A.labelExtraY=0,h=!0}ae.fontSize=W.size,OEt(u.type,ae,n),o[L].transform=ae,ev.setTransormAndDisplay(N,ae)})});var d=zp.select(this).selectAll("g.titletext").data(u.title.text?[0]:[]);if(d.enter().append("g").classed("titletext",!0),d.exit().remove(),d.each(function(){var A=ev.ensureSingle(zp.select(this),"text","",function(C){C.attr("data-notex",1)}),L=u.title.text;u._meta&&(L=ev.templateString(L,u._meta)),A.text(L).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(Wy.font,u.title.font).call(rW.convertToTspans,e);var _;u.title.position==="middle center"?_=jEt(l):_=vEe(l,i),A.attr("transform",Q4e(_.x,_.y)+qEt(Math.min(1,_.scale))+Q4e(_.tx,_.ty))}),h&&ZEt(f,u),UEt(c,u),h&&u.automargin){var v=Wy.bBox(s.node()),x=u.domain,b=i.w*(x.x[1]-x.x[0]),g=i.h*(x.y[1]-x.y[0]),E=(.5*b-l.r)/i.w,k=(.5*g-l.r)/i.h;FEt.autoMargin(e,"pie."+u.uid+".automargin",{xl:x.x[0]-E,xr:x.x[1]+E,yb:x.y[0]-k,yt:x.y[1]+k,l:Math.max(l.cx-l.r-v.left,0),r:Math.max(v.right-(l.cx+l.r),0),b:Math.max(v.bottom-(l.cy+l.r),0),t:Math.max(l.cy-l.r-v.top,0),pad:5})}})});setTimeout(function(){a.selectAll("tspan").each(function(){var o=zp.select(this);o.attr("dy")&&o.attr("dy",o.attr("dy"))})},0)}function UEt(e,t){e.each(function(r){var n=zp.select(this);if(!r.labelExtraX&&!r.labelExtraY){n.select("path.textline").remove();return}var i=n.select("g.slicetext text");r.transform.targetX+=r.labelExtraX,r.transform.targetY+=r.labelExtraY,ev.setTransormAndDisplay(i,r.transform);var a=r.cxFinal+r.pxmid[0],o=r.cyFinal+r.pxmid[1],s="M"+a+","+o,l=(r.yLabelMax-r.yLabelMin)*(r.pxmid[0]<0?-1:1)/4;if(r.labelExtraX){var u=r.labelExtraX*r.pxmid[1]/r.pxmid[0],c=r.yLabelMid+r.labelExtraY-(r.cyFinal+r.pxmid[1]);Math.abs(u)>Math.abs(c)?s+="l"+c*r.pxmid[0]/r.pxmid[1]+","+c+"H"+(a+r.labelExtraX+l):s+="l"+r.labelExtraX+","+u+"v"+(c-u)+"h"+l}else s+="V"+(r.yLabelMid+r.labelExtraY)+"h"+l;ev.ensureSingle(n,"path","textline").call(nEe.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:s,fill:"none"})})}function sEe(e,t,r){var n=r[0],i=n.cx,a=n.cy,o=n.trace,s=o.type==="funnelarea";"_hasHoverLabel"in o||(o._hasHoverLabel=!1),"_hasHoverEvent"in o||(o._hasHoverEvent=!1),e.on("mouseover",function(l){var u=t._fullLayout,c=t._fullData[o.index];if(!(t._dragging||u.hovermode===!1)){var f=c.hoverinfo;if(Array.isArray(f)&&(f=uD.castHoverinfo({hoverinfo:[Zo.castOption(f,l.pts)],_module:o._module},u,0)),f==="all"&&(f="label+text+value+percent+name"),c.hovertemplate||f!=="none"&&f!=="skip"&&f){var h=l.rInscribed||0,d=i+l.pxmid[0]*(1-h),v=a+l.pxmid[1]*(1-h),x=u.separators,b=[];if(f&&f.indexOf("label")!==-1&&b.push(l.label),l.text=Zo.castOption(c.hovertext||c.text,l.pts),f&&f.indexOf("text")!==-1){var g=l.text;ev.isValidTextValue(g)&&b.push(g)}l.value=l.v,l.valueLabel=Zo.formatPieValue(l.v,x),f&&f.indexOf("value")!==-1&&b.push(l.valueLabel),l.percent=l.v/n.vTotal,l.percentLabel=Zo.formatPiePercent(l.percent,x),f&&f.indexOf("percent")!==-1&&b.push(l.percentLabel);var E=c.hoverlabel,k=E.font,A=[];uD.loneHover({trace:o,x0:d-h*n.r,x1:d+h*n.r,y:v,_x0:s?i+l.TL[0]:d-h*n.r,_x1:s?i+l.TR[0]:d+h*n.r,_y0:s?a+l.TL[1]:v-h*n.r,_y1:s?a+l.BL[1]:v+h*n.r,text:b.join("
"),name:c.hovertemplate||f.indexOf("name")!==-1?c.name:void 0,idealAlign:l.pxmid[0]<0?"left":"right",color:Zo.castOption(E.bgcolor,l.pts)||l.color,borderColor:Zo.castOption(E.bordercolor,l.pts),fontFamily:Zo.castOption(k.family,l.pts),fontSize:Zo.castOption(k.size,l.pts),fontColor:Zo.castOption(k.color,l.pts),nameLength:Zo.castOption(E.namelength,l.pts),textAlign:Zo.castOption(E.align,l.pts),hovertemplate:Zo.castOption(c.hovertemplate,l.pts),hovertemplateLabels:l,eventData:[cD(l,c)]},{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:t,inOut_bbox:A}),l.bbox=A[0],o._hasHoverLabel=!0}o._hasHoverEvent=!0,t.emit("plotly_hover",{points:[cD(l,c)],event:zp.event})}}),e.on("mouseout",function(l){var u=t._fullLayout,c=t._fullData[o.index],f=zp.select(this).datum();o._hasHoverEvent&&(l.originalEvent=zp.event,t.emit("plotly_unhover",{points:[cD(f,c)],event:zp.event}),o._hasHoverEvent=!1),o._hasHoverLabel&&(uD.loneUnhover(u._hoverlayer.node()),o._hasHoverLabel=!1)}),e.on("click",function(l){var u=t._fullLayout,c=t._fullData[o.index];t._dragging||u.hovermode===!1||(t._hoverdata=[cD(l,c)],uD.click(t,zp.event))})}function VEt(e,t,r){var n=Zo.castOption(e.outsidetextfont.color,t.pts)||Zo.castOption(e.textfont.color,t.pts)||r.color,i=Zo.castOption(e.outsidetextfont.family,t.pts)||Zo.castOption(e.textfont.family,t.pts)||r.family,a=Zo.castOption(e.outsidetextfont.size,t.pts)||Zo.castOption(e.textfont.size,t.pts)||r.size,o=Zo.castOption(e.outsidetextfont.weight,t.pts)||Zo.castOption(e.textfont.weight,t.pts)||r.weight,s=Zo.castOption(e.outsidetextfont.style,t.pts)||Zo.castOption(e.textfont.style,t.pts)||r.style,l=Zo.castOption(e.outsidetextfont.variant,t.pts)||Zo.castOption(e.textfont.variant,t.pts)||r.variant,u=Zo.castOption(e.outsidetextfont.textcase,t.pts)||Zo.castOption(e.textfont.textcase,t.pts)||r.textcase,c=Zo.castOption(e.outsidetextfont.lineposition,t.pts)||Zo.castOption(e.textfont.lineposition,t.pts)||r.lineposition,f=Zo.castOption(e.outsidetextfont.shadow,t.pts)||Zo.castOption(e.textfont.shadow,t.pts)||r.shadow;return{color:n,family:i,size:a,weight:o,style:s,variant:l,textcase:u,lineposition:c,shadow:f}}function lEe(e,t,r){var n=Zo.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=Zo.castOption(e._input.textfont.color,t.pts));var i=Zo.castOption(e.insidetextfont.family,t.pts)||Zo.castOption(e.textfont.family,t.pts)||r.family,a=Zo.castOption(e.insidetextfont.size,t.pts)||Zo.castOption(e.textfont.size,t.pts)||r.size,o=Zo.castOption(e.insidetextfont.weight,t.pts)||Zo.castOption(e.textfont.weight,t.pts)||r.weight,s=Zo.castOption(e.insidetextfont.style,t.pts)||Zo.castOption(e.textfont.style,t.pts)||r.style,l=Zo.castOption(e.insidetextfont.variant,t.pts)||Zo.castOption(e.textfont.variant,t.pts)||r.variant,u=Zo.castOption(e.insidetextfont.textcase,t.pts)||Zo.castOption(e.textfont.textcase,t.pts)||r.textcase,c=Zo.castOption(e.insidetextfont.lineposition,t.pts)||Zo.castOption(e.textfont.lineposition,t.pts)||r.lineposition,f=Zo.castOption(e.insidetextfont.shadow,t.pts)||Zo.castOption(e.textfont.shadow,t.pts)||r.shadow;return{color:n||nEe.contrast(t.color),family:i,size:a,weight:o,style:s,variant:l,textcase:u,lineposition:c,shadow:f}}function uEe(e,t){for(var r,n,i=0;i=-4;E-=2)g(Math.PI*E,"tan");for(E=4;E>=-4;E-=2)g(Math.PI*(E+1),"tan")}if(f||d){for(E=4;E>=-4;E-=2)g(Math.PI*(E+1.5),"rad");for(E=4;E>=-4;E-=2)g(Math.PI*(E+.5),"rad")}}if(s||v||f){var k=Math.sqrt(e.width*e.width+e.height*e.height);if(b={scale:i*n*2/k,rCenter:1-i,rotate:0},b.textPosAngle=(t.startangle+t.stopangle)/2,b.scale>=1)return b;x.push(b)}(v||d)&&(b=tEe(e,n,o,l,u),b.textPosAngle=(t.startangle+t.stopangle)/2,x.push(b)),(v||h)&&(b=rEe(e,n,o,l,u),b.textPosAngle=(t.startangle+t.stopangle)/2,x.push(b));for(var A=0,L=0,_=0;_=1)break}return x[A]}function HEt(e,t){var r=e.startangle,n=e.stopangle;return r>t&&t>n||r0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function jEt(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}function vEe(e,t){var r=1,n=1,i,a=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=pEe(a),a.title.position.indexOf("top")!==-1?(o.y-=(1+i)*e.r,s.ty-=e.titleBox.height):a.title.position.indexOf("bottom")!==-1&&(o.y+=(1+i)*e.r);var l=WEt(e.r,e.trace.aspectratio),u=t.w*(a.domain.x[1]-a.domain.x[0])/2;return a.title.position.indexOf("left")!==-1?(u=u+l,o.x-=(1+i)*l,s.tx+=e.titleBox.width/2):a.title.position.indexOf("center")!==-1?u*=2:a.title.position.indexOf("right")!==-1&&(u=u+l,o.x+=(1+i)*l,s.tx-=e.titleBox.width/2),r=u/e.titleBox.width,n=iW(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function WEt(e,t){return e/(t===void 0?1:t)}function iW(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function pEe(e){var t=e.pull;if(!t)return 0;var r;if(ev.isArrayOrTypedArray(t))for(t=0,r=0;rt&&(t=e.pull[r]);return t}function ZEt(e,t){var r,n,i,a,o,s,l,u,c,f,h,d,v;function x(k,A){return k.pxmid[1]-A.pxmid[1]}function b(k,A){return A.pxmid[1]-k.pxmid[1]}function g(k,A){A||(A={});var L=A.labelExtraY+(n?A.yLabelMax:A.yLabelMin),_=n?k.yLabelMin:k.yLabelMax,C=n?k.yLabelMax:k.yLabelMin,M=k.cyFinal+o(k.px0[1],k.px1[1]),p=L-_,P,T,F,q,V,H;if(p*l>0&&(k.labelExtraY=p),!!ev.isArrayOrTypedArray(t.pull))for(T=0;T=(Zo.castOption(t.pull,F.pts)||0))&&((k.pxmid[1]-F.pxmid[1])*l>0?(q=F.cyFinal+o(F.px0[1],F.px1[1]),p=q-_-k.labelExtraY,p*l>0&&(k.labelExtraY+=p)):(C+k.labelExtraY-M)*l>0&&(P=3*s*Math.abs(T-f.indexOf(k)),V=F.cxFinal+a(F.px0[0],F.px1[0]),H=V+P-(k.cxFinal+k.pxmid[0])-k.labelExtraX,H*s>0&&(k.labelExtraX+=H)))}for(n=0;n<2;n++)for(i=n?x:b,o=n?Math.max:Math.min,l=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,s=r?1:-1,u=e[n][r],u.sort(i),c=e[1-n][r],f=c.concat(u),d=[],h=0;h1?(u=r.r,c=u/i.aspectratio):(c=r.r,u=c*i.aspectratio),u*=(1+i.baseratio)/2,l=u*c}o=Math.min(o,l/r.vTotal)}for(n=0;nt.vTotal/2?1:0,u.halfangle=Math.PI*Math.min(u.v/t.vTotal,.5),u.ring=1-n.hole,u.rInscribed=GEt(u,t))}function fD(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}function mEe(e,t,r){var n=e._fullLayout,i=r.trace,a=i.texttemplate,o=i.textinfo;if(!a&&o&&o!=="none"){var s=o.split("+"),l=function(A){return s.indexOf(A)!==-1},u=l("label"),c=l("text"),f=l("value"),h=l("percent"),d=n.separators,v;if(v=u?[t.label]:[],c){var x=Zo.getFirstFilled(i.text,t.pts);eEe(x)&&v.push(x)}f&&v.push(Zo.formatPieValue(t.v,d)),h&&v.push(Zo.formatPiePercent(t.v/r.vTotal,d)),t.text=v.join("
")}function b(A){return{label:A.label,value:A.v,valueLabel:Zo.formatPieValue(A.v,n.separators),percent:A.v/r.vTotal,percentLabel:Zo.formatPiePercent(A.v/r.vTotal,n.separators),color:A.color,text:A.text,customdata:ev.castOption(i,A.i,"customdata")}}if(a){var g=ev.castOption(i,t.i,"texttemplate");if(!g)t.text="";else{var E=b(t),k=Zo.getFirstFilled(i.text,t.pts);(eEe(k)||k==="")&&(E.text=k),t.text=ev.texttemplateString(g,E,e._fullLayout._d3locale,E,i._meta||{})}}}function yEe(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*n-o*i,e.textY=a*i+o*n,e.noCenter=!0}_Ee.exports={plot:NEt,formatSliceLabel:mEe,transformInsideText:cEe,determineInsideTextFont:lEe,positionTitleOutside:vEe,prerenderTitles:uEe,layoutAreas:gEe,attachFxHandlers:sEe,computeTransform:yEe}});var wEe=ye((rfr,bEe)=>{"use strict";var xEe=xa(),KEt=z3(),JEt=_v().resizeText;bEe.exports=function(t){var r=t._fullLayout._pielayer.selectAll(".trace");JEt(t,r,"pie"),r.each(function(n){var i=n[0],a=i.trace,o=xEe.select(this);o.style({opacity:a.opacity}),o.selectAll("path.surface").each(function(s){xEe.select(this).call(KEt,s,a,t)})})}});var AEe=ye(_5=>{"use strict";var TEe=Xu();_5.name="pie";_5.plot=function(e,t,r,n){TEe.plotBasePlot(_5.name,e,t,r,n)};_5.clean=function(e,t,r,n){TEe.cleanBasePlot(_5.name,e,t,r,n)}});var MEe=ye((nfr,SEe)=>{"use strict";SEe.exports={attributes:A2(),supplyDefaults:S2().supplyDefaults,supplyLayoutDefaults:Z4e(),layoutAttributes:lD(),calc:y5().calc,crossTraceCalc:y5().crossTraceCalc,plot:hD().plot,style:wEe(),styleOne:z3(),moduleType:"trace",name:"pie",basePlotModule:AEe(),categories:["pie-like","pie","showLegend"],meta:{}}});var kEe=ye((afr,EEe)=>{"use strict";EEe.exports=MEe()});var LEe=ye(x5=>{"use strict";var CEe=Xu();x5.name="sunburst";x5.plot=function(e,t,r,n){CEe.plotBasePlot(x5.name,e,t,r,n)};x5.clean=function(e,t,r,n){CEe.cleanBasePlot(x5.name,e,t,r,n)}});var nW=ye((sfr,PEe)=>{"use strict";PEe.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}});var AE=ye((lfr,REe)=>{"use strict";var $Et=vl(),QEt=Wo().hovertemplateAttrs,ekt=Wo().texttemplateAttrs,tkt=Kl(),rkt=Ju().attributes,Zy=A2(),IEe=nW(),TE=no().extendFlat,ikt=Ed().pattern;REe.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:TE({colors:{valType:"data_array",editType:"calc"},line:{color:TE({},Zy.marker.line.color,{dflt:null}),width:TE({},Zy.marker.line.width,{dflt:1}),editType:"calc"},pattern:ikt,editType:"calc"},tkt("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:Zy.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:ekt({editType:"plot"},{keys:IEe.eventDataKeys.concat(["label","value"])}),hovertext:Zy.hovertext,hoverinfo:TE({},$Et.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:QEt({},{keys:IEe.eventDataKeys}),textfont:Zy.textfont,insidetextorientation:Zy.insidetextorientation,insidetextfont:Zy.insidetextfont,outsidetextfont:TE({},Zy.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:Zy.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:rkt({name:"sunburst",trace:!0,editType:"calc"})}});var aW=ye((ufr,DEe)=>{"use strict";DEe.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}});var OEe=ye((cfr,qEe)=>{"use strict";var zEe=Mr(),nkt=AE(),akt=Ju().defaults,okt=r0().handleText,skt=S2().handleMarkerDefaults,FEe=Mu(),lkt=FEe.hasColorscale,ukt=FEe.handleDefaults;qEe.exports=function(t,r,n,i){function a(h,d){return zEe.coerce(t,r,nkt,h,d)}var o=a("labels"),s=a("parents");if(!o||!o.length||!s||!s.length){r.visible=!1;return}var l=a("values");l&&l.length?a("branchvalues"):a("count"),a("level"),a("maxdepth"),skt(t,r,i,a);var u=r._hasColorscale=lkt(t,"marker","colors")||(t.marker||{}).coloraxis;u&&ukt(t,r,i,a,{prefix:"marker.",cLetter:"c"}),a("leaf.opacity",u?1:.7);var c=a("text");a("texttemplate"),r.texttemplate||a("textinfo",zEe.isArrayOrTypedArray(c)?"text+label":"label"),a("hovertext"),a("hovertemplate");var f="auto";okt(t,r,i,a,f,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),a("insidetextorientation"),a("sort"),a("rotation"),a("root.color"),akt(r,i,a),r._length=null}});var NEe=ye((ffr,BEe)=>{"use strict";var ckt=Mr(),fkt=aW();BEe.exports=function(t,r){function n(i,a){return ckt.coerce(t,r,fkt,i,a)}n("sunburstcolorway",r.colorway),n("extendsunburstcolors")}});var SE=ye((dD,UEe)=>{(function(e,t){typeof dD=="object"&&typeof UEe!="undefined"?t(dD):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.d3=e.d3||{}))})(dD,function(e){"use strict";function t(Ve,Xe){return Ve.parent===Xe.parent?1:2}function r(Ve){return Ve.reduce(n,0)/Ve.length}function n(Ve,Xe){return Ve+Xe.x}function i(Ve){return 1+Ve.reduce(a,0)}function a(Ve,Xe){return Math.max(Ve,Xe.y)}function o(Ve){for(var Xe;Xe=Ve.children;)Ve=Xe[0];return Ve}function s(Ve){for(var Xe;Xe=Ve.children;)Ve=Xe[Xe.length-1];return Ve}function l(){var Ve=t,Xe=1,ht=1,Le=!1;function xe(Se){var lt,Gt=0;Se.eachAfter(function(jr){var ri=jr.children;ri?(jr.x=r(ri),jr.y=i(ri)):(jr.x=lt?Gt+=Ve(jr,lt):0,jr.y=0,lt=jr)});var Vt=o(Se),ar=s(Se),Qr=Vt.x-Ve(Vt,ar)/2,ai=ar.x+Ve(ar,Vt)/2;return Se.eachAfter(Le?function(jr){jr.x=(jr.x-Se.x)*Xe,jr.y=(Se.y-jr.y)*ht}:function(jr){jr.x=(jr.x-Qr)/(ai-Qr)*Xe,jr.y=(1-(Se.y?jr.y/Se.y:1))*ht})}return xe.separation=function(Se){return arguments.length?(Ve=Se,xe):Ve},xe.size=function(Se){return arguments.length?(Le=!1,Xe=+Se[0],ht=+Se[1],xe):Le?null:[Xe,ht]},xe.nodeSize=function(Se){return arguments.length?(Le=!0,Xe=+Se[0],ht=+Se[1],xe):Le?[Xe,ht]:null},xe}function u(Ve){var Xe=0,ht=Ve.children,Le=ht&&ht.length;if(!Le)Xe=1;else for(;--Le>=0;)Xe+=ht[Le].value;Ve.value=Xe}function c(){return this.eachAfter(u)}function f(Ve){var Xe=this,ht,Le=[Xe],xe,Se,lt;do for(ht=Le.reverse(),Le=[];Xe=ht.pop();)if(Ve(Xe),xe=Xe.children,xe)for(Se=0,lt=xe.length;Se=0;--xe)ht.push(Le[xe]);return this}function d(Ve){for(var Xe=this,ht=[Xe],Le=[],xe,Se,lt;Xe=ht.pop();)if(Le.push(Xe),xe=Xe.children,xe)for(Se=0,lt=xe.length;Se=0;)ht+=Le[xe].value;Xe.value=ht})}function x(Ve){return this.eachBefore(function(Xe){Xe.children&&Xe.children.sort(Ve)})}function b(Ve){for(var Xe=this,ht=g(Xe,Ve),Le=[Xe];Xe!==ht;)Xe=Xe.parent,Le.push(Xe);for(var xe=Le.length;Ve!==ht;)Le.splice(xe,0,Ve),Ve=Ve.parent;return Le}function g(Ve,Xe){if(Ve===Xe)return Ve;var ht=Ve.ancestors(),Le=Xe.ancestors(),xe=null;for(Ve=ht.pop(),Xe=Le.pop();Ve===Xe;)xe=Ve,Ve=ht.pop(),Xe=Le.pop();return xe}function E(){for(var Ve=this,Xe=[Ve];Ve=Ve.parent;)Xe.push(Ve);return Xe}function k(){var Ve=[];return this.each(function(Xe){Ve.push(Xe)}),Ve}function A(){var Ve=[];return this.eachBefore(function(Xe){Xe.children||Ve.push(Xe)}),Ve}function L(){var Ve=this,Xe=[];return Ve.each(function(ht){ht!==Ve&&Xe.push({source:ht.parent,target:ht})}),Xe}function _(Ve,Xe){var ht=new T(Ve),Le=+Ve.value&&(ht.value=Ve.value),xe,Se=[ht],lt,Gt,Vt,ar;for(Xe==null&&(Xe=M);xe=Se.pop();)if(Le&&(xe.value=+xe.data.value),(Gt=Xe(xe.data))&&(ar=Gt.length))for(xe.children=new Array(ar),Vt=ar-1;Vt>=0;--Vt)Se.push(lt=xe.children[Vt]=new T(Gt[Vt])),lt.parent=xe,lt.depth=xe.depth+1;return ht.eachBefore(P)}function C(){return _(this).eachBefore(p)}function M(Ve){return Ve.children}function p(Ve){Ve.data=Ve.data.data}function P(Ve){var Xe=0;do Ve.height=Xe;while((Ve=Ve.parent)&&Ve.height<++Xe)}function T(Ve){this.data=Ve,this.depth=this.height=0,this.parent=null}T.prototype=_.prototype={constructor:T,count:c,each:f,eachAfter:d,eachBefore:h,sum:v,sort:x,path:b,ancestors:E,descendants:k,leaves:A,links:L,copy:C};var F=Array.prototype.slice;function q(Ve){for(var Xe=Ve.length,ht,Le;Xe;)Le=Math.random()*Xe--|0,ht=Ve[Xe],Ve[Xe]=Ve[Le],Ve[Le]=ht;return Ve}function V(Ve){for(var Xe=0,ht=(Ve=q(F.call(Ve))).length,Le=[],xe,Se;Xe0&&ht*ht>Le*Le+xe*xe}function N(Ve,Xe){for(var ht=0;htVt?(xe=(ar+Vt-Se)/(2*ar),Gt=Math.sqrt(Math.max(0,Vt/ar-xe*xe)),ht.x=Ve.x-xe*Le-Gt*lt,ht.y=Ve.y-xe*lt+Gt*Le):(xe=(ar+Se-Vt)/(2*ar),Gt=Math.sqrt(Math.max(0,Se/ar-xe*xe)),ht.x=Xe.x+xe*Le-Gt*lt,ht.y=Xe.y+xe*lt+Gt*Le)):(ht.x=Xe.x+ht.r,ht.y=Xe.y)}function ke(Ve,Xe){var ht=Ve.r+Xe.r-1e-6,Le=Xe.x-Ve.x,xe=Xe.y-Ve.y;return ht>0&&ht*ht>Le*Le+xe*xe}function ge(Ve){var Xe=Ve._,ht=Ve.next._,Le=Xe.r+ht.r,xe=(Xe.x*ht.r+ht.x*Xe.r)/Le,Se=(Xe.y*ht.r+ht.y*Xe.r)/Le;return xe*xe+Se*Se}function ie(Ve){this._=Ve,this.next=null,this.previous=null}function Te(Ve){if(!(xe=Ve.length))return 0;var Xe,ht,Le,xe,Se,lt,Gt,Vt,ar,Qr,ai;if(Xe=Ve[0],Xe.x=0,Xe.y=0,!(xe>1))return Xe.r;if(ht=Ve[1],Xe.x=-ht.r,ht.x=Xe.r,ht.y=0,!(xe>2))return Xe.r+ht.r;Me(ht,Xe,Le=Ve[2]),Xe=new ie(Xe),ht=new ie(ht),Le=new ie(Le),Xe.next=Le.previous=ht,ht.next=Xe.previous=Le,Le.next=ht.previous=Xe;e:for(Gt=3;Gt0)throw new Error("cycle");return Gt}return ht.id=function(Le){return arguments.length?(Ve=ze(Le),ht):Ve},ht.parentId=function(Le){return arguments.length?(Xe=ze(Le),ht):Xe},ht}function Ke(Ve,Xe){return Ve.parent===Xe.parent?1:2}function xt(Ve){var Xe=Ve.children;return Xe?Xe[0]:Ve.t}function bt(Ve){var Xe=Ve.children;return Xe?Xe[Xe.length-1]:Ve.t}function Lt(Ve,Xe,ht){var Le=ht/(Xe.i-Ve.i);Xe.c-=Le,Xe.s+=ht,Ve.c+=Le,Xe.z+=ht,Xe.m+=ht}function St(Ve){for(var Xe=0,ht=0,Le=Ve.children,xe=Le.length,Se;--xe>=0;)Se=Le[xe],Se.z+=Xe,Se.m+=Xe,Xe+=Se.s+(ht+=Se.c)}function Et(Ve,Xe,ht){return Ve.a.parent===Xe.parent?Ve.a:ht}function dt(Ve,Xe){this._=Ve,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=Xe}dt.prototype=Object.create(T.prototype);function Ht(Ve){for(var Xe=new dt(Ve,0),ht,Le=[Xe],xe,Se,lt,Gt;ht=Le.pop();)if(Se=ht._.children)for(ht.children=new Array(Gt=Se.length),lt=Gt-1;lt>=0;--lt)Le.push(xe=ht.children[lt]=new dt(Se[lt],lt)),xe.parent=ht;return(Xe.parent=new dt(null,0)).children=[Xe],Xe}function $t(){var Ve=Ke,Xe=1,ht=1,Le=null;function xe(ar){var Qr=Ht(ar);if(Qr.eachAfter(Se),Qr.parent.m=-Qr.z,Qr.eachBefore(lt),Le)ar.eachBefore(Vt);else{var ai=ar,jr=ar,ri=ar;ar.eachBefore(function(_n){_n.xjr.x&&(jr=_n),_n.depth>ri.depth&&(ri=_n)});var bi=ai===jr?1:Ve(ai,jr)/2,nn=bi-ai.x,Wi=Xe/(jr.x+bi+nn),Ni=ht/(ri.depth||1);ar.eachBefore(function(_n){_n.x=(_n.x+nn)*Wi,_n.y=_n.depth*Ni})}return ar}function Se(ar){var Qr=ar.children,ai=ar.parent.children,jr=ar.i?ai[ar.i-1]:null;if(Qr){St(ar);var ri=(Qr[0].z+Qr[Qr.length-1].z)/2;jr?(ar.z=jr.z+Ve(ar._,jr._),ar.m=ar.z-ri):ar.z=ri}else jr&&(ar.z=jr.z+Ve(ar._,jr._));ar.parent.A=Gt(ar,jr,ar.parent.A||ai[0])}function lt(ar){ar._.x=ar.z+ar.parent.m,ar.m+=ar.parent.m}function Gt(ar,Qr,ai){if(Qr){for(var jr=ar,ri=ar,bi=Qr,nn=jr.parent.children[0],Wi=jr.m,Ni=ri.m,_n=bi.m,$i=nn.m,zn;bi=bt(bi),jr=xt(jr),bi&&jr;)nn=xt(nn),ri=bt(ri),ri.a=ar,zn=bi.z+_n-jr.z-Wi+Ve(bi._,jr._),zn>0&&(Lt(Et(bi,ar,ai),ar,zn),Wi+=zn,Ni+=zn),_n+=bi.m,Wi+=jr.m,$i+=nn.m,Ni+=ri.m;bi&&!bt(ri)&&(ri.t=bi,ri.m+=_n-Ni),jr&&!xt(nn)&&(nn.t=jr,nn.m+=Wi-$i,ai=ar)}return ai}function Vt(ar){ar.x*=Xe,ar.y=ar.depth*ht}return xe.separation=function(ar){return arguments.length?(Ve=ar,xe):Ve},xe.size=function(ar){return arguments.length?(Le=!1,Xe=+ar[0],ht=+ar[1],xe):Le?null:[Xe,ht]},xe.nodeSize=function(ar){return arguments.length?(Le=!0,Xe=+ar[0],ht=+ar[1],xe):Le?[Xe,ht]:null},xe}function fr(Ve,Xe,ht,Le,xe){for(var Se=Ve.children,lt,Gt=-1,Vt=Se.length,ar=Ve.value&&(xe-ht)/Ve.value;++Gt_n&&(_n=ar),It=Wi*Wi*Wn,$i=Math.max(_n/It,It/Ni),$i>zn){Wi-=ar;break}zn=$i}lt.push(Vt={value:Wi,dice:ri1?Le:1)},ht}(_r);function Nr(){var Ve=Or,Xe=!1,ht=1,Le=1,xe=[0],Se=Ce,lt=Ce,Gt=Ce,Vt=Ce,ar=Ce;function Qr(jr){return jr.x0=jr.y0=0,jr.x1=ht,jr.y1=Le,jr.eachBefore(ai),xe=[0],Xe&&jr.eachBefore(qt),jr}function ai(jr){var ri=xe[jr.depth],bi=jr.x0+ri,nn=jr.y0+ri,Wi=jr.x1-ri,Ni=jr.y1-ri;Wi=jr-1){var _n=Se[ai];_n.x0=bi,_n.y0=nn,_n.x1=Wi,_n.y1=Ni;return}for(var $i=ar[ai],zn=ri/2+$i,Wn=ai+1,It=jr-1;Wn>>1;ar[ft]Ni-nn){var yr=(bi*Zt+Wi*jt)/ri;Qr(ai,Wn,jt,bi,nn,yr,Ni),Qr(Wn,jr,Zt,yr,nn,Wi,Ni)}else{var Fr=(nn*Zt+Ni*jt)/ri;Qr(ai,Wn,jt,bi,nn,Wi,Fr),Qr(Wn,jr,Zt,bi,Fr,Wi,Ni)}}}function Ne(Ve,Xe,ht,Le,xe){(Ve.depth&1?fr:rt)(Ve,Xe,ht,Le,xe)}var Ye=function Ve(Xe){function ht(Le,xe,Se,lt,Gt){if((Vt=Le._squarify)&&Vt.ratio===Xe)for(var Vt,ar,Qr,ai,jr=-1,ri,bi=Vt.length,nn=Le.value;++jr1?Le:1)},ht}(_r);e.cluster=l,e.hierarchy=_,e.pack=ce,e.packEnclose=V,e.packSiblings=Ee,e.partition=ot,e.stratify=er,e.tree=$t,e.treemap=Nr,e.treemapBinary=ut,e.treemapDice=rt,e.treemapResquarify=Ye,e.treemapSlice=fr,e.treemapSliceDice=Ne,e.treemapSquarify=Or,Object.defineProperty(e,"__esModule",{value:!0})})});var EE=ye(ME=>{"use strict";var VEe=SE(),hkt=uo(),b5=Mr(),dkt=Mu().makeColorScaleFuncFromTrace,vkt=y5().makePullColorFn,pkt=y5().generateExtendedColors,gkt=Mu().calc,mkt=es().ALMOST_EQUAL,ykt={},_kt={},xkt={};ME.calc=function(e,t){var r=e._fullLayout,n=t.ids,i=b5.isArrayOrTypedArray(n),a=t.labels,o=t.parents,s=t.values,l=b5.isArrayOrTypedArray(s),u=[],c={},f={},h=function(G,N){c[G]?c[G].push(N):c[G]=[N],f[N]=1},d=function(G){return G||typeof G=="number"},v=function(G){return!l||hkt(s[G])&&s[G]>=0},x,b,g;i?(x=Math.min(n.length,o.length),b=function(G){return d(n[G])&&v(G)},g=function(G){return String(n[G])}):(x=Math.min(a.length,o.length),b=function(G){return d(a[G])&&v(G)},g=function(G){return String(a[G])}),l&&(x=Math.min(x,s.length));for(var E=0;E1){for(var M=b5.randstr(),p=0;p{});function Vm(){}function jEe(){return this.rgb().formatHex()}function kkt(){return this.rgb().formatHex8()}function Ckt(){return $Ee(this).formatHsl()}function WEe(){return this.rgb().formatRgb()}function j_(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=bkt.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?ZEe(t):r===3?new hd(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?pD(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?pD(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=wkt.exec(e))?new hd(t[1],t[2],t[3],1):(t=Tkt.exec(e))?new hd(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Akt.exec(e))?pD(t[1],t[2],t[3],t[4]):(t=Skt.exec(e))?pD(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Mkt.exec(e))?KEe(t[1],t[2]/100,t[3]/100,1):(t=Ekt.exec(e))?KEe(t[1],t[2]/100,t[3]/100,t[4]):GEe.hasOwnProperty(e)?ZEe(GEe[e]):e==="transparent"?new hd(NaN,NaN,NaN,0):null}function ZEe(e){return new hd(e>>16&255,e>>8&255,e&255,1)}function pD(e,t,r,n){return n<=0&&(e=t=r=NaN),new hd(e,t,r,n)}function CE(e){return e instanceof Vm||(e=j_(e)),e?(e=e.rgb(),new hd(e.r,e.g,e.b,e.opacity)):new hd}function T5(e,t,r,n){return arguments.length===1?CE(e):new hd(e,t,r,n==null?1:n)}function hd(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function XEe(){return`#${M2(this.r)}${M2(this.g)}${M2(this.b)}`}function Lkt(){return`#${M2(this.r)}${M2(this.g)}${M2(this.b)}${M2((isNaN(this.opacity)?1:this.opacity)*255)}`}function YEe(){let e=mD(this.opacity);return`${e===1?"rgb(":"rgba("}${E2(this.r)}, ${E2(this.g)}, ${E2(this.b)}${e===1?")":`, ${e})`}`}function mD(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function E2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function M2(e){return e=E2(e),(e<16?"0":"")+e.toString(16)}function KEe(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Zg(e,t,r,n)}function $Ee(e){if(e instanceof Zg)return new Zg(e.h,e.s,e.l,e.opacity);if(e instanceof Vm||(e=j_(e)),!e)return new Zg;if(e instanceof Zg)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new Zg(o,s,l,e.opacity)}function LE(e,t,r,n){return arguments.length===1?$Ee(e):new Zg(e,t,r,n==null?1:n)}function Zg(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function JEe(e){return e=(e||0)%360,e<0?e+360:e}function gD(e){return Math.max(0,Math.min(1,e||0))}function oW(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var G_,k2,w5,kE,Um,bkt,wkt,Tkt,Akt,Skt,Mkt,Ekt,GEe,yD=su(()=>{vD();G_=.7,k2=1/G_,w5="\\s*([+-]?\\d+)\\s*",kE="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Um="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bkt=/^#([0-9a-f]{3,8})$/,wkt=new RegExp(`^rgb\\(${w5},${w5},${w5}\\)$`),Tkt=new RegExp(`^rgb\\(${Um},${Um},${Um}\\)$`),Akt=new RegExp(`^rgba\\(${w5},${w5},${w5},${kE}\\)$`),Skt=new RegExp(`^rgba\\(${Um},${Um},${Um},${kE}\\)$`),Mkt=new RegExp(`^hsl\\(${kE},${Um},${Um}\\)$`),Ekt=new RegExp(`^hsla\\(${kE},${Um},${Um},${kE}\\)$`),GEe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xy(Vm,j_,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jEe,formatHex:jEe,formatHex8:kkt,formatHsl:Ckt,formatRgb:WEe,toString:WEe});Xy(hd,T5,H_(Vm,{brighter(e){return e=e==null?k2:Math.pow(k2,e),new hd(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?G_:Math.pow(G_,e),new hd(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hd(E2(this.r),E2(this.g),E2(this.b),mD(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:XEe,formatHex:XEe,formatHex8:Lkt,formatRgb:YEe,toString:YEe}));Xy(Zg,LE,H_(Vm,{brighter(e){return e=e==null?k2:Math.pow(k2,e),new Zg(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?G_:Math.pow(G_,e),new Zg(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new hd(oW(e>=240?e-240:e+120,i,n),oW(e,i,n),oW(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Zg(JEe(this.h),gD(this.s),gD(this.l),mD(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=mD(this.opacity);return`${e===1?"hsl(":"hsla("}${JEe(this.h)}, ${gD(this.s)*100}%, ${gD(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var _D,xD,sW=su(()=>{_D=Math.PI/180,xD=180/Math.PI});function nke(e){if(e instanceof Hm)return new Hm(e.l,e.a,e.b,e.opacity);if(e instanceof Yy)return ake(e);e instanceof hd||(e=CE(e));var t=fW(e.r),r=fW(e.g),n=fW(e.b),i=lW((.2225045*t+.7168786*r+.0606169*n)/eke),a,o;return t===r&&r===n?a=o=i:(a=lW((.4360747*t+.3850649*r+.1430804*n)/QEe),o=lW((.0139322*t+.0971045*r+.7141733*n)/tke)),new Hm(116*i-16,500*(a-i),200*(i-o),e.opacity)}function S5(e,t,r,n){return arguments.length===1?nke(e):new Hm(e,t,r,n==null?1:n)}function Hm(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function lW(e){return e>Pkt?Math.pow(e,1/3):e/ike+rke}function uW(e){return e>A5?e*e*e:ike*(e-rke)}function cW(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function fW(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ikt(e){if(e instanceof Yy)return new Yy(e.h,e.c,e.l,e.opacity);if(e instanceof Hm||(e=nke(e)),e.a===0&&e.b===0)return new Yy(NaN,0{vD();yD();sW();bD=18,QEe=.96422,eke=1,tke=.82521,rke=4/29,A5=6/29,ike=3*A5*A5,Pkt=A5*A5*A5;Xy(Hm,S5,H_(Vm,{brighter(e){return new Hm(this.l+bD*(e==null?1:e),this.a,this.b,this.opacity)},darker(e){return new Hm(this.l-bD*(e==null?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=QEe*uW(t),e=eke*uW(e),r=tke*uW(r),new hd(cW(3.1338561*t-1.6168667*e-.4906146*r),cW(-.9787684*t+1.9161415*e+.033454*r),cW(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));Xy(Yy,PE,H_(Vm,{brighter(e){return new Yy(this.h,this.c,this.l+bD*(e==null?1:e),this.opacity)},darker(e){return new Yy(this.h,this.c,this.l-bD*(e==null?1:e),this.opacity)},rgb(){return ake(this).rgb()}}))});function Rkt(e){if(e instanceof C2)return new C2(e.h,e.s,e.l,e.opacity);e instanceof hd||(e=CE(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(uke*n+ske*t-lke*r)/(uke+ske-lke),a=n-i,o=(IE*(r-i)-dW*a)/wD,s=Math.sqrt(o*o+a*a)/(IE*i*(1-i)),l=s?Math.atan2(o,a)*xD-120:NaN;return new C2(l<0?l+360:l,s,i,e.opacity)}function M5(e,t,r,n){return arguments.length===1?Rkt(e):new C2(e,t,r,n==null?1:n)}function C2(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}var cke,hW,dW,wD,IE,ske,lke,uke,fke=su(()=>{vD();yD();sW();cke=-.14861,hW=1.78277,dW=-.29227,wD=-.90649,IE=1.97294,ske=IE*wD,lke=IE*hW,uke=hW*dW-wD*cke;Xy(C2,M5,H_(Vm,{brighter(e){return e=e==null?k2:Math.pow(k2,e),new C2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?G_:Math.pow(G_,e),new C2(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*_D,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new hd(255*(t+r*(cke*n+hW*i)),255*(t+r*(dW*n+wD*i)),255*(t+r*(IE*n)),this.opacity)}}))});var L2=su(()=>{yD();oke();fke()});function vW(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}function TD(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=n{});function SD(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],a=e[n%t],o=e[(n+1)%t],s=e[(n+2)%t];return vW((r-n/t)*t,i,a,o,s)}}var pW=su(()=>{AD()});var E5,gW=su(()=>{E5=e=>()=>e});function hke(e,t){return function(r){return e+r*t}}function Dkt(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function W_(e,t){var r=t-e;return r?hke(e,r>180||r<-180?r-360*Math.round(r/360):r):E5(isNaN(e)?t:e)}function dke(e){return(e=+e)==1?qf:function(t,r){return r-t?Dkt(t,r,e):E5(isNaN(t)?r:t)}}function qf(e,t){var r=t-e;return r?hke(e,r):E5(isNaN(e)?t:e)}var P2=su(()=>{gW()});function vke(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),a=new Array(r),o,s;for(o=0;o{L2();AD();pW();P2();RE=function e(t){var r=dke(t);function n(i,a){var o=r((i=T5(i)).r,(a=T5(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=qf(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=e,n}(1);pke=vke(TD),gke=vke(SD)});function k5(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i{});function mke(e,t){return(MD(t)?k5:yW)(e,t)}function yW(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o{DE();ED()});function kD(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var xW=su(()=>{});function Fp(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var zE=su(()=>{});function CD(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Z_(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var bW=su(()=>{DE()});function zkt(e){return function(){return e}}function Fkt(e){return function(t){return e(t)+""}}function LD(e,t){var r=TW.lastIndex=wW.lastIndex=0,n,i,a,o=-1,s=[],l=[];for(e=e+"",t=t+"";(n=TW.exec(e))&&(i=wW.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Fp(n,i)})),r=wW.lastIndex;return r{zE();TW=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wW=new RegExp(TW.source,"g")});function Z_(e,t){var r=typeof t,n;return t==null||r==="boolean"?E5(t):(r==="number"?Fp:r==="string"?(n=j_(t))?(t=n,RE):LD:t instanceof j_?RE:t instanceof Date?kD:MD(t)?k5:Array.isArray(t)?yW:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?CD:Fp)(e,t)}var DE=su(()=>{L2();mW();_W();xW();zE();bW();AW();gW();ED()});function yke(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var _ke=su(()=>{});function xke(e,t){var r=W_(+e,+t);return function(n){var i=r(n);return i-360*Math.floor(i/360)}}var bke=su(()=>{P2()});function wke(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var Tke=su(()=>{});function SW(e,t,r,n,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),e*n{Ake=180/Math.PI,PD={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function Mke(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?PD:SW(t.a,t.b,t.c,t.d,t.e,t.f)}function Eke(e){return e==null?PD:(ID||(ID=document.createElementNS("http://www.w3.org/2000/svg","g")),ID.setAttribute("transform",e),(e=ID.transform.baseVal.consolidate())?(e=e.matrix,SW(e.a,e.b,e.c,e.d,e.e,e.f)):PD)}var ID,kke=su(()=>{Ske()});function Cke(e,t,r,n){function i(u){return u.length?u.pop()+" ":""}function a(u,c,f,h,d,v){if(u!==f||c!==h){var x=d.push("translate(",null,t,null,r);v.push({i:x-4,x:Fp(u,f)},{i:x-2,x:Fp(c,h)})}else(f||h)&&d.push("translate("+f+t+h+r)}function o(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,n)-2,x:Fp(u,c)})):c&&f.push(i(f)+"rotate("+c+n)}function s(u,c,f,h){u!==c?h.push({i:f.push(i(f)+"skewX(",null,n)-2,x:Fp(u,c)}):c&&f.push(i(f)+"skewX("+c+n)}function l(u,c,f,h,d,v){if(u!==f||c!==h){var x=d.push(i(d)+"scale(",null,",",null,")");v.push({i:x-4,x:Fp(u,f)},{i:x-2,x:Fp(c,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),a(u.translateX,u.translateY,c.translateX,c.translateY,f,h),o(u.rotate,c.rotate,f,h),s(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(d){for(var v=-1,x=h.length,b;++v{zE();kke();Lke=Cke(Mke,"px, ","px)","deg)"),Pke=Cke(Eke,", ",")",")")});function Rke(e){return((e=Math.exp(e))+1/e)/2}function Okt(e){return((e=Math.exp(e))-1/e)/2}function Bkt(e){return((e=Math.exp(2*e))-1)/(e+1)}var qkt,Dke,zke=su(()=>{qkt=1e-12;Dke=function e(t,r,n){function i(a,o){var s=a[0],l=a[1],u=a[2],c=o[0],f=o[1],h=o[2],d=c-s,v=f-l,x=d*d+v*v,b,g;if(x{L2();P2();qke=Fke(W_),Oke=Fke(qf)});function MW(e,t){var r=qf((e=S5(e)).l,(t=S5(t)).l),n=qf(e.a,t.a),i=qf(e.b,t.b),a=qf(e.opacity,t.opacity);return function(o){return e.l=r(o),e.a=n(o),e.b=i(o),e.opacity=a(o),e+""}}var Nke=su(()=>{L2();P2()});function Uke(e){return function(t,r){var n=e((t=PE(t)).h,(r=PE(r)).h),i=qf(t.c,r.c),a=qf(t.l,r.l),o=qf(t.opacity,r.opacity);return function(s){return t.h=n(s),t.c=i(s),t.l=a(s),t.opacity=o(s),t+""}}}var Vke,Hke,Gke=su(()=>{L2();P2();Vke=Uke(W_),Hke=Uke(qf)});function jke(e){return function t(r){r=+r;function n(i,a){var o=e((i=M5(i)).h,(a=M5(a)).h),s=qf(i.s,a.s),l=qf(i.l,a.l),u=qf(i.opacity,a.opacity);return function(c){return i.h=o(c),i.s=s(c),i.l=l(Math.pow(c,r)),i.opacity=u(c),i+""}}return n.gamma=t,n}(1)}var Wke,Zke,Xke=su(()=>{L2();P2();Wke=jke(W_),Zke=jke(qf)});function EW(e,t){t===void 0&&(t=e,e=Z_);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r{DE()});function Kke(e,t){for(var r=new Array(t),n=0;n{});var I2={};BQe(I2,{interpolate:()=>Z_,interpolateArray:()=>mke,interpolateBasis:()=>TD,interpolateBasisClosed:()=>SD,interpolateCubehelix:()=>Wke,interpolateCubehelixLong:()=>Zke,interpolateDate:()=>kD,interpolateDiscrete:()=>yke,interpolateHcl:()=>Vke,interpolateHclLong:()=>Hke,interpolateHsl:()=>qke,interpolateHslLong:()=>Oke,interpolateHue:()=>xke,interpolateLab:()=>MW,interpolateNumber:()=>Fp,interpolateNumberArray:()=>k5,interpolateObject:()=>CD,interpolateRgb:()=>RE,interpolateRgbBasis:()=>pke,interpolateRgbBasisClosed:()=>gke,interpolateRound:()=>wke,interpolateString:()=>LD,interpolateTransformCss:()=>Lke,interpolateTransformSvg:()=>Pke,interpolateZoom:()=>Dke,piecewise:()=>EW,quantize:()=>Kke});var R2=su(()=>{DE();_W();AD();pW();xW();_ke();bke();zE();ED();bW();Tke();AW();Ike();zke();mW();Bke();Nke();Gke();Xke();Yke();Jke()});var RD=ye((tdr,$ke)=>{"use strict";var Nkt=ao(),Ukt=va();$ke.exports=function(t,r,n,i,a){var o=r.data.data,s=o.i,l=a||o.color;if(s>=0){r.i=o.i;var u=n.marker;u.pattern?(!u.colors||!u.pattern.shape)&&(u.color=l,r.color=l):(u.color=l,r.color=l),Nkt.pointStyle(t,n,i,r)}else Ukt.fill(t,l)}});var kW=ye((rdr,iCe)=>{"use strict";var Qke=xa(),eCe=va(),tCe=Mr(),Vkt=_v().resizeText,Hkt=RD();function Gkt(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");Vkt(e,t,"sunburst"),t.each(function(r){var n=Qke.select(this),i=r[0],a=i.trace;n.style("opacity",a.opacity),n.selectAll("path.surface").each(function(o){Qke.select(this).call(rCe,o,a,e)})})}function rCe(e,t,r,n){var i=t.data.data,a=!t.children,o=i.i,s=tCe.castOption(r,o,"marker.line.color")||eCe.defaultLine,l=tCe.castOption(r,o,"marker.line.width")||0;e.call(Hkt,t,r,n).style("stroke-width",l).call(eCe.stroke,s).style("opacity",a?r.leaf.opacity:null)}iCe.exports={style:Gkt,styleOne:rCe}});var Ky=ye(bs=>{"use strict";var D2=Mr(),jkt=va(),Wkt=Tg(),nCe=l_();bs.findEntryWithLevel=function(e,t){var r;return t&&e.eachAfter(function(n){if(bs.getPtId(n)===t)return r=n.copy()}),r||e};bs.findEntryWithChild=function(e,t){var r;return e.eachAfter(function(n){for(var i=n.children||[],a=0;a0)};bs.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0};bs.isHeader=function(e,t){return!(bs.isLeaf(e)||e.depth===t._maxDepth-1)};function aCe(e){return e.data.data.pid}bs.getParent=function(e,t){return bs.findEntryWithLevel(e,aCe(t))};bs.listPath=function(e,t){var r=e.parent;if(!r)return[];var n=t?[r.data[t]]:[r];return bs.listPath(r,t).concat(n)};bs.getPath=function(e){return bs.listPath(e,"label").join("/")+"/"};bs.formatValue=nCe.formatPieValue;bs.formatPercent=function(e,t){var r=D2.formatPercent(e,0);return r==="0%"&&(r=nCe.formatPiePercent(e,t)),r}});var OE=ye((ndr,lCe)=>{"use strict";var C5=xa(),oCe=ba(),Ykt=rp().appendArrayPointValue,FE=Nc(),sCe=Mr(),Kkt=g3(),Wh=Ky(),Jkt=l_(),$kt=Jkt.formatPieValue;lCe.exports=function(t,r,n,i,a){var o=i[0],s=o.trace,l=o.hierarchy,u=s.type==="sunburst",c=s.type==="treemap"||s.type==="icicle";"_hasHoverLabel"in s||(s._hasHoverLabel=!1),"_hasHoverEvent"in s||(s._hasHoverEvent=!1);var f=function(v){var x=n._fullLayout;if(!(n._dragging||x.hovermode===!1)){var b=n._fullData[s.index],g=v.data.data,E=g.i,k=Wh.isHierarchyRoot(v),A=Wh.getParent(l,v),L=Wh.getValue(v),_=function(Me){return sCe.castOption(b,E,Me)},C=_("hovertemplate"),M=FE.castHoverinfo(b,x,E),p=x.separators,P;if(C||M&&M!=="none"&&M!=="skip"){var T,F;u&&(T=o.cx+v.pxmid[0]*(1-v.rInscribed),F=o.cy+v.pxmid[1]*(1-v.rInscribed)),c&&(T=v._hoverX,F=v._hoverY);var q={},V=[],H=[],X=function(Me){return V.indexOf(Me)!==-1};M&&(V=M==="all"?b._module.attributes.hoverinfo.flags:M.split("+")),q.label=g.label,X("label")&&q.label&&H.push(q.label),g.hasOwnProperty("v")&&(q.value=g.v,q.valueLabel=$kt(q.value,p),X("value")&&H.push(q.valueLabel)),q.currentPath=v.currentPath=Wh.getPath(v.data),X("current path")&&!k&&H.push(q.currentPath);var G,N=[],W=function(){N.indexOf(G)===-1&&(H.push(G),N.push(G))};q.percentParent=v.percentParent=L/Wh.getValue(A),q.parent=v.parentString=Wh.getPtLabel(A),X("percent parent")&&(G=Wh.formatPercent(q.percentParent,p)+" of "+q.parent,W()),q.percentEntry=v.percentEntry=L/Wh.getValue(r),q.entry=v.entry=Wh.getPtLabel(r),X("percent entry")&&!k&&!v.onPathbar&&(G=Wh.formatPercent(q.percentEntry,p)+" of "+q.entry,W()),q.percentRoot=v.percentRoot=L/Wh.getValue(l),q.root=v.root=Wh.getPtLabel(l),X("percent root")&&!k&&(G=Wh.formatPercent(q.percentRoot,p)+" of "+q.root,W()),q.text=_("hovertext")||_("text"),X("text")&&(G=q.text,sCe.isValidTextValue(G)&&H.push(G)),P=[qE(v,b,a.eventDataKeys)];var re={trace:b,y:F,_x0:v._x0,_x1:v._x1,_y0:v._y0,_y1:v._y1,text:H.join("
"),name:C||X("name")?b.name:void 0,color:_("hoverlabel.bgcolor")||g.color,borderColor:_("hoverlabel.bordercolor"),fontFamily:_("hoverlabel.font.family"),fontSize:_("hoverlabel.font.size"),fontColor:_("hoverlabel.font.color"),fontWeight:_("hoverlabel.font.weight"),fontStyle:_("hoverlabel.font.style"),fontVariant:_("hoverlabel.font.variant"),nameLength:_("hoverlabel.namelength"),textAlign:_("hoverlabel.align"),hovertemplate:C,hovertemplateLabels:q,eventData:P};u&&(re.x0=T-v.rInscribed*v.rpx1,re.x1=T+v.rInscribed*v.rpx1,re.idealAlign=v.pxmid[0]<0?"left":"right"),c&&(re.x=T,re.idealAlign=T<0?"left":"right");var ae=[];FE.loneHover(re,{container:x._hoverlayer.node(),outerContainer:x._paper.node(),gd:n,inOut_bbox:ae}),P[0].bbox=ae[0],s._hasHoverLabel=!0}if(c){var _e=t.select("path.surface");a.styleOne(_e,v,b,n,{hovered:!0})}s._hasHoverEvent=!0,n.emit("plotly_hover",{points:P||[qE(v,b,a.eventDataKeys)],event:C5.event})}},h=function(v){var x=n._fullLayout,b=n._fullData[s.index],g=C5.select(this).datum();if(s._hasHoverEvent&&(v.originalEvent=C5.event,n.emit("plotly_unhover",{points:[qE(g,b,a.eventDataKeys)],event:C5.event}),s._hasHoverEvent=!1),s._hasHoverLabel&&(FE.loneUnhover(x._hoverlayer.node()),s._hasHoverLabel=!1),c){var E=t.select("path.surface");a.styleOne(E,g,b,n,{hovered:!1})}},d=function(v){var x=n._fullLayout,b=n._fullData[s.index],g=u&&(Wh.isHierarchyRoot(v)||Wh.isLeaf(v)),E=Wh.getPtId(v),k=Wh.isEntry(v)?Wh.findEntryWithChild(l,E):Wh.findEntryWithLevel(l,E),A=Wh.getPtId(k),L={points:[qE(v,b,a.eventDataKeys)],event:C5.event};g||(L.nextLevel=A);var _=Kkt.triggerHandler(n,"plotly_"+s.type+"click",L);if(_!==!1&&x.hovermode&&(n._hoverdata=[qE(v,b,a.eventDataKeys)],FE.click(n,C5.event)),!g&&_!==!1&&!n._dragging&&!n._transitioning){oCe.call("_storeDirectGUIEdit",b,x._tracePreGUI[b.uid],{level:b.level});var C={data:[{level:A}],traces:[s.index]},M={frame:{redraw:!1,duration:a.transitionTime},transition:{duration:a.transitionTime,easing:a.transitionEasing},mode:"immediate",fromcurrent:!0};FE.loneUnhover(x._hoverlayer.node()),oCe.call("animate",n,C,M)}};t.on("mouseover",f),t.on("mouseout",h),t.on("click",d)};function qE(e,t,r){for(var n=e.data.data,i={curveNumber:t.index,pointNumber:n.i,data:t._input,fullData:t},a=0;a{"use strict";var BE=xa(),Qkt=SE(),Xg=(R2(),ab(I2)).interpolate,uCe=ao(),bv=Mr(),eCt=Ll(),dCe=_v(),cCe=dCe.recordMinTextSize,tCt=dCe.clearMinTextSize,vCe=hD(),rCt=l_().getRotationAngle,iCt=vCe.computeTransform,nCt=vCe.transformInsideText,aCt=kW().styleOne,oCt=N0().resizeText,sCt=OE(),CW=nW(),sl=Ky();DD.plot=function(e,t,r,n){var i=e._fullLayout,a=i._sunburstlayer,o,s,l=!r,u=!i.uniformtext.mode&&sl.hasTransition(r);if(tCt("sunburst",i),o=a.selectAll("g.trace.sunburst").data(t,function(f){return f[0].trace.uid}),o.enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),o.order(),u){n&&(s=n());var c=BE.transition().duration(r.duration).ease(r.easing).each("end",function(){s&&s()}).each("interrupt",function(){s&&s()});c.each(function(){a.selectAll("g.trace").each(function(f){fCe(e,f,this,r)})})}else o.each(function(f){fCe(e,f,this,r)}),i.uniformtext.mode&&oCt(e,i._sunburstlayer.selectAll(".trace"),"sunburst");l&&o.exit().remove()};function fCe(e,t,r,n){var i=e._context.staticPlot,a=e._fullLayout,o=!a.uniformtext.mode&&sl.hasTransition(n),s=BE.select(r),l=s.selectAll("g.slice"),u=t[0],c=u.trace,f=u.hierarchy,h=sl.findEntryWithLevel(f,c.level),d=sl.getMaxDepth(c),v=a._size,x=c.domain,b=v.w*(x.x[1]-x.x[0]),g=v.h*(x.y[1]-x.y[0]),E=.5*Math.min(b,g),k=u.cx=v.l+v.w*(x.x[1]+x.x[0])/2,A=u.cy=v.t+v.h*(1-x.y[0])-g/2;if(!h)return l.remove();var L=null,_={};o&&l.each(function(ge){_[sl.getPtId(ge)]={rpx0:ge.rpx0,rpx1:ge.rpx1,x0:ge.x0,x1:ge.x1,transform:ge.transform},!L&&sl.isEntry(ge)&&(L=ge)});var C=lCt(h).descendants(),M=h.height+1,p=0,P=d;u.hasMultipleRoots&&sl.isHierarchyRoot(h)&&(C=C.slice(1),M-=1,p=1,P+=1),C=C.filter(function(ge){return ge.y1<=P});var T=rCt(c.rotation);T&&C.forEach(function(ge){ge.x0+=T,ge.x1+=T});var F=Math.min(M,d),q=function(ge){return(ge-p)/F*E},V=function(ge,ie){return[ge*Math.cos(ie),-ge*Math.sin(ie)]},H=function(ge){return bv.pathAnnulus(ge.rpx0,ge.rpx1,ge.x0,ge.x1,k,A)},X=function(ge){return k+hCe(ge)[0]*(ge.transform.rCenter||0)+(ge.transform.x||0)},G=function(ge){return A+hCe(ge)[1]*(ge.transform.rCenter||0)+(ge.transform.y||0)};l=l.data(C,sl.getPtId),l.enter().append("g").classed("slice",!0),o?l.exit().transition().each(function(){var ge=BE.select(this),ie=ge.select("path.surface");ie.transition().attrTween("d",function(Ee){var Ae=ae(Ee);return function(ze){return H(Ae(ze))}});var Te=ge.select("g.slicetext");Te.attr("opacity",0)}).remove():l.exit().remove(),l.order();var N=null;if(o&&L){var W=sl.getPtId(L);l.each(function(ge){N===null&&sl.getPtId(ge)===W&&(N=ge.x1)})}var re=l;o&&(re=re.transition().each("end",function(){var ge=BE.select(this);sl.setSliceCursor(ge,e,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),re.each(function(ge){var ie=BE.select(this),Te=bv.ensureSingle(ie,"path","surface",function(Re){Re.style("pointer-events",i?"none":"all")});ge.rpx0=q(ge.y0),ge.rpx1=q(ge.y1),ge.xmid=(ge.x0+ge.x1)/2,ge.pxmid=V(ge.rpx1,ge.xmid),ge.midangle=-(ge.xmid-Math.PI/2),ge.startangle=-(ge.x0-Math.PI/2),ge.stopangle=-(ge.x1-Math.PI/2),ge.halfangle=.5*Math.min(bv.angleDelta(ge.x0,ge.x1)||Math.PI,Math.PI),ge.ring=1-ge.rpx0/ge.rpx1,ge.rInscribed=uCt(ge,c),o?Te.transition().attrTween("d",function(Re){var ce=_e(Re);return function(Ge){return H(ce(Ge))}}):Te.attr("d",H),ie.call(sCt,h,e,t,{eventDataKeys:CW.eventDataKeys,transitionTime:CW.CLICK_TRANSITION_TIME,transitionEasing:CW.CLICK_TRANSITION_EASING}).call(sl.setSliceCursor,e,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:e._transitioning}),Te.call(aCt,ge,c,e);var Ee=bv.ensureSingle(ie,"g","slicetext"),Ae=bv.ensureSingle(Ee,"text","",function(Re){Re.attr("data-notex",1)}),ze=bv.ensureUniformFontSize(e,sl.determineTextFont(c,ge,a.font));Ae.text(DD.formatSliceLabel(ge,h,c,t,a)).classed("slicetext",!0).attr("text-anchor","middle").call(uCe.font,ze).call(eCt.convertToTspans,e);var Ce=uCe.bBox(Ae.node());ge.transform=nCt(Ce,ge,u),ge.transform.targetX=X(ge),ge.transform.targetY=G(ge);var me=function(Re,ce){var Ge=Re.transform;return iCt(Ge,ce),Ge.fontSize=ze.size,cCe(c.type,Ge,a),bv.getTextTransform(Ge)};o?Ae.transition().attrTween("transform",function(Re){var ce=Me(Re);return function(Ge){return me(ce(Ge),Ce)}}):Ae.attr("transform",me(ge,Ce))});function ae(ge){var ie=sl.getPtId(ge),Te=_[ie],Ee=_[sl.getPtId(h)],Ae;if(Ee){var ze=(ge.x1>Ee.x1?2*Math.PI:0)+T;Ae=ge.rpx1N?2*Math.PI:0)+T;Te={x0:Ae,x1:Ae}}else Te={rpx0:E,rpx1:E},bv.extendFlat(Te,ke(ge));else Te={rpx0:0,rpx1:0};else Te={x0:T,x1:T};return Xg(Te,Ee)}function Me(ge){var ie=_[sl.getPtId(ge)],Te,Ee=ge.transform;if(ie)Te=ie;else if(Te={rpx1:ge.rpx1,transform:{textPosAngle:Ee.textPosAngle,scale:0,rotate:Ee.rotate,rCenter:Ee.rCenter,x:Ee.x,y:Ee.y}},L)if(ge.parent)if(N){var Ae=ge.x1>N?2*Math.PI:0;Te.x0=Te.x1=Ae}else bv.extendFlat(Te,ke(ge));else Te.x0=Te.x1=T;else Te.x0=Te.x1=T;var ze=Xg(Te.transform.textPosAngle,ge.transform.textPosAngle),Ce=Xg(Te.rpx1,ge.rpx1),me=Xg(Te.x0,ge.x0),Re=Xg(Te.x1,ge.x1),ce=Xg(Te.transform.scale,Ee.scale),Ge=Xg(Te.transform.rotate,Ee.rotate),nt=Ee.rCenter===0?3:Te.transform.rCenter===0?1/3:1,ct=Xg(Te.transform.rCenter,Ee.rCenter),qt=function(rt){return ct(Math.pow(rt,nt))};return function(rt){var ot=Ce(rt),Rt=me(rt),kt=Re(rt),Ct=qt(rt),Yt=V(ot,(Rt+kt)/2),xr=ze(rt),er={pxmid:Yt,rpx1:ot,transform:{textPosAngle:xr,rCenter:Ct,x:Ee.x,y:Ee.y}};return cCe(c.type,Ee,a),{transform:{targetX:X(er),targetY:G(er),scale:ce(rt),rotate:Ge(rt),rCenter:Ct}}}}function ke(ge){var ie=ge.parent,Te=_[sl.getPtId(ie)],Ee={};if(Te){var Ae=ie.children,ze=Ae.indexOf(ge),Ce=Ae.length,me=Xg(Te.x0,Te.x1);Ee.x0=me(ze/Ce),Ee.x1=me(ze/Ce)}else Ee.x0=Ee.x1=0;return Ee}}function lCt(e){return Qkt.partition().size([2*Math.PI,e.height+1])(e)}DD.formatSliceLabel=function(e,t,r,n,i){var a=r.texttemplate,o=r.textinfo;if(!a&&(!o||o==="none"))return"";var s=i.separators,l=n[0],u=e.data.data,c=l.hierarchy,f=sl.isHierarchyRoot(e),h=sl.getParent(c,e),d=sl.getValue(e);if(!a){var v=o.split("+"),x=function(p){return v.indexOf(p)!==-1},b=[],g;if(x("label")&&u.label&&b.push(u.label),u.hasOwnProperty("v")&&x("value")&&b.push(sl.formatValue(u.v,s)),!f){x("current path")&&b.push(sl.getPath(e.data));var E=0;x("percent parent")&&E++,x("percent entry")&&E++,x("percent root")&&E++;var k=E>1;if(E){var A,L=function(p){g=sl.formatPercent(A,s),k&&(g+=" of "+p),b.push(g)};x("percent parent")&&!f&&(A=d/sl.getValue(h),L("parent")),x("percent entry")&&(A=d/sl.getValue(t),L("entry")),x("percent root")&&(A=d/sl.getValue(c),L("root"))}}return x("text")&&(g=bv.castOption(r,u.i,"text"),bv.isValidTextValue(g)&&b.push(g)),b.join("
")}var _=bv.castOption(r,u.i,"texttemplate");if(!_)return"";var C={};u.label&&(C.label=u.label),u.hasOwnProperty("v")&&(C.value=u.v,C.valueLabel=sl.formatValue(u.v,s)),C.currentPath=sl.getPath(e.data),f||(C.percentParent=d/sl.getValue(h),C.percentParentLabel=sl.formatPercent(C.percentParent,s),C.parent=sl.getPtLabel(h)),C.percentEntry=d/sl.getValue(t),C.percentEntryLabel=sl.formatPercent(C.percentEntry,s),C.entry=sl.getPtLabel(t),C.percentRoot=d/sl.getValue(c),C.percentRootLabel=sl.formatPercent(C.percentRoot,s),C.root=sl.getPtLabel(c),u.hasOwnProperty("color")&&(C.color=u.color);var M=bv.castOption(r,u.i,"text");return(bv.isValidTextValue(M)||M==="")&&(C.text=M),C.customdata=bv.castOption(r,u.i,"customdata"),bv.texttemplateString(_,C,i._d3locale,C,r._meta||{})};function uCt(e){return e.rpx0===0&&bv.isFullCircle([e.x0,e.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2))}function hCe(e){return cCt(e.rpx1,e.transform.textPosAngle)}function cCt(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}});var gCe=ye((odr,pCe)=>{"use strict";pCe.exports={moduleType:"trace",name:"sunburst",basePlotModule:LEe(),categories:[],animatable:!0,attributes:AE(),layoutAttributes:aW(),supplyDefaults:OEe(),supplyLayoutDefaults:NEe(),calc:EE().calc,crossTraceCalc:EE().crossTraceCalc,plot:zD().plot,style:kW().style,colorbar:Kd(),meta:{}}});var yCe=ye((sdr,mCe)=>{"use strict";mCe.exports=gCe()});var xCe=ye(L5=>{"use strict";var _Ce=Xu();L5.name="treemap";L5.plot=function(e,t,r,n){_Ce.plotBasePlot(L5.name,e,t,r,n)};L5.clean=function(e,t,r,n){_Ce.cleanBasePlot(L5.name,e,t,r,n)}});var z2=ye((udr,bCe)=>{"use strict";bCe.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}});var FD=ye((cdr,TCe)=>{"use strict";var fCt=Wo().hovertemplateAttrs,hCt=Wo().texttemplateAttrs,dCt=Kl(),vCt=Ju().attributes,F2=A2(),Q0=AE(),wCe=z2(),LW=no().extendFlat,pCt=Ed().pattern;TCe.exports={labels:Q0.labels,parents:Q0.parents,values:Q0.values,branchvalues:Q0.branchvalues,count:Q0.count,level:Q0.level,maxdepth:Q0.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:LW({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:Q0.marker.colors,pattern:pCt,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:Q0.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},dCt("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:LW({},F2.textfont,{}),editType:"calc"},text:F2.text,textinfo:Q0.textinfo,texttemplate:hCt({editType:"plot"},{keys:wCe.eventDataKeys.concat(["label","value"])}),hovertext:F2.hovertext,hoverinfo:Q0.hoverinfo,hovertemplate:fCt({},{keys:wCe.eventDataKeys}),textfont:F2.textfont,insidetextfont:F2.insidetextfont,outsidetextfont:LW({},F2.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:F2.sort,root:Q0.root,domain:vCt({name:"treemap",trace:!0,editType:"calc"})}});var PW=ye((fdr,ACe)=>{"use strict";ACe.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}});var kCe=ye((hdr,ECe)=>{"use strict";var SCe=Mr(),gCt=FD(),mCt=va(),yCt=Ju().defaults,_Ct=r0().handleText,xCt=Qb().TEXTPAD,bCt=S2().handleMarkerDefaults,MCe=Mu(),wCt=MCe.hasColorscale,TCt=MCe.handleDefaults;ECe.exports=function(t,r,n,i){function a(b,g){return SCe.coerce(t,r,gCt,b,g)}var o=a("labels"),s=a("parents");if(!o||!o.length||!s||!s.length){r.visible=!1;return}var l=a("values");l&&l.length?a("branchvalues"):a("count"),a("level"),a("maxdepth");var u=a("tiling.packing");u==="squarify"&&a("tiling.squarifyratio"),a("tiling.flip"),a("tiling.pad");var c=a("text");a("texttemplate"),r.texttemplate||a("textinfo",SCe.isArrayOrTypedArray(c)?"text+label":"label"),a("hovertext"),a("hovertemplate");var f=a("pathbar.visible"),h="auto";_Ct(t,r,i,a,h,{hasPathbar:f,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),a("textposition");var d=r.textposition.indexOf("bottom")!==-1;bCt(t,r,i,a);var v=r._hasColorscale=wCt(t,"marker","colors")||(t.marker||{}).coloraxis;v?TCt(t,r,i,a,{prefix:"marker.",cLetter:"c"}):a("marker.depthfade",!(r.marker.colors||[]).length);var x=r.textfont.size*2;a("marker.pad.t",d?x/4:x),a("marker.pad.l",x/4),a("marker.pad.r",x/4),a("marker.pad.b",d?x:x/4),a("marker.cornerradius"),r._hovered={marker:{line:{width:2,color:mCt.contrast(i.paper_bgcolor)}}},f&&(a("pathbar.thickness",r.pathbar.textfont.size+2*xCt),a("pathbar.side"),a("pathbar.edgeshape")),a("sort"),a("root.color"),yCt(r,i,a),r._length=null}});var LCe=ye((ddr,CCe)=>{"use strict";var ACt=Mr(),SCt=PW();CCe.exports=function(t,r){function n(i,a){return ACt.coerce(t,r,SCt,i,a)}n("treemapcolorway",r.colorway),n("extendtreemapcolors")}});var RW=ye(IW=>{"use strict";var PCe=EE();IW.calc=function(e,t){return PCe.calc(e,t)};IW.crossTraceCalc=function(e){return PCe._runCrossTraceCalc("treemap",e)}});var DW=ye((pdr,ICe)=>{"use strict";ICe.exports=function e(t,r,n){var i;n.swapXY&&(i=t.x0,t.x0=t.y0,t.y0=i,i=t.x1,t.x1=t.y1,t.y1=i),n.flipX&&(i=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-i),n.flipY&&(i=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-i);var a=t.children;if(a)for(var o=0;o{"use strict";var P5=SE(),MCt=DW();RCe.exports=function(t,r,n){var i=n.flipX,a=n.flipY,o=n.packing==="dice-slice",s=n.pad[a?"bottom":"top"],l=n.pad[i?"right":"left"],u=n.pad[i?"left":"right"],c=n.pad[a?"top":"bottom"],f;o&&(f=l,l=s,s=f,f=u,u=c,c=f);var h=P5.treemap().tile(ECt(n.packing,n.squarifyratio)).paddingInner(n.pad.inner).paddingLeft(l).paddingRight(u).paddingTop(s).paddingBottom(c).size(o?[r[1],r[0]]:r)(t);return(o||i||a)&&MCt(h,r,{swapXY:o,flipX:i,flipY:a}),h};function ECt(e,t){switch(e){case"squarify":return P5.treemapSquarify.ratio(t);case"binary":return P5.treemapBinary;case"dice":return P5.treemapDice;case"slice":return P5.treemapSlice;default:return P5.treemapSliceDice}}});var qD=ye((mdr,qCe)=>{"use strict";var DCe=xa(),I5=va(),zCe=Mr(),FW=Ky(),kCt=_v().resizeText,CCt=RD();function LCt(e){var t=e._fullLayout._treemaplayer.selectAll(".trace");kCt(e,t,"treemap"),t.each(function(r){var n=DCe.select(this),i=r[0],a=i.trace;n.style("opacity",a.opacity),n.selectAll("path.surface").each(function(o){DCe.select(this).call(FCe,o,a,e,{hovered:!1})})})}function FCe(e,t,r,n,i){var a=(i||{}).hovered,o=t.data.data,s=o.i,l,u,c=o.color,f=FW.isHierarchyRoot(t),h=1;if(a)l=r._hovered.marker.line.color,u=r._hovered.marker.line.width;else if(f&&c===r.root.color)h=100,l="rgba(0,0,0,0)",u=0;else if(l=zCe.castOption(r,s,"marker.line.color")||I5.defaultLine,u=zCe.castOption(r,s,"marker.line.width")||0,!r._hasColorscale&&!t.onPathbar){var d=r.marker.depthfade;if(d){var v=I5.combine(I5.addOpacity(r._backgroundColor,.75),c),x;if(d===!0){var b=FW.getMaxDepth(r);isFinite(b)?FW.isLeaf(t)?x=0:x=r._maxVisibleLayers-(t.data.depth-r._entryDepth):x=t.data.height+1}else x=t.data.depth-r._entryDepth,r._atRootLevel||x++;if(x>0)for(var g=0;g{"use strict";var OCe=xa(),OD=Mr(),BCe=ao(),PCt=Ll(),ICt=zW(),NCe=qD().styleOne,qW=z2(),R5=Ky(),RCt=OE(),OW=!0;UCe.exports=function(t,r,n,i,a){var o=a.barDifY,s=a.width,l=a.height,u=a.viewX,c=a.viewY,f=a.pathSlice,h=a.toMoveInsideSlice,d=a.strTransform,v=a.hasTransition,x=a.handleSlicesExit,b=a.makeUpdateSliceInterpolator,g=a.makeUpdateTextInterpolator,E={},k=t._context.staticPlot,A=t._fullLayout,L=r[0],_=L.trace,C=L.hierarchy,M=s/_._entryDepth,p=R5.listPath(n.data,"id"),P=ICt(C.copy(),[s,l],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();P=P.filter(function(F){var q=p.indexOf(F.data.id);return q===-1?!1:(F.x0=M*q,F.x1=M*(q+1),F.y0=o,F.y1=o+l,F.onPathbar=!0,!0)}),P.reverse(),i=i.data(P,R5.getPtId),i.enter().append("g").classed("pathbar",!0),x(i,OW,E,[s,l],f),i.order();var T=i;v&&(T=T.transition().each("end",function(){var F=OCe.select(this);R5.setSliceCursor(F,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),T.each(function(F){F._x0=u(F.x0),F._x1=u(F.x1),F._y0=c(F.y0),F._y1=c(F.y1),F._hoverX=u(F.x1-Math.min(s,l)/2),F._hoverY=c(F.y1-l/2);var q=OCe.select(this),V=OD.ensureSingle(q,"path","surface",function(N){N.style("pointer-events",k?"none":"all")});v?V.transition().attrTween("d",function(N){var W=b(N,OW,E,[s,l]);return function(re){return f(W(re))}}):V.attr("d",f),q.call(RCt,n,t,r,{styleOne:NCe,eventDataKeys:qW.eventDataKeys,transitionTime:qW.CLICK_TRANSITION_TIME,transitionEasing:qW.CLICK_TRANSITION_EASING}).call(R5.setSliceCursor,t,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:t._transitioning}),V.call(NCe,F,_,t,{hovered:!1}),F._text=(R5.getPtLabel(F)||"").split("
").join(" ")||"";var H=OD.ensureSingle(q,"g","slicetext"),X=OD.ensureSingle(H,"text","",function(N){N.attr("data-notex",1)}),G=OD.ensureUniformFontSize(t,R5.determineTextFont(_,F,A.font,{onPathbar:!0}));X.text(F._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(BCe.font,G).call(PCt.convertToTspans,t),F.textBB=BCe.bBox(X.node()),F.transform=h(F,{fontSize:G.size,onPathbar:!0}),F.transform.fontSize=G.size,v?X.transition().attrTween("transform",function(N){var W=g(N,OW,E,[s,l]);return function(re){return d(W(re))}}):X.attr("transform",d(F))})}});var WCe=ye((_dr,jCe)=>{"use strict";var HCe=xa(),BW=(R2(),ab(I2)).interpolate,X_=Ky(),NE=Mr(),GCe=Qb().TEXTPAD,DCt=i2(),zCt=DCt.toMoveInsideBar,FCt=_v(),NW=FCt.recordMinTextSize,qCt=z2(),OCt=VCe();function q2(e){return X_.isHierarchyRoot(e)?"":X_.getPtId(e)}jCe.exports=function(t,r,n,i,a){var o=t._fullLayout,s=r[0],l=s.trace,u=l.type,c=u==="icicle",f=s.hierarchy,h=X_.findEntryWithLevel(f,l.level),d=HCe.select(n),v=d.selectAll("g.pathbar"),x=d.selectAll("g.slice");if(!h){v.remove(),x.remove();return}var b=X_.isHierarchyRoot(h),g=!o.uniformtext.mode&&X_.hasTransition(i),E=X_.getMaxDepth(l),k=function(Ke){return Ke.data.depth-h.data.depth-1?C+P:-(p+P):0,F={x0:M,x1:M,y0:T,y1:T+p},q=function(Ke,xt,bt){var Lt=l.tiling.pad,St=function($t){return $t-Lt<=xt.x0},Et=function($t){return $t+Lt>=xt.x1},dt=function($t){return $t-Lt<=xt.y0},Ht=function($t){return $t+Lt>=xt.y1};return Ke.x0===xt.x0&&Ke.x1===xt.x1&&Ke.y0===xt.y0&&Ke.y1===xt.y1?{x0:Ke.x0,x1:Ke.x1,y0:Ke.y0,y1:Ke.y1}:{x0:St(Ke.x0-Lt)?0:Et(Ke.x0-Lt)?bt[0]:Ke.x0,x1:St(Ke.x1+Lt)?0:Et(Ke.x1+Lt)?bt[0]:Ke.x1,y0:dt(Ke.y0-Lt)?0:Ht(Ke.y0-Lt)?bt[1]:Ke.y0,y1:dt(Ke.y1+Lt)?0:Ht(Ke.y1+Lt)?bt[1]:Ke.y1}},V=null,H={},X={},G=null,N=function(Ke,xt){return xt?H[q2(Ke)]:X[q2(Ke)]},W=function(Ke,xt,bt,Lt){if(xt)return H[q2(f)]||F;var St=X[l.level]||bt;return k(Ke)?q(Ke,St,Lt):{}};s.hasMultipleRoots&&b&&E++,l._maxDepth=E,l._backgroundColor=o.paper_bgcolor,l._entryDepth=h.data.depth,l._atRootLevel=b;var re=-_/2+A.l+A.w*(L.x[1]+L.x[0])/2,ae=-C/2+A.t+A.h*(1-(L.y[1]+L.y[0])/2),_e=function(Ke){return re+Ke},Me=function(Ke){return ae+Ke},ke=Me(0),ge=_e(0),ie=function(Ke){return ge+Ke},Te=function(Ke){return ke+Ke};function Ee(Ke,xt){return Ke+","+xt}var Ae=ie(0),ze=function(Ke){Ke.x=Math.max(Ae,Ke.x)},Ce=l.pathbar.edgeshape,me=function(Ke){var xt=ie(Math.max(Math.min(Ke.x0,Ke.x0),0)),bt=ie(Math.min(Math.max(Ke.x1,Ke.x1),M)),Lt=Te(Ke.y0),St=Te(Ke.y1),Et=p/2,dt={},Ht={};dt.x=xt,Ht.x=bt,dt.y=Ht.y=(Lt+St)/2;var $t={x:xt,y:Lt},fr={x:bt,y:Lt},_r={x:bt,y:St},Br={x:xt,y:St};return Ce===">"?($t.x-=Et,fr.x-=Et,_r.x-=Et,Br.x-=Et):Ce==="/"?(_r.x-=Et,Br.x-=Et,dt.x-=Et/2,Ht.x-=Et/2):Ce==="\\"?($t.x-=Et,fr.x-=Et,dt.x-=Et/2,Ht.x-=Et/2):Ce==="<"&&(dt.x-=Et,Ht.x-=Et),ze($t),ze(Br),ze(dt),ze(fr),ze(_r),ze(Ht),"M"+Ee($t.x,$t.y)+"L"+Ee(fr.x,fr.y)+"L"+Ee(Ht.x,Ht.y)+"L"+Ee(_r.x,_r.y)+"L"+Ee(Br.x,Br.y)+"L"+Ee(dt.x,dt.y)+"Z"},Re=l[c?"tiling":"marker"].pad,ce=function(Ke){return l.textposition.indexOf(Ke)!==-1},Ge=ce("top"),nt=ce("left"),ct=ce("right"),qt=ce("bottom"),rt=function(Ke){var xt=_e(Ke.x0),bt=_e(Ke.x1),Lt=Me(Ke.y0),St=Me(Ke.y1),Et=bt-xt,dt=St-Lt;if(!Et||!dt)return"";var Ht=l.marker.cornerradius||0,$t=Math.min(Ht,Et/2,dt/2);$t&&Ke.data&&Ke.data.data&&Ke.data.data.label&&(Ge&&($t=Math.min($t,Re.t)),nt&&($t=Math.min($t,Re.l)),ct&&($t=Math.min($t,Re.r)),qt&&($t=Math.min($t,Re.b)));var fr=function(_r,Br){return $t?"a"+Ee($t,$t)+" 0 0 1 "+Ee(_r,Br):""};return"M"+Ee(xt,Lt+$t)+fr($t,-$t)+"L"+Ee(bt-$t,Lt)+fr($t,$t)+"L"+Ee(bt,St-$t)+fr(-$t,$t)+"L"+Ee(xt+$t,St)+fr(-$t,-$t)+"Z"},ot=function(Ke,xt){var bt=Ke.x0,Lt=Ke.x1,St=Ke.y0,Et=Ke.y1,dt=Ke.textBB,Ht=Ge||xt.isHeader&&!qt,$t=Ht?"start":qt?"end":"middle",fr=ce("right"),_r=ce("left")||xt.onPathbar,Br=_r?-1:fr?1:0;if(xt.isHeader){if(bt+=(c?Re:Re.l)-GCe,Lt-=(c?Re:Re.r)-GCe,bt>=Lt){var Or=(bt+Lt)/2;bt=Or,Lt=Or}var Nr;qt?(Nr=Et-(c?Re:Re.b),St{"use strict";var BCt=xa(),NCt=Ky(),UCt=_v(),VCt=UCt.clearMinTextSize,HCt=N0().resizeText,ZCe=WCe();XCe.exports=function(t,r,n,i,a){var o=a.type,s=a.drawDescendants,l=t._fullLayout,u=l["_"+o+"layer"],c,f,h=!n;if(VCt(o,l),c=u.selectAll("g.trace."+o).data(r,function(v){return v[0].trace.uid}),c.enter().append("g").classed("trace",!0).classed(o,!0),c.order(),!l.uniformtext.mode&&NCt.hasTransition(n)){i&&(f=i());var d=BCt.transition().duration(n.duration).ease(n.easing).each("end",function(){f&&f()}).each("interrupt",function(){f&&f()});d.each(function(){u.selectAll("g.trace").each(function(v){ZCe(t,v,this,n,s)})})}else c.each(function(v){ZCe(t,v,this,n,s)}),l.uniformtext.mode&&HCt(t,u.selectAll(".trace"),o);h&&c.exit().remove()}});var QCe=ye((bdr,$Ce)=>{"use strict";var YCe=xa(),BD=Mr(),KCe=ao(),GCt=Ll(),jCt=zW(),JCe=qD().styleOne,VW=z2(),Y_=Ky(),WCt=OE(),ZCt=zD().formatSliceLabel,HW=!1;$Ce.exports=function(t,r,n,i,a){var o=a.width,s=a.height,l=a.viewX,u=a.viewY,c=a.pathSlice,f=a.toMoveInsideSlice,h=a.strTransform,d=a.hasTransition,v=a.handleSlicesExit,x=a.makeUpdateSliceInterpolator,b=a.makeUpdateTextInterpolator,g=a.prevEntry,E={},k=t._context.staticPlot,A=t._fullLayout,L=r[0],_=L.trace,C=_.textposition.indexOf("left")!==-1,M=_.textposition.indexOf("right")!==-1,p=_.textposition.indexOf("bottom")!==-1,P=!p&&!_.marker.pad.t||p&&!_.marker.pad.b,T=jCt(n,[o,s],{packing:_.tiling.packing,squarifyratio:_.tiling.squarifyratio,flipX:_.tiling.flip.indexOf("x")>-1,flipY:_.tiling.flip.indexOf("y")>-1,pad:{inner:_.tiling.pad,top:_.marker.pad.t,left:_.marker.pad.l,right:_.marker.pad.r,bottom:_.marker.pad.b}}),F=T.descendants(),q=1/0,V=-1/0;F.forEach(function(W){var re=W.depth;re>=_._maxDepth?(W.x0=W.x1=(W.x0+W.x1)/2,W.y0=W.y1=(W.y0+W.y1)/2):(q=Math.min(q,re),V=Math.max(V,re))}),i=i.data(F,Y_.getPtId),_._maxVisibleLayers=isFinite(V)?V-q+1:0,i.enter().append("g").classed("slice",!0),v(i,HW,E,[o,s],c),i.order();var H=null;if(d&&g){var X=Y_.getPtId(g);i.each(function(W){H===null&&Y_.getPtId(W)===X&&(H={x0:W.x0,x1:W.x1,y0:W.y0,y1:W.y1})})}var G=function(){return H||{x0:0,x1:o,y0:0,y1:s}},N=i;return d&&(N=N.transition().each("end",function(){var W=YCe.select(this);Y_.setSliceCursor(W,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),N.each(function(W){var re=Y_.isHeader(W,_);W._x0=l(W.x0),W._x1=l(W.x1),W._y0=u(W.y0),W._y1=u(W.y1),W._hoverX=l(W.x1-_.marker.pad.r),W._hoverY=u(p?W.y1-_.marker.pad.b/2:W.y0+_.marker.pad.t/2);var ae=YCe.select(this),_e=BD.ensureSingle(ae,"path","surface",function(Ee){Ee.style("pointer-events",k?"none":"all")});d?_e.transition().attrTween("d",function(Ee){var Ae=x(Ee,HW,G(),[o,s]);return function(ze){return c(Ae(ze))}}):_e.attr("d",c),ae.call(WCt,n,t,r,{styleOne:JCe,eventDataKeys:VW.eventDataKeys,transitionTime:VW.CLICK_TRANSITION_TIME,transitionEasing:VW.CLICK_TRANSITION_EASING}).call(Y_.setSliceCursor,t,{isTransitioning:t._transitioning}),_e.call(JCe,W,_,t,{hovered:!1}),W.x0===W.x1||W.y0===W.y1?W._text="":re?W._text=P?"":Y_.getPtLabel(W)||"":W._text=ZCt(W,n,_,r,A)||"";var Me=BD.ensureSingle(ae,"g","slicetext"),ke=BD.ensureSingle(Me,"text","",function(Ee){Ee.attr("data-notex",1)}),ge=BD.ensureUniformFontSize(t,Y_.determineTextFont(_,W,A.font)),ie=W._text||" ",Te=re&&ie.indexOf("
")===-1;ke.text(ie).classed("slicetext",!0).attr("text-anchor",M?"end":C||Te?"start":"middle").call(KCe.font,ge).call(GCt.convertToTspans,t),W.textBB=KCe.bBox(ke.node()),W.transform=f(W,{fontSize:ge.size,isHeader:re}),W.transform.fontSize=ge.size,d?ke.transition().attrTween("transform",function(Ee){var Ae=b(Ee,HW,G(),[o,s]);return function(ze){return h(Ae(ze))}}):ke.attr("transform",h(W))}),H}});var t6e=ye((wdr,e6e)=>{"use strict";var XCt=UW(),YCt=QCe();e6e.exports=function(t,r,n,i){return XCt(t,r,n,i,{type:"treemap",drawDescendants:YCt})}});var i6e=ye((Tdr,r6e)=>{"use strict";r6e.exports={moduleType:"trace",name:"treemap",basePlotModule:xCe(),categories:[],animatable:!0,attributes:FD(),layoutAttributes:PW(),supplyDefaults:kCe(),supplyLayoutDefaults:LCe(),calc:RW().calc,crossTraceCalc:RW().crossTraceCalc,plot:t6e(),style:qD().style,colorbar:Kd(),meta:{}}});var a6e=ye((Adr,n6e)=>{"use strict";n6e.exports=i6e()});var s6e=ye(D5=>{"use strict";var o6e=Xu();D5.name="icicle";D5.plot=function(e,t,r,n){o6e.plotBasePlot(D5.name,e,t,r,n)};D5.clean=function(e,t,r,n){o6e.cleanBasePlot(D5.name,e,t,r,n)}});var GW=ye((Mdr,u6e)=>{"use strict";var KCt=Wo().hovertemplateAttrs,JCt=Wo().texttemplateAttrs,$Ct=Kl(),QCt=Ju().attributes,UE=A2(),o0=AE(),ND=FD(),l6e=z2(),e6t=no().extendFlat,t6t=Ed().pattern;u6e.exports={labels:o0.labels,parents:o0.parents,values:o0.values,branchvalues:o0.branchvalues,count:o0.count,level:o0.level,maxdepth:o0.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:ND.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:e6t({colors:o0.marker.colors,line:o0.marker.line,pattern:t6t,editType:"calc"},$Ct("marker",{colorAttr:"colors",anim:!1})),leaf:o0.leaf,pathbar:ND.pathbar,text:UE.text,textinfo:o0.textinfo,texttemplate:JCt({editType:"plot"},{keys:l6e.eventDataKeys.concat(["label","value"])}),hovertext:UE.hovertext,hoverinfo:o0.hoverinfo,hovertemplate:KCt({},{keys:l6e.eventDataKeys}),textfont:UE.textfont,insidetextfont:UE.insidetextfont,outsidetextfont:ND.outsidetextfont,textposition:ND.textposition,sort:UE.sort,root:o0.root,domain:QCt({name:"icicle",trace:!0,editType:"calc"})}});var jW=ye((Edr,c6e)=>{"use strict";c6e.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}});var v6e=ye((kdr,d6e)=>{"use strict";var f6e=Mr(),r6t=GW(),i6t=va(),n6t=Ju().defaults,a6t=r0().handleText,o6t=Qb().TEXTPAD,s6t=S2().handleMarkerDefaults,h6e=Mu(),l6t=h6e.hasColorscale,u6t=h6e.handleDefaults;d6e.exports=function(t,r,n,i){function a(d,v){return f6e.coerce(t,r,r6t,d,v)}var o=a("labels"),s=a("parents");if(!o||!o.length||!s||!s.length){r.visible=!1;return}var l=a("values");l&&l.length?a("branchvalues"):a("count"),a("level"),a("maxdepth"),a("tiling.orientation"),a("tiling.flip"),a("tiling.pad");var u=a("text");a("texttemplate"),r.texttemplate||a("textinfo",f6e.isArrayOrTypedArray(u)?"text+label":"label"),a("hovertext"),a("hovertemplate");var c=a("pathbar.visible"),f="auto";a6t(t,r,i,a,f,{hasPathbar:c,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),a("textposition"),s6t(t,r,i,a);var h=r._hasColorscale=l6t(t,"marker","colors")||(t.marker||{}).coloraxis;h&&u6t(t,r,i,a,{prefix:"marker.",cLetter:"c"}),a("leaf.opacity",h?1:.7),r._hovered={marker:{line:{width:2,color:i6t.contrast(i.paper_bgcolor)}}},c&&(a("pathbar.thickness",r.pathbar.textfont.size+2*o6t),a("pathbar.side"),a("pathbar.edgeshape")),a("sort"),a("root.color"),n6t(r,i,a),r._length=null}});var g6e=ye((Cdr,p6e)=>{"use strict";var c6t=Mr(),f6t=jW();p6e.exports=function(t,r){function n(i,a){return c6t.coerce(t,r,f6t,i,a)}n("iciclecolorway",r.colorway),n("extendiciclecolors")}});var ZW=ye(WW=>{"use strict";var m6e=EE();WW.calc=function(e,t){return m6e.calc(e,t)};WW.crossTraceCalc=function(e){return m6e._runCrossTraceCalc("icicle",e)}});var _6e=ye((Pdr,y6e)=>{"use strict";var h6t=SE(),d6t=DW();y6e.exports=function(t,r,n){var i=n.flipX,a=n.flipY,o=n.orientation==="h",s=n.maxDepth,l=r[0],u=r[1];s&&(l=(t.height+1)*r[0]/Math.min(t.height+1,s),u=(t.height+1)*r[1]/Math.min(t.height+1,s));var c=h6t.partition().padding(n.pad.inner).size(o?[r[1],l]:[r[0],u])(t);return(o||i||a)&&d6t(c,r,{swapXY:o,flipX:i,flipY:a}),c}});var XW=ye((Idr,A6e)=>{"use strict";var x6e=xa(),b6e=va(),w6e=Mr(),v6t=_v().resizeText,p6t=RD();function g6t(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");v6t(e,t,"icicle"),t.each(function(r){var n=x6e.select(this),i=r[0],a=i.trace;n.style("opacity",a.opacity),n.selectAll("path.surface").each(function(o){x6e.select(this).call(T6e,o,a,e)})})}function T6e(e,t,r,n){var i=t.data.data,a=!t.children,o=i.i,s=w6e.castOption(r,o,"marker.line.color")||b6e.defaultLine,l=w6e.castOption(r,o,"marker.line.width")||0;e.call(p6t,t,r,n).style("stroke-width",l).call(b6e.stroke,s).style("opacity",a?r.leaf.opacity:null)}A6e.exports={style:g6t,styleOne:T6e}});var C6e=ye((Rdr,k6e)=>{"use strict";var S6e=xa(),UD=Mr(),M6e=ao(),m6t=Ll(),y6t=_6e(),E6e=XW().styleOne,YW=z2(),z5=Ky(),_6t=OE(),x6t=zD().formatSliceLabel,KW=!1;k6e.exports=function(t,r,n,i,a){var o=a.width,s=a.height,l=a.viewX,u=a.viewY,c=a.pathSlice,f=a.toMoveInsideSlice,h=a.strTransform,d=a.hasTransition,v=a.handleSlicesExit,x=a.makeUpdateSliceInterpolator,b=a.makeUpdateTextInterpolator,g=a.prevEntry,E={},k=t._context.staticPlot,A=t._fullLayout,L=r[0],_=L.trace,C=_.textposition.indexOf("left")!==-1,M=_.textposition.indexOf("right")!==-1,p=_.textposition.indexOf("bottom")!==-1,P=y6t(n,[o,s],{flipX:_.tiling.flip.indexOf("x")>-1,flipY:_.tiling.flip.indexOf("y")>-1,orientation:_.tiling.orientation,pad:{inner:_.tiling.pad},maxDepth:_._maxDepth}),T=P.descendants(),F=1/0,q=-1/0;T.forEach(function(N){var W=N.depth;W>=_._maxDepth?(N.x0=N.x1=(N.x0+N.x1)/2,N.y0=N.y1=(N.y0+N.y1)/2):(F=Math.min(F,W),q=Math.max(q,W))}),i=i.data(T,z5.getPtId),_._maxVisibleLayers=isFinite(q)?q-F+1:0,i.enter().append("g").classed("slice",!0),v(i,KW,E,[o,s],c),i.order();var V=null;if(d&&g){var H=z5.getPtId(g);i.each(function(N){V===null&&z5.getPtId(N)===H&&(V={x0:N.x0,x1:N.x1,y0:N.y0,y1:N.y1})})}var X=function(){return V||{x0:0,x1:o,y0:0,y1:s}},G=i;return d&&(G=G.transition().each("end",function(){var N=S6e.select(this);z5.setSliceCursor(N,t,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),G.each(function(N){N._x0=l(N.x0),N._x1=l(N.x1),N._y0=u(N.y0),N._y1=u(N.y1),N._hoverX=l(N.x1-_.tiling.pad),N._hoverY=u(p?N.y1-_.tiling.pad/2:N.y0+_.tiling.pad/2);var W=S6e.select(this),re=UD.ensureSingle(W,"path","surface",function(ke){ke.style("pointer-events",k?"none":"all")});d?re.transition().attrTween("d",function(ke){var ge=x(ke,KW,X(),[o,s],{orientation:_.tiling.orientation,flipX:_.tiling.flip.indexOf("x")>-1,flipY:_.tiling.flip.indexOf("y")>-1});return function(ie){return c(ge(ie))}}):re.attr("d",c),W.call(_6t,n,t,r,{styleOne:E6e,eventDataKeys:YW.eventDataKeys,transitionTime:YW.CLICK_TRANSITION_TIME,transitionEasing:YW.CLICK_TRANSITION_EASING}).call(z5.setSliceCursor,t,{isTransitioning:t._transitioning}),re.call(E6e,N,_,t,{hovered:!1}),N.x0===N.x1||N.y0===N.y1?N._text="":N._text=x6t(N,n,_,r,A)||"";var ae=UD.ensureSingle(W,"g","slicetext"),_e=UD.ensureSingle(ae,"text","",function(ke){ke.attr("data-notex",1)}),Me=UD.ensureUniformFontSize(t,z5.determineTextFont(_,N,A.font));_e.text(N._text||" ").classed("slicetext",!0).attr("text-anchor",M?"end":C?"start":"middle").call(M6e.font,Me).call(m6t.convertToTspans,t),N.textBB=M6e.bBox(_e.node()),N.transform=f(N,{fontSize:Me.size}),N.transform.fontSize=Me.size,d?_e.transition().attrTween("transform",function(ke){var ge=b(ke,KW,X(),[o,s]);return function(ie){return h(ge(ie))}}):_e.attr("transform",h(N))}),V}});var P6e=ye((Ddr,L6e)=>{"use strict";var b6t=UW(),w6t=C6e();L6e.exports=function(t,r,n,i){return b6t(t,r,n,i,{type:"icicle",drawDescendants:w6t})}});var R6e=ye((zdr,I6e)=>{"use strict";I6e.exports={moduleType:"trace",name:"icicle",basePlotModule:s6e(),categories:[],animatable:!0,attributes:GW(),layoutAttributes:jW(),supplyDefaults:v6e(),supplyLayoutDefaults:g6e(),calc:ZW().calc,crossTraceCalc:ZW().crossTraceCalc,plot:P6e(),style:XW().style,colorbar:Kd(),meta:{}}});var z6e=ye((Fdr,D6e)=>{"use strict";D6e.exports=R6e()});var q6e=ye(F5=>{"use strict";var F6e=Xu();F5.name="funnelarea";F5.plot=function(e,t,r,n){F6e.plotBasePlot(F5.name,e,t,r,n)};F5.clean=function(e,t,r,n){F6e.cleanBasePlot(F5.name,e,t,r,n)}});var JW=ye((Odr,O6e)=>{"use strict";var tv=A2(),T6t=vl(),A6t=Ju().attributes,S6t=Wo().hovertemplateAttrs,M6t=Wo().texttemplateAttrs,O2=no().extendFlat;O6e.exports={labels:tv.labels,label0:tv.label0,dlabel:tv.dlabel,values:tv.values,marker:{colors:tv.marker.colors,line:{color:O2({},tv.marker.line.color,{dflt:null}),width:O2({},tv.marker.line.width,{dflt:1}),editType:"calc"},pattern:tv.marker.pattern,editType:"calc"},text:tv.text,hovertext:tv.hovertext,scalegroup:O2({},tv.scalegroup,{}),textinfo:O2({},tv.textinfo,{flags:["label","text","value","percent"]}),texttemplate:M6t({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:O2({},T6t.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:S6t({},{keys:["label","color","value","text","percent"]}),textposition:O2({},tv.textposition,{values:["inside","none"],dflt:"inside"}),textfont:tv.textfont,insidetextfont:tv.insidetextfont,title:{text:tv.title.text,font:tv.title.font,position:O2({},tv.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:A6t({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}});var $W=ye((Bdr,B6e)=>{"use strict";var E6t=lD().hiddenlabels;B6e.exports={hiddenlabels:E6t,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}});var V6e=ye((Ndr,U6e)=>{"use strict";var N6e=Mr(),k6t=JW(),C6t=Ju().defaults,L6t=r0().handleText,P6t=S2().handleLabelsAndValues,I6t=S2().handleMarkerDefaults;U6e.exports=function(t,r,n,i){function a(x,b){return N6e.coerce(t,r,k6t,x,b)}var o=a("labels"),s=a("values"),l=P6t(o,s),u=l.len;if(r._hasLabels=l.hasLabels,r._hasValues=l.hasValues,!r._hasLabels&&r._hasValues&&(a("label0"),a("dlabel")),!u){r.visible=!1;return}r._length=u,I6t(t,r,i,a),a("scalegroup");var c=a("text"),f=a("texttemplate"),h;if(f||(h=a("textinfo",Array.isArray(c)?"text+percent":"percent")),a("hovertext"),a("hovertemplate"),f||h&&h!=="none"){var d=a("textposition");L6t(t,r,i,a,d,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else h==="none"&&a("textposition","none");C6t(r,i,a);var v=a("title.text");v&&(a("title.position"),N6e.coerceFont(a,"title.font",i.font)),a("aspectratio"),a("baseratio")}});var G6e=ye((Udr,H6e)=>{"use strict";var R6t=Mr(),D6t=$W();H6e.exports=function(t,r){function n(i,a){return R6t.coerce(t,r,D6t,i,a)}n("hiddenlabels"),n("funnelareacolorway",r.colorway),n("extendfunnelareacolors")}});var QW=ye((Vdr,W6e)=>{"use strict";var j6e=y5();function z6t(e,t){return j6e.calc(e,t)}function F6t(e){j6e.crossTraceCalc(e,{type:"funnelarea"})}W6e.exports={calc:z6t,crossTraceCalc:F6t}});var J6e=ye((Hdr,K6e)=>{"use strict";var B2=xa(),eZ=ao(),K_=Mr(),q6t=K_.strScale,Z6e=K_.strTranslate,X6e=Ll(),O6t=i2(),B6t=O6t.toMoveInsideBar,Y6e=_v(),N6t=Y6e.recordMinTextSize,U6t=Y6e.clearMinTextSize,V6t=l_(),q5=hD(),H6t=q5.attachFxHandlers,G6t=q5.determineInsideTextFont,j6t=q5.layoutAreas,W6t=q5.prerenderTitles,Z6t=q5.positionTitleOutside,X6t=q5.formatSliceLabel;K6e.exports=function(t,r){var n=t._context.staticPlot,i=t._fullLayout;U6t("funnelarea",i),W6t(r,t),j6t(r,i._size),K_.makeTraceGroups(i._funnelarealayer,r,"trace").each(function(a){var o=B2.select(this),s=a[0],l=s.trace;K6t(a),o.each(function(){var u=B2.select(this).selectAll("g.slice").data(a);u.enter().append("g").classed("slice",!0),u.exit().remove(),u.each(function(f,h){if(f.hidden){B2.select(this).selectAll("path,g").remove();return}f.pointNumber=f.i,f.curveNumber=l.index;var d=s.cx,v=s.cy,x=B2.select(this),b=x.selectAll("path.surface").data([f]);b.enter().append("path").classed("surface",!0).style({"pointer-events":n?"none":"all"}),x.call(H6t,t,a);var g="M"+(d+f.TR[0])+","+(v+f.TR[1])+tZ(f.TR,f.BR)+tZ(f.BR,f.BL)+tZ(f.BL,f.TL)+"Z";b.attr("d",g),X6t(t,f,s);var E=V6t.castOption(l.textposition,f.pts),k=x.selectAll("g.slicetext").data(f.text&&E!=="none"?[0]:[]);k.enter().append("g").classed("slicetext",!0),k.exit().remove(),k.each(function(){var A=K_.ensureSingle(B2.select(this),"text","",function(F){F.attr("data-notex",1)}),L=K_.ensureUniformFontSize(t,G6t(l,f,i.font));A.text(f.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(eZ.font,L).call(X6e.convertToTspans,t);var _=eZ.bBox(A.node()),C,M,p,P=Math.min(f.BL[1],f.BR[1])+v,T=Math.max(f.TL[1],f.TR[1])+v;M=Math.max(f.TL[0],f.BL[0])+d,p=Math.min(f.TR[0],f.BR[0])+d,C=B6t(M,p,P,T,_,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),C.fontSize=L.size,N6t(l.type,C,i),a[h].transform=C,K_.setTransormAndDisplay(A,C)})});var c=B2.select(this).selectAll("g.titletext").data(l.title.text?[0]:[]);c.enter().append("g").classed("titletext",!0),c.exit().remove(),c.each(function(){var f=K_.ensureSingle(B2.select(this),"text","",function(v){v.attr("data-notex",1)}),h=l.title.text;l._meta&&(h=K_.templateString(h,l._meta)),f.text(h).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(eZ.font,l.title.font).call(X6e.convertToTspans,t);var d=Z6t(s,i._size);f.attr("transform",Z6e(d.x,d.y)+q6t(Math.min(1,d.scale))+Z6e(d.tx,d.ty))})})})};function tZ(e,t){var r=t[0]-e[0],n=t[1]-e[1];return"l"+r+","+n}function Y6t(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}function K6t(e){if(!e.length)return;var t=e[0],r=t.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a=Math.pow(i,2),o=t.vTotal,s=o*a/(1-a),l=o,u=s/o;function c(){var q=Math.sqrt(u);return{x:q,y:-q}}function f(){var q=c();return[q.x,q.y]}var h,d=[];d.push(f());var v,x;for(v=e.length-1;v>-1;v--)if(x=e[v],!x.hidden){var b=x.v/l;u+=b,d.push(f())}var g=1/0,E=-1/0;for(v=0;v-1;v--)if(x=e[v],!x.hidden){P+=1;var T=d[P][0],F=d[P][1];x.TL=[-T,F],x.TR=[T,F],x.BL=M,x.BR=p,x.pxmid=Y6t(x.TR,x.BR),M=x.TL,p=x.TR}}});var eLe=ye((Gdr,Q6e)=>{"use strict";var $6e=xa(),J6t=z3(),$6t=_v().resizeText;Q6e.exports=function(t){var r=t._fullLayout._funnelarealayer.selectAll(".trace");$6t(t,r,"funnelarea"),r.each(function(n){var i=n[0],a=i.trace,o=$6e.select(this);o.style({opacity:a.opacity}),o.selectAll("path.surface").each(function(s){$6e.select(this).call(J6t,s,a,t)})})}});var rLe=ye((jdr,tLe)=>{"use strict";tLe.exports={moduleType:"trace",name:"funnelarea",basePlotModule:q6e(),categories:["pie-like","funnelarea","showLegend"],attributes:JW(),layoutAttributes:$W(),supplyDefaults:V6e(),supplyLayoutDefaults:G6e(),calc:QW().calc,crossTraceCalc:QW().crossTraceCalc,plot:J6e(),style:eLe(),styleOne:z3(),meta:{}}});var nLe=ye((Wdr,iLe)=>{"use strict";iLe.exports=rLe()});var Rd=ye((Zdr,aLe)=>{(function(){var e={1964:function(i,a,o){i.exports={alpha_shape:o(3502),convex_hull:o(7352),delaunay_triangulate:o(7642),gl_cone3d:o(6405),gl_error3d:o(9165),gl_line3d:o(5714),gl_mesh3d:o(7201),gl_plot3d:o(4100),gl_scatter3d:o(8418),gl_streamtube3d:o(7815),gl_surface3d:o(9499),ndarray:o(9618),ndarray_linear_interpolate:o(4317)}},4793:function(i,a,o){"use strict";var s;function l(Le,xe){if(!(Le instanceof xe))throw new TypeError("Cannot call a class as a function")}function u(Le,xe){for(var Se=0;SeM)throw new RangeError('The value "'+Le+'" is invalid for option "size"');var xe=new Uint8Array(Le);return Object.setPrototypeOf(xe,T.prototype),xe}function T(Le,xe,Se){if(typeof Le=="number"){if(typeof xe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return H(Le)}return F(Le,xe,Se)}T.poolSize=8192;function F(Le,xe,Se){if(typeof Le=="string")return X(Le,xe);if(ArrayBuffer.isView(Le))return N(Le);if(Le==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(Le));if(Ne(Le,ArrayBuffer)||Le&&Ne(Le.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Ne(Le,SharedArrayBuffer)||Le&&Ne(Le.buffer,SharedArrayBuffer)))return W(Le,xe,Se);if(typeof Le=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var lt=Le.valueOf&&Le.valueOf();if(lt!=null&<!==Le)return T.from(lt,xe,Se);var Gt=re(Le);if(Gt)return Gt;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof Le[Symbol.toPrimitive]=="function")return T.from(Le[Symbol.toPrimitive]("string"),xe,Se);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+A(Le))}T.from=function(Le,xe,Se){return F(Le,xe,Se)},Object.setPrototypeOf(T.prototype,Uint8Array.prototype),Object.setPrototypeOf(T,Uint8Array);function q(Le){if(typeof Le!="number")throw new TypeError('"size" argument must be of type number');if(Le<0)throw new RangeError('The value "'+Le+'" is invalid for option "size"')}function V(Le,xe,Se){return q(Le),Le<=0?P(Le):xe!==void 0?typeof Se=="string"?P(Le).fill(xe,Se):P(Le).fill(xe):P(Le)}T.alloc=function(Le,xe,Se){return V(Le,xe,Se)};function H(Le){return q(Le),P(Le<0?0:ae(Le)|0)}T.allocUnsafe=function(Le){return H(Le)},T.allocUnsafeSlow=function(Le){return H(Le)};function X(Le,xe){if((typeof xe!="string"||xe==="")&&(xe="utf8"),!T.isEncoding(xe))throw new TypeError("Unknown encoding: "+xe);var Se=Me(Le,xe)|0,lt=P(Se),Gt=lt.write(Le,xe);return Gt!==Se&&(lt=lt.slice(0,Gt)),lt}function G(Le){for(var xe=Le.length<0?0:ae(Le.length)|0,Se=P(xe),lt=0;lt=M)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+M.toString(16)+" bytes");return Le|0}function _e(Le){return+Le!=Le&&(Le=0),T.alloc(+Le)}T.isBuffer=function(xe){return xe!=null&&xe._isBuffer===!0&&xe!==T.prototype},T.compare=function(xe,Se){if(Ne(xe,Uint8Array)&&(xe=T.from(xe,xe.offset,xe.byteLength)),Ne(Se,Uint8Array)&&(Se=T.from(Se,Se.offset,Se.byteLength)),!T.isBuffer(xe)||!T.isBuffer(Se))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(xe===Se)return 0;for(var lt=xe.length,Gt=Se.length,Vt=0,ar=Math.min(lt,Gt);VtGt.length?(T.isBuffer(ar)||(ar=T.from(ar)),ar.copy(Gt,Vt)):Uint8Array.prototype.set.call(Gt,ar,Vt);else if(T.isBuffer(ar))ar.copy(Gt,Vt);else throw new TypeError('"list" argument must be an Array of Buffers');Vt+=ar.length}return Gt};function Me(Le,xe){if(T.isBuffer(Le))return Le.length;if(ArrayBuffer.isView(Le)||Ne(Le,ArrayBuffer))return Le.byteLength;if(typeof Le!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+A(Le));var Se=Le.length,lt=arguments.length>2&&arguments[2]===!0;if(!lt&&Se===0)return 0;for(var Gt=!1;;)switch(xe){case"ascii":case"latin1":case"binary":return Se;case"utf8":case"utf-8":return _r(Le).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se*2;case"hex":return Se>>>1;case"base64":return Nr(Le).length;default:if(Gt)return lt?-1:_r(Le).length;xe=(""+xe).toLowerCase(),Gt=!0}}T.byteLength=Me;function ke(Le,xe,Se){var lt=!1;if((xe===void 0||xe<0)&&(xe=0),xe>this.length||((Se===void 0||Se>this.length)&&(Se=this.length),Se<=0)||(Se>>>=0,xe>>>=0,Se<=xe))return"";for(Le||(Le="utf8");;)switch(Le){case"hex":return rt(this,xe,Se);case"utf8":case"utf-8":return ce(this,xe,Se);case"ascii":return ct(this,xe,Se);case"latin1":case"binary":return qt(this,xe,Se);case"base64":return Re(this,xe,Se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ot(this,xe,Se);default:if(lt)throw new TypeError("Unknown encoding: "+Le);Le=(Le+"").toLowerCase(),lt=!0}}T.prototype._isBuffer=!0;function ge(Le,xe,Se){var lt=Le[xe];Le[xe]=Le[Se],Le[Se]=lt}T.prototype.swap16=function(){var xe=this.length;if(xe%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Se=0;SeSe&&(xe+=" ... "),""},C&&(T.prototype[C]=T.prototype.inspect),T.prototype.compare=function(xe,Se,lt,Gt,Vt){if(Ne(xe,Uint8Array)&&(xe=T.from(xe,xe.offset,xe.byteLength)),!T.isBuffer(xe))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+A(xe));if(Se===void 0&&(Se=0),lt===void 0&&(lt=xe?xe.length:0),Gt===void 0&&(Gt=0),Vt===void 0&&(Vt=this.length),Se<0||lt>xe.length||Gt<0||Vt>this.length)throw new RangeError("out of range index");if(Gt>=Vt&&Se>=lt)return 0;if(Gt>=Vt)return-1;if(Se>=lt)return 1;if(Se>>>=0,lt>>>=0,Gt>>>=0,Vt>>>=0,this===xe)return 0;for(var ar=Vt-Gt,Qr=lt-Se,ai=Math.min(ar,Qr),jr=this.slice(Gt,Vt),ri=xe.slice(Se,lt),bi=0;bi2147483647?Se=2147483647:Se<-2147483648&&(Se=-2147483648),Se=+Se,Ye(Se)&&(Se=Gt?0:Le.length-1),Se<0&&(Se=Le.length+Se),Se>=Le.length){if(Gt)return-1;Se=Le.length-1}else if(Se<0)if(Gt)Se=0;else return-1;if(typeof xe=="string"&&(xe=T.from(xe,lt)),T.isBuffer(xe))return xe.length===0?-1:Te(Le,xe,Se,lt,Gt);if(typeof xe=="number")return xe=xe&255,typeof Uint8Array.prototype.indexOf=="function"?Gt?Uint8Array.prototype.indexOf.call(Le,xe,Se):Uint8Array.prototype.lastIndexOf.call(Le,xe,Se):Te(Le,[xe],Se,lt,Gt);throw new TypeError("val must be string, number or Buffer")}function Te(Le,xe,Se,lt,Gt){var Vt=1,ar=Le.length,Qr=xe.length;if(lt!==void 0&&(lt=String(lt).toLowerCase(),lt==="ucs2"||lt==="ucs-2"||lt==="utf16le"||lt==="utf-16le")){if(Le.length<2||xe.length<2)return-1;Vt=2,ar/=2,Qr/=2,Se/=2}function ai(Wi,Ni){return Vt===1?Wi[Ni]:Wi.readUInt16BE(Ni*Vt)}var jr;if(Gt){var ri=-1;for(jr=Se;jrar&&(Se=ar-Qr),jr=Se;jr>=0;jr--){for(var bi=!0,nn=0;nnGt&&(lt=Gt)):lt=Gt;var Vt=xe.length;lt>Vt/2&&(lt=Vt/2);var ar;for(ar=0;ar>>0,isFinite(lt)?(lt=lt>>>0,Gt===void 0&&(Gt="utf8")):(Gt=lt,lt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Vt=this.length-Se;if((lt===void 0||lt>Vt)&&(lt=Vt),xe.length>0&&(lt<0||Se<0)||Se>this.length)throw new RangeError("Attempt to write outside buffer bounds");Gt||(Gt="utf8");for(var ar=!1;;)switch(Gt){case"hex":return Ee(this,xe,Se,lt);case"utf8":case"utf-8":return Ae(this,xe,Se,lt);case"ascii":case"latin1":case"binary":return ze(this,xe,Se,lt);case"base64":return Ce(this,xe,Se,lt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,xe,Se,lt);default:if(ar)throw new TypeError("Unknown encoding: "+Gt);Gt=(""+Gt).toLowerCase(),ar=!0}},T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Re(Le,xe,Se){return xe===0&&Se===Le.length?L.fromByteArray(Le):L.fromByteArray(Le.slice(xe,Se))}function ce(Le,xe,Se){Se=Math.min(Le.length,Se);for(var lt=[],Gt=xe;Gt239?4:Vt>223?3:Vt>191?2:1;if(Gt+Qr<=Se){var ai=void 0,jr=void 0,ri=void 0,bi=void 0;switch(Qr){case 1:Vt<128&&(ar=Vt);break;case 2:ai=Le[Gt+1],(ai&192)===128&&(bi=(Vt&31)<<6|ai&63,bi>127&&(ar=bi));break;case 3:ai=Le[Gt+1],jr=Le[Gt+2],(ai&192)===128&&(jr&192)===128&&(bi=(Vt&15)<<12|(ai&63)<<6|jr&63,bi>2047&&(bi<55296||bi>57343)&&(ar=bi));break;case 4:ai=Le[Gt+1],jr=Le[Gt+2],ri=Le[Gt+3],(ai&192)===128&&(jr&192)===128&&(ri&192)===128&&(bi=(Vt&15)<<18|(ai&63)<<12|(jr&63)<<6|ri&63,bi>65535&&bi<1114112&&(ar=bi))}}ar===null?(ar=65533,Qr=1):ar>65535&&(ar-=65536,lt.push(ar>>>10&1023|55296),ar=56320|ar&1023),lt.push(ar),Gt+=Qr}return nt(lt)}var Ge=4096;function nt(Le){var xe=Le.length;if(xe<=Ge)return String.fromCharCode.apply(String,Le);for(var Se="",lt=0;ltlt)&&(Se=lt);for(var Gt="",Vt=xe;Vtlt&&(xe=lt),Se<0?(Se+=lt,Se<0&&(Se=0)):Se>lt&&(Se=lt),SeSe)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(xe,Se,lt){xe=xe>>>0,Se=Se>>>0,lt||Rt(xe,Se,this.length);for(var Gt=this[xe],Vt=1,ar=0;++ar>>0,Se=Se>>>0,lt||Rt(xe,Se,this.length);for(var Gt=this[xe+--Se],Vt=1;Se>0&&(Vt*=256);)Gt+=this[xe+--Se]*Vt;return Gt},T.prototype.readUint8=T.prototype.readUInt8=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,1,this.length),this[xe]},T.prototype.readUint16LE=T.prototype.readUInt16LE=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,2,this.length),this[xe]|this[xe+1]<<8},T.prototype.readUint16BE=T.prototype.readUInt16BE=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,2,this.length),this[xe]<<8|this[xe+1]},T.prototype.readUint32LE=T.prototype.readUInt32LE=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,4,this.length),(this[xe]|this[xe+1]<<8|this[xe+2]<<16)+this[xe+3]*16777216},T.prototype.readUint32BE=T.prototype.readUInt32BE=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,4,this.length),this[xe]*16777216+(this[xe+1]<<16|this[xe+2]<<8|this[xe+3])},T.prototype.readBigUInt64LE=Xe(function(xe){xe=xe>>>0,dt(xe,"offset");var Se=this[xe],lt=this[xe+7];(Se===void 0||lt===void 0)&&Ht(xe,this.length-8);var Gt=Se+this[++xe]*Math.pow(2,8)+this[++xe]*Math.pow(2,16)+this[++xe]*Math.pow(2,24),Vt=this[++xe]+this[++xe]*Math.pow(2,8)+this[++xe]*Math.pow(2,16)+lt*Math.pow(2,24);return BigInt(Gt)+(BigInt(Vt)<>>0,dt(xe,"offset");var Se=this[xe],lt=this[xe+7];(Se===void 0||lt===void 0)&&Ht(xe,this.length-8);var Gt=Se*Math.pow(2,24)+this[++xe]*Math.pow(2,16)+this[++xe]*Math.pow(2,8)+this[++xe],Vt=this[++xe]*Math.pow(2,24)+this[++xe]*Math.pow(2,16)+this[++xe]*Math.pow(2,8)+lt;return(BigInt(Gt)<>>0,Se=Se>>>0,lt||Rt(xe,Se,this.length);for(var Gt=this[xe],Vt=1,ar=0;++ar=Vt&&(Gt-=Math.pow(2,8*Se)),Gt},T.prototype.readIntBE=function(xe,Se,lt){xe=xe>>>0,Se=Se>>>0,lt||Rt(xe,Se,this.length);for(var Gt=Se,Vt=1,ar=this[xe+--Gt];Gt>0&&(Vt*=256);)ar+=this[xe+--Gt]*Vt;return Vt*=128,ar>=Vt&&(ar-=Math.pow(2,8*Se)),ar},T.prototype.readInt8=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,1,this.length),this[xe]&128?(255-this[xe]+1)*-1:this[xe]},T.prototype.readInt16LE=function(xe,Se){xe=xe>>>0,Se||Rt(xe,2,this.length);var lt=this[xe]|this[xe+1]<<8;return lt&32768?lt|4294901760:lt},T.prototype.readInt16BE=function(xe,Se){xe=xe>>>0,Se||Rt(xe,2,this.length);var lt=this[xe+1]|this[xe]<<8;return lt&32768?lt|4294901760:lt},T.prototype.readInt32LE=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,4,this.length),this[xe]|this[xe+1]<<8|this[xe+2]<<16|this[xe+3]<<24},T.prototype.readInt32BE=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,4,this.length),this[xe]<<24|this[xe+1]<<16|this[xe+2]<<8|this[xe+3]},T.prototype.readBigInt64LE=Xe(function(xe){xe=xe>>>0,dt(xe,"offset");var Se=this[xe],lt=this[xe+7];(Se===void 0||lt===void 0)&&Ht(xe,this.length-8);var Gt=this[xe+4]+this[xe+5]*Math.pow(2,8)+this[xe+6]*Math.pow(2,16)+(lt<<24);return(BigInt(Gt)<>>0,dt(xe,"offset");var Se=this[xe],lt=this[xe+7];(Se===void 0||lt===void 0)&&Ht(xe,this.length-8);var Gt=(Se<<24)+this[++xe]*Math.pow(2,16)+this[++xe]*Math.pow(2,8)+this[++xe];return(BigInt(Gt)<>>0,Se||Rt(xe,4,this.length),_.read(this,xe,!0,23,4)},T.prototype.readFloatBE=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,4,this.length),_.read(this,xe,!1,23,4)},T.prototype.readDoubleLE=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,8,this.length),_.read(this,xe,!0,52,8)},T.prototype.readDoubleBE=function(xe,Se){return xe=xe>>>0,Se||Rt(xe,8,this.length),_.read(this,xe,!1,52,8)};function kt(Le,xe,Se,lt,Gt,Vt){if(!T.isBuffer(Le))throw new TypeError('"buffer" argument must be a Buffer instance');if(xe>Gt||xeLe.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(xe,Se,lt,Gt){if(xe=+xe,Se=Se>>>0,lt=lt>>>0,!Gt){var Vt=Math.pow(2,8*lt)-1;kt(this,xe,Se,lt,Vt,0)}var ar=1,Qr=0;for(this[Se]=xe&255;++Qr>>0,lt=lt>>>0,!Gt){var Vt=Math.pow(2,8*lt)-1;kt(this,xe,Se,lt,Vt,0)}var ar=lt-1,Qr=1;for(this[Se+ar]=xe&255;--ar>=0&&(Qr*=256);)this[Se+ar]=xe/Qr&255;return Se+lt},T.prototype.writeUint8=T.prototype.writeUInt8=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,1,255,0),this[Se]=xe&255,Se+1},T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,2,65535,0),this[Se]=xe&255,this[Se+1]=xe>>>8,Se+2},T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,2,65535,0),this[Se]=xe>>>8,this[Se+1]=xe&255,Se+2},T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,4,4294967295,0),this[Se+3]=xe>>>24,this[Se+2]=xe>>>16,this[Se+1]=xe>>>8,this[Se]=xe&255,Se+4},T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,4,4294967295,0),this[Se]=xe>>>24,this[Se+1]=xe>>>16,this[Se+2]=xe>>>8,this[Se+3]=xe&255,Se+4};function Ct(Le,xe,Se,lt,Gt){Et(xe,lt,Gt,Le,Se,7);var Vt=Number(xe&BigInt(4294967295));Le[Se++]=Vt,Vt=Vt>>8,Le[Se++]=Vt,Vt=Vt>>8,Le[Se++]=Vt,Vt=Vt>>8,Le[Se++]=Vt;var ar=Number(xe>>BigInt(32)&BigInt(4294967295));return Le[Se++]=ar,ar=ar>>8,Le[Se++]=ar,ar=ar>>8,Le[Se++]=ar,ar=ar>>8,Le[Se++]=ar,Se}function Yt(Le,xe,Se,lt,Gt){Et(xe,lt,Gt,Le,Se,7);var Vt=Number(xe&BigInt(4294967295));Le[Se+7]=Vt,Vt=Vt>>8,Le[Se+6]=Vt,Vt=Vt>>8,Le[Se+5]=Vt,Vt=Vt>>8,Le[Se+4]=Vt;var ar=Number(xe>>BigInt(32)&BigInt(4294967295));return Le[Se+3]=ar,ar=ar>>8,Le[Se+2]=ar,ar=ar>>8,Le[Se+1]=ar,ar=ar>>8,Le[Se]=ar,Se+8}T.prototype.writeBigUInt64LE=Xe(function(xe){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Ct(this,xe,Se,BigInt(0),BigInt("0xffffffffffffffff"))}),T.prototype.writeBigUInt64BE=Xe(function(xe){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Yt(this,xe,Se,BigInt(0),BigInt("0xffffffffffffffff"))}),T.prototype.writeIntLE=function(xe,Se,lt,Gt){if(xe=+xe,Se=Se>>>0,!Gt){var Vt=Math.pow(2,8*lt-1);kt(this,xe,Se,lt,Vt-1,-Vt)}var ar=0,Qr=1,ai=0;for(this[Se]=xe&255;++ar>0)-ai&255;return Se+lt},T.prototype.writeIntBE=function(xe,Se,lt,Gt){if(xe=+xe,Se=Se>>>0,!Gt){var Vt=Math.pow(2,8*lt-1);kt(this,xe,Se,lt,Vt-1,-Vt)}var ar=lt-1,Qr=1,ai=0;for(this[Se+ar]=xe&255;--ar>=0&&(Qr*=256);)xe<0&&ai===0&&this[Se+ar+1]!==0&&(ai=1),this[Se+ar]=(xe/Qr>>0)-ai&255;return Se+lt},T.prototype.writeInt8=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,1,127,-128),xe<0&&(xe=255+xe+1),this[Se]=xe&255,Se+1},T.prototype.writeInt16LE=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,2,32767,-32768),this[Se]=xe&255,this[Se+1]=xe>>>8,Se+2},T.prototype.writeInt16BE=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,2,32767,-32768),this[Se]=xe>>>8,this[Se+1]=xe&255,Se+2},T.prototype.writeInt32LE=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,4,2147483647,-2147483648),this[Se]=xe&255,this[Se+1]=xe>>>8,this[Se+2]=xe>>>16,this[Se+3]=xe>>>24,Se+4},T.prototype.writeInt32BE=function(xe,Se,lt){return xe=+xe,Se=Se>>>0,lt||kt(this,xe,Se,4,2147483647,-2147483648),xe<0&&(xe=4294967295+xe+1),this[Se]=xe>>>24,this[Se+1]=xe>>>16,this[Se+2]=xe>>>8,this[Se+3]=xe&255,Se+4},T.prototype.writeBigInt64LE=Xe(function(xe){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Ct(this,xe,Se,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),T.prototype.writeBigInt64BE=Xe(function(xe){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Yt(this,xe,Se,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function xr(Le,xe,Se,lt,Gt,Vt){if(Se+lt>Le.length)throw new RangeError("Index out of range");if(Se<0)throw new RangeError("Index out of range")}function er(Le,xe,Se,lt,Gt){return xe=+xe,Se=Se>>>0,Gt||xr(Le,xe,Se,4,34028234663852886e22,-34028234663852886e22),_.write(Le,xe,Se,lt,23,4),Se+4}T.prototype.writeFloatLE=function(xe,Se,lt){return er(this,xe,Se,!0,lt)},T.prototype.writeFloatBE=function(xe,Se,lt){return er(this,xe,Se,!1,lt)};function Ke(Le,xe,Se,lt,Gt){return xe=+xe,Se=Se>>>0,Gt||xr(Le,xe,Se,8,17976931348623157e292,-17976931348623157e292),_.write(Le,xe,Se,lt,52,8),Se+8}T.prototype.writeDoubleLE=function(xe,Se,lt){return Ke(this,xe,Se,!0,lt)},T.prototype.writeDoubleBE=function(xe,Se,lt){return Ke(this,xe,Se,!1,lt)},T.prototype.copy=function(xe,Se,lt,Gt){if(!T.isBuffer(xe))throw new TypeError("argument should be a Buffer");if(lt||(lt=0),!Gt&&Gt!==0&&(Gt=this.length),Se>=xe.length&&(Se=xe.length),Se||(Se=0),Gt>0&&Gt=this.length)throw new RangeError("Index out of range");if(Gt<0)throw new RangeError("sourceEnd out of bounds");Gt>this.length&&(Gt=this.length),xe.length-Se>>0,lt=lt===void 0?this.length:lt>>>0,xe||(xe=0);var ar;if(typeof xe=="number")for(ar=Se;arMath.pow(2,32)?Gt=Lt(String(Se)):typeof Se=="bigint"&&(Gt=String(Se),(Se>Math.pow(BigInt(2),BigInt(32))||Se<-Math.pow(BigInt(2),BigInt(32)))&&(Gt=Lt(Gt)),Gt+="n"),lt+=" It must be ".concat(xe,". Received ").concat(Gt),lt},RangeError);function Lt(Le){for(var xe="",Se=Le.length,lt=Le[0]==="-"?1:0;Se>=lt+4;Se-=3)xe="_".concat(Le.slice(Se-3,Se)).concat(xe);return"".concat(Le.slice(0,Se)).concat(xe)}function St(Le,xe,Se){dt(xe,"offset"),(Le[xe]===void 0||Le[xe+Se]===void 0)&&Ht(xe,Le.length-(Se+1))}function Et(Le,xe,Se,lt,Gt,Vt){if(Le>Se||Le3?xe===0||xe===BigInt(0)?Qr=">= 0".concat(ar," and < 2").concat(ar," ** ").concat((Vt+1)*8).concat(ar):Qr=">= -(2".concat(ar," ** ").concat((Vt+1)*8-1).concat(ar,") and < 2 ** ")+"".concat((Vt+1)*8-1).concat(ar):Qr=">= ".concat(xe).concat(ar," and <= ").concat(Se).concat(ar),new xt.ERR_OUT_OF_RANGE("value",Qr,Le)}St(lt,Gt,Vt)}function dt(Le,xe){if(typeof Le!="number")throw new xt.ERR_INVALID_ARG_TYPE(xe,"number",Le)}function Ht(Le,xe,Se){throw Math.floor(Le)!==Le?(dt(Le,Se),new xt.ERR_OUT_OF_RANGE(Se||"offset","an integer",Le)):xe<0?new xt.ERR_BUFFER_OUT_OF_BOUNDS:new xt.ERR_OUT_OF_RANGE(Se||"offset",">= ".concat(Se?1:0," and <= ").concat(xe),Le)}var $t=/[^+/0-9A-Za-z-_]/g;function fr(Le){if(Le=Le.split("=")[0],Le=Le.trim().replace($t,""),Le.length<2)return"";for(;Le.length%4!==0;)Le=Le+"=";return Le}function _r(Le,xe){xe=xe||1/0;for(var Se,lt=Le.length,Gt=null,Vt=[],ar=0;ar55295&&Se<57344){if(!Gt){if(Se>56319){(xe-=3)>-1&&Vt.push(239,191,189);continue}else if(ar+1===lt){(xe-=3)>-1&&Vt.push(239,191,189);continue}Gt=Se;continue}if(Se<56320){(xe-=3)>-1&&Vt.push(239,191,189),Gt=Se;continue}Se=(Gt-55296<<10|Se-56320)+65536}else Gt&&(xe-=3)>-1&&Vt.push(239,191,189);if(Gt=null,Se<128){if((xe-=1)<0)break;Vt.push(Se)}else if(Se<2048){if((xe-=2)<0)break;Vt.push(Se>>6|192,Se&63|128)}else if(Se<65536){if((xe-=3)<0)break;Vt.push(Se>>12|224,Se>>6&63|128,Se&63|128)}else if(Se<1114112){if((xe-=4)<0)break;Vt.push(Se>>18|240,Se>>12&63|128,Se>>6&63|128,Se&63|128)}else throw new Error("Invalid code point")}return Vt}function Br(Le){for(var xe=[],Se=0;Se>8,Gt=Se%256,Vt.push(Gt),Vt.push(lt);return Vt}function Nr(Le){return L.toByteArray(fr(Le))}function ut(Le,xe,Se,lt){var Gt;for(Gt=0;Gt=xe.length||Gt>=Le.length);++Gt)xe[Gt+Se]=Le[Gt];return Gt}function Ne(Le,xe){return Le instanceof xe||Le!=null&&Le.constructor!=null&&Le.constructor.name!=null&&Le.constructor.name===xe.name}function Ye(Le){return Le!==Le}var Ve=function(){for(var Le="0123456789abcdef",xe=new Array(256),Se=0;Se<16;++Se)for(var lt=Se*16,Gt=0;Gt<16;++Gt)xe[lt+Gt]=Le[Se]+Le[Gt];return xe}();function Xe(Le){return typeof BigInt=="undefined"?ht:Le}function ht(){throw new Error("BigInt not supported")}},9216:function(i){"use strict";i.exports=l,i.exports.isMobile=l,i.exports.default=l;var a=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,o=/CrOS/,s=/android|ipad|playbook|silk/i;function l(u){u||(u={});var c=u.ua;if(!c&&typeof navigator!="undefined"&&(c=navigator.userAgent),c&&c.headers&&typeof c.headers["user-agent"]=="string"&&(c=c.headers["user-agent"]),typeof c!="string")return!1;var f=a.test(c)&&!o.test(c)||!!u.tablet&&s.test(c);return!f&&u.tablet&&u.featureDetect&&navigator&&navigator.maxTouchPoints>1&&c.indexOf("Macintosh")!==-1&&c.indexOf("Safari")!==-1&&(f=!0),f}},6296:function(i,a,o){"use strict";i.exports=h;var s=o(7261),l=o(9977),u=o(1811);function c(d,v){this._controllerNames=Object.keys(d),this._controllerList=this._controllerNames.map(function(x){return d[x]}),this._mode=v,this._active=d[v],this._active||(this._mode="turntable",this._active=d.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var f=c.prototype;f.flush=function(d){for(var v=this._controllerList,x=0;x0)throw new Error("Invalid string. Length must be a multiple of 4");var L=k.indexOf("=");L===-1&&(L=A);var _=L===A?0:4-L%4;return[L,_]}function d(k){var A=h(k),L=A[0],_=A[1];return(L+_)*3/4-_}function v(k,A,L){return(A+L)*3/4-L}function x(k){var A,L=h(k),_=L[0],C=L[1],M=new l(v(k,_,C)),p=0,P=C>0?_-4:_,T;for(T=0;T>16&255,M[p++]=A>>8&255,M[p++]=A&255;return C===2&&(A=s[k.charCodeAt(T)]<<2|s[k.charCodeAt(T+1)]>>4,M[p++]=A&255),C===1&&(A=s[k.charCodeAt(T)]<<10|s[k.charCodeAt(T+1)]<<4|s[k.charCodeAt(T+2)]>>2,M[p++]=A>>8&255,M[p++]=A&255),M}function b(k){return o[k>>18&63]+o[k>>12&63]+o[k>>6&63]+o[k&63]}function g(k,A,L){for(var _,C=[],M=A;MP?P:p+M));return _===1?(A=k[L-1],C.push(o[A>>2]+o[A<<4&63]+"==")):_===2&&(A=(k[L-2]<<8)+k[L-1],C.push(o[A>>10]+o[A>>4&63]+o[A<<2&63]+"=")),C.join("")}},3865:function(i,a,o){"use strict";var s=o(869);i.exports=l;function l(u,c){return s(u[0].mul(c[1]).add(c[0].mul(u[1])),u[1].mul(c[1]))}},1318:function(i){"use strict";i.exports=a;function a(o,s){return o[0].mul(s[1]).cmp(s[0].mul(o[1]))}},8697:function(i,a,o){"use strict";var s=o(869);i.exports=l;function l(u,c){return s(u[0].mul(c[1]),u[1].mul(c[0]))}},7842:function(i,a,o){"use strict";var s=o(6330),l=o(1533),u=o(2651),c=o(6768),f=o(869),h=o(8697);i.exports=d;function d(v,x){if(s(v))return x?h(v,d(x)):[v[0].clone(),v[1].clone()];var b=0,g,E;if(l(v))g=v.clone();else if(typeof v=="string")g=c(v);else{if(v===0)return[u(0),u(1)];if(v===Math.floor(v))g=u(v);else{for(;v!==Math.floor(v);)v=v*Math.pow(2,256),b-=256;g=u(v)}}if(s(x))g.mul(x[1]),E=x[0].clone();else if(l(x))E=x.clone();else if(typeof x=="string")E=c(x);else if(!x)E=u(1);else if(x===Math.floor(x))E=u(x);else{for(;x!==Math.floor(x);)x=x*Math.pow(2,256),b+=256;E=u(x)}return b>0?g=g.ushln(b):b<0&&(E=E.ushln(-b)),f(g,E)}},6330:function(i,a,o){"use strict";var s=o(1533);i.exports=l;function l(u){return Array.isArray(u)&&u.length===2&&s(u[0])&&s(u[1])}},5716:function(i,a,o){"use strict";var s=o(6859);i.exports=l;function l(u){return u.cmp(new s(0))}},1369:function(i,a,o){"use strict";var s=o(5716);i.exports=l;function l(u){var c=u.length,f=u.words,h=0;if(c===1)h=f[0];else if(c===2)h=f[0]+f[1]*67108864;else for(var d=0;d20?52:h+32}},1533:function(i,a,o){"use strict";var s=o(6859);i.exports=l;function l(u){return u&&typeof u=="object"&&!!u.words}},2651:function(i,a,o){"use strict";var s=o(6859),l=o(2361);i.exports=u;function u(c){var f=l.exponent(c);return f<52?new s(c):new s(c*Math.pow(2,52-f)).ushln(f-52)}},869:function(i,a,o){"use strict";var s=o(2651),l=o(5716);i.exports=u;function u(c,f){var h=l(c),d=l(f);if(h===0)return[s(0),s(1)];if(d===0)return[s(0),s(0)];d<0&&(c=c.neg(),f=f.neg());var v=c.gcd(f);return v.cmpn(1)?[c.div(v),f.div(v)]:[c,f]}},6768:function(i,a,o){"use strict";var s=o(6859);i.exports=l;function l(u){return new s(u)}},6504:function(i,a,o){"use strict";var s=o(869);i.exports=l;function l(u,c){return s(u[0].mul(c[0]),u[1].mul(c[1]))}},7721:function(i,a,o){"use strict";var s=o(5716);i.exports=l;function l(u){return s(u[0])*s(u[1])}},5572:function(i,a,o){"use strict";var s=o(869);i.exports=l;function l(u,c){return s(u[0].mul(c[1]).sub(u[1].mul(c[0])),u[1].mul(c[1]))}},946:function(i,a,o){"use strict";var s=o(1369),l=o(4025);i.exports=u;function u(c){var f=c[0],h=c[1];if(f.cmpn(0)===0)return 0;var d=f.abs().divmod(h.abs()),v=d.div,x=s(v),b=d.mod,g=f.negative!==h.negative?-1:1;if(b.cmpn(0)===0)return g*x;if(x){var E=l(x)+4,k=s(b.ushln(E).divRound(h));return g*(x+k*Math.pow(2,-E))}else{var A=h.bitLength()-b.bitLength()+53,k=s(b.ushln(A).divRound(h));return A<1023?g*k*Math.pow(2,-A):(k*=Math.pow(2,-1023),g*k*Math.pow(2,1023-A))}}},2478:function(i){"use strict";function a(f,h,d,v,x){for(var b=x+1;v<=x;){var g=v+x>>>1,E=f[g],k=d!==void 0?d(E,h):E-h;k>=0?(b=g,x=g-1):v=g+1}return b}function o(f,h,d,v,x){for(var b=x+1;v<=x;){var g=v+x>>>1,E=f[g],k=d!==void 0?d(E,h):E-h;k>0?(b=g,x=g-1):v=g+1}return b}function s(f,h,d,v,x){for(var b=v-1;v<=x;){var g=v+x>>>1,E=f[g],k=d!==void 0?d(E,h):E-h;k<0?(b=g,v=g+1):x=g-1}return b}function l(f,h,d,v,x){for(var b=v-1;v<=x;){var g=v+x>>>1,E=f[g],k=d!==void 0?d(E,h):E-h;k<=0?(b=g,v=g+1):x=g-1}return b}function u(f,h,d,v,x){for(;v<=x;){var b=v+x>>>1,g=f[b],E=d!==void 0?d(g,h):g-h;if(E===0)return b;E<=0?v=b+1:x=b-1}return-1}function c(f,h,d,v,x,b){return typeof d=="function"?b(f,h,d,v===void 0?0:v|0,x===void 0?f.length-1:x|0):b(f,h,void 0,d===void 0?0:d|0,v===void 0?f.length-1:v|0)}i.exports={ge:function(f,h,d,v,x){return c(f,h,d,v,x,a)},gt:function(f,h,d,v,x){return c(f,h,d,v,x,o)},lt:function(f,h,d,v,x){return c(f,h,d,v,x,s)},le:function(f,h,d,v,x){return c(f,h,d,v,x,l)},eq:function(f,h,d,v,x){return c(f,h,d,v,x,u)}}},8828:function(i,a){"use strict";"use restrict";var o=32;a.INT_BITS=o,a.INT_MAX=2147483647,a.INT_MIN=-1<0)-(u<0)},a.abs=function(u){var c=u>>o-1;return(u^c)-c},a.min=function(u,c){return c^(u^c)&-(u65535)<<4,u>>>=c,f=(u>255)<<3,u>>>=f,c|=f,f=(u>15)<<2,u>>>=f,c|=f,f=(u>3)<<1,u>>>=f,c|=f,c|u>>1},a.log10=function(u){return u>=1e9?9:u>=1e8?8:u>=1e7?7:u>=1e6?6:u>=1e5?5:u>=1e4?4:u>=1e3?3:u>=100?2:u>=10?1:0},a.popCount=function(u){return u=u-(u>>>1&1431655765),u=(u&858993459)+(u>>>2&858993459),(u+(u>>>4)&252645135)*16843009>>>24};function s(u){var c=32;return u&=-u,u&&c--,u&65535&&(c-=16),u&16711935&&(c-=8),u&252645135&&(c-=4),u&858993459&&(c-=2),u&1431655765&&(c-=1),c}a.countTrailingZeros=s,a.nextPow2=function(u){return u+=u===0,--u,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u+1},a.prevPow2=function(u){return u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u-(u>>>1)},a.parity=function(u){return u^=u>>>16,u^=u>>>8,u^=u>>>4,u&=15,27030>>>u&1};var l=new Array(256);(function(u){for(var c=0;c<256;++c){var f=c,h=c,d=7;for(f>>>=1;f;f>>>=1)h<<=1,h|=f&1,--d;u[c]=h<>>8&255]<<16|l[u>>>16&255]<<8|l[u>>>24&255]},a.interleave2=function(u,c){return u&=65535,u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,c&=65535,c=(c|c<<8)&16711935,c=(c|c<<4)&252645135,c=(c|c<<2)&858993459,c=(c|c<<1)&1431655765,u|c<<1},a.deinterleave2=function(u,c){return u=u>>>c&1431655765,u=(u|u>>>1)&858993459,u=(u|u>>>2)&252645135,u=(u|u>>>4)&16711935,u=(u|u>>>16)&65535,u<<16>>16},a.interleave3=function(u,c,f){return u&=1023,u=(u|u<<16)&4278190335,u=(u|u<<8)&251719695,u=(u|u<<4)&3272356035,u=(u|u<<2)&1227133513,c&=1023,c=(c|c<<16)&4278190335,c=(c|c<<8)&251719695,c=(c|c<<4)&3272356035,c=(c|c<<2)&1227133513,u|=c<<1,f&=1023,f=(f|f<<16)&4278190335,f=(f|f<<8)&251719695,f=(f|f<<4)&3272356035,f=(f|f<<2)&1227133513,u|f<<2},a.deinterleave3=function(u,c){return u=u>>>c&1227133513,u=(u|u>>>2)&3272356035,u=(u|u>>>4)&251719695,u=(u|u>>>8)&4278190335,u=(u|u>>>16)&1023,u<<22>>22},a.nextCombination=function(u){var c=u|u-1;return c+1|(~c&-~c)-1>>>s(u)+1}},6859:function(i,a,o){i=o.nmd(i),function(s,l){"use strict";function u(G,N){if(!G)throw new Error(N||"Assertion failed")}function c(G,N){G.super_=N;var W=function(){};W.prototype=N.prototype,G.prototype=new W,G.prototype.constructor=G}function f(G,N,W){if(f.isBN(G))return G;this.negative=0,this.words=null,this.length=0,this.red=null,G!==null&&((N==="le"||N==="be")&&(W=N,N=10),this._init(G||0,N||10,W||"be"))}typeof s=="object"?s.exports=f:l.BN=f,f.BN=f,f.wordSize=26;var h;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?h=window.Buffer:h=o(7790).Buffer}catch(G){}f.isBN=function(N){return N instanceof f?!0:N!==null&&typeof N=="object"&&N.constructor.wordSize===f.wordSize&&Array.isArray(N.words)},f.max=function(N,W){return N.cmp(W)>0?N:W},f.min=function(N,W){return N.cmp(W)<0?N:W},f.prototype._init=function(N,W,re){if(typeof N=="number")return this._initNumber(N,W,re);if(typeof N=="object")return this._initArray(N,W,re);W==="hex"&&(W=16),u(W===(W|0)&&W>=2&&W<=36),N=N.toString().replace(/\s+/g,"");var ae=0;N[0]==="-"&&(ae++,this.negative=1),ae=0;ae-=3)Me=N[ae]|N[ae-1]<<8|N[ae-2]<<16,this.words[_e]|=Me<>>26-ke&67108863,ke+=24,ke>=26&&(ke-=26,_e++);else if(re==="le")for(ae=0,_e=0;ae>>26-ke&67108863,ke+=24,ke>=26&&(ke-=26,_e++);return this.strip()};function d(G,N){var W=G.charCodeAt(N);return W>=65&&W<=70?W-55:W>=97&&W<=102?W-87:W-48&15}function v(G,N,W){var re=d(G,W);return W-1>=N&&(re|=d(G,W-1)<<4),re}f.prototype._parseHex=function(N,W,re){this.length=Math.ceil((N.length-W)/6),this.words=new Array(this.length);for(var ae=0;ae=W;ae-=2)ke=v(N,W,ae)<<_e,this.words[Me]|=ke&67108863,_e>=18?(_e-=18,Me+=1,this.words[Me]|=ke>>>26):_e+=8;else{var ge=N.length-W;for(ae=ge%2===0?W+1:W;ae=18?(_e-=18,Me+=1,this.words[Me]|=ke>>>26):_e+=8}this.strip()};function x(G,N,W,re){for(var ae=0,_e=Math.min(G.length,W),Me=N;Me<_e;Me++){var ke=G.charCodeAt(Me)-48;ae*=re,ke>=49?ae+=ke-49+10:ke>=17?ae+=ke-17+10:ae+=ke}return ae}f.prototype._parseBase=function(N,W,re){this.words=[0],this.length=1;for(var ae=0,_e=1;_e<=67108863;_e*=W)ae++;ae--,_e=_e/W|0;for(var Me=N.length-re,ke=Me%ae,ge=Math.min(Me,Me-ke)+re,ie=0,Te=re;Te1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?""};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(N,W){N=N||10,W=W|0||1;var re;if(N===16||N==="hex"){re="";for(var ae=0,_e=0,Me=0;Me>>24-ae&16777215,_e!==0||Me!==this.length-1?re=b[6-ge.length]+ge+re:re=ge+re,ae+=2,ae>=26&&(ae-=26,Me--)}for(_e!==0&&(re=_e.toString(16)+re);re.length%W!==0;)re="0"+re;return this.negative!==0&&(re="-"+re),re}if(N===(N|0)&&N>=2&&N<=36){var ie=g[N],Te=E[N];re="";var Ee=this.clone();for(Ee.negative=0;!Ee.isZero();){var Ae=Ee.modn(Te).toString(N);Ee=Ee.idivn(Te),Ee.isZero()?re=Ae+re:re=b[ie-Ae.length]+Ae+re}for(this.isZero()&&(re="0"+re);re.length%W!==0;)re="0"+re;return this.negative!==0&&(re="-"+re),re}u(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var N=this.words[0];return this.length===2?N+=this.words[1]*67108864:this.length===3&&this.words[2]===1?N+=4503599627370496+this.words[1]*67108864:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-N:N},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(N,W){return u(typeof h!="undefined"),this.toArrayLike(h,N,W)},f.prototype.toArray=function(N,W){return this.toArrayLike(Array,N,W)},f.prototype.toArrayLike=function(N,W,re){var ae=this.byteLength(),_e=re||Math.max(1,ae);u(ae<=_e,"byte array longer than desired length"),u(_e>0,"Requested array length <= 0"),this.strip();var Me=W==="le",ke=new N(_e),ge,ie,Te=this.clone();if(Me){for(ie=0;!Te.isZero();ie++)ge=Te.andln(255),Te.iushrn(8),ke[ie]=ge;for(;ie<_e;ie++)ke[ie]=0}else{for(ie=0;ie<_e-ae;ie++)ke[ie]=0;for(ie=0;!Te.isZero();ie++)ge=Te.andln(255),Te.iushrn(8),ke[_e-ie-1]=ge}return ke},Math.clz32?f.prototype._countBits=function(N){return 32-Math.clz32(N)}:f.prototype._countBits=function(N){var W=N,re=0;return W>=4096&&(re+=13,W>>>=13),W>=64&&(re+=7,W>>>=7),W>=8&&(re+=4,W>>>=4),W>=2&&(re+=2,W>>>=2),re+W},f.prototype._zeroBits=function(N){if(N===0)return 26;var W=N,re=0;return W&8191||(re+=13,W>>>=13),W&127||(re+=7,W>>>=7),W&15||(re+=4,W>>>=4),W&3||(re+=2,W>>>=2),W&1||re++,re},f.prototype.bitLength=function(){var N=this.words[this.length-1],W=this._countBits(N);return(this.length-1)*26+W};function k(G){for(var N=new Array(G.bitLength()),W=0;W>>ae}return N}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var N=0,W=0;WN.length?this.clone().ior(N):N.clone().ior(this)},f.prototype.uor=function(N){return this.length>N.length?this.clone().iuor(N):N.clone().iuor(this)},f.prototype.iuand=function(N){var W;this.length>N.length?W=N:W=this;for(var re=0;reN.length?this.clone().iand(N):N.clone().iand(this)},f.prototype.uand=function(N){return this.length>N.length?this.clone().iuand(N):N.clone().iuand(this)},f.prototype.iuxor=function(N){var W,re;this.length>N.length?(W=this,re=N):(W=N,re=this);for(var ae=0;aeN.length?this.clone().ixor(N):N.clone().ixor(this)},f.prototype.uxor=function(N){return this.length>N.length?this.clone().iuxor(N):N.clone().iuxor(this)},f.prototype.inotn=function(N){u(typeof N=="number"&&N>=0);var W=Math.ceil(N/26)|0,re=N%26;this._expand(W),re>0&&W--;for(var ae=0;ae0&&(this.words[ae]=~this.words[ae]&67108863>>26-re),this.strip()},f.prototype.notn=function(N){return this.clone().inotn(N)},f.prototype.setn=function(N,W){u(typeof N=="number"&&N>=0);var re=N/26|0,ae=N%26;return this._expand(re+1),W?this.words[re]=this.words[re]|1<N.length?(re=this,ae=N):(re=N,ae=this);for(var _e=0,Me=0;Me>>26;for(;_e!==0&&Me>>26;if(this.length=re.length,_e!==0)this.words[this.length]=_e,this.length++;else if(re!==this)for(;MeN.length?this.clone().iadd(N):N.clone().iadd(this)},f.prototype.isub=function(N){if(N.negative!==0){N.negative=0;var W=this.iadd(N);return N.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(N),this.negative=1,this._normSign();var re=this.cmp(N);if(re===0)return this.negative=0,this.length=1,this.words[0]=0,this;var ae,_e;re>0?(ae=this,_e=N):(ae=N,_e=this);for(var Me=0,ke=0;ke<_e.length;ke++)W=(ae.words[ke]|0)-(_e.words[ke]|0)+Me,Me=W>>26,this.words[ke]=W&67108863;for(;Me!==0&&ke>26,this.words[ke]=W&67108863;if(Me===0&&ke>>26,Ee=ge&67108863,Ae=Math.min(ie,N.length-1),ze=Math.max(0,ie-G.length+1);ze<=Ae;ze++){var Ce=ie-ze|0;ae=G.words[Ce]|0,_e=N.words[ze]|0,Me=ae*_e+Ee,Te+=Me/67108864|0,Ee=Me&67108863}W.words[ie]=Ee|0,ge=Te|0}return ge!==0?W.words[ie]=ge|0:W.length--,W.strip()}var L=function(N,W,re){var ae=N.words,_e=W.words,Me=re.words,ke=0,ge,ie,Te,Ee=ae[0]|0,Ae=Ee&8191,ze=Ee>>>13,Ce=ae[1]|0,me=Ce&8191,Re=Ce>>>13,ce=ae[2]|0,Ge=ce&8191,nt=ce>>>13,ct=ae[3]|0,qt=ct&8191,rt=ct>>>13,ot=ae[4]|0,Rt=ot&8191,kt=ot>>>13,Ct=ae[5]|0,Yt=Ct&8191,xr=Ct>>>13,er=ae[6]|0,Ke=er&8191,xt=er>>>13,bt=ae[7]|0,Lt=bt&8191,St=bt>>>13,Et=ae[8]|0,dt=Et&8191,Ht=Et>>>13,$t=ae[9]|0,fr=$t&8191,_r=$t>>>13,Br=_e[0]|0,Or=Br&8191,Nr=Br>>>13,ut=_e[1]|0,Ne=ut&8191,Ye=ut>>>13,Ve=_e[2]|0,Xe=Ve&8191,ht=Ve>>>13,Le=_e[3]|0,xe=Le&8191,Se=Le>>>13,lt=_e[4]|0,Gt=lt&8191,Vt=lt>>>13,ar=_e[5]|0,Qr=ar&8191,ai=ar>>>13,jr=_e[6]|0,ri=jr&8191,bi=jr>>>13,nn=_e[7]|0,Wi=nn&8191,Ni=nn>>>13,_n=_e[8]|0,$i=_n&8191,zn=_n>>>13,Wn=_e[9]|0,It=Wn&8191,ft=Wn>>>13;re.negative=N.negative^W.negative,re.length=19,ge=Math.imul(Ae,Or),ie=Math.imul(Ae,Nr),ie=ie+Math.imul(ze,Or)|0,Te=Math.imul(ze,Nr);var jt=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(jt>>>26)|0,jt&=67108863,ge=Math.imul(me,Or),ie=Math.imul(me,Nr),ie=ie+Math.imul(Re,Or)|0,Te=Math.imul(Re,Nr),ge=ge+Math.imul(Ae,Ne)|0,ie=ie+Math.imul(Ae,Ye)|0,ie=ie+Math.imul(ze,Ne)|0,Te=Te+Math.imul(ze,Ye)|0;var Zt=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,ge=Math.imul(Ge,Or),ie=Math.imul(Ge,Nr),ie=ie+Math.imul(nt,Or)|0,Te=Math.imul(nt,Nr),ge=ge+Math.imul(me,Ne)|0,ie=ie+Math.imul(me,Ye)|0,ie=ie+Math.imul(Re,Ne)|0,Te=Te+Math.imul(Re,Ye)|0,ge=ge+Math.imul(Ae,Xe)|0,ie=ie+Math.imul(Ae,ht)|0,ie=ie+Math.imul(ze,Xe)|0,Te=Te+Math.imul(ze,ht)|0;var yr=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(yr>>>26)|0,yr&=67108863,ge=Math.imul(qt,Or),ie=Math.imul(qt,Nr),ie=ie+Math.imul(rt,Or)|0,Te=Math.imul(rt,Nr),ge=ge+Math.imul(Ge,Ne)|0,ie=ie+Math.imul(Ge,Ye)|0,ie=ie+Math.imul(nt,Ne)|0,Te=Te+Math.imul(nt,Ye)|0,ge=ge+Math.imul(me,Xe)|0,ie=ie+Math.imul(me,ht)|0,ie=ie+Math.imul(Re,Xe)|0,Te=Te+Math.imul(Re,ht)|0,ge=ge+Math.imul(Ae,xe)|0,ie=ie+Math.imul(Ae,Se)|0,ie=ie+Math.imul(ze,xe)|0,Te=Te+Math.imul(ze,Se)|0;var Fr=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,ge=Math.imul(Rt,Or),ie=Math.imul(Rt,Nr),ie=ie+Math.imul(kt,Or)|0,Te=Math.imul(kt,Nr),ge=ge+Math.imul(qt,Ne)|0,ie=ie+Math.imul(qt,Ye)|0,ie=ie+Math.imul(rt,Ne)|0,Te=Te+Math.imul(rt,Ye)|0,ge=ge+Math.imul(Ge,Xe)|0,ie=ie+Math.imul(Ge,ht)|0,ie=ie+Math.imul(nt,Xe)|0,Te=Te+Math.imul(nt,ht)|0,ge=ge+Math.imul(me,xe)|0,ie=ie+Math.imul(me,Se)|0,ie=ie+Math.imul(Re,xe)|0,Te=Te+Math.imul(Re,Se)|0,ge=ge+Math.imul(Ae,Gt)|0,ie=ie+Math.imul(Ae,Vt)|0,ie=ie+Math.imul(ze,Gt)|0,Te=Te+Math.imul(ze,Vt)|0;var Zr=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,ge=Math.imul(Yt,Or),ie=Math.imul(Yt,Nr),ie=ie+Math.imul(xr,Or)|0,Te=Math.imul(xr,Nr),ge=ge+Math.imul(Rt,Ne)|0,ie=ie+Math.imul(Rt,Ye)|0,ie=ie+Math.imul(kt,Ne)|0,Te=Te+Math.imul(kt,Ye)|0,ge=ge+Math.imul(qt,Xe)|0,ie=ie+Math.imul(qt,ht)|0,ie=ie+Math.imul(rt,Xe)|0,Te=Te+Math.imul(rt,ht)|0,ge=ge+Math.imul(Ge,xe)|0,ie=ie+Math.imul(Ge,Se)|0,ie=ie+Math.imul(nt,xe)|0,Te=Te+Math.imul(nt,Se)|0,ge=ge+Math.imul(me,Gt)|0,ie=ie+Math.imul(me,Vt)|0,ie=ie+Math.imul(Re,Gt)|0,Te=Te+Math.imul(Re,Vt)|0,ge=ge+Math.imul(Ae,Qr)|0,ie=ie+Math.imul(Ae,ai)|0,ie=ie+Math.imul(ze,Qr)|0,Te=Te+Math.imul(ze,ai)|0;var Vr=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,ge=Math.imul(Ke,Or),ie=Math.imul(Ke,Nr),ie=ie+Math.imul(xt,Or)|0,Te=Math.imul(xt,Nr),ge=ge+Math.imul(Yt,Ne)|0,ie=ie+Math.imul(Yt,Ye)|0,ie=ie+Math.imul(xr,Ne)|0,Te=Te+Math.imul(xr,Ye)|0,ge=ge+Math.imul(Rt,Xe)|0,ie=ie+Math.imul(Rt,ht)|0,ie=ie+Math.imul(kt,Xe)|0,Te=Te+Math.imul(kt,ht)|0,ge=ge+Math.imul(qt,xe)|0,ie=ie+Math.imul(qt,Se)|0,ie=ie+Math.imul(rt,xe)|0,Te=Te+Math.imul(rt,Se)|0,ge=ge+Math.imul(Ge,Gt)|0,ie=ie+Math.imul(Ge,Vt)|0,ie=ie+Math.imul(nt,Gt)|0,Te=Te+Math.imul(nt,Vt)|0,ge=ge+Math.imul(me,Qr)|0,ie=ie+Math.imul(me,ai)|0,ie=ie+Math.imul(Re,Qr)|0,Te=Te+Math.imul(Re,ai)|0,ge=ge+Math.imul(Ae,ri)|0,ie=ie+Math.imul(Ae,bi)|0,ie=ie+Math.imul(ze,ri)|0,Te=Te+Math.imul(ze,bi)|0;var gi=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(gi>>>26)|0,gi&=67108863,ge=Math.imul(Lt,Or),ie=Math.imul(Lt,Nr),ie=ie+Math.imul(St,Or)|0,Te=Math.imul(St,Nr),ge=ge+Math.imul(Ke,Ne)|0,ie=ie+Math.imul(Ke,Ye)|0,ie=ie+Math.imul(xt,Ne)|0,Te=Te+Math.imul(xt,Ye)|0,ge=ge+Math.imul(Yt,Xe)|0,ie=ie+Math.imul(Yt,ht)|0,ie=ie+Math.imul(xr,Xe)|0,Te=Te+Math.imul(xr,ht)|0,ge=ge+Math.imul(Rt,xe)|0,ie=ie+Math.imul(Rt,Se)|0,ie=ie+Math.imul(kt,xe)|0,Te=Te+Math.imul(kt,Se)|0,ge=ge+Math.imul(qt,Gt)|0,ie=ie+Math.imul(qt,Vt)|0,ie=ie+Math.imul(rt,Gt)|0,Te=Te+Math.imul(rt,Vt)|0,ge=ge+Math.imul(Ge,Qr)|0,ie=ie+Math.imul(Ge,ai)|0,ie=ie+Math.imul(nt,Qr)|0,Te=Te+Math.imul(nt,ai)|0,ge=ge+Math.imul(me,ri)|0,ie=ie+Math.imul(me,bi)|0,ie=ie+Math.imul(Re,ri)|0,Te=Te+Math.imul(Re,bi)|0,ge=ge+Math.imul(Ae,Wi)|0,ie=ie+Math.imul(Ae,Ni)|0,ie=ie+Math.imul(ze,Wi)|0,Te=Te+Math.imul(ze,Ni)|0;var Si=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Si>>>26)|0,Si&=67108863,ge=Math.imul(dt,Or),ie=Math.imul(dt,Nr),ie=ie+Math.imul(Ht,Or)|0,Te=Math.imul(Ht,Nr),ge=ge+Math.imul(Lt,Ne)|0,ie=ie+Math.imul(Lt,Ye)|0,ie=ie+Math.imul(St,Ne)|0,Te=Te+Math.imul(St,Ye)|0,ge=ge+Math.imul(Ke,Xe)|0,ie=ie+Math.imul(Ke,ht)|0,ie=ie+Math.imul(xt,Xe)|0,Te=Te+Math.imul(xt,ht)|0,ge=ge+Math.imul(Yt,xe)|0,ie=ie+Math.imul(Yt,Se)|0,ie=ie+Math.imul(xr,xe)|0,Te=Te+Math.imul(xr,Se)|0,ge=ge+Math.imul(Rt,Gt)|0,ie=ie+Math.imul(Rt,Vt)|0,ie=ie+Math.imul(kt,Gt)|0,Te=Te+Math.imul(kt,Vt)|0,ge=ge+Math.imul(qt,Qr)|0,ie=ie+Math.imul(qt,ai)|0,ie=ie+Math.imul(rt,Qr)|0,Te=Te+Math.imul(rt,ai)|0,ge=ge+Math.imul(Ge,ri)|0,ie=ie+Math.imul(Ge,bi)|0,ie=ie+Math.imul(nt,ri)|0,Te=Te+Math.imul(nt,bi)|0,ge=ge+Math.imul(me,Wi)|0,ie=ie+Math.imul(me,Ni)|0,ie=ie+Math.imul(Re,Wi)|0,Te=Te+Math.imul(Re,Ni)|0,ge=ge+Math.imul(Ae,$i)|0,ie=ie+Math.imul(Ae,zn)|0,ie=ie+Math.imul(ze,$i)|0,Te=Te+Math.imul(ze,zn)|0;var Mi=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,ge=Math.imul(fr,Or),ie=Math.imul(fr,Nr),ie=ie+Math.imul(_r,Or)|0,Te=Math.imul(_r,Nr),ge=ge+Math.imul(dt,Ne)|0,ie=ie+Math.imul(dt,Ye)|0,ie=ie+Math.imul(Ht,Ne)|0,Te=Te+Math.imul(Ht,Ye)|0,ge=ge+Math.imul(Lt,Xe)|0,ie=ie+Math.imul(Lt,ht)|0,ie=ie+Math.imul(St,Xe)|0,Te=Te+Math.imul(St,ht)|0,ge=ge+Math.imul(Ke,xe)|0,ie=ie+Math.imul(Ke,Se)|0,ie=ie+Math.imul(xt,xe)|0,Te=Te+Math.imul(xt,Se)|0,ge=ge+Math.imul(Yt,Gt)|0,ie=ie+Math.imul(Yt,Vt)|0,ie=ie+Math.imul(xr,Gt)|0,Te=Te+Math.imul(xr,Vt)|0,ge=ge+Math.imul(Rt,Qr)|0,ie=ie+Math.imul(Rt,ai)|0,ie=ie+Math.imul(kt,Qr)|0,Te=Te+Math.imul(kt,ai)|0,ge=ge+Math.imul(qt,ri)|0,ie=ie+Math.imul(qt,bi)|0,ie=ie+Math.imul(rt,ri)|0,Te=Te+Math.imul(rt,bi)|0,ge=ge+Math.imul(Ge,Wi)|0,ie=ie+Math.imul(Ge,Ni)|0,ie=ie+Math.imul(nt,Wi)|0,Te=Te+Math.imul(nt,Ni)|0,ge=ge+Math.imul(me,$i)|0,ie=ie+Math.imul(me,zn)|0,ie=ie+Math.imul(Re,$i)|0,Te=Te+Math.imul(Re,zn)|0,ge=ge+Math.imul(Ae,It)|0,ie=ie+Math.imul(Ae,ft)|0,ie=ie+Math.imul(ze,It)|0,Te=Te+Math.imul(ze,ft)|0;var Pi=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Pi>>>26)|0,Pi&=67108863,ge=Math.imul(fr,Ne),ie=Math.imul(fr,Ye),ie=ie+Math.imul(_r,Ne)|0,Te=Math.imul(_r,Ye),ge=ge+Math.imul(dt,Xe)|0,ie=ie+Math.imul(dt,ht)|0,ie=ie+Math.imul(Ht,Xe)|0,Te=Te+Math.imul(Ht,ht)|0,ge=ge+Math.imul(Lt,xe)|0,ie=ie+Math.imul(Lt,Se)|0,ie=ie+Math.imul(St,xe)|0,Te=Te+Math.imul(St,Se)|0,ge=ge+Math.imul(Ke,Gt)|0,ie=ie+Math.imul(Ke,Vt)|0,ie=ie+Math.imul(xt,Gt)|0,Te=Te+Math.imul(xt,Vt)|0,ge=ge+Math.imul(Yt,Qr)|0,ie=ie+Math.imul(Yt,ai)|0,ie=ie+Math.imul(xr,Qr)|0,Te=Te+Math.imul(xr,ai)|0,ge=ge+Math.imul(Rt,ri)|0,ie=ie+Math.imul(Rt,bi)|0,ie=ie+Math.imul(kt,ri)|0,Te=Te+Math.imul(kt,bi)|0,ge=ge+Math.imul(qt,Wi)|0,ie=ie+Math.imul(qt,Ni)|0,ie=ie+Math.imul(rt,Wi)|0,Te=Te+Math.imul(rt,Ni)|0,ge=ge+Math.imul(Ge,$i)|0,ie=ie+Math.imul(Ge,zn)|0,ie=ie+Math.imul(nt,$i)|0,Te=Te+Math.imul(nt,zn)|0,ge=ge+Math.imul(me,It)|0,ie=ie+Math.imul(me,ft)|0,ie=ie+Math.imul(Re,It)|0,Te=Te+Math.imul(Re,ft)|0;var Gi=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,ge=Math.imul(fr,Xe),ie=Math.imul(fr,ht),ie=ie+Math.imul(_r,Xe)|0,Te=Math.imul(_r,ht),ge=ge+Math.imul(dt,xe)|0,ie=ie+Math.imul(dt,Se)|0,ie=ie+Math.imul(Ht,xe)|0,Te=Te+Math.imul(Ht,Se)|0,ge=ge+Math.imul(Lt,Gt)|0,ie=ie+Math.imul(Lt,Vt)|0,ie=ie+Math.imul(St,Gt)|0,Te=Te+Math.imul(St,Vt)|0,ge=ge+Math.imul(Ke,Qr)|0,ie=ie+Math.imul(Ke,ai)|0,ie=ie+Math.imul(xt,Qr)|0,Te=Te+Math.imul(xt,ai)|0,ge=ge+Math.imul(Yt,ri)|0,ie=ie+Math.imul(Yt,bi)|0,ie=ie+Math.imul(xr,ri)|0,Te=Te+Math.imul(xr,bi)|0,ge=ge+Math.imul(Rt,Wi)|0,ie=ie+Math.imul(Rt,Ni)|0,ie=ie+Math.imul(kt,Wi)|0,Te=Te+Math.imul(kt,Ni)|0,ge=ge+Math.imul(qt,$i)|0,ie=ie+Math.imul(qt,zn)|0,ie=ie+Math.imul(rt,$i)|0,Te=Te+Math.imul(rt,zn)|0,ge=ge+Math.imul(Ge,It)|0,ie=ie+Math.imul(Ge,ft)|0,ie=ie+Math.imul(nt,It)|0,Te=Te+Math.imul(nt,ft)|0;var Ki=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Ki>>>26)|0,Ki&=67108863,ge=Math.imul(fr,xe),ie=Math.imul(fr,Se),ie=ie+Math.imul(_r,xe)|0,Te=Math.imul(_r,Se),ge=ge+Math.imul(dt,Gt)|0,ie=ie+Math.imul(dt,Vt)|0,ie=ie+Math.imul(Ht,Gt)|0,Te=Te+Math.imul(Ht,Vt)|0,ge=ge+Math.imul(Lt,Qr)|0,ie=ie+Math.imul(Lt,ai)|0,ie=ie+Math.imul(St,Qr)|0,Te=Te+Math.imul(St,ai)|0,ge=ge+Math.imul(Ke,ri)|0,ie=ie+Math.imul(Ke,bi)|0,ie=ie+Math.imul(xt,ri)|0,Te=Te+Math.imul(xt,bi)|0,ge=ge+Math.imul(Yt,Wi)|0,ie=ie+Math.imul(Yt,Ni)|0,ie=ie+Math.imul(xr,Wi)|0,Te=Te+Math.imul(xr,Ni)|0,ge=ge+Math.imul(Rt,$i)|0,ie=ie+Math.imul(Rt,zn)|0,ie=ie+Math.imul(kt,$i)|0,Te=Te+Math.imul(kt,zn)|0,ge=ge+Math.imul(qt,It)|0,ie=ie+Math.imul(qt,ft)|0,ie=ie+Math.imul(rt,It)|0,Te=Te+Math.imul(rt,ft)|0;var ka=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(ka>>>26)|0,ka&=67108863,ge=Math.imul(fr,Gt),ie=Math.imul(fr,Vt),ie=ie+Math.imul(_r,Gt)|0,Te=Math.imul(_r,Vt),ge=ge+Math.imul(dt,Qr)|0,ie=ie+Math.imul(dt,ai)|0,ie=ie+Math.imul(Ht,Qr)|0,Te=Te+Math.imul(Ht,ai)|0,ge=ge+Math.imul(Lt,ri)|0,ie=ie+Math.imul(Lt,bi)|0,ie=ie+Math.imul(St,ri)|0,Te=Te+Math.imul(St,bi)|0,ge=ge+Math.imul(Ke,Wi)|0,ie=ie+Math.imul(Ke,Ni)|0,ie=ie+Math.imul(xt,Wi)|0,Te=Te+Math.imul(xt,Ni)|0,ge=ge+Math.imul(Yt,$i)|0,ie=ie+Math.imul(Yt,zn)|0,ie=ie+Math.imul(xr,$i)|0,Te=Te+Math.imul(xr,zn)|0,ge=ge+Math.imul(Rt,It)|0,ie=ie+Math.imul(Rt,ft)|0,ie=ie+Math.imul(kt,It)|0,Te=Te+Math.imul(kt,ft)|0;var jn=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(jn>>>26)|0,jn&=67108863,ge=Math.imul(fr,Qr),ie=Math.imul(fr,ai),ie=ie+Math.imul(_r,Qr)|0,Te=Math.imul(_r,ai),ge=ge+Math.imul(dt,ri)|0,ie=ie+Math.imul(dt,bi)|0,ie=ie+Math.imul(Ht,ri)|0,Te=Te+Math.imul(Ht,bi)|0,ge=ge+Math.imul(Lt,Wi)|0,ie=ie+Math.imul(Lt,Ni)|0,ie=ie+Math.imul(St,Wi)|0,Te=Te+Math.imul(St,Ni)|0,ge=ge+Math.imul(Ke,$i)|0,ie=ie+Math.imul(Ke,zn)|0,ie=ie+Math.imul(xt,$i)|0,Te=Te+Math.imul(xt,zn)|0,ge=ge+Math.imul(Yt,It)|0,ie=ie+Math.imul(Yt,ft)|0,ie=ie+Math.imul(xr,It)|0,Te=Te+Math.imul(xr,ft)|0;var la=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(la>>>26)|0,la&=67108863,ge=Math.imul(fr,ri),ie=Math.imul(fr,bi),ie=ie+Math.imul(_r,ri)|0,Te=Math.imul(_r,bi),ge=ge+Math.imul(dt,Wi)|0,ie=ie+Math.imul(dt,Ni)|0,ie=ie+Math.imul(Ht,Wi)|0,Te=Te+Math.imul(Ht,Ni)|0,ge=ge+Math.imul(Lt,$i)|0,ie=ie+Math.imul(Lt,zn)|0,ie=ie+Math.imul(St,$i)|0,Te=Te+Math.imul(St,zn)|0,ge=ge+Math.imul(Ke,It)|0,ie=ie+Math.imul(Ke,ft)|0,ie=ie+Math.imul(xt,It)|0,Te=Te+Math.imul(xt,ft)|0;var Fa=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,ge=Math.imul(fr,Wi),ie=Math.imul(fr,Ni),ie=ie+Math.imul(_r,Wi)|0,Te=Math.imul(_r,Ni),ge=ge+Math.imul(dt,$i)|0,ie=ie+Math.imul(dt,zn)|0,ie=ie+Math.imul(Ht,$i)|0,Te=Te+Math.imul(Ht,zn)|0,ge=ge+Math.imul(Lt,It)|0,ie=ie+Math.imul(Lt,ft)|0,ie=ie+Math.imul(St,It)|0,Te=Te+Math.imul(St,ft)|0;var Ra=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(Ra>>>26)|0,Ra&=67108863,ge=Math.imul(fr,$i),ie=Math.imul(fr,zn),ie=ie+Math.imul(_r,$i)|0,Te=Math.imul(_r,zn),ge=ge+Math.imul(dt,It)|0,ie=ie+Math.imul(dt,ft)|0,ie=ie+Math.imul(Ht,It)|0,Te=Te+Math.imul(Ht,ft)|0;var jo=(ke+ge|0)+((ie&8191)<<13)|0;ke=(Te+(ie>>>13)|0)+(jo>>>26)|0,jo&=67108863,ge=Math.imul(fr,It),ie=Math.imul(fr,ft),ie=ie+Math.imul(_r,It)|0,Te=Math.imul(_r,ft);var oa=(ke+ge|0)+((ie&8191)<<13)|0;return ke=(Te+(ie>>>13)|0)+(oa>>>26)|0,oa&=67108863,Me[0]=jt,Me[1]=Zt,Me[2]=yr,Me[3]=Fr,Me[4]=Zr,Me[5]=Vr,Me[6]=gi,Me[7]=Si,Me[8]=Mi,Me[9]=Pi,Me[10]=Gi,Me[11]=Ki,Me[12]=ka,Me[13]=jn,Me[14]=la,Me[15]=Fa,Me[16]=Ra,Me[17]=jo,Me[18]=oa,ke!==0&&(Me[19]=ke,re.length++),re};Math.imul||(L=A);function _(G,N,W){W.negative=N.negative^G.negative,W.length=G.length+N.length;for(var re=0,ae=0,_e=0;_e>>26)|0,ae+=Me>>>26,Me&=67108863}W.words[_e]=ke,re=Me,Me=ae}return re!==0?W.words[_e]=re:W.length--,W.strip()}function C(G,N,W){var re=new M;return re.mulp(G,N,W)}f.prototype.mulTo=function(N,W){var re,ae=this.length+N.length;return this.length===10&&N.length===10?re=L(this,N,W):ae<63?re=A(this,N,W):ae<1024?re=_(this,N,W):re=C(this,N,W),re};function M(G,N){this.x=G,this.y=N}M.prototype.makeRBT=function(N){for(var W=new Array(N),re=f.prototype._countBits(N)-1,ae=0;ae>=1;return ae},M.prototype.permute=function(N,W,re,ae,_e,Me){for(var ke=0;ke>>1)_e++;return 1<<_e+1+ae},M.prototype.conjugate=function(N,W,re){if(!(re<=1))for(var ae=0;ae>>13,re[2*Me+1]=_e&8191,_e=_e>>>13;for(Me=2*W;Me>=26,W+=ae/67108864|0,W+=_e>>>26,this.words[re]=_e&67108863}return W!==0&&(this.words[re]=W,this.length++),this},f.prototype.muln=function(N){return this.clone().imuln(N)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(N){var W=k(N);if(W.length===0)return new f(1);for(var re=this,ae=0;ae=0);var W=N%26,re=(N-W)/26,ae=67108863>>>26-W<<26-W,_e;if(W!==0){var Me=0;for(_e=0;_e>>26-W}Me&&(this.words[_e]=Me,this.length++)}if(re!==0){for(_e=this.length-1;_e>=0;_e--)this.words[_e+re]=this.words[_e];for(_e=0;_e=0);var ae;W?ae=(W-W%26)/26:ae=0;var _e=N%26,Me=Math.min((N-_e)/26,this.length),ke=67108863^67108863>>>_e<<_e,ge=re;if(ae-=Me,ae=Math.max(0,ae),ge){for(var ie=0;ieMe)for(this.length-=Me,ie=0;ie=0&&(Te!==0||ie>=ae);ie--){var Ee=this.words[ie]|0;this.words[ie]=Te<<26-_e|Ee>>>_e,Te=Ee&ke}return ge&&Te!==0&&(ge.words[ge.length++]=Te),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(N,W,re){return u(this.negative===0),this.iushrn(N,W,re)},f.prototype.shln=function(N){return this.clone().ishln(N)},f.prototype.ushln=function(N){return this.clone().iushln(N)},f.prototype.shrn=function(N){return this.clone().ishrn(N)},f.prototype.ushrn=function(N){return this.clone().iushrn(N)},f.prototype.testn=function(N){u(typeof N=="number"&&N>=0);var W=N%26,re=(N-W)/26,ae=1<=0);var W=N%26,re=(N-W)/26;if(u(this.negative===0,"imaskn works only with positive numbers"),this.length<=re)return this;if(W!==0&&re++,this.length=Math.min(re,this.length),W!==0){var ae=67108863^67108863>>>W<=67108864;W++)this.words[W]-=67108864,W===this.length-1?this.words[W+1]=1:this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},f.prototype.isubn=function(N){if(u(typeof N=="number"),u(N<67108864),N<0)return this.iaddn(-N);if(this.negative!==0)return this.negative=0,this.iaddn(N),this.negative=1,this;if(this.words[0]-=N,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W>26)-(ge/67108864|0),this.words[_e+re]=Me&67108863}for(;_e>26,this.words[_e+re]=Me&67108863;if(ke===0)return this.strip();for(u(ke===-1),ke=0,_e=0;_e>26,this.words[_e]=Me&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(N,W){var re=this.length-N.length,ae=this.clone(),_e=N,Me=_e.words[_e.length-1]|0,ke=this._countBits(Me);re=26-ke,re!==0&&(_e=_e.ushln(re),ae.iushln(re),Me=_e.words[_e.length-1]|0);var ge=ae.length-_e.length,ie;if(W!=="mod"){ie=new f(null),ie.length=ge+1,ie.words=new Array(ie.length);for(var Te=0;Te=0;Ae--){var ze=(ae.words[_e.length+Ae]|0)*67108864+(ae.words[_e.length+Ae-1]|0);for(ze=Math.min(ze/Me|0,67108863),ae._ishlnsubmul(_e,ze,Ae);ae.negative!==0;)ze--,ae.negative=0,ae._ishlnsubmul(_e,1,Ae),ae.isZero()||(ae.negative^=1);ie&&(ie.words[Ae]=ze)}return ie&&ie.strip(),ae.strip(),W!=="div"&&re!==0&&ae.iushrn(re),{div:ie||null,mod:ae}},f.prototype.divmod=function(N,W,re){if(u(!N.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var ae,_e,Me;return this.negative!==0&&N.negative===0?(Me=this.neg().divmod(N,W),W!=="mod"&&(ae=Me.div.neg()),W!=="div"&&(_e=Me.mod.neg(),re&&_e.negative!==0&&_e.iadd(N)),{div:ae,mod:_e}):this.negative===0&&N.negative!==0?(Me=this.divmod(N.neg(),W),W!=="mod"&&(ae=Me.div.neg()),{div:ae,mod:Me.mod}):this.negative&N.negative?(Me=this.neg().divmod(N.neg(),W),W!=="div"&&(_e=Me.mod.neg(),re&&_e.negative!==0&&_e.isub(N)),{div:Me.div,mod:_e}):N.length>this.length||this.cmp(N)<0?{div:new f(0),mod:this}:N.length===1?W==="div"?{div:this.divn(N.words[0]),mod:null}:W==="mod"?{div:null,mod:new f(this.modn(N.words[0]))}:{div:this.divn(N.words[0]),mod:new f(this.modn(N.words[0]))}:this._wordDiv(N,W)},f.prototype.div=function(N){return this.divmod(N,"div",!1).div},f.prototype.mod=function(N){return this.divmod(N,"mod",!1).mod},f.prototype.umod=function(N){return this.divmod(N,"mod",!0).mod},f.prototype.divRound=function(N){var W=this.divmod(N);if(W.mod.isZero())return W.div;var re=W.div.negative!==0?W.mod.isub(N):W.mod,ae=N.ushrn(1),_e=N.andln(1),Me=re.cmp(ae);return Me<0||_e===1&&Me===0?W.div:W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},f.prototype.modn=function(N){u(N<=67108863);for(var W=(1<<26)%N,re=0,ae=this.length-1;ae>=0;ae--)re=(W*re+(this.words[ae]|0))%N;return re},f.prototype.idivn=function(N){u(N<=67108863);for(var W=0,re=this.length-1;re>=0;re--){var ae=(this.words[re]|0)+W*67108864;this.words[re]=ae/N|0,W=ae%N}return this.strip()},f.prototype.divn=function(N){return this.clone().idivn(N)},f.prototype.egcd=function(N){u(N.negative===0),u(!N.isZero());var W=this,re=N.clone();W.negative!==0?W=W.umod(N):W=W.clone();for(var ae=new f(1),_e=new f(0),Me=new f(0),ke=new f(1),ge=0;W.isEven()&&re.isEven();)W.iushrn(1),re.iushrn(1),++ge;for(var ie=re.clone(),Te=W.clone();!W.isZero();){for(var Ee=0,Ae=1;!(W.words[0]&Ae)&&Ee<26;++Ee,Ae<<=1);if(Ee>0)for(W.iushrn(Ee);Ee-- >0;)(ae.isOdd()||_e.isOdd())&&(ae.iadd(ie),_e.isub(Te)),ae.iushrn(1),_e.iushrn(1);for(var ze=0,Ce=1;!(re.words[0]&Ce)&&ze<26;++ze,Ce<<=1);if(ze>0)for(re.iushrn(ze);ze-- >0;)(Me.isOdd()||ke.isOdd())&&(Me.iadd(ie),ke.isub(Te)),Me.iushrn(1),ke.iushrn(1);W.cmp(re)>=0?(W.isub(re),ae.isub(Me),_e.isub(ke)):(re.isub(W),Me.isub(ae),ke.isub(_e))}return{a:Me,b:ke,gcd:re.iushln(ge)}},f.prototype._invmp=function(N){u(N.negative===0),u(!N.isZero());var W=this,re=N.clone();W.negative!==0?W=W.umod(N):W=W.clone();for(var ae=new f(1),_e=new f(0),Me=re.clone();W.cmpn(1)>0&&re.cmpn(1)>0;){for(var ke=0,ge=1;!(W.words[0]&ge)&&ke<26;++ke,ge<<=1);if(ke>0)for(W.iushrn(ke);ke-- >0;)ae.isOdd()&&ae.iadd(Me),ae.iushrn(1);for(var ie=0,Te=1;!(re.words[0]&Te)&&ie<26;++ie,Te<<=1);if(ie>0)for(re.iushrn(ie);ie-- >0;)_e.isOdd()&&_e.iadd(Me),_e.iushrn(1);W.cmp(re)>=0?(W.isub(re),ae.isub(_e)):(re.isub(W),_e.isub(ae))}var Ee;return W.cmpn(1)===0?Ee=ae:Ee=_e,Ee.cmpn(0)<0&&Ee.iadd(N),Ee},f.prototype.gcd=function(N){if(this.isZero())return N.abs();if(N.isZero())return this.abs();var W=this.clone(),re=N.clone();W.negative=0,re.negative=0;for(var ae=0;W.isEven()&&re.isEven();ae++)W.iushrn(1),re.iushrn(1);do{for(;W.isEven();)W.iushrn(1);for(;re.isEven();)re.iushrn(1);var _e=W.cmp(re);if(_e<0){var Me=W;W=re,re=Me}else if(_e===0||re.cmpn(1)===0)break;W.isub(re)}while(!0);return re.iushln(ae)},f.prototype.invm=function(N){return this.egcd(N).a.umod(N)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(N){return this.words[0]&N},f.prototype.bincn=function(N){u(typeof N=="number");var W=N%26,re=(N-W)/26,ae=1<>>26,ke&=67108863,this.words[Me]=ke}return _e!==0&&(this.words[Me]=_e,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(N){var W=N<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var re;if(this.length>1)re=1;else{W&&(N=-N),u(N<=67108863,"Number is too big");var ae=this.words[0]|0;re=ae===N?0:aeN.length)return 1;if(this.length=0;re--){var ae=this.words[re]|0,_e=N.words[re]|0;if(ae!==_e){ae<_e?W=-1:ae>_e&&(W=1);break}}return W},f.prototype.gtn=function(N){return this.cmpn(N)===1},f.prototype.gt=function(N){return this.cmp(N)===1},f.prototype.gten=function(N){return this.cmpn(N)>=0},f.prototype.gte=function(N){return this.cmp(N)>=0},f.prototype.ltn=function(N){return this.cmpn(N)===-1},f.prototype.lt=function(N){return this.cmp(N)===-1},f.prototype.lten=function(N){return this.cmpn(N)<=0},f.prototype.lte=function(N){return this.cmp(N)<=0},f.prototype.eqn=function(N){return this.cmpn(N)===0},f.prototype.eq=function(N){return this.cmp(N)===0},f.red=function(N){return new H(N)},f.prototype.toRed=function(N){return u(!this.red,"Already a number in reduction context"),u(this.negative===0,"red works only with positives"),N.convertTo(this)._forceRed(N)},f.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(N){return this.red=N,this},f.prototype.forceRed=function(N){return u(!this.red,"Already a number in reduction context"),this._forceRed(N)},f.prototype.redAdd=function(N){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,N)},f.prototype.redIAdd=function(N){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,N)},f.prototype.redSub=function(N){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,N)},f.prototype.redISub=function(N){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,N)},f.prototype.redShl=function(N){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,N)},f.prototype.redMul=function(N){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.mul(this,N)},f.prototype.redIMul=function(N){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.imul(this,N)},f.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(N){return u(this.red&&!N.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,N)};var p={k256:null,p224:null,p192:null,p25519:null};function P(G,N){this.name=G,this.p=new f(N,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var N=new f(null);return N.words=new Array(Math.ceil(this.n/13)),N},P.prototype.ireduce=function(N){var W=N,re;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),re=W.bitLength();while(re>this.n);var ae=re0?W.isub(this.p):W.strip!==void 0?W.strip():W._strip(),W},P.prototype.split=function(N,W){N.iushrn(this.n,0,W)},P.prototype.imulK=function(N){return N.imul(this.k)};function T(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}c(T,P),T.prototype.split=function(N,W){for(var re=4194303,ae=Math.min(N.length,9),_e=0;_e>>22,Me=ke}Me>>>=22,N.words[_e-10]=Me,Me===0&&N.length>10?N.length-=10:N.length-=9},T.prototype.imulK=function(N){N.words[N.length]=0,N.words[N.length+1]=0,N.length+=2;for(var W=0,re=0;re>>=26,N.words[re]=_e,W=ae}return W!==0&&(N.words[N.length++]=W),N},f._prime=function(N){if(p[N])return p[N];var W;if(N==="k256")W=new T;else if(N==="p224")W=new F;else if(N==="p192")W=new q;else if(N==="p25519")W=new V;else throw new Error("Unknown prime "+N);return p[N]=W,W};function H(G){if(typeof G=="string"){var N=f._prime(G);this.m=N.p,this.prime=N}else u(G.gtn(1),"modulus must be greater than 1"),this.m=G,this.prime=null}H.prototype._verify1=function(N){u(N.negative===0,"red works only with positives"),u(N.red,"red works only with red numbers")},H.prototype._verify2=function(N,W){u((N.negative|W.negative)===0,"red works only with positives"),u(N.red&&N.red===W.red,"red works only with red numbers")},H.prototype.imod=function(N){return this.prime?this.prime.ireduce(N)._forceRed(this):N.umod(this.m)._forceRed(this)},H.prototype.neg=function(N){return N.isZero()?N.clone():this.m.sub(N)._forceRed(this)},H.prototype.add=function(N,W){this._verify2(N,W);var re=N.add(W);return re.cmp(this.m)>=0&&re.isub(this.m),re._forceRed(this)},H.prototype.iadd=function(N,W){this._verify2(N,W);var re=N.iadd(W);return re.cmp(this.m)>=0&&re.isub(this.m),re},H.prototype.sub=function(N,W){this._verify2(N,W);var re=N.sub(W);return re.cmpn(0)<0&&re.iadd(this.m),re._forceRed(this)},H.prototype.isub=function(N,W){this._verify2(N,W);var re=N.isub(W);return re.cmpn(0)<0&&re.iadd(this.m),re},H.prototype.shl=function(N,W){return this._verify1(N),this.imod(N.ushln(W))},H.prototype.imul=function(N,W){return this._verify2(N,W),this.imod(N.imul(W))},H.prototype.mul=function(N,W){return this._verify2(N,W),this.imod(N.mul(W))},H.prototype.isqr=function(N){return this.imul(N,N.clone())},H.prototype.sqr=function(N){return this.mul(N,N)},H.prototype.sqrt=function(N){if(N.isZero())return N.clone();var W=this.m.andln(3);if(u(W%2===1),W===3){var re=this.m.add(new f(1)).iushrn(2);return this.pow(N,re)}for(var ae=this.m.subn(1),_e=0;!ae.isZero()&&ae.andln(1)===0;)_e++,ae.iushrn(1);u(!ae.isZero());var Me=new f(1).toRed(this),ke=Me.redNeg(),ge=this.m.subn(1).iushrn(1),ie=this.m.bitLength();for(ie=new f(2*ie*ie).toRed(this);this.pow(ie,ge).cmp(ke)!==0;)ie.redIAdd(ke);for(var Te=this.pow(ie,ae),Ee=this.pow(N,ae.addn(1).iushrn(1)),Ae=this.pow(N,ae),ze=_e;Ae.cmp(Me)!==0;){for(var Ce=Ae,me=0;Ce.cmp(Me)!==0;me++)Ce=Ce.redSqr();u(me=0;_e--){for(var Te=W.words[_e],Ee=ie-1;Ee>=0;Ee--){var Ae=Te>>Ee&1;if(Me!==ae[0]&&(Me=this.sqr(Me)),Ae===0&&ke===0){ge=0;continue}ke<<=1,ke|=Ae,ge++,!(ge!==re&&(_e!==0||Ee!==0))&&(Me=this.mul(Me,ae[ke]),ge=0,ke=0)}ie=26}return Me},H.prototype.convertTo=function(N){var W=N.umod(this.m);return W===N?W.clone():W},H.prototype.convertFrom=function(N){var W=N.clone();return W.red=null,W},f.mont=function(N){return new X(N)};function X(G){H.call(this,G),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}c(X,H),X.prototype.convertTo=function(N){return this.imod(N.ushln(this.shift))},X.prototype.convertFrom=function(N){var W=this.imod(N.mul(this.rinv));return W.red=null,W},X.prototype.imul=function(N,W){if(N.isZero()||W.isZero())return N.words[0]=0,N.length=1,N;var re=N.imul(W),ae=re.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_e=re.isub(ae).iushrn(this.shift),Me=_e;return _e.cmp(this.m)>=0?Me=_e.isub(this.m):_e.cmpn(0)<0&&(Me=_e.iadd(this.m)),Me._forceRed(this)},X.prototype.mul=function(N,W){if(N.isZero()||W.isZero())return new f(0)._forceRed(this);var re=N.mul(W),ae=re.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_e=re.isub(ae).iushrn(this.shift),Me=_e;return _e.cmp(this.m)>=0?Me=_e.isub(this.m):_e.cmpn(0)<0&&(Me=_e.iadd(this.m)),Me._forceRed(this)},X.prototype.invm=function(N){var W=this.imod(N._invmp(this.m).mul(this.r2));return W._forceRed(this)}}(i,this)},6204:function(i){"use strict";i.exports=a;function a(o){var s,l,u,c=o.length,f=0;for(s=0;s>>1;if(!(M<=0)){var p,P=s.mallocDouble(2*M*_),T=s.mallocInt32(_);if(_=f(E,M,P,T),_>0){if(M===1&&L)l.init(_),p=l.sweepComplete(M,A,0,_,P,T,0,_,P,T);else{var F=s.mallocDouble(2*M*C),q=s.mallocInt32(C);C=f(k,M,F,q),C>0&&(l.init(_+C),M===1?p=l.sweepBipartite(M,A,0,_,P,T,0,C,F,q):p=u(M,A,L,_,P,T,C,F,q),s.free(F),s.free(q))}s.free(P),s.free(T)}return p}}}var d;function v(E,k){d.push([E,k])}function x(E){return d=[],h(E,E,v,!0),d}function b(E,k){return d=[],h(E,k,v,!1),d}function g(E,k,A){switch(arguments.length){case 1:return x(E);case 2:return typeof k=="function"?h(E,E,k,!0):b(E,k);case 3:return h(E,k,A,!1);default:throw new Error("box-intersect: Invalid arguments")}}},2455:function(i,a){"use strict";function o(){function u(h,d,v,x,b,g,E,k,A,L,_){for(var C=2*h,M=x,p=C*x;MA-k?u(h,d,v,x,b,g,E,k,A,L,_):c(h,d,v,x,b,g,E,k,A,L,_)}return f}function s(){function u(v,x,b,g,E,k,A,L,_,C,M){for(var p=2*v,P=g,T=p*g;PC-_?g?u(v,x,b,E,k,A,L,_,C,M,p):c(v,x,b,E,k,A,L,_,C,M,p):g?f(v,x,b,E,k,A,L,_,C,M,p):h(v,x,b,E,k,A,L,_,C,M,p)}return d}function l(u){return u?o():s()}a.partial=l(!1),a.full=l(!0)},7150:function(i,a,o){"use strict";i.exports=G;var s=o(1888),l=o(8828),u=o(2455),c=u.partial,f=u.full,h=o(855),d=o(3545),v=o(8105),x=128,b=1<<22,g=1<<22,E=v("!(lo>=p0)&&!(p1>=hi)"),k=v("lo===p0"),A=v("lo0;){Te-=1;var ze=Te*M,Ce=T[ze],me=T[ze+1],Re=T[ze+2],ce=T[ze+3],Ge=T[ze+4],nt=T[ze+5],ct=Te*p,qt=F[ct],rt=F[ct+1],ot=nt&1,Rt=!!(nt&16),kt=_e,Ct=Me,Yt=ge,xr=ie;if(ot&&(kt=ge,Ct=ie,Yt=_e,xr=Me),!(nt&2&&(Re=A(N,Ce,me,Re,kt,Ct,rt),me>=Re))&&!(nt&4&&(me=L(N,Ce,me,Re,kt,Ct,qt),me>=Re))){var er=Re-me,Ke=Ge-ce;if(Rt){if(N*er*(er+Ke)v&&b[C+d]>L;--_,C-=E){for(var M=C,p=C+E,P=0;P>>1,L=2*h,_=A,C=b[L*A+d];E=F?(_=T,C=F):P>=V?(_=p,C=P):(_=q,C=V):F>=V?(_=T,C=F):V>=P?(_=p,C=P):(_=q,C=V);for(var G=L*(k-1),N=L*_,H=0;H=p0)&&!(p1>=hi)":d};function o(v){return a[v]}function s(v,x,b,g,E,k,A){for(var L=2*v,_=L*b,C=_,M=b,p=x,P=v+x,T=b;g>T;++T,_+=L){var F=E[_+p];if(F===A)if(M===T)M+=1,C+=L;else{for(var q=0;L>q;++q){var V=E[_+q];E[_+q]=E[C],E[C++]=V}var H=k[T];k[T]=k[M],k[M++]=H}}return M}function l(v,x,b,g,E,k,A){for(var L=2*v,_=L*b,C=_,M=b,p=x,P=v+x,T=b;g>T;++T,_+=L){var F=E[_+p];if(Fq;++q){var V=E[_+q];E[_+q]=E[C],E[C++]=V}var H=k[T];k[T]=k[M],k[M++]=H}}return M}function u(v,x,b,g,E,k,A){for(var L=2*v,_=L*b,C=_,M=b,p=x,P=v+x,T=b;g>T;++T,_+=L){var F=E[_+P];if(F<=A)if(M===T)M+=1,C+=L;else{for(var q=0;L>q;++q){var V=E[_+q];E[_+q]=E[C],E[C++]=V}var H=k[T];k[T]=k[M],k[M++]=H}}return M}function c(v,x,b,g,E,k,A){for(var L=2*v,_=L*b,C=_,M=b,p=x,P=v+x,T=b;g>T;++T,_+=L){var F=E[_+P];if(F<=A)if(M===T)M+=1,C+=L;else{for(var q=0;L>q;++q){var V=E[_+q];E[_+q]=E[C],E[C++]=V}var H=k[T];k[T]=k[M],k[M++]=H}}return M}function f(v,x,b,g,E,k,A){for(var L=2*v,_=L*b,C=_,M=b,p=x,P=v+x,T=b;g>T;++T,_+=L){var F=E[_+p],q=E[_+P];if(F<=A&&A<=q)if(M===T)M+=1,C+=L;else{for(var V=0;L>V;++V){var H=E[_+V];E[_+V]=E[C],E[C++]=H}var X=k[T];k[T]=k[M],k[M++]=X}}return M}function h(v,x,b,g,E,k,A){for(var L=2*v,_=L*b,C=_,M=b,p=x,P=v+x,T=b;g>T;++T,_+=L){var F=E[_+p],q=E[_+P];if(FV;++V){var H=E[_+V];E[_+V]=E[C],E[C++]=H}var X=k[T];k[T]=k[M],k[M++]=X}}return M}function d(v,x,b,g,E,k,A,L){for(var _=2*v,C=_*b,M=C,p=b,P=x,T=v+x,F=b;g>F;++F,C+=_){var q=E[C+P],V=E[C+T];if(!(q>=A)&&!(L>=V))if(p===F)p+=1,M+=_;else{for(var H=0;_>H;++H){var X=E[C+H];E[C+H]=E[M],E[M++]=X}var G=k[F];k[F]=k[p],k[p++]=G}}return p}},4192:function(i){"use strict";i.exports=o;var a=32;function o(x,b){b<=4*a?s(0,b-1,x):v(0,b-1,x)}function s(x,b,g){for(var E=2*(x+1),k=x+1;k<=b;++k){for(var A=g[E++],L=g[E++],_=k,C=E-2;_-- >x;){var M=g[C-2],p=g[C-1];if(Mg[b+1]:!0}function d(x,b,g,E){x*=2;var k=E[x];return k>1,_=L-E,C=L+E,M=k,p=_,P=L,T=C,F=A,q=x+1,V=b-1,H=0;h(M,p,g)&&(H=M,M=p,p=H),h(T,F,g)&&(H=T,T=F,F=H),h(M,P,g)&&(H=M,M=P,P=H),h(p,P,g)&&(H=p,p=P,P=H),h(M,T,g)&&(H=M,M=T,T=H),h(P,T,g)&&(H=P,P=T,T=H),h(p,F,g)&&(H=p,p=F,F=H),h(p,P,g)&&(H=p,p=P,P=H),h(T,F,g)&&(H=T,T=F,F=H);for(var X=g[2*p],G=g[2*p+1],N=g[2*T],W=g[2*T+1],re=2*M,ae=2*P,_e=2*F,Me=2*k,ke=2*L,ge=2*A,ie=0;ie<2;++ie){var Te=g[re+ie],Ee=g[ae+ie],Ae=g[_e+ie];g[Me+ie]=Te,g[ke+ie]=Ee,g[ge+ie]=Ae}u(_,x,g),u(C,b,g);for(var ze=q;ze<=V;++ze)if(d(ze,X,G,g))ze!==q&&l(ze,q,g),++q;else if(!d(ze,N,W,g))for(;;)if(d(V,N,W,g)){d(V,X,G,g)?(c(ze,q,V,g),++q,--V):(l(ze,V,g),--V);break}else{if(--V>>1;u(E,Ee);for(var Ae=0,ze=0,ke=0;ke=c)Ce=Ce-c|0,A(v,x,ze--,Ce);else if(Ce>=0)A(h,d,Ae--,Ce);else if(Ce<=-c){Ce=-Ce-c|0;for(var me=0;me>>1;u(E,Ee);for(var Ae=0,ze=0,Ce=0,ke=0;ke>1===E[2*ke+3]>>1&&(Re=2,ke+=1),me<0){for(var ce=-(me>>1)-1,Ge=0;Ge>1)-1;Re===0?A(h,d,Ae--,ce):Re===1?A(v,x,ze--,ce):Re===2&&A(b,g,Ce--,ce)}}}function M(P,T,F,q,V,H,X,G,N,W,re,ae){var _e=0,Me=2*P,ke=T,ge=T+P,ie=1,Te=1;q?Te=c:ie=c;for(var Ee=V;Ee>>1;u(E,me);for(var Re=0,Ee=0;Ee=c?(Ge=!q,Ae-=c):(Ge=!!q,Ae-=1),Ge)L(h,d,Re++,Ae);else{var nt=ae[Ae],ct=Me*Ae,qt=re[ct+T+1],rt=re[ct+T+1+P];e:for(var ot=0;ot>>1;u(E,Ae);for(var ze=0,ge=0;ge=c)h[ze++]=ie-c;else{ie-=1;var me=re[ie],Re=_e*ie,ce=W[Re+T+1],Ge=W[Re+T+1+P];e:for(var nt=0;nt=0;--nt)if(h[nt]===ie){for(var ot=nt+1;ot0;){for(var k=d.pop(),b=d.pop(),A=-1,L=-1,g=x[b],C=1;C=0||(h.flip(b,k),u(f,h,d,A,b,L),u(f,h,d,b,L,A),u(f,h,d,L,k,A),u(f,h,d,k,A,L))}}},5023:function(i,a,o){"use strict";var s=o(2478);i.exports=d;function l(v,x,b,g,E,k,A){this.cells=v,this.neighbor=x,this.flags=g,this.constraint=b,this.active=E,this.next=k,this.boundary=A}var u=l.prototype;function c(v,x){return v[0]-x[0]||v[1]-x[1]||v[2]-x[2]}u.locate=function(){var v=[0,0,0];return function(x,b,g){var E=x,k=b,A=g;return b0||A.length>0;){for(;k.length>0;){var p=k.pop();if(L[p]!==-E){L[p]=E;for(var P=_[p],T=0;T<3;++T){var F=M[3*p+T];F>=0&&L[F]===0&&(C[3*p+T]?A.push(F):(k.push(F),L[F]=E))}}}var q=A;A=k,k=q,A.length=0,E=-E}var V=h(_,L,x);return b?V.concat(g.boundary):V}},8902:function(i,a,o){"use strict";var s=o(2478),l=o(3250)[3],u=0,c=1,f=2;i.exports=A;function h(L,_,C,M,p){this.a=L,this.b=_,this.idx=C,this.lowerIds=M,this.upperIds=p}function d(L,_,C,M){this.a=L,this.b=_,this.type=C,this.idx=M}function v(L,_){var C=L.a[0]-_.a[0]||L.a[1]-_.a[1]||L.type-_.type;return C||L.type!==u&&(C=l(L.a,L.b,_.b),C)?C:L.idx-_.idx}function x(L,_){return l(L.a,L.b,_)}function b(L,_,C,M,p){for(var P=s.lt(_,M,x),T=s.gt(_,M,x),F=P;F1&&l(C[V[X-2]],C[V[X-1]],M)>0;)L.push([V[X-1],V[X-2],p]),X-=1;V.length=X,V.push(p);for(var H=q.upperIds,X=H.length;X>1&&l(C[H[X-2]],C[H[X-1]],M)<0;)L.push([H[X-2],H[X-1],p]),X-=1;H.length=X,H.push(p)}}function g(L,_){var C;return L.a[0]<_.a[0]?C=l(L.a,L.b,_.a):C=l(_.b,_.a,L.a),C||(_.b[0]q[0]&&p.push(new d(q,F,f,P),new d(F,q,c,P))}p.sort(v);for(var V=p[0].a[0]-(1+Math.abs(p[0].a[0]))*Math.pow(2,-52),H=[new h([V,1],[V,0],-1,[],[],[],[])],X=[],P=0,G=p.length;P=0}}(),u.removeTriangle=function(h,d,v){var x=this.stars;c(x[h],d,v),c(x[d],v,h),c(x[v],h,d)},u.addTriangle=function(h,d,v){var x=this.stars;x[h].push(d,v),x[d].push(v,h),x[v].push(h,d)},u.opposite=function(h,d){for(var v=this.stars[d],x=1,b=v.length;x=0;--N){var Te=X[N];W=Te[0];var Ee=V[W],Ae=Ee[0],ze=Ee[1],Ce=q[Ae],me=q[ze];if((Ce[0]-me[0]||Ce[1]-me[1])<0){var Re=Ae;Ae=ze,ze=Re}Ee[0]=Ae;var ce=Ee[1]=Te[1],Ge;for(G&&(Ge=Ee[2]);N>0&&X[N-1][0]===W;){var Te=X[--N],nt=Te[1];G?V.push([ce,nt,Ge]):V.push([ce,nt]),ce=nt}G?V.push([ce,ze,Ge]):V.push([ce,ze])}return re}function _(q,V,H){for(var X=V.length,G=new s(X),N=[],W=0;WV[2]?1:0)}function p(q,V,H){if(q.length!==0){if(V)for(var X=0;X0||W.length>0}function F(q,V,H){var X;if(H){X=V;for(var G=new Array(V.length),N=0;NL+1)throw new Error(k+" map requires nshades to be at least size "+E.length);Array.isArray(d.alpha)?d.alpha.length!==2?_=[1,1]:_=d.alpha.slice():typeof d.alpha=="number"?_=[d.alpha,d.alpha]:_=[1,1],v=E.map(function(F){return Math.round(F.index*L)}),_[0]=Math.min(Math.max(_[0],0),1),_[1]=Math.min(Math.max(_[1],0),1);var M=E.map(function(F,q){var V=E[q].index,H=E[q].rgb.slice();return H.length===4&&H[3]>=0&&H[3]<=1||(H[3]=_[0]+(_[1]-_[0])*V),H}),p=[];for(C=0;C=0}function d(v,x,b,g){var E=s(x,b,g);if(E===0){var k=l(s(v,x,b)),A=l(s(v,x,g));if(k===A){if(k===0){var L=h(v,x,b),_=h(v,x,g);return L===_?0:L?1:-1}return 0}else{if(A===0)return k>0||h(v,x,g)?-1:1;if(k===0)return A>0||h(v,x,b)?1:-1}return l(A-k)}var C=s(v,x,b);if(C>0)return E>0&&s(v,x,g)>0?1:-1;if(C<0)return E>0||s(v,x,g)>0?1:-1;var M=s(v,x,g);return M>0||h(v,x,b)?1:-1}},8572:function(i){"use strict";i.exports=function(o){return o<0?-1:o>0?1:0}},8507:function(i){i.exports=s;var a=Math.min;function o(l,u){return l-u}function s(l,u){var c=l.length,f=l.length-u.length;if(f)return f;switch(c){case 0:return 0;case 1:return l[0]-u[0];case 2:return l[0]+l[1]-u[0]-u[1]||a(l[0],l[1])-a(u[0],u[1]);case 3:var h=l[0]+l[1],d=u[0]+u[1];if(f=h+l[2]-(d+u[2]),f)return f;var v=a(l[0],l[1]),x=a(u[0],u[1]);return a(v,l[2])-a(x,u[2])||a(v+l[2],h)-a(x+u[2],d);case 4:var b=l[0],g=l[1],E=l[2],k=l[3],A=u[0],L=u[1],_=u[2],C=u[3];return b+g+E+k-(A+L+_+C)||a(b,g,E,k)-a(A,L,_,C,A)||a(b+g,b+E,b+k,g+E,g+k,E+k)-a(A+L,A+_,A+C,L+_,L+C,_+C)||a(b+g+E,b+g+k,b+E+k,g+E+k)-a(A+L+_,A+L+C,A+_+C,L+_+C);default:for(var M=l.slice().sort(o),p=u.slice().sort(o),P=0;Po[l][0]&&(l=u);return sl?[[l],[s]]:[[s]]}},4750:function(i,a,o){"use strict";i.exports=l;var s=o(3090);function l(u){var c=s(u),f=c.length;if(f<=2)return[];for(var h=new Array(f),d=c[f-1],v=0;v=d[A]&&(k+=1);g[E]=k}}return h}function f(h,d){try{return s(h,!0)}catch(g){var v=l(h);if(v.length<=d)return[];var x=u(h,v),b=s(x,!0);return c(b,v)}}},4769:function(i){"use strict";function a(s,l,u,c,f,h){var d=6*f*f-6*f,v=3*f*f-4*f+1,x=-6*f*f+6*f,b=3*f*f-2*f;if(s.length){h||(h=new Array(s.length));for(var g=s.length-1;g>=0;--g)h[g]=d*s[g]+v*l[g]+x*u[g]+b*c[g];return h}return d*s+v*l+x*u[g]+b*c}function o(s,l,u,c,f,h){var d=f-1,v=f*f,x=d*d,b=(1+2*f)*x,g=f*x,E=v*(3-2*f),k=v*d;if(s.length){h||(h=new Array(s.length));for(var A=s.length-1;A>=0;--A)h[A]=b*s[A]+g*l[A]+E*u[A]+k*c[A];return h}return b*s+g*l+E*u+k*c}i.exports=o,i.exports.derivative=a},7642:function(i,a,o){"use strict";var s=o(8954),l=o(1682);i.exports=h;function u(d,v){this.point=d,this.index=v}function c(d,v){for(var x=d.point,b=v.point,g=x.length,E=0;E=2)return!1;H[G]=N}return!0}):V=V.filter(function(H){for(var X=0;X<=b;++X){var G=P[H[X]];if(G<0)return!1;H[X]=G}return!0}),b&1)for(var k=0;k>>31},i.exports.exponent=function(E){var k=i.exports.hi(E);return(k<<1>>>21)-1023},i.exports.fraction=function(E){var k=i.exports.lo(E),A=i.exports.hi(E),L=A&(1<<20)-1;return A&2146435072&&(L+=1048576),[k,L]},i.exports.denormalized=function(E){var k=i.exports.hi(E);return!(k&2146435072)}},1338:function(i){"use strict";function a(l,u,c){var f=l[c]|0;if(f<=0)return[];var h=new Array(f),d;if(c===l.length-1)for(d=0;d0)return o(l|0,u);break;case"object":if(typeof l.length=="number")return a(l,u,0);break}return[]}i.exports=s},3134:function(i,a,o){"use strict";i.exports=l;var s=o(1682);function l(u,c){var f=u.length;if(typeof c!="number"){c=0;for(var h=0;h=b-1)for(var C=k.length-1,p=v-x[b-1],M=0;M=b-1)for(var _=k.length-1,C=v-x[b-1],M=0;M=0;--b)if(v[--x])return!1;return!0},f.jump=function(v){var x=this.lastT(),b=this.dimension;if(!(v0;--M)g.push(u(L[M-1],_[M-1],arguments[M])),E.push(0)}},f.push=function(v){var x=this.lastT(),b=this.dimension;if(!(v1e-6?1/A:0;this._time.push(v);for(var p=b;p>0;--p){var P=u(_[p-1],C[p-1],arguments[p]);g.push(P),E.push((P-g[k++])*M)}}},f.set=function(v){var x=this.dimension;if(!(v0;--L)b.push(u(k[L-1],A[L-1],arguments[L])),g.push(0)}},f.move=function(v){var x=this.lastT(),b=this.dimension;if(!(v<=x||arguments.length!==b+1)){var g=this._state,E=this._velocity,k=g.length-this.dimension,A=this.bounds,L=A[0],_=A[1],C=v-x,M=C>1e-6?1/C:0;this._time.push(v);for(var p=b;p>0;--p){var P=arguments[p];g.push(u(L[p-1],_[p-1],g[k++]+P)),E.push(P*M)}}},f.idle=function(v){var x=this.lastT();if(!(v=0;--M)g.push(u(L[M],_[M],g[k]+C*E[k])),E.push(0),k+=1}};function h(v){for(var x=new Array(v),b=0;b=0;--q){var p=P[q];T[q]<=0?P[q]=new s(p._color,p.key,p.value,P[q+1],p.right,p._count+1):P[q]=new s(p._color,p.key,p.value,p.left,P[q+1],p._count+1)}for(var q=P.length-1;q>1;--q){var V=P[q-1],p=P[q];if(V._color===o||p._color===o)break;var H=P[q-2];if(H.left===V)if(V.left===p){var X=H.right;if(X&&X._color===a)V._color=o,H.right=u(o,X),H._color=a,q-=1;else{if(H._color=a,H.left=V.right,V._color=o,V.right=H,P[q-2]=V,P[q-1]=p,c(H),c(V),q>=3){var G=P[q-3];G.left===H?G.left=V:G.right=V}break}}else{var X=H.right;if(X&&X._color===a)V._color=o,H.right=u(o,X),H._color=a,q-=1;else{if(V.right=p.left,H._color=a,H.left=p.right,p._color=o,p.left=V,p.right=H,P[q-2]=p,P[q-1]=V,c(H),c(V),c(p),q>=3){var G=P[q-3];G.left===H?G.left=p:G.right=p}break}}else if(V.right===p){var X=H.left;if(X&&X._color===a)V._color=o,H.left=u(o,X),H._color=a,q-=1;else{if(H._color=a,H.right=V.left,V._color=o,V.left=H,P[q-2]=V,P[q-1]=p,c(H),c(V),q>=3){var G=P[q-3];G.right===H?G.right=V:G.left=V}break}}else{var X=H.left;if(X&&X._color===a)V._color=o,H.left=u(o,X),H._color=a,q-=1;else{if(V.left=p.right,H._color=a,H.right=p.left,p._color=o,p.right=V,p.left=H,P[q-2]=p,P[q-1]=V,c(H),c(V),c(p),q>=3){var G=P[q-3];G.right===H?G.right=p:G.left=p}break}}}return P[0]._color=o,new f(M,P[0])};function d(_,C){if(C.left){var M=d(_,C.left);if(M)return M}var M=_(C.key,C.value);if(M)return M;if(C.right)return d(_,C.right)}function v(_,C,M,p){var P=C(_,p.key);if(P<=0){if(p.left){var T=v(_,C,M,p.left);if(T)return T}var T=M(p.key,p.value);if(T)return T}if(p.right)return v(_,C,M,p.right)}function x(_,C,M,p,P){var T=M(_,P.key),F=M(C,P.key),q;if(T<=0&&(P.left&&(q=x(_,C,M,p,P.left),q)||F>0&&(q=p(P.key,P.value),q)))return q;if(F>0&&P.right)return x(_,C,M,p,P.right)}h.forEach=function(C,M,p){if(this.root)switch(arguments.length){case 1:return d(C,this.root);case 2:return v(M,this._compare,C,this.root);case 3:return this._compare(M,p)>=0?void 0:x(M,p,this._compare,C,this.root)}},Object.defineProperty(h,"begin",{get:function(){for(var _=[],C=this.root;C;)_.push(C),C=C.left;return new b(this,_)}}),Object.defineProperty(h,"end",{get:function(){for(var _=[],C=this.root;C;)_.push(C),C=C.right;return new b(this,_)}}),h.at=function(_){if(_<0)return new b(this,[]);for(var C=this.root,M=[];;){if(M.push(C),C.left){if(_=C.right._count)break;C=C.right}else break}return new b(this,[])},h.ge=function(_){for(var C=this._compare,M=this.root,p=[],P=0;M;){var T=C(_,M.key);p.push(M),T<=0&&(P=p.length),T<=0?M=M.left:M=M.right}return p.length=P,new b(this,p)},h.gt=function(_){for(var C=this._compare,M=this.root,p=[],P=0;M;){var T=C(_,M.key);p.push(M),T<0&&(P=p.length),T<0?M=M.left:M=M.right}return p.length=P,new b(this,p)},h.lt=function(_){for(var C=this._compare,M=this.root,p=[],P=0;M;){var T=C(_,M.key);p.push(M),T>0&&(P=p.length),T<=0?M=M.left:M=M.right}return p.length=P,new b(this,p)},h.le=function(_){for(var C=this._compare,M=this.root,p=[],P=0;M;){var T=C(_,M.key);p.push(M),T>=0&&(P=p.length),T<0?M=M.left:M=M.right}return p.length=P,new b(this,p)},h.find=function(_){for(var C=this._compare,M=this.root,p=[];M;){var P=C(_,M.key);if(p.push(M),P===0)return new b(this,p);P<=0?M=M.left:M=M.right}return new b(this,[])},h.remove=function(_){var C=this.find(_);return C?C.remove():this},h.get=function(_){for(var C=this._compare,M=this.root;M;){var p=C(_,M.key);if(p===0)return M.value;p<=0?M=M.left:M=M.right}};function b(_,C){this.tree=_,this._stack=C}var g=b.prototype;Object.defineProperty(g,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(g,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),g.clone=function(){return new b(this.tree,this._stack.slice())};function E(_,C){_.key=C.key,_.value=C.value,_.left=C.left,_.right=C.right,_._color=C._color,_._count=C._count}function k(_){for(var C,M,p,P,T=_.length-1;T>=0;--T){if(C=_[T],T===0){C._color=o;return}if(M=_[T-1],M.left===C){if(p=M.right,p.right&&p.right._color===a){if(p=M.right=l(p),P=p.right=l(p.right),M.right=p.left,p.left=M,p.right=P,p._color=M._color,C._color=o,M._color=o,P._color=o,c(M),c(p),T>1){var F=_[T-2];F.left===M?F.left=p:F.right=p}_[T-1]=p;return}else if(p.left&&p.left._color===a){if(p=M.right=l(p),P=p.left=l(p.left),M.right=P.left,p.left=P.right,P.left=M,P.right=p,P._color=M._color,M._color=o,p._color=o,C._color=o,c(M),c(p),c(P),T>1){var F=_[T-2];F.left===M?F.left=P:F.right=P}_[T-1]=P;return}if(p._color===o)if(M._color===a){M._color=o,M.right=u(a,p);return}else{M.right=u(a,p);continue}else{if(p=l(p),M.right=p.left,p.left=M,p._color=M._color,M._color=a,c(M),c(p),T>1){var F=_[T-2];F.left===M?F.left=p:F.right=p}_[T-1]=p,_[T]=M,T+1<_.length?_[T+1]=C:_.push(C),T=T+2}}else{if(p=M.left,p.left&&p.left._color===a){if(p=M.left=l(p),P=p.left=l(p.left),M.left=p.right,p.right=M,p.left=P,p._color=M._color,C._color=o,M._color=o,P._color=o,c(M),c(p),T>1){var F=_[T-2];F.right===M?F.right=p:F.left=p}_[T-1]=p;return}else if(p.right&&p.right._color===a){if(p=M.left=l(p),P=p.right=l(p.right),M.left=P.right,p.right=P.left,P.right=M,P.left=p,P._color=M._color,M._color=o,p._color=o,C._color=o,c(M),c(p),c(P),T>1){var F=_[T-2];F.right===M?F.right=P:F.left=P}_[T-1]=P;return}if(p._color===o)if(M._color===a){M._color=o,M.left=u(a,p);return}else{M.left=u(a,p);continue}else{if(p=l(p),M.left=p.right,p.right=M,p._color=M._color,M._color=a,c(M),c(p),T>1){var F=_[T-2];F.right===M?F.right=p:F.left=p}_[T-1]=p,_[T]=M,T+1<_.length?_[T+1]=C:_.push(C),T=T+2}}}}g.remove=function(){var _=this._stack;if(_.length===0)return this.tree;var C=new Array(_.length),M=_[_.length-1];C[C.length-1]=new s(M._color,M.key,M.value,M.left,M.right,M._count);for(var p=_.length-2;p>=0;--p){var M=_[p];M.left===_[p+1]?C[p]=new s(M._color,M.key,M.value,C[p+1],M.right,M._count):C[p]=new s(M._color,M.key,M.value,M.left,C[p+1],M._count)}if(M=C[C.length-1],M.left&&M.right){var P=C.length;for(M=M.left;M.right;)C.push(M),M=M.right;var T=C[P-1];C.push(new s(M._color,T.key,T.value,M.left,M.right,M._count)),C[P-1].key=M.key,C[P-1].value=M.value;for(var p=C.length-2;p>=P;--p)M=C[p],C[p]=new s(M._color,M.key,M.value,M.left,C[p+1],M._count);C[P-1].left=C[P]}if(M=C[C.length-1],M._color===a){var F=C[C.length-2];F.left===M?F.left=null:F.right===M&&(F.right=null),C.pop();for(var p=0;p0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(g,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(g,"index",{get:function(){var _=0,C=this._stack;if(C.length===0){var M=this.tree.root;return M?M._count:0}else C[C.length-1].left&&(_=C[C.length-1].left._count);for(var p=C.length-2;p>=0;--p)C[p+1]===C[p].right&&(++_,C[p].left&&(_+=C[p].left._count));return _},enumerable:!0}),g.next=function(){var _=this._stack;if(_.length!==0){var C=_[_.length-1];if(C.right)for(C=C.right;C;)_.push(C),C=C.left;else for(_.pop();_.length>0&&_[_.length-1].right===C;)C=_[_.length-1],_.pop()}},Object.defineProperty(g,"hasNext",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].right)return!0;for(var C=_.length-1;C>0;--C)if(_[C-1].left===_[C])return!0;return!1}}),g.update=function(_){var C=this._stack;if(C.length===0)throw new Error("Can't update empty node!");var M=new Array(C.length),p=C[C.length-1];M[M.length-1]=new s(p._color,p.key,_,p.left,p.right,p._count);for(var P=C.length-2;P>=0;--P)p=C[P],p.left===C[P+1]?M[P]=new s(p._color,p.key,p.value,M[P+1],p.right,p._count):M[P]=new s(p._color,p.key,p.value,p.left,M[P+1],p._count);return new f(this.tree._compare,M[0])},g.prev=function(){var _=this._stack;if(_.length!==0){var C=_[_.length-1];if(C.left)for(C=C.left;C;)_.push(C),C=C.right;else for(_.pop();_.length>0&&_[_.length-1].left===C;)C=_[_.length-1],_.pop()}},Object.defineProperty(g,"hasPrev",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].left)return!0;for(var C=_.length-1;C>0;--C)if(_[C-1].right===_[C])return!0;return!1}});function A(_,C){return _C?1:0}function L(_){return new f(_||A,null)}},3837:function(i,a,o){"use strict";i.exports=q;var s=o(4935),l=o(501),u=o(5304),c=o(6429),f=o(6444),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=ArrayBuffer,v=DataView;function x(V){return d.isView(V)&&!(V instanceof v)}function b(V){return Array.isArray(V)||x(V)}function g(V,H){return V[0]=H[0],V[1]=H[1],V[2]=H[2],V}function E(V){this.gl=V,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=u(V)}var k=E.prototype;k.update=function(V){V=V||{};function H(Ae,ze,Ce){if(Ce in V){var me=V[Ce],Re=this[Ce],ce;(Ae?b(me)&&b(me[0]):b(me))?this[Ce]=ce=[ze(me[0]),ze(me[1]),ze(me[2])]:this[Ce]=ce=[ze(me),ze(me),ze(me)];for(var Ge=0;Ge<3;++Ge)if(ce[Ge]!==Re[Ge])return!0}return!1}var X=H.bind(this,!1,Number),G=H.bind(this,!1,Boolean),N=H.bind(this,!1,String),W=H.bind(this,!0,function(Ae){if(b(Ae)){if(Ae.length===3)return[+Ae[0],+Ae[1],+Ae[2],1];if(Ae.length===4)return[+Ae[0],+Ae[1],+Ae[2],+Ae[3]]}return[0,0,0,1]}),re,ae=!1,_e=!1;if("bounds"in V)for(var Me=V.bounds,ke=0;ke<2;++ke)for(var ge=0;ge<3;++ge)Me[ke][ge]!==this.bounds[ke][ge]&&(_e=!0),this.bounds[ke][ge]=Me[ke][ge];if("ticks"in V){re=V.ticks,ae=!0,this.autoTicks=!1;for(var ke=0;ke<3;++ke)this.tickSpacing[ke]=0}else X("tickSpacing")&&(this.autoTicks=!0,_e=!0);if(this._firstInit&&("ticks"in V||"tickSpacing"in V||(this.autoTicks=!0),_e=!0,ae=!0,this._firstInit=!1),_e&&this.autoTicks&&(re=f.create(this.bounds,this.tickSpacing),ae=!0),ae){for(var ke=0;ke<3;++ke)re[ke].sort(function(ze,Ce){return ze.x-Ce.x});f.equal(re,this.ticks)?ae=!1:this.ticks=re}G("tickEnable"),N("tickFont")&&(ae=!0),N("tickFontStyle")&&(ae=!0),N("tickFontWeight")&&(ae=!0),N("tickFontVariant")&&(ae=!0),X("tickSize"),X("tickAngle"),X("tickPad"),W("tickColor");var ie=N("labels");N("labelFont")&&(ie=!0),N("labelFontStyle")&&(ie=!0),N("labelFontWeight")&&(ie=!0),N("labelFontVariant")&&(ie=!0),G("labelEnable"),X("labelSize"),X("labelPad"),W("labelColor"),G("lineEnable"),G("lineMirror"),X("lineWidth"),W("lineColor"),G("lineTickEnable"),G("lineTickMirror"),X("lineTickLength"),X("lineTickWidth"),W("lineTickColor"),G("gridEnable"),X("gridWidth"),W("gridColor"),G("zeroEnable"),W("zeroLineColor"),X("zeroLineWidth"),G("backgroundEnable"),W("backgroundColor");var Te=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],Ee=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(ie||ae)&&this._text.update(this.bounds,this.labels,Te,this.ticks,Ee):this._text=s(this.gl,this.bounds,this.labels,Te,this.ticks,Ee),this._lines&&ae&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=l(this.gl,this.bounds,this.ticks))};function A(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var L=[new A,new A,new A];function _(V,H,X,G,N){for(var W=V.primalOffset,re=V.primalMinor,ae=V.mirrorOffset,_e=V.mirrorMinor,Me=G[H],ke=0;ke<3;++ke)if(H!==ke){var ge=W,ie=ae,Te=re,Ee=_e;Me&1<0?(Te[ke]=-1,Ee[ke]=0):(Te[ke]=0,Ee[ke]=1)}}var C=[0,0,0],M={model:h,view:h,projection:h,_ortho:!1};k.isOpaque=function(){return!0},k.isTransparent=function(){return!1},k.drawTransparent=function(V){};var p=0,P=[0,0,0],T=[0,0,0],F=[0,0,0];k.draw=function(V){V=V||M;for(var Ce=this.gl,H=V.model||h,X=V.view||h,G=V.projection||h,N=this.bounds,W=V._ortho||!1,re=c(H,X,G,N,W),ae=re.cubeEdges,_e=re.axis,Me=X[12],ke=X[13],ge=X[14],ie=X[15],Te=W?2:1,Ee=Te*this.pixelRatio*(G[3]*Me+G[7]*ke+G[11]*ge+G[15]*ie)/Ce.drawingBufferHeight,Ae=0;Ae<3;++Ae)this.lastCubeProps.cubeEdges[Ae]=ae[Ae],this.lastCubeProps.axis[Ae]=_e[Ae];for(var ze=L,Ae=0;Ae<3;++Ae)_(L[Ae],Ae,this.bounds,ae,_e);for(var Ce=this.gl,me=C,Ae=0;Ae<3;++Ae)this.backgroundEnable[Ae]?me[Ae]=_e[Ae]:me[Ae]=0;this._background.draw(H,X,G,N,me,this.backgroundColor),this._lines.bind(H,X,G,this);for(var Ae=0;Ae<3;++Ae){var Re=[0,0,0];_e[Ae]>0?Re[Ae]=N[1][Ae]:Re[Ae]=N[0][Ae];for(var ce=0;ce<2;++ce){var Ge=(Ae+1+ce)%3,nt=(Ae+1+(ce^1))%3;this.gridEnable[Ge]&&this._lines.drawGrid(Ge,nt,this.bounds,Re,this.gridColor[Ge],this.gridWidth[Ge]*this.pixelRatio)}for(var ce=0;ce<2;++ce){var Ge=(Ae+1+ce)%3,nt=(Ae+1+(ce^1))%3;this.zeroEnable[nt]&&Math.min(N[0][nt],N[1][nt])<=0&&Math.max(N[0][nt],N[1][nt])>=0&&this._lines.drawZero(Ge,nt,this.bounds,Re,this.zeroLineColor[nt],this.zeroLineWidth[nt]*this.pixelRatio)}}for(var Ae=0;Ae<3;++Ae){this.lineEnable[Ae]&&this._lines.drawAxisLine(Ae,this.bounds,ze[Ae].primalOffset,this.lineColor[Ae],this.lineWidth[Ae]*this.pixelRatio),this.lineMirror[Ae]&&this._lines.drawAxisLine(Ae,this.bounds,ze[Ae].mirrorOffset,this.lineColor[Ae],this.lineWidth[Ae]*this.pixelRatio);for(var ct=g(P,ze[Ae].primalMinor),qt=g(T,ze[Ae].mirrorMinor),rt=this.lineTickLength,ce=0;ce<3;++ce){var ot=Ee/H[5*ce];ct[ce]*=rt[ce]*ot,qt[ce]*=rt[ce]*ot}this.lineTickEnable[Ae]&&this._lines.drawAxisTicks(Ae,ze[Ae].primalOffset,ct,this.lineTickColor[Ae],this.lineTickWidth[Ae]*this.pixelRatio),this.lineTickMirror[Ae]&&this._lines.drawAxisTicks(Ae,ze[Ae].mirrorOffset,qt,this.lineTickColor[Ae],this.lineTickWidth[Ae]*this.pixelRatio)}this._lines.unbind(),this._text.bind(H,X,G,this.pixelRatio);var Rt,kt=.5,Ct,Yt;function xr(St){Yt=[0,0,0],Yt[St]=1}function er(St,Et,dt){var Ht=(St+1)%3,$t=(St+2)%3,fr=Et[Ht],_r=Et[$t],Br=dt[Ht],Or=dt[$t];if(fr>0&&Or>0){xr(Ht);return}else if(fr>0&&Or<0){xr(Ht);return}else if(fr<0&&Or>0){xr(Ht);return}else if(fr<0&&Or<0){xr(Ht);return}else if(_r>0&&Br>0){xr($t);return}else if(_r>0&&Br<0){xr($t);return}else if(_r<0&&Br>0){xr($t);return}else if(_r<0&&Br<0){xr($t);return}}for(var Ae=0;Ae<3;++Ae){for(var Ke=ze[Ae].primalMinor,xt=ze[Ae].mirrorMinor,bt=g(F,ze[Ae].primalOffset),ce=0;ce<3;++ce)this.lineTickEnable[Ae]&&(bt[ce]+=Ee*Ke[ce]*Math.max(this.lineTickLength[ce],0)/H[5*ce]);var Lt=[0,0,0];if(Lt[Ae]=1,this.tickEnable[Ae]){this.tickAngle[Ae]===-3600?(this.tickAngle[Ae]=0,this.tickAlign[Ae]="auto"):this.tickAlign[Ae]=-1,Ct=1,Rt=[this.tickAlign[Ae],kt,Ct],Rt[0]==="auto"?Rt[0]=p:Rt[0]=parseInt(""+Rt[0]),Yt=[0,0,0],er(Ae,Ke,xt);for(var ce=0;ce<3;++ce)bt[ce]+=Ee*Ke[ce]*this.tickPad[ce]/H[5*ce];this._text.drawTicks(Ae,this.tickSize[Ae],this.tickAngle[Ae],bt,this.tickColor[Ae],Lt,Yt,Rt)}if(this.labelEnable[Ae]){Ct=0,Yt=[0,0,0],this.labels[Ae].length>4&&(xr(Ae),Ct=1),Rt=[this.labelAlign[Ae],kt,Ct],Rt[0]==="auto"?Rt[0]=p:Rt[0]=parseInt(""+Rt[0]);for(var ce=0;ce<3;++ce)bt[ce]+=Ee*Ke[ce]*this.labelPad[ce]/H[5*ce];bt[Ae]+=.5*(N[0][Ae]+N[1][Ae]),this._text.drawLabel(Ae,this.labelSize[Ae],this.labelAngle[Ae],bt,this.labelColor[Ae],[0,0,0],Yt,Rt)}}this._text.unbind()},k.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function q(V,H){var X=new E(V);return X.update(H),X}},5304:function(i,a,o){"use strict";i.exports=h;var s=o(2762),l=o(8116),u=o(1879).bg;function c(d,v,x,b){this.gl=d,this.buffer=v,this.vao=x,this.shader=b}var f=c.prototype;f.draw=function(d,v,x,b,g,E){for(var k=!1,A=0;A<3;++A)k=k||g[A];if(k){var L=this.gl;L.enable(L.POLYGON_OFFSET_FILL),L.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:d,view:v,projection:x,bounds:b,enable:g,colors:E},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),L.disable(L.POLYGON_OFFSET_FILL)}},f.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function h(d){for(var v=[],x=[],b=0,g=0;g<3;++g)for(var E=(g+1)%3,k=(g+2)%3,A=[0,0,0],L=[0,0,0],_=-1;_<=1;_+=2){x.push(b,b+2,b+1,b+1,b+2,b+3),A[g]=_,L[g]=_;for(var C=-1;C<=1;C+=2){A[E]=C;for(var M=-1;M<=1;M+=2)A[k]=M,v.push(A[0],A[1],A[2],L[0],L[1],L[2]),b+=1}var p=E;E=k,k=p}var P=s(d,new Float32Array(v)),T=s(d,new Uint16Array(x),d.ELEMENT_ARRAY_BUFFER),F=l(d,[{buffer:P,type:d.FLOAT,size:3,offset:0,stride:24},{buffer:P,type:d.FLOAT,size:3,offset:12,stride:24}],T),q=u(d);return q.attributes.position.location=0,q.attributes.normal.location=1,new c(d,P,F,q)}},6429:function(i,a,o){"use strict";i.exports=_;var s=o(8828),l=o(6760),u=o(5202),c=o(3250),f=new Array(16),h=new Array(8),d=new Array(8),v=new Array(3),x=[0,0,0];(function(){for(var C=0;C<8;++C)h[C]=[1,1,1,1],d[C]=[1,1,1]})();function b(C,M,p){for(var P=0;P<4;++P){C[P]=p[12+P];for(var T=0;T<3;++T)C[P]+=M[T]*p[4*T+P]}}var g=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function E(C){for(var M=0;M_e&&(X|=1<_e){X|=1<d[q][1])&&(ze=q);for(var Ce=-1,q=0;q<3;++q){var me=ze^1<d[Re][0]&&(Re=me)}}var ce=k;ce[0]=ce[1]=ce[2]=0,ce[s.log2(Ce^ze)]=ze&Ce,ce[s.log2(ze^Re)]=zeℜvar Ge=Re^7;Ge===X||Ge===Ae?(Ge=Ce^7,ce[s.log2(Re^Ge)]=Ge&Re):ce[s.log2(Ce^Ge)]=Ge&Ce;for(var nt=A,ct=X,W=0;W<3;++W)ct&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?
+ b - PI :
+ b;
+}
+
+float look_horizontal_or_vertical(float a, float ratio) {
+ // ratio controls the ratio between being horizontal to (vertical + horizontal)
+ // if ratio is set to 0.5 then it is 50%, 50%.
+ // when using a higher ratio e.g. 0.75 the result would
+ // likely be more horizontal than vertical.
+
+ float b = positive_angle(a);
+
+ return
+ (b < ( ratio) * HALF_PI) ? 0.0 :
+ (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :
+ (b < (2.0 + ratio) * HALF_PI) ? 0.0 :
+ (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :
+ 0.0;
+}
+
+float roundTo(float a, float b) {
+ return float(b * floor((a + 0.5 * b) / b));
+}
+
+float look_round_n_directions(float a, int n) {
+ float b = positive_angle(a);
+ float div = TWO_PI / float(n);
+ float c = roundTo(b, div);
+ return look_upwards(c);
+}
+
+float applyAlignOption(float rawAngle, float delta) {
+ return
+ (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions
+ (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical
+ (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis
+ (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards
+ (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal
+ rawAngle; // otherwise return back raw input angle
+}
+
+bool isAxisTitle = (axis.x == 0.0) &&
+ (axis.y == 0.0) &&
+ (axis.z == 0.0);
+
+void main() {
+ //Compute world offset
+ float axisDistance = position.z;
+ vec3 dataPosition = axisDistance * axis + offset;
+
+ float beta = angle; // i.e. user defined attributes for each tick
+
+ float axisAngle;
+ float clipAngle;
+ float flip;
+
+ if (enableAlign) {
+ axisAngle = (isAxisTitle) ? HALF_PI :
+ computeViewAngle(dataPosition, dataPosition + axis);
+ clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);
+
+ axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;
+ clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;
+
+ flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),
+ vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;
+
+ beta += applyAlignOption(clipAngle, flip * PI);
+ }
+
+ //Compute plane offset
+ vec2 planeCoord = position.xy * pixelScale;
+
+ mat2 planeXform = scale * mat2(
+ cos(beta), sin(beta),
+ -sin(beta), cos(beta)
+ );
+
+ vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;
+
+ //Compute clip position
+ vec3 clipPosition = project(dataPosition);
+
+ //Apply text offset in clip coordinates
+ clipPosition += vec3(viewOffset, 0.0);
+
+ //Done
+ gl_Position = vec4(clipPosition, 1.0);
+}
+`]),h=s([`precision highp float;
+#define GLSLIFY 1
+
+uniform vec4 color;
+void main() {
+ gl_FragColor = color;
+}`]);a.Q=function(x){return l(x,f,h,null,[{name:"position",type:"vec3"}])};var d=s([`precision highp float;
+#define GLSLIFY 1
+
+attribute vec3 position;
+attribute vec3 normal;
+
+uniform mat4 model, view, projection;
+uniform vec3 enable;
+uniform vec3 bounds[2];
+
+varying vec3 colorChannel;
+
+void main() {
+
+ vec3 signAxis = sign(bounds[1] - bounds[0]);
+
+ vec3 realNormal = signAxis * normal;
+
+ if(dot(realNormal, enable) > 0.0) {
+ vec3 minRange = min(bounds[0], bounds[1]);
+ vec3 maxRange = max(bounds[0], bounds[1]);
+ vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));
+ gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));
+ } else {
+ gl_Position = vec4(0,0,0,0);
+ }
+
+ colorChannel = abs(realNormal);
+}
+`]),v=s([`precision highp float;
+#define GLSLIFY 1
+
+uniform vec4 colors[3];
+
+varying vec3 colorChannel;
+
+void main() {
+ gl_FragColor = colorChannel.x * colors[0] +
+ colorChannel.y * colors[1] +
+ colorChannel.z * colors[2];
+}`]);a.bg=function(x){return l(x,d,v,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(i,a,o){"use strict";i.exports=E;var s=o(2762),l=o(8116),u=o(4359),c=o(1879).Q,f=window||process.global||{},h=f.__TEXT_CACHE||{};f.__TEXT_CACHE={};var d=3;function v(k,A,L,_){this.gl=k,this.shader=A,this.buffer=L,this.vao=_,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var x=v.prototype,b=[0,0];x.bind=function(k,A,L,_){this.vao.bind(),this.shader.bind();var C=this.shader.uniforms;C.model=k,C.view=A,C.projection=L,C.pixelScale=_,b[0]=this.gl.drawingBufferWidth,b[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=b},x.unbind=function(){this.vao.unbind()},x.update=function(k,A,L,_,C){var M=[];function p(W,re,ae,_e,Me,ke){var ge=[ae.style,ae.weight,ae.variant,ae.family].join("_"),ie=h[ge];ie||(ie=h[ge]={});var Te=ie[re];Te||(Te=ie[re]=g(re,{triangles:!0,font:ae.family,fontStyle:ae.style,fontWeight:ae.weight,fontVariant:ae.variant,textAlign:"center",textBaseline:"middle",lineSpacing:Me,styletags:ke}));for(var Ee=(_e||12)/12,Ae=Te.positions,ze=Te.cells,Ce=0,me=ze.length;Ce=0;--ce){var Ge=Ae[Re[ce]];M.push(Ee*Ge[0],-Ee*Ge[1],W)}}for(var P=[0,0,0],T=[0,0,0],F=[0,0,0],q=[0,0,0],V=1.25,H={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},X=0;X<3;++X){F[X]=M.length/d|0,p(.5*(k[0][X]+k[1][X]),A[X],L[X],12,V,H),q[X]=(M.length/d|0)-F[X],P[X]=M.length/d|0;for(var G=0;G<_[X].length;++G)if(_[X][G].text){var N={family:_[X][G].font||C[X].family,style:C[X].fontStyle||C[X].style,weight:C[X].fontWeight||C[X].weight,variant:C[X].fontVariant||C[X].variant};p(_[X][G].x,_[X][G].text,N,_[X][G].fontSize||12,V,H)}T[X]=(M.length/d|0)-P[X]}this.buffer.update(M),this.tickOffset=P,this.tickCount=T,this.labelOffset=F,this.labelCount=q},x.drawTicks=function(k,A,L,_,C,M,p,P){this.tickCount[k]&&(this.shader.uniforms.axis=M,this.shader.uniforms.color=C,this.shader.uniforms.angle=L,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=p,this.shader.uniforms.alignOpt=P,this.vao.draw(this.gl.TRIANGLES,this.tickCount[k],this.tickOffset[k]))},x.drawLabel=function(k,A,L,_,C,M,p,P){this.labelCount[k]&&(this.shader.uniforms.axis=M,this.shader.uniforms.color=C,this.shader.uniforms.angle=L,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=p,this.shader.uniforms.alignOpt=P,this.vao.draw(this.gl.TRIANGLES,this.labelCount[k],this.labelOffset[k]))},x.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function g(k,A){try{return u(k,A)}catch(L){return console.warn('error vectorizing text:"'+k+'" error:',L),{cells:[],positions:[]}}}function E(k,A,L,_,C,M){var p=s(k),P=l(k,[{buffer:p,size:3}]),T=c(k);T.attributes.position.location=0;var F=new v(k,T,p,P);return F.update(A,L,_,C,M),F}},6444:function(i,a){"use strict";a.create=s,a.equal=l;function o(u,c){var f=u+"",h=f.indexOf("."),d=0;h>=0&&(d=f.length-h-1);var v=Math.pow(10,d),x=Math.round(u*c*v),b=x+"";if(b.indexOf("e")>=0)return b;var g=x/v,E=x%v;x<0?(g=-Math.ceil(g)|0,E=-E|0):(g=Math.floor(g)|0,E=E|0);var k=""+g;if(x<0&&(k="-"+k),d){for(var A=""+E;A.length=u[0][h];--x)d.push({x:x*c[h],text:o(c[h],x)});f.push(d)}return f}function l(u,c){for(var f=0;f<3;++f){if(u[f].length!==c[f].length)return!1;for(var h=0;hk)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return g.bufferSubData(E,_,L),k}function v(g,E){for(var k=s.malloc(g.length,E),A=g.length,L=0;L=0;--A){if(E[A]!==k)return!1;k*=g[A]}return!0}h.update=function(g,E){if(typeof E!="number"&&(E=-1),this.bind(),typeof g=="object"&&typeof g.shape!="undefined"){var k=g.dtype;if(c.indexOf(k)<0&&(k="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var A=gl.getExtension("OES_element_index_uint");A&&k!=="uint16"?k="uint32":k="uint16"}if(k===g.dtype&&x(g.shape,g.stride))g.offset===0&&g.data.length===g.shape[0]?this.length=d(this.gl,this.type,this.length,this.usage,g.data,E):this.length=d(this.gl,this.type,this.length,this.usage,g.data.subarray(g.offset,g.shape[0]),E);else{var L=s.malloc(g.size,k),_=u(L,g.shape);l.assign(_,g),E<0?this.length=d(this.gl,this.type,this.length,this.usage,L,E):this.length=d(this.gl,this.type,this.length,this.usage,L.subarray(0,g.size),E),s.free(L)}}else if(Array.isArray(g)){var C;this.type===this.gl.ELEMENT_ARRAY_BUFFER?C=v(g,"uint16"):C=v(g,"float32"),E<0?this.length=d(this.gl,this.type,this.length,this.usage,C,E):this.length=d(this.gl,this.type,this.length,this.usage,C.subarray(0,g.length),E),s.free(C)}else if(typeof g=="object"&&typeof g.length=="number")this.length=d(this.gl,this.type,this.length,this.usage,g,E);else if(typeof g=="number"||g===void 0){if(E>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");g=g|0,g<=0&&(g=1),this.gl.bufferData(this.type,g|0,this.usage),this.length=g}else throw new Error("gl-buffer: Invalid data type")};function b(g,E,k,A){if(k=k||g.ARRAY_BUFFER,A=A||g.DYNAMIC_DRAW,k!==g.ARRAY_BUFFER&&k!==g.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(A!==g.DYNAMIC_DRAW&&A!==g.STATIC_DRAW&&A!==g.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var L=g.createBuffer(),_=new f(g,k,L,0,A);return _.update(E),_}i.exports=b},6405:function(i,a,o){"use strict";var s=o(2931);i.exports=function(u,c){var f=u.positions,h=u.vectors,d={positions:[],vertexIntensity:[],vertexIntensityBounds:u.vertexIntensityBounds,vectors:[],cells:[],coneOffset:u.coneOffset,colormap:u.colormap};if(u.positions.length===0)return c&&(c[0]=[0,0,0],c[1]=[0,0,0]),d;for(var v=0,x=1/0,b=-1/0,g=1/0,E=-1/0,k=1/0,A=-1/0,L=null,_=null,C=[],M=1/0,p=!1,P=u.coneSizemode==="raw",T=0;Tv&&(v=s.length(q)),T&&!P){var V=2*s.distance(L,F)/(s.length(_)+s.length(q));V?(M=Math.min(M,V),p=!1):p=!0}p||(L=F,_=q),C.push(q)}var H=[x,g,k],X=[b,E,A];c&&(c[0]=H,c[1]=X),v===0&&(v=1);var G=1/v;isFinite(M)||(M=1),d.vectorScale=M;var N=u.coneSize||(P?1:.5);u.absoluteConeSize&&(N=u.absoluteConeSize*G),d.coneScale=N;for(var T=0,W=0;T=1},g.isTransparent=function(){return this.opacity<1},g.pickSlots=1,g.setPickBase=function(C){this.pickId=C};function E(C){for(var M=v({colormap:C,nshades:256,format:"rgba"}),p=new Uint8Array(256*4),P=0;P<256;++P){for(var T=M[P],F=0;F<3;++F)p[4*P+F]=T[F];p[4*P+3]=T[3]*255}return d(p,[256,256,4],[4,0,1])}function k(C){for(var M=C.length,p=new Array(M),P=0;P0){var W=this.triShader;W.bind(),W.uniforms=V,this.triangleVAO.bind(),M.drawArrays(M.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},g.drawPick=function(C){C=C||{};for(var M=this.gl,p=C.model||x,P=C.view||x,T=C.projection||x,F=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],q=0;q<3;++q)F[0][q]=Math.max(F[0][q],this.clipBounds[0][q]),F[1][q]=Math.min(F[1][q],this.clipBounds[1][q]);this._model=[].slice.call(p),this._view=[].slice.call(P),this._projection=[].slice.call(T),this._resolution=[M.drawingBufferWidth,M.drawingBufferHeight];var V={model:p,view:P,projection:T,clipBounds:F,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},H=this.pickShader;H.bind(),H.uniforms=V,this.triangleCount>0&&(this.triangleVAO.bind(),M.drawArrays(M.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},g.pick=function(C){if(!C||C.id!==this.pickId)return null;var M=C.value[0]+256*C.value[1]+65536*C.value[2],p=this.cells[M],P=this.positions[p[1]].slice(0,3),T={position:P,dataCoordinate:P,index:Math.floor(p[1]/48)};return this.traceType==="cone"?T.index=Math.floor(p[1]/48):this.traceType==="streamtube"&&(T.intensity=this.intensity[p[1]],T.velocity=this.vectors[p[1]].slice(0,3),T.divergence=this.vectors[p[1]][3],T.index=M),T},g.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()};function A(C,M){var p=s(C,M.meshShader.vertex,M.meshShader.fragment,null,M.meshShader.attributes);return p.attributes.position.location=0,p.attributes.color.location=2,p.attributes.uv.location=3,p.attributes.vector.location=4,p}function L(C,M){var p=s(C,M.pickShader.vertex,M.pickShader.fragment,null,M.pickShader.attributes);return p.attributes.position.location=0,p.attributes.id.location=1,p.attributes.vector.location=4,p}function _(C,M,p){var P=p.shaders;arguments.length===1&&(M=C,C=M.gl);var T=A(C,P),F=L(C,P),q=c(C,d(new Uint8Array([255,255,255,255]),[1,1,4]));q.generateMipmap(),q.minFilter=C.LINEAR_MIPMAP_LINEAR,q.magFilter=C.LINEAR;var V=l(C),H=l(C),X=l(C),G=l(C),N=l(C),W=u(C,[{buffer:V,type:C.FLOAT,size:4},{buffer:N,type:C.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:X,type:C.FLOAT,size:4},{buffer:G,type:C.FLOAT,size:2},{buffer:H,type:C.FLOAT,size:4}]),re=new b(C,q,T,F,V,H,N,X,G,W,p.traceType||"cone");return re.update(M),re}i.exports=_},614:function(i,a,o){var s=o(3236),l=s([`precision highp float;
+
+precision highp float;
+#define GLSLIFY 1
+
+vec3 getOrthogonalVector(vec3 v) {
+ // Return up-vector for only-z vector.
+ // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
+ // From the above if-statement we have ||a|| > 0 U ||b|| > 0.
+ // Assign z = 0, x = -b, y = a:
+ // a*-b + b*a + c*0 = -ba + ba + 0 = 0
+ if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
+ return normalize(vec3(-v.y, v.x, 0.0));
+ } else {
+ return normalize(vec3(0.0, v.z, -v.y));
+ }
+}
+
+// Calculate the cone vertex and normal at the given index.
+//
+// The returned vertex is for a cone with its top at origin and height of 1.0,
+// pointing in the direction of the vector attribute.
+//
+// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.
+// These vertices are used to make up the triangles of the cone by the following:
+// segment + 0 top vertex
+// segment + 1 perimeter vertex a+1
+// segment + 2 perimeter vertex a
+// segment + 3 center base vertex
+// segment + 4 perimeter vertex a
+// segment + 5 perimeter vertex a+1
+// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.
+// To go from index to segment, floor(index / 6)
+// To go from segment to angle, 2*pi * (segment/segmentCount)
+// To go from index to segment index, index - (segment*6)
+//
+vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {
+
+ const float segmentCount = 8.0;
+
+ float index = rawIndex - floor(rawIndex /
+ (segmentCount * 6.0)) *
+ (segmentCount * 6.0);
+
+ float segment = floor(0.001 + index/6.0);
+ float segmentIndex = index - (segment*6.0);
+
+ normal = -normalize(d);
+
+ if (segmentIndex > 2.99 && segmentIndex < 3.01) {
+ return mix(vec3(0.0), -d, coneOffset);
+ }
+
+ float nextAngle = (
+ (segmentIndex > 0.99 && segmentIndex < 1.01) ||
+ (segmentIndex > 4.99 && segmentIndex < 5.01)
+ ) ? 1.0 : 0.0;
+ float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);
+
+ vec3 v1 = mix(d, vec3(0.0), coneOffset);
+ vec3 v2 = v1 - d;
+
+ vec3 u = getOrthogonalVector(d);
+ vec3 v = normalize(cross(u, d));
+
+ vec3 x = u * cos(angle) * length(d)*0.25;
+ vec3 y = v * sin(angle) * length(d)*0.25;
+ vec3 v3 = v2 + x + y;
+ if (segmentIndex < 3.0) {
+ vec3 tx = u * sin(angle);
+ vec3 ty = v * -cos(angle);
+ vec3 tangent = tx + ty;
+ normal = normalize(cross(v3 - v1, tangent));
+ }
+
+ if (segmentIndex == 0.0) {
+ return mix(d, vec3(0.0), coneOffset);
+ }
+ return v3;
+}
+
+attribute vec3 vector;
+attribute vec4 color, position;
+attribute vec2 uv;
+
+uniform float vectorScale, coneScale, coneOffset;
+uniform mat4 model, view, projection, inverseModel;
+uniform vec3 eyePosition, lightPosition;
+
+varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
+varying vec4 f_color;
+varying vec2 f_uv;
+
+void main() {
+ // Scale the vector magnitude to stay constant with
+ // model & view changes.
+ vec3 normal;
+ vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);
+ vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
+
+ //Lighting geometry parameters
+ vec4 cameraCoordinate = view * conePosition;
+ cameraCoordinate.xyz /= cameraCoordinate.w;
+ f_lightDirection = lightPosition - cameraCoordinate.xyz;
+ f_eyeDirection = eyePosition - cameraCoordinate.xyz;
+ f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
+
+ // vec4 m_position = model * vec4(conePosition, 1.0);
+ vec4 t_position = view * conePosition;
+ gl_Position = projection * t_position;
+
+ f_color = color;
+ f_data = conePosition.xyz;
+ f_position = position.xyz;
+ f_uv = uv;
+}
+`]),u=s([`#extension GL_OES_standard_derivatives : enable
+
+precision highp float;
+#define GLSLIFY 1
+
+float beckmannDistribution(float x, float roughness) {
+ float NdotH = max(x, 0.0001);
+ float cos2Alpha = NdotH * NdotH;
+ float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
+ float roughness2 = roughness * roughness;
+ float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
+ return exp(tan2Alpha / roughness2) / denom;
+}
+
+float cookTorranceSpecular(
+ vec3 lightDirection,
+ vec3 viewDirection,
+ vec3 surfaceNormal,
+ float roughness,
+ float fresnel) {
+
+ float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
+ float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
+
+ //Half angle vector
+ vec3 H = normalize(lightDirection + viewDirection);
+
+ //Geometric term
+ float NdotH = max(dot(surfaceNormal, H), 0.0);
+ float VdotH = max(dot(viewDirection, H), 0.000001);
+ float LdotH = max(dot(lightDirection, H), 0.000001);
+ float G1 = (2.0 * NdotH * VdotN) / VdotH;
+ float G2 = (2.0 * NdotH * LdotN) / LdotH;
+ float G = min(1.0, min(G1, G2));
+
+ //Distribution term
+ float D = beckmannDistribution(NdotH, roughness);
+
+ //Fresnel term
+ float F = pow(1.0 - VdotN, fresnel);
+
+ //Multiply terms and done
+ return G * F * D / max(3.14159265 * VdotN, 0.000001);
+}
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform vec3 clipBounds[2];
+uniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;
+uniform sampler2D texture;
+
+varying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;
+varying vec4 f_color;
+varying vec2 f_uv;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
+ vec3 N = normalize(f_normal);
+ vec3 L = normalize(f_lightDirection);
+ vec3 V = normalize(f_eyeDirection);
+
+ if(gl_FrontFacing) {
+ N = -N;
+ }
+
+ float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
+ float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
+
+ vec4 surfaceColor = f_color * texture2D(texture, f_uv);
+ vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
+
+ gl_FragColor = litColor * opacity;
+}
+`]),c=s([`precision highp float;
+
+precision highp float;
+#define GLSLIFY 1
+
+vec3 getOrthogonalVector(vec3 v) {
+ // Return up-vector for only-z vector.
+ // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).
+ // From the above if-statement we have ||a|| > 0 U ||b|| > 0.
+ // Assign z = 0, x = -b, y = a:
+ // a*-b + b*a + c*0 = -ba + ba + 0 = 0
+ if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {
+ return normalize(vec3(-v.y, v.x, 0.0));
+ } else {
+ return normalize(vec3(0.0, v.z, -v.y));
+ }
+}
+
+// Calculate the cone vertex and normal at the given index.
+//
+// The returned vertex is for a cone with its top at origin and height of 1.0,
+// pointing in the direction of the vector attribute.
+//
+// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.
+// These vertices are used to make up the triangles of the cone by the following:
+// segment + 0 top vertex
+// segment + 1 perimeter vertex a+1
+// segment + 2 perimeter vertex a
+// segment + 3 center base vertex
+// segment + 4 perimeter vertex a
+// segment + 5 perimeter vertex a+1
+// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.
+// To go from index to segment, floor(index / 6)
+// To go from segment to angle, 2*pi * (segment/segmentCount)
+// To go from index to segment index, index - (segment*6)
+//
+vec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {
+
+ const float segmentCount = 8.0;
+
+ float index = rawIndex - floor(rawIndex /
+ (segmentCount * 6.0)) *
+ (segmentCount * 6.0);
+
+ float segment = floor(0.001 + index/6.0);
+ float segmentIndex = index - (segment*6.0);
+
+ normal = -normalize(d);
+
+ if (segmentIndex > 2.99 && segmentIndex < 3.01) {
+ return mix(vec3(0.0), -d, coneOffset);
+ }
+
+ float nextAngle = (
+ (segmentIndex > 0.99 && segmentIndex < 1.01) ||
+ (segmentIndex > 4.99 && segmentIndex < 5.01)
+ ) ? 1.0 : 0.0;
+ float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);
+
+ vec3 v1 = mix(d, vec3(0.0), coneOffset);
+ vec3 v2 = v1 - d;
+
+ vec3 u = getOrthogonalVector(d);
+ vec3 v = normalize(cross(u, d));
+
+ vec3 x = u * cos(angle) * length(d)*0.25;
+ vec3 y = v * sin(angle) * length(d)*0.25;
+ vec3 v3 = v2 + x + y;
+ if (segmentIndex < 3.0) {
+ vec3 tx = u * sin(angle);
+ vec3 ty = v * -cos(angle);
+ vec3 tangent = tx + ty;
+ normal = normalize(cross(v3 - v1, tangent));
+ }
+
+ if (segmentIndex == 0.0) {
+ return mix(d, vec3(0.0), coneOffset);
+ }
+ return v3;
+}
+
+attribute vec4 vector;
+attribute vec4 position;
+attribute vec4 id;
+
+uniform mat4 model, view, projection;
+uniform float vectorScale, coneScale, coneOffset;
+
+varying vec3 f_position;
+varying vec4 f_id;
+
+void main() {
+ vec3 normal;
+ vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);
+ vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);
+ gl_Position = projection * (view * conePosition);
+ f_id = id;
+ f_position = position.xyz;
+}
+`]),f=s([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform vec3 clipBounds[2];
+uniform float pickId;
+
+varying vec3 f_position;
+varying vec4 f_id;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
+
+ gl_FragColor = vec4(pickId, f_id.xyz);
+}`]);a.meshShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},a.pickShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(i){i.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(i,a,o){var s=o(737);i.exports=function(u){return s[u]}},9165:function(i,a,o){"use strict";i.exports=b;var s=o(2762),l=o(8116),u=o(3436),c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(g,E,k,A){this.gl=g,this.shader=A,this.buffer=E,this.vao=k,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var h=f.prototype;h.isOpaque=function(){return!this.hasAlpha},h.isTransparent=function(){return this.hasAlpha},h.drawTransparent=h.draw=function(g){var E=this.gl,k=this.shader.uniforms;this.shader.bind();var A=k.view=g.view||c,L=k.projection=g.projection||c;k.model=g.model||c,k.clipBounds=this.clipBounds,k.opacity=this.opacity;var _=A[12],C=A[13],M=A[14],p=A[15],P=g._ortho||!1,T=P?2:1,F=T*this.pixelRatio*(L[3]*_+L[7]*C+L[11]*M+L[15]*p)/E.drawingBufferHeight;this.vao.bind();for(var q=0;q<3;++q)E.lineWidth(this.lineWidth[q]*this.pixelRatio),k.capSize=this.capSize[q]*F,this.lineCount[q]&&E.drawArrays(E.LINES,this.lineOffset[q],this.lineCount[q]);this.vao.unbind()};function d(g,E){for(var k=0;k<3;++k)g[0][k]=Math.min(g[0][k],E[k]),g[1][k]=Math.max(g[1][k],E[k])}var v=function(){for(var g=new Array(3),E=0;E<3;++E){for(var k=[],A=1;A<=2;++A)for(var L=-1;L<=1;L+=2){var _=(A+E)%3,C=[0,0,0];C[_]=L,k.push(C)}g[E]=k}return g}();function x(g,E,k,A){for(var L=v[A],_=0;_0){var V=P.slice();V[M]+=F[1][M],L.push(P[0],P[1],P[2],q[0],q[1],q[2],q[3],0,0,0,V[0],V[1],V[2],q[0],q[1],q[2],q[3],0,0,0),d(this.bounds,V),C+=2+x(L,V,q,M)}}}this.lineCount[M]=C-this.lineOffset[M]}this.buffer.update(L)}},h.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function b(g){var E=g.gl,k=s(E),A=l(E,[{buffer:k,type:E.FLOAT,size:3,offset:0,stride:40},{buffer:k,type:E.FLOAT,size:4,offset:12,stride:40},{buffer:k,type:E.FLOAT,size:3,offset:28,stride:40}]),L=u(E);L.attributes.position.location=0,L.attributes.color.location=1,L.attributes.offset.location=2;var _=new f(E,k,A,L);return _.update(g),_}},3436:function(i,a,o){"use strict";var s=o(3236),l=o(9405),u=s([`precision highp float;
+#define GLSLIFY 1
+
+attribute vec3 position, offset;
+attribute vec4 color;
+uniform mat4 model, view, projection;
+uniform float capSize;
+varying vec4 fragColor;
+varying vec3 fragPosition;
+
+void main() {
+ vec4 worldPosition = model * vec4(position, 1.0);
+ worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);
+ gl_Position = projection * (view * worldPosition);
+ fragColor = color;
+ fragPosition = position;
+}`]),c=s([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform vec3 clipBounds[2];
+uniform float opacity;
+varying vec3 fragPosition;
+varying vec4 fragColor;
+
+void main() {
+ if (
+ outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||
+ fragColor.a * opacity == 0.
+ ) discard;
+
+ gl_FragColor = opacity * fragColor;
+}`]);i.exports=function(f){return l(f,u,c,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(i,a,o){"use strict";var s=o(7766);i.exports=C;var l=null,u,c,f,h;function d(M){var p=M.getParameter(M.FRAMEBUFFER_BINDING),P=M.getParameter(M.RENDERBUFFER_BINDING),T=M.getParameter(M.TEXTURE_BINDING_2D);return[p,P,T]}function v(M,p){M.bindFramebuffer(M.FRAMEBUFFER,p[0]),M.bindRenderbuffer(M.RENDERBUFFER,p[1]),M.bindTexture(M.TEXTURE_2D,p[2])}function x(M,p){var P=M.getParameter(p.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(P+1);for(var T=0;T<=P;++T){for(var F=new Array(P),q=0;q1&&H.drawBuffersWEBGL(l[V]);var re=P.getExtension("WEBGL_depth_texture");re?X?M.depth=g(P,F,q,re.UNSIGNED_INT_24_8_WEBGL,P.DEPTH_STENCIL,P.DEPTH_STENCIL_ATTACHMENT):G&&(M.depth=g(P,F,q,P.UNSIGNED_SHORT,P.DEPTH_COMPONENT,P.DEPTH_ATTACHMENT)):G&&X?M._depth_rb=E(P,F,q,P.DEPTH_STENCIL,P.DEPTH_STENCIL_ATTACHMENT):G?M._depth_rb=E(P,F,q,P.DEPTH_COMPONENT16,P.DEPTH_ATTACHMENT):X&&(M._depth_rb=E(P,F,q,P.STENCIL_INDEX,P.STENCIL_ATTACHMENT));var ae=P.checkFramebufferStatus(P.FRAMEBUFFER);if(ae!==P.FRAMEBUFFER_COMPLETE){M._destroyed=!0,P.bindFramebuffer(P.FRAMEBUFFER,null),P.deleteFramebuffer(M.handle),M.handle=null,M.depth&&(M.depth.dispose(),M.depth=null),M._depth_rb&&(P.deleteRenderbuffer(M._depth_rb),M._depth_rb=null);for(var W=0;WF||P<0||P>F)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");M._shape[0]=p,M._shape[1]=P;for(var q=d(T),V=0;Vq||P<0||P>q)throw new Error("gl-fbo: Parameters are too large for FBO");T=T||{};var V=1;if("color"in T){if(V=Math.max(T.color|0,0),V<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(V>1)if(F){if(V>M.getParameter(F.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+V+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var H=M.UNSIGNED_BYTE,X=M.getExtension("OES_texture_float");if(T.float&&V>0){if(!X)throw new Error("gl-fbo: Context does not support floating point textures");H=M.FLOAT}else T.preferFloat&&V>0&&X&&(H=M.FLOAT);var G=!0;"depth"in T&&(G=!!T.depth);var N=!1;return"stencil"in T&&(N=!!T.stencil),new A(M,p,P,H,V,G,N,F)}},2992:function(i,a,o){var s=o(3387).sprintf,l=o(5171),u=o(1848),c=o(1085);i.exports=f;function f(h,d,v){"use strict";var x=u(d)||"of unknown name (see npm glsl-shader-name)",b="unknown type";v!==void 0&&(b=v===l.FRAGMENT_SHADER?"fragment":"vertex");for(var g=s(`Error compiling %s shader %s:
+`,b,x),E=s("%s%s",g,h),k=h.split(`
+`),A={},L=0;L max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform vec3 clipBounds[2];
+uniform sampler2D dashTexture;
+uniform float dashScale;
+uniform float opacity;
+
+varying vec3 worldPosition;
+varying float pixelArcLength;
+varying vec4 fragColor;
+
+void main() {
+ if (
+ outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||
+ fragColor.a * opacity == 0.
+ ) discard;
+
+ float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;
+ if(dashWeight < 0.5) {
+ discard;
+ }
+ gl_FragColor = fragColor * opacity;
+}
+`]),f=s([`precision highp float;
+#define GLSLIFY 1
+
+#define FLOAT_MAX 1.70141184e38
+#define FLOAT_MIN 1.17549435e-38
+
+// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl
+vec4 packFloat(float v) {
+ float av = abs(v);
+
+ //Handle special cases
+ if(av < FLOAT_MIN) {
+ return vec4(0.0, 0.0, 0.0, 0.0);
+ } else if(v > FLOAT_MAX) {
+ return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;
+ } else if(v < -FLOAT_MAX) {
+ return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;
+ }
+
+ vec4 c = vec4(0,0,0,0);
+
+ //Compute exponent and mantissa
+ float e = floor(log2(av));
+ float m = av * pow(2.0, -e) - 1.0;
+
+ //Unpack mantissa
+ c[1] = floor(128.0 * m);
+ m -= c[1] / 128.0;
+ c[2] = floor(32768.0 * m);
+ m -= c[2] / 32768.0;
+ c[3] = floor(8388608.0 * m);
+
+ //Unpack exponent
+ float ebias = e + 127.0;
+ c[0] = floor(ebias / 2.0);
+ ebias -= c[0] * 2.0;
+ c[1] += floor(ebias) * 128.0;
+
+ //Unpack sign bit
+ c[0] += 128.0 * step(0.0, -v);
+
+ //Scale back to range
+ return c / 255.0;
+}
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform float pickId;
+uniform vec3 clipBounds[2];
+
+varying vec3 worldPosition;
+varying float pixelArcLength;
+varying vec4 fragColor;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;
+
+ gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);
+}`]),h=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];a.createShader=function(d){return l(d,u,c,null,h)},a.createPickShader=function(d){return l(d,u,f,null,h)}},5714:function(i,a,o){"use strict";i.exports=M;var s=o(2762),l=o(8116),u=o(7766),c=new Uint8Array(4),f=new Float32Array(c.buffer);function h(p,P,T,F){return c[0]=F,c[1]=T,c[2]=P,c[3]=p,f[0]}var d=o(2478),v=o(9618),x=o(7319),b=x.createShader,g=x.createPickShader,E=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(p,P){for(var T=0,F=0;F<3;++F){var q=p[F]-P[F];T+=q*q}return Math.sqrt(T)}function A(p){for(var P=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],T=0;T<3;++T)P[0][T]=Math.max(p[0][T],P[0][T]),P[1][T]=Math.min(p[1][T],P[1][T]);return P}function L(p,P,T,F){this.arcLength=p,this.position=P,this.index=T,this.dataCoordinate=F}function _(p,P,T,F,q,V){this.gl=p,this.shader=P,this.pickShader=T,this.buffer=F,this.vao=q,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=V,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var C=_.prototype;C.isTransparent=function(){return this.hasAlpha},C.isOpaque=function(){return!this.hasAlpha},C.pickSlots=1,C.setPickBase=function(p){this.pickId=p},C.drawTransparent=C.draw=function(p){if(this.vertexCount){var P=this.gl,T=this.shader,F=this.vao;T.bind(),T.uniforms={model:p.model||E,view:p.view||E,projection:p.projection||E,clipBounds:A(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[P.drawingBufferWidth,P.drawingBufferHeight],pixelRatio:this.pixelRatio},F.bind(),F.draw(P.TRIANGLE_STRIP,this.vertexCount),F.unbind()}},C.drawPick=function(p){if(this.vertexCount){var P=this.gl,T=this.pickShader,F=this.vao;T.bind(),T.uniforms={model:p.model||E,view:p.view||E,projection:p.projection||E,pickId:this.pickId,clipBounds:A(this.clipBounds),screenShape:[P.drawingBufferWidth,P.drawingBufferHeight],pixelRatio:this.pixelRatio},F.bind(),F.draw(P.TRIANGLE_STRIP,this.vertexCount),F.unbind()}},C.update=function(p){var P,T;this.dirty=!0;var F=!!p.connectGaps;"dashScale"in p&&(this.dashScale=p.dashScale),this.hasAlpha=!1,"opacity"in p&&(this.opacity=+p.opacity,this.opacity<1&&(this.hasAlpha=!0));var q=[],V=[],H=[],X=0,G=0,N=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],W=p.position||p.positions;if(W){var re=p.color||p.colors||[0,0,0,1],ae=p.lineWidth||1,_e=!1;e:for(P=1;P0){for(var ge=0;ge<24;++ge)q.push(q[q.length-12]);G+=2,_e=!0}continue e}N[0][T]=Math.min(N[0][T],Me[T],ke[T]),N[1][T]=Math.max(N[1][T],Me[T],ke[T])}var ie,Te;Array.isArray(re[0])?(ie=re.length>P-1?re[P-1]:re.length>0?re[re.length-1]:[0,0,0,1],Te=re.length>P?re[P]:re.length>0?re[re.length-1]:[0,0,0,1]):ie=Te=re,ie.length===3&&(ie=[ie[0],ie[1],ie[2],1]),Te.length===3&&(Te=[Te[0],Te[1],Te[2],1]),!this.hasAlpha&&ie[3]<1&&(this.hasAlpha=!0);var Ee;Array.isArray(ae)?Ee=ae.length>P-1?ae[P-1]:ae.length>0?ae[ae.length-1]:[0,0,0,1]:Ee=ae;var Ae=X;if(X+=k(Me,ke),_e){for(T=0;T<2;++T)q.push(Me[0],Me[1],Me[2],ke[0],ke[1],ke[2],Ae,Ee,ie[0],ie[1],ie[2],ie[3]);G+=2,_e=!1}q.push(Me[0],Me[1],Me[2],ke[0],ke[1],ke[2],Ae,Ee,ie[0],ie[1],ie[2],ie[3],Me[0],Me[1],Me[2],ke[0],ke[1],ke[2],Ae,-Ee,ie[0],ie[1],ie[2],ie[3],ke[0],ke[1],ke[2],Me[0],Me[1],Me[2],X,-Ee,Te[0],Te[1],Te[2],Te[3],ke[0],ke[1],ke[2],Me[0],Me[1],Me[2],X,Ee,Te[0],Te[1],Te[2],Te[3]),G+=4}}if(this.buffer.update(q),V.push(X),H.push(W[W.length-1].slice()),this.bounds=N,this.vertexCount=G,this.points=H,this.arcLength=V,"dashes"in p){var ze=p.dashes,Ce=ze.slice();for(Ce.unshift(0),P=1;P1.0001)return null;T+=P[L]}return Math.abs(T-1)>.001?null:[_,h(v,P),P]}},840:function(i,a,o){var s=o(3236),l=s([`precision highp float;
+#define GLSLIFY 1
+
+attribute vec3 position, normal;
+attribute vec4 color;
+attribute vec2 uv;
+
+uniform mat4 model
+ , view
+ , projection
+ , inverseModel;
+uniform vec3 eyePosition
+ , lightPosition;
+
+varying vec3 f_normal
+ , f_lightDirection
+ , f_eyeDirection
+ , f_data;
+varying vec4 f_color;
+varying vec2 f_uv;
+
+vec4 project(vec3 p) {
+ return projection * (view * (model * vec4(p, 1.0)));
+}
+
+void main() {
+ gl_Position = project(position);
+
+ //Lighting geometry parameters
+ vec4 cameraCoordinate = view * vec4(position , 1.0);
+ cameraCoordinate.xyz /= cameraCoordinate.w;
+ f_lightDirection = lightPosition - cameraCoordinate.xyz;
+ f_eyeDirection = eyePosition - cameraCoordinate.xyz;
+ f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);
+
+ f_color = color;
+ f_data = position;
+ f_uv = uv;
+}
+`]),u=s([`#extension GL_OES_standard_derivatives : enable
+
+precision highp float;
+#define GLSLIFY 1
+
+float beckmannDistribution(float x, float roughness) {
+ float NdotH = max(x, 0.0001);
+ float cos2Alpha = NdotH * NdotH;
+ float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;
+ float roughness2 = roughness * roughness;
+ float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;
+ return exp(tan2Alpha / roughness2) / denom;
+}
+
+float cookTorranceSpecular(
+ vec3 lightDirection,
+ vec3 viewDirection,
+ vec3 surfaceNormal,
+ float roughness,
+ float fresnel) {
+
+ float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);
+ float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);
+
+ //Half angle vector
+ vec3 H = normalize(lightDirection + viewDirection);
+
+ //Geometric term
+ float NdotH = max(dot(surfaceNormal, H), 0.0);
+ float VdotH = max(dot(viewDirection, H), 0.000001);
+ float LdotH = max(dot(lightDirection, H), 0.000001);
+ float G1 = (2.0 * NdotH * VdotN) / VdotH;
+ float G2 = (2.0 * NdotH * LdotN) / LdotH;
+ float G = min(1.0, min(G1, G2));
+
+ //Distribution term
+ float D = beckmannDistribution(NdotH, roughness);
+
+ //Fresnel term
+ float F = pow(1.0 - VdotN, fresnel);
+
+ //Multiply terms and done
+ return G * F * D / max(3.14159265 * VdotN, 0.000001);
+}
+
+//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform vec3 clipBounds[2];
+uniform float roughness
+ , fresnel
+ , kambient
+ , kdiffuse
+ , kspecular;
+uniform sampler2D texture;
+
+varying vec3 f_normal
+ , f_lightDirection
+ , f_eyeDirection
+ , f_data;
+varying vec4 f_color;
+varying vec2 f_uv;
+
+void main() {
+ if (f_color.a == 0.0 ||
+ outOfRange(clipBounds[0], clipBounds[1], f_data)
+ ) discard;
+
+ vec3 N = normalize(f_normal);
+ vec3 L = normalize(f_lightDirection);
+ vec3 V = normalize(f_eyeDirection);
+
+ if(gl_FrontFacing) {
+ N = -N;
+ }
+
+ float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));
+ //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d
+
+ float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);
+
+ vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);
+ vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);
+
+ gl_FragColor = litColor * f_color.a;
+}
+`]),c=s([`precision highp float;
+#define GLSLIFY 1
+
+attribute vec3 position;
+attribute vec4 color;
+attribute vec2 uv;
+
+uniform mat4 model, view, projection;
+
+varying vec4 f_color;
+varying vec3 f_data;
+varying vec2 f_uv;
+
+void main() {
+ gl_Position = projection * (view * (model * vec4(position, 1.0)));
+ f_color = color;
+ f_data = position;
+ f_uv = uv;
+}`]),f=s([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform vec3 clipBounds[2];
+uniform sampler2D texture;
+uniform float opacity;
+
+varying vec4 f_color;
+varying vec3 f_data;
+varying vec2 f_uv;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;
+
+ gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;
+}`]),h=s([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+attribute vec3 position;
+attribute vec4 color;
+attribute vec2 uv;
+attribute float pointSize;
+
+uniform mat4 model, view, projection;
+uniform vec3 clipBounds[2];
+
+varying vec4 f_color;
+varying vec2 f_uv;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], position)) {
+
+ gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);
+ } else {
+ gl_Position = projection * (view * (model * vec4(position, 1.0)));
+ }
+ gl_PointSize = pointSize;
+ f_color = color;
+ f_uv = uv;
+}`]),d=s([`precision highp float;
+#define GLSLIFY 1
+
+uniform sampler2D texture;
+uniform float opacity;
+
+varying vec4 f_color;
+varying vec2 f_uv;
+
+void main() {
+ vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);
+ if(dot(pointR, pointR) > 0.25) {
+ discard;
+ }
+ gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;
+}`]),v=s([`precision highp float;
+#define GLSLIFY 1
+
+attribute vec3 position;
+attribute vec4 id;
+
+uniform mat4 model, view, projection;
+
+varying vec3 f_position;
+varying vec4 f_id;
+
+void main() {
+ gl_Position = projection * (view * (model * vec4(position, 1.0)));
+ f_id = id;
+ f_position = position;
+}`]),x=s([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform vec3 clipBounds[2];
+uniform float pickId;
+
+varying vec3 f_position;
+varying vec4 f_id;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;
+
+ gl_FragColor = vec4(pickId, f_id.xyz);
+}`]),b=s([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+attribute vec3 position;
+attribute float pointSize;
+attribute vec4 id;
+
+uniform mat4 model, view, projection;
+uniform vec3 clipBounds[2];
+
+varying vec3 f_position;
+varying vec4 f_id;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], position)) {
+
+ gl_Position = vec4(0.0, 0.0, 0.0, 0.0);
+ } else {
+ gl_Position = projection * (view * (model * vec4(position, 1.0)));
+ gl_PointSize = pointSize;
+ }
+ f_id = id;
+ f_position = position;
+}`]),g=s([`precision highp float;
+#define GLSLIFY 1
+
+attribute vec3 position;
+
+uniform mat4 model, view, projection;
+
+void main() {
+ gl_Position = projection * (view * (model * vec4(position, 1.0)));
+}`]),E=s([`precision highp float;
+#define GLSLIFY 1
+
+uniform vec3 contourColor;
+
+void main() {
+ gl_FragColor = vec4(contourColor, 1.0);
+}
+`]);a.meshShader={vertex:l,fragment:u,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},a.wireShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},a.pointShader={vertex:h,fragment:d,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},a.pickShader={vertex:v,fragment:x,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},a.pointPickShader={vertex:b,fragment:x,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},a.contourShader={vertex:g,fragment:E,attributes:[{name:"position",type:"vec3"}]}},7201:function(i,a,o){"use strict";var s=1e-6,l=1e-6,u=o(9405),c=o(2762),f=o(8116),h=o(7766),d=o(8406),v=o(6760),x=o(7608),b=o(9618),g=o(6729),E=o(7765),k=o(1888),A=o(840),L=o(7626),_=A.meshShader,C=A.wireShader,M=A.pointShader,p=A.pickShader,P=A.pointPickShader,T=A.contourShader,F=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function q(ge,ie,Te,Ee,Ae,ze,Ce,me,Re,ce,Ge,nt,ct,qt,rt,ot,Rt,kt,Ct,Yt,xr,er,Ke,xt,bt,Lt,St){this.gl=ge,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=ie,this.dirty=!0,this.triShader=Te,this.lineShader=Ee,this.pointShader=Ae,this.pickShader=ze,this.pointPickShader=Ce,this.contourShader=me,this.trianglePositions=Re,this.triangleColors=Ge,this.triangleNormals=ct,this.triangleUVs=nt,this.triangleIds=ce,this.triangleVAO=qt,this.triangleCount=0,this.lineWidth=1,this.edgePositions=rt,this.edgeColors=Rt,this.edgeUVs=kt,this.edgeIds=ot,this.edgeVAO=Ct,this.edgeCount=0,this.pointPositions=Yt,this.pointColors=er,this.pointUVs=Ke,this.pointSizes=xt,this.pointIds=xr,this.pointVAO=bt,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=Lt,this.contourVAO=St,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=F,this._view=F,this._projection=F,this._resolution=[1,1]}var V=q.prototype;V.isOpaque=function(){return!this.hasAlpha},V.isTransparent=function(){return this.hasAlpha},V.pickSlots=1,V.setPickBase=function(ge){this.pickId=ge};function H(ge,ie){if(!ie||!ie.length)return 1;for(var Te=0;Tege&&Te>0){var Ee=(ie[Te][0]-ge)/(ie[Te][0]-ie[Te-1][0]);return ie[Te][1]*(1-Ee)+Ee*ie[Te-1][1]}}return 1}function X(ge,ie){for(var Te=g({colormap:ge,nshades:256,format:"rgba"}),Ee=new Uint8Array(256*4),Ae=0;Ae<256;++Ae){for(var ze=Te[Ae],Ce=0;Ce<3;++Ce)Ee[4*Ae+Ce]=ze[Ce];ie?Ee[4*Ae+3]=255*H(Ae/255,ie):Ee[4*Ae+3]=255*ze[3]}return b(Ee,[256,256,4],[4,0,1])}function G(ge){for(var ie=ge.length,Te=new Array(ie),Ee=0;Ee0){var ct=this.triShader;ct.bind(),ct.uniforms=me,this.triangleVAO.bind(),ie.drawArrays(ie.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var ct=this.lineShader;ct.bind(),ct.uniforms=me,this.edgeVAO.bind(),ie.lineWidth(this.lineWidth*this.pixelRatio),ie.drawArrays(ie.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var ct=this.pointShader;ct.bind(),ct.uniforms=me,this.pointVAO.bind(),ie.drawArrays(ie.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var ct=this.contourShader;ct.bind(),ct.uniforms=me,this.contourVAO.bind(),ie.drawArrays(ie.LINES,0,this.contourCount),this.contourVAO.unbind()}},V.drawPick=function(ge){ge=ge||{};for(var ie=this.gl,Te=ge.model||F,Ee=ge.view||F,Ae=ge.projection||F,ze=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],Ce=0;Ce<3;++Ce)ze[0][Ce]=Math.max(ze[0][Ce],this.clipBounds[0][Ce]),ze[1][Ce]=Math.min(ze[1][Ce],this.clipBounds[1][Ce]);this._model=[].slice.call(Te),this._view=[].slice.call(Ee),this._projection=[].slice.call(Ae),this._resolution=[ie.drawingBufferWidth,ie.drawingBufferHeight];var me={model:Te,view:Ee,projection:Ae,clipBounds:ze,pickId:this.pickId/255},Re=this.pickShader;if(Re.bind(),Re.uniforms=me,this.triangleCount>0&&(this.triangleVAO.bind(),ie.drawArrays(ie.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),ie.lineWidth(this.lineWidth*this.pixelRatio),ie.drawArrays(ie.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var Re=this.pointPickShader;Re.bind(),Re.uniforms=me,this.pointVAO.bind(),ie.drawArrays(ie.POINTS,0,this.pointCount),this.pointVAO.unbind()}},V.pick=function(ge){if(!ge||ge.id!==this.pickId)return null;for(var ie=ge.value[0]+256*ge.value[1]+65536*ge.value[2],Te=this.cells[ie],Ee=this.positions,Ae=new Array(Te.length),ze=0;zeMath.abs(p))g.rotate(F,0,0,-M*P*Math.PI*_.rotateSpeed/window.innerWidth);else if(!_._ortho){var q=-_.zoomSpeed*T*p/window.innerHeight*(F-g.lastT())/20;g.pan(F,0,0,k*(Math.exp(q)-1))}}},!0)},_.enableMouseListeners(),_}},799:function(i,a,o){var s=o(3236),l=o(9405),u=s([`precision mediump float;
+#define GLSLIFY 1
+attribute vec2 position;
+varying vec2 uv;
+void main() {
+ uv = position;
+ gl_Position = vec4(position, 0, 1);
+}`]),c=s([`precision mediump float;
+#define GLSLIFY 1
+
+uniform sampler2D accumBuffer;
+varying vec2 uv;
+
+void main() {
+ vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));
+ gl_FragColor = min(vec4(1,1,1,1), accum);
+}`]);i.exports=function(f){return l(f,u,c,null,[{name:"position",type:"vec2"}])}},4100:function(i,a,o){"use strict";var s=o(4437),l=o(3837),u=o(5445),c=o(4449),f=o(3589),h=o(2260),d=o(7169),v=o(351),x=o(4772),b=o(4040),g=o(799),E=o(9216)({tablet:!0,featureDetect:!0});i.exports={createScene:C,createCamera:s};function k(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function A(p,P){var T=null;try{T=p.getContext("webgl",P),T||(T=p.getContext("experimental-webgl",P))}catch(F){return null}return T}function L(p){var P=Math.round(Math.log(Math.abs(p))/Math.log(10));if(P<0){var T=Math.round(Math.pow(10,-P));return Math.ceil(p*T)/T}else if(P>0){var T=Math.round(Math.pow(10,P));return Math.ceil(p/T)*T}return Math.ceil(p)}function _(p){return typeof p=="boolean"?p:!0}function C(p){p=p||{},p.camera=p.camera||{};var P=p.canvas;if(!P)if(P=document.createElement("canvas"),p.container){var T=p.container;T.appendChild(P)}else document.body.appendChild(P);var F=p.gl;if(F||(p.glOptions&&(E=!!p.glOptions.preserveDrawingBuffer),F=A(P,p.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:E})),!F)throw new Error("webgl not supported");var q=p.bounds||[[-10,-10,-10],[10,10,10]],V=new k,H=h(F,F.drawingBufferWidth,F.drawingBufferHeight,{preferFloat:!E}),X=g(F),G=p.cameraObject&&p.cameraObject._ortho===!0||p.camera.projection&&p.camera.projection.type==="orthographic"||!1,N={eye:p.camera.eye||[2,0,0],center:p.camera.center||[0,0,0],up:p.camera.up||[0,1,0],zoomMin:p.camera.zoomMax||.1,zoomMax:p.camera.zoomMin||100,mode:p.camera.mode||"turntable",_ortho:G},W=p.axes||{},re=l(F,W);re.enable=!W.disable;var ae=p.spikes||{},_e=c(F,ae),Me=[],ke=[],ge=[],ie=[],Te=!0,Ce=!0,Ee=new Array(16),Ae=new Array(16),ze={view:null,projection:Ee,model:Ae,_ortho:!1},Ce=!0,me=[F.drawingBufferWidth,F.drawingBufferHeight],Re=p.cameraObject||s(P,N),ce={gl:F,contextLost:!1,pixelRatio:p.pixelRatio||1,canvas:P,selection:V,camera:Re,axes:re,axesPixels:null,spikes:_e,bounds:q,objects:Me,shape:me,aspect:p.aspectRatio||[1,1,1],pickRadius:p.pickRadius||10,zNear:p.zNear||.01,zFar:p.zFar||1e3,fovy:p.fovy||Math.PI/4,clearColor:p.clearColor||[0,0,0,0],autoResize:_(p.autoResize),autoBounds:_(p.autoBounds),autoScale:!!p.autoScale,autoCenter:_(p.autoCenter),clipToBounds:_(p.clipToBounds),snapToData:!!p.snapToData,onselect:p.onselect||null,onrender:p.onrender||null,onclick:p.onclick||null,cameraParams:ze,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Yt){this.aspect[0]=Yt.x,this.aspect[1]=Yt.y,this.aspect[2]=Yt.z,Ce=!0},setBounds:function(Yt,xr){this.bounds[0][Yt]=xr.min,this.bounds[1][Yt]=xr.max},setClearColor:function(Yt){this.clearColor=Yt},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},Ge=[F.drawingBufferWidth/ce.pixelRatio|0,F.drawingBufferHeight/ce.pixelRatio|0];function nt(){if(!ce._stopped&&ce.autoResize){var Yt=P.parentNode,xr=1,er=1;Yt&&Yt!==document.body?(xr=Yt.clientWidth,er=Yt.clientHeight):(xr=window.innerWidth,er=window.innerHeight);var Ke=Math.ceil(xr*ce.pixelRatio)|0,xt=Math.ceil(er*ce.pixelRatio)|0;if(Ke!==P.width||xt!==P.height){P.width=Ke,P.height=xt;var bt=P.style;bt.position=bt.position||"absolute",bt.left="0px",bt.top="0px",bt.width=xr+"px",bt.height=er+"px",Te=!0}}}ce.autoResize&&nt(),window.addEventListener("resize",nt);function ct(){for(var Yt=Me.length,xr=ie.length,er=0;er0&&ge[xr-1]===0;)ge.pop(),ie.pop().dispose()}ce.update=function(Yt){ce._stopped||(Yt=Yt||{},Te=!0,Ce=!0)},ce.add=function(Yt){ce._stopped||(Yt.axes=re,Me.push(Yt),ke.push(-1),Te=!0,Ce=!0,ct())},ce.remove=function(Yt){if(!ce._stopped){var xr=Me.indexOf(Yt);xr<0||(Me.splice(xr,1),ke.pop(),Te=!0,Ce=!0,ct())}},ce.dispose=function(){if(!ce._stopped&&(ce._stopped=!0,window.removeEventListener("resize",nt),P.removeEventListener("webglcontextlost",qt),ce.mouseListener.enabled=!1,!ce.contextLost)){re.dispose(),_e.dispose();for(var Yt=0;YtV.distance)continue;for(var dt=0;dt1e-6?(E=Math.acos(k),A=Math.sin(E),L=Math.sin((1-u)*E)/A,_=Math.sin(u*E)/A):(L=1-u,_=u),o[0]=L*c+_*v,o[1]=L*f+_*x,o[2]=L*h+_*b,o[3]=L*d+_*g,o}},5964:function(i){"use strict";i.exports=function(a){return!a&&a!==0?"":a.toString()}},9366:function(i,a,o){"use strict";var s=o(4359);i.exports=u;var l={};function u(c,f,h){var d=[f.style,f.weight,f.variant,f.family].join("_"),v=l[d];if(v||(v=l[d]={}),c in v)return v[c];var x={textAlign:"center",textBaseline:"middle",lineHeight:1,font:f.family,fontStyle:f.style,fontWeight:f.weight,fontVariant:f.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};x.triangles=!0;var b=s(c,x);x.triangles=!1;var g=s(c,x),E,k;if(h&&h!==1){for(E=0;E max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+attribute vec3 position;
+attribute vec4 color;
+attribute vec2 glyph;
+attribute vec4 id;
+
+uniform vec4 highlightId;
+uniform float highlightScale;
+uniform mat4 model, view, projection;
+uniform vec3 clipBounds[2];
+
+varying vec4 interpColor;
+varying vec4 pickId;
+varying vec3 dataCoordinate;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], position)) {
+
+ gl_Position = vec4(0,0,0,0);
+ } else {
+ float scale = 1.0;
+ if(distance(highlightId, id) < 0.0001) {
+ scale = highlightScale;
+ }
+
+ vec4 worldPosition = model * vec4(position, 1);
+ vec4 viewPosition = view * worldPosition;
+ viewPosition = viewPosition / viewPosition.w;
+ vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));
+
+ gl_Position = clipPosition;
+ interpColor = color;
+ pickId = id;
+ dataCoordinate = position;
+ }
+}`]),c=l([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+attribute vec3 position;
+attribute vec4 color;
+attribute vec2 glyph;
+attribute vec4 id;
+
+uniform mat4 model, view, projection;
+uniform vec2 screenSize;
+uniform vec3 clipBounds[2];
+uniform float highlightScale, pixelRatio;
+uniform vec4 highlightId;
+
+varying vec4 interpColor;
+varying vec4 pickId;
+varying vec3 dataCoordinate;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], position)) {
+
+ gl_Position = vec4(0,0,0,0);
+ } else {
+ float scale = pixelRatio;
+ if(distance(highlightId.bgr, id.bgr) < 0.001) {
+ scale *= highlightScale;
+ }
+
+ vec4 worldPosition = model * vec4(position, 1.0);
+ vec4 viewPosition = view * worldPosition;
+ vec4 clipPosition = projection * viewPosition;
+ clipPosition /= clipPosition.w;
+
+ gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);
+ interpColor = color;
+ pickId = id;
+ dataCoordinate = position;
+ }
+}`]),f=l([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+attribute vec3 position;
+attribute vec4 color;
+attribute vec2 glyph;
+attribute vec4 id;
+
+uniform float highlightScale;
+uniform vec4 highlightId;
+uniform vec3 axes[2];
+uniform mat4 model, view, projection;
+uniform vec2 screenSize;
+uniform vec3 clipBounds[2];
+uniform float scale, pixelRatio;
+
+varying vec4 interpColor;
+varying vec4 pickId;
+varying vec3 dataCoordinate;
+
+void main() {
+ if (outOfRange(clipBounds[0], clipBounds[1], position)) {
+
+ gl_Position = vec4(0,0,0,0);
+ } else {
+ float lscale = pixelRatio * scale;
+ if(distance(highlightId, id) < 0.0001) {
+ lscale *= highlightScale;
+ }
+
+ vec4 clipCenter = projection * (view * (model * vec4(position, 1)));
+ vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;
+ vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));
+
+ gl_Position = clipPosition;
+ interpColor = color;
+ pickId = id;
+ dataCoordinate = dataPosition;
+ }
+}
+`]),h=l([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform vec3 fragClipBounds[2];
+uniform float opacity;
+
+varying vec4 interpColor;
+varying vec3 dataCoordinate;
+
+void main() {
+ if (
+ outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||
+ interpColor.a * opacity == 0.
+ ) discard;
+ gl_FragColor = interpColor * opacity;
+}
+`]),d=l([`precision highp float;
+#define GLSLIFY 1
+
+bool outOfRange(float a, float b, float p) {
+ return ((p > max(a, b)) ||
+ (p < min(a, b)));
+}
+
+bool outOfRange(vec2 a, vec2 b, vec2 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y));
+}
+
+bool outOfRange(vec3 a, vec3 b, vec3 p) {
+ return (outOfRange(a.x, b.x, p.x) ||
+ outOfRange(a.y, b.y, p.y) ||
+ outOfRange(a.z, b.z, p.z));
+}
+
+bool outOfRange(vec4 a, vec4 b, vec4 p) {
+ return outOfRange(a.xyz, b.xyz, p.xyz);
+}
+
+uniform vec3 fragClipBounds[2];
+uniform float pickGroup;
+
+varying vec4 pickId;
+varying vec3 dataCoordinate;
+
+void main() {
+ if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;
+
+ gl_FragColor = vec4(pickGroup, pickId.bgr);
+}`]),v=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],x={vertex:u,fragment:h,attributes:v},b={vertex:c,fragment:h,attributes:v},g={vertex:f,fragment:h,attributes:v},E={vertex:u,fragment:d,attributes:v},k={vertex:c,fragment:d,attributes:v},A={vertex:f,fragment:d,attributes:v};function L(_,C){var M=s(_,C),p=M.attributes;return p.position.location=0,p.color.location=1,p.glyph.location=2,p.id.location=3,M}a.createPerspective=function(_){return L(_,x)},a.createOrtho=function(_){return L(_,b)},a.createProject=function(_){return L(_,g)},a.createPickPerspective=function(_){return L(_,E)},a.createPickOrtho=function(_){return L(_,k)},a.createPickProject=function(_){return L(_,A)}},8418:function(i,a,o){"use strict";var s=o(5219),l=o(2762),u=o(8116),c=o(1888),f=o(6760),h=o(1283),d=o(9366),v=o(5964),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],b=ArrayBuffer,g=DataView;function E(Ae){return b.isView(Ae)&&!(Ae instanceof g)}function k(Ae){return Array.isArray(Ae)||E(Ae)}i.exports=Ee;function A(Ae,ze){var Ce=Ae[0],me=Ae[1],Re=Ae[2],ce=Ae[3];return Ae[0]=ze[0]*Ce+ze[4]*me+ze[8]*Re+ze[12]*ce,Ae[1]=ze[1]*Ce+ze[5]*me+ze[9]*Re+ze[13]*ce,Ae[2]=ze[2]*Ce+ze[6]*me+ze[10]*Re+ze[14]*ce,Ae[3]=ze[3]*Ce+ze[7]*me+ze[11]*Re+ze[15]*ce,Ae}function L(Ae,ze,Ce,me){return A(me,me,Ce),A(me,me,ze),A(me,me,Ae)}function _(Ae,ze){this.index=Ae,this.dataCoordinate=this.position=ze}function C(Ae){return Ae===!0||Ae>1?1:Ae}function M(Ae,ze,Ce,me,Re,ce,Ge,nt,ct,qt,rt,ot){this.gl=Ae,this.pixelRatio=1,this.shader=ze,this.orthoShader=Ce,this.projectShader=me,this.pointBuffer=Re,this.colorBuffer=ce,this.glyphBuffer=Ge,this.idBuffer=nt,this.vao=ct,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=qt,this.pickOrthoShader=rt,this.pickProjectShader=ot,this.points=[],this._selectResult=new _(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}var p=M.prototype;p.pickSlots=1,p.setPickBase=function(Ae){this.pickId=Ae},p.isTransparent=function(){if(this.hasAlpha)return!0;for(var Ae=0;Ae<3;++Ae)if(this.axesProject[Ae]&&this.projectHasAlpha)return!0;return!1},p.isOpaque=function(){if(!this.hasAlpha)return!0;for(var Ae=0;Ae<3;++Ae)if(this.axesProject[Ae]&&!this.projectHasAlpha)return!0;return!1};var P=[0,0],T=[0,0,0],F=[0,0,0],q=[0,0,0,1],V=[0,0,0,1],H=x.slice(),X=[0,0,0],G=[[0,0,0],[0,0,0]];function N(Ae){return Ae[0]=Ae[1]=Ae[2]=0,Ae}function W(Ae,ze){return Ae[0]=ze[0],Ae[1]=ze[1],Ae[2]=ze[2],Ae[3]=1,Ae}function re(Ae,ze,Ce,me){return Ae[0]=ze[0],Ae[1]=ze[1],Ae[2]=ze[2],Ae[Ce]=me,Ae}function ae(Ae){for(var ze=G,Ce=0;Ce<2;++Ce)for(var me=0;me<3;++me)ze[Ce][me]=Math.max(Math.min(Ae[Ce][me],1e8),-1e8);return ze}function _e(Ae,ze,Ce,me){var Re=ze.axesProject,ce=ze.gl,Ge=Ae.uniforms,nt=Ce.model||x,ct=Ce.view||x,qt=Ce.projection||x,rt=ze.axesBounds,ot=ae(ze.clipBounds),Rt;ze.axes&&ze.axes.lastCubeProps?Rt=ze.axes.lastCubeProps.axis:Rt=[1,1,1],P[0]=2/ce.drawingBufferWidth,P[1]=2/ce.drawingBufferHeight,Ae.bind(),Ge.view=ct,Ge.projection=qt,Ge.screenSize=P,Ge.highlightId=ze.highlightId,Ge.highlightScale=ze.highlightScale,Ge.clipBounds=ot,Ge.pickGroup=ze.pickId/255,Ge.pixelRatio=me;for(var kt=0;kt<3;++kt)if(Re[kt]){Ge.scale=ze.projectScale[kt],Ge.opacity=ze.projectOpacity[kt];for(var Ct=H,Yt=0;Yt<16;++Yt)Ct[Yt]=0;for(var Yt=0;Yt<4;++Yt)Ct[5*Yt]=1;Ct[5*kt]=0,Rt[kt]<0?Ct[12+kt]=rt[0][kt]:Ct[12+kt]=rt[1][kt],f(Ct,nt,Ct),Ge.model=Ct;var xr=(kt+1)%3,er=(kt+2)%3,Ke=N(T),xt=N(F);Ke[xr]=1,xt[er]=1;var bt=L(qt,ct,nt,W(q,Ke)),Lt=L(qt,ct,nt,W(V,xt));if(Math.abs(bt[1])>Math.abs(Lt[1])){var St=bt;bt=Lt,Lt=St,St=Ke,Ke=xt,xt=St;var Et=xr;xr=er,er=Et}bt[0]<0&&(Ke[xr]=-1),Lt[1]>0&&(xt[er]=-1);for(var dt=0,Ht=0,Yt=0;Yt<4;++Yt)dt+=Math.pow(nt[4*xr+Yt],2),Ht+=Math.pow(nt[4*er+Yt],2);Ke[xr]/=Math.sqrt(dt),xt[er]/=Math.sqrt(Ht),Ge.axes[0]=Ke,Ge.axes[1]=xt,Ge.fragClipBounds[0]=re(X,ot[0],kt,-1e8),Ge.fragClipBounds[1]=re(X,ot[1],kt,1e8),ze.vao.bind(),ze.vao.draw(ce.TRIANGLES,ze.vertexCount),ze.lineWidth>0&&(ce.lineWidth(ze.lineWidth*me),ze.vao.draw(ce.LINES,ze.lineVertexCount,ze.vertexCount)),ze.vao.unbind()}}var Me=[-1e8,-1e8,-1e8],ke=[1e8,1e8,1e8],ge=[Me,ke];function ie(Ae,ze,Ce,me,Re,ce,Ge){var nt=Ce.gl;if((ce===Ce.projectHasAlpha||Ge)&&_e(ze,Ce,me,Re),ce===Ce.hasAlpha||Ge){Ae.bind();var ct=Ae.uniforms;ct.model=me.model||x,ct.view=me.view||x,ct.projection=me.projection||x,P[0]=2/nt.drawingBufferWidth,P[1]=2/nt.drawingBufferHeight,ct.screenSize=P,ct.highlightId=Ce.highlightId,ct.highlightScale=Ce.highlightScale,ct.fragClipBounds=ge,ct.clipBounds=Ce.axes.bounds,ct.opacity=Ce.opacity,ct.pickGroup=Ce.pickId/255,ct.pixelRatio=Re,Ce.vao.bind(),Ce.vao.draw(nt.TRIANGLES,Ce.vertexCount),Ce.lineWidth>0&&(nt.lineWidth(Ce.lineWidth*Re),Ce.vao.draw(nt.LINES,Ce.lineVertexCount,Ce.vertexCount)),Ce.vao.unbind()}}p.draw=function(Ae){var ze=this.useOrtho?this.orthoShader:this.shader;ie(ze,this.projectShader,this,Ae,this.pixelRatio,!1,!1)},p.drawTransparent=function(Ae){var ze=this.useOrtho?this.orthoShader:this.shader;ie(ze,this.projectShader,this,Ae,this.pixelRatio,!0,!1)},p.drawPick=function(Ae){var ze=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;ie(ze,this.pickProjectShader,this,Ae,1,!0,!0)},p.pick=function(Ae){if(!Ae||Ae.id!==this.pickId)return null;var ze=Ae.value[2]+(Ae.value[1]<<8)+(Ae.value[0]<<16);if(ze>=this.pointCount||ze<0)return null;var Ce=this.points[ze],me=this._selectResult;me.index=ze;for(var Re=0;Re<3;++Re)me.position[Re]=me.dataCoordinate[Re]=Ce[Re];return me},p.highlight=function(Ae){if(!Ae)this.highlightId=[1,1,1,1];else{var ze=Ae.index,Ce=ze&255,me=ze>>8&255,Re=ze>>16&255;this.highlightId=[Ce/255,me/255,Re/255,0]}};function Te(Ae,ze,Ce,me){var Re;k(Ae)?ze0){var Nr=0,ut=er,Ne=[0,0,0,1],Ye=[0,0,0,1],Ve=k(Rt)&&k(Rt[0]),Xe=k(Yt)&&k(Yt[0]);e:for(var me=0;me0?1-Ht[0][0]:Vt<0?1+Ht[1][0]:1,ar*=ar>0?1-Ht[0][1]:ar<0?1+Ht[1][1]:1;for(var Qr=[Vt,ar],nn=Et.cells||[],Wi=Et.positions||[],Lt=0;Ltthis.buffer.length){l.free(this.buffer);for(var k=this.buffer=l.mallocUint8(c(E*g*4)),A=0;Ak)for(g=k;gE)for(g=E;g=0){for(var G=X.type.charAt(X.type.length-1)|0,N=new Array(G),W=0;W