mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-21 12:11:52 +02:00
1 line
5.5 KiB
JavaScript
1 line
5.5 KiB
JavaScript
|
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.nonLayeredTidyTreeLayout=n():t.nonLayeredTidyTreeLayout=n()}(window,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=0)}([function(t,n,e){"use strict";function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}e.r(n);var o=function t(n,e,o,i){r(this,t),this.w=n,this.h=e,this.y=o,this.c=i,this.cs=i.length,this.x=0,this.prelim=0,this.mod=0,this.shift=0,this.change=0,this.tl=null,this.tr=null,this.el=null,this.er=null,this.msel=0,this.mser=0};function i(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function u(t){return t.y+t.h}var l=function t(n,e,o){r(this,t),this.lowY=n,this.index=e,this.next=o};function c(t,n,e){for(;null!==e&&t>=e.lowY;)e=e.next;return new l(t,n,e)}function a(t,n,e,r){t.c[n].mod+=r,t.c[n].msel+=r,t.c[n].mser+=r,function(t,n,e,r){if(e!==n-1){var o=n-e;t.c[e+1].shift+=r/o,t.c[n].shift-=r/o,t.c[n].change-=r-r/o}}(t,n,e,r)}function s(t){return 0===t.cs?t.tl:t.c[0]}function f(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function h(t,n,e){for(var r=t.c[n-1],o=r.mod,i=t.c[n],l=i.mod;null!==r&&null!==i;){u(r)>e.lowY&&(e=e.next);var c=o+r.prelim+r.w-(l+i.prelim);c>0&&(l+=c,a(t,n,e.index,c));var h=u(r),d=u(i);h<=d&&null!==(r=f(r))&&(o+=r.mod),h>=d&&null!==(i=s(i))&&(l+=i.mod)}null===r&&null!==i?function(t,n,e,r){var o=t.c[0].el;o.tl=e;var i=r-e.mod-t.c[0].msel;o.mod+=i,o.prelim-=i,t.c[0].el=t.c[n].el,t.c[0].msel=t.c[n].msel}(t,n,i,l):null!==r&&null===i&&function(t,n,e,r){var o=t.c[n].er;o.tr=e;var i=r-e.mod-t.c[n].mser;o.mod+=i,o.prelim-=i,t.c[n].er=t.c[n-1].er,t.c[n].mser=t.c[n-1].mser}(t,n,r,o)}function d(t){!function t(n){if(0!==n.cs){t(n.c[0]);for(var e=c(u(n.c[0].el),0,null),r=1;r<n.cs;r++){t(n.c[r]);var o=u(n.c[r].er);h(n,r,e),e=c(o,r,e)}!function(t){t.prelim=(t.c[0].prelim+t.c[0].mod+t.c[t.cs-1].mod+t.c[t.cs-1].prelim+t.c[t.cs-1].w)/2-t.w/2}(n),i(n)}else i(n)}(t),function t(n,e){e+=n.mod,n.x=n.prelim+e,function(t){for(var n=0,e=0,r=0;r<t.cs;r++)e+=(n+=t.c[r].shift)+t.c[r].change,t.c[r].mod+=e}(n);for(var r=0;r<n.cs;r++)t(n.c[r],e)}(t,0)}function m(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function v(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function y(t,n,e){return n&&v(t.prototype,n),e&&v(t,e),t}var g=function(){function t(n,e){m(this,t),this.gap=n,this.bottomPadding=e}return y(t,[{key:"addBoundingBox",value:function(t,n){return{width:t+this.gap,height:n+this.bottomPadding}}},{key:"removeBoundingBox",value:function(t,n){return{x:t+this.gap/2,y:n}}}]),t}(),p=function(){function t(n){m(this,t),this.bb=n}return y(t,[{key:"layout",value:function(t){var n=this.convert(t);d(n);var e=this.assignLayout(n,t),r=e.boundingBox;return{result:e.result,boundingBox:r}}},{key:"convert",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null===t)return null;var e=this.bb.addBoundingBox(t.width,t.height),r=
|