@brownnrl/geomlib 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -1,2 +1,2 @@
1
- var geomlib;(()=>{"use strict";var t={1454(t,e){function n(){var t=s(Math.random(),Math.random(),1);return"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")")}function r(t){var e=i(t);if(null==e)return t;var n=.7,r=Math.ceil(1/(1-n)),o=0===e.r?r:Math.min(Math.floor(e.r/n),255),s=0===e.g?r:Math.min(Math.floor(e.g/n),255),a=0===e.b?r:Math.min(Math.floor(e.b/n),255);return o<r&&(o=r),s<r&&(s=r),a<r&&(a=r),"rgb(".concat(o,",").concat(s,",").concat(a,")")}function o(t){var e=i(t);if(null==e)return t;var n=Math.floor(.7*e.r),r=Math.floor(.7*e.g),o=Math.floor(.7*e.b);return"rgb(".concat(n,",").concat(r,",").concat(o,")")}function i(t){if(null==t)return null;var n=t.match(/^rgb\((\d+),(\d+),(\d+)\)$/);if(n)return{r:parseInt(n[1]),g:parseInt(n[2]),b:parseInt(n[3])};if(t in e.colors)return i(e.colors[t]);var r=t.replace(/^#/,"");if(/^[0-9a-fA-F]{6}$/.test(r)){var o=parseInt(r,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}var a=t.split(",");if(3===a.length){var l=parseInt(a[0])/360,u=parseInt(a[1])/100,c=parseInt(a[2])/100;if(!isNaN(l)&&!isNaN(u)&&!isNaN(c))return s(l,u,c)}return null}function s(t,e,n){var r,o,i,s=Math.floor(6*t),a=6*t-s,l=n*(1-e),u=n*(1-a*e),c=n*(1-(1-a)*e);switch(s%6){case 0:r=n,o=c,i=l;break;case 1:r=u,o=n,i=l;break;case 2:r=l,o=n,i=c;break;case 3:r=l,o=u,i=n;break;case 4:r=c,o=l,i=n;break;case 5:r=n,o=l,i=u}return{r:Math.round(255*r),g:Math.round(255*o),b:Math.round(255*i)}}Object.defineProperty(e,"__esModule",{value:!0}),e.colors=void 0,e.parseColor=function(t,i,a){if(0===t)return null;if(null==t)return i;var l=String(t);if("none"===l||"0"===l||""===l)return null;if("random"===l)return n();if("background"===l)return a;if("brighter"===l)return r(a);if("darker"===l)return o(a);if(l in e.colors)return e.colors[l];var u=l.replace(/^#/,"");if(/^[0-9a-fA-F]+$/.test(u)){var c=parseInt(u,16);if(!isNaN(c)){var h=c>>8&255,p=255&c;return"rgb(".concat(c>>16&255,",").concat(h,",").concat(p,")")}}var f=l.split(",");if(3===f.length){var _=parseInt(f[0])/360,y=parseInt(f[1])/100;if(p=parseInt(f[2])/100,!isNaN(_)&&!isNaN(y)&&!isNaN(p)){var d=s(_,y,p);return"rgb(".concat(d.r,",").concat(d.g,",").concat(d.b,")")}}return null},e.randomColor=n,e.brighter=r,e.darker=o,e.lighten=function(t){return r(t)},e.darken=function(t){return o(t)},e.colors={black:"rgb(0,0,0)",blue:"rgb(0,0,255)",cyan:"rgb(0,255,255)",darkGray:"rgb(64,64,64)",gray:"rgb(128,128,128)",green:"rgb(0,255,0)",lightGray:"rgb(192,192,192)",magenta:"rgb(255,0,255)",orange:"rgb(255,200,0)",pink:"rgb(255,175,175)",red:"rgb(255,0,0)",white:"rgb(255,255,255)",yellow:"rgb(255,255,0)"}},8041(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Slate=void 0;var r=n(6055),o=n(6401),i=n(7658),s=n(6091),a=n(2145),l=n(6900),u=function(){function t(e){if(this._aliases=new Map,this._slides=[],this._resolveJustification=null,this._animationConfig={},this._animator=null,this._ephemerals=[],this._htmlCanvas=null,this.inTest=!1,this._itsNumSlate=-1,t.numSlate+=1,this._itsNumSlate=t.numSlate,this._elements=[],null==e)throw new TypeError("canvas cannot be null or undefined.");this._canvas=e;var n=new o.FixedPoint({x:0,y:0,z:0});n.name="screen_origin";var i=new o.FixedPoint({x:1,y:0,z:0});i.name="screen_x";var s=new o.FixedPoint({x:0,y:1,z:0});s.name="screen_y";var a=new r.PlaneElement({A:n,B:i,C:s});a.name="screen",a.nameColor=null,a.isScreen=!0,this._screen=a,this._pick=null;for(var l=0,u=[n,i,s,a];l<u.length;l++){var c=u[l];c.nameColor=null,c.vertexColor=null,c.vertexHighlightColor=null,c.faceColor=null,c.faceHighlightColor=null,this._elements.push(c)}var h=this,p=this._canvas;if(this._htmlCanvas=p,null!=this._htmlCanvas.addEventListener){this._htmlCanvas.style.touchAction="none";var f=null;this._htmlCanvas.addEventListener("pointerdown",(function(t){if(null===f){f=t.pointerId;try{h._htmlCanvas.setPointerCapture(t.pointerId)}catch(t){}var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],r=e[1];h._onMouseDown(n,r)}})),this._htmlCanvas.addEventListener("pointermove",(function(t){if(t.pointerId===f){var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],r=e[1];h._onMouseDrag(n,r)}}));var _=function(t){if(t.pointerId===f){var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],r=e[1];h._onMouseUp(n,r);try{h._htmlCanvas.releasePointerCapture(t.pointerId)}catch(t){}f=null}};this._htmlCanvas.addEventListener("pointerup",_),this._htmlCanvas.addEventListener("pointercancel",_),this._htmlCanvas.addEventListener("lostpointercapture",(function(t){t.pointerId===f&&(null!=h._pick&&(h._pick=null),f=null)}))}}return t.prototype._getCanvasPosition=function(t,e){var n=this._htmlCanvas.getBoundingClientRect();return[t-n.left,e-n.top]},t.prototype._onMouseDown=function(t,e){this._pick=null,this.movePick(t,e)},t.prototype._onMouseUp=function(t,e){null!=this._pick&&(this.movePick(t,e),this._pick=null)},t.prototype._onMouseDrag=function(t,e){null!=this._pick&&this.movePick(t,e)},Object.defineProperty(t.prototype,"elements",{get:function(){return this._elements},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bgcolor",{get:function(){return this._bgcolor},set:function(t){this._bgcolor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this._canvas},enumerable:!1,configurable:!0}),t.prototype.lookupElement=function(t){for(var e=0,n=this._elements;e<n.length;e++)if((s=n[e]).name==t)return s;var r=this._aliases.get(t);if(null!=r)for(var o=0,i=this._elements;o<i.length;o++){var s;if((s=i[o]).name==r)return s}return null},t.prototype.addAlias=function(t,e){this._aliases.set(t,e)},t.prototype.addAliases=function(t){for(var e in t)this._aliases.set(e,t[e])},Object.defineProperty(t.prototype,"slides",{get:function(){return this._slides},set:function(t){this._slides=t||[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolveJustification",{get:function(){return this._resolveJustification},set:function(t){this._resolveJustification=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationConfig",{get:function(){return this._animationConfig},set:function(t){this._animationConfig=t||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animator",{get:function(){return this._animator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ephemerals",{get:function(){return this._ephemerals},enumerable:!1,configurable:!0}),t.prototype.addEphemeral=function(t){this._ephemerals.push(t)},t.prototype.removeEphemeral=function(t){var e=this._ephemerals.indexOf(t);e>=0&&this._ephemerals.splice(e,1)},t.prototype.clearEphemerals=function(){this._ephemerals.length=0},t.prototype._ensureAnimator=function(){return null==this._animator&&(this._animator=new l.SlateAnimator(this)),this._animator},t.prototype.animateTo=function(t,e,n,r){return this._ensureAnimator().run(t,e,n,r)},t.prototype.setVisibleNames=function(t){for(var e=new Set(t),n=0,r=this._elements;n<r.length;n++){var o=r[n];null!=o.name&&(o.visible=e.has(o.name))}},t.prototype.clearVisibility=function(){for(var t=0,e=this._elements;t<e.length;t++)e[t].visible=!0},t.prototype.convertParams=function(t){for(var e=[],n=[],r=[],o=0,i=t;o<i.length;o++){var l=i[o];switch(typeof l){case"string":var u=this.lookupElement(l);if(null==u)throw new TypeError("Element with name ".concat(l," not found."));u instanceof s.PointElement?e.push(u):u instanceof a.LineElement?(e.push(u.A),e.push(u.B)):n.push(u);break;case"number":r.push(l);break;default:throw new TypeError("Expecting only named elements (strings) or numbers.")}}return{P:e,E:n,N:r}},t.prototype.findConstruction=function(t,e){for(var n=0,r=i.constructions;n<r.length;n++){var o=r[n];if(o.validateSignature(t,e))return o}return null},t.prototype.createElement=function(t,e,n){var r=this.convertParams(e),o=this.findConstruction(t,r);if(null==o){var s=(0,i.getConstructionName)(t);throw null==n&&(n=""),new TypeError('Construction not found for "'.concat(n,'" ').concat(s," with params P=[").concat(r.P,"] E=[").concat(r.E,"] N=[").concat(r.N,"]"))}var a=o.construct(this._screen,r.P,r.E,r.N),l=a[0],u=a[1];-1!==this._elements.indexOf(u)&&(u.preexists=!0),null!=n&&(u.name=n);for(var c=0,h=l;c<h.length;c++){var p=h[c];-1==this._elements.indexOf(p)&&this._elements.push(p)}return-1==this._elements.indexOf(u)&&this._elements.push(u),u},t.prototype.reset=function(){for(var t=0,e=this._elements;t<e.length;t++)e[t].reset();this.update()},t.prototype.update=function(){for(var t=0,e=this._elements;t<e.length;t++)e[t].update();this.drawElements()},t.prototype.drawElements=function(){if(!this.inTest){var t=this._canvas.width,e=this._canvas.height,n=this._canvas.getContext("2d");n.clearRect(0,0,t,e),n.fillStyle=this._bgcolor,n.fillRect(0,0,t,e);for(var r=0,o=this._elements;r<o.length;r++)o[r].drawFace(this._canvas);for(var i=0,s=this._elements;i<s.length;i++)s[i].drawEdge(this._canvas);for(var a=0,l=this._elements;a<l.length;a++)l[a].drawVertex(this._canvas);for(var u=0,c=this._elements;u<c.length;u++)c[u].drawName(this._canvas);for(var h=0,p=this._ephemerals;h<p.length;h++)p[h].drawFace(this._canvas);for(var f=0,_=this._ephemerals;f<_.length;f++)_[f].drawEdge(this._canvas);for(var y=0,d=this._ephemerals;y<d.length;y++)d[y].drawVertex(this._canvas);for(var v=0,g=this._ephemerals;v<g.length;v++)g[v].drawName(this._canvas)}},t.prototype.updateCoordinates=function(t){for(++t;t<this._elements.length;t++)this._elements[t].defined()||this._elements[t].reset(),this._elements[t].update();this.drawElements()},t.prototype.translateCoordinates=function(t,e){for(var n=0;n<this._elements.length;n++){var r=this._elements[n];r.preexists||r.translate(t,e)}this.update()},t.prototype.closestVisiblePoint=function(t,e,n){void 0===n&&(n=30);var r=function(t,e){return(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)},o=t.filter((function(t){return t instanceof s.PointElement})).map((function(t){return t})).filter((function(t){return null!=t.vertexColor})).sort((function(t,n){var o=r(t,e),i=r(n,e);return o<i?-1:i<o?1:0}));if(0==o.length)return null;var i=o[0];return Math.sqrt(r(i,e))>n?null:i},t.prototype._getPick=function(t,e){if(null!=this._pick)return this._pick;var n=new s.PointElement({x:t,y:e}),r=this.closestVisiblePoint(this._elements,n);return null!=r?(this._pick=r,this._pick):void 0},t.prototype.setPivot=function(t){var e=t.split(","),n=e[0].trim(),o=this.lookupElement(n);if(null!=o&&o instanceof s.PointElement){var i=o;if(e.length>1){var a=e[1].trim(),l=this.lookupElement(a);if(null==l||!(l instanceof r.PlaneElement))return;l.pivot=i}else i._AP=this._screen,this._screen.pivot=i}},t.prototype.movePick=function(t,e){if(null!=this._getPick(t,e)){var n=this._elements.indexOf(this._pick),r=this._canvas.width;t<0?t=0:t>r&&(t=r);var o=this._canvas.height;if(e<0?e=0:e>o&&(e=o),!(Math.abs(t-this._pick.x)+Math.abs(e-this._pick.y)<1)){if(this._pick.draggable){if(!this._pick.drag(t,e))return;this.updateCoordinates(n)}else if(null!=this._pick.AP&&null!=this._pick.AP.pivot&&this._pick.AP.pivot!=this._pick)this.rotateCoordinates(t,e);else{var i=t-this._pick.x,s=e-this._pick.y;this.translateCoordinates(i,s)}this.drawElements()}}},t.prototype.rotateCoordinates=function(t,e){for(var n=this._pick,r=n.AP.pivot,o=s.PointElement.difference(n,r),i=t-r.x,a=e-r.y,l=n.AP.S,u=n.AP.T,c=s.PointElement.dot(o,l),h=s.PointElement.dot(o,u),p=l.x*u.y-l.y*u.x,f=(i*u.y-a*u.x)/p,_=(a*l.x-i*l.y)/p,y=(f*c+_*h)/(p=c*c+h*h),d=(_*c-f*h)/p,v=0,g=this._elements;v<g.length;v++){var m=g[v];m.preexists||m.rotate(r,y,d)}this.update()},t.numSlate=0,t}();e.Slate=u},6900(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.SlateAnimator=void 0;var o=n(7233),i="function"==typeof requestAnimationFrame,s="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return Date.now()},a=function(){function t(t){this.groups=[],this.mode="cascade",this.resolveCurrent=null,this.cascadeIndex=0,this.rafId=null,this.lastFrameMs=0,this.fadingOut=!1,this.fadeStartMs=0,this.slate=t}return t.prototype.run=function(t,e,n,i){var a=this;this.groups.length>0&&this.cancel();for(var l=[],u=this.slate.animationConfig||{},c=null!=u.speedMultiplier?u.speedMultiplier:1,h=!0===u.reducedMotion||0===c,p=function(t){var e=f.slate.lookupElement(t.elem);if(null==e)return"continue";var n=(0,o.findAnimation)(t.name);if(null==n)return"continue";if(!(e instanceof n.elementType))return"undefined"!=typeof console&&console.warn&&console.warn("[geomlib] animation '"+n.name+"' targets "+n.elementType.name+" but element '"+t.elem+"' is "+e.constructor.name+" — falling back to instant"),e.drawProgress=1,e.visible=!0,"continue";var i=(n.build(e,f.slate,t.args||{})||[]).map((function(e){return{step:r(r({},e),{durationMs:(o=e.durationMs,i=t.durationMs,s=u.durations&&u.durations[n.name],null!=i?i:null!=s?s:o)}),elapsedMs:0,started:!1,finalised:!1};var o,i,s}));l.push({target:e,steps:i,currentIndex:0})},f=this,_=0,y=n||[];_<y.length;_++)p(y[_]);for(var d=new Set(l.map((function(t){return t.target}))),v=0,g=this.slate.elements;v<g.length;v++){var m=g[v];if(null!=m.name){var P=t.has(m.name),C=e.has(m.name);d.has(m)?(m.shouldHighlight=C,m.drawProgress=0,m.visible=P):(m.visible=P,m.shouldHighlight=C,m.drawProgress=1)}}if(h||0===l.length){for(var w=0,x=l;w<x.length;w++)for(var E=0,b=x[w].steps;E<b.length;E++){var A=b[E];A.step.setup&&!A.started&&A.step.setup(),A.step.finalise(),A.finalised=!0}return this.slate.clearEphemerals(),this.slate.drawElements(),Promise.resolve()}for(var S=0,O=l;S<O.length;S++)O[S].target.emphasized=!0;return this.groups=l,this.mode=i,this.cascadeIndex=0,this.lastFrameMs=s(),new Promise((function(t){a.resolveCurrent=t,a._kickoff(),a._scheduleFrame()}))},t.prototype._clearAnimatedEmphasis=function(){for(var t=0,e=this.groups;t<e.length;t++)e[t].target.emphasized=!1},t.prototype.cancel=function(){if(0!==this.groups.length){for(var t=0,e=this.groups;t<e.length;t++)for(var n=e[t],r=0;r<n.steps.length;r++){var o=n.steps[r];o.finalised||(o.step.setup&&!o.started&&(o.step.setup(),o.started=!0),o.step.finalise(),o.finalised=!0)}this._clearAnimatedEmphasis(),this.slate.clearEphemerals(),this.slate.drawElements(),this.groups=[],this.fadingOut=!1,null!=this.rafId&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this.rafId),this.rafId=null,this.resolveCurrent&&(this.resolveCurrent(),this.resolveCurrent=null)}},t.prototype._kickoff=function(){if("cascade"===this.mode)this._startGroupIndex(0);else for(var t=0,e=this.groups;t<e.length;t++){var n=e[t];this._startStep(n,0)}},t.prototype._startGroupIndex=function(t){t>=this.groups.length||this._startStep(this.groups[t],0)},t.prototype._startStep=function(t,e){if(!(e>=t.steps.length)){var n=t.steps[e];n.started||(n.step.setup&&n.step.setup(),n.started=!0,t.currentIndex=e)}},t.prototype._scheduleFrame=function(){var t=this;if(i)this.rafId=requestAnimationFrame((function(e){return t._frame(e)}));else{var e=s()+16;this.rafId=setTimeout((function(){return t._frame(e)}),16)}},t.prototype._frame=function(t){if(0!==this.groups.length){var e=this.slate.animationConfig||{},n=null!=e.speedMultiplier?e.speedMultiplier:1,r=e.cascadeGapMs||0,o=t-this.lastFrameMs;o<0&&(o=0),o>100&&(o=100);var i=o*n;if(this.lastFrameMs=t,"cascade"===this.mode?this._tickCascade(i,t,r):this._tickParallel(i,t),this.slate.drawElements(),this._allFinalised()){this.fadingOut||(this.fadingOut=!0,this.fadeStartMs=t);for(var s=t-this.fadeStartMs,a=s>=250?1:s/250,l=1-a,u=0,c=this.groups;u<c.length;u++)c[u].target.emphasisAmount=l;return this.slate.drawElements(),a>=1?(this._clearAnimatedEmphasis(),this.groups=[],this.fadingOut=!1,this.rafId=null,void(this.resolveCurrent&&(this.resolveCurrent(),this.resolveCurrent=null))):void this._scheduleFrame()}this._scheduleFrame()}},t.prototype._tickCascade=function(t,e,n){for(;this.cascadeIndex<this.groups.length;){var r=this.groups[this.cascadeIndex],o=r.steps[r.currentIndex];if(o){if(!o.finalised)return void this._tickStep(r.target,o,t,e);if(null==r.finishedAtMs&&(r.finishedAtMs=e),e-r.finishedAtMs<n)return;r.currentIndex+1<r.steps.length?this._startStep(r,r.currentIndex+1):(this.cascadeIndex+=1,this.cascadeIndex<this.groups.length&&this._startStep(this.groups[this.cascadeIndex],0))}else this.cascadeIndex+=1,this.cascadeIndex<this.groups.length&&this._startStep(this.groups[this.cascadeIndex],0)}},t.prototype._tickParallel=function(t,e){for(var n=0,r=this.groups;n<r.length;n++){var o=r[n],i=o.steps[o.currentIndex];i&&(i.finalised?o.currentIndex+1<o.steps.length&&this._startStep(o,o.currentIndex+1):this._tickStep(o.target,i,t,e))}},t.prototype._tickStep=function(t,e,n,r){e.started||(e.step.setup&&e.step.setup(),e.started=!0),e.elapsedMs+=n;var o=e.step.durationMs,i=o>0?e.elapsedMs/o:1;i>1&&(i=1),i<0&&(i=0),e.step.tick(i,n,e.elapsedMs),i>=1&&(e.step.finalise(),e.finalised=!0)},t.prototype._allFinalised=function(){for(var t=0,e=this.groups;t<e.length;t++)for(var n=0,r=e[t].steps;n<r.length;n++)if(!r[n].finalised)return!1;return!0},t}();e.SlateAnimator=a},3267(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.trackWindowResize=l,e.createControls=function(t,e,n){e.parentElement&&new u(t,e,n).init()};var r=n(7680);function o(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches}var i=o()?18:20,s=(o(),4),a=o()?7:8;function l(t,e){var n=function(){return e()};return t.addEventListener("resize",n),function(){return t.removeEventListener("resize",n)}}var u=function(){function t(t,e,n){this._maximized=!1,this._savedStyles=null,this._stopTrackingResize=null,this._presenting=!1,this._presentationIndex=0,this._presentationOverlay=null,this._presentationCaption=null,this._presentationJusts=null,this._presentationCounter=null,this._presentationOnKey=null,this._stickyRefSpan=null,this._stickyRefElem=null,this._slate=t,this._canvas=e,this._config=n}return t.prototype.init=function(){this._wrapper=this.createWrapper(),this.createButtons(),this.addKeyboardShortcuts()},t.prototype.createWrapper=function(){var t=this,e=document.createElement("div");return e.style.position="relative",e.style.display="inline-block",this._canvas.parentElement.insertBefore(e,this._canvas),e.appendChild(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.style.outline="none",this._canvas.addEventListener("focus",(function(){t._canvas.style.outline="2px solid rgba(66,133,244,0.5)"})),this._canvas.addEventListener("blur",(function(){t._canvas.style.outline="none"})),e},t.prototype.createButtons=function(){var t=this,e=[{draw:h,action:function(){return t.onReset()},title:"Reset (r)"},{draw:p,action:function(){return t.onMaximize()},title:"Maximize (m)"},{draw:f,action:function(){return t.onNewWindow()},title:"New Window (u)"}];this._slate.slides.length>0&&e.push({draw:_,action:function(){return t.onPresent()},title:"Present (p)"});for(var n=function(n){var o=document.createElement("button");o.style.position="absolute",o.style.top=a+"px",o.style.right=a+n*(i+s)+"px",o.style.width=i+"px",o.style.height=i+"px",o.style.padding="0",o.style.border="none",o.style.cursor="pointer",o.style.background="rgba(0,0,0,0.12)",o.style.borderRadius="3px",o.title=e[n].title,o.addEventListener("mouseenter",(function(){o.style.background="rgba(0,0,0,0.3)"})),o.addEventListener("mouseleave",(function(){o.style.background="rgba(0,0,0,0.12)"}));var l=document.createElement("canvas");l.width=i,l.height=i,l.style.display="block";var u=l.getContext("2d");e[n].draw(u,i),o.appendChild(l),o.addEventListener("click",(function(r){r.stopPropagation(),e[n].action(),t._canvas.focus()})),1===n&&(r._maxBtn=o,r._maxIconCanvas=l),r._wrapper.appendChild(o)},r=this,o=0;o<e.length;o++)n(o)},t.prototype.addKeyboardShortcuts=function(){var t=this;this._canvas.addEventListener("keydown",(function(e){switch(e.key){case"r":case"R":case" ":e.preventDefault(),t.onReset();break;case"u":case"U":case"Enter":e.preventDefault(),t.onNewWindow();break;case"m":case"M":e.preventDefault(),t.onMaximize();break;case"p":case"P":t._slate.slides.length>0&&(e.preventDefault(),t.onPresent())}}))},t.prototype.onReset=function(){this._slate.reset()},t.prototype.onMaximize=function(){this._maximized?this.minimize():this.maximize()},t.prototype.maximize=function(){var t=this;this._savedStyles={wrapperPosition:this._wrapper.style.position,wrapperTop:this._wrapper.style.top,wrapperLeft:this._wrapper.style.left,wrapperWidth:this._wrapper.style.width,wrapperHeight:this._wrapper.style.height,wrapperZIndex:this._wrapper.style.zIndex,wrapperBackground:this._wrapper.style.background,canvasStyleWidth:this._canvas.style.width,canvasStyleHeight:this._canvas.style.height,canvasAttrWidth:this._canvas.width,canvasAttrHeight:this._canvas.height},this._wrapper.style.position="fixed",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.style.width="100vw",this._wrapper.style.height="100vh",this._wrapper.style.zIndex="9999",this._wrapper.style.background="white",this._canvas.style.width="100%",this._canvas.style.height="100%",this.resizeAndRedraw(),this._maximized=!0,this.updateMaximizeIcon(),this._stopTrackingResize=l(window,(function(){return t.resizeAndRedraw()}))},t.prototype.minimize=function(){this._savedStyles&&(this._stopTrackingResize&&(this._stopTrackingResize(),this._stopTrackingResize=null),this._wrapper.style.position=this._savedStyles.wrapperPosition,this._wrapper.style.top=this._savedStyles.wrapperTop,this._wrapper.style.left=this._savedStyles.wrapperLeft,this._wrapper.style.width=this._savedStyles.wrapperWidth,this._wrapper.style.height=this._savedStyles.wrapperHeight,this._wrapper.style.zIndex=this._savedStyles.wrapperZIndex,this._wrapper.style.background=this._savedStyles.wrapperBackground,this._canvas.style.width=this._savedStyles.canvasStyleWidth,this._canvas.style.height=this._savedStyles.canvasStyleHeight,this._canvas.width=this._savedStyles.canvasAttrWidth,this._canvas.height=this._savedStyles.canvasAttrHeight,this.resizeAndRedraw(),this._maximized=!1,this._savedStyles=null,this.updateMaximizeIcon())},t.prototype.resizeAndRedraw=function(){var t=this._canvas.clientWidth,e=this._canvas.clientHeight;this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e),this._slate.update()},t.prototype.updateMaximizeIcon=function(){var t=this._maxIconCanvas,e=this._maxBtn;if(t){var n=t.getContext("2d");n.clearRect(0,0,i,i),this._maximized?(function(t,e){var n=e-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var r=4+n,o=4,i=4+.55*n,s=4+.45*n;t.beginPath(),t.moveTo(r,o),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i+5,s),t.lineTo(i,s-5),t.closePath(),t.fill(),r=4,o=4+n,i=4+.45*n,s=4+.55*n,t.beginPath(),t.moveTo(r,o),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i-5,s),t.lineTo(i,s+5),t.closePath(),t.fill()}(n,i),e.title="Minimize (m)"):(p(n,i),e.title="Maximize (m)")}},t.prototype.onNewWindow=function(){for(var t=document.querySelectorAll("script[src]"),e="bundle.js",n=0;n<t.length;n++){var r=t[n].src;if(r.indexOf("bundle.js")>=0){e=r;break}}var o=Object.assign({},this._config,{canvasid:"canvasId"}),i=JSON.stringify(o),s=this._config.title||"Geometry",a="<!DOCTYPE html>\n<html><head><title>".concat(s,'</title></head>\n<body style="margin:0;padding:0;overflow:hidden;">\n<canvas id="canvasId" style="width:100vw;height:100vh;"></canvas>\n<script src="').concat(e,'"><\/script>\n<script>geomlib.init(').concat(i,");<\/script>\n</body></html>"),l=window.open("","_blank");l&&(l.document.write(a),l.document.close())},t.prototype.onPresent=function(){this._presenting||0!==this._slate.slides.length&&(this._maximized||this.maximize(),this.buildPresentationOverlay(),this.bindPresentationKeys(),this._presenting=!0,this.showSlide(0))},t.prototype.exitPresent=function(){if(this._presenting){this.unbindPresentationKeys(),this.clearStickyRef(),this.removePresentationOverlay(),this._slate.clearVisibility();for(var t=0,e=this._slate.elements;t<e.length;t++){var n=e[t];n.shouldHighlight=!1,n.emphasized=!1}this._slate.update(),this._presenting=!1}},t.prototype.buildPresentationOverlay=function(){var t=this,e=document.createElement("div");e.className="geomlib-presentation-overlay",e.style.position="fixed",e.style.left="0",e.style.right="0",e.style.bottom="0",e.style.margin="0 auto",e.style.maxWidth="100vw",e.style.background="#ffffff",e.style.color="#222",e.style.borderTop="1px solid rgba(0,0,0,0.18)",e.style.boxShadow="0 -6px 18px rgba(0,0,0,0.18)",e.style.padding="12px 16px calc(12px + env(safe-area-inset-bottom, 0px))",e.style.zIndex="2147483647",e.style.fontFamily="Georgia, 'Times New Roman', serif",e.style.touchAction="manipulation",e.style.boxSizing="border-box",e.style.textAlign="center";var n=document.createElement("div");n.className="geomlib-presentation-caption",n.style.fontSize="1.1rem",n.style.lineHeight="1.45",n.style.textAlign="center",n.style.marginBottom="6px",e.appendChild(n);var r=document.createElement("div");r.className="geomlib-presentation-justs",r.style.fontSize="0.85rem",r.style.textAlign="center",r.style.opacity="0.85",r.style.minHeight="1em",r.style.marginBottom="10px",e.appendChild(r);var o=document.createElement("div");o.className="geomlib-presentation-nav",o.style.display="flex",o.style.gap="10px",o.style.alignItems="center",o.style.justifyContent="center";var i=c("‹ Prev"),s=document.createElement("span");s.className="geomlib-presentation-counter",s.style.minWidth="56px",s.style.textAlign="center",s.style.opacity="0.7",s.style.fontSize="0.9rem";var a=c("Next ›"),l=c("✕ Exit");l.style.marginLeft="16px",i.addEventListener("click",(function(e){e.stopPropagation(),t.showSlide(t._presentationIndex-1)})),a.addEventListener("click",(function(e){e.stopPropagation(),t.showSlide(t._presentationIndex+1)})),l.addEventListener("click",(function(e){e.stopPropagation(),t.exitPresent()})),o.appendChild(i),o.appendChild(s),o.appendChild(a),o.appendChild(l),e.appendChild(o),document.documentElement.appendChild(e),this._presentationOverlay=e,this._presentationCaption=n,this._presentationJusts=r,this._presentationCounter=s},t.prototype.removePresentationOverlay=function(){this._presentationOverlay&&this._presentationOverlay.parentNode&&this._presentationOverlay.parentNode.removeChild(this._presentationOverlay),this._presentationOverlay=null,this._presentationCaption=null,this._presentationJusts=null,this._presentationCounter=null},t.prototype.bindPresentationKeys=function(){var t=this,e=function(e){if(t._presenting)switch(e.key){case"ArrowLeft":e.preventDefault(),t.showSlide(t._presentationIndex-1);break;case"ArrowRight":case" ":e.preventDefault(),t.showSlide(t._presentationIndex+1);break;case"Escape":e.preventDefault(),t.exitPresent()}};this._presentationOnKey=e,document.addEventListener("keydown",e)},t.prototype.unbindPresentationKeys=function(){this._presentationOnKey&&(document.removeEventListener("keydown",this._presentationOnKey),this._presentationOnKey=null)},t.prototype.showSlide=function(t){var e=this._slate.slides;if(0!==e.length){var n=Math.max(0,Math.min(e.length-1,t));this._presentationIndex=n;var o=(0,r.computeSlideState)(this._slate,e,n);this.clearStickyRef();for(var i=e[n],s=i.transition,a=s&&s.animations,l=s&&"parallel"===s.mode?"parallel":"cascade",u=0,c=this._slate.elements;u<c.length;u++)(f=c[u]).emphasized=!1;if(a&&a.length>0)this._slate.animateTo(o.visible,o.highlighted,a,l);else{for(var h=0,p=this._slate.elements;h<p.length;h++){var f;null!=(f=p[h]).name&&(f.visible=o.visible.has(f.name),f.shouldHighlight=o.highlighted.has(f.name),f.drawProgress=1)}this._slate.update()}if(this._presentationCaption&&this.renderCaptionText(this._presentationCaption,i.text||""),this._presentationCounter&&(this._presentationCounter.textContent=n+1+" / "+e.length),this._presentationJusts){this._presentationJusts.innerHTML="";var _=this._slate.resolveJustification;if(i.justifications)for(var y=0;y<i.justifications.length;y++){if(y>0){var d=document.createElement("span");d.textContent=" · ",d.style.opacity="0.5",this._presentationJusts.appendChild(d)}var v=i.justifications[y].ref,g=_?_(v):null;if(g){var m=document.createElement("a");m.href=g,m.textContent=v,m.target="_blank",m.rel="noopener",m.style.color="#0066cc",this._presentationJusts.appendChild(m)}else{var P=document.createElement("span");P.textContent=v,this._presentationJusts.appendChild(P)}}}}},t.prototype.renderCaptionText=function(t,e){t.innerHTML="";for(var n,r=/\{([A-Za-z][A-Za-z0-9'\-]*)\}/g,o=0;null!==(n=r.exec(e));){n.index>o&&t.appendChild(document.createTextNode(e.slice(o,n.index)));var i=n[1],s=this._slate.lookupElement(i);s?t.appendChild(this.buildCaptionRef(i,s)):t.appendChild(document.createTextNode(i)),o=n.index+n[0].length}o<e.length&&t.appendChild(document.createTextNode(e.slice(o)))},t.prototype.buildCaptionRef=function(t,e){var n=this,r=document.createElement("span");return r.className="geomlib-presentation-ref",r.textContent=t,r.style.fontWeight="700",r.style.fontStyle="italic",r.style.cursor="pointer",r.style.borderBottom="1px dotted currentColor",r.addEventListener("mouseenter",(function(){null==n._stickyRefSpan&&(e.emphasized=!0,n._slate.update())})),r.addEventListener("mouseleave",(function(){null==n._stickyRefSpan&&(e.emphasized=!1,n._slate.update())})),r.addEventListener("pointerdown",(function(t){t.preventDefault(),t.stopPropagation();var o=n._stickyRefSpan===r;n.clearStickyRef(),o||n.setStickyRef(r,e),n._slate.update()})),r},t.prototype.clearStickyRef=function(){null!=this._stickyRefSpan&&(this._stickyRefSpan.classList.remove("active"),this._stickyRefSpan.style.color=""),null!=this._stickyRefElem&&(this._stickyRefElem.emphasized=!1),this._stickyRefSpan=null,this._stickyRefElem=null},t.prototype.setStickyRef=function(t,e){t.classList.add("active"),t.style.color="#b08800",e.emphasized=!0,this._stickyRefSpan=t,this._stickyRefElem=e},t}();function c(t){var e=document.createElement("button");return e.textContent=t,e.style.background="rgba(0,0,0,0.08)",e.style.color="#222",e.style.border="1px solid rgba(0,0,0,0.15)",e.style.borderRadius="4px",e.style.padding="10px 16px",e.style.minHeight="44px",e.style.cursor="pointer",e.style.fontFamily="inherit",e.style.fontSize="1rem",e.style.touchAction="manipulation",e.addEventListener("mouseenter",(function(){e.style.background="rgba(0,0,0,0.16)"})),e.addEventListener("mouseleave",(function(){e.style.background="rgba(0,0,0,0.08)"})),e}function h(t,e){var n=e/2,r=e/2,o=.32*e;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5,t.beginPath(),t.arc(n,r,o,.5*-Math.PI,.75*Math.PI),t.stroke();var i=.75*Math.PI,s=n+o*Math.cos(i),a=r+o*Math.sin(i),l=i+.3*Math.PI,u=i+.9*Math.PI;t.beginPath(),t.moveTo(s,a),t.lineTo(s+4*Math.cos(l),a+4*Math.sin(l)),t.lineTo(s+4*Math.cos(u),a+4*Math.sin(u)),t.closePath(),t.fill()}function p(t,e){var n=e-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var r=4+.55*n,o=4+.45*n,i=4+n,s=4;t.beginPath(),t.moveTo(r,o),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i-5,s),t.lineTo(i,s+5),t.closePath(),t.fill(),r=4+.45*n,o=4+.55*n,i=4,s=4+n,t.beginPath(),t.moveTo(r,o),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i+5,s),t.lineTo(i,s-5),t.closePath(),t.fill()}function f(t,e){var n=e-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var r=4+.3*n,o=.65*n,i=.7*n;t.strokeRect(4,r,o,i);var s=4+.4*n,a=4+.6*n,l=4+n;t.beginPath(),t.moveTo(s,a),t.lineTo(l,4),t.stroke(),t.beginPath(),t.moveTo(l,4),t.lineTo(l-5,4),t.lineTo(l,9),t.closePath(),t.fill()}function _(t,e){var n=.28*e,r=n-1,o=e-n+2,i=n,s=e-n;t.fillStyle="rgba(0,0,0,0.7)",t.beginPath(),t.moveTo(r,i),t.lineTo(r,s),t.lineTo(o,e/2),t.closePath(),t.fill()}},7233(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InstantAnimation=e.Animation=e.A=e.AllAnimations=void 0,e.registerAnimation=p,e.findAnimation=function(t){var e;if(null==(e="string"==typeof t?c.get(t):u.get(t))){var n=String(t);return h.has(n)||(h.add(n),"undefined"!=typeof console&&console.warn&&console.warn("[geomlib] unknown animation '"+n+"' — falling back to instant")),null}return null!=e?e:null};var i,s=n(8020);!function(t){t[t.INSTANT=0]="INSTANT",t[t.POINT_APPEAR=1]="POINT_APPEAR",t[t.POINT_INTERSECT=2]="POINT_INTERSECT",t[t.LINE_STRAIGHT_EDGE_CONNECT=3]="LINE_STRAIGHT_EDGE_CONNECT",t[t.LINE_STRAIGHT_EDGE_EXTEND=4]="LINE_STRAIGHT_EDGE_EXTEND",t[t.LINE_COMPASS_TRANSFER=5]="LINE_COMPASS_TRANSFER",t[t.CIRCLE_COMPASS=6]="CIRCLE_COMPASS",t[t.CIRCLE_COMPASS_EXPLICIT=7]="CIRCLE_COMPASS_EXPLICIT",t[t.POLYGON_OUTLINE=8]="POLYGON_OUTLINE",t[t.POLYGON_OUTLINE_AND_FILL=9]="POLYGON_OUTLINE_AND_FILL"}(i||(e.AllAnimations=i={})),e.A={Point:{appear:i.POINT_APPEAR,intersect:i.POINT_INTERSECT},Line:{straightEdgeConnect:i.LINE_STRAIGHT_EDGE_CONNECT,straightEdgeExtend:i.LINE_STRAIGHT_EDGE_EXTEND,compassTransfer:i.LINE_COMPASS_TRANSFER},Circle:{compass:i.CIRCLE_COMPASS,compassExplicit:i.CIRCLE_COMPASS_EXPLICIT},Polygon:{outline:i.POLYGON_OUTLINE,outlineAndFill:i.POLYGON_OUTLINE_AND_FILL},instant:i.INSTANT};var a=function(){};e.Animation=a;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.INSTANT,e.name="instant",e.elementType=s.GeomElement,e}return o(e,t),e.prototype.build=function(t,e,n){return[{durationMs:0,tick:function(){},finalise:function(){t.drawProgress=1,t.visible=!0}}]},e}(a);e.InstantAnimation=l;var u=new Map,c=new Map,h=new Set;function p(t){u.set(t.animationMethod,t),c.set(t.name,t)}p(new l)},7658(t,e,n){var r,o,i,s,a,l,u,c,h,p=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.constructions=e.Construction=e.E=e.PolyhedraConstructions=e.SphereConstructions=e.PlaneConstructions=e.SectorConstructions=e.PolygonConstructions=e.CircleConstructions=e.LineConstructions=e.PointConstructions=e.ConstructionTypes=void 0,e.getConstructionName=function(t){return t<100?"Point."+o[t]:100<t&&t<200?"Line."+i[t]:300<t&&t<400?"Polygon."+a[t]:400<t&&t<500?"Sector."+l[t]:500<t&&t<600?"Plane."+u[t]:600<t&&t<700?"Sphere."+c[t]:700<t&&t<800?"Polyhedra."+h[t]:"<Not Valid Construction>"},function(t){t[t.Integer=0]="Integer",t[t.PointElement=1]="PointElement",t[t.CircleElement=2]="CircleElement",t[t.PlaneElement=3]="PlaneElement",t[t.SphereElement=4]="SphereElement",t[t.PolygonElement=5]="PolygonElement",t[t.PolyhedronElement=6]="PolyhedronElement"}(r||(e.ConstructionTypes=r={})),function(t){t[t.free=1]="free",t[t.midpoint=2]="midpoint",t[t.intersection=3]="intersection",t[t.first=4]="first",t[t.last=5]="last",t[t.center=6]="center",t[t.lineSlider=7]="lineSlider",t[t.circleSlider=8]="circleSlider",t[t.circumcenter=9]="circumcenter",t[t.vertex=10]="vertex",t[t.foot=11]="foot",t[t.cutoff=12]="cutoff",t[t.extend=13]="extend",t[t.parallelogram=14]="parallelogram",t[t.similar=15]="similar",t[t.perpendicular=16]="perpendicular",t[t.proportion=17]="proportion",t[t.invert=18]="invert",t[t.meanProportional=19]="meanProportional",t[t.planeSlider=20]="planeSlider",t[t.sphereSlider=21]="sphereSlider",t[t.angleBisector=22]="angleBisector",t[t.angleDivider=23]="angleDivider",t[t.fixed=24]="fixed",t[t.lineSegmentSlider=25]="lineSegmentSlider",t[t.harmonic=26]="harmonic"}(o||(e.PointConstructions=o={})),function(t){t[t.connect=101]="connect",t[t.angleBisector=102]="angleBisector",t[t.angleDivider=103]="angleDivider",t[t.foot=104]="foot",t[t.chord=105]="chord",t[t.bichord=106]="bichord",t[t.perpendicular=107]="perpendicular",t[t.cutoff=108]="cutoff",t[t.extend=109]="extend",t[t.parallel=110]="parallel",t[t.similar=111]="similar",t[t.proportion=112]="proportion",t[t.meanProportional=113]="meanProportional"}(i||(e.LineConstructions=i={})),function(t){t[t.radius=201]="radius",t[t.circumcircle=202]="circumcircle",t[t.invert=203]="invert",t[t.intersection=204]="intersection"}(s||(e.CircleConstructions=s={})),function(t){t[t.square=301]="square",t[t.triangle=302]="triangle",t[t.quadrilateral=303]="quadrilateral",t[t.pentagon=304]="pentagon",t[t.hexagon=305]="hexagon",t[t.equilateralTriangle=306]="equilateralTriangle",t[t.parallelogram=307]="parallelogram",t[t.regularPolygon=308]="regularPolygon",t[t.starPolygon=309]="starPolygon",t[t.similar=310]="similar",t[t.application=311]="application",t[t.octagon=312]="octagon",t[t.face=313]="face"}(a||(e.PolygonConstructions=a={})),function(t){t[t.sector=401]="sector",t[t.arc=402]="arc"}(l||(e.SectorConstructions=l={})),function(t){t[t.threePoints=501]="threePoints",t[t.perpendicular=502]="perpendicular",t[t.parallel=503]="parallel",t[t.ambient=504]="ambient"}(u||(e.PlaneConstructions=u={})),function(t){t[t.radius=601]="radius"}(c||(e.SphereConstructions=c={})),function(t){t[t.tetrahedron=701]="tetrahedron",t[t.parallelepiped=702]="parallelepiped",t[t.prism=703]="prism",t[t.pyramid=704]="pyramid"}(h||(e.PolyhedraConstructions=h={})),e.E={Point:o,Line:i,Circle:s,Polygon:a,Sector:l,Plane:u,Sphere:c,Polyhedra:h};var f=function(){function t(){}return t.prototype.validateSignature=function(t,e){if(t!=this.constructionMethod)return!1;var n=this.signature;if(n.points!==e.P.length)return!1;if(n.elements!==e.E.length)return!1;if(n.integers!==e.N.length)return!1;if(n.elementTypes)for(var r=0;r<n.elementTypes.length;r++)if(!(e.E[r]instanceof n.elementTypes[r]))return!1;return!0},t}();e.Construction=f;var _=n(4461),y=n(7339),d=n(9275),v=n(4133),g=n(5755),m=n(5193),P=n(8649),C=n(1099);e.constructions=p(p(p(p(p(p(p(p([],_.pointConstructions,!0),y.lineConstructions,!0),d.circleConstructions,!0),g.sectorConstructions,!0),v.polygonConstructions,!0),m.planeConstructions,!0),P.sphereConstructions,!0),C.polyhedronConstructions,!0)},8020(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GeomElement=e.Align=void 0,function(t){t[t.CENTRAL=0]="CENTRAL",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW"}(n||(e.Align=n={}));var r=function(){function t(){this.preexists=!1,this._nameColor=null,this._vertexColor=null,this._edgeColor=null,this._faceColor=null,this._nameHighlightColor="#FFD700",this._vertexHighlightColor="#FFD700",this._edgeHighlightColor="#FFD700",this._faceHighlightColor="#FFD700",this._shouldHighlight=!1,this._visible=!0,this._emphasisAmount=0,this._drawProgress=1,this._pixelTolerance=50}return t.setFont=function(e,n){t._font="italic ".concat(n,"px ").concat(e)},t.prototype._getTextMetrics=function(t,e){var n=t.measureText(e);return[n.width,null!=n.actualBoundingBoxAscent?n.actualBoundingBoxAscent+n.actualBoundingBoxDescent:16]},t.prototype.drawString=function(e,r,o,i){var s=o.getContext("2d");if(null!=this._nameColor){s.font=t._font,s.fillStyle=this._nameColor;var a=this._getTextMetrics(s,this._name),l=a[0],u=a[1];switch(i||this._align){case n.LEFT:return e=e-l-6,r=r+u/2-4,void s.fillText(this._name,e,r);case n.RIGHT:return e+=2,r+=u/2-4,void s.fillText(this._name,e,r);case n.ABOVE:return e-=l/2,r+=-u/2+4,void s.fillText(this._name,e,r);case n.BELOW:return e-=l/2,r+=u/2+6,void s.fillText(this._name,e,r)}var c=o.width,h=o.height,p=(e-c/2)*h,f=(r-h/2)*c;f>p?f>=-p?(e-=l/2,r+=u/2+6,s.fillText(this._name,e,r)):(e=e-l-6,r+=u/2-4,s.fillText(this._name,e,r)):f>=-p?(e+=2,r+=u/2-4,s.fillText(this._name,e,r)):(e-=l/2,r+=-u/2+4,s.fillText(this._name,e,r))}},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.update()},t.prototype.defined=function(){return!1},t.prototype.drag=function(t,e){return!1},Object.defineProperty(t.prototype,"nameColor",{get:function(){return this._nameColor},set:function(t){this._nameColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeColor",{get:function(){return this._edgeColor},set:function(t){this._edgeColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceColor",{get:function(){return this._faceColor},set:function(t){this._faceColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameHighlightColor",{get:function(){return this._nameHighlightColor},set:function(t){this._nameHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexHighlightColor",{get:function(){return this._vertexHighlightColor},set:function(t){this._vertexHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeHighlightColor",{get:function(){return this._edgeHighlightColor},set:function(t){this._edgeHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceHighlightColor",{get:function(){return this._faceHighlightColor},set:function(t){this._faceHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"draggable",{get:function(){return this._draggable},set:function(t){this._draggable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimension",{get:function(){return this._dimension},set:function(t){this._dimension=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldHighlight",{get:function(){return this._shouldHighlight},set:function(t){this._shouldHighlight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"emphasized",{get:function(){return this._emphasisAmount>0},set:function(t){this._emphasisAmount=t?1:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"emphasisAmount",{get:function(){return this._emphasisAmount},set:function(t){this._emphasisAmount=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawProgress",{get:function(){return this._drawProgress},set:function(t){this._drawProgress=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexColor",{get:function(){return this._vertexColor},set:function(t){this._vertexColor=t},enumerable:!1,configurable:!0}),t._font="italic 18px Times New Roman",t}();e.GeomElement=r},9222(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleCompassAnimation=void 0;var i=n(7233),s=n(1313),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.CIRCLE_COMPASS,e.name="Circle.compass",e.elementType=s.CircleElement,e.defaultRate=.003,e.defaultDurationMs=600,e}return o(e,t),e.prototype.build=function(t,e,n){var r=t,o=n&&"number"==typeof n.startAngle?n.startAngle:Math.atan2(r.B.y-r.Center.y,r.B.x-r.Center.x),i=2*Math.PI/this.defaultRate;return[{durationMs:i,setup:function(){r.drawStartAngle=o,r.faceAlpha=0,r.drawProgress=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}},{durationMs:Math.min(i/2,this.defaultDurationMs),tick:function(t){r.faceAlpha=t},finalise:function(){r.faceAlpha=1,r.drawProgress=1,r.drawStartAngle=0,r.visible=!0}}]},e}(i.Animation);e.CircleCompassAnimation=a,(0,i.registerAnimation)(new a)},9275(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.circleConstructions=e.SphereIntersectionConstruction=e.InvertCircleConstruction=e.CircleRadius3PointConstruction=e.CircleRadiusCenterConstruction=void 0;var i=n(7658),s=n(1313),a=n(4021),l=n(8157),u=n(6055),c=n(2295),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.radius,e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof u.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new s.CircleElement({C:e[0],B:e[1],AP:o});return[[i],i]},e}(i.Construction);e.CircleRadiusCenterConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.radius,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof u.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new s.CircleElement({C:e[0],A:e[1],B:e[2],AP:o});return[[i],i]},e}(i.Construction);e.CircleRadius3PointConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.invert,e.signature={points:0,elements:2,integers:0,elementTypes:[s.CircleElement,s.CircleElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new a.InvertCircleElement(n[0],n[1]);return[[o],o]},e}(i.Construction);e.InvertCircleConstruction=f;var _=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.intersection,e.signature={points:0,elements:2,integers:0,elementTypes:[c.SphereElement,c.SphereElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new l.SphereIntersectionElement(n[0],n[1]);return[[o],o]},e}(i.Construction);e.SphereIntersectionConstruction=_,e.circleConstructions=[new p,new h,new f,new _]},1313(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleElement=void 0;var i=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n._drawStartAngle=0,n._faceAlpha=1,n.dimension=2,null==e||(n.Center=e.C,n.A=null!=e.A?e.A:n.Center,n.B=e.B,n.AP=e.AP),n}return o(e,t),Object.defineProperty(e.prototype,"drawStartAngle",{get:function(){return this._drawStartAngle},set:function(t){this._drawStartAngle=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return this.A.distance(this.B)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius2",{get:function(){return this.A.distance2(this.B)},enumerable:!1,configurable:!0}),e.prototype.defined=function(){return!0},e.prototype._drawCircleArc=function(t,e,n){t.beginPath();var r=this.radius2,o=Math.sqrt(r),i=this.AP.S.z*this.AP.S.z+this.AP.T.z*this.AP.T.z;if(Math.abs(i)<.01)t.ellipse(this.Center.x,this.Center.y,o,o,0,e,n);else{var s=o/Math.sqrt(i),a=s*this.AP.T.z,l=-s*this.AP.S.z,u=a*this.AP.S.x+l*this.AP.T.x,c=a*this.AP.S.y+l*this.AP.T.y,h=i<1?Math.sqrt(1-i):0,p=-h*c,f=h*u,_=Math.sqrt(u*u+c*c),y=Math.sqrt(p*p+f*f);if(y<.5)return t.moveTo(this.Center.x-u,this.Center.y-c),void t.lineTo(this.Center.x+u,this.Center.y+c);var d=Math.atan2(c,u);t.ellipse(this.Center.x,this.Center.y,_,y,d,e,n)}},e.prototype.drawEdge=function(t){if(this.visible&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.strokeStyle=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;var n=this.shouldHighlight?3:1;e.lineWidth=n+this.emphasisAmount*(6-n);var r=this.drawStartAngle,o=r+2*Math.PI*this.drawProgress;this._drawCircleArc(e,r,o),e.stroke()}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()){var e=this.faceAlpha;if(!(e<=0)){var n=t.getContext("2d");n.fillStyle=this.faceColor,this._drawCircleArc(n,0,2*Math.PI),e<1?(n.save(),n.globalAlpha=e,n.fill(),n.restore()):n.fill()}}},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name){var e=t.getContext("2d");e.strokeStyle=this.nameColor,e.font=i.GeomElement._font;var n=this._getTextMetrics(e,this.name),r=n[0],o=n[1];e.fillText(this._name,this.Center.x-r/2,this.Center.y-o/2)}},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(i.GeomElement);e.CircleElement=s},2218(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircumcircleElement=void 0;var i=n(6091),s=function(t){function e(e,n,r,o){var s=t.call(this)||this;return s.dimension=2,s.B=e,s.C=n,s.D=r,s.AP=o,s.Center=new i.PointElement({AP:o}),s.A=s.Center,s}return o(e,t),e.prototype.update=function(){this.Center.toCircumcenter(this.B,this.C,this.D)},e.prototype.translate=function(t,e){this.Center.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n)},e}(n(1313).CircleElement);e.CircumcircleElement=s},4021(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvertCircleElement=void 0;var i=n(1313),s=n(6091),a=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=2,r._C=e,r._D=n,r.AP=e.AP,r.Center=new s.PointElement({AP:r.AP}),r.A=r.Center,r.B=new s.PointElement({AP:r.AP}),r}return o(e,t),e.prototype.update=function(){var t=this._C.Center.distance2(this._D.Center),e=this._C.radius2,n=this._D.radius2/(t-e);this.Center.to(this._C.Center).minus(this._D.Center).times(n).plus(this._D.Center),n=1+Math.sqrt(e/t),this.B.to(this.Center).minus(this._D.Center).times(n).plus(this._D.Center)},e.prototype.translate=function(t,e){this.Center.translate(t,e),this.B.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n),this.B.rotate(t,e,n)},e}(i.CircleElement);e.InvertCircleElement=a},8157(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereIntersectionElement=void 0;var i=n(1313),s=n(6091),a=n(103),l=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=2,r._S=e,r._T=n,r.Center=r.A=new s.PointElement,r.B=new s.PointElement,r.AP=new a.PerpendicularPlane({A:r.Center,E:n.Center}),r.Center._AP=r.AP,r}return o(e,t),e.prototype.update=function(){var t=this._T.Center.distance2(this._S.Center),e=this._T.radius2(),n=.5+(e-this._S.radius2())/(2*t);this.Center.to(this._S.Center).minus(this._T.Center).times(n).plus(this._T.Center);var r=Math.sqrt(e-this.Center.distance2(this._T.Center));this.B.to(this.Center),this.B.z+=r,this.AP.update()},e.prototype.translate=function(t,e){this.Center.translate(t,e),this.B.translate(t,e),this.AP.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n),this.B.rotate(t,e,n),this.AP.rotate(t,e,n)},e}(i.CircleElement);e.SphereIntersectionElement=l},5002(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Bichord=void 0;var i=n(2145),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._A=new s.PointElement,n._B=new s.PointElement,n.C=e.C,n.D=e.D,n._A._AP=n.C.AP,n._B._AP=n.C.AP),n}return o(e,t),e.prototype.translate=function(t,e){this._A.translate(t,e),this._B.translate(t,e)},e.prototype.rotate=function(t,e,n){this._A.rotate(t,e,n),this._B.rotate(t,e,n)},e.prototype.update=function(){var t=this.C.radius,e=this.D.radius,n=this.C.Center.distance(this.D.Center);if(n>t+e){var r=NaN;return this.A.x=r,this.A.y=r,this.A.z=r,this.B.x=r,this.B.y=r,void(this.B.z=r)}var o=(n*n+t*t-e*e)/(2*n*t),i=Math.sqrt(1-o*o);this.A.to(this.D.Center).toCircle(this.C),this.B.to(this.A),this.A.rotate(this.C.Center,o,i,this.C.AP),this.B.rotate(this.C.Center,o,-i,this.C.AP)},e}(i.LineElement);e.Bichord=a},1549(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Chord=void 0;var i=n(2145),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n.C=e.C,n.D=e.D,n.E=e.E,n._A=new s.PointElement({AP:n.C.AP}),n._B=new s.PointElement({AP:n.C.AP})),n}return o(e,t),e.prototype.translate=function(t,e){this._A.translate(t,e),this._B.translate(t,e)},e.prototype.rotate=function(t,e,n){this._A.rotate(t,e,n),this._B.rotate(t,e,n)},e.prototype.update=function(){this._B.to(this.C.Center).toLine(this.D,this.E,!1);var t=this.C.Center.distance2(this._B),e=this.C.radius2;if(t>e){var n=NaN;return this._A.x=n,this._A.y=n,this._A.z=n,this._B.x=n,this._B.y=n,void(this._B.z=n)}var r=Math.sqrt(e-t),o=r/this.D.distance(this._B);o<1e10?this._A.to(this.D).minus(this._B).times(o).plus(this._B):(o=r/this.E.distance(this._B),this._A.to(this.E).minus(this._B).times(o).plus(this._B)),this._B.times(2).minus(this._A)},e}(i.LineElement);e.Chord=a},1910(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineStraightEdgeExtendAnimation=e.LineStraightEdgeConnectAnimation=void 0;var i=n(7233),s=n(2145);function a(t,e){var n=t.B.x-t.A.x,r=t.B.y-t.A.y,o=Math.sqrt(n*n+r*r);return{durationMs:Math.max(120,o/e),tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1,t.visible=!0}}}var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.LINE_STRAIGHT_EDGE_CONNECT,e.name="Line.straightEdgeConnect",e.elementType=s.LineElement,e.defaultRate=.25,e}return o(e,t),e.prototype.build=function(t,e,n){return[a(t,this.defaultRate)]},e}(i.Animation);e.LineStraightEdgeConnectAnimation=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.LINE_STRAIGHT_EDGE_EXTEND,e.name="Line.straightEdgeExtend",e.elementType=s.LineElement,e.defaultRate=.25,e}return o(e,t),e.prototype.build=function(t,e,n){return[a(t,this.defaultRate)]},e}(i.Animation);e.LineStraightEdgeExtendAnimation=u,(0,i.registerAnimation)(new l),(0,i.registerAnimation)(new u)},7339(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.lineConstructions=e.MeanProportionalLineConstruction=e.ProportionLineConstruction=e.SimilarLineConstruction=e.LineParallelConstruction=e.LineExtendConstruction=e.LineCutoffConstruction=e.LinePerpendicular5Construction=e.LinePerpendicular4Construction=e.LinePerpendicular3Construction=e.LinePerpendicular2Construction=e.LinePerpendicular1Construction=e.BichordConstruction=e.ChordConstruction=e.PlaneFootLineConstruction=e.LineFootConstruction=e.AngleDividerLineConstruction=e.AngleBisectorLineConstruction=e.LineConnectConstruction=void 0;var i=n(7658),s=n(4461),a=n(1313),l=n(6055),u=n(2090),c=n(6921),h=n(3703),p=n(2145),f=n(5002),_=n(1549),y=n(5014),d=n(9535),v=n(9237),g=n(3219),m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.connect,e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new p.LineElement({A:e[0],B:e[1]});return[[o],o]},e}(i.Construction);e.LineConnectConstruction=m;var P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.angleBisector,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new v.AngleDividerElement(e[0],e[1],e[2],o,2),s=new p.LineElement({A:e[1],B:i});return[[i,s],s]},e}(i.Construction);e.AngleBisectorLineConstruction=P;var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.angleDivider,e.signature={points:3,elements:0,integers:1},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new v.AngleDividerElement(e[0],e[1],e[2],o,r[0]),s=new p.LineElement({A:e[1],B:i});return[[i,s],s]},e}(i.Construction);e.AngleDividerLineConstruction=C;var w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.foot,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new c.Foot(e[0],e[1],e[2]),i=new p.LineElement({A:e[0],B:o});return[[o,i],i]},e}(i.Construction);e.LineFootConstruction=w;var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.foot,e.signature={points:1,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new h.PlaneFootElement(e[0],n[0]),i=new p.LineElement({A:e[0],B:o});return[[o,i],i]},e}(i.Construction);e.PlaneFootLineConstruction=x;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.chord,e.signature={points:2,elements:1,integers:0,elementTypes:[a.CircleElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new _.Chord({D:e[0],E:e[1],C:n[0]});return[[o],o]},e}(i.Construction);e.ChordConstruction=E;var b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.bichord,e.signature={points:0,elements:2,integers:0,elementTypes:[a.CircleElement,a.CircleElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new f.Bichord({C:n[0],D:n[1]});return[[o],o]},e}(i.Construction);function A(t){return[t[0],t[0][0]]}e.BichordConstruction=b;var S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return o(e,t),e.prototype.construct=function(e,n,r,o){return A(t.prototype.construct.call(this,e,n,r,o))},e}(s.PointPerpendicular1Construction);e.LinePerpendicular1Construction=S;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return o(e,t),e.prototype.construct=function(e,n,r,o){return A(t.prototype.construct.call(this,e,n,r,o))},e}(s.PointPerpendicular2Construction);e.LinePerpendicular2Construction=O;var M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return o(e,t),e.prototype.construct=function(e,n,r,o){return A(t.prototype.construct.call(this,e,n,r,o))},e}(s.PointPerpendicular3Construction);e.LinePerpendicular3Construction=M;var T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return o(e,t),e.prototype.construct=function(e,n,r,o){return A(t.prototype.construct.call(this,e,n,r,o))},e}(s.PointPerpendicular4Construction);e.LinePerpendicular4Construction=T;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return o(e,t),e.prototype.construct=function(e,n,r,o){return A(t.prototype.construct.call(this,e,n,r,o))},e}(s.PointPerpendicular5Construction);e.LinePerpendicular5Construction=j;var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.cutoff,e.signature={points:4,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new u.Layoff(e[0],e[0],e[1],e[2],e[3]),i=new p.LineElement({A:e[0],B:o});return[[o,i],i]},e}(i.Construction);e.LineCutoffConstruction=B;var L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.extend,e.signature={points:4,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new u.Layoff(e[1],e[0],e[1],e[2],e[3]),i=new p.LineElement({A:e[1],B:o});return[[o,i],i]},e}(i.Construction);e.LineExtendConstruction=L;var z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.parallel,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new u.Layoff(e[0],e[1],e[2],e[1],e[2]),i=new p.LineElement({A:e[0],B:o});return[[o,i],i]},e}(i.Construction);e.LineParallelConstruction=z;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=n.length>1?n[1]:t,s=new y.SimilarElement(e[0],e[1],o,e[2],e[3],e[4],i),a=new p.LineElement({A:e[0],B:s});return[[s,a],a]},e}(i.Construction);e.SimilarLineConstruction=I;var k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.proportion,e.signature={points:8,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new d.ProportionElement(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),i=new p.LineElement({A:e[6],B:o});return[[o,i],i]},e}(i.Construction);e.ProportionLineConstruction=k;var N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.meanProportional,e.signature={points:6,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new g.MeanProportionalElement(e[0],e[1],e[2],e[3],e[4],e[5]),i=new p.LineElement({A:e[4],B:o});return[[o,i],i]},e}(i.Construction);e.MeanProportionalLineConstruction=N,e.lineConstructions=[new m,new L,new S,new O,new M,new T,new j,new b,new E,new z,new B,new x,new w,new I,new k,new P,new C,new N]},2145(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;var i=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,n._A=e&&e.A||null,n._B=e&&e.B||null,n}return o(e,t),Object.defineProperty(e.prototype,"A",{get:function(){return this._A},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"B",{get:function(){return this._B},enumerable:!1,configurable:!0}),e.prototype.drawEdge=function(t,e){if(this.visible&&(null==e&&(e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=e)){var n=t.getContext("2d");n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=r+this.emphasisAmount*(6-r);var o=this.drawProgress,i=this._A.x+(this._B.x-this._A.x)*o,s=this._A.y+(this._B.y-this._A.y)*o;n.beginPath(),n.moveTo(this._A.x,this._A.y),n.lineTo(i,s),n.stroke()}},e.prototype.drawFace=function(t){},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name&&null!=this._A&&this._A.defined()&&null!=this._B&&this._B.defined()){var e=Math.round((this._A.x+this._B.x)/2),n=Math.round((this._A.y+this._B.y)/2);this.drawString(e,n,t)}},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(n(8020).GeomElement);e.LineElement=i},6279(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Perpendicular=void 0;var i=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._P=e.P,n._A=new i.PointElement({AP:e.P}),n._B=new i.PointElement({AP:e.P}),n._C=e.C,n._D=e.D,n._E=e.E,n._F=e.F),n}return o(e,t),e.prototype.rotate=function(t,e,n){this.A.rotate(t,e,n),this.B.rotate(t,e,n)},e.prototype.translate=function(t,e){this.A.translate(t,e),this.B.translate(t,e)},e.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.to(this._D).minus(this._A);var t=i.PointElement.dot(this.B,this._P.S),e=i.PointElement.dot(this.B,this._P.T),n=Math.sqrt(this._E.distance2(this._F)/(t*t+e*e));t=-t/n,e/=n,this._B.x=e*this._P.S.x+t*this._P.T.x+this._A.x,this._B.y=e*this._P.S.y+t*this._P.T.y+this._A.y,this._B.z=e*this._P.S.z+t*this._P.T.z+this._A.z},e}(n(2145).LineElement);e.Perpendicular=s},3375(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlanePerpendicularLine=void 0;var i=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._A=new i.PointElement({AP:e.P}),n._B=new i.PointElement,n._C=e.C,n._D=e.D,n._E=e.E,n._P=e.P),n}return o(e,t),e.prototype.rotate=function(t,e,n){this.A.rotate(t,e,n),this.B.rotate(t,e,n)},e.prototype.translate=function(t,e){this.A.translate(t,e),this.B.translate(t,e)},e.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.toCross(this._P.S,this._P.T),this._B.times(this._D.distance(this._E)).plus(this._A)},e}(n(2145).LineElement);e.PlanePerpendicularLine=s},9362(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ParallelPlane=void 0;var i=n(6055),s=n(6091),a=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=2,r._P=e,r.A=n,r.B=new s.PointElement,r.C=new s.PointElement,r.S=e.S,r.T=e.T,r.U=e.U,r}return o(e,t),e.prototype.translate=function(t,e){this.B.translate(t,e),this.C.translate(t,e)},e.prototype.rotate=function(t,e,n){this.B.rotate(t,e,n),this.C.rotate(t,e,n)},e.prototype.update=function(){this.B.to(this._P.B).minus(this._P.A).plus(this.A),this.C.to(this._P.C).minus(this._P.A).plus(this.A)},e}(i.PlaneElement);e.ParallelPlane=a},103(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PerpendicularPlane=void 0;var i=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.A=e.A,n.E=e.E,n.B=new i.PointElement({AP:n}),n.C=new i.PointElement({AP:n}),n.S=new i.PointElement,n.T=new i.PointElement,n}return o(e,t),e.prototype.translate=function(t,e){this.B.translate(t,e),this.C.translate(t,e)},e.prototype.rotate=function(e,n,r){this.B.rotate(e,n,r),this.C.rotate(e,n,r),t.prototype.update.call(this)},e.prototype.update=function(){this.U=i.PointElement.difference(this.E,this.A);var t=this.U.length();this.U.times(1/t);var e=Math.sqrt(this.U.x*this.U.x+this.U.y*this.U.y);e>=1e-6?(this.S.x=-this.U.y/e,this.S.y=this.U.x/e,this.T.toCross(this.U,this.S)):(this.S.x=1,this.S.y=0,this.S.z=0,this.T.x=0,this.T.y=1,this.T.z=0),this.B.to(this.S).times(t).plus(this.A),this.C.to(this.T).times(t).plus(this.A)},e}(n(6055).PlaneElement);e.PerpendicularPlane=s},5193(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.planeConstructions=e.AmbientPlaneCircleConstruction=e.AmbientPlanePointConstruction=e.PlaneParallelConstruction=e.PerpendicularPlaneConstruction=e.Plane3PointsConstruction=void 0;var i=n(7658),s=n(1313),a=n(6055),l=n(103),u=n(9362),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.threePoints,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new a.PlaneElement({A:e[0],B:e[1],C:e[2]});return[[o],o]},e}(i.Construction);e.Plane3PointsConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.perpendicular,e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new l.PerpendicularPlane({A:e[0],E:e[1]});return[[o],o]},e}(i.Construction);e.PerpendicularPlaneConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.parallel,e.signature={points:1,elements:1,integers:0,elementTypes:[a.PlaneElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new u.ParallelPlane(n[0],e[0]);return[[o],o]},e}(i.Construction);e.PlaneParallelConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.ambient,e.signature={points:1,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){return[[e[0]._AP],e[0]._AP]},e}(i.Construction);e.AmbientPlanePointConstruction=f;var _=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.ambient,e.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=n[0];return[[o.AP],o.AP]},e}(i.Construction);e.AmbientPlaneCircleConstruction=_,e.planeConstructions=[new c,new h,new p,new f,new _]},6055(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneElement=void 0;var i=n(8020),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=2,n.isScreen=!1,null!=e&&(n.A=e.A,n.B=e.B,n.C=e.C,n.S=new s.PointElement,n.T=new s.PointElement,n.U=new s.PointElement),n}return o(e,t),e.prototype.defined=function(){return null!=this.A&&null!=this.B&&null!=this.C},e.prototype.drawEdge=function(t){if(this.visible&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.save(),e.strokeStyle=this.edgeColor;var n=this.B.x+this.C.x-this.A.x,r=this.B.y+this.C.y-this.A.y;e.beginPath(),e.moveTo(this.A.x,this.A.y),e.lineTo(this.B.x,this.B.y),e.lineTo(n,r),e.lineTo(this.C.x,this.C.y),e.closePath(),e.stroke(),e.restore()}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.save(),e.fillStyle=this.faceColor;var n=this.B.x+this.C.x-this.A.x,r=this.B.y+this.C.y-this.A.y;e.beginPath(),e.moveTo(this.A.x,this.A.y),e.lineTo(this.B.x,this.B.y),e.lineTo(n,r),e.lineTo(this.C.x,this.C.y),e.closePath(),e.fill(),e.restore()}},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()){var e=Math.round((this.B.x+this.C.x)/2),n=Math.round((this.B.y+this.C.y)/2);this.drawString(e,n,t)}},e.prototype.drawVertex=function(t){if(this.visible&&null!=this.vertexColor&&this.defined()){var e=t.getContext("2d"),n=this.B.x+this.C.x-this.A.x,r=this.B.y+this.C.y-this.A.y;e.beginPath(),e.fillStyle=this.vertexColor,e.arc(n,r,2,0,2*Math.PI,!1),e.fill()}},e.prototype.rotate=function(t,e,n){this.update()},e.prototype.translate=function(t,e){},e.prototype.update=function(){!this.isScreen||0==this.A.z&&0==this.B.z&&0==this.C.z||(this.isScreen=!1),this.S.to(this.B).minus(this.A),this.T.to(this.C).minus(this.A),this.S.times(1/this.S.length());var t=s.PointElement.dot(this.T,this.S);this.T.x-=t*this.S.x,this.T.y-=t*this.S.y,this.T.z-=t*this.S.z,this.T.times(1/this.T.length()),this.U.toCross(this.S,this.T)},e}(i.GeomElement);e.PlaneElement=a},9237(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AngleDividerElement=void 0;var i=function(t){function e(e,n,r,o,i){var s=t.call(this)||this;return s.dimension=0,s._A=n,s._B=e,s._C=r,s._AP=o,s._n=i,s}return o(e,t),e.prototype.update=function(){var t=this._A.angle(this._B,this._C,this._AP)/this._n,e=Math.cos(t),n=Math.sin(t);this._AP.isScreen?(this._x=this._A.x+e*(this._B.x-this._A.x)-n*(this._B.y-this._A.y),this._y=this._A.y+n*(this._B.x-this._A.x)+e*(this._B.y-this._A.y),this._z=0):this.to(this._B).rotate(this._A,e,n,this._AP),this.toIntersection(this,this._A,this._B,this._C,this._AP)},e}(n(6091).PointElement);e.AngleDividerElement=i},788(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleSlider=void 0;var i=n(6091),s=function(t){function e(e,n,r,o){var s=t.call(this)||this;return s._newP=new i.PointElement,s.dimension=0,s.draggable=!0,s._C=e,s._x=n,s._initx=n,s._y=r,s._inity=r,s._z=o,s._initz=o,s}return o(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toCircle(this._C)},e.prototype.update=function(){this.toCircle(this._C)},e.prototype.drag=function(t,e){return this._x=t,this._y=e,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._C.AP),this._newP.defined()||this._newP.to(this).toPlane(this._C.AP),this._newP.toSphere(this._C.Center,this._C.radius),!((this._newP.x-this.x)*(this._newP.x-this.x)+(this._newP.y-this.y)*(this._newP.y-this.y)<.5||(this.to(this._newP),0))},e}(i.PointElement);e.CircleSlider=s},6401(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FixedPoint=void 0;var i=function(t){function e(e){var n=t.call(this,e)||this;return n._initx=n._x,n._inity=n._y,n._initz=n._z,n}return o(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz},e}(n(6091).PointElement);e.FixedPoint=i},6921(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Foot=void 0;var i=function(t){function e(e,n,r){var o=t.call(this)||this;return o.dimension=0,o._A=e,o._B=n,o._C=r,o._B.AP==o._C.AP&&(o._AP=o._B.AP),o}return o(e,t),e.prototype.update=function(){this.to(this._A).toLine(this._B,this._C,!1)},e}(n(6091).PointElement);e.Foot=i},7876(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.HarmonicElement=void 0;var i=n(6091),s=function(t){function e(e,n,r){var o=t.call(this)||this;return o.dimension=0,o._B=e,o._C=n,o._D=r,o._E=new i.PointElement,o._F=new i.PointElement,o._M=new i.PointElement,o}return o(e,t),e.prototype.update=function(){if(0===this._B.z&&0===this._C.z&&0===this._D.z){var t=this._B.x-this._C.x,e=this._B.y-this._C.y,n=this._B.x-this._D.x,r=this._B.y-this._D.y,o=this._C.x*n-this._C.y*r,s=this._C.x*r+this._C.y*n,a=this._D.x*t-this._D.y*e,l=this._D.x*e+this._D.y*t,u=(n+t)*(n+t)+(r+e)*(r+e),c=(o+a)*(n+t)+(s+l)*(r+e),h=-(o+a)*(r+e)+(s+l)*(n+t);this._x=c/u,this._y=h/u}else{this._M.to(this._C).plus(this._D).times(.5),this._F.to(this._C).minus(this._M),this._E.to(this._B).minus(this._M);var p=1/this._E.length2(),f=this._F.length2();this.to(this._F).times(2*i.PointElement.dot(this._E,this._F)).minus(this._E.times(f)).times(p).plus(this._M)}},e}(i.PointElement);e.HarmonicElement=s},7832(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Intersection=void 0;var i=function(t){function e(e,n,r,o,i){var s=t.call(this,{AP:i})||this;return s.dimension=0,s.A=e,s.B=n,s.C=r,s.D=o,s}return o(e,t),e.prototype.update=function(){this.toIntersection(this.A,this.B,this.C,this.D,this.AP)},e}(n(6091).PointElement);e.Intersection=i},6015(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvertPointElement=void 0;var i=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._C=n,r._AP=n.AP,r}return o(e,t),e.prototype.update=function(){this.toInvertPoint(this._A,this._C)},e}(n(6091).PointElement);e.InvertPointElement=i},2090(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Layoff=void 0;var i=function(t){function e(e,n,r,o,i){var s=t.call(this)||this;return s.dimension=0,s._A=e,s._C=n,s._D=r,s._E=o,s._F=i,e.AP==n.AP&&e.AP==r.AP&&(s._AP=e.AP),s}return o(e,t),e.prototype.update=function(){var t=this._E.distance(this._F)/this._C.distance(this._D);this.to(this._D).minus(this._C),this.times(t).plus(this._A)},e}(n(6091).PointElement);e.Layoff=i},4610(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineSlider=void 0;var i=function(t){function e(e,n,r,o,i,s){var a=t.call(this)||this;return a.dimension=0,a.draggable=!0,a._A=e,a._B=n,a._x=r,a._initx=r,a._y=o,a._inity=o,a._z=i,a._initz=i,a._segment=s,a._A.AP==a._B.AP&&(a._AP=a._A.AP),a}return o(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toLine(this._A,this._B,this._segment)},e.prototype.update=function(){this.toLine(this._A,this._B,this._segment)},e.prototype.drag=function(t,e){t-=this._A.x,e-=this._A.y;var n=this._B.x-this._A.x,r=this._B.y-this._A.y,o=(t*n+e*r)/(n*n+r*r);return this._segment&&(o<0?o=0:o>1&&(o=1)),t=this._A.x+n*o,e=this._A.y+r*o,!((t-this._x)*(t-this._x)+(t-this._y)*(t-this._y)<.5||(this._x=t,this._y=e,this._z=this._A.z+(this._B.z-this._A.z)*o,0))},e}(n(6091).PointElement);e.LineSlider=i},3219(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MeanProportionalElement=void 0;var i=function(t){function e(e,n,r,o,i,s){var a=t.call(this)||this;return a.dimension=0,a._S0=e,a._S1=n,a._T0=r,a._T1=o,a._U0=i,a._U1=s,i._AP===s._AP&&(a._AP=i._AP),a}return o(e,t),e.prototype.update=function(){var t=Math.sqrt(this._S0.distance2(this._S1)*this._T0.distance2(this._T1));t=Math.sqrt(t/this._U0.distance2(this._U1)),this.to(this._U1).minus(this._U0),this.times(t).plus(this._U0)},e}(n(6091).PointElement);e.MeanProportionalElement=i},489(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Midpoint=void 0;var i=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._B=n,r._A.AP==r._B.AP&&(r._AP=r._A.AP),r}return o(e,t),e.prototype.update=function(){this._x=(this._A.x+this._B.x)/2,this._y=(this._A.y+this._B.y)/2,this._z=(this._A.z+this._B.z)/2},e}(n(6091).PointElement);e.Midpoint=i},3703(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneFootElement=void 0;var i=function(t){function e(e,n){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._AP=n,r}return o(e,t),e.prototype.update=function(){this.to(this._A).toPlane(this._AP)},e}(n(6091).PointElement);e.PlaneFootElement=i},2930(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneIntersection=void 0;var i=function(t){function e(e,n,r){var o=t.call(this)||this;return o.dimension=0,o._A=n,o._B=r,o._AP=e,o}return o(e,t),e.prototype.update=function(){this.toIntersectionPL(this._AP,this._A,this._B)},e}(n(6091).PointElement);e.PlaneIntersection=i},4994(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneSlider=void 0;var i=n(6091),s=function(t){function e(e,n,r,o){var s=t.call(this)||this;return s._newP=new i.PointElement,s.dimension=0,s.draggable=!0,s._AP=e,s._x=s._initx=n,s._y=s._inity=r,s._z=s._initz=o,s}return o(e,t),e.prototype.update=function(){this.toPlane(this._AP)},e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toPlane(this._AP)},e.prototype.drag=function(t,e){return this._x=t,this._y=e,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._AP),this._newP.defined()?this.to(this._newP):this.toPlane(this._AP),!0},e}(i.PointElement);e.PlaneSlider=s},2872(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PointAppearAnimation=void 0;var i=n(7233),s=n(6091),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.POINT_APPEAR,e.name="Point.appear",e.elementType=s.PointElement,e.defaultDurationMs=350,e}return o(e,t),e.prototype.build=function(t,e,n){return[{durationMs:this.defaultDurationMs,tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1,t.visible=!0}}]},e}(i.Animation);e.PointAppearAnimation=a,(0,i.registerAnimation)(new a)},4461(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.pointConstructions=e.VertexConstruction=e.HarmonicPointConstruction=e.LineSliderSegmentConstruction=e.FixedPointConstruction=e.AngleDividerPointConstruction=e.AngleBisectorPointConstruction=e.SphereSliderConstruction=e.PlaneSliderConstruction=e.MeanProportionalPointConstruction=e.InvertPointConstruction=e.ProportionPointConstruction=e.PointPerpendicular5Construction=e.PointPerpendicular4Construction=e.PointPerpendicular3Construction=e.PointPerpendicular2Construction=e.PointPerpendicular1Construction=e.PointPerpendicularConstruction=e.SimilarPointConstruction=e.ParallelogramConstruction=e.ExtendConstruction=e.CutoffConstruction=e.LayoffConstruction=e.PlaneFootPointConstruction=e.FootPointConstruction=e.CircumcenterConstruction=e.CircumcircleConstruction=e.CircleSliderConstruction=e.LineSliderConstruction=e.SphereCenterConstruction=e.CircleCenterConstruction=e.LastPointConstruction=e.FirstPointConstruction=e.PlaneIntersectionConstruction=e.IntersectionConstruction=e.MidPointConstruction=e.FreePointConstruction=void 0;var i=n(7658),s=n(1313),a=n(2218),l=n(6055),u=n(6401),c=n(4994),h=n(489),p=n(7832),f=n(2930),_=n(4610),y=n(2090),d=n(6921),v=n(3703),g=n(788),m=n(5014),P=n(9535),C=n(9237),w=n(3219),x=n(7876),E=n(6015),b=n(5089),A=n(6279),S=n(3375),O=n(2295),M=n(7091),T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.free,e.signature={points:0,elements:0,integers:2},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new c.PlaneSlider(t,r[0],r[1],0);return[[o],o]},e}(i.Construction);e.FreePointConstruction=T;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.midpoint,e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new h.Midpoint(e[0],e[1]);return[[o],o]},e}(i.Construction);e.MidPointConstruction=j;var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.intersection,e.signature={points:4,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&4===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new p.Intersection(e[0],e[1],e[2],e[3],o);return[[i],i]},e}(i.Construction);e.IntersectionConstruction=B;var L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.intersection,e.signature={points:2,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new f.PlaneIntersection(n[0],e[0],e[1]);return[[o],o]},e}(i.Construction);e.PlaneIntersectionConstruction=L;var z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.first,e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){return[[],e[0]]},e}(i.Construction);e.FirstPointConstruction=z;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.last,e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){return[[],e[1]]},e}(i.Construction);e.LastPointConstruction=I;var k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.center,e.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){return[[],n[0].Center]},e}(i.Construction);e.CircleCenterConstruction=k;var N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.center,e.signature={points:0,elements:1,integers:0,elementTypes:[O.SphereElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){return[[],n[0].Center]},e}(i.Construction);e.SphereCenterConstruction=N;var V=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.lineSlider,e.signature={points:2,elements:0,integers:2},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.E.length&&(2===e.N.length||3===e.N.length)},e.prototype.construct=function(t,e,n,r){var o=this.createSlider(e[0],e[1],r[0],r[1],r.length>2?r[2]:0);return[[o],o]},e.prototype.createSlider=function(t,e,n,r,o){return new _.LineSlider(t,e,n,r,o,!1)},e}(i.Construction);e.LineSliderConstruction=V;var R=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.circleSlider,e.signature={points:0,elements:1,integers:2,elementTypes:[s.CircleElement]},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&0===e.P.length&&1===e.E.length&&(2===e.N.length||3===e.N.length)&&e.E[0]instanceof s.CircleElement},e.prototype.construct=function(t,e,n,r){var o=new g.CircleSlider(n[0],r[0],r[1],r.length>2?r[2]:0);return[[o],o]},e}(i.Construction);e.CircleSliderConstruction=R;var D=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.circumcircle,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new a.CircumcircleElement(e[0],e[1],e[2],o);return[[i],i]},e}(i.Construction);e.CircumcircleConstruction=D;var F=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.circumcenter,e}return o(e,t),e.prototype.construct=function(e,n,r,o){var i=t.prototype.construct.call(this,e,n,r,o),s=i[1];return i[0].push(s.Center),[i[0],s.Center]},e}(D);e.CircumcenterConstruction=F;var H=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.foot,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new d.Foot(e[0],e[1],e[2]);return[[o],o]},e}(i.Construction);e.FootPointConstruction=H;var G=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.foot,e.signature={points:1,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new v.PlaneFootElement(e[0],n[0]);return[[o],o]},e}(i.Construction);e.PlaneFootPointConstruction=G;var U=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=this._createLayoff(e);return[[o],o]},e}(i.Construction);e.LayoffConstruction=U;var q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.cutoff,e}return o(e,t),e.prototype._createLayoff=function(t){return new y.Layoff(t[0],t[0],t[1],t[2],t[3])},e}(U);e.CutoffConstruction=q;var W=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.extend,e}return o(e,t),e.prototype._createLayoff=function(t){return new y.Layoff(t[1],t[0],t[1],t[2],t[3])},e}(U);e.ExtendConstruction=W;var J=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.parallelogram,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new y.Layoff(e[0],e[1],e[2],e[1],e[2]);return[[o],o]},e}(i.Construction);e.ParallelogramConstruction=J;var K=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=n.length>1?n[1]:t,s=new m.SimilarElement(e[0],e[1],o,e[2],e[3],e[4],i);return[[s],s]},e}(i.Construction);e.SimilarPointConstruction=K;var Y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.perpendicular,e}return o(e,t),e}(i.Construction);e.PointPerpendicularConstruction=Y;var X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new A.Perpendicular({C:e[0],D:e[1],P:t,E:e[0],F:e[1]});return[[o],o.B]},e}(Y);e.PointPerpendicular1Construction=X;var Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:2,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new A.Perpendicular({C:e[0],D:e[1],P:n[0],E:e[0],F:e[1]});return[[o],o.B]},e}(Y);e.PointPerpendicular2Construction=Q;var Z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new A.Perpendicular({C:e[0],D:e[1],P:t,E:e[2],F:e[3]});return[[o],o.B]},e}(Y);e.PointPerpendicular3Construction=Z;var $=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new A.Perpendicular({C:e[0],D:e[1],P:n[0],E:e[2],F:e[3]});return[[o],o.B]},e}(Y);e.PointPerpendicular4Construction=$;var tt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:3,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new S.PlanePerpendicularLine({C:e[0],P:n[0],D:e[1],E:e[2]});return[[o],o.B]},e}(Y);e.PointPerpendicular5Construction=tt;var et=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.proportion,e.signature={points:8,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new P.ProportionElement(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]);return[[o],o]},e}(i.Construction);e.ProportionPointConstruction=et;var nt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.invert,e.signature={points:1,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new E.InvertPointElement(e[0],n[0]);return[[o],o]},e}(i.Construction);e.InvertPointConstruction=nt;var rt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.meanProportional,e.signature={points:6,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new w.MeanProportionalElement(e[0],e[1],e[2],e[3],e[4],e[5]);return[[o],o]},e}(i.Construction);e.MeanProportionalPointConstruction=rt;var ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.planeSlider,e.signature={points:0,elements:1,integers:3,elementTypes:[l.PlaneElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new c.PlaneSlider(n[0],r[0],r[1],r[2]);return[[o],o]},e}(i.Construction);e.PlaneSliderConstruction=ot;var it=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.sphereSlider,e.signature={points:0,elements:1,integers:3,elementTypes:[O.SphereElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new b.SphereSliderElement(n[0],r[0],r[1],r[2]);return[[o],o]},e}(i.Construction);e.SphereSliderConstruction=it;var st=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.angleBisector,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new C.AngleDividerElement(e[0],e[1],e[2],o,2);return[[i],i]},e}(i.Construction);e.AngleBisectorPointConstruction=st;var at=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.angleDivider,e.signature={points:3,elements:0,integers:1},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new C.AngleDividerElement(e[0],e[1],e[2],o,r[0]);return[[i],i]},e}(i.Construction);e.AngleDividerPointConstruction=at;var lt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.fixed,e.signature={points:0,elements:0,integers:2},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&0===e.P.length&&0===e.E.length&&(2===e.N.length||3===e.N.length)},e.prototype.construct=function(t,e,n,r){var o=new u.FixedPoint({x:r[0],y:r[1],z:r.length>2?r[2]:0});return[[o],o]},e}(i.Construction);e.FixedPointConstruction=lt;var ut=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.lineSegmentSlider,e}return o(e,t),e.prototype.createSlider=function(t,e,n,r,o){return new _.LineSlider(t,e,n,r,o,!0)},e}(V);e.LineSliderSegmentConstruction=ut;var ct=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.harmonic,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new x.HarmonicElement(e[0],e[1],e[2]);return[[o],o]},e}(i.Construction);e.HarmonicPointConstruction=ct;var ht=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.vertex,e.signature={points:0,elements:1,integers:1,elementTypes:[M.PolygonElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=n[0].V[r[0]-1];return[[o],o]},e}(i.Construction);e.VertexConstruction=ht,e.pointConstructions=[new T,new lt,new z,new I,new k,new F,new j,new B,new H,new G,new W,new q,new J,new K,new et,new st,new at,new rt,new ot,new it,new ct,new nt,new L,new N,new D,new V,new ut,new R,new X,new Q,new Z,new $,new tt,new ht]},6091(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PointElement=void 0;var i=function(t){function e(e){var n=t.call(this)||this;return n.dimension=0,n._x=e&&e.x||0,n._y=e&&e.y||0,n._z=e&&e.z||0,n._AP=e&&e.AP||null,n}return o(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"AP",{get:function(){return this._AP},set:function(t){this._AP=t},enumerable:!1,configurable:!0}),e.prototype.defined=function(){return!isNaN(this._x)&&!isNaN(this._y)&&!isNaN(this._z)&&null!=this._x&&null!=this._y&&null!=this._z},e.prototype.to=function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this},e.prototype.plus=function(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this},e.prototype.minus=function(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this},e.prototype.times=function(t){return this._x*=t,this._y*=t,this._z*=t,this},e.difference=function(t,n){return new e({x:t.x-n.x,y:t.y-n.y,z:t.z-n.z,AP:null})},e.product=function(t,n){return new e({x:t*n.x,y:t*n.y,z:t*n.z,AP:null})},e.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},e.prototype.length2=function(){return this._x*this._x+this._y*this._y+this._z*this._z},e.prototype.length=function(){return Math.sqrt(this.length2())},e.prototype.distance2=function(t){return(this._x-t.x)*(this._x-t.x)+(this._y-t.y)*(this._y-t.y)+(this._z-t.z)*(this._z-t.z)},e.prototype.distance=function(t){return Math.sqrt(this.distance2(t))},e.prototype.toCross=function(t,e){return this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this},e.cross=function(t,n){return new e({x:t.y*n.z-t.z*n.y,y:t.z*n.x-t.x*n.z,z:t.x*n.y-t.y*n.x,AP:null})},e.triple=function(t,e,n){return t.x*(e.y*n.z-e.z*n.y)+e.x*(n.y*t.z-n.z*t.y)+n.x*(t.y*e.z-t.z*e.y)},e.prototype.toLine=function(t,n,r){var o=e.difference(n,t);this.minus(t);var i=e.dot(o,this)/o.length2();return r&&(i<0?i=0:i>1&&(i=1)),o.times(i),this.to(o).plus(t)},e.prototype.toPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var n=e.dot(this,t.S),r=e.dot(this,t.T);this.to(t.S).times(n).plus(e.product(r,t.T)).plus(t.A)}return this},e.prototype.uptoPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var n=t.S.x*t.T.y-t.S.y*t.T.x,r=(this.x*t.T.y-this.y*t.T.x)/n,o=(this.y*t.S.x-this.x*t.S.y)/n;this.to(t.S).times(r).plus(e.product(o,t.T)).plus(t.A)}return this},e.prototype.toCircumcenter=function(t,n,r){if(0==t.z&&0==n.z&&0==r.z){var o=((t.x-n.x)*(t.x+n.x)+(t.y-n.y)*(t.y+n.y))/2,i=((n.x-r.x)*(n.x+r.x)+(n.y-r.y)*(n.y+r.y))/2,s=(t.x-n.x)*(n.y-r.y)-(n.x-r.x)*(t.y-n.y);this._x=(o*(n.y-r.y)-i*(t.y-n.y))/s,this._y=(i*(t.x-n.x)-o*(n.x-r.x))/s,this._z=0}else{var a=e.difference(n,t),l=e.difference(r,t),u=e.dot(a,l),c=a.length2(),h=l.length2(),p=h*(c-u)/(s=2*(c*h-u*u)),f=c*(h-u)/s;this.to(t).plus(a.times(p)).plus(l.times(f))}return this},e.prototype.toCircle=function(t){if(t.AP.isScreen){var e=t.radius/this.distance(t.Center);this._x=t.Center.x+e*(this._x-t.Center.x),this._y=t.Center.y+e*(this._y-t.Center.y),this._z=0}else this.toPlane(t.AP),this.toSphere(t.Center,t.radius);return this},e.prototype.toSphere=function(t,e){var n=e/this.distance(t);return this._x=t.x+n*(this._x-t.x),this._y=t.y+n*(this._y-t.y),this._z=t.z+n*(this._z-t.z),this},e.area=function(t,n,r){var o=e.difference(n,t),i=e.difference(r,t);return this.cross(o,i).length()/2},e.prototype.angle=function(t,e,n){var r=t.x-this._x,o=e.x-this._x,i=t.y-this._y,s=e.y-this._y;if(n.isScreen)return Math.atan2(r*s-i*o,r*o+i*s);var a=t.z-this._z,l=e.z-this._z,u=r*n.S.x+i*n.S.y+a*n.S.z,c=r*n.T.x+i*n.T.y+a*n.T.z,h=o*n.S.x+s*n.S.y+l*n.S.z,p=o*n.T.x+s*n.T.y+l*n.T.z;return Math.atan2(u*p-c*h,u*h+c*p)},e.prototype.toIntersection=function(t,n,r,o,i){if(i.isScreen){var s=t.x*n.y-t.y*n.x,a=r.x*o.y-r.y*o.x,l=(n.y-t.y)*(r.x-o.x)-(t.x-n.x)*(o.y-r.y);this._x=(s*(r.x-o.x)-a*(t.x-n.x))/l,this._y=(a*(n.y-t.y)-s*(o.y-r.y))/l}else{var u=e.difference(t,i.A),c=e.difference(n,i.A),h=e.difference(r,i.A),p=e.difference(o,i.A),f=e.dot(u,i.S),_=e.dot(u,i.T),y=e.dot(c,i.S),d=e.dot(c,i.T),v=e.dot(h,i.S),g=e.dot(h,i.T),m=e.dot(p,i.S),P=e.dot(p,i.T),C=((s=f*d-_*y)*(v-m)-(a=v*P-g*m)*(f-y))/(l=(d-_)*(v-m)-(f-y)*(P-g)),w=(a*(d-_)-s*(P-g))/l;this.to(i.S).times(C).plus(e.product(w,i.T)).plus(i.A)}return this},e.prototype.toIntersectionPL=function(t,n,r){this.to(r).minus(n);var o=e.difference(n,t.A),i=-e.triple(t.S,t.T,o)/e.triple(t.S,t.T,this);return this.times(i).plus(n)},e.prototype.toInvertPoint=function(t,e){var n=e.radius2/t.distance2(e.Center);return this.to(t).minus(e.Center).times(n).plus(e.Center)},e.prototype.toSimilar=function(t,n,r,o,i,s,a){var l=o.angle(i,s,a),u=Math.cos(l),c=Math.sin(l),h=o.distance(s)/o.distance(i);if(r.isScreen)this._x=n.x,this._y=n.y,this.rotate(t,u,c,r),this._x=t.x+h*(this._x-t.x),this._y=t.y+h*(this._y-t.y),this._z=0;else{var p=e.difference(n,t),f=e.dot(p,r.S),_=e.dot(p,r.T),y=h*(u*f-c*_),d=h*(c*f+u*_);this._x=y*r.S.x+d*r.T.x+t.x,this._y=y*r.S.y+d*r.T.y+t.y,this._z=y*r.S.z+d*r.T.z+t.z}return this},e.prototype.rotate=function(t,n,r,o){if(null==o&&(o=t._AP),this!=t)if(o.isScreen){var i=this.x-t.x,s=this.y-t.y;this._x=t.x+n*i-r*s,this._y=t.y+r*i+n*s}else{this.minus(t);var a=o.S,l=o.T,u=o.U,c=e.dot(this,a),h=e.dot(this,l),p=e.dot(this,u),f=n*c-r*h,_=r*c+n*h;this._x=t.x+f*a.x+_*l.x+p*u.x,this._y=t.y+f*a.y+_*l.y+p*u.y,this._z=t.z+f*a.z+_*l.z+p*u.z}},e.prototype.drawName=function(t){this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this.x),Math.round(this.y),t)},e.prototype.drawVertex=function(t,e){if(this.visible){var n=t.getContext("2d");if(null==e&&(e=this.emphasized||this.shouldHighlight?this.vertexHighlightColor:this.vertexColor),null!=e){var r=this.shouldHighlight?4:2,o=r+this.emphasisAmount*(6-r);(o*=this.drawProgress)<.5||(n.beginPath(),n.fillStyle=e,n.arc(this._x,this._y,o,0,2*Math.PI,!1),n.fill())}}},e.prototype.translate=function(t,e){this._x+=t,this._y+=e},e.prototype.update=function(){},e.prototype.drawEdge=function(t){},e.prototype.drawFace=function(t){},e}(n(8020).GeomElement);e.PointElement=i},9535(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ProportionElement=void 0;var i=function(t){function e(e,n,r,o,i,s,a,l){var u=t.call(this)||this;return u.dimension=0,u._S0=e,u._S1=n,u._T0=r,u._T1=o,u._U0=i,u._U1=s,u._V0=a,u._V1=l,a._AP===l._AP&&(u._AP=a._AP),u}return o(e,t),e.prototype.update=function(){var t=this._T0.distance2(this._T1)*this._U0.distance2(this._U1)/(this._S0.distance2(this._S1)*this._V0.distance2(this._V1));t=Math.sqrt(t),this.to(this._V1).minus(this._V0),this.times(t).plus(this._V0)},e}(n(6091).PointElement);e.ProportionElement=i},5014(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SimilarElement=void 0;var i=function(t){function e(e,n,r,o,i,s,a){var l=t.call(this)||this;return l.dimension=0,l._parentA=e,l._parentB=n,l._AP=r,l._D=o,l._E=i,l._F=s,l._Q=a,l}return o(e,t),e.prototype.update=function(){this.toSimilar(this._parentA,this._parentB,this._AP,this._D,this._E,this._F,this._Q)},e}(n(6091).PointElement);e.SimilarElement=i},5089(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereSliderElement=void 0;var i=function(t){function e(e,n,r,o){var i=t.call(this)||this;return i.dimension=0,i.draggable=!0,i._S=e,i._x=i._initx=n,i._y=i._inity=r,i._z=i._initz=o,i}return o(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toSphere(this._S.Center,this._S.radius())},e.prototype.update=function(){this.toSphere(this._S.Center,this._S.radius())},e.prototype.drag=function(t,e){var n=(this._S.Center.x-t)*(this._S.Center.x-t)+(this._S.Center.y-e)*(this._S.Center.y-e),r=this._S.radius2();if(n<=r)this._x=t,this._y=e,this._z>this._S.Center.z?this._z=this._S.Center.z+Math.sqrt(r-n):this._z=this._S.Center.z-Math.sqrt(r-n);else{t-=this._S.Center.x,e-=this._S.Center.y;var o=Math.sqrt((t*t+e*e)/r);if(t=t/o+this._S.Center.x,e=e/o+this._S.Center.y,(t-this._x)*(t-this._x)+(e-this._y)*(e-this._y)<.5)return!1;this._x=t,this._y=e,this._z=this._S.Center.z}return!0},e}(n(6091).PointElement);e.SphereSliderElement=i},2563(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ApplicationElement=void 0;var i=n(7091),s=n(6091),a=function(t){function e(e,n,r,o){var i=t.call(this)||this;return i.dimension=2,i._P=e,i._C=o,i.V=new Array(4),i.V[0]=n,i.V[1]=r,i.V[2]=new s.PointElement,i.V[3]=new s.PointElement,n._AP===r._AP&&n._AP===o._AP&&(i.V[2]._AP=n._AP,i.V[3]._AP=n._AP),i}return o(e,t),e.prototype.translate=function(t,e){this.V[2].translate(t,e),this.V[3].translate(t,e)},e.prototype.rotate=function(t,e,n){this.V[2].rotate(t,e,n),this.V[3].rotate(t,e,n)},e.prototype.update=function(){var t=this._P.area()/(2*s.PointElement.area(this.V[0],this.V[1],this._C));t=Math.abs(t),this.V[3].x=this.V[0].x+t*(this._C.x-this.V[0].x),this.V[3].y=this.V[0].y+t*(this._C.y-this.V[0].y),this.V[3].z=this.V[0].z+t*(this._C.z-this.V[0].z),this.V[2].x=this.V[1].x+this.V[3].x-this.V[0].x,this.V[2].y=this.V[1].y+this.V[3].y-this.V[0].y,this.V[2].z=this.V[1].z+this.V[3].z-this.V[0].z},e}(i.PolygonElement);e.ApplicationElement=a},3712(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonOutlineAndFillAnimation=e.PolygonOutlineAnimation=void 0;var i=n(7233),s=n(7091);function a(t){var e=t.V.length;if(e<2)return 0;for(var n=0,r=e>2?e:e-1,o=0;o<r;o++){var i=t.V[o],s=t.V[(o+1)%e],a=s.x-i.x,l=s.y-i.y;n+=Math.sqrt(a*a+l*l)}return n}var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.POLYGON_OUTLINE,e.name="Polygon.outline",e.elementType=s.PolygonElement,e.defaultRate=.25,e}return o(e,t),e.prototype.build=function(t,e,n){var r=t;return[{durationMs:Math.max(180,a(r)/this.defaultRate),tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1,r.visible=!0}}]},e}(i.Animation);e.PolygonOutlineAnimation=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.POLYGON_OUTLINE_AND_FILL,e.name="Polygon.outlineAndFill",e.elementType=s.PolygonElement,e.defaultRate=.25,e.defaultDurationMs=500,e}return o(e,t),e.prototype.build=function(t,e,n){var r=t,o=Math.max(180,a(r)/this.defaultRate);return[{durationMs:o,setup:function(){r.drawProgress=0,r.faceAlpha=0},tick:function(t){r.drawProgress=t},finalise:function(){r.drawProgress=1}},{durationMs:Math.min(o/2,this.defaultDurationMs),tick:function(t){r.faceAlpha=t},finalise:function(){r.faceAlpha=1,r.drawProgress=1,r.visible=!0}}]},e}(i.Animation);e.PolygonOutlineAndFillAnimation=u,(0,i.registerAnimation)(new l),(0,i.registerAnimation)(new u)},4133(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.polygonConstructions=e.FacePolygonConstruction=e.OctagonPolygonConstruction=e.ApplicationPolygonConstruction=e.SimilarPolygonConstruction=e.StarPolygonConstruction=e.RegularPolygonConstruction=e.ParallelogramPolygonConstruction=e.EquilateralTriangleConstruction=e.HexagonPolygonConstruction=e.PentagonPolygonConstruction=e.QuadrilateralPolygonConstruction=e.TrianglePolygonConstruction=e.SquarePolygonConstruction=e.PolyConstruction=void 0;var i=n(7658),s=n(6055),a=n(2090),l=n(5014),u=n(7091),c=n(1943),h=n(2563),p=n(3857),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new u.PolygonElement(e);return[[o],o]},e}(i.Construction);e.PolyConstruction=f;var _=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.square,e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new c.RegularPolygonElement(e[0],e[1],o,4);return[[i],i]},e}(i.Construction);e.SquarePolygonConstruction=_;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.triangle,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e}(f);e.TrianglePolygonConstruction=y;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.quadrilateral,e.signature={points:4,elements:0,integers:0},e}return o(e,t),e}(f);e.QuadrilateralPolygonConstruction=d;var v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.pentagon,e.signature={points:5,elements:0,integers:0},e}return o(e,t),e}(f);e.PentagonPolygonConstruction=v;var g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.hexagon,e.signature={points:6,elements:0,integers:0},e}return o(e,t),e}(f);e.HexagonPolygonConstruction=g;var m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.equilateralTriangle,e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new c.RegularPolygonElement(e[0],e[1],o,3);return[[i],i]},e}(i.Construction);e.EquilateralTriangleConstruction=m;var P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.parallelogram,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new a.Layoff(e[0],e[1],e[2],e[1],e[2]),i=new u.PolygonElement([e[0],e[1],e[2],o]);return[[o,i],i]},e}(i.Construction);e.ParallelogramPolygonConstruction=P;var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.regularPolygon,e.signature={points:2,elements:0,integers:1},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new c.RegularPolygonElement(e[0],e[1],o,r[0]);return[[i],i]},e}(i.Construction);e.RegularPolygonConstruction=C;var w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.starPolygon,e.signature={points:2,elements:0,integers:2},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new c.RegularPolygonElement(e[0],e[1],t,r[0],r[1]);return[[o],o]},e}(i.Construction);e.StarPolygonConstruction=w;var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=n.length>1?n[1]:t,s=new l.SimilarElement(e[0],e[1],o,e[2],e[3],e[4],i),a=new u.PolygonElement([e[0],e[1],s]);return[[s,a],a]},e}(i.Construction);e.SimilarPolygonConstruction=x;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.application,e.signature={points:3,elements:1,integers:0,elementTypes:[u.PolygonElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new h.ApplicationElement(n[0],e[0],e[1],e[2]);return[[o],o]},e}(i.Construction);e.ApplicationPolygonConstruction=E;var b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.octagon,e.signature={points:8,elements:0,integers:0},e}return o(e,t),e}(f);e.OctagonPolygonConstruction=b;var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.face,e.signature={points:0,elements:1,integers:1,elementTypes:[p.PolyhedronElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=n[0].P[r[0]-1];return[[o],o]},e}(i.Construction);e.FacePolygonConstruction=A,e.polygonConstructions=[new y,new w,new C,new _,new m,new P,new d,new b,new v,new g,new x,new E,new A]},7091(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonElement=void 0;var i=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n._faceAlpha=1,n.dimension=2,null==e?(n.V=[],n):(n.V=e,n)}return o(e,t),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),e.prototype.area=function(){for(var t=0,e=0;e<this.V.length-2;++e)t+=i.PointElement.area(this.V[0],this.V[e+1],this.V[e+2]);return t},e.prototype.drawEdge=function(t,e){if(this.visible&&(null==e&&(e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=e&&!(this.V.length<=1))){var n=t.getContext("2d");n.beginPath(),n.strokeStyle=e;var r=this.shouldHighlight?3:1;n.lineWidth=r+this.emphasisAmount*(6-r);var o=this.V.length,i=o>2?o:o-1,s=this.drawProgress*i,a=Math.floor(s),l=s-a;n.moveTo(this.V[0].x,this.V[0].y);for(var u=0;u<a;u++){var c=this.V[(u+1)%o];n.lineTo(c.x,c.y),n.stroke()}if(l>0&&a<i){var h=this.V[a],p=(c=this.V[(a+1)%o],h.x+(c.x-h.x)*l),f=h.y+(c.y-h.y)*l;n.lineTo(p,f),n.stroke()}}},e.prototype.defined=function(){if(0==this.V.length)return!1;for(var t=0,e=this.V;t<e.length;t++)if(!e[t].defined())return!1;return!0},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()&&this.V.length>2){var e=t.getContext("2d");e.beginPath(),e.fillStyle=this.faceColor;var n=this.V[0],r=this.V.slice(1);e.moveTo(n.x,n.y);for(var o=0,i=r;o<i.length;o++){var s=i[o];e.lineTo(s.x,s.y)}e.closePath();var a=this.faceAlpha;if(a<1){if(a<=0)return;e.save(),e.globalAlpha=a,e.fill(),e.restore()}else e.fill()}},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,r=0,o=this.V;r<o.length;r++){var i=o[r];e+=i.x,n+=i.y}var s=this.V.length;e/=s,n/=s;var a=t.getContext("2d"),l=this._getTextMetrics(a,this._name),u=l[0],c=l[1];a.beginPath(),a.fillStyle=this.nameColor,a.fillText(this._name,e-u/2,n+c/4)}},e.prototype.drawVertex=function(t){if(this.visible&&null!=this.vertexColor&&this.defined())for(var e=0,n=this.V;e<n.length;e++)n[e].drawVertex(t,this.vertexColor)},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(n(8020).GeomElement);e.PolygonElement=s},1943(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RegularPolygonElement=void 0;var i=n(7091),s=n(6091),a=function(t){function e(e,n,r,o,i){void 0===i&&(i=1);var a=t.call(this)||this;a._P=r;var l=Math.PI*i*(o-2)/o;a._cos=Math.cos(l),a._sin=Math.sin(l),a.V=new Array(o),a.V[0]=e,a.V[1]=n;for(var u=2;u<o;u++)a.V[u]=new s.PointElement({AP:r});return a}return o(e,t),e.prototype.update=function(){for(var t=2;t<this.V.length;t++)this.V[t].to(this.V[t-2]),this.V[t].rotate(this.V[t-1],this._cos,this._sin,this._P)},e.prototype.translate=function(t,e){for(var n=2;n<this.V.length;n++)this.V[n].translate(t,e)},e.prototype.rotate=function(t,e,n){for(var r=2;r<this.V.length;r++)this.V[r].rotate(t,e,n,this._P)},e}(i.PolygonElement);e.RegularPolygonElement=a},1099(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.polyhedronConstructions=e.PyramidConstruction=e.PrismConstruction=e.ParallelepipedConstruction=e.TetrahedronConstruction=void 0;var i=n(7658),s=n(2090),a=n(7091),l=n(2383),u=n(444),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolyhedraConstructions.tetrahedron,e.signature={points:4,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new a.PolygonElement([e[0],e[1],e[2]]),i=new l.PyramidElement(o,e[3]);return[[o,i],i]},e}(i.Construction);e.TetrahedronConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolyhedraConstructions.parallelepiped,e.signature={points:4,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new s.Layoff(e[1],e[0],e[2],e[0],e[2]),i=new a.PolygonElement([e[1],e[0],e[2],o]),l=new u.PrismElement(i,e[0],e[3]);return[[o,i,l],l]},e}(i.Construction);e.ParallelepipedConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolyhedraConstructions.prism,e.signature={points:2,elements:1,integers:0,elementTypes:[a.PolygonElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new u.PrismElement(n[0],e[0],e[1]);return[[o],o]},e}(i.Construction);e.PrismConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolyhedraConstructions.pyramid,e.signature={points:1,elements:1,integers:0,elementTypes:[a.PolygonElement]},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new l.PyramidElement(n[0],e[0]);return[[o],o]},e}(i.Construction);e.PyramidConstruction=f,e.polyhedronConstructions=[new c,new h,new p,new f]},3857(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolyhedronElement=void 0;var i=function(t){function e(){var e=t.call(this)||this;return e.dimension=2,e.P=[],e}return o(e,t),e.prototype.defined=function(){for(var t=0;t<this.P.length;++t)if(!this.P[t].defined())return!1;return!0},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,r=0,o=0;o<this.P.length;++o)for(var i=0;i<this.P[o].V.length;++i)e+=this.P[o].V[i].x,n+=this.P[o].V[i].y,++r;e/=r,n/=r,this.drawString(Math.round(e),Math.round(n),t)}},e.prototype.drawVertex=function(t){if(this.visible&&null!=this.vertexColor&&this.defined())for(var e=0;e<this.P.length;++e)for(var n=0;n<this.P[e].V.length;++n)this.P[e].V[n].drawVertex(t,this.vertexColor)},e.prototype.drawEdge=function(t){if(this.visible&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.strokeStyle=this.edgeColor;for(var n=0;n<this.P.length;++n)for(var r=0;r<this.P[n].V.length;++r){var o=this.P[n].V[r],i=this.P[n].V[(r+1)%this.P[n].V.length];e.beginPath(),e.moveTo(o.x,o.y),e.lineTo(i.x,i.y),e.stroke()}}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined())for(var e=0;e<this.P.length;++e){var n=this.P[e].faceColor;this.P[e].faceColor=this.faceColor,this.P[e].drawFace(t),this.P[e].faceColor=n}},e.prototype.update=function(){},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n){},e}(n(8020).GeomElement);e.PolyhedronElement=i},444(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PrismElement=void 0;var i=n(3857),s=n(7091),a=n(6091),l=function(t){function e(e,n,r){var o=t.call(this)||this;o.dimension=2,o._C=n,o._D=r;var i=e.V.length,l=2+i;o.P=new Array(l),o.P[0]=e;for(var u=new Array(i),c=0;c<i;++c)u[c]=new a.PointElement,u[c].to(e.V[c]).plus(r).minus(n);o.P[1]=new s.PolygonElement(u);for(var h=2;h<l;++h)o.P[h]=new s.PolygonElement([e.V[h-2],e.V[(h-1)%i],o.P[1].V[(h-1)%i],o.P[1].V[h-2]]);return o}return o(e,t),e.prototype.translate=function(t,e){for(var n=0;n<this.P[1].V.length;++n)this.P[1].V[n].translate(t,e)},e.prototype.rotate=function(t,e,n){for(var r=0;r<this.P[1].V.length;++r)this.P[1].V[r].rotate(t,e,n)},e.prototype.update=function(){for(var t=0;t<this.P[1].V.length;++t)this.P[1].V[t].to(this.P[0].V[t]).plus(this._D).minus(this._C)},e}(i.PolyhedronElement);e.PrismElement=l},2383(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PyramidElement=void 0;var i=n(3857),s=n(7091),a=function(t){function e(e,n){var r=t.call(this)||this;r.dimension=2;var o=1+e.V.length;r.P=new Array(o),r.P[0]=e;for(var i=1;i<o;++i)r.P[i]=new s.PolygonElement([n,e.V[i-1],e.V[i%e.V.length]]);return r}return o(e,t),e}(i.PolyhedronElement);e.PyramidElement=a},5483(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ArcElement=void 0;var i=n(1025),s=n(6091),a=function(t){function e(e,n,r,o){var i=t.call(this)||this;return i.dimension=2,i._Center=new s.PointElement,i._A=e,i._M=n,i._B=r,i._P=o,i}return o(e,t),e.prototype.update=function(){this._P.update(),this._Center.toCircumcenter(this._A,this._M,this._B)},e.prototype.translate=function(t,e){this._Center.translate(t,e)},e.prototype.rotate=function(t,e,n){this._Center.rotate(t,e,n)},e}(i.SectorElement);e.ArcElement=a},5755(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.sectorConstructions=e.ArcConstruction=e.SectorConstruction=void 0;var i=n(7658),s=n(6055),a=n(1025),l=n(5483),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.SectorConstructions.sector,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new a.SectorElement({O:e[0],A:e[1],B:e[2],P:o});return[[i],i]},e}(i.Construction);e.SectorConstruction=u;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.SectorConstructions.arc,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,r){var o=n.length>0?n[0]:t,i=new l.ArcElement(e[0],e[1],e[2],o);return[[i],i]},e}(i.Construction);e.ArcConstruction=c,e.sectorConstructions=[new u,new c]},1025(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SectorElement=void 0;var i=function(t){function e(e){var n=t.call(this)||this;return n._angle=null,n.dimension=2,null!=e&&(n._Center=e.O,n._A=e.A,n._B=e.B,n._P=e.P),n}return o(e,t),e.prototype.radius=function(){return this._Center.distance(this._A)},e.prototype.defined=function(){return this._A.defined()&&this._B.defined()&&this._Center.defined()},e.prototype._updateThroughPoint=function(){0!=this.radius()&&(this._angle=Math.atan2(this._B.y-this._A.y,this._B.x-this._A.x)-Math.atan2(this._Center.y-this._A.y,this._Center.x-this._A.x),this._Center.x,Math.cos(this._angle/2),this._Center.y,Math.sin(this._angle/2))},e.prototype.drawEdge=function(t){if(this.visible&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.strokeStyle=this.edgeColor,e.beginPath();var n=this.radius(),r=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),o=r+this._Center.angle(this._A,this._B,this._P);e.arc(this._Center.x,this._Center.y,n,r,o,!0),e.stroke()}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.fillStyle=this.faceColor,e.beginPath();var n=this.radius(),r=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),o=this._Center.angle(this._A,this._B,this._P),i=r+o;e.arc(this._Center.x,this._Center.y,n,r,i,!0),e.moveTo(this._Center.x,this._Center.y),o<=180?(e.lineTo(this._A.x,this._A.y),e.lineTo(this._B.x,this._B.y)):(e.lineTo(this._B.x,this._B.y),e.lineTo(this._A.x,this._A.y)),e.lineTo(this._Center.x,this._Center.y),e.fill()}},e.prototype.drawName=function(t){},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){this._updateThroughPoint()},e}(n(8020).GeomElement);e.SectorElement=i},8649(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.sphereConstructions=e.SphereRadius3PointConstruction=e.SphereRadiusConstruction=void 0;var i=n(7658),s=n(2295),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.SphereConstructions.radius,e.signature={points:2,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new s.SphereElement({Center:e[0],B:e[1]});return[[o],o]},e}(i.Construction);e.SphereRadiusConstruction=a;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.SphereConstructions.radius,e.signature={points:3,elements:0,integers:0},e}return o(e,t),e.prototype.construct=function(t,e,n,r){var o=new s.SphereElement({Center:e[0],A:e[1],B:e[2]});return[[o],o]},e}(i.Construction);e.SphereRadius3PointConstruction=l,e.sphereConstructions=[new l,new a]},2295(t,e,n){var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereElement=void 0;var i=n(8020),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=2,n._Center=e&&e.Center||new s.PointElement,n._A=e&&e.A||n._Center,n._B=e&&e.B||new s.PointElement,n}return o(e,t),Object.defineProperty(e.prototype,"Center",{get:function(){return this._Center},enumerable:!1,configurable:!0}),e.prototype.drawName=function(t){this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this._Center.x),Math.round(this._Center.y),t,i.Align.CENTRAL)},e.prototype.defined=function(){return!0},e.prototype.drawEdge=function(t){if(this.visible&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.save(),e.strokeStyle=this.edgeColor;var n=this.radius();e.beginPath(),e.ellipse(this._Center.x,this._Center.y,n,n,0,0,2*Math.PI),e.stroke(),e.restore()}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.save(),e.fillStyle=this.faceColor;var n=this.radius();e.beginPath(),e.ellipse(this._Center.x,this._Center.y,n,n,0,0,2*Math.PI),e.fill(),e.restore()}},e.prototype.radius=function(){return this._A.distance(this._B)},e.prototype.radius2=function(){return this._A.distance2(this._B)},e.prototype.drawVertex=function(){},e.prototype.update=function(){},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n,r){},e}(i.GeomElement);e.SphereElement=a},8156(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.slates=e.BUILD_MARKER=e.A=e.AllAnimations=e.E=e.Align=void 0,e.parseParam=p,e.revealNoscriptFallback=f,e.init=function(t){var n=null!=t.canvasid?t.canvasid:"canvasid",o=document.getElementById(n);try{!function(t,n){var o=null!=t.align?t.align:r.Align.CENTRAL;!function(t){var e=t.clientWidth,n=t.clientHeight;t.width==e&&t.height==n||(t.width=e,t.height=n)}(n);var i=new a.Slate(n);e.slates.push(i);var h=null!=t.font?t.font:"Times New Roman",f=null!=t.fontsize?t.fontsize:18;r.GeomElement.setFont(h,f),i.bgcolor=(0,u.parseColor)(t.background,"#ffffff","#ffffff");for(var _=0,y=t.elements;_<y.length;_++){var d=y[_],v="string"==typeof d?p(d):d,g=i.createElement(v.construction,v.params,v.name);g.align=o;var m=g instanceof s.PointElement?"black":null;g.nameColor=(0,u.parseColor)(v.nameColor,m,i.bgcolor);var P=g.draggable?g instanceof l.PlaneSlider?"red":"orange":"black";g.vertexColor=(0,u.parseColor)(v.vertexColor,P,i.bgcolor),g.edgeColor=(0,u.parseColor)(v.edgeColor,"black",i.bgcolor);var C=(0,u.lighten)(i.bgcolor),w=2==g.dimension?C:null;g.faceColor=(0,u.parseColor)(v.faceColor,w,i.bgcolor)}null!=t.aliases&&i.addAliases(t.aliases),null!=t.slides&&t.slides.length>0&&(i.slides=t.slides),null!=t.resolveJustification&&(i.resolveJustification=t.resolveJustification),null!=t.animationConfig&&(i.animationConfig=t.animationConfig),null!=t.pivot&&i.setPivot(t.pivot),i.update(),i.updateCoordinates(0),n&&n.parentElement&&(0,c.createControls)(i,n,t)}(t,o)}catch(t){throw console.error("[geomlib] init failed:",t),f(o),t}};var r=n(8020);Object.defineProperty(e,"Align",{enumerable:!0,get:function(){return r.Align}});var o=n(7658);Object.defineProperty(e,"E",{enumerable:!0,get:function(){return o.E}});var i=n(7233);Object.defineProperty(e,"AllAnimations",{enumerable:!0,get:function(){return i.AllAnimations}}),Object.defineProperty(e,"A",{enumerable:!0,get:function(){return i.A}}),n(2872),n(1910),n(9222),n(3712);var s=n(6091),a=n(8041),l=n(4994),u=n(1454),c=n(3267);e.BUILD_MARKER="pointer-events-refactor-v1 (Slate.ts #55)",e.slates=[];var h={point:"Point",line:"Line",circle:"Circle",polygon:"Polygon",sector:"Sector",plane:"Plane",sphere:"Sphere",polyhedron:"Polyhedra"};function p(t){var e=t.split(";");if(e.length<4)throw new Error("parseParam: expected at least 4 semicolon-separated fields, got ".concat(e.length,': "').concat(t,'"'));var n=e[0],r=e[1],i=e[2],s=e[3],a=h[r];if(null==a)throw new Error('parseParam: unknown element type "'.concat(r,'" in "').concat(t,'"'));var l=o.E[a]["3points"===i?"threePoints":i];if(null==l)throw new Error('parseParam: unknown construction "'.concat(r,";").concat(i,'" in "').concat(t,'"'));var u={name:n,construction:l,params:s.split(",").map((function(t){var e=Number(t);return""===t||isNaN(e)?t:e}))};return e.length>4&&void 0!==e[4]&&(u.nameColor=e[4]),e.length>5&&void 0!==e[5]&&(u.vertexColor=e[5]),e.length>6&&void 0!==e[6]&&(u.edgeColor=e[6]),e.length>7&&void 0!==e[7]&&(u.faceColor=e[7]),u}function f(t){var e;if(t)try{for(var n=t.nextElementSibling,r=0;n&&r++<5&&"NOSCRIPT"!==n.tagName;)n=n.nextElementSibling;if(!n||"NOSCRIPT"!==n.tagName)return;var o=n.innerHTML;if(!o)return;var i=document.createElement("div");i.innerHTML=o,null===(e=n.parentNode)||void 0===e||e.insertBefore(i,n),t.style.display="none"}catch(t){}}},7680(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.computeSlideState=function(t,e,n){for(var r=[],o=n;o>=0;o--)if(null!=e[o].visible){r=e[o].visible;break}for(var i=new Set(r),s=e[n],a=new Set(s.highlighted||[]),l=0,u=t.elements;l<u.length;l++){var c=u[l];c.draggable&&null!=c.name&&i.add(c.name)}return a.forEach((function(t){return i.add(t)})),{visible:i,highlighted:a}}}},e={},n=function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}(8156);geomlib=n})();
1
+ var geomlib;(()=>{"use strict";var t={1454(t,e){function n(){var t=s(Math.random(),Math.random(),1);return"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")")}function o(t){var e=i(t);if(null==e)return t;var n=.7,o=Math.ceil(1/(1-n)),r=0===e.r?o:Math.min(Math.floor(e.r/n),255),s=0===e.g?o:Math.min(Math.floor(e.g/n),255),a=0===e.b?o:Math.min(Math.floor(e.b/n),255);return r<o&&(r=o),s<o&&(s=o),a<o&&(a=o),"rgb(".concat(r,",").concat(s,",").concat(a,")")}function r(t){var e=i(t);if(null==e)return t;var n=Math.floor(.7*e.r),o=Math.floor(.7*e.g),r=Math.floor(.7*e.b);return"rgb(".concat(n,",").concat(o,",").concat(r,")")}function i(t){if(null==t)return null;var n=t.match(/^rgb\((\d+),(\d+),(\d+)\)$/);if(n)return{r:parseInt(n[1]),g:parseInt(n[2]),b:parseInt(n[3])};if(t in e.colors)return i(e.colors[t]);var o=t.replace(/^#/,"");if(/^[0-9a-fA-F]{6}$/.test(o)){var r=parseInt(o,16);return{r:r>>16&255,g:r>>8&255,b:255&r}}var a=t.split(",");if(3===a.length){var l=parseInt(a[0])/360,u=parseInt(a[1])/100,c=parseInt(a[2])/100;if(!isNaN(l)&&!isNaN(u)&&!isNaN(c))return s(l,u,c)}return null}function s(t,e,n){var o,r,i,s=Math.floor(6*t),a=6*t-s,l=n*(1-e),u=n*(1-a*e),c=n*(1-(1-a)*e);switch(s%6){case 0:o=n,r=c,i=l;break;case 1:o=u,r=n,i=l;break;case 2:o=l,r=n,i=c;break;case 3:o=l,r=u,i=n;break;case 4:o=c,r=l,i=n;break;case 5:o=n,r=l,i=u}return{r:Math.round(255*o),g:Math.round(255*r),b:Math.round(255*i)}}Object.defineProperty(e,"__esModule",{value:!0}),e.colors=void 0,e.parseColor=function(t,i,a){if(0===t)return null;if(null==t)return i;var l=String(t);if("none"===l||"0"===l||""===l)return null;if("random"===l)return n();if("background"===l)return a;if("brighter"===l)return o(a);if("darker"===l)return r(a);if(l in e.colors)return e.colors[l];var u=l.replace(/^#/,"");if(/^[0-9a-fA-F]+$/.test(u)){var c=parseInt(u,16);if(!isNaN(c)){var h=c>>8&255,p=255&c;return"rgb(".concat(c>>16&255,",").concat(h,",").concat(p,")")}}var f=l.split(",");if(3===f.length){var _=parseInt(f[0])/360,y=parseInt(f[1])/100;if(p=parseInt(f[2])/100,!isNaN(_)&&!isNaN(y)&&!isNaN(p)){var d=s(_,y,p);return"rgb(".concat(d.r,",").concat(d.g,",").concat(d.b,")")}}return null},e.randomColor=n,e.brighter=o,e.darker=r,e.lighten=function(t){return o(t)},e.darken=function(t){return r(t)},e.colors={black:"rgb(0,0,0)",blue:"rgb(0,0,255)",cyan:"rgb(0,255,255)",darkGray:"rgb(64,64,64)",gray:"rgb(128,128,128)",green:"rgb(0,255,0)",lightGray:"rgb(192,192,192)",magenta:"rgb(255,0,255)",orange:"rgb(255,200,0)",pink:"rgb(255,175,175)",red:"rgb(255,0,0)",white:"rgb(255,255,255)",yellow:"rgb(255,255,0)"}},8041(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Slate=void 0;var o=n(6055),r=n(6401),i=n(7658),s=n(6091),a=n(2145),l=n(6900),u=function(){function t(e){if(this._aliases=new Map,this._slides=[],this._resolveJustification=null,this._animationConfig={},this._animator=null,this._ephemerals=[],this._htmlCanvas=null,this.inTest=!1,this._itsNumSlate=-1,t.numSlate+=1,this._itsNumSlate=t.numSlate,this._elements=[],null==e)throw new TypeError("canvas cannot be null or undefined.");this._canvas=e;var n=new r.FixedPoint({x:0,y:0,z:0});n.name="screen_origin";var i=new r.FixedPoint({x:1,y:0,z:0});i.name="screen_x";var s=new r.FixedPoint({x:0,y:1,z:0});s.name="screen_y";var a=new o.PlaneElement({A:n,B:i,C:s});a.name="screen",a.nameColor=null,a.isScreen=!0,this._screen=a,this._pick=null;for(var l=0,u=[n,i,s,a];l<u.length;l++){var c=u[l];c.nameColor=null,c.vertexColor=null,c.vertexHighlightColor=null,c.faceColor=null,c.faceHighlightColor=null,this._elements.push(c)}var h=this,p=this._canvas;if(this._htmlCanvas=p,null!=this._htmlCanvas.addEventListener){this._htmlCanvas.style.touchAction="none";var f=null;this._htmlCanvas.addEventListener("pointerdown",(function(t){if(null===f){f=t.pointerId;try{h._htmlCanvas.setPointerCapture(t.pointerId)}catch(t){}var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],o=e[1];h._onMouseDown(n,o)}})),this._htmlCanvas.addEventListener("pointermove",(function(t){if(t.pointerId===f){var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],o=e[1];h._onMouseDrag(n,o)}}));var _=function(t){if(t.pointerId===f){var e=h._getCanvasPosition(t.clientX,t.clientY),n=e[0],o=e[1];h._onMouseUp(n,o);try{h._htmlCanvas.releasePointerCapture(t.pointerId)}catch(t){}f=null}};this._htmlCanvas.addEventListener("pointerup",_),this._htmlCanvas.addEventListener("pointercancel",_),this._htmlCanvas.addEventListener("lostpointercapture",(function(t){t.pointerId===f&&(null!=h._pick&&(h._pick=null),f=null)}))}}return t.prototype._getCanvasPosition=function(t,e){var n=this._htmlCanvas.getBoundingClientRect();return[t-n.left,e-n.top]},t.prototype._onMouseDown=function(t,e){this._pick=null,this.movePick(t,e)},t.prototype._onMouseUp=function(t,e){null!=this._pick&&(this.movePick(t,e),this._pick=null)},t.prototype._onMouseDrag=function(t,e){null!=this._pick&&this.movePick(t,e)},Object.defineProperty(t.prototype,"elements",{get:function(){return this._elements},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bgcolor",{get:function(){return this._bgcolor},set:function(t){this._bgcolor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this._canvas},enumerable:!1,configurable:!0}),t.prototype.lookupElement=function(t){for(var e=0,n=this._elements;e<n.length;e++)if((s=n[e]).name==t)return s;var o=this._aliases.get(t);if(null!=o)for(var r=0,i=this._elements;r<i.length;r++){var s;if((s=i[r]).name==o)return s}return null},t.prototype.addAlias=function(t,e){this._aliases.set(t,e)},t.prototype.addAliases=function(t){for(var e in t)this._aliases.set(e,t[e])},Object.defineProperty(t.prototype,"slides",{get:function(){return this._slides},set:function(t){this._slides=t||[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resolveJustification",{get:function(){return this._resolveJustification},set:function(t){this._resolveJustification=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationConfig",{get:function(){return this._animationConfig},set:function(t){this._animationConfig=t||{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animator",{get:function(){return this._animator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ephemerals",{get:function(){return this._ephemerals},enumerable:!1,configurable:!0}),t.prototype.addEphemeral=function(t){this._ephemerals.push(t)},t.prototype.removeEphemeral=function(t){var e=this._ephemerals.indexOf(t);e>=0&&this._ephemerals.splice(e,1)},t.prototype.clearEphemerals=function(){this._ephemerals.length=0},t.prototype._ensureAnimator=function(){return null==this._animator&&(this._animator=new l.SlateAnimator(this)),this._animator},t.prototype.animateTo=function(t,e,n,o){return this._ensureAnimator().run(t,e,n,o)},t.prototype.setVisibleNames=function(t){for(var e=new Set(t),n=0,o=this._elements;n<o.length;n++){var r=o[n];null!=r.name&&(r.visible=e.has(r.name))}},t.prototype.clearVisibility=function(){for(var t=0,e=this._elements;t<e.length;t++)e[t].visible=!0},t.prototype.convertParams=function(t){for(var e=[],n=[],o=[],r=0,i=t;r<i.length;r++){var l=i[r];switch(typeof l){case"string":var u=this.lookupElement(l);if(null==u)throw new TypeError("Element with name ".concat(l," not found."));u instanceof s.PointElement?e.push(u):u instanceof a.LineElement?(e.push(u.A),e.push(u.B)):n.push(u);break;case"number":o.push(l);break;default:throw new TypeError("Expecting only named elements (strings) or numbers.")}}return{P:e,E:n,N:o}},t.prototype.findConstruction=function(t,e){for(var n=0,o=i.constructions;n<o.length;n++){var r=o[n];if(r.validateSignature(t,e))return r}return null},t.prototype.createElement=function(t,e,n){var o=this.convertParams(e),r=this.findConstruction(t,o);if(null==r){var s=(0,i.getConstructionName)(t);throw null==n&&(n=""),new TypeError('Construction not found for "'.concat(n,'" ').concat(s," with params P=[").concat(o.P,"] E=[").concat(o.E,"] N=[").concat(o.N,"]"))}var a=r.construct(this._screen,o.P,o.E,o.N),l=a[0],u=a[1];-1!==this._elements.indexOf(u)&&(u.preexists=!0),null!=n&&(u.name=n);for(var c=0,h=l;c<h.length;c++){var p=h[c];-1==this._elements.indexOf(p)&&this._elements.push(p)}return-1==this._elements.indexOf(u)&&this._elements.push(u),u},t.prototype.reset=function(){for(var t=0,e=this._elements;t<e.length;t++)e[t].reset();this.update()},t.prototype.update=function(){for(var t=0,e=this._elements;t<e.length;t++)e[t].update();this.drawElements()},t.prototype.drawElements=function(){if(!this.inTest){var t=this._canvas.width,e=this._canvas.height,n=this._canvas.getContext("2d");n.clearRect(0,0,t,e),n.fillStyle=this._bgcolor,n.fillRect(0,0,t,e);for(var o=0,r=this._elements;o<r.length;o++)r[o].drawFace(this._canvas);for(var i=0,s=this._elements;i<s.length;i++)s[i].drawEdge(this._canvas);for(var a=0,l=this._elements;a<l.length;a++)l[a].drawVertex(this._canvas);for(var u=0,c=this._elements;u<c.length;u++)c[u].drawName(this._canvas);for(var h=0,p=this._ephemerals;h<p.length;h++)p[h].drawFace(this._canvas);for(var f=0,_=this._ephemerals;f<_.length;f++)_[f].drawEdge(this._canvas);for(var y=0,d=this._ephemerals;y<d.length;y++)d[y].drawVertex(this._canvas);for(var v=0,g=this._ephemerals;v<g.length;v++)g[v].drawName(this._canvas)}},t.prototype.updateCoordinates=function(t){for(++t;t<this._elements.length;t++)this._elements[t].defined()||this._elements[t].reset(),this._elements[t].update();this.drawElements()},t.prototype.translateCoordinates=function(t,e){for(var n=0;n<this._elements.length;n++){var o=this._elements[n];o.preexists||o.translate(t,e)}this.update()},t.prototype.closestVisiblePoint=function(t,e,n){void 0===n&&(n=30);var o=function(t,e){return(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)},r=t.filter((function(t){return t instanceof s.PointElement})).map((function(t){return t})).filter((function(t){return null!=t.vertexColor})).sort((function(t,n){var r=o(t,e),i=o(n,e);return r<i?-1:i<r?1:0}));if(0==r.length)return null;var i=r[0];return Math.sqrt(o(i,e))>n?null:i},t.prototype._getPick=function(t,e){if(null!=this._pick)return this._pick;var n=new s.PointElement({x:t,y:e}),o=this.closestVisiblePoint(this._elements,n);return null!=o?(this._pick=o,this._pick):void 0},t.prototype.setPivot=function(t){var e=t.split(","),n=e[0].trim(),r=this.lookupElement(n);if(null!=r&&r instanceof s.PointElement){var i=r;if(e.length>1){var a=e[1].trim(),l=this.lookupElement(a);if(null==l||!(l instanceof o.PlaneElement))return;l.pivot=i}else i._AP=this._screen,this._screen.pivot=i}},t.prototype.movePick=function(t,e){if(null!=this._getPick(t,e)){var n=this._elements.indexOf(this._pick),o=this._canvas.width;t<0?t=0:t>o&&(t=o);var r=this._canvas.height;if(e<0?e=0:e>r&&(e=r),!(Math.abs(t-this._pick.x)+Math.abs(e-this._pick.y)<1)){if(this._pick.draggable){if(!this._pick.drag(t,e))return;this.updateCoordinates(n)}else if(null!=this._pick.AP&&null!=this._pick.AP.pivot&&this._pick.AP.pivot!=this._pick)this.rotateCoordinates(t,e);else{var i=t-this._pick.x,s=e-this._pick.y;this.translateCoordinates(i,s)}this.drawElements()}}},t.prototype.rotateCoordinates=function(t,e){for(var n=this._pick,o=n.AP.pivot,r=s.PointElement.difference(n,o),i=t-o.x,a=e-o.y,l=n.AP.S,u=n.AP.T,c=s.PointElement.dot(r,l),h=s.PointElement.dot(r,u),p=l.x*u.y-l.y*u.x,f=(i*u.y-a*u.x)/p,_=(a*l.x-i*l.y)/p,y=(f*c+_*h)/(p=c*c+h*h),d=(_*c-f*h)/p,v=0,g=this._elements;v<g.length;v++){var m=g[v];m.preexists||m.rotate(o,y,d)}this.update()},t.numSlate=0,t}();e.Slate=u},6900(t,e,n){var o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},o.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.SlateAnimator=void 0;var r=n(7233),i="function"==typeof requestAnimationFrame,s="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return Date.now()},a=function(){function t(t){this.groups=[],this.mode="cascade",this.resolveCurrent=null,this.cascadeIndex=0,this.rafId=null,this.lastFrameMs=0,this.fadingOut=!1,this.fadeStartMs=0,this.slate=t}return t.prototype.run=function(t,e,n,i){var a=this;this.groups.length>0&&this.cancel();for(var l=[],u=this.slate.animationConfig||{},c=null!=u.speedMultiplier?u.speedMultiplier:1,h=!0===u.reducedMotion||0===c,p=function(t){var e=f.slate.lookupElement(t.elem);if(null==e)return"continue";var n=(0,r.findAnimation)(t.name);if(null==n)return"continue";if(!(e instanceof n.elementType))return"undefined"!=typeof console&&console.warn&&console.warn("[geomlib] animation '"+n.name+"' targets "+n.elementType.name+" but element '"+t.elem+"' is "+e.constructor.name+" — falling back to instant"),e.drawProgress=1,e.visible=!0,"continue";var i=(n.build(e,f.slate,t.args||{})||[]).map((function(e){return{step:o(o({},e),{durationMs:(r=e.durationMs,i=t.durationMs,s=u.durations&&u.durations[n.name],null!=i?i:null!=s?s:r)}),elapsedMs:0,started:!1,finalised:!1};var r,i,s}));l.push({target:e,steps:i,currentIndex:0})},f=this,_=0,y=n||[];_<y.length;_++)p(y[_]);for(var d=new Set(l.map((function(t){return t.target}))),v=0,g=this.slate.elements;v<g.length;v++){var m=g[v];if(null!=m.name){var P=t.has(m.name),C=e.has(m.name);d.has(m)?(m.shouldHighlight=C,m.drawProgress=0,m.visible=!1):(m.visible=P,m.shouldHighlight=C,m.drawProgress=1)}}if(h||0===l.length){for(var w=0,x=l;w<x.length;w++)for(var E=0,b=x[w].steps;E<b.length;E++){var A=b[E];A.step.setup&&!A.started&&A.step.setup(),A.step.finalise(),A.finalised=!0}return this.slate.clearEphemerals(),this.slate.drawElements(),Promise.resolve()}for(var S=0,O=l;S<O.length;S++)O[S].target.emphasized=!0;return this.groups=l,this.mode=i,this.cascadeIndex=0,this.lastFrameMs=s(),new Promise((function(t){a.resolveCurrent=t,a._kickoff(),a._scheduleFrame()}))},t.prototype._clearAnimatedEmphasis=function(){for(var t=0,e=this.groups;t<e.length;t++)e[t].target.emphasized=!1},t.prototype.cancel=function(){if(0!==this.groups.length){for(var t=0,e=this.groups;t<e.length;t++)for(var n=e[t],o=0;o<n.steps.length;o++){var r=n.steps[o];r.finalised||(r.step.setup&&!r.started&&(r.step.setup(),r.started=!0),r.step.finalise(),r.finalised=!0)}this._clearAnimatedEmphasis(),this.slate.clearEphemerals(),this.slate.drawElements(),this.groups=[],this.fadingOut=!1,null!=this.rafId&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this.rafId),this.rafId=null,this.resolveCurrent&&(this.resolveCurrent(),this.resolveCurrent=null)}},t.prototype._kickoff=function(){if("cascade"===this.mode)this._startGroupIndex(0);else for(var t=0,e=this.groups;t<e.length;t++){var n=e[t];this._startStep(n,0)}},t.prototype._startGroupIndex=function(t){t>=this.groups.length||this._startStep(this.groups[t],0)},t.prototype._startStep=function(t,e){if(!(e>=t.steps.length)){var n=t.steps[e];n.started||(0===e&&(t.target.visible=!0),n.step.setup&&n.step.setup(),n.started=!0,t.currentIndex=e)}},t.prototype._scheduleFrame=function(){var t=this;if(i)this.rafId=requestAnimationFrame((function(e){return t._frame(e)}));else{var e=s()+16;this.rafId=setTimeout((function(){return t._frame(e)}),16)}},t.prototype._frame=function(t){if(0!==this.groups.length){var e=this.slate.animationConfig||{},n=null!=e.speedMultiplier?e.speedMultiplier:1,o=e.cascadeGapMs||0,r=t-this.lastFrameMs;r<0&&(r=0),r>100&&(r=100);var i=r*n;if(this.lastFrameMs=t,"cascade"===this.mode?this._tickCascade(i,t,o):this._tickParallel(i,t),this.slate.drawElements(),this._allFinalised()){this.fadingOut||(this.fadingOut=!0,this.fadeStartMs=t);for(var s=t-this.fadeStartMs,a=s>=250?1:s/250,l=1-a,u=0,c=this.groups;u<c.length;u++)c[u].target.emphasisAmount=l;return this.slate.drawElements(),a>=1?(this._clearAnimatedEmphasis(),this.groups=[],this.fadingOut=!1,this.rafId=null,void(this.resolveCurrent&&(this.resolveCurrent(),this.resolveCurrent=null))):void this._scheduleFrame()}this._scheduleFrame()}},t.prototype._tickCascade=function(t,e,n){for(;this.cascadeIndex<this.groups.length;){var o=this.groups[this.cascadeIndex],r=o.steps[o.currentIndex];if(r){if(!r.finalised)return void this._tickStep(o.target,r,t,e);if(null==o.finishedAtMs&&(o.finishedAtMs=e),e-o.finishedAtMs<n)return;o.currentIndex+1<o.steps.length?this._startStep(o,o.currentIndex+1):(this.cascadeIndex+=1,this.cascadeIndex<this.groups.length&&this._startStep(this.groups[this.cascadeIndex],0))}else this.cascadeIndex+=1,this.cascadeIndex<this.groups.length&&this._startStep(this.groups[this.cascadeIndex],0)}},t.prototype._tickParallel=function(t,e){for(var n=0,o=this.groups;n<o.length;n++){var r=o[n],i=r.steps[r.currentIndex];i&&(i.finalised?r.currentIndex+1<r.steps.length&&this._startStep(r,r.currentIndex+1):this._tickStep(r.target,i,t,e))}},t.prototype._tickStep=function(t,e,n,o){e.started||(e.step.setup&&e.step.setup(),e.started=!0),e.elapsedMs+=n;var r=e.step.durationMs,i=r>0?e.elapsedMs/r:1;i>1&&(i=1),i<0&&(i=0),e.step.tick(i,n,e.elapsedMs),i>=1&&(e.step.finalise(),e.finalised=!0)},t.prototype._allFinalised=function(){for(var t=0,e=this.groups;t<e.length;t++)for(var n=0,o=e[t].steps;n<o.length;n++)if(!o[n].finalised)return!1;return!0},t}();e.SlateAnimator=a},3267(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.trackWindowResize=l,e.createControls=function(t,e,n){e.parentElement&&new u(t,e,n).init()};var o=n(7680);function r(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches}var i=r()?18:20,s=(r(),4),a=r()?7:8;function l(t,e){var n=function(){return e()};return t.addEventListener("resize",n),function(){return t.removeEventListener("resize",n)}}var u=function(){function t(t,e,n){this._maximized=!1,this._savedStyles=null,this._stopTrackingResize=null,this._presenting=!1,this._presentationIndex=0,this._presentationOverlay=null,this._presentationCaption=null,this._presentationJusts=null,this._presentationCounter=null,this._presentationOnKey=null,this._stickyRefSpan=null,this._stickyRefElem=null,this._slate=t,this._canvas=e,this._config=n}return t.prototype.init=function(){this._wrapper=this.createWrapper(),this.createButtons(),this.addKeyboardShortcuts()},t.prototype.createWrapper=function(){var t=this,e=document.createElement("div");return e.style.position="relative",e.style.display="inline-block",this._canvas.parentElement.insertBefore(e,this._canvas),e.appendChild(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.style.outline="none",this._canvas.addEventListener("focus",(function(){t._canvas.style.outline="2px solid rgba(66,133,244,0.5)"})),this._canvas.addEventListener("blur",(function(){t._canvas.style.outline="none"})),e},t.prototype.createButtons=function(){var t=this,e=[{draw:h,action:function(){return t.onReset()},title:"Reset (r)"},{draw:p,action:function(){return t.onMaximize()},title:"Maximize (m)"},{draw:f,action:function(){return t.onNewWindow()},title:"New Window (u)"}];this._slate.slides.length>0&&e.push({draw:_,action:function(){return t.onPresent()},title:"Present (p)"});for(var n=function(n){var r=document.createElement("button");r.style.position="absolute",r.style.top=a+"px",r.style.right=a+n*(i+s)+"px",r.style.width=i+"px",r.style.height=i+"px",r.style.padding="0",r.style.border="none",r.style.cursor="pointer",r.style.background="rgba(0,0,0,0.12)",r.style.borderRadius="3px",r.title=e[n].title,r.addEventListener("mouseenter",(function(){r.style.background="rgba(0,0,0,0.3)"})),r.addEventListener("mouseleave",(function(){r.style.background="rgba(0,0,0,0.12)"}));var l=document.createElement("canvas");l.width=i,l.height=i,l.style.display="block";var u=l.getContext("2d");e[n].draw(u,i),r.appendChild(l),r.addEventListener("click",(function(o){o.stopPropagation(),e[n].action(),t._canvas.focus()})),1===n&&(o._maxBtn=r,o._maxIconCanvas=l),o._wrapper.appendChild(r)},o=this,r=0;r<e.length;r++)n(r)},t.prototype.addKeyboardShortcuts=function(){var t=this;this._canvas.addEventListener("keydown",(function(e){switch(e.key){case"r":case"R":case" ":e.preventDefault(),t.onReset();break;case"u":case"U":case"Enter":e.preventDefault(),t.onNewWindow();break;case"m":case"M":e.preventDefault(),t.onMaximize();break;case"p":case"P":t._slate.slides.length>0&&(e.preventDefault(),t.onPresent())}}))},t.prototype.onReset=function(){this._slate.reset()},t.prototype.onMaximize=function(){this._maximized?this.minimize():this.maximize()},t.prototype.maximize=function(){var t=this;this._savedStyles={wrapperPosition:this._wrapper.style.position,wrapperTop:this._wrapper.style.top,wrapperLeft:this._wrapper.style.left,wrapperWidth:this._wrapper.style.width,wrapperHeight:this._wrapper.style.height,wrapperZIndex:this._wrapper.style.zIndex,wrapperBackground:this._wrapper.style.background,canvasStyleWidth:this._canvas.style.width,canvasStyleHeight:this._canvas.style.height,canvasAttrWidth:this._canvas.width,canvasAttrHeight:this._canvas.height},this._wrapper.style.position="fixed",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.style.width="100vw",this._wrapper.style.height="100vh",this._wrapper.style.zIndex="9999",this._wrapper.style.background="white",this._canvas.style.width="100%",this._canvas.style.height="100%",this.resizeAndRedraw(),this._maximized=!0,this.updateMaximizeIcon(),this._stopTrackingResize=l(window,(function(){return t.resizeAndRedraw()}))},t.prototype.minimize=function(){this._savedStyles&&(this._stopTrackingResize&&(this._stopTrackingResize(),this._stopTrackingResize=null),this._wrapper.style.position=this._savedStyles.wrapperPosition,this._wrapper.style.top=this._savedStyles.wrapperTop,this._wrapper.style.left=this._savedStyles.wrapperLeft,this._wrapper.style.width=this._savedStyles.wrapperWidth,this._wrapper.style.height=this._savedStyles.wrapperHeight,this._wrapper.style.zIndex=this._savedStyles.wrapperZIndex,this._wrapper.style.background=this._savedStyles.wrapperBackground,this._canvas.style.width=this._savedStyles.canvasStyleWidth,this._canvas.style.height=this._savedStyles.canvasStyleHeight,this._canvas.width=this._savedStyles.canvasAttrWidth,this._canvas.height=this._savedStyles.canvasAttrHeight,this.resizeAndRedraw(),this._maximized=!1,this._savedStyles=null,this.updateMaximizeIcon())},t.prototype.resizeAndRedraw=function(){var t=this._canvas.clientWidth,e=this._canvas.clientHeight;this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e),this._slate.update()},t.prototype.updateMaximizeIcon=function(){var t=this._maxIconCanvas,e=this._maxBtn;if(t){var n=t.getContext("2d");n.clearRect(0,0,i,i),this._maximized?(function(t,e){var n=e-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var o=4+n,r=4,i=4+.55*n,s=4+.45*n;t.beginPath(),t.moveTo(o,r),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i+5,s),t.lineTo(i,s-5),t.closePath(),t.fill(),o=4,r=4+n,i=4+.45*n,s=4+.55*n,t.beginPath(),t.moveTo(o,r),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i-5,s),t.lineTo(i,s+5),t.closePath(),t.fill()}(n,i),e.title="Minimize (m)"):(p(n,i),e.title="Maximize (m)")}},t.prototype.onNewWindow=function(){for(var t=document.querySelectorAll("script[src]"),e="bundle.js",n=0;n<t.length;n++){var o=t[n].src;if(o.indexOf("bundle.js")>=0){e=o;break}}var r=Object.assign({},this._config,{canvasid:"canvasId"}),i=JSON.stringify(r),s=this._config.title||"Geometry",a="<!DOCTYPE html>\n<html><head><title>".concat(s,'</title></head>\n<body style="margin:0;padding:0;overflow:hidden;">\n<canvas id="canvasId" style="width:100vw;height:100vh;"></canvas>\n<script src="').concat(e,'"><\/script>\n<script>geomlib.init(').concat(i,");<\/script>\n</body></html>"),l=window.open("","_blank");l&&(l.document.write(a),l.document.close())},t.prototype.onPresent=function(){this._presenting||0!==this._slate.slides.length&&(this._maximized||this.maximize(),this.buildPresentationOverlay(),this.bindPresentationKeys(),this._presenting=!0,this.showSlide(0))},t.prototype.exitPresent=function(){if(this._presenting){this.unbindPresentationKeys(),this.clearStickyRef(),this.removePresentationOverlay(),this._slate.clearVisibility();for(var t=0,e=this._slate.elements;t<e.length;t++){var n=e[t];n.shouldHighlight=!1,n.emphasized=!1}this._slate.update(),this._presenting=!1}},t.prototype.buildPresentationOverlay=function(){var t=this,e=document.createElement("div");e.className="geomlib-presentation-overlay",e.style.position="fixed",e.style.left="0",e.style.right="0",e.style.bottom="0",e.style.margin="0 auto",e.style.maxWidth="100vw",e.style.background="#ffffff",e.style.color="#222",e.style.borderTop="1px solid rgba(0,0,0,0.18)",e.style.boxShadow="0 -6px 18px rgba(0,0,0,0.18)",e.style.padding="12px 16px calc(12px + env(safe-area-inset-bottom, 0px))",e.style.zIndex="2147483647",e.style.fontFamily="Georgia, 'Times New Roman', serif",e.style.touchAction="manipulation",e.style.boxSizing="border-box",e.style.textAlign="center";var n=document.createElement("div");n.className="geomlib-presentation-caption",n.style.fontSize="1.1rem",n.style.lineHeight="1.45",n.style.textAlign="center",n.style.marginBottom="6px",e.appendChild(n);var o=document.createElement("div");o.className="geomlib-presentation-justs",o.style.fontSize="0.85rem",o.style.textAlign="center",o.style.opacity="0.85",o.style.minHeight="1em",o.style.marginBottom="10px",e.appendChild(o);var r=document.createElement("div");r.className="geomlib-presentation-nav",r.style.display="flex",r.style.gap="10px",r.style.alignItems="center",r.style.justifyContent="center";var i=c("‹ Prev"),s=document.createElement("span");s.className="geomlib-presentation-counter",s.style.minWidth="56px",s.style.textAlign="center",s.style.opacity="0.7",s.style.fontSize="0.9rem";var a=c("Next ›"),l=c("✕ Exit");l.style.marginLeft="16px",i.addEventListener("click",(function(e){e.stopPropagation(),t.showSlide(t._presentationIndex-1)})),a.addEventListener("click",(function(e){e.stopPropagation(),t.showSlide(t._presentationIndex+1)})),l.addEventListener("click",(function(e){e.stopPropagation(),t.exitPresent()})),r.appendChild(i),r.appendChild(s),r.appendChild(a),r.appendChild(l),e.appendChild(r),document.documentElement.appendChild(e),this._presentationOverlay=e,this._presentationCaption=n,this._presentationJusts=o,this._presentationCounter=s},t.prototype.removePresentationOverlay=function(){this._presentationOverlay&&this._presentationOverlay.parentNode&&this._presentationOverlay.parentNode.removeChild(this._presentationOverlay),this._presentationOverlay=null,this._presentationCaption=null,this._presentationJusts=null,this._presentationCounter=null},t.prototype.bindPresentationKeys=function(){var t=this,e=function(e){if(t._presenting)switch(e.key){case"ArrowLeft":e.preventDefault(),t.showSlide(t._presentationIndex-1);break;case"ArrowRight":case" ":e.preventDefault(),t.showSlide(t._presentationIndex+1);break;case"Escape":e.preventDefault(),t.exitPresent()}};this._presentationOnKey=e,document.addEventListener("keydown",e)},t.prototype.unbindPresentationKeys=function(){this._presentationOnKey&&(document.removeEventListener("keydown",this._presentationOnKey),this._presentationOnKey=null)},t.prototype.showSlide=function(t){var e=this._slate.slides;if(0!==e.length){var n=Math.max(0,Math.min(e.length-1,t));this._presentationIndex=n;var r=(0,o.computeSlideState)(this._slate,e,n);this.clearStickyRef();for(var i=e[n],s=i.transition,a=s&&s.animations,l=s&&"parallel"===s.mode?"parallel":"cascade",u=0,c=this._slate.elements;u<c.length;u++)(f=c[u]).emphasized=!1;if(a&&a.length>0)this._slate.animateTo(r.visible,r.highlighted,a,l);else{for(var h=0,p=this._slate.elements;h<p.length;h++){var f;null!=(f=p[h]).name&&(f.visible=r.visible.has(f.name),f.shouldHighlight=r.highlighted.has(f.name),f.drawProgress=1)}this._slate.update()}if(this._presentationCaption&&this.renderCaptionText(this._presentationCaption,i.text||""),this._presentationCounter&&(this._presentationCounter.textContent=n+1+" / "+e.length),this._presentationJusts){this._presentationJusts.innerHTML="";var _=this._slate.resolveJustification;if(i.justifications)for(var y=0;y<i.justifications.length;y++){if(y>0){var d=document.createElement("span");d.textContent=" · ",d.style.opacity="0.5",this._presentationJusts.appendChild(d)}var v=i.justifications[y].ref,g=_?_(v):null;if(g){var m=document.createElement("a");m.href=g,m.textContent=v,m.target="_blank",m.rel="noopener",m.style.color="#0066cc",this._presentationJusts.appendChild(m)}else{var P=document.createElement("span");P.textContent=v,this._presentationJusts.appendChild(P)}}}}},t.prototype.renderCaptionText=function(t,e){t.innerHTML="";for(var n,o=/\{([A-Za-z][A-Za-z0-9'\-]*)\}/g,r=0;null!==(n=o.exec(e));){n.index>r&&t.appendChild(document.createTextNode(e.slice(r,n.index)));var i=n[1],s=this._slate.lookupElement(i);s?t.appendChild(this.buildCaptionRef(i,s)):t.appendChild(document.createTextNode(i)),r=n.index+n[0].length}r<e.length&&t.appendChild(document.createTextNode(e.slice(r)))},t.prototype.buildCaptionRef=function(t,e){var n=this,o=document.createElement("span");return o.className="geomlib-presentation-ref",o.textContent=t,o.style.fontWeight="700",o.style.fontStyle="italic",o.style.cursor="pointer",o.style.borderBottom="1px dotted currentColor",o.addEventListener("mouseenter",(function(){null==n._stickyRefSpan&&(e.emphasized=!0,n._slate.update())})),o.addEventListener("mouseleave",(function(){null==n._stickyRefSpan&&(e.emphasized=!1,n._slate.update())})),o.addEventListener("pointerdown",(function(t){t.preventDefault(),t.stopPropagation();var r=n._stickyRefSpan===o;n.clearStickyRef(),r||n.setStickyRef(o,e),n._slate.update()})),o},t.prototype.clearStickyRef=function(){null!=this._stickyRefSpan&&(this._stickyRefSpan.classList.remove("active"),this._stickyRefSpan.style.color=""),null!=this._stickyRefElem&&(this._stickyRefElem.emphasized=!1),this._stickyRefSpan=null,this._stickyRefElem=null},t.prototype.setStickyRef=function(t,e){t.classList.add("active"),t.style.color="#b08800",e.emphasized=!0,this._stickyRefSpan=t,this._stickyRefElem=e},t}();function c(t){var e=document.createElement("button");return e.textContent=t,e.style.background="rgba(0,0,0,0.08)",e.style.color="#222",e.style.border="1px solid rgba(0,0,0,0.15)",e.style.borderRadius="4px",e.style.padding="10px 16px",e.style.minHeight="44px",e.style.cursor="pointer",e.style.fontFamily="inherit",e.style.fontSize="1rem",e.style.touchAction="manipulation",e.addEventListener("mouseenter",(function(){e.style.background="rgba(0,0,0,0.16)"})),e.addEventListener("mouseleave",(function(){e.style.background="rgba(0,0,0,0.08)"})),e}function h(t,e){var n=e/2,o=e/2,r=.32*e;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5,t.beginPath(),t.arc(n,o,r,.5*-Math.PI,.75*Math.PI),t.stroke();var i=.75*Math.PI,s=n+r*Math.cos(i),a=o+r*Math.sin(i),l=i+.3*Math.PI,u=i+.9*Math.PI;t.beginPath(),t.moveTo(s,a),t.lineTo(s+4*Math.cos(l),a+4*Math.sin(l)),t.lineTo(s+4*Math.cos(u),a+4*Math.sin(u)),t.closePath(),t.fill()}function p(t,e){var n=e-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var o=4+.55*n,r=4+.45*n,i=4+n,s=4;t.beginPath(),t.moveTo(o,r),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i-5,s),t.lineTo(i,s+5),t.closePath(),t.fill(),o=4+.45*n,r=4+.55*n,i=4,s=4+n,t.beginPath(),t.moveTo(o,r),t.lineTo(i,s),t.stroke(),t.beginPath(),t.moveTo(i,s),t.lineTo(i+5,s),t.lineTo(i,s-5),t.closePath(),t.fill()}function f(t,e){var n=e-8;t.strokeStyle="rgba(0,0,0,0.7)",t.fillStyle="rgba(0,0,0,0.7)",t.lineWidth=1.5;var o=4+.3*n,r=.65*n,i=.7*n;t.strokeRect(4,o,r,i);var s=4+.4*n,a=4+.6*n,l=4+n;t.beginPath(),t.moveTo(s,a),t.lineTo(l,4),t.stroke(),t.beginPath(),t.moveTo(l,4),t.lineTo(l-5,4),t.lineTo(l,9),t.closePath(),t.fill()}function _(t,e){var n=.28*e,o=n-1,r=e-n+2,i=n,s=e-n;t.fillStyle="rgba(0,0,0,0.7)",t.beginPath(),t.moveTo(o,i),t.lineTo(o,s),t.lineTo(r,e/2),t.closePath(),t.fill()}},7233(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InstantAnimation=e.Animation=e.A=e.AllAnimations=void 0,e.registerAnimation=p,e.findAnimation=function(t){var e;if(null==(e="string"==typeof t?c.get(t):u.get(t))){var n=String(t);return h.has(n)||(h.add(n),"undefined"!=typeof console&&console.warn&&console.warn("[geomlib] unknown animation '"+n+"' — falling back to instant")),null}return null!=e?e:null};var i,s=n(8020);!function(t){t[t.INSTANT=0]="INSTANT",t[t.POINT_APPEAR=1]="POINT_APPEAR",t[t.POINT_INTERSECT=2]="POINT_INTERSECT",t[t.LINE_STRAIGHT_EDGE_CONNECT=3]="LINE_STRAIGHT_EDGE_CONNECT",t[t.LINE_STRAIGHT_EDGE_EXTEND=4]="LINE_STRAIGHT_EDGE_EXTEND",t[t.LINE_COMPASS_TRANSFER=5]="LINE_COMPASS_TRANSFER",t[t.CIRCLE_COMPASS=6]="CIRCLE_COMPASS",t[t.CIRCLE_COMPASS_EXPLICIT=7]="CIRCLE_COMPASS_EXPLICIT",t[t.POLYGON_OUTLINE=8]="POLYGON_OUTLINE",t[t.POLYGON_OUTLINE_AND_FILL=9]="POLYGON_OUTLINE_AND_FILL",t[t.POLYGON_SUPERPOSE=10]="POLYGON_SUPERPOSE",t[t.SECTOR_SWEEP=11]="SECTOR_SWEEP"}(i||(e.AllAnimations=i={})),e.A={Point:{appear:i.POINT_APPEAR,intersect:i.POINT_INTERSECT},Line:{straightEdgeConnect:i.LINE_STRAIGHT_EDGE_CONNECT,straightEdgeExtend:i.LINE_STRAIGHT_EDGE_EXTEND,compassTransfer:i.LINE_COMPASS_TRANSFER},Circle:{compass:i.CIRCLE_COMPASS,compassExplicit:i.CIRCLE_COMPASS_EXPLICIT},Polygon:{outline:i.POLYGON_OUTLINE,outlineAndFill:i.POLYGON_OUTLINE_AND_FILL,superpose:i.POLYGON_SUPERPOSE},Sector:{sweep:i.SECTOR_SWEEP},instant:i.INSTANT};var a=function(){};e.Animation=a;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.INSTANT,e.name="instant",e.elementType=s.GeomElement,e}return r(e,t),e.prototype.build=function(t,e,n){return[{durationMs:0,tick:function(){},finalise:function(){t.drawProgress=1,t.visible=!0}}]},e}(a);e.InstantAnimation=l;var u=new Map,c=new Map,h=new Set;function p(t){u.set(t.animationMethod,t),c.set(t.name,t)}p(new l)},7658(t,e,n){var o,r,i,s,a,l,u,c,h,p=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.constructions=e.Construction=e.E=e.PolyhedraConstructions=e.SphereConstructions=e.PlaneConstructions=e.SectorConstructions=e.PolygonConstructions=e.CircleConstructions=e.LineConstructions=e.PointConstructions=e.ConstructionTypes=void 0,e.getConstructionName=function(t){return t<100?"Point."+r[t]:100<t&&t<200?"Line."+i[t]:300<t&&t<400?"Polygon."+a[t]:400<t&&t<500?"Sector."+l[t]:500<t&&t<600?"Plane."+u[t]:600<t&&t<700?"Sphere."+c[t]:700<t&&t<800?"Polyhedra."+h[t]:"<Not Valid Construction>"},function(t){t[t.Integer=0]="Integer",t[t.PointElement=1]="PointElement",t[t.CircleElement=2]="CircleElement",t[t.PlaneElement=3]="PlaneElement",t[t.SphereElement=4]="SphereElement",t[t.PolygonElement=5]="PolygonElement",t[t.PolyhedronElement=6]="PolyhedronElement"}(o||(e.ConstructionTypes=o={})),function(t){t[t.free=1]="free",t[t.midpoint=2]="midpoint",t[t.intersection=3]="intersection",t[t.first=4]="first",t[t.last=5]="last",t[t.center=6]="center",t[t.lineSlider=7]="lineSlider",t[t.circleSlider=8]="circleSlider",t[t.circumcenter=9]="circumcenter",t[t.vertex=10]="vertex",t[t.foot=11]="foot",t[t.cutoff=12]="cutoff",t[t.extend=13]="extend",t[t.parallelogram=14]="parallelogram",t[t.similar=15]="similar",t[t.perpendicular=16]="perpendicular",t[t.proportion=17]="proportion",t[t.invert=18]="invert",t[t.meanProportional=19]="meanProportional",t[t.planeSlider=20]="planeSlider",t[t.sphereSlider=21]="sphereSlider",t[t.angleBisector=22]="angleBisector",t[t.angleDivider=23]="angleDivider",t[t.fixed=24]="fixed",t[t.lineSegmentSlider=25]="lineSegmentSlider",t[t.harmonic=26]="harmonic"}(r||(e.PointConstructions=r={})),function(t){t[t.connect=101]="connect",t[t.angleBisector=102]="angleBisector",t[t.angleDivider=103]="angleDivider",t[t.foot=104]="foot",t[t.chord=105]="chord",t[t.bichord=106]="bichord",t[t.perpendicular=107]="perpendicular",t[t.cutoff=108]="cutoff",t[t.extend=109]="extend",t[t.parallel=110]="parallel",t[t.similar=111]="similar",t[t.proportion=112]="proportion",t[t.meanProportional=113]="meanProportional"}(i||(e.LineConstructions=i={})),function(t){t[t.radius=201]="radius",t[t.circumcircle=202]="circumcircle",t[t.invert=203]="invert",t[t.intersection=204]="intersection"}(s||(e.CircleConstructions=s={})),function(t){t[t.square=301]="square",t[t.triangle=302]="triangle",t[t.quadrilateral=303]="quadrilateral",t[t.pentagon=304]="pentagon",t[t.hexagon=305]="hexagon",t[t.equilateralTriangle=306]="equilateralTriangle",t[t.parallelogram=307]="parallelogram",t[t.regularPolygon=308]="regularPolygon",t[t.starPolygon=309]="starPolygon",t[t.similar=310]="similar",t[t.application=311]="application",t[t.octagon=312]="octagon",t[t.face=313]="face"}(a||(e.PolygonConstructions=a={})),function(t){t[t.sector=401]="sector",t[t.arc=402]="arc"}(l||(e.SectorConstructions=l={})),function(t){t[t.threePoints=501]="threePoints",t[t.perpendicular=502]="perpendicular",t[t.parallel=503]="parallel",t[t.ambient=504]="ambient"}(u||(e.PlaneConstructions=u={})),function(t){t[t.radius=601]="radius"}(c||(e.SphereConstructions=c={})),function(t){t[t.tetrahedron=701]="tetrahedron",t[t.parallelepiped=702]="parallelepiped",t[t.prism=703]="prism",t[t.pyramid=704]="pyramid"}(h||(e.PolyhedraConstructions=h={})),e.E={Point:r,Line:i,Circle:s,Polygon:a,Sector:l,Plane:u,Sphere:c,Polyhedra:h};var f=function(){function t(){}return t.prototype.validateSignature=function(t,e){if(t!=this.constructionMethod)return!1;var n=this.signature;if(n.points!==e.P.length)return!1;if(n.elements!==e.E.length)return!1;if(n.integers!==e.N.length)return!1;if(n.elementTypes)for(var o=0;o<n.elementTypes.length;o++)if(!(e.E[o]instanceof n.elementTypes[o]))return!1;return!0},t}();e.Construction=f;var _=n(4461),y=n(7339),d=n(9275),v=n(4133),g=n(5755),m=n(5193),P=n(8649),C=n(1099);e.constructions=p(p(p(p(p(p(p(p([],_.pointConstructions,!0),y.lineConstructions,!0),d.circleConstructions,!0),g.sectorConstructions,!0),v.polygonConstructions,!0),m.planeConstructions,!0),P.sphereConstructions,!0),C.polyhedronConstructions,!0)},8020(t,e){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.GeomElement=e.Align=void 0,function(t){t[t.CENTRAL=0]="CENTRAL",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW"}(n||(e.Align=n={}));var o=function(){function t(){this.preexists=!1,this._nameColor=null,this._vertexColor=null,this._edgeColor=null,this._faceColor=null,this._nameHighlightColor="#FFD700",this._vertexHighlightColor="#FFD700",this._edgeHighlightColor="#FFD700",this._faceHighlightColor="#FFD700",this._shouldHighlight=!1,this._visible=!0,this._emphasisAmount=0,this._drawProgress=1,this._pixelTolerance=50}return t.setFont=function(e,n){t._font="italic ".concat(n,"px ").concat(e)},t.prototype._getTextMetrics=function(t,e){var n=t.measureText(e);return[n.width,null!=n.actualBoundingBoxAscent?n.actualBoundingBoxAscent+n.actualBoundingBoxDescent:16]},t.prototype.drawString=function(e,o,r,i){var s=r.getContext("2d");if(null!=this._nameColor){s.font=t._font,s.fillStyle=this._nameColor;var a=this._getTextMetrics(s,this._name),l=a[0],u=a[1];switch(i||this._align){case n.LEFT:return e=e-l-6,o=o+u/2-4,void s.fillText(this._name,e,o);case n.RIGHT:return e+=2,o+=u/2-4,void s.fillText(this._name,e,o);case n.ABOVE:return e-=l/2,o+=-u/2+4,void s.fillText(this._name,e,o);case n.BELOW:return e-=l/2,o+=u/2+6,void s.fillText(this._name,e,o)}var c=r.width,h=r.height,p=(e-c/2)*h,f=(o-h/2)*c;f>p?f>=-p?(e-=l/2,o+=u/2+6,s.fillText(this._name,e,o)):(e=e-l-6,o+=u/2-4,s.fillText(this._name,e,o)):f>=-p?(e+=2,o+=u/2-4,s.fillText(this._name,e,o)):(e-=l/2,o+=-u/2+4,s.fillText(this._name,e,o))}},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.update()},t.prototype.defined=function(){return!1},t.prototype.drag=function(t,e){return!1},Object.defineProperty(t.prototype,"nameColor",{get:function(){return this._nameColor},set:function(t){this._nameColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeColor",{get:function(){return this._edgeColor},set:function(t){this._edgeColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceColor",{get:function(){return this._faceColor},set:function(t){this._faceColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nameHighlightColor",{get:function(){return this._nameHighlightColor},set:function(t){this._nameHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexHighlightColor",{get:function(){return this._vertexHighlightColor},set:function(t){this._vertexHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgeHighlightColor",{get:function(){return this._edgeHighlightColor},set:function(t){this._edgeHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"faceHighlightColor",{get:function(){return this._faceHighlightColor},set:function(t){this._faceHighlightColor=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"draggable",{get:function(){return this._draggable},set:function(t){this._draggable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimension",{get:function(){return this._dimension},set:function(t){this._dimension=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldHighlight",{get:function(){return this._shouldHighlight},set:function(t){this._shouldHighlight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"emphasized",{get:function(){return this._emphasisAmount>0},set:function(t){this._emphasisAmount=t?1:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"emphasisAmount",{get:function(){return this._emphasisAmount},set:function(t){this._emphasisAmount=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawProgress",{get:function(){return this._drawProgress},set:function(t){this._drawProgress=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertexColor",{get:function(){return this._vertexColor},set:function(t){this._vertexColor=t},enumerable:!1,configurable:!0}),t._font="italic 18px Times New Roman",t}();e.GeomElement=o},9222(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleCompassAnimation=void 0;var i=n(7233),s=n(1313),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.CIRCLE_COMPASS,e.name="Circle.compass",e.elementType=s.CircleElement,e.defaultRate=.003,e.defaultDurationMs=600,e}return r(e,t),e.prototype.build=function(t,e,n){var o=t,r=n&&"number"==typeof n.startAngle?n.startAngle:Math.atan2(o.B.y-o.Center.y,o.B.x-o.Center.x),i=2*Math.PI/this.defaultRate,s=function(){o.faceAlpha=1,o.drawProgress=1,o.drawStartAngle=0,o.visible=!0},a={durationMs:i,setup:function(){o.drawStartAngle=r,o.faceAlpha=0,o.drawProgress=0},tick:function(t){o.drawProgress=t},finalise:function(){o.drawProgress=1}};return null==o.faceColor?(a.finalise=s,[a]):[a,{durationMs:Math.min(i/2,this.defaultDurationMs),tick:function(t){o.faceAlpha=t},finalise:s}]},e}(i.Animation);e.CircleCompassAnimation=a,(0,i.registerAnimation)(new a)},9275(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.circleConstructions=e.SphereIntersectionConstruction=e.InvertCircleConstruction=e.CircleRadius3PointConstruction=e.CircleRadiusCenterConstruction=void 0;var i=n(7658),s=n(1313),a=n(4021),l=n(8157),u=n(6055),c=n(2295),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.radius,e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof u.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new s.CircleElement({C:e[0],B:e[1],AP:r});return[[i],i]},e}(i.Construction);e.CircleRadiusCenterConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.radius,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof u.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new s.CircleElement({C:e[0],A:e[1],B:e[2],AP:r});return[[i],i]},e}(i.Construction);e.CircleRadius3PointConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.invert,e.signature={points:0,elements:2,integers:0,elementTypes:[s.CircleElement,s.CircleElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new a.InvertCircleElement(n[0],n[1]);return[[r],r]},e}(i.Construction);e.InvertCircleConstruction=f;var _=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.intersection,e.signature={points:0,elements:2,integers:0,elementTypes:[c.SphereElement,c.SphereElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new l.SphereIntersectionElement(n[0],n[1]);return[[r],r]},e}(i.Construction);e.SphereIntersectionConstruction=_,e.circleConstructions=[new p,new h,new f,new _]},1313(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleElement=void 0;var i=n(8020),s=function(t){function e(e){var n=t.call(this)||this;return n._drawStartAngle=0,n._faceAlpha=1,n.dimension=2,null==e||(n.Center=e.C,n.A=null!=e.A?e.A:n.Center,n.B=e.B,n.AP=e.AP),n}return r(e,t),Object.defineProperty(e.prototype,"drawStartAngle",{get:function(){return this._drawStartAngle},set:function(t){this._drawStartAngle=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius",{get:function(){return this.A.distance(this.B)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"radius2",{get:function(){return this.A.distance2(this.B)},enumerable:!1,configurable:!0}),e.prototype.defined=function(){return!0},e.prototype._drawCircleArc=function(t,e,n){t.beginPath();var o=this.radius2,r=Math.sqrt(o),i=this.AP.S.z*this.AP.S.z+this.AP.T.z*this.AP.T.z;if(Math.abs(i)<.01)t.ellipse(this.Center.x,this.Center.y,r,r,0,e,n);else{var s=r/Math.sqrt(i),a=s*this.AP.T.z,l=-s*this.AP.S.z,u=a*this.AP.S.x+l*this.AP.T.x,c=a*this.AP.S.y+l*this.AP.T.y,h=i<1?Math.sqrt(1-i):0,p=-h*c,f=h*u,_=Math.sqrt(u*u+c*c),y=Math.sqrt(p*p+f*f);if(y<.5)return t.moveTo(this.Center.x-u,this.Center.y-c),void t.lineTo(this.Center.x+u,this.Center.y+c);var d=Math.atan2(c,u);t.ellipse(this.Center.x,this.Center.y,_,y,d,e,n)}},e.prototype.drawEdge=function(t){if(this.visible){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(null!=e&&this.defined()){var n=t.getContext("2d");n.strokeStyle=e;var o=this.shouldHighlight?3:1;n.lineWidth=o+this.emphasisAmount*(6-o);var r=this.drawStartAngle,i=r+2*Math.PI*this.drawProgress;this._drawCircleArc(n,r,i),n.stroke()}}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()){var e=this.faceAlpha;if(!(e<=0)){var n=t.getContext("2d");n.fillStyle=this.faceColor,this._drawCircleArc(n,0,2*Math.PI),e<1?(n.save(),n.globalAlpha=e,n.fill(),n.restore()):n.fill()}}},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name){var e=t.getContext("2d");e.strokeStyle=this.nameColor,e.font=i.GeomElement._font;var n=this._getTextMetrics(e,this.name),o=n[0],r=n[1];e.fillText(this._name,this.Center.x-o/2,this.Center.y-r/2)}},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(i.GeomElement);e.CircleElement=s},2218(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircumcircleElement=void 0;var i=n(6091),s=function(t){function e(e,n,o,r){var s=t.call(this)||this;return s.dimension=2,s.B=e,s.C=n,s.D=o,s.AP=r,s.Center=new i.PointElement({AP:r}),s.A=s.Center,s}return r(e,t),e.prototype.update=function(){this.Center.toCircumcenter(this.B,this.C,this.D)},e.prototype.translate=function(t,e){this.Center.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n)},e}(n(1313).CircleElement);e.CircumcircleElement=s},4021(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvertCircleElement=void 0;var i=n(1313),s=n(6091),a=function(t){function e(e,n){var o=t.call(this)||this;return o.dimension=2,o._C=e,o._D=n,o.AP=e.AP,o.Center=new s.PointElement({AP:o.AP}),o.A=o.Center,o.B=new s.PointElement({AP:o.AP}),o}return r(e,t),e.prototype.update=function(){var t=this._C.Center.distance2(this._D.Center),e=this._C.radius2,n=this._D.radius2/(t-e);this.Center.to(this._C.Center).minus(this._D.Center).times(n).plus(this._D.Center),n=1+Math.sqrt(e/t),this.B.to(this.Center).minus(this._D.Center).times(n).plus(this._D.Center)},e.prototype.translate=function(t,e){this.Center.translate(t,e),this.B.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n),this.B.rotate(t,e,n)},e}(i.CircleElement);e.InvertCircleElement=a},8157(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereIntersectionElement=void 0;var i=n(1313),s=n(6091),a=n(103),l=function(t){function e(e,n){var o=t.call(this)||this;return o.dimension=2,o._S=e,o._T=n,o.Center=o.A=new s.PointElement,o.B=new s.PointElement,o.AP=new a.PerpendicularPlane({A:o.Center,E:n.Center}),o.Center._AP=o.AP,o}return r(e,t),e.prototype.update=function(){var t=this._T.Center.distance2(this._S.Center),e=this._T.radius2(),n=.5+(e-this._S.radius2())/(2*t);this.Center.to(this._S.Center).minus(this._T.Center).times(n).plus(this._T.Center);var o=Math.sqrt(e-this.Center.distance2(this._T.Center));this.B.to(this.Center),this.B.z+=o,this.AP.update()},e.prototype.translate=function(t,e){this.Center.translate(t,e),this.B.translate(t,e),this.AP.translate(t,e)},e.prototype.rotate=function(t,e,n){this.Center.rotate(t,e,n),this.B.rotate(t,e,n),this.AP.rotate(t,e,n)},e}(i.CircleElement);e.SphereIntersectionElement=l},5002(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Bichord=void 0;var i=n(2145),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._A=new s.PointElement,n._B=new s.PointElement,n.C=e.C,n.D=e.D,n._A._AP=n.C.AP,n._B._AP=n.C.AP),n}return r(e,t),e.prototype.translate=function(t,e){this._A.translate(t,e),this._B.translate(t,e)},e.prototype.rotate=function(t,e,n){this._A.rotate(t,e,n),this._B.rotate(t,e,n)},e.prototype.update=function(){var t=this.C.radius,e=this.D.radius,n=this.C.Center.distance(this.D.Center);if(n>t+e){var o=NaN;return this.A.x=o,this.A.y=o,this.A.z=o,this.B.x=o,this.B.y=o,void(this.B.z=o)}var r=(n*n+t*t-e*e)/(2*n*t),i=Math.sqrt(1-r*r);this.A.to(this.D.Center).toCircle(this.C),this.B.to(this.A),this.A.rotate(this.C.Center,r,i,this.C.AP),this.B.rotate(this.C.Center,r,-i,this.C.AP)},e}(i.LineElement);e.Bichord=a},1549(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Chord=void 0;var i=n(2145),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n.C=e.C,n.D=e.D,n.E=e.E,n._A=new s.PointElement({AP:n.C.AP}),n._B=new s.PointElement({AP:n.C.AP})),n}return r(e,t),e.prototype.translate=function(t,e){this._A.translate(t,e),this._B.translate(t,e)},e.prototype.rotate=function(t,e,n){this._A.rotate(t,e,n),this._B.rotate(t,e,n)},e.prototype.update=function(){this._B.to(this.C.Center).toLine(this.D,this.E,!1);var t=this.C.Center.distance2(this._B),e=this.C.radius2;if(t>e){var n=NaN;return this._A.x=n,this._A.y=n,this._A.z=n,this._B.x=n,this._B.y=n,void(this._B.z=n)}var o=Math.sqrt(e-t),r=o/this.D.distance(this._B);r<1e10?this._A.to(this.D).minus(this._B).times(r).plus(this._B):(r=o/this.E.distance(this._B),this._A.to(this.E).minus(this._B).times(r).plus(this._B)),this._B.times(2).minus(this._A)},e}(i.LineElement);e.Chord=a},1910(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineStraightEdgeExtendAnimation=e.LineStraightEdgeConnectAnimation=void 0;var i=n(7233),s=n(2145);function a(t,e){var n=t.B.x-t.A.x,o=t.B.y-t.A.y,r=Math.sqrt(n*n+o*o);return{durationMs:Math.max(120,r/e),tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1,t.visible=!0}}}var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.LINE_STRAIGHT_EDGE_CONNECT,e.name="Line.straightEdgeConnect",e.elementType=s.LineElement,e.defaultRate=.25,e}return r(e,t),e.prototype.build=function(t,e,n){return[a(t,this.defaultRate)]},e}(i.Animation);e.LineStraightEdgeConnectAnimation=l;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.LINE_STRAIGHT_EDGE_EXTEND,e.name="Line.straightEdgeExtend",e.elementType=s.LineElement,e.defaultRate=.25,e}return r(e,t),e.prototype.build=function(t,e,n){return[a(t,this.defaultRate)]},e}(i.Animation);e.LineStraightEdgeExtendAnimation=u,(0,i.registerAnimation)(new l),(0,i.registerAnimation)(new u)},7339(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.lineConstructions=e.MeanProportionalLineConstruction=e.ProportionLineConstruction=e.SimilarLineConstruction=e.LineParallelConstruction=e.LineExtendConstruction=e.LineCutoffConstruction=e.LinePerpendicular5Construction=e.LinePerpendicular4Construction=e.LinePerpendicular3Construction=e.LinePerpendicular2Construction=e.LinePerpendicular1Construction=e.BichordConstruction=e.ChordConstruction=e.PlaneFootLineConstruction=e.LineFootConstruction=e.AngleDividerLineConstruction=e.AngleBisectorLineConstruction=e.LineConnectConstruction=void 0;var i=n(7658),s=n(4461),a=n(1313),l=n(6055),u=n(2090),c=n(6921),h=n(3703),p=n(2145),f=n(5002),_=n(1549),y=n(5014),d=n(9535),v=n(9237),g=n(3219),m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.connect,e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new p.LineElement({A:e[0],B:e[1]});return[[r],r]},e}(i.Construction);e.LineConnectConstruction=m;var P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.angleBisector,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new v.AngleDividerElement(e[0],e[1],e[2],r,2),s=new p.LineElement({A:e[1],B:i});return[[i,s],s]},e}(i.Construction);e.AngleBisectorLineConstruction=P;var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.angleDivider,e.signature={points:3,elements:0,integers:1},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new v.AngleDividerElement(e[0],e[1],e[2],r,o[0]),s=new p.LineElement({A:e[1],B:i});return[[i,s],s]},e}(i.Construction);e.AngleDividerLineConstruction=C;var w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.foot,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new c.Foot(e[0],e[1],e[2]),i=new p.LineElement({A:e[0],B:r});return[[r,i],i]},e}(i.Construction);e.LineFootConstruction=w;var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.foot,e.signature={points:1,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new h.PlaneFootElement(e[0],n[0]),i=new p.LineElement({A:e[0],B:r});return[[r,i],i]},e}(i.Construction);e.PlaneFootLineConstruction=x;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.chord,e.signature={points:2,elements:1,integers:0,elementTypes:[a.CircleElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new _.Chord({D:e[0],E:e[1],C:n[0]});return[[r],r]},e}(i.Construction);e.ChordConstruction=E;var b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.bichord,e.signature={points:0,elements:2,integers:0,elementTypes:[a.CircleElement,a.CircleElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new f.Bichord({C:n[0],D:n[1]});return[[r],r]},e}(i.Construction);function A(t){return[t[0],t[0][0]]}e.BichordConstruction=b;var S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return r(e,t),e.prototype.construct=function(e,n,o,r){return A(t.prototype.construct.call(this,e,n,o,r))},e}(s.PointPerpendicular1Construction);e.LinePerpendicular1Construction=S;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return r(e,t),e.prototype.construct=function(e,n,o,r){return A(t.prototype.construct.call(this,e,n,o,r))},e}(s.PointPerpendicular2Construction);e.LinePerpendicular2Construction=O;var M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return r(e,t),e.prototype.construct=function(e,n,o,r){return A(t.prototype.construct.call(this,e,n,o,r))},e}(s.PointPerpendicular3Construction);e.LinePerpendicular3Construction=M;var T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return r(e,t),e.prototype.construct=function(e,n,o,r){return A(t.prototype.construct.call(this,e,n,o,r))},e}(s.PointPerpendicular4Construction);e.LinePerpendicular4Construction=T;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.perpendicular,e}return r(e,t),e.prototype.construct=function(e,n,o,r){return A(t.prototype.construct.call(this,e,n,o,r))},e}(s.PointPerpendicular5Construction);e.LinePerpendicular5Construction=j;var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.cutoff,e.signature={points:4,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new u.Layoff(e[0],e[0],e[1],e[2],e[3]),i=new p.LineElement({A:e[0],B:r});return[[r,i],i]},e}(i.Construction);e.LineCutoffConstruction=B;var L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.extend,e.signature={points:4,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new u.Layoff(e[1],e[0],e[1],e[2],e[3]),i=new p.LineElement({A:e[1],B:r});return[[r,i],i]},e}(i.Construction);e.LineExtendConstruction=L;var z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.parallel,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new u.Layoff(e[0],e[1],e[2],e[1],e[2]),i=new p.LineElement({A:e[0],B:r});return[[r,i],i]},e}(i.Construction);e.LineParallelConstruction=z;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=n.length>1?n[1]:t,s=new y.SimilarElement(e[0],e[1],r,e[2],e[3],e[4],i),a=new p.LineElement({A:e[0],B:s});return[[s,a],a]},e}(i.Construction);e.SimilarLineConstruction=I;var k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.proportion,e.signature={points:8,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new d.ProportionElement(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),i=new p.LineElement({A:e[6],B:r});return[[r,i],i]},e}(i.Construction);e.ProportionLineConstruction=k;var N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.LineConstructions.meanProportional,e.signature={points:6,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new g.MeanProportionalElement(e[0],e[1],e[2],e[3],e[4],e[5]),i=new p.LineElement({A:e[4],B:r});return[[r,i],i]},e}(i.Construction);e.MeanProportionalLineConstruction=N,e.lineConstructions=[new m,new L,new S,new O,new M,new T,new j,new b,new E,new z,new B,new x,new w,new I,new k,new P,new C,new N]},2145(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineElement=void 0;var i=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,n._A=e&&e.A||null,n._B=e&&e.B||null,n}return r(e,t),Object.defineProperty(e.prototype,"A",{get:function(){return this._A},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"B",{get:function(){return this._B},enumerable:!1,configurable:!0}),e.prototype.drawEdge=function(t,e){if(this.visible&&(null==e&&(e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=e)){var n=t.getContext("2d");n.strokeStyle=e;var o=this.shouldHighlight?3:1;n.lineWidth=o+this.emphasisAmount*(6-o);var r=this.drawProgress,i=this._A.x+(this._B.x-this._A.x)*r,s=this._A.y+(this._B.y-this._A.y)*r;n.beginPath(),n.moveTo(this._A.x,this._A.y),n.lineTo(i,s),n.stroke()}},e.prototype.drawFace=function(t){},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name&&null!=this._A&&this._A.defined()&&null!=this._B&&this._B.defined()){var e=Math.round((this._A.x+this._B.x)/2),n=Math.round((this._A.y+this._B.y)/2);this.drawString(e,n,t)}},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(n(8020).GeomElement);e.LineElement=i},6279(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Perpendicular=void 0;var i=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._P=e.P,n._A=new i.PointElement({AP:e.P}),n._B=new i.PointElement({AP:e.P}),n._C=e.C,n._D=e.D,n._E=e.E,n._F=e.F),n}return r(e,t),e.prototype.rotate=function(t,e,n){this.A.rotate(t,e,n),this.B.rotate(t,e,n)},e.prototype.translate=function(t,e){this.A.translate(t,e),this.B.translate(t,e)},e.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.to(this._D).minus(this._A);var t=i.PointElement.dot(this.B,this._P.S),e=i.PointElement.dot(this.B,this._P.T),n=Math.sqrt(this._E.distance2(this._F)/(t*t+e*e));t=-t/n,e/=n,this._B.x=e*this._P.S.x+t*this._P.T.x+this._A.x,this._B.y=e*this._P.S.y+t*this._P.T.y+this._A.y,this._B.z=e*this._P.S.z+t*this._P.T.z+this._A.z},e}(n(2145).LineElement);e.Perpendicular=s},3375(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlanePerpendicularLine=void 0;var i=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.dimension=1,null==e||(n._A=new i.PointElement({AP:e.P}),n._B=new i.PointElement,n._C=e.C,n._D=e.D,n._E=e.E,n._P=e.P),n}return r(e,t),e.prototype.rotate=function(t,e,n){this.A.rotate(t,e,n),this.B.rotate(t,e,n)},e.prototype.translate=function(t,e){this.A.translate(t,e),this.B.translate(t,e)},e.prototype.update=function(){this._A.to(this._C).toPlane(this._P),this._B.toCross(this._P.S,this._P.T),this._B.times(this._D.distance(this._E)).plus(this._A)},e}(n(2145).LineElement);e.PlanePerpendicularLine=s},9362(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ParallelPlane=void 0;var i=n(6055),s=n(6091),a=function(t){function e(e,n){var o=t.call(this)||this;return o.dimension=2,o._P=e,o.A=n,o.B=new s.PointElement,o.C=new s.PointElement,o.S=e.S,o.T=e.T,o.U=e.U,o}return r(e,t),e.prototype.translate=function(t,e){this.B.translate(t,e),this.C.translate(t,e)},e.prototype.rotate=function(t,e,n){this.B.rotate(t,e,n),this.C.rotate(t,e,n)},e.prototype.update=function(){this.B.to(this._P.B).minus(this._P.A).plus(this.A),this.C.to(this._P.C).minus(this._P.A).plus(this.A)},e}(i.PlaneElement);e.ParallelPlane=a},103(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PerpendicularPlane=void 0;var i=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n.A=e.A,n.E=e.E,n.B=new i.PointElement({AP:n}),n.C=new i.PointElement({AP:n}),n.S=new i.PointElement,n.T=new i.PointElement,n}return r(e,t),e.prototype.translate=function(t,e){this.B.translate(t,e),this.C.translate(t,e)},e.prototype.rotate=function(e,n,o){this.B.rotate(e,n,o),this.C.rotate(e,n,o),t.prototype.update.call(this)},e.prototype.update=function(){this.U=i.PointElement.difference(this.E,this.A);var t=this.U.length();this.U.times(1/t);var e=Math.sqrt(this.U.x*this.U.x+this.U.y*this.U.y);e>=1e-6?(this.S.x=-this.U.y/e,this.S.y=this.U.x/e,this.T.toCross(this.U,this.S)):(this.S.x=1,this.S.y=0,this.S.z=0,this.T.x=0,this.T.y=1,this.T.z=0),this.B.to(this.S).times(t).plus(this.A),this.C.to(this.T).times(t).plus(this.A)},e}(n(6055).PlaneElement);e.PerpendicularPlane=s},5193(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.planeConstructions=e.AmbientPlaneCircleConstruction=e.AmbientPlanePointConstruction=e.PlaneParallelConstruction=e.PerpendicularPlaneConstruction=e.Plane3PointsConstruction=void 0;var i=n(7658),s=n(1313),a=n(6055),l=n(103),u=n(9362),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.threePoints,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new a.PlaneElement({A:e[0],B:e[1],C:e[2]});return[[r],r]},e}(i.Construction);e.Plane3PointsConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.perpendicular,e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new l.PerpendicularPlane({A:e[0],E:e[1]});return[[r],r]},e}(i.Construction);e.PerpendicularPlaneConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.parallel,e.signature={points:1,elements:1,integers:0,elementTypes:[a.PlaneElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new u.ParallelPlane(n[0],e[0]);return[[r],r]},e}(i.Construction);e.PlaneParallelConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.ambient,e.signature={points:1,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){return[[e[0]._AP],e[0]._AP]},e}(i.Construction);e.AmbientPlanePointConstruction=f;var _=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PlaneConstructions.ambient,e.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=n[0];return[[r.AP],r.AP]},e}(i.Construction);e.AmbientPlaneCircleConstruction=_,e.planeConstructions=[new c,new h,new p,new f,new _]},6055(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneElement=void 0;var i=n(8020),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=2,n.isScreen=!1,null!=e&&(n.A=e.A,n.B=e.B,n.C=e.C,n.S=new s.PointElement,n.T=new s.PointElement,n.U=new s.PointElement),n}return r(e,t),e.prototype.defined=function(){return null!=this.A&&null!=this.B&&null!=this.C},e.prototype.drawEdge=function(t){if(this.visible&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.save(),e.strokeStyle=this.edgeColor;var n=this.B.x+this.C.x-this.A.x,o=this.B.y+this.C.y-this.A.y;e.beginPath(),e.moveTo(this.A.x,this.A.y),e.lineTo(this.B.x,this.B.y),e.lineTo(n,o),e.lineTo(this.C.x,this.C.y),e.closePath(),e.stroke(),e.restore()}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.save(),e.fillStyle=this.faceColor;var n=this.B.x+this.C.x-this.A.x,o=this.B.y+this.C.y-this.A.y;e.beginPath(),e.moveTo(this.A.x,this.A.y),e.lineTo(this.B.x,this.B.y),e.lineTo(n,o),e.lineTo(this.C.x,this.C.y),e.closePath(),e.fill(),e.restore()}},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()){var e=Math.round((this.B.x+this.C.x)/2),n=Math.round((this.B.y+this.C.y)/2);this.drawString(e,n,t)}},e.prototype.drawVertex=function(t){if(this.visible&&null!=this.vertexColor&&this.defined()){var e=t.getContext("2d"),n=this.B.x+this.C.x-this.A.x,o=this.B.y+this.C.y-this.A.y;e.beginPath(),e.fillStyle=this.vertexColor,e.arc(n,o,2,0,2*Math.PI,!1),e.fill()}},e.prototype.rotate=function(t,e,n){this.update()},e.prototype.translate=function(t,e){},e.prototype.update=function(){!this.isScreen||0==this.A.z&&0==this.B.z&&0==this.C.z||(this.isScreen=!1),this.S.to(this.B).minus(this.A),this.T.to(this.C).minus(this.A),this.S.times(1/this.S.length());var t=s.PointElement.dot(this.T,this.S);this.T.x-=t*this.S.x,this.T.y-=t*this.S.y,this.T.z-=t*this.S.z,this.T.times(1/this.T.length()),this.U.toCross(this.S,this.T)},e}(i.GeomElement);e.PlaneElement=a},9237(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.AngleDividerElement=void 0;var i=function(t){function e(e,n,o,r,i){var s=t.call(this)||this;return s.dimension=0,s._A=n,s._B=e,s._C=o,s._AP=r,s._n=i,s}return r(e,t),e.prototype.update=function(){var t=this._A.angle(this._B,this._C,this._AP)/this._n,e=Math.cos(t),n=Math.sin(t);this._AP.isScreen?(this._x=this._A.x+e*(this._B.x-this._A.x)-n*(this._B.y-this._A.y),this._y=this._A.y+n*(this._B.x-this._A.x)+e*(this._B.y-this._A.y),this._z=0):this.to(this._B).rotate(this._A,e,n,this._AP),this.toIntersection(this,this._A,this._B,this._C,this._AP)},e}(n(6091).PointElement);e.AngleDividerElement=i},788(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CircleSlider=void 0;var i=n(6091),s=function(t){function e(e,n,o,r){var s=t.call(this)||this;return s._newP=new i.PointElement,s.dimension=0,s.draggable=!0,s._C=e,s._x=n,s._initx=n,s._y=o,s._inity=o,s._z=r,s._initz=r,s}return r(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toCircle(this._C)},e.prototype.update=function(){this.toCircle(this._C)},e.prototype.drag=function(t,e){return this._x=t,this._y=e,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._C.AP),this._newP.defined()||this._newP.to(this).toPlane(this._C.AP),this._newP.toSphere(this._C.Center,this._C.radius),!((this._newP.x-this.x)*(this._newP.x-this.x)+(this._newP.y-this.y)*(this._newP.y-this.y)<.5||(this.to(this._newP),0))},e}(i.PointElement);e.CircleSlider=s},6401(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.FixedPoint=void 0;var i=function(t){function e(e){var n=t.call(this,e)||this;return n._initx=n._x,n._inity=n._y,n._initz=n._z,n}return r(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz},e}(n(6091).PointElement);e.FixedPoint=i},6921(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Foot=void 0;var i=function(t){function e(e,n,o){var r=t.call(this)||this;return r.dimension=0,r._A=e,r._B=n,r._C=o,r._B.AP==r._C.AP&&(r._AP=r._B.AP),r}return r(e,t),e.prototype.update=function(){this.to(this._A).toLine(this._B,this._C,!1)},e}(n(6091).PointElement);e.Foot=i},7876(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.HarmonicElement=void 0;var i=n(6091),s=function(t){function e(e,n,o){var r=t.call(this)||this;return r.dimension=0,r._B=e,r._C=n,r._D=o,r._E=new i.PointElement,r._F=new i.PointElement,r._M=new i.PointElement,r}return r(e,t),e.prototype.update=function(){if(0===this._B.z&&0===this._C.z&&0===this._D.z){var t=this._B.x-this._C.x,e=this._B.y-this._C.y,n=this._B.x-this._D.x,o=this._B.y-this._D.y,r=this._C.x*n-this._C.y*o,s=this._C.x*o+this._C.y*n,a=this._D.x*t-this._D.y*e,l=this._D.x*e+this._D.y*t,u=(n+t)*(n+t)+(o+e)*(o+e),c=(r+a)*(n+t)+(s+l)*(o+e),h=-(r+a)*(o+e)+(s+l)*(n+t);this._x=c/u,this._y=h/u}else{this._M.to(this._C).plus(this._D).times(.5),this._F.to(this._C).minus(this._M),this._E.to(this._B).minus(this._M);var p=1/this._E.length2(),f=this._F.length2();this.to(this._F).times(2*i.PointElement.dot(this._E,this._F)).minus(this._E.times(f)).times(p).plus(this._M)}},e}(i.PointElement);e.HarmonicElement=s},7832(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Intersection=void 0;var i=function(t){function e(e,n,o,r,i){var s=t.call(this,{AP:i})||this;return s.dimension=0,s.A=e,s.B=n,s.C=o,s.D=r,s}return r(e,t),e.prototype.update=function(){this.toIntersection(this.A,this.B,this.C,this.D,this.AP)},e}(n(6091).PointElement);e.Intersection=i},6015(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.InvertPointElement=void 0;var i=function(t){function e(e,n){var o=t.call(this)||this;return o.dimension=0,o._A=e,o._C=n,o._AP=n.AP,o}return r(e,t),e.prototype.update=function(){this.toInvertPoint(this._A,this._C)},e}(n(6091).PointElement);e.InvertPointElement=i},2090(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Layoff=void 0;var i=function(t){function e(e,n,o,r,i){var s=t.call(this)||this;return s.dimension=0,s._A=e,s._C=n,s._D=o,s._E=r,s._F=i,e.AP==n.AP&&e.AP==o.AP&&(s._AP=e.AP),s}return r(e,t),e.prototype.update=function(){var t=this._E.distance(this._F)/this._C.distance(this._D);this.to(this._D).minus(this._C),this.times(t).plus(this._A)},e}(n(6091).PointElement);e.Layoff=i},4610(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LineSlider=void 0;var i=function(t){function e(e,n,o,r,i,s){var a=t.call(this)||this;return a.dimension=0,a.draggable=!0,a._A=e,a._B=n,a._x=o,a._initx=o,a._y=r,a._inity=r,a._z=i,a._initz=i,a._segment=s,a._A.AP==a._B.AP&&(a._AP=a._A.AP),a}return r(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toLine(this._A,this._B,this._segment)},e.prototype.update=function(){this.toLine(this._A,this._B,this._segment)},e.prototype.drag=function(t,e){t-=this._A.x,e-=this._A.y;var n=this._B.x-this._A.x,o=this._B.y-this._A.y,r=(t*n+e*o)/(n*n+o*o);return this._segment&&(r<0?r=0:r>1&&(r=1)),t=this._A.x+n*r,e=this._A.y+o*r,!((t-this._x)*(t-this._x)+(t-this._y)*(t-this._y)<.5||(this._x=t,this._y=e,this._z=this._A.z+(this._B.z-this._A.z)*r,0))},e}(n(6091).PointElement);e.LineSlider=i},3219(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.MeanProportionalElement=void 0;var i=function(t){function e(e,n,o,r,i,s){var a=t.call(this)||this;return a.dimension=0,a._S0=e,a._S1=n,a._T0=o,a._T1=r,a._U0=i,a._U1=s,i._AP===s._AP&&(a._AP=i._AP),a}return r(e,t),e.prototype.update=function(){var t=Math.sqrt(this._S0.distance2(this._S1)*this._T0.distance2(this._T1));t=Math.sqrt(t/this._U0.distance2(this._U1)),this.to(this._U1).minus(this._U0),this.times(t).plus(this._U0)},e}(n(6091).PointElement);e.MeanProportionalElement=i},489(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Midpoint=void 0;var i=function(t){function e(e,n){var o=t.call(this)||this;return o.dimension=0,o._A=e,o._B=n,o._A.AP==o._B.AP&&(o._AP=o._A.AP),o}return r(e,t),e.prototype.update=function(){this._x=(this._A.x+this._B.x)/2,this._y=(this._A.y+this._B.y)/2,this._z=(this._A.z+this._B.z)/2},e}(n(6091).PointElement);e.Midpoint=i},3703(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneFootElement=void 0;var i=function(t){function e(e,n){var o=t.call(this)||this;return o.dimension=0,o._A=e,o._AP=n,o}return r(e,t),e.prototype.update=function(){this.to(this._A).toPlane(this._AP)},e}(n(6091).PointElement);e.PlaneFootElement=i},2930(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneIntersection=void 0;var i=function(t){function e(e,n,o){var r=t.call(this)||this;return r.dimension=0,r._A=n,r._B=o,r._AP=e,r}return r(e,t),e.prototype.update=function(){this.toIntersectionPL(this._AP,this._A,this._B)},e}(n(6091).PointElement);e.PlaneIntersection=i},4994(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PlaneSlider=void 0;var i=n(6091),s=function(t){function e(e,n,o,r){var s=t.call(this)||this;return s._newP=new i.PointElement,s.dimension=0,s.draggable=!0,s._AP=e,s._x=s._initx=n,s._y=s._inity=o,s._z=s._initz=r,s}return r(e,t),e.prototype.update=function(){this.toPlane(this._AP)},e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toPlane(this._AP)},e.prototype.drag=function(t,e){return this._x=t,this._y=e,this.defined()||(this._z=this._initz),this._newP.to(this).uptoPlane(this._AP),this._newP.defined()?this.to(this._newP):this.toPlane(this._AP),!0},e}(i.PointElement);e.PlaneSlider=s},2872(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PointAppearAnimation=void 0;var i=n(7233),s=n(6091),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.POINT_APPEAR,e.name="Point.appear",e.elementType=s.PointElement,e.defaultDurationMs=350,e}return r(e,t),e.prototype.build=function(t,e,n){return[{durationMs:this.defaultDurationMs,tick:function(e){t.drawProgress=e},finalise:function(){t.drawProgress=1,t.visible=!0}}]},e}(i.Animation);e.PointAppearAnimation=a,(0,i.registerAnimation)(new a)},4461(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.pointConstructions=e.VertexConstruction=e.HarmonicPointConstruction=e.LineSliderSegmentConstruction=e.FixedPointConstruction=e.AngleDividerPointConstruction=e.AngleBisectorPointConstruction=e.SphereSliderConstruction=e.PlaneSliderConstruction=e.MeanProportionalPointConstruction=e.InvertPointConstruction=e.ProportionPointConstruction=e.PointPerpendicular5Construction=e.PointPerpendicular4Construction=e.PointPerpendicular3Construction=e.PointPerpendicular2Construction=e.PointPerpendicular1Construction=e.PointPerpendicularConstruction=e.SimilarPointConstruction=e.ParallelogramConstruction=e.ExtendConstruction=e.CutoffConstruction=e.LayoffConstruction=e.PlaneFootPointConstruction=e.FootPointConstruction=e.CircumcenterConstruction=e.CircumcircleConstruction=e.CircleSliderConstruction=e.LineSliderConstruction=e.SphereCenterConstruction=e.CircleCenterConstruction=e.LastPointConstruction=e.FirstPointConstruction=e.PlaneIntersectionConstruction=e.IntersectionConstruction=e.MidPointConstruction=e.FreePointConstruction=void 0;var i=n(7658),s=n(1313),a=n(2218),l=n(6055),u=n(6401),c=n(4994),h=n(489),p=n(7832),f=n(2930),_=n(4610),y=n(2090),d=n(6921),v=n(3703),g=n(788),m=n(5014),P=n(9535),C=n(9237),w=n(3219),x=n(7876),E=n(6015),b=n(5089),A=n(6279),S=n(3375),O=n(2295),M=n(7091),T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.free,e.signature={points:0,elements:0,integers:2},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new c.PlaneSlider(t,o[0],o[1],0);return[[r],r]},e}(i.Construction);e.FreePointConstruction=T;var j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.midpoint,e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new h.Midpoint(e[0],e[1]);return[[r],r]},e}(i.Construction);e.MidPointConstruction=j;var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.intersection,e.signature={points:4,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&4===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new p.Intersection(e[0],e[1],e[2],e[3],r);return[[i],i]},e}(i.Construction);e.IntersectionConstruction=B;var L=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.intersection,e.signature={points:2,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new f.PlaneIntersection(n[0],e[0],e[1]);return[[r],r]},e}(i.Construction);e.PlaneIntersectionConstruction=L;var z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.first,e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){return[[],e[0]]},e}(i.Construction);e.FirstPointConstruction=z;var I=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.last,e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){return[[],e[1]]},e}(i.Construction);e.LastPointConstruction=I;var k=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.center,e.signature={points:0,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){return[[],n[0].Center]},e}(i.Construction);e.CircleCenterConstruction=k;var N=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.center,e.signature={points:0,elements:1,integers:0,elementTypes:[O.SphereElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){return[[],n[0].Center]},e}(i.Construction);e.SphereCenterConstruction=N;var V=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.lineSlider,e.signature={points:2,elements:0,integers:2},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.E.length&&(2===e.N.length||3===e.N.length)},e.prototype.construct=function(t,e,n,o){var r=this.createSlider(e[0],e[1],o[0],o[1],o.length>2?o[2]:0);return[[r],r]},e.prototype.createSlider=function(t,e,n,o,r){return new _.LineSlider(t,e,n,o,r,!1)},e}(i.Construction);e.LineSliderConstruction=V;var R=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.circleSlider,e.signature={points:0,elements:1,integers:2,elementTypes:[s.CircleElement]},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&0===e.P.length&&1===e.E.length&&(2===e.N.length||3===e.N.length)&&e.E[0]instanceof s.CircleElement},e.prototype.construct=function(t,e,n,o){var r=new g.CircleSlider(n[0],o[0],o[1],o.length>2?o[2]:0);return[[r],r]},e}(i.Construction);e.CircleSliderConstruction=R;var D=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.CircleConstructions.circumcircle,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new a.CircumcircleElement(e[0],e[1],e[2],r);return[[i],i]},e}(i.Construction);e.CircumcircleConstruction=D;var F=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.circumcenter,e}return r(e,t),e.prototype.construct=function(e,n,o,r){var i=t.prototype.construct.call(this,e,n,o,r),s=i[1];return i[0].push(s.Center),[i[0],s.Center]},e}(D);e.CircumcenterConstruction=F;var H=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.foot,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new d.Foot(e[0],e[1],e[2]);return[[r],r]},e}(i.Construction);e.FootPointConstruction=H;var G=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.foot,e.signature={points:1,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new v.PlaneFootElement(e[0],n[0]);return[[r],r]},e}(i.Construction);e.PlaneFootPointConstruction=G;var U=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=this._createLayoff(e);return[[r],r]},e}(i.Construction);e.LayoffConstruction=U;var q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.cutoff,e}return r(e,t),e.prototype._createLayoff=function(t){return new y.Layoff(t[0],t[0],t[1],t[2],t[3])},e}(U);e.CutoffConstruction=q;var W=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.extend,e}return r(e,t),e.prototype._createLayoff=function(t){return new y.Layoff(t[1],t[0],t[1],t[2],t[3])},e}(U);e.ExtendConstruction=W;var J=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.parallelogram,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new y.Layoff(e[0],e[1],e[2],e[1],e[2]);return[[r],r]},e}(i.Construction);e.ParallelogramConstruction=J;var Y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=n.length>1?n[1]:t,s=new m.SimilarElement(e[0],e[1],r,e[2],e[3],e[4],i);return[[s],s]},e}(i.Construction);e.SimilarPointConstruction=Y;var K=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.perpendicular,e}return r(e,t),e}(i.Construction);e.PointPerpendicularConstruction=K;var X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new A.Perpendicular({C:e[0],D:e[1],P:t,E:e[0],F:e[1]});return[[r],r.B]},e}(K);e.PointPerpendicular1Construction=X;var Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:2,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new A.Perpendicular({C:e[0],D:e[1],P:n[0],E:e[0],F:e[1]});return[[r],r.B]},e}(K);e.PointPerpendicular2Construction=Q;var Z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new A.Perpendicular({C:e[0],D:e[1],P:t,E:e[2],F:e[3]});return[[r],r.B]},e}(K);e.PointPerpendicular3Construction=Z;var $=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:4,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new A.Perpendicular({C:e[0],D:e[1],P:n[0],E:e[2],F:e[3]});return[[r],r.B]},e}(K);e.PointPerpendicular4Construction=$;var tt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.signature={points:3,elements:1,integers:0,elementTypes:[l.PlaneElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new S.PlanePerpendicularLine({C:e[0],P:n[0],D:e[1],E:e[2]});return[[r],r.B]},e}(K);e.PointPerpendicular5Construction=tt;var et=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.proportion,e.signature={points:8,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new P.ProportionElement(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]);return[[r],r]},e}(i.Construction);e.ProportionPointConstruction=et;var nt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.invert,e.signature={points:1,elements:1,integers:0,elementTypes:[s.CircleElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new E.InvertPointElement(e[0],n[0]);return[[r],r]},e}(i.Construction);e.InvertPointConstruction=nt;var ot=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.meanProportional,e.signature={points:6,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new w.MeanProportionalElement(e[0],e[1],e[2],e[3],e[4],e[5]);return[[r],r]},e}(i.Construction);e.MeanProportionalPointConstruction=ot;var rt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.planeSlider,e.signature={points:0,elements:1,integers:3,elementTypes:[l.PlaneElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new c.PlaneSlider(n[0],o[0],o[1],o[2]);return[[r],r]},e}(i.Construction);e.PlaneSliderConstruction=rt;var it=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.sphereSlider,e.signature={points:0,elements:1,integers:3,elementTypes:[O.SphereElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new b.SphereSliderElement(n[0],o[0],o[1],o[2]);return[[r],r]},e}(i.Construction);e.SphereSliderConstruction=it;var st=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.angleBisector,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new C.AngleDividerElement(e[0],e[1],e[2],r,2);return[[i],i]},e}(i.Construction);e.AngleBisectorPointConstruction=st;var at=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.angleDivider,e.signature={points:3,elements:0,integers:1},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof l.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new C.AngleDividerElement(e[0],e[1],e[2],r,o[0]);return[[i],i]},e}(i.Construction);e.AngleDividerPointConstruction=at;var lt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.fixed,e.signature={points:0,elements:0,integers:2},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&0===e.P.length&&0===e.E.length&&(2===e.N.length||3===e.N.length)},e.prototype.construct=function(t,e,n,o){var r=new u.FixedPoint({x:o[0],y:o[1],z:o.length>2?o[2]:0});return[[r],r]},e}(i.Construction);e.FixedPointConstruction=lt;var ut=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.lineSegmentSlider,e}return r(e,t),e.prototype.createSlider=function(t,e,n,o,r){return new _.LineSlider(t,e,n,o,r,!0)},e}(V);e.LineSliderSegmentConstruction=ut;var ct=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.harmonic,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new x.HarmonicElement(e[0],e[1],e[2]);return[[r],r]},e}(i.Construction);e.HarmonicPointConstruction=ct;var ht=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PointConstructions.vertex,e.signature={points:0,elements:1,integers:1,elementTypes:[M.PolygonElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=n[0].V[o[0]-1];return[[r],r]},e}(i.Construction);e.VertexConstruction=ht,e.pointConstructions=[new T,new lt,new z,new I,new k,new F,new j,new B,new H,new G,new W,new q,new J,new Y,new et,new st,new at,new ot,new rt,new it,new ct,new nt,new L,new N,new D,new V,new ut,new R,new X,new Q,new Z,new $,new tt,new ht]},6091(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PointElement=void 0;var i=function(t){function e(e){var n=t.call(this)||this;return n.dimension=0,n._x=e&&e.x||0,n._y=e&&e.y||0,n._z=e&&e.z||0,n._AP=e&&e.AP||null,n}return r(e,t),Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(t){this._z=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"AP",{get:function(){return this._AP},set:function(t){this._AP=t},enumerable:!1,configurable:!0}),e.prototype.defined=function(){return!isNaN(this._x)&&!isNaN(this._y)&&!isNaN(this._z)&&null!=this._x&&null!=this._y&&null!=this._z},e.prototype.to=function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this},e.prototype.plus=function(t){return this._x+=t._x,this._y+=t._y,this._z+=t._z,this},e.prototype.minus=function(t){return this._x-=t._x,this._y-=t._y,this._z-=t._z,this},e.prototype.times=function(t){return this._x*=t,this._y*=t,this._z*=t,this},e.difference=function(t,n){return new e({x:t.x-n.x,y:t.y-n.y,z:t.z-n.z,AP:null})},e.product=function(t,n){return new e({x:t*n.x,y:t*n.y,z:t*n.z,AP:null})},e.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},e.prototype.length2=function(){return this._x*this._x+this._y*this._y+this._z*this._z},e.prototype.length=function(){return Math.sqrt(this.length2())},e.prototype.distance2=function(t){return(this._x-t.x)*(this._x-t.x)+(this._y-t.y)*(this._y-t.y)+(this._z-t.z)*(this._z-t.z)},e.prototype.distance=function(t){return Math.sqrt(this.distance2(t))},e.prototype.toCross=function(t,e){return this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this},e.cross=function(t,n){return new e({x:t.y*n.z-t.z*n.y,y:t.z*n.x-t.x*n.z,z:t.x*n.y-t.y*n.x,AP:null})},e.triple=function(t,e,n){return t.x*(e.y*n.z-e.z*n.y)+e.x*(n.y*t.z-n.z*t.y)+n.x*(t.y*e.z-t.z*e.y)},e.prototype.toLine=function(t,n,o){var r=e.difference(n,t);this.minus(t);var i=e.dot(r,this)/r.length2();return o&&(i<0?i=0:i>1&&(i=1)),r.times(i),this.to(r).plus(t)},e.prototype.toPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var n=e.dot(this,t.S),o=e.dot(this,t.T);this.to(t.S).times(n).plus(e.product(o,t.T)).plus(t.A)}return this},e.prototype.uptoPlane=function(t){if(t.isScreen)this._z=0;else{this.minus(t.A);var n=t.S.x*t.T.y-t.S.y*t.T.x,o=(this.x*t.T.y-this.y*t.T.x)/n,r=(this.y*t.S.x-this.x*t.S.y)/n;this.to(t.S).times(o).plus(e.product(r,t.T)).plus(t.A)}return this},e.prototype.toCircumcenter=function(t,n,o){if(0==t.z&&0==n.z&&0==o.z){var r=((t.x-n.x)*(t.x+n.x)+(t.y-n.y)*(t.y+n.y))/2,i=((n.x-o.x)*(n.x+o.x)+(n.y-o.y)*(n.y+o.y))/2,s=(t.x-n.x)*(n.y-o.y)-(n.x-o.x)*(t.y-n.y);this._x=(r*(n.y-o.y)-i*(t.y-n.y))/s,this._y=(i*(t.x-n.x)-r*(n.x-o.x))/s,this._z=0}else{var a=e.difference(n,t),l=e.difference(o,t),u=e.dot(a,l),c=a.length2(),h=l.length2(),p=h*(c-u)/(s=2*(c*h-u*u)),f=c*(h-u)/s;this.to(t).plus(a.times(p)).plus(l.times(f))}return this},e.prototype.toCircle=function(t){if(t.AP.isScreen){var e=t.radius/this.distance(t.Center);this._x=t.Center.x+e*(this._x-t.Center.x),this._y=t.Center.y+e*(this._y-t.Center.y),this._z=0}else this.toPlane(t.AP),this.toSphere(t.Center,t.radius);return this},e.prototype.toSphere=function(t,e){var n=e/this.distance(t);return this._x=t.x+n*(this._x-t.x),this._y=t.y+n*(this._y-t.y),this._z=t.z+n*(this._z-t.z),this},e.area=function(t,n,o){var r=e.difference(n,t),i=e.difference(o,t);return this.cross(r,i).length()/2},e.prototype.angle=function(t,e,n){var o=t.x-this._x,r=e.x-this._x,i=t.y-this._y,s=e.y-this._y;if(n.isScreen)return Math.atan2(o*s-i*r,o*r+i*s);var a=t.z-this._z,l=e.z-this._z,u=o*n.S.x+i*n.S.y+a*n.S.z,c=o*n.T.x+i*n.T.y+a*n.T.z,h=r*n.S.x+s*n.S.y+l*n.S.z,p=r*n.T.x+s*n.T.y+l*n.T.z;return Math.atan2(u*p-c*h,u*h+c*p)},e.prototype.toIntersection=function(t,n,o,r,i){if(i.isScreen){var s=t.x*n.y-t.y*n.x,a=o.x*r.y-o.y*r.x,l=(n.y-t.y)*(o.x-r.x)-(t.x-n.x)*(r.y-o.y);this._x=(s*(o.x-r.x)-a*(t.x-n.x))/l,this._y=(a*(n.y-t.y)-s*(r.y-o.y))/l}else{var u=e.difference(t,i.A),c=e.difference(n,i.A),h=e.difference(o,i.A),p=e.difference(r,i.A),f=e.dot(u,i.S),_=e.dot(u,i.T),y=e.dot(c,i.S),d=e.dot(c,i.T),v=e.dot(h,i.S),g=e.dot(h,i.T),m=e.dot(p,i.S),P=e.dot(p,i.T),C=((s=f*d-_*y)*(v-m)-(a=v*P-g*m)*(f-y))/(l=(d-_)*(v-m)-(f-y)*(P-g)),w=(a*(d-_)-s*(P-g))/l;this.to(i.S).times(C).plus(e.product(w,i.T)).plus(i.A)}return this},e.prototype.toIntersectionPL=function(t,n,o){this.to(o).minus(n);var r=e.difference(n,t.A),i=-e.triple(t.S,t.T,r)/e.triple(t.S,t.T,this);return this.times(i).plus(n)},e.prototype.toInvertPoint=function(t,e){var n=e.radius2/t.distance2(e.Center);return this.to(t).minus(e.Center).times(n).plus(e.Center)},e.prototype.toSimilar=function(t,n,o,r,i,s,a){var l=r.angle(i,s,a),u=Math.cos(l),c=Math.sin(l),h=r.distance(s)/r.distance(i);if(o.isScreen)this._x=n.x,this._y=n.y,this.rotate(t,u,c,o),this._x=t.x+h*(this._x-t.x),this._y=t.y+h*(this._y-t.y),this._z=0;else{var p=e.difference(n,t),f=e.dot(p,o.S),_=e.dot(p,o.T),y=h*(u*f-c*_),d=h*(c*f+u*_);this._x=y*o.S.x+d*o.T.x+t.x,this._y=y*o.S.y+d*o.T.y+t.y,this._z=y*o.S.z+d*o.T.z+t.z}return this},e.prototype.rotate=function(t,n,o,r){if(null==r&&(r=t._AP),this!=t)if(r.isScreen){var i=this.x-t.x,s=this.y-t.y;this._x=t.x+n*i-o*s,this._y=t.y+o*i+n*s}else{this.minus(t);var a=r.S,l=r.T,u=r.U,c=e.dot(this,a),h=e.dot(this,l),p=e.dot(this,u),f=n*c-o*h,_=o*c+n*h;this._x=t.x+f*a.x+_*l.x+p*u.x,this._y=t.y+f*a.y+_*l.y+p*u.y,this._z=t.z+f*a.z+_*l.z+p*u.z}},e.prototype.drawName=function(t){this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this.x),Math.round(this.y),t)},e.prototype.drawVertex=function(t,e){if(this.visible){var n=t.getContext("2d");if(null==e&&(e=this.emphasized||this.shouldHighlight?this.vertexHighlightColor:this.vertexColor),null!=e){var o=this.shouldHighlight?4:2,r=o+this.emphasisAmount*(6-o);(r*=this.drawProgress)<.5||(n.beginPath(),n.fillStyle=e,n.arc(this._x,this._y,r,0,2*Math.PI,!1),n.fill())}}},e.prototype.translate=function(t,e){this._x+=t,this._y+=e},e.prototype.update=function(){},e.prototype.drawEdge=function(t){},e.prototype.drawFace=function(t){},e}(n(8020).GeomElement);e.PointElement=i},9535(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ProportionElement=void 0;var i=function(t){function e(e,n,o,r,i,s,a,l){var u=t.call(this)||this;return u.dimension=0,u._S0=e,u._S1=n,u._T0=o,u._T1=r,u._U0=i,u._U1=s,u._V0=a,u._V1=l,a._AP===l._AP&&(u._AP=a._AP),u}return r(e,t),e.prototype.update=function(){var t=this._T0.distance2(this._T1)*this._U0.distance2(this._U1)/(this._S0.distance2(this._S1)*this._V0.distance2(this._V1));t=Math.sqrt(t),this.to(this._V1).minus(this._V0),this.times(t).plus(this._V0)},e}(n(6091).PointElement);e.ProportionElement=i},5014(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SimilarElement=void 0;var i=function(t){function e(e,n,o,r,i,s,a){var l=t.call(this)||this;return l.dimension=0,l._parentA=e,l._parentB=n,l._AP=o,l._D=r,l._E=i,l._F=s,l._Q=a,l}return r(e,t),e.prototype.update=function(){this.toSimilar(this._parentA,this._parentB,this._AP,this._D,this._E,this._F,this._Q)},e}(n(6091).PointElement);e.SimilarElement=i},5089(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereSliderElement=void 0;var i=function(t){function e(e,n,o,r){var i=t.call(this)||this;return i.dimension=0,i.draggable=!0,i._S=e,i._x=i._initx=n,i._y=i._inity=o,i._z=i._initz=r,i}return r(e,t),e.prototype.reset=function(){this._x=this._initx,this._y=this._inity,this._z=this._initz,this.toSphere(this._S.Center,this._S.radius())},e.prototype.update=function(){this.toSphere(this._S.Center,this._S.radius())},e.prototype.drag=function(t,e){var n=(this._S.Center.x-t)*(this._S.Center.x-t)+(this._S.Center.y-e)*(this._S.Center.y-e),o=this._S.radius2();if(n<=o)this._x=t,this._y=e,this._z>this._S.Center.z?this._z=this._S.Center.z+Math.sqrt(o-n):this._z=this._S.Center.z-Math.sqrt(o-n);else{t-=this._S.Center.x,e-=this._S.Center.y;var r=Math.sqrt((t*t+e*e)/o);if(t=t/r+this._S.Center.x,e=e/r+this._S.Center.y,(t-this._x)*(t-this._x)+(e-this._y)*(e-this._y)<.5)return!1;this._x=t,this._y=e,this._z=this._S.Center.z}return!0},e}(n(6091).PointElement);e.SphereSliderElement=i},2563(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ApplicationElement=void 0;var i=n(7091),s=n(6091),a=function(t){function e(e,n,o,r){var i=t.call(this)||this;return i.dimension=2,i._P=e,i._C=r,i.V=new Array(4),i.V[0]=n,i.V[1]=o,i.V[2]=new s.PointElement,i.V[3]=new s.PointElement,n._AP===o._AP&&n._AP===r._AP&&(i.V[2]._AP=n._AP,i.V[3]._AP=n._AP),i}return r(e,t),e.prototype.translate=function(t,e){this.V[2].translate(t,e),this.V[3].translate(t,e)},e.prototype.rotate=function(t,e,n){this.V[2].rotate(t,e,n),this.V[3].rotate(t,e,n)},e.prototype.update=function(){var t=this._P.area()/(2*s.PointElement.area(this.V[0],this.V[1],this._C));t=Math.abs(t),this.V[3].x=this.V[0].x+t*(this._C.x-this.V[0].x),this.V[3].y=this.V[0].y+t*(this._C.y-this.V[0].y),this.V[3].z=this.V[0].z+t*(this._C.z-this.V[0].z),this.V[2].x=this.V[1].x+this.V[3].x-this.V[0].x,this.V[2].y=this.V[1].y+this.V[3].y-this.V[0].y,this.V[2].z=this.V[1].z+this.V[3].z-this.V[0].z},e}(i.PolygonElement);e.ApplicationElement=a},3712(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonSuperposeAnimation=e.PolygonOutlineAndFillAnimation=e.PolygonOutlineAnimation=void 0;var i=n(7233),s=n(7091),a=n(6091);function l(t){var e=t.V.length;if(e<2)return 0;for(var n=0,o=e>2?e:e-1,r=0;r<o;r++){var i=t.V[r],s=t.V[(r+1)%e],a=s.x-i.x,l=s.y-i.y;n+=Math.sqrt(a*a+l*l)}return n}var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.POLYGON_OUTLINE,e.name="Polygon.outline",e.elementType=s.PolygonElement,e.defaultRate=.25,e}return r(e,t),e.prototype.build=function(t,e,n){var o=t;return[{durationMs:Math.max(180,l(o)/this.defaultRate),tick:function(t){o.drawProgress=t},finalise:function(){o.drawProgress=1,o.visible=!0}}]},e}(i.Animation);e.PolygonOutlineAnimation=u;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.POLYGON_OUTLINE_AND_FILL,e.name="Polygon.outlineAndFill",e.elementType=s.PolygonElement,e.defaultRate=.25,e.defaultDurationMs=500,e}return r(e,t),e.prototype.build=function(t,e,n){var o=t,r=Math.max(180,l(o)/this.defaultRate),i=function(){o.faceAlpha=1,o.drawProgress=1,o.visible=!0},s={durationMs:r,setup:function(){o.drawProgress=0,o.faceAlpha=0},tick:function(t){o.drawProgress=t},finalise:function(){o.drawProgress=1}};return null==o.faceColor?(s.finalise=i,[s]):[s,{durationMs:Math.min(r/2,this.defaultDurationMs),tick:function(t){o.faceAlpha=t},finalise:i}]},e}(i.Animation);e.PolygonOutlineAndFillAnimation=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.POLYGON_SUPERPOSE,e.name="Polygon.superpose",e.elementType=s.PolygonElement,e}return r(e,t),e.prototype.build=function(t,e,n){var o=this,r=t,i=n&&n.onto,l=null!=i?e.lookupElement(String(i)):null;if(!(l instanceof s.PolygonElement)||l.V.length!==r.V.length)return"undefined"!=typeof console&&console.warn&&console.warn("[geomlib] Polygon.superpose: args.onto ('"+i+"') is not a polygon with "+r.V.length+" vertices — skipping"),[{durationMs:0,tick:function(){},finalise:function(){r.drawProgress=1,r.visible=!0}}];var u=r.V.length,c=[],h=0,p=0,f=0,_=[],y=new s.PolygonElement;y.edgeColor="#FFD700",y.faceColor=null,y.nameColor=null,y.vertexColor=null;var d=function(t){for(var e=0;e<u;e++)_[e].x=t[e].x,_[e].y=t[e].y},v=function(t){return c.map((function(e){return{x:e.x+h*t,y:e.y+p*t}}))},g=function(t){var e=l.V[0].x,n=l.V[0].y,o=Math.cos(f*t),r=Math.sin(f*t);return v(1).map((function(t){return{x:e+(t.x-e)*o-(t.y-n)*r,y:n+(t.x-e)*r+(t.y-n)*o}}))},m=Math.hypot(l.V[0].x-r.V[0].x,l.V[0].y-r.V[0].y),P=Math.max(250,m/.25),C=Math.abs(this._sideAngleDelta(r,l)),w=Math.max(250,C/.003);return[{durationMs:P,setup:function(){r.drawProgress=1,r.visible=!0,c=r.V.map((function(t){return{x:t.x,y:t.y}})),h=l.V[0].x-c[0].x,p=l.V[0].y-c[0].y,f=o._sideAngleDelta(r,l);for(var t=0;t<u;t++){var n=new a.PointElement;n.x=c[t].x,n.y=c[t].y,_.push(n),y.V.push(n)}e.addEphemeral(y)},tick:function(t){d(v(t))},finalise:function(){d(v(1))}},{durationMs:w,tick:function(t){d(g(t))},finalise:function(){d(g(1))}},{durationMs:800,tick:function(){},finalise:function(){}},{durationMs:w,tick:function(t){d(g(1-t))},finalise:function(){d(v(1))}},{durationMs:P,tick:function(t){d(v(1-t))},finalise:function(){e.removeEphemeral(y),r.drawProgress=1,r.visible=!0}}]},e.prototype._sideAngleDelta=function(t,e){for(var n=Math.atan2(t.V[1].y-t.V[0].y,t.V[1].x-t.V[0].x),o=Math.atan2(e.V[1].y-e.V[0].y,e.V[1].x-e.V[0].x)-n;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;return o},e}(i.Animation);e.PolygonSuperposeAnimation=h,(0,i.registerAnimation)(new u),(0,i.registerAnimation)(new c),(0,i.registerAnimation)(new h)},4133(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.polygonConstructions=e.FacePolygonConstruction=e.OctagonPolygonConstruction=e.ApplicationPolygonConstruction=e.SimilarPolygonConstruction=e.StarPolygonConstruction=e.RegularPolygonConstruction=e.ParallelogramPolygonConstruction=e.EquilateralTriangleConstruction=e.HexagonPolygonConstruction=e.PentagonPolygonConstruction=e.QuadrilateralPolygonConstruction=e.TrianglePolygonConstruction=e.SquarePolygonConstruction=e.PolyConstruction=void 0;var i=n(7658),s=n(6055),a=n(2090),l=n(5014),u=n(7091),c=n(1943),h=n(2563),p=n(3857),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new u.PolygonElement(e);return[[r],r]},e}(i.Construction);e.PolyConstruction=f;var _=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.square,e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new c.RegularPolygonElement(e[0],e[1],r,4);return[[i],i]},e}(i.Construction);e.SquarePolygonConstruction=_;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.triangle,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e}(f);e.TrianglePolygonConstruction=y;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.quadrilateral,e.signature={points:4,elements:0,integers:0},e}return r(e,t),e}(f);e.QuadrilateralPolygonConstruction=d;var v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.pentagon,e.signature={points:5,elements:0,integers:0},e}return r(e,t),e}(f);e.PentagonPolygonConstruction=v;var g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.hexagon,e.signature={points:6,elements:0,integers:0},e}return r(e,t),e}(f);e.HexagonPolygonConstruction=g;var m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.equilateralTriangle,e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new c.RegularPolygonElement(e[0],e[1],r,3);return[[i],i]},e}(i.Construction);e.EquilateralTriangleConstruction=m;var P=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.parallelogram,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new a.Layoff(e[0],e[1],e[2],e[1],e[2]),i=new u.PolygonElement([e[0],e[1],e[2],r]);return[[r,i],i]},e}(i.Construction);e.ParallelogramPolygonConstruction=P;var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.regularPolygon,e.signature={points:2,elements:0,integers:1},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&2===e.P.length&&1===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new c.RegularPolygonElement(e[0],e[1],r,o[0]);return[[i],i]},e}(i.Construction);e.RegularPolygonConstruction=C;var w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.starPolygon,e.signature={points:2,elements:0,integers:2},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new c.RegularPolygonElement(e[0],e[1],t,o[0],o[1]);return[[r],r]},e}(i.Construction);e.StarPolygonConstruction=w;var x=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.similar,e.signature={points:5,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&5===e.P.length&&0===e.N.length&&(0===e.E.length||2===e.E.length)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=n.length>1?n[1]:t,s=new l.SimilarElement(e[0],e[1],r,e[2],e[3],e[4],i),a=new u.PolygonElement([e[0],e[1],s]);return[[s,a],a]},e}(i.Construction);e.SimilarPolygonConstruction=x;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.application,e.signature={points:3,elements:1,integers:0,elementTypes:[u.PolygonElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new h.ApplicationElement(n[0],e[0],e[1],e[2]);return[[r],r]},e}(i.Construction);e.ApplicationPolygonConstruction=E;var b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.octagon,e.signature={points:8,elements:0,integers:0},e}return r(e,t),e}(f);e.OctagonPolygonConstruction=b;var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolygonConstructions.face,e.signature={points:0,elements:1,integers:1,elementTypes:[p.PolyhedronElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=n[0].P[o[0]-1];return[[r],r]},e}(i.Construction);e.FacePolygonConstruction=A,e.polygonConstructions=[new y,new w,new C,new _,new m,new P,new d,new b,new v,new g,new x,new E,new A]},7091(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolygonElement=void 0;var i=n(6091),s=function(t){function e(e){var n=t.call(this)||this;return n._faceAlpha=1,n.dimension=2,null==e?(n.V=[],n):(n.V=e,n)}return r(e,t),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),e.prototype.area=function(){for(var t=0,e=0;e<this.V.length-2;++e)t+=i.PointElement.area(this.V[0],this.V[e+1],this.V[e+2]);return t},e.prototype.drawEdge=function(t,e){if(this.visible&&(null==e&&(e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor),null!=e&&!(this.V.length<=1))){var n=t.getContext("2d");n.beginPath(),n.strokeStyle=e;var o=this.shouldHighlight?3:1;n.lineWidth=o+this.emphasisAmount*(6-o);var r=this.V.length,i=r>2?r:r-1,s=this.drawProgress*i,a=Math.floor(s),l=s-a;n.moveTo(this.V[0].x,this.V[0].y);for(var u=0;u<a;u++){var c=this.V[(u+1)%r];n.lineTo(c.x,c.y),n.stroke()}if(l>0&&a<i){var h=this.V[a],p=(c=this.V[(a+1)%r],h.x+(c.x-h.x)*l),f=h.y+(c.y-h.y)*l;n.lineTo(p,f),n.stroke()}}},e.prototype.defined=function(){if(0==this.V.length)return!1;for(var t=0,e=this.V;t<e.length;t++)if(!e[t].defined())return!1;return!0},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()&&this.V.length>2){var e=t.getContext("2d");e.beginPath(),e.fillStyle=this.faceColor;var n=this.V[0],o=this.V.slice(1);e.moveTo(n.x,n.y);for(var r=0,i=o;r<i.length;r++){var s=i[r];e.lineTo(s.x,s.y)}e.closePath();var a=this.faceAlpha;if(a<1){if(a<=0)return;e.save(),e.globalAlpha=a,e.fill(),e.restore()}else e.fill()}},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,o=0,r=this.V;o<r.length;o++){var i=r[o];e+=i.x,n+=i.y}var s=this.V.length;e/=s,n/=s;var a=t.getContext("2d"),l=this._getTextMetrics(a,this._name),u=l[0],c=l[1];a.beginPath(),a.fillStyle=this.nameColor,a.fillText(this._name,e-u/2,n+c/4)}},e.prototype.drawVertex=function(t){if(this.visible&&null!=this.vertexColor&&this.defined())for(var e=0,n=this.V;e<n.length;e++)n[e].drawVertex(t,this.vertexColor)},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){},e}(n(8020).GeomElement);e.PolygonElement=s},1943(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RegularPolygonElement=void 0;var i=n(7091),s=n(6091),a=function(t){function e(e,n,o,r,i){void 0===i&&(i=1);var a=t.call(this)||this;a._P=o;var l=Math.PI*i*(r-2)/r;a._cos=Math.cos(l),a._sin=Math.sin(l),a.V=new Array(r),a.V[0]=e,a.V[1]=n;for(var u=2;u<r;u++)a.V[u]=new s.PointElement({AP:o});return a}return r(e,t),e.prototype.update=function(){for(var t=2;t<this.V.length;t++)this.V[t].to(this.V[t-2]),this.V[t].rotate(this.V[t-1],this._cos,this._sin,this._P)},e.prototype.translate=function(t,e){for(var n=2;n<this.V.length;n++)this.V[n].translate(t,e)},e.prototype.rotate=function(t,e,n){for(var o=2;o<this.V.length;o++)this.V[o].rotate(t,e,n,this._P)},e}(i.PolygonElement);e.RegularPolygonElement=a},1099(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.polyhedronConstructions=e.PyramidConstruction=e.PrismConstruction=e.ParallelepipedConstruction=e.TetrahedronConstruction=void 0;var i=n(7658),s=n(2090),a=n(7091),l=n(2383),u=n(444),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolyhedraConstructions.tetrahedron,e.signature={points:4,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new a.PolygonElement([e[0],e[1],e[2]]),i=new l.PyramidElement(r,e[3]);return[[r,i],i]},e}(i.Construction);e.TetrahedronConstruction=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolyhedraConstructions.parallelepiped,e.signature={points:4,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new s.Layoff(e[1],e[0],e[2],e[0],e[2]),i=new a.PolygonElement([e[1],e[0],e[2],r]),l=new u.PrismElement(i,e[0],e[3]);return[[r,i,l],l]},e}(i.Construction);e.ParallelepipedConstruction=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolyhedraConstructions.prism,e.signature={points:2,elements:1,integers:0,elementTypes:[a.PolygonElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new u.PrismElement(n[0],e[0],e[1]);return[[r],r]},e}(i.Construction);e.PrismConstruction=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.PolyhedraConstructions.pyramid,e.signature={points:1,elements:1,integers:0,elementTypes:[a.PolygonElement]},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new l.PyramidElement(n[0],e[0]);return[[r],r]},e}(i.Construction);e.PyramidConstruction=f,e.polyhedronConstructions=[new c,new h,new p,new f]},3857(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PolyhedronElement=void 0;var i=function(t){function e(){var e=t.call(this)||this;return e.dimension=2,e.P=[],e}return r(e,t),e.prototype.defined=function(){for(var t=0;t<this.P.length;++t)if(!this.P[t].defined())return!1;return!0},e.prototype.drawName=function(t){if(this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()){for(var e=0,n=0,o=0,r=0;r<this.P.length;++r)for(var i=0;i<this.P[r].V.length;++i)e+=this.P[r].V[i].x,n+=this.P[r].V[i].y,++o;e/=o,n/=o,this.drawString(Math.round(e),Math.round(n),t)}},e.prototype.drawVertex=function(t){if(this.visible&&null!=this.vertexColor&&this.defined())for(var e=0;e<this.P.length;++e)for(var n=0;n<this.P[e].V.length;++n)this.P[e].V[n].drawVertex(t,this.vertexColor)},e.prototype.drawEdge=function(t){if(this.visible&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.strokeStyle=this.edgeColor;for(var n=0;n<this.P.length;++n)for(var o=0;o<this.P[n].V.length;++o){var r=this.P[n].V[o],i=this.P[n].V[(o+1)%this.P[n].V.length];e.beginPath(),e.moveTo(r.x,r.y),e.lineTo(i.x,i.y),e.stroke()}}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined())for(var e=0;e<this.P.length;++e){var n=this.P[e].faceColor;this.P[e].faceColor=this.faceColor,this.P[e].drawFace(t),this.P[e].faceColor=n}},e.prototype.update=function(){},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n){},e}(n(8020).GeomElement);e.PolyhedronElement=i},444(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PrismElement=void 0;var i=n(3857),s=n(7091),a=n(6091),l=function(t){function e(e,n,o){var r=t.call(this)||this;r.dimension=2,r._C=n,r._D=o;var i=e.V.length,l=2+i;r.P=new Array(l),r.P[0]=e;for(var u=new Array(i),c=0;c<i;++c)u[c]=new a.PointElement,u[c].to(e.V[c]).plus(o).minus(n);r.P[1]=new s.PolygonElement(u);for(var h=2;h<l;++h)r.P[h]=new s.PolygonElement([e.V[h-2],e.V[(h-1)%i],r.P[1].V[(h-1)%i],r.P[1].V[h-2]]);return r}return r(e,t),e.prototype.translate=function(t,e){for(var n=0;n<this.P[1].V.length;++n)this.P[1].V[n].translate(t,e)},e.prototype.rotate=function(t,e,n){for(var o=0;o<this.P[1].V.length;++o)this.P[1].V[o].rotate(t,e,n)},e.prototype.update=function(){for(var t=0;t<this.P[1].V.length;++t)this.P[1].V[t].to(this.P[0].V[t]).plus(this._D).minus(this._C)},e}(i.PolyhedronElement);e.PrismElement=l},2383(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.PyramidElement=void 0;var i=n(3857),s=n(7091),a=function(t){function e(e,n){var o=t.call(this)||this;o.dimension=2;var r=1+e.V.length;o.P=new Array(r),o.P[0]=e;for(var i=1;i<r;++i)o.P[i]=new s.PolygonElement([n,e.V[i-1],e.V[i%e.V.length]]);return o}return r(e,t),e}(i.PolyhedronElement);e.PyramidElement=a},5483(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ArcElement=void 0;var i=n(1025),s=n(6091),a=function(t){function e(e,n,o,r){var i=t.call(this)||this;return i.dimension=2,i._Center=new s.PointElement,i._A=e,i._M=n,i._B=o,i._P=r,i}return r(e,t),e.prototype.update=function(){this._P.update(),this._Center.toCircumcenter(this._A,this._M,this._B)},e.prototype.translate=function(t,e){this._Center.translate(t,e)},e.prototype.rotate=function(t,e,n){this._Center.rotate(t,e,n)},e}(i.SectorElement);e.ArcElement=a},3702(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SectorSweepAnimation=void 0;var i=n(7233),s=n(1025),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.animationMethod=i.AllAnimations.SECTOR_SWEEP,e.name="Sector.sweep",e.elementType=s.SectorElement,e.defaultRate=.003,e.defaultDurationMs=500,e}return r(e,t),e.prototype.build=function(t,e,n){var o=t,r=Math.abs(o._Center.angle(o._A,o._B,o._P)),i=Math.max(250,r/this.defaultRate),s=function(){o.faceAlpha=1,o.drawProgress=1,o.visible=!0},a={durationMs:i,setup:function(){o.faceAlpha=0,o.drawProgress=0},tick:function(t){o.drawProgress=t},finalise:function(){o.drawProgress=1}};return null==o.faceColor?(a.finalise=s,[a]):[a,{durationMs:Math.min(i/2,this.defaultDurationMs),tick:function(t){o.faceAlpha=t},finalise:s}]},e}(i.Animation);e.SectorSweepAnimation=a,(0,i.registerAnimation)(new a)},5755(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.sectorConstructions=e.ArcConstruction=e.SectorConstruction=void 0;var i=n(7658),s=n(6055),a=n(1025),l=n(5483),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.SectorConstructions.sector,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new a.SectorElement({O:e[0],A:e[1],B:e[2],P:r});return[[i],i]},e}(i.Construction);e.SectorConstruction=u;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.SectorConstructions.arc,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.validateSignature=function(t,e){return t===this.constructionMethod&&3===e.P.length&&0===e.N.length&&(0===e.E.length||1===e.E.length&&e.E[0]instanceof s.PlaneElement)},e.prototype.construct=function(t,e,n,o){var r=n.length>0?n[0]:t,i=new l.ArcElement(e[0],e[1],e[2],r);return[[i],i]},e}(i.Construction);e.ArcConstruction=c,e.sectorConstructions=[new u,new c]},1025(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SectorElement=void 0;var i=function(t){function e(e){var n=t.call(this)||this;return n._angle=null,n._faceAlpha=1,n.dimension=2,null!=e&&(n._Center=e.O,n._A=e.A,n._B=e.B,n._P=e.P),n}return r(e,t),Object.defineProperty(e.prototype,"faceAlpha",{get:function(){return this._faceAlpha},set:function(t){this._faceAlpha=t<0?0:t>1?1:t},enumerable:!1,configurable:!0}),e.prototype.radius=function(){return this._Center.distance(this._A)},e.prototype.defined=function(){return this._A.defined()&&this._B.defined()&&this._Center.defined()},e.prototype._updateThroughPoint=function(){0!=this.radius()&&(this._angle=Math.atan2(this._B.y-this._A.y,this._B.x-this._A.x)-Math.atan2(this._Center.y-this._A.y,this._Center.x-this._A.x),this._Center.x,Math.cos(this._angle/2),this._Center.y,Math.sin(this._angle/2))},e.prototype.drawEdge=function(t){if(this.visible){var e=this.emphasized||this.shouldHighlight?this.edgeHighlightColor:this.edgeColor;if(null!=e&&this.defined()){var n=t.getContext("2d");n.strokeStyle=e;var o=this.shouldHighlight?3:1;n.lineWidth=o+this.emphasisAmount*(6-o),n.beginPath();var r=this.radius(),i=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),s=i+this._Center.angle(this._A,this._B,this._P)*this.drawProgress;n.arc(this._Center.x,this._Center.y,r,i,s,!0),n.stroke()}}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()){var e=this.faceAlpha;if(!(e<=0)){var n=t.getContext("2d");n.fillStyle=this.faceColor,n.beginPath();var o=this.radius(),r=Math.atan2(this._A.y-this._Center.y,this._A.x-this._Center.x),i=this._Center.angle(this._A,this._B,this._P),s=r+i;n.arc(this._Center.x,this._Center.y,o,r,s,!0),n.moveTo(this._Center.x,this._Center.y),i<=180?(n.lineTo(this._A.x,this._A.y),n.lineTo(this._B.x,this._B.y)):(n.lineTo(this._B.x,this._B.y),n.lineTo(this._A.x,this._A.y)),n.lineTo(this._Center.x,this._Center.y),e<1?(n.save(),n.globalAlpha=e,n.fill(),n.restore()):n.fill()}}},e.prototype.drawName=function(t){},e.prototype.drawVertex=function(t){},e.prototype.rotate=function(t,e,n){},e.prototype.translate=function(t,e){},e.prototype.update=function(){this._updateThroughPoint()},e}(n(8020).GeomElement);e.SectorElement=i},8649(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.sphereConstructions=e.SphereRadius3PointConstruction=e.SphereRadiusConstruction=void 0;var i=n(7658),s=n(2295),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.SphereConstructions.radius,e.signature={points:2,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new s.SphereElement({Center:e[0],B:e[1]});return[[r],r]},e}(i.Construction);e.SphereRadiusConstruction=a;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.constructionMethod=i.SphereConstructions.radius,e.signature={points:3,elements:0,integers:0},e}return r(e,t),e.prototype.construct=function(t,e,n,o){var r=new s.SphereElement({Center:e[0],A:e[1],B:e[2]});return[[r],r]},e}(i.Construction);e.SphereRadius3PointConstruction=l,e.sphereConstructions=[new l,new a]},2295(t,e,n){var o,r=this&&this.__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SphereElement=void 0;var i=n(8020),s=n(6091),a=function(t){function e(e){var n=t.call(this)||this;return n.dimension=2,n._Center=e&&e.Center||new s.PointElement,n._A=e&&e.A||n._Center,n._B=e&&e.B||new s.PointElement,n}return r(e,t),Object.defineProperty(e.prototype,"Center",{get:function(){return this._Center},enumerable:!1,configurable:!0}),e.prototype.drawName=function(t){this.visible&&null!=this.nameColor&&null!=this.name&&this.defined()&&this.drawString(Math.round(this._Center.x),Math.round(this._Center.y),t,i.Align.CENTRAL)},e.prototype.defined=function(){return!0},e.prototype.drawEdge=function(t){if(this.visible&&null!=this.edgeColor&&this.defined()){var e=t.getContext("2d");e.save(),e.strokeStyle=this.edgeColor;var n=this.radius();e.beginPath(),e.ellipse(this._Center.x,this._Center.y,n,n,0,0,2*Math.PI),e.stroke(),e.restore()}},e.prototype.drawFace=function(t){if(this.visible&&null!=this.faceColor&&this.defined()){var e=t.getContext("2d");e.save(),e.fillStyle=this.faceColor;var n=this.radius();e.beginPath(),e.ellipse(this._Center.x,this._Center.y,n,n,0,0,2*Math.PI),e.fill(),e.restore()}},e.prototype.radius=function(){return this._A.distance(this._B)},e.prototype.radius2=function(){return this._A.distance2(this._B)},e.prototype.drawVertex=function(){},e.prototype.update=function(){},e.prototype.translate=function(t,e){},e.prototype.rotate=function(t,e,n,o){},e}(i.GeomElement);e.SphereElement=a},8156(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.slates=e.BUILD_MARKER=e.A=e.AllAnimations=e.E=e.Align=void 0,e.parseParam=p,e.revealNoscriptFallback=f,e.init=function(t){var n=null!=t.canvasid?t.canvasid:"canvasid",r=document.getElementById(n);try{!function(t,n){var r=null!=t.align?t.align:o.Align.CENTRAL;!function(t){var e=t.clientWidth,n=t.clientHeight;t.width==e&&t.height==n||(t.width=e,t.height=n)}(n);var i=new a.Slate(n);e.slates.push(i);var h=null!=t.font?t.font:"Times New Roman",f=null!=t.fontsize?t.fontsize:18;o.GeomElement.setFont(h,f),i.bgcolor=(0,u.parseColor)(t.background,"#ffffff","#ffffff");for(var _=0,y=t.elements;_<y.length;_++){var d=y[_],v="string"==typeof d?p(d):d,g=i.createElement(v.construction,v.params,v.name);g.align=r;var m=g instanceof s.PointElement?"black":null;g.nameColor=(0,u.parseColor)(v.nameColor,m,i.bgcolor);var P=g.draggable?g instanceof l.PlaneSlider?"red":"orange":"black";g.vertexColor=(0,u.parseColor)(v.vertexColor,P,i.bgcolor),g.edgeColor=(0,u.parseColor)(v.edgeColor,"black",i.bgcolor);var C=(0,u.lighten)(i.bgcolor),w=2==g.dimension?C:null;g.faceColor=(0,u.parseColor)(v.faceColor,w,i.bgcolor)}null!=t.aliases&&i.addAliases(t.aliases),null!=t.slides&&t.slides.length>0&&(i.slides=t.slides),null!=t.resolveJustification&&(i.resolveJustification=t.resolveJustification),null!=t.animationConfig&&(i.animationConfig=t.animationConfig),null!=t.pivot&&i.setPivot(t.pivot),i.update(),i.updateCoordinates(0),n&&n.parentElement&&(0,c.createControls)(i,n,t)}(t,r)}catch(t){throw console.error("[geomlib] init failed:",t),f(r),t}};var o=n(8020);Object.defineProperty(e,"Align",{enumerable:!0,get:function(){return o.Align}});var r=n(7658);Object.defineProperty(e,"E",{enumerable:!0,get:function(){return r.E}});var i=n(7233);Object.defineProperty(e,"AllAnimations",{enumerable:!0,get:function(){return i.AllAnimations}}),Object.defineProperty(e,"A",{enumerable:!0,get:function(){return i.A}}),n(2872),n(1910),n(9222),n(3712),n(3702);var s=n(6091),a=n(8041),l=n(4994),u=n(1454),c=n(3267);e.BUILD_MARKER="pointer-events-refactor-v1 (Slate.ts #55)",e.slates=[];var h={point:"Point",line:"Line",circle:"Circle",polygon:"Polygon",sector:"Sector",plane:"Plane",sphere:"Sphere",polyhedron:"Polyhedra"};function p(t){var e=t.split(";");if(e.length<4)throw new Error("parseParam: expected at least 4 semicolon-separated fields, got ".concat(e.length,': "').concat(t,'"'));var n=e[0],o=e[1],i=e[2],s=e[3],a=h[o];if(null==a)throw new Error('parseParam: unknown element type "'.concat(o,'" in "').concat(t,'"'));var l=r.E[a]["3points"===i?"threePoints":i];if(null==l)throw new Error('parseParam: unknown construction "'.concat(o,";").concat(i,'" in "').concat(t,'"'));var u={name:n,construction:l,params:s.split(",").map((function(t){var e=Number(t);return""===t||isNaN(e)?t:e}))};return e.length>4&&void 0!==e[4]&&(u.nameColor=e[4]),e.length>5&&void 0!==e[5]&&(u.vertexColor=e[5]),e.length>6&&void 0!==e[6]&&(u.edgeColor=e[6]),e.length>7&&void 0!==e[7]&&(u.faceColor=e[7]),u}function f(t){var e;if(t)try{for(var n=t.nextElementSibling,o=0;n&&o++<5&&"NOSCRIPT"!==n.tagName;)n=n.nextElementSibling;if(!n||"NOSCRIPT"!==n.tagName)return;var r=n.innerHTML;if(!r)return;var i=document.createElement("div");i.innerHTML=r,null===(e=n.parentNode)||void 0===e||e.insertBefore(i,n),t.style.display="none"}catch(t){}}},7680(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.computeSlideState=function(t,e,n){for(var o=[],r=n;r>=0;r--)if(null!=e[r].visible){o=e[r].visible;break}for(var i=new Set(o),s=e[n],a=new Set(s.highlighted||[]),l=0,u=t.elements;l<u.length;l++){var c=u[l];c.draggable&&null!=c.name&&i.add(c.name)}return a.forEach((function(t){return i.add(t)})),{visible:i,highlighted:a}}}},e={},n=function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o].call(i.exports,i,i.exports,n),i.exports}(8156);geomlib=n})();
2
2
  //# sourceMappingURL=bundle.js.map