diff --git a/composer.json b/composer.json index 3d7894f..6a7a56b 100644 --- a/composer.json +++ b/composer.json @@ -30,9 +30,9 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "ext-json": "*", "ext-dom": "*", - "fisharebest/webtrees": "~2.2.0 || dev-main", + "ext-json": "*", + "fisharebest/webtrees": "~2.2.0", "magicsunday/webtrees-module-base": "^1.0", "magicsunday/webtrees-module-installer-plugin": "^1.3" }, @@ -89,12 +89,16 @@ "rector process --config rector.php --dry-run" ], "ci:cgl": [ - "php-cs-fixer fix --diff --verbose" + "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --diff --verbose" + ], + "ci:rector": [ + "rector process --config rector.php" ], "ci:test": [ "@ci:test:php:lint", "@ci:test:php:phpstan", - "@ci:test:php:rector" + "@ci:test:php:rector", + "@ci:cgl --dry-run" ], "module:check": [ "@ci:test" diff --git a/package.json b/package.json index ae90617..6c86555 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webtrees-fan-chart", - "version": "2.7.2", + "version": "3.0.0", "description": "This modules provides an SVG ancestor fan chart for the [webtrees](https://www.webtrees.net) genealogy application.", "keywords": [ "webtrees", diff --git a/resources/js/fan-chart-2.7.2.min.js b/resources/js/fan-chart-3.0.0.min.js similarity index 99% rename from resources/js/fan-chart-2.7.2.min.js rename to resources/js/fan-chart-3.0.0.min.js index 7901c0a..b3bdda1 100644 --- a/resources/js/fan-chart-2.7.2.min.js +++ b/resources/js/fan-chart-3.0.0.min.js @@ -4,8 +4,8 @@ * For the full copyright and license information, please read the * LICENSE file that was distributed with this source code. * - * Generated: 2024-12-02 09:00:55 - * Version: 2.7.2 + * Generated: 2024-12-02 09:21:19 + * Version: 3.0.0 */ var t,e;t=this,e=function(t){function e(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function n(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function r(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=a)):void 0===e&&(e=i);for(var n,r,o,u,h,c=new l(t),f=[c];n=f.pop();)if((o=e(n.data))&&(h=(o=Array.from(o)).length))for(n.children=o,u=h-1;u>=0;--u)f.push(r=o[u]=new l(o[u])),r.parent=n,r.depth=n.depth+1;return c.eachBefore(s)}function i(t){return t.children}function a(t){return Array.isArray(t)?t[1]:null}function o(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function s(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function l(t){this.data=t,this.depth=this.height=0,this.parent=null}function u(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function h(){var t=1,e=1,n=0,r=!1;function i(i){var a=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/a,i.eachBefore(function(t,e){return function(r){r.children&&function(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,u=t.value&&(r-e)/t.value;++s=0;--r)a.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return r(this).eachBefore(o)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n=0))throw new Error(`invalid digits: ${t}`);if(e>15)return g;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;ed)if(Math.abs(h*s-l*u)>d&&i){let p=n-a,g=r-o,m=s*s+l*l,v=p*p+g*g,_=Math.sqrt(m),y=Math.sqrt(f),w=i*Math.tan((c-Math.acos((m+f-v)/(2*_*y)))/2),x=w/y,b=w/_;Math.abs(x-1)>d&&this._append`L${t+x*u},${e+x*h}`,this._append`A${i},${i},0,0,${+(h*p>u*g)},${this._x1=t+b*s},${this._y1=e+b*l}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,u=e+s,h=1^a,g=a?r-i:i-r;null===this._x1?this._append`M${l},${u}`:(Math.abs(this._x1-l)>d||Math.abs(this._y1-u)>d)&&this._append`L${l},${u}`,n&&(g<0&&(g=g%f+f),g>p?this._append`A${n},${n},0,1,${h},${t-o},${e-s}A${n},${n},0,1,${h},${this._x1=l},${this._y1=u}`:g>d&&this._append`A${n},${n},0,${+(g>=c)},${h},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function v(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function _(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function y(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i>>1;n(t[e],r)<0?i=e+1:a=e}while(iv(t(e),n),r=(e,n)=>t(e)-n):(e=t===v||t===_?t:w,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const o=i(t,e,n,a-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r,i=0,a=t.length){if(i>>1;n(t[e],r)<=0?i=e+1:a=e}while(i=b?10:a>=A?5:a>=M?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(t*u),l=Math.round(e*u),s/ue&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(t/u),l=Math.round(e/u),s*ue&&--l),l>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?F(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?F(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=I.exec(t))?new K(e[1],e[2],e[3],1):(e=L.exec(t))?new K(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=B.exec(t))?F(e[1],e[2],e[3],e[4]):(e=j.exec(t))?F(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=X.exec(t))?nt(e[1],e[2]/100,e[3]/100,1):(e=q.exec(t))?nt(e[1],e[2]/100,e[3]/100,e[4]):G.hasOwnProperty(t)?U(G[t]):"transparent"===t?new K(NaN,NaN,NaN,0):null}function U(t){return new K(t>>16&255,t>>8&255,255&t,1)}function F(t,e,n,r){return r<=0&&(t=e=n=NaN),new K(t,e,n,r)}function W(t,e,n,r){return 1===arguments.length?((i=t)instanceof $||(i=Y(i)),i?new K((i=i.rgb()).r,i.g,i.b,i.opacity):new K):new K(t,e,n,null==r?1:r);var i}function K(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Q(){return`#${et(this.r)}${et(this.g)}${et(this.b)}`}function Z(){const t=J(this.opacity);return`${1===t?"rgb(":"rgba("}${tt(this.r)}, ${tt(this.g)}, ${tt(this.b)}${1===t?")":`, ${t})`}`}function J(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function tt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function et(t){return((t=tt(t))<16?"0":"")+t.toString(16)}function nt(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new it(t,e,n,r)}function rt(t){if(t instanceof it)return new it(t.h,t.s,t.l,t.opacity);if(t instanceof $||(t=Y(t)),!t)return new it;if(t instanceof it)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n0&&l<1?0:o,new it(o,s,l,t.opacity)}function it(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function at(t){return(t=(t||0)%360)<0?t+360:t}function ot(t){return Math.max(0,Math.min(1,t||0))}function st(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}S($,Y,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:H,formatHex:H,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return rt(this).formatHsl()},formatRgb:V,toString:V}),S(K,W,P($,{brighter(t){return t=null==t?T:Math.pow(T,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?C:Math.pow(C,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new K(tt(this.r),tt(this.g),tt(this.b),J(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Q,formatHex:Q,formatHex8:function(){return`#${et(this.r)}${et(this.g)}${et(this.b)}${et(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Z,toString:Z})),S(it,(function(t,e,n,r){return 1===arguments.length?rt(t):new it(t,e,n,null==r?1:r)}),P($,{brighter(t){return t=null==t?T:Math.pow(T,t),new it(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?C:Math.pow(C,t),new it(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new K(st(t>=240?t-240:t+120,i,r),st(t,i,r),st(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new it(at(this.h),ot(this.s),ot(this.l),J(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=J(this.opacity);return`${1===t?"hsl(":"hsla("}${at(this.h)}, ${100*ot(this.s)}%, ${100*ot(this.l)}%${1===t?")":`, ${t})`}`}}));var lt=t=>()=>t;function ut(t){return 1==(t=+t)?ht:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):lt(isNaN(e)?n:e)}}function ht(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):lt(isNaN(t)?e:t)}var ct=function t(e){var n=ut(e);function r(t,e){var r=n((t=W(t)).r,(e=W(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=ht(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function ft(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;na&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,l.push({i:o,x:gt(n,r)})),a=_t.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:gt(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,s,l),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:gt(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,s,l),function(t,e,n,r,a,o){if(t!==n||e!==r){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:gt(t,n)},{i:s-2,x:gt(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,n=-1,r=l.length;++ne&&(n=t,t=e,e=n),u=function(n){return Math.max(t,Math.min(e,n))}),r=l>2?Ot:Dt,i=a=null,c}function c(e){return null==e||isNaN(e=+e)?n:(i||(i=r(o.map(t),s,l)))(t(u(e)))}return c.invert=function(n){return u(e((a||(a=r(s,o.map(t),gt)))(n)))},c.domain=function(t){return arguments.length?(o=Array.from(t,Ct),h()):o.slice()},c.range=function(t){return arguments.length?(s=Array.from(t),h()):s.slice()},c.rangeRound=function(t){return s=Array.from(t),l=xt,h()},c.clamp=function(t){return arguments.length?(u=!!t||zt,h()):u!==zt},c.interpolate=function(t){return arguments.length?(l=t,h()):l},c.unknown=function(t){return arguments.length?(n=t,c):n},function(n,r){return t=n,e=r,h()}}function Lt(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Bt(t){return(t=Lt(Math.abs(t)))?t[1]:NaN}var jt,Xt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function qt(t){if(!(e=Xt.exec(t)))throw new Error("invalid format: "+t);var e;return new Gt({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Gt(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ht(t,e){var n=Lt(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}qt.prototype=Gt.prototype,Gt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Vt={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ht(100*t,e),r:Ht,s:function(t,e){var n=Lt(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(jt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Lt(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Yt(t){return t}var Ut,Ft,Wt,Kt=Array.prototype.map,Qt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Zt(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Yt:(e=Kt.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Yt:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Kt.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"−":t.minus+"",h=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=qt(t)).fill,n=t.align,c=t.sign,f=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,v=t.trim,_=t.type;"n"===_?(g=!0,_="g"):Vt[_]||(void 0===m&&(m=12),v=!0,_="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var y="$"===f?i:"#"===f&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",w="$"===f?a:/[%p]/.test(_)?l:"",x=Vt[_],b=/[defgprs%]/.test(_);function A(t){var i,a,l,f=y,A=w;if("c"===_)A=x(t)+A,t="";else{var M=(t=+t)<0||1/t<0;if(t=isNaN(t)?h:x(Math.abs(t),m),v&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),M&&0==+t&&"+"!==c&&(M=!1),f=(M?"("===c?c:u:"-"===c||"("===c?"":c)+f,A=("s"===_?Qt[8+jt/3]:"")+A+(M&&"("===c?")":""),b)for(i=-1,a=t.length;++i(l=t.charCodeAt(i))||l>57){A=(46===l?o+t.slice(i+1):t.slice(i))+A,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var N=f.length+t.length+A.length,k=N>1)+f+t+A+k.slice(N);break;default:t=k+f+t+A}return s(t)}return m=void 0===m?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),A.toString=function(){return t+""},A}return{format:c,formatPrefix:function(t,e){var n=c(((t=qt(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Bt(e)/3))),i=Math.pow(10,-r),a=Qt[8+r/3];return function(t){return n(i*t)+a}}}}function Jt(t,e,n,r){var i,a=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?k(e,t,n):k(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}(t,e,n);switch((r=qt(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Bt(e)/3)))-Bt(Math.abs(t)))}(a,o))||(r.precision=i),Wt(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Bt(e)-Bt(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-Bt(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return Ft(r)}function te(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e=i))return[];const s=a-i+1,l=new Array(s);if(r)if(o<0)for(let t=0;t0;){if((i=k(l,u,n))===r)return a[o]=l,a[s]=u,e(a);if(i>0)l=Math.floor(l/i)*i,u=Math.ceil(u/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,u=Math.floor(u*i)/i}r=i}return t},t}function ee(){var t=It()(zt,zt);return t.copy=function(){return e=t,ee().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},E.apply(t,arguments),te(t)}Ut=Zt({thousands:",",grouping:[3],currency:["$",""]}),Ft=Ut.format,Wt=Ut.formatPrefix;var ne="http://www.w3.org/1999/xhtml",re={svg:"http://www.w3.org/2000/svg",xhtml:ne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ie(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),re.hasOwnProperty(e)?{space:re[e],local:t}:t}function ae(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ne&&e.documentElement.namespaceURI===ne?e.createElement(t):e.createElementNS(n,t)}}function oe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function se(t){var e=ie(t);return(e.local?oe:ae)(e)}function le(){}function ue(t){return null==t?le:function(){return this.querySelector(t)}}function he(){return[]}function ce(t){return null==t?he:function(){return this.querySelectorAll(t)}}function fe(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function de(t){return function(){return this.matches(t)}}function pe(t){return function(e){return e.matches(t)}}var ge=Array.prototype.find;function me(){return this.firstElementChild}var ve=Array.prototype.filter;function _e(){return Array.from(this.children)}function ye(t){return new Array(t.length)}function we(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function xe(t,e,n,r,i,a){for(var o,s=0,l=e.length,u=a.length;se?1:t>=e?0:NaN}function ke(t){return function(){this.removeAttribute(t)}}function Ee(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Se(t,e){return function(){this.setAttribute(t,e)}}function Pe(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function $e(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Ce(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Te(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ze(t){return function(){this.style.removeProperty(t)}}function Re(t,e,n){return function(){this.style.setProperty(t,e,n)}}function De(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Oe(t,e){return t.style.getPropertyValue(e)||Te(t).getComputedStyle(t,null).getPropertyValue(e)}function Ie(t){return function(){delete this[t]}}function Le(t,e){return function(){this[t]=e}}function Be(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function je(t){return t.trim().split(/^|\s+/)}function Xe(t){return t.classList||new qe(t)}function qe(t){this._node=t,this._names=je(t.getAttribute("class")||"")}function Ge(t,e){for(var n=Xe(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var fn=[null];function dn(t,e){this._groups=t,this._parents=e}function pn(){return new dn([[document.documentElement]],fn)}function gn(t){return"string"==typeof t?new dn([[document.querySelector(t)]],[document.documentElement]):new dn([[t]],fn)}function mn(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}dn.prototype=pn.prototype={constructor:dn,select:function(t){"function"!=typeof t&&(t=ue(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=x&&(x=w+1);!(y=v[x])&&++x=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Ne);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==e?ze:"function"==typeof e?De:Re)(t,e,null==n?"":n)):Oe(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Ie:"function"==typeof e?Be:Le)(t,e)):this.node()[t]},classed:function(t,e){var n=je(t+"");if(arguments.length<2){for(var r=Xe(this.node()),i=-1,a=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?ln:sn,r=0;r=0&&e._call.call(void 0,t),e=e._next;--yn}()}finally{yn=0,function(){for(var t,e,n=vn,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:vn=e);_n=t,zn(r)}(),An=0}}function Tn(){var t=Nn.now(),e=t-bn;e>1e3&&(Mn-=e,bn=t)}function zn(t){yn||(wn&&(wn=clearTimeout(wn)),t-An>24?(t<1/0&&(wn=setTimeout(Cn,t-Nn.now()-Mn)),xn&&(xn=clearInterval(xn))):(xn||(bn=Nn.now(),xn=setInterval(Tn,1e3)),yn=1,kn(Cn)))}function Rn(t,e,n){var r=new Pn;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}function Dn(t){return function(){return t}}Pn.prototype=$n.prototype={constructor:Pn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?En():+n)+(null==e?0:+e),this._next||_n===this||(_n?_n._next=this:vn=this,_n=this),this._call=t,this._time=n,zn()},stop:function(){this._call&&(this._call=null,this._time=1/0,zn())}};const On=Math.abs,In=Math.atan2,Ln=Math.cos,Bn=Math.max,jn=Math.min,Xn=Math.sin,qn=Math.sqrt,Gn=1e-12,Hn=Math.PI,Vn=Hn/2,Yn=2*Hn;function Un(t){return t>=1?Vn:t<=-1?-Vn:Math.asin(t)}function Fn(t){return t.innerRadius}function Wn(t){return t.outerRadius}function Kn(t){return t.startAngle}function Qn(t){return t.endAngle}function Zn(t){return t&&t.padAngle}function Jn(t,e,n,r,i,a,o){var s=t-n,l=e-r,u=(o?a:-a)/qn(s*s+l*l),h=u*l,c=-u*s,f=t+h,d=e+c,p=n+h,g=r+c,m=(f+p)/2,v=(d+g)/2,_=p-f,y=g-d,w=_*_+y*y,x=i-a,b=f*g-p*d,A=(y<0?-1:1)*qn(Bn(0,x*x*w-b*b)),M=(b*y-_*A)/w,N=(-b*_-y*A)/w,k=(b*y+_*A)/w,E=(-b*_+y*A)/w,S=M-m,P=N-v,$=k-m,C=E-v;return S*S+P*P>$*$+C*C&&(M=k,N=E),{cx:M,cy:N,x01:-h,y01:-c,x11:M*(i/x-1),y11:N*(i/x-1)}}function tr(){var t=Fn,e=Wn,n=Dn(0),r=null,i=Kn,a=Qn,o=Zn,s=null,l=function(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new m(e)}(u);function u(){var u,h,c,f=+t.apply(this,arguments),d=+e.apply(this,arguments),p=i.apply(this,arguments)-Vn,g=a.apply(this,arguments)-Vn,m=On(g-p),v=g>p;if(s||(s=u=l()),dGn)if(m>Yn-Gn)s.moveTo(d*Ln(p),d*Xn(p)),s.arc(0,0,d,p,g,!v),f>Gn&&(s.moveTo(f*Ln(g),f*Xn(g)),s.arc(0,0,f,g,p,v));else{var _,y,w=p,x=g,b=p,A=g,M=m,N=m,k=o.apply(this,arguments)/2,E=k>Gn&&(r?+r.apply(this,arguments):qn(f*f+d*d)),S=jn(On(d-f)/2,+n.apply(this,arguments)),P=S,$=S;if(E>Gn){var C=Un(E/f*Xn(k)),T=Un(E/d*Xn(k));(M-=2*C)>Gn?(b+=C*=v?1:-1,A-=C):(M=0,b=A=(p+g)/2),(N-=2*T)>Gn?(w+=T*=v?1:-1,x-=T):(N=0,w=x=(p+g)/2)}var z=d*Ln(w),R=d*Xn(w),D=f*Ln(A),O=f*Xn(A);if(S>Gn){var I,L=d*Ln(x),B=d*Xn(x),j=f*Ln(b),X=f*Xn(b);if(m1?0:c<-1?Hn:Math.acos(c))/2),U=qn(I[0]*I[0]+I[1]*I[1]);P=jn(S,(f-U)/(Y-1)),$=jn(S,(d-U)/(Y+1))}else P=$=0}N>Gn?$>Gn?(_=Jn(j,X,z,R,d,$,v),y=Jn(L,B,D,O,d,$,v),s.moveTo(_.cx+_.x01,_.cy+_.y01),$Gn&&M>Gn?P>Gn?(_=Jn(D,O,L,B,f,-P,v),y=Jn(z,R,j,X,f,-P,v),s.lineTo(_.cx+_.x01,_.cy+_.y01),P{}};function nr(){for(var t,e=0,n=arguments.length,r={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var n,r,i=new Array(n),a=0;a0)throw new Error("too late; already scheduled");return n}function hr(t,e){var n=cr(t,e);if(n.state>3)throw new Error("too late; already running");return n}function cr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function fr(t,e){var n,r,i,a=t.__transition,o=!0;if(a){for(i in e=null==e?null:e+"",a)(n=a[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}}function dr(t,e){var n,r;return function(){var i=hr(this,t),a=i.tween;if(a!==n)for(var o=0,s=(r=n=a).length;o=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ur:hr;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}(n,t,e))},attr:function(t,e){var n=ie(t),r="transform"===n?St:mr;return this.attrTween(t,"function"==typeof e?(n.local?br:xr)(n,r,gr(this,"attr."+t,e)):null==e?(n.local?_r:vr)(n):(n.local?wr:yr)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=ie(t);return this.tween(n,(r.local?Ar:Mr)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?Et:mr;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var a=Oe(this,t),o=(this.style.removeProperty(t),Oe(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}(t,r)).on("end.style."+t,$r(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,a;return function(){var o=Oe(this,t),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(t),l=s=Oe(this,t)),o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,s))}}(t,r,gr(this,"style."+t,e))).each(function(t,e){var n,r,i,a,o="style."+e,s="end."+o;return function(){var l=hr(this,t),u=l.on,h=null==l.value[o]?a||(a=$r(e)):void 0;u===n&&i===h||(r=(n=u).copy()).on(s,i=h),l.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,a=n+"";return function(){var o=Oe(this,t);return o===a?null:o===r?i:i=e(r=o,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,a,n)),r}return a._value=e,a}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(gr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=cr(this.node(),n).tween,a=0,o=i.length;a()=>t;function Xr(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function qr(t,e,n){this.k=t,this.x=e,this.y=n}qr.prototype={constructor:qr,scale:function(t){return 1===t?this:new qr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new qr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Gr=new qr(1,0,0);function Hr(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Gr;return t.__zoom}function Vr(t){t.stopImmediatePropagation()}function Yr(t){t.preventDefault(),t.stopImmediatePropagation()}function Ur(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Fr(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Wr(){return this.__zoom||Gr}function Kr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Qr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zr(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Jr(){var t,e,n,r=Ur,i=Fr,a=Zr,o=Kr,s=Qr,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],h=250,c=$t,f=nr("start","zoom","end"),d=0,p=10;function g(t){t.property("__zoom",Wr).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",M).filter(s).on("touchstart.zoom",N).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",E).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(t,e){return(e=Math.max(l[0],Math.min(l[1],e)))===t.k?t:new qr(e,t.x,t.y)}function v(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new qr(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,e,n,r){t.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,a=arguments,o=w(t,a).event(r),s=i.apply(t,a),l=null==n?_(s):"function"==typeof n?n.apply(t,a):n,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),h=t.__zoom,f="function"==typeof e?e.apply(t,a):e,d=c(h.invert(l).concat(u/h.k),f.invert(l).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=d(t),n=u/e[2];t=new qr(n,l[0]-e[0]*n,l[1]-e[1]*n)}o.zoom(null,t)}}))}function w(t,e,n){return!n&&t.__zooming||new x(t,e)}function x(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function b(t,...e){if(r.apply(this,arguments)){var n=w(this,e).event(t),i=this.__zoom,s=Math.max(l[0],Math.min(l[1],i.k*Math.pow(2,o.apply(this,arguments)))),h=mn(t);if(n.wheel)n.mouse[0][0]===h[0]&&n.mouse[0][1]===h[1]||(n.mouse[1]=i.invert(n.mouse[0]=h)),clearTimeout(n.wheel);else{if(i.k===s)return;n.mouse=[h,i.invert(h)],fr(this),n.start()}Yr(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),150),n.zoom("mouse",a(v(m(i,s),n.mouse[0],n.mouse[1]),n.extent,u))}}function A(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,o=w(this,e,!0).event(t),s=gn(t.view).on("mousemove.zoom",(function(t){if(Yr(t),!o.moved){var e=t.clientX-h,n=t.clientY-c;o.moved=e*e+n*n>d}o.event(t).zoom("mouse",a(v(o.that.__zoom,o.mouse[0]=mn(t,i),o.mouse[1]),o.extent,u))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,r=gn(t).on("dragstart.drag",null);e&&(r.on("click.drag",Br,Lr),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,o.moved),Yr(t),o.event(t).end()}),!0),l=mn(t,i),h=t.clientX,c=t.clientY;!function(t){var e=t.document.documentElement,n=gn(t).on("dragstart.drag",Br,Lr);"onselectstart"in e?n.on("selectstart.drag",Br,Lr):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Vr(t),o.mouse=[l,this.__zoom.invert(l)],fr(this),o.start()}}function M(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,o=mn(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(o),l=n.k*(t.shiftKey?.5:2),c=a(v(m(n,l),o,s),i.apply(this,e),u);Yr(t),h>0?gn(this).transition().duration(h).call(y,c,o,t):gn(this).call(g.transform,c,o,t)}}function N(n,...i){if(r.apply(this,arguments)){var a,o,s,l,u=n.touches,h=u.length,c=w(this,i,n.changedTouches.length===h).event(n);for(Vr(n),o=0;o(!t.parents&&t.data.generation{t.id=e}))}get nodes(){return this._nodes}get root(){return this._root}createEmptyNode(t,e){return{data:{id:0,xref:"",url:"",updateUrl:"",generation:t,name:"",firstNames:[],lastNames:[],preferredName:"",alternativeName:"",isAltRtl:!1,sex:e,timespan:""}}}}class ii{constructor(t){this._element=t.append("div").attr("class","overlay").style("opacity",1e-6)}show(t,e=0,n=null){this._element.select("p").remove(),this._element.append("p").attr("class","tooltip").text(t),this._element.transition().duration(e).style("opacity",1).on("end",(()=>{"function"==typeof n&&n()}))}hide(t=0,e=0){this._element.transition().delay(t).duration(e).style("opacity",1e-6)}get(){return this._element}}class ai{constructor(t){this._element=t.append("defs")}get(){return this._element}select(t){return this._element.select(t)}append(t){return this._element.append(t)}}class oi{constructor(t){this._zoom=null,this._parent=t,this.init()}init(){this._zoom=Jr(),this._zoom.scaleExtent([.1,20]).on("zoom",(t=>{this._parent.attr("transform",t.transform)})),this._zoom.wheelDelta((t=>-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002))),this._zoom.filter((t=>{if("wheel"===t.type){if(!t.ctrlKey)return!1;const e=Hr(this);if(e.k){if(e.k<=.1&&t.deltaY>0)return t.preventDefault(),!1;if(e.k>=20&&t.deltaY<0)return t.preventDefault(),!1}return!0}return t.button||"touchstart"!==t.type?!(t.ctrlKey&&"wheel"!==t.type||t.button):2===t.touches.length}))}get(){return this._zoom}}class si{constructor(t){this._element=t,this._element.append("filter").attr("id","drop-shadow").append("feDropShadow").attr("stdDeviation","7 7").attr("dx","0").attr("dy","0").attr("flood-opacity","0.3").attr("flood-color","rgb(0,0,0)")}get(){return this._element}}class li{triggerDownload(t,e){let n=new MouseEvent("click",{view:window,bubbles:!1,cancelable:!0}),r=document.createElement("a");r.setAttribute("download",e),r.setAttribute("href",t),r.setAttribute("target","_blank"),r.dispatchEvent(n)}}class ui extends li{copyStylesInline(t,e){let n=["svg","g","text","textPath"];for(let r=0;r{let i=(new XMLSerializer).serializeToString(t),a=window.URL||window.webkitURL||window,o=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),s=a.createObjectURL(o),l=new Image;l.onload=()=>{let t=this.createCanvas(e,n),i=t.getContext("2d");i.fillStyle="rgb(255,255,255)",i.fillRect(0,0,t.width,t.height),i.drawImage(l,0,0),a.revokeObjectURL(s);let o=t.toDataURL("image/png").replace("image/png","image/octet-stream");r(o)},l.src=s}))}cloneSvg(t){return new Promise((e=>{e(t.cloneNode(!0))}))}svgToImage(t,e){const n=[4960,3508];this.cloneSvg(t.node()).then((e=>{this.copyStylesInline(t.node(),e);const r=this.calculateViewBox(t.node()),i=Math.max(n[0],r[2]),a=Math.max(n[1],r[3]);return e.setAttribute("width",""+i),e.setAttribute("height",""+a),e.setAttribute("viewBox",""+r),this.convertToDataUrl(e,i,a)})).then((t=>this.triggerDownload(t,e))).catch((()=>{console.log("Failed to save chart as PNG image")}))}}class hi extends li{constructor(){super(),this._obsoleteStyles=["d","cursor","user-select","block-size","inline-size","width","height","column-rule-color","vertical-align","border-collapse","border-spacing","place-content","place-items","place-self","bottom","top","right","left","column-fill","gap","column-rule-style","column-rule-width","column-span","empty-cells","flex","flex-flow","grid-area","order","shape-image-threshold","shape-margin","shape-outside","table-layout","z-index"],this._defaultStyles={}}createSandbox(t){return this._sandbox=document.createElement("iframe"),this._sandbox.style.visibility="hidden",this._sandbox.style.position="fixed",document.body.appendChild(this._sandbox),this._sandbox.contentWindow.document.write('Sandbox'),t}getDefaultComputedStyle(t){if(this._defaultStyles[t.tagName])return this._defaultStyles[t.tagName];const e=this._sandbox.contentWindow.document.createElement(t.tagName);e.textContent="​",this._sandbox.contentWindow.document.body.appendChild(e);const n=this._sandbox.contentWindow.getComputedStyle(e);return this._sandbox.contentWindow.document.body.removeChild(e),this._defaultStyles[t.tagName]=n,this._defaultStyles[t.tagName]}cloneStyles(t,e,n){if(!(e instanceof Element))return Promise.resolve(e);const r=this.getDefaultComputedStyle(t),i=window.getComputedStyle(t),a=e.style;return Array.from(i).forEach((t=>{if(t.startsWith("--"))return;if(-1!==this._obsoleteStyles.indexOf(t))return;const e=i.getPropertyValue(t),o=r[t],s=n?n.getPropertyValue(t):void 0;if(e!==o&&e!==s||n&&e!==s){const n=i.getPropertyPriority(t);n?a.setProperty(t,e,n):a.setProperty(t,e),"font-family"===t&&a.setProperty(t,'"Segoe UI", Arial, sans-serif')}})),Promise.resolve(e)}createNodeDuplicate(t,e){return Promise.resolve(t).then((t=>t.cloneNode(!1))).then((e=>this.cloneChildren(t,e))).then((n=>this.cloneStyles(t,n,e)))}cloneChildren(t,e){let n=Promise.resolve();if(0!==t.childNodes.length){const r=window.getComputedStyle(t);Array.from(t.childNodes).forEach((t=>{n=n.then((()=>this.createNodeDuplicate(t,r))).then((t=>{t&&e.appendChild(t)}))}))}return n.then((()=>e))}convertToObjectUrl(t){return new Promise((e=>{const n=(new XMLSerializer).serializeToString(t),r=window.URL||window.webkitURL||window,i=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),a=r.createObjectURL(i),o=new Image;o.onload=()=>{e(a)},o.src=a}))}cleanUp(t){return this._sandbox&&(document.body.removeChild(this._sandbox),this._sandbox=null),t}svgToImage(t,e,n,r){let i=t.node();Promise.resolve(i).then((t=>this.createSandbox(t))).then((t=>t.cloneNode(!1))).then((t=>this.cloneStyles(i,t,null))).then((t=>this.cloneChildren(i,t))).then((t=>this.convertToObjectUrl(t))).then((t=>this.cleanUp(t))).then((t=>this.triggerDownload(t,r))).catch((t=>{console.log("Failed to save chart as SVG image: "+t.message),console.log(t)}))}}class ci{constructor(){this._exportClass=null}setExportClass(t){switch(t){case"png":this._exportClass=ui;break;case"svg":this._exportClass=hi}}createExport(t){switch(this.setExportClass(t),t){case"png":case"svg":return new this._exportClass}}}class fi{constructor(t,e){this._element=t.append("svg"),this._defs=new ai(this._element),this._visual=null,this._zoom=null,this._div=null,this._configuration=e,this.init()}get defs(){return this._defs}get zoom(){return this._zoom}get visual(){return this._visual}get div(){return this._div}init(){this._element.attr("width","100%").attr("height","100%").attr("text-rendering","geometricPrecision").attr("text-anchor","middle").attr("xmlns:xlink","https://www.w3.org/1999/xlink"),new si(this._defs.get())}initEvents(t){this._element.on("contextmenu",(t=>t.preventDefault())).on("wheel",(e=>{e.ctrlKey||t.show(this._configuration.labels.zoom,300,(()=>{t.hide(700,800)}))})).on("touchend",(e=>{e.touches.length<2&&t.hide(0,800)})).on("touchmove",(e=>{e.touches.length>=2?t.hide():t.show(this._configuration.labels.move)})).on("click",(t=>this.doStopPropagation(t)),!0),this._configuration.rtl&&this._element.classed("rtl",!0);const e=gn("div.tooltip");e.empty()?this._div=gn("body").append("div").attr("class","tooltip").style("opacity",0):this._div=e.style("opacity",0),this._visual=this._element.append("g"),this._visual.append("g").attr("class","personGroup"),this._zoom=new oi(this._visual),this._element.call(this._zoom.get())}doStopPropagation(t){t.defaultPrevented&&t.stopPropagation()}export(t){return(new ci).createExport(t)}node(){return this._element.node()}select(t){return this._element.select(t)}selectAll(t){return this._element.selectAll(t)}style(t){return this._element.style(...arguments)}attr(t){return this._element.attr(...arguments)}transition(){return this._element.transition()}}const di=Math.PI/180,pi=180/Math.PI,gi=2*Math.PI;class mi{constructor(t){this._configuration=t}get startPi(){return 90===this._configuration.fanDegree?0:-this._configuration.fanDegree/2*di}get endPi(){return 90===this._configuration.fanDegree?this._configuration.fanDegree*di:this._configuration.fanDegree/2*di}get scale(){return ee().range([this.startPi,this.endPi])}innerRadius(t){return 0===t?0:t<=this._configuration.numberOfInnerCircles?(t-1)*this._configuration.innerArcHeight+this._configuration.centerCircleRadius+this._configuration.circlePadding:this._configuration.numberOfInnerCircles*this._configuration.innerArcHeight+(t-this._configuration.numberOfInnerCircles-1)*this._configuration.outerArcHeight+this._configuration.centerCircleRadius+this._configuration.circlePadding}outerRadius(t){return 0===t?this._configuration.centerCircleRadius:t<=this._configuration.numberOfInnerCircles?(t-1)*this._configuration.innerArcHeight+this._configuration.centerCircleRadius+this._configuration.innerArcHeight:this._configuration.numberOfInnerCircles*this._configuration.innerArcHeight+(t-this._configuration.numberOfInnerCircles-1)*this._configuration.outerArcHeight+this._configuration.centerCircleRadius+this._configuration.outerArcHeight}centerRadius(t){return(this.innerRadius(t)+this.outerRadius(t))/2}relativeRadius(t,e){const n=this.outerRadius(t);return n-(100-e)*(n-this.innerRadius(t))/100}calcAngle(t){return Math.max(this.startPi,Math.min(this.endPi,this.scale(t)))}startAngle(t,e){return 0===t?0:this.calcAngle(e)}endAngle(t,e){return 0===t?gi:this.calcAngle(e)}arcLength(t,e){return(this.endAngle(t.depth,t.x1)-this.startAngle(t.depth,t.x0))*this.relativeRadius(t.depth,e)}}let vi=null;class _i{constructor(t,e){this._svg=t,this._configuration=e,this._geometry=new mi(this._configuration)}createLabels(t,e){if(this.isInnerLabel(e)){const n=gn(t.node().parentNode).attr("id");if(this.createNamesData(e).forEach(((r,i)=>{const a=this.getAvailableWidth(e,i),o=this.createPathDefinition(n,i,e),s=t.append("text").append("textPath").attr("href","#"+o).attr("startOffset","25%");this.addNameElements(s,this.truncateNamesData(s,r,a))})),""!==e.data.data.alternativeName){const r=this.createPathDefinition(n,2,e),i=this.getAvailableWidth(e,2),a=this.createAlternativeNamesData(e),o=t.append("text").append("textPath").attr("href","#"+r).attr("startOffset","25%").classed("wt-chart-box-name-alt",!0).classed("rtl",e.data.data.isAltRtl);this.addNameElements(o,this.truncateNamesData(o,a,i))}if(""!==e.data.data.timespan){const r=this.createPathDefinition(n,3,e),i=t.append("text").append("textPath").attr("href","#"+r).attr("startOffset","25%").attr("class","date");i.append("title").text(e.data.data.timespan);const a=i.append("tspan").text(e.data.data.timespan),o=this.getAvailableWidth(e,3);this.getTextLength(i)>o&&(i.selectAll("tspan").each(this.truncateDate(i,o)),a.text(a.text()+"…"))}}else{if(e.depth>=7){const[n,...r]=this.createNamesData(e),i=this.getAvailableWidth(e,0),a=[].concat(n,void 0!==r[0]?r[0]:[]);let o=t.append("text").attr("dy","2px");this.addNameElements(o,this.truncateNamesData(o,a,i))}else{if(this.createNamesData(e).forEach(((n,r)=>{const i=this.getAvailableWidth(e,r),a=t.append("text").attr("dy","2px");this.addNameElements(a,this.truncateNamesData(a,n,i))})),""!==e.data.data.alternativeName){const n=this.getAvailableWidth(e,2),r=this.createAlternativeNamesData(e),i=t.append("text").attr("dy","5px").classed("wt-chart-box-name-alt",!0).classed("rtl",e.data.data.isAltRtl);this.addNameElements(i,this.truncateNamesData(i,r,n))}if(e.depth<6&&""!==e.data.data.timespan){const n=t.append("text").attr("class","date").attr("dy","7px");n.append("title").text(e.data.data.timespan);const r=n.append("tspan").text(e.data.data.timespan),i=this.getAvailableWidth(e,2);this.getTextLength(n)>i&&(n.selectAll("tspan").each(this.truncateDate(n,i)),r.text(r.text()+"…"))}}this.transformOuterText(t,e)}if(this._configuration.showParentMarriageDates&&e.children&&e.depth<5){const n=gn(t.node().parentNode).attr("id"),r=this.createPathDefinition(n,4,e),i=t.append("text").append("textPath").attr("href","#"+r).attr("startOffset","25%").attr("class","date");this.addMarriageDate(i,e)}}createNamesData(t){let e={},n=Number.MAX_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER,i=0,a=new Map;for(let e in t.data.data.firstNames){const r=t.data.data.name.indexOf(t.data.data.firstNames[e],i);-1!==r&&(i=r+t.data.data.firstNames[e].length,rt));let o=0,s=new Map;for(let e in t.data.data.lastNames){let n;do{n=t.data.data.name.indexOf(t.data.data.lastNames[e],o),-1!==n&&a.has(n)&&(o+=n+t.data.data.lastNames[e].length)}while(-1!==n&&a.has(n));-1!==n&&(o=n,nt)),Object.values(e)}createAlternativeNamesData(t){let e=t.data.data.alternativeName.split(/\s+/),n=[];return n=n.concat(e.map((e=>({label:e,isPreferred:!1,isLastName:!1,isNameRtl:t.data.data.isAltRtl})))),n}addNameElements(t,e){t.selectAll("tspan").data(e).enter().call((t=>{t.append("tspan").text((t=>t.label)).attr("dx",((t,e)=>0!==e?.25*(t.isNameRtl?-1:1)+"em":null)).attr("text-decoration",(t=>t.isPreferred?"underline":null)).classed("lastName",(t=>t.isLastName))}))}truncateNamesData(t,e,n){const r=t.style("font-size"),i=t.style("font-weight");return this.truncateNames(e,r,i,n)}addMarriageDate(t,e){e.data.data.marriageDateOfParents&&t.append("tspan").text("⚭ "+e.data.data.marriageDateOfParents)}truncateNames(t,e,n,r){let i=t.map((t=>t.label)).join(" ");return t.reverse().map((a=>(!1===a.isPreferred&&!1===a.isLastName&&this.measureText(i,e,n)>r&&(a.label=a.label.slice(0,1)+".",i=t.map((t=>t.label)).join(" ")),a))).map((a=>(!0===a.isPreferred&&this.measureText(i,e,n)>r&&(a.label=a.label.slice(0,1)+".",i=t.map((t=>t.label)).join(" ")),a))).map((a=>(!0===a.isLastName&&this.measureText(i,e,n)>r&&(a.label=a.label.slice(0,1)+".",i=t.map((t=>t.label)).join(" ")),a))).reverse()}measureText(t,e,n=400){return function(t,e,n,r=400){null===vi&&(vi=document.createElement("canvas"));const i=vi.getContext("2d"),a=`${r||""} ${n} ${e}`;return i.font!==a&&(i.font=a),i.measureText(t).width}(t,this._svg.style("font-family"),e,n)}truncateDate(t,e){let n=this;return function(){let r=n.getTextLength(t),i=gn(this),a=i.text();for(;r>e&&a.length>1;)a=a.slice(0,-1).trim(),i.text(a),r=n.getTextLength(t);"."===a[a.length-1]&&i.text(a.slice(0,-1).trim())}}getTextLength(t){let e=0;return t.selectAll("tspan").each((function(){e+=this.getComputedTextLength()})),e}isInnerLabel(t){return t.depth>0&&t.depth<=this._configuration.numberOfInnerCircles}createPathDefinition(t,e,n){let r="path-"+t+"-"+e;if(this._svg.defs.select("path#"+r).node())return r;let i=this.isPositionFlipped(n.depth,n.x0,n.x1),a=this._geometry.startAngle(n.depth,n.x0),o=this._geometry.endAngle(n.depth,n.x1),s=this._geometry.relativeRadius(n.depth,this.getTextOffset(i,e));this._configuration.showParentMarriageDates&&4===e&&n.depth<1&&(a=this._geometry.calcAngle(n.x0),o=this._geometry.calcAngle(n.x1));let l=tr().startAngle(i?o:a).endAngle(i?a:o).innerRadius(s).outerRadius(s);return l.padAngle(this._configuration.padAngle).padRadius(this._configuration.padRadius).cornerRadius(this._configuration.cornerRadius),this._svg.defs.append("path").attr("id",r).attr("d",l),r}isPositionFlipped(t,e,n){if(360!==this._configuration.fanDegree||t<=1)return!1;const r=this._geometry.startAngle(t,e),i=this._geometry.endAngle(t,n);return r>=90*di&&i<=180*di||r>=-180*di&&i<=-90*di}getTextOffset(t,e){return t?[23,40,62,84,125][e]:[73,56,34,12,120][e]}getAvailableWidth(t,e){if(t.depth>this._configuration.numberOfInnerCircles)return this._configuration.outerArcHeight-2*this._configuration.textPadding-this._configuration.circlePadding;let n=2*this._configuration.centerCircleRadius-.15*this._configuration.centerCircleRadius;if(t.depth>=1){let r=this.isPositionFlipped(t.depth,t.x0,t.x1);n=this._geometry.arcLength(t,this.getTextOffset(r,e))}return n-2*this._configuration.textPadding-this._configuration.padDistance/2}transformOuterText(t,e){let n=this,r=t.selectAll("text"),i=r.size(),a=1;switch(e.depth){case 0:case 5:a=1.5;break;case 1:a=6.5;break;case 2:a=3.5;break;case 3:a=2.2;break;case 4:a=1.9;break;case 6:a=.5}let o=ee().domain([0,i-1]).range([-a,a]);r.each((function(t,r){const i=o(r)*n._configuration.fontScale/100;0===e.depth?gn(this).attr("dy",15*i+7.5+"px"):gn(this).attr("transform",(function(){let t=e.x1-e.x0,r=n._geometry.scale(e.x0+t/2)*pi,a=r-i*(r>0?-1:1),o=n._geometry.centerRadius(e.depth)-n._configuration.colorArcWidth/2;return r>0?a-=90:(o=-o,a+=90),"rotate("+a+") translate("+o+")"}))}))}}class yi{constructor(t,e,n,r){this._svg=t,this._configuration=e,this._geometry=new mi(this._configuration),this.init(n,r)}init(t,e){if(t.classed("new")&&this._configuration.hideEmptySegments?this.addArcToPerson(t,e):t.classed("new")||t.classed("update")||t.classed("remove")||""===e.data.data.xref&&this._configuration.hideEmptySegments||this.addArcToPerson(t,e),""!==e.data.data.xref){this.addTitleToPerson(t,e.data.data.name);let n=new _i(this._svg,this._configuration),r=this.addLabelToPerson(t,e);n.createLabels(r,e),this.addColorGroup(t,e),t.on("contextmenu",((t,e)=>{this._svg.div.property("active")?(this._svg.div.transition().duration(200).style("opacity",0),this._svg.div.property("active",!1),t.preventDefault()):(this._svg.div.property("active",!0),this.setTooltipHtml(e),t.preventDefault())})).on("mouseenter",((t,e)=>{""===e.data.data.xref&&this._svg.div.style("opacity",0),this.setTooltipHtml(e)})).on("mouseleave",((t,e)=>{""===e.data.data.xref&&this._svg.div.style("opacity",0)})).on("mousemove",((t,e)=>{this._svg.div.style("left",t.pageX+"px").style("top",t.pageY-30+"px")})).on("mouseover",(function(e,n){const r=t.nodes(),i=r.indexOf(this);gn(r[i]).classed("hover",!0).raise()})).on("mouseout",(function(e,n){const r=t.nodes(),i=r.indexOf(this);gn(r[i]).classed("hover",!1)}))}}setTooltipHtml(t){if(""===t.data.data.xref)return;let e="";this._configuration.showImages&&(t.data.data.thumbnail?(e='
',e+='',e+="
"):this._configuration.showSilhouettes&&(e='
',e+='',e+="
"));const n=t.data.data.birth||t.data.data.marriageDate||t.data.data.death;this._svg.div.html(e+'
'+t.data.data.name+"
"+(n?""+(t.data.data.birth?'":"")+(t.data.data.marriageDate?'":"")+(t.data.data.death?'":"")+"
'+t.data.data.birth+"
'+t.data.data.marriageDate+"
'+t.data.data.death+"
":"")+"
").style("left",event.pageX+"px").style("top",event.pageY-30+"px"),this._svg.div.property("active")&&this._svg.div.transition().duration(200).style("opacity",1)}addColorGroup(t,e){let n=tr().startAngle(this._geometry.startAngle(e.depth,e.x0)).endAngle(this._geometry.endAngle(e.depth,e.x1)).innerRadius(this._geometry.outerRadius(e.depth)-this._configuration.colorArcWidth).outerRadius(this._geometry.outerRadius(e.depth)+1);n.padAngle(this._configuration.padAngle).padRadius(this._configuration.padRadius);let r=t.append("g").attr("class","color").append("path").attr("fill",(()=>this._configuration.showColorGradients?e.depth?"url(#grad-"+e.id+")":"rgb(225, 225, 225)":null)).attr("d",n);this._configuration.showColorGradients||r.attr("class",e.data.data.sex===ni?"female":e.data.data.sex===ei?"male":"unknown")}addArcToPerson(t,e){let n=tr().startAngle(this._geometry.startAngle(e.depth,e.x0)).endAngle(this._geometry.endAngle(e.depth,e.x1)).innerRadius(this._geometry.innerRadius(e.depth)).outerRadius(this._geometry.outerRadius(e.depth));n.padAngle(this._configuration.padAngle).padRadius(this._configuration.padRadius).cornerRadius(this._configuration.cornerRadius);let r=t.append("g").attr("class","arc").append("path").attr("d",n);t.classed("new")&&r.style("opacity",1e-6)}addTitleToPerson(t,e){t.insert("title",":first-child").text(e)}addLabelToPerson(t,e){return t.append("g").attr("class","wt-chart-box-name name").style("font-size",this.getFontSize(e)+"px")}getFontSize(t){let e=this._configuration.fontSize;return t.depth>=this._configuration.numberOfInnerCircles+1&&(e+=1),(e-t.depth)*this._configuration.fontScale/100}}class wi{constructor(t,e){this._svg=t,this._configuration=e}init(t){if(t.depth<1)return;if(1===t.depth){let e=[64,143,222],n=[161,219,117];t.data.data.sex===ni&&(e=[218,102,13],n=[235,201,33]),t.data.data.colors=[e,n]}else{let e=[Math.ceil((t.parent.data.data.colors[0][0]+t.parent.data.data.colors[1][0])/2),Math.ceil((t.parent.data.data.colors[0][1]+t.parent.data.data.colors[1][1])/2),Math.ceil((t.parent.data.data.colors[0][2]+t.parent.data.data.colors[1][2])/2)];t.data.data.sex===ei&&(t.data.data.colors=[t.parent.data.data.colors[0],e]),t.data.data.sex===ni&&(t.data.data.colors=[e,t.parent.data.data.colors[1]])}let e=this._svg.defs.append("svg:linearGradient").attr("id","grad-"+t.id);e.append("svg:stop").attr("offset","0%").attr("stop-color","rgb("+t.data.data.colors[0].join(",")+")"),e.append("svg:stop").attr("offset","100%").attr("stop-color","rgb("+t.data.data.colors[1].join(",")+")")}}class xi{constructor(t,e,n){this._svg=t,this._configuration=e,this._hierarchy=n}update(t,n){let r=this;this._svg.selectAll("g.person").classed("hover",!1).on("click",null).on("mouseover",null).on("mouseout",null),function(t,n){return fetch(t,n).then(e)}(t).then((t=>{this._hierarchy.init(t.data),this._svg.selectAll("g.person").data(this._hierarchy.nodes,(t=>t.id)).each((function(t){let e=""===t.data.data.xref,n=gn(this);n.classed("remove",e).classed("update",!e&&n.classed("available")).classed("new",!e&&!n.classed("available")),n.classed("new")||n.selectAll("g.name, g.color, title").classed("old",!0),new yi(r._svg,r._configuration,n,t)})),this._svg.selectAll("g.person:not(.remove)").selectAll("g.name:not(.old), g.color:not(.old)").style("opacity",1e-6);let e=zr().duration(this._configuration.updateDuration).call(this.endAll,(()=>this.updateDone(n)));this._svg.selectAll("g.person.remove g.arc path").transition(e).style("fill",(()=>this._configuration.hideEmptySegments?null:"rgb(235, 235, 235)")).style("opacity",(()=>this._configuration.hideEmptySegments?1e-6:null)),this._svg.selectAll("g.person.new g.arc path").transition(e).style("fill","rgb(250, 250, 250)").style("opacity",(()=>this._configuration.hideEmptySegments?1:null)),this._svg.selectAll("g.person.update, g.person.remove").selectAll("g.name.old, g.color.old").transition(e).style("opacity",1e-6),this._svg.selectAll("g.person:not(.remove)").selectAll("g.name:not(.old), g.color:not(.old)").transition(e).style("opacity",1)}))}updateDone(t){this._configuration.hideEmptySegments&&this._svg.selectAll("g.person.remove").selectAll("g.arc").remove();let e=$n((()=>{this._svg.selectAll("g.person g.arc path").attr("style",null),this._svg.selectAll("g.person g.name, g.person g.color").style("opacity",null),e.stop()}),10);this._svg.selectAll("g.person.new, g.person.update, g.person.remove").classed("new",!1).classed("update",!1).classed("remove",!1).selectAll("g.name.old, g.color.old, title.old").remove(),this._svg.selectAll("g.person.available").classed("available",!1),t()}endAll(t,e){let n=0;t.on("start",(()=>++n)).on("end",(()=>{--n||e.apply(t)}))}}class bi{constructor(t,e){this._configuration=e,this._parent=t,this._hierarchy=new ri(this._configuration),this._data={}}get svg(){return this._svg}get parent(){return this._parent}get data(){return this._data}set data(t){this._data=t,this._hierarchy.init(this._data)}convertRemToPixels(t){return t*parseFloat(window.getComputedStyle(document.documentElement).fontSize)}updateViewBox(){this.svg.attr("width","100%").attr("height","100%");const t=this.convertRemToPixels(1);let e=this.svg.visual.node().getBBox(),n=this.parent.node().getBoundingClientRect(),r=Math.max(n.width,e.width),i=Math.max(n.height,e.height);document.fullscreenElement&&(r=Math.max(e.width,Math.min(n.width,e.width)),i=Math.max(e.height,Math.min(n.height,e.height)));let a=r-e.width>>1,o=i-e.height>>1,s=Math.ceil(e.x-a-t),l=Math.ceil(e.y-o-t);if(document.fullscreenElement){const e=32,r=e+this.convertRemToPixels(2);l+=e-(t<<1),this.svg.attr("width",n.width).attr("height",n.height-r)}r=Math.ceil(r+(t<<1)),i=Math.ceil(i+(t<<1)),this.svg.attr("viewBox",[s,l,r,i])}center(){this.svg.transition().duration(750).call(this.svg.zoom.get().transform,Gr)}draw(){this._parent.html(""),this._svg=new fi(this._parent,this._configuration),this._overlay=new ii(this._parent),this._svg.initEvents(this._overlay);let t=this._svg.select("g.personGroup"),e=new wi(this._svg,this._configuration),n=this;t.selectAll("g.person").data(this._hierarchy.nodes,(t=>t.id)).enter().filter((t=>""!==t.data.data.xref||!this._configuration.hideEmptySegments)).append("g").attr("class","person").attr("id",(t=>"person-"+t.id)),t.selectAll("g.person").each((function(t){let r=gn(this);n._configuration.showColorGradients&&e.init(t),new yi(n._svg,n._configuration,r,t)})),this.updateViewBox(),this.bindClickEventListener()}bindClickEventListener(){let t=this._svg.select("g.personGroup").selectAll("g.person").filter((t=>""!==t.data.data.xref)).classed("available",!0);t.on("click",this.personClick.bind(this))}personClick(t,e){0===e.depth?this.redirectToIndividual(e.data.data.url):this.update(e.data.data.updateUrl)}redirectToIndividual(t){window.open(t,"_blank")}update(t){new xi(this._svg,this._configuration,this._hierarchy).update(t,(()=>this.bindClickEventListener()))}}t.FanChart=class{constructor(t,e){this._selector=t,this._parent=gn(this._selector),this._configuration=new ti(e.labels,e.generations,e.fanDegree,e.fontScale,e.hideEmptySegments,e.showColorGradients,e.showParentMarriageDates,e.showImages,e.showSilhouettes,e.rtl,e.innerArcs),this._cssFiles=e.cssFiles,this._chart=new bi(this._parent,this._configuration),this.init(),this.draw(e.data)}get configuration(){return this._configuration}init(){gn("#centerButton").on("click",(()=>this._chart.center())),gn("#exportPNG").on("click",(()=>this.exportPNG())),gn("#exportSVG").on("click",(()=>this.exportSVG())),this.addEventListeners()}addEventListeners(){document.addEventListener("fullscreenchange",(()=>{document.fullscreenElement?document.body.setAttribute("fullscreen",""):document.body.removeAttribute("fullscreen"),this._chart.updateViewBox()})),screen.orientation.addEventListener("change",(()=>{this._chart.updateViewBox()}))}update(t){this._chart.update(t)}draw(t){this._chart.data=t,this._chart.draw()}exportPNG(){this._chart.svg.export("png").svgToImage(this._chart.svg,"fan-chart.png")}exportSVG(){this._chart.svg.export("svg").svgToImage(this._chart.svg,this._cssFiles,"webtrees-fan-chart-container","fan-chart.svg")}}},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WebtreesFanChart={}); diff --git a/src/Module.php b/src/Module.php index 5a60fd5..817cdca 100644 --- a/src/Module.php +++ b/src/Module.php @@ -66,7 +66,7 @@ class Module extends FanChartModule implements ModuleCustomInterface, ModuleConf /** * @var string */ - public const CUSTOM_VERSION = '2.7.2'; + public const CUSTOM_VERSION = '3.0.0'; /** * @var string