Last modified by Veronika Kocher on Friday, 04 Sep 2026 14:45

From version 5.10
edited by Veronika Kocher
on Thursday, 03 Sep 2026 10:09
Change comment: There is no comment for this version
To version 5.7
edited by Veronika Kocher
on Wednesday, 02 Sep 2026 13:13
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -261,1120 +261,3 @@
261 261  </div>
262 262  {{/html}}
263 263  
264 -\n\n
265 -\n\n{{html clean="false"}}
266 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_START -->
267 -
268 -<style data-sn-horizontal-box-harmonizer="7">
269 -/* ---------- Typography: never justify headings ---------- */
270 -#xwikicontent h1,
271 -#xwikicontent h2,
272 -#xwikicontent h3,
273 -#xwikicontent h4,
274 -#xwikicontent h5,
275 -#xwikicontent h6,
276 -#xwikicontent .box-title,
277 -#xwikicontent [role="heading"],
278 -#xwikicontent h1 a,
279 -#xwikicontent h2 a,
280 -#xwikicontent h3 a,
281 -#xwikicontent h4 a,
282 -#xwikicontent h5 a,
283 -#xwikicontent h6 a,
284 -#xwikicontent .box-title a,
285 -#xwikicontent [role="heading"] a{
286 - text-align:left!important;
287 - text-justify:auto!important;
288 - word-spacing:normal!important;
289 -}
290 -
291 -/* ---------- Native XWiki semantic callouts ---------- */
292 -#xwikicontent .box.infomessage,
293 -#xwikicontent .infomessage,
294 -#xwikicontent .box.warningmessage,
295 -#xwikicontent .warningmessage,
296 -#xwikicontent .box.successmessage,
297 -#xwikicontent .successmessage,
298 -#xwikicontent .box.errormessage,
299 -#xwikicontent .errormessage,
300 -#xwikicontent [data-sn-callout-harmonized="1"]{
301 - box-sizing:border-box!important;
302 - border-radius:8px!important;
303 - border-top:1px solid rgba(0,0,0,.08)!important;
304 - border-right:1px solid rgba(0,0,0,.08)!important;
305 - border-bottom:1px solid rgba(0,0,0,.08)!important;
306 - border-left:4px solid var(--sn-callout-accent,#21b6d7)!important;
307 - padding:14px 16px!important;
308 - text-align:left!important;
309 - text-justify:auto!important;
310 - word-spacing:normal!important;
311 - box-shadow:none!important;
312 -}
313 -
314 -#xwikicontent .box.infomessage,
315 -#xwikicontent .infomessage{
316 - --sn-callout-accent:#21b6d7;
317 - background:#eaf7fb!important;
318 -}
319 -
320 -#xwikicontent .box.warningmessage,
321 -#xwikicontent .warningmessage{
322 - --sn-callout-accent:#f0aa00;
323 - background:#fff8e7!important;
324 -}
325 -
326 -#xwikicontent .box.successmessage,
327 -#xwikicontent .successmessage{
328 - --sn-callout-accent:#38b76a;
329 - background:#edf9f1!important;
330 -}
331 -
332 -#xwikicontent .box.errormessage,
333 -#xwikicontent .errormessage{
334 - --sn-callout-accent:#e94b13;
335 - background:#fff1ec!important;
336 -}
337 -
338 -#xwikicontent [data-sn-callout-harmonized="1"] > :first-child,
339 -#xwikicontent .infomessage > :first-child,
340 -#xwikicontent .warningmessage > :first-child,
341 -#xwikicontent .successmessage > :first-child,
342 -#xwikicontent .errormessage > :first-child{
343 - margin-top:0!important;
344 -}
345 -
346 -#xwikicontent [data-sn-callout-harmonized="1"] > :last-child,
347 -#xwikicontent .infomessage > :last-child,
348 -#xwikicontent .warningmessage > :last-child,
349 -#xwikicontent .successmessage > :last-child,
350 -#xwikicontent .errormessage > :last-child{
351 - margin-bottom:0!important;
352 -}
353 -
354 -#xwikicontent [data-sn-equal-height-managed],
355 -#xwikicontent [data-sn-first-section-aligned],
356 -#xwikicontent [data-sn-first-content-aligned]{
357 - box-sizing:border-box;
358 -}
359 -</style>
360 -
361 -<script data-sn-horizontal-box-harmonizer="7">
362 -(function(){
363 - "use strict";
364 -
365 - var MOBILE_MAX=767;
366 - var ROW_TOLERANCE=6;
367 - var MIN_W=150;
368 - var MIN_H=36;
369 - var MAX_PARENT_CHILDREN=18;
370 - var SEARCH_DEPTH=5;
371 - var RESIZE_DEBOUNCE=220;
372 - var MIN_WIDTH_CHANGE=2;
373 -
374 - var root=
375 - document.getElementById("xwikicontent")||
376 - document.querySelector(".xwiki-rendering-content")||
377 - document.querySelector("main")||
378 - document.body;
379 -
380 - if(!root)return;
381 -
382 - var heightManaged=new Set();
383 - var sectionManaged=new Set();
384 - var contentManaged=new Set();
385 -
386 - var originalMinHeight=new WeakMap();
387 - var originalMarginTop=new WeakMap();
388 -
389 - var resizeTimer=0;
390 - var lastWidth=-1;
391 - var hasApplied=false;
392 - var applying=false;
393 -
394 - function num(v){
395 - var n=parseFloat(v);
396 - return Number.isFinite(n)?n:0;
397 - }
398 -
399 - function visible(el,minW,minH){
400 - if(!el||el.nodeType!==1)return false;
401 -
402 - var s=getComputedStyle(el);
403 -
404 - if(
405 - s.display==="none"||
406 - s.visibility==="hidden"||
407 - Number(s.opacity)===0
408 - ){
409 - return false;
410 - }
411 -
412 - var r=el.getBoundingClientRect();
413 -
414 - return (
415 - r.width>=(minW||1)&&
416 - r.height>=(minH||1)
417 - );
418 - }
419 -
420 - function normalizeText(text){
421 - return String(text||"")
422 - .replace(/\s+/g," ")
423 - .trim()
424 - .toUpperCase();
425 - }
426 -
427 - function excluded(el){
428 - return (
429 - !el.matches||
430 - el.matches(
431 - "button,input,select,textarea,option,label,img,svg,canvas,table,thead,tbody,tfoot,tr,td,th,summary,script,style,noscript,template,.btn,.chip,[role=button]"
432 - )
433 - );
434 - }
435 -
436 - /* ---------- Custom coloured callouts ---------- */
437 -
438 - function nativeCallout(el){
439 - var c=
440 - typeof el.className==="string"
441 - ? el.className.toLowerCase()
442 - : "";
443 -
444 - return (
445 - /(^|\s)(infomessage|warningmessage|successmessage|errormessage)(\s|$)/.test(c)
446 - );
447 - }
448 -
449 - function customCallout(el){
450 - if(!visible(el,220,42)||excluded(el))return false;
451 -
452 - var r=el.getBoundingClientRect();
453 -
454 - if(r.height>520)return false;
455 -
456 - var s=getComputedStyle(el);
457 -
458 - var bg=
459 - s.backgroundColor&&
460 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
461 - s.backgroundColor!=="transparent"&&
462 - s.backgroundColor!=="rgb(255, 255, 255)";
463 -
464 - var left=
465 - num(s.borderLeftWidth);
466 -
467 - return (
468 - bg&&
469 - left>=2
470 - );
471 - }
472 -
473 - function harmoniseCustomCallouts(){
474 - Array.from(
475 - root.querySelectorAll(
476 - "div,aside,section"
477 - )
478 - ).forEach(function(el){
479 - if(nativeCallout(el))return;
480 - if(!customCallout(el))return;
481 -
482 - var s=getComputedStyle(el);
483 -
484 - el.setAttribute(
485 - "data-sn-callout-harmonized",
486 - "1"
487 - );
488 -
489 - if(
490 - s.borderLeftColor
491 - ){
492 - el.style.setProperty(
493 - "--sn-callout-accent",
494 - s.borderLeftColor
495 - );
496 - }
497 - });
498 - }
499 -
500 - /* ---------- Restore only values V7 itself changed ---------- */
501 -
502 - function saveOriginal(el,map,property){
503 - if(map.has(el))return;
504 -
505 - map.set(el,{
506 - value:
507 - el.style.getPropertyValue(
508 - property
509 - ),
510 - priority:
511 - el.style.getPropertyPriority(
512 - property
513 - )
514 - });
515 - }
516 -
517 - function restoreOriginal(el,map,property){
518 - var original=map.get(el);
519 -
520 - if(original&&original.value){
521 - el.style.setProperty(
522 - property,
523 - original.value,
524 - original.priority||""
525 - );
526 - }else{
527 - el.style.removeProperty(
528 - property
529 - );
530 - }
531 - }
532 -
533 - function resetRuntime(){
534 - heightManaged.forEach(function(el){
535 - restoreOriginal(
536 - el,
537 - originalMinHeight,
538 - "min-height"
539 - );
540 -
541 - el.removeAttribute(
542 - "data-sn-equal-height-managed"
543 - );
544 - });
545 -
546 - sectionManaged.forEach(function(el){
547 - restoreOriginal(
548 - el,
549 - originalMarginTop,
550 - "margin-top"
551 - );
552 -
553 - el.removeAttribute(
554 - "data-sn-first-section-aligned"
555 - );
556 - });
557 -
558 - contentManaged.forEach(function(el){
559 - restoreOriginal(
560 - el,
561 - originalMarginTop,
562 - "margin-top"
563 - );
564 -
565 - el.removeAttribute(
566 - "data-sn-first-content-aligned"
567 - );
568 - });
569 -
570 - heightManaged.clear();
571 - sectionManaged.clear();
572 - contentManaged.clear();
573 - }
574 -
575 - /* ---------- Card detection ---------- */
576 -
577 - function namedLikeBox(el){
578 - var c=
579 - typeof el.className==="string"
580 - ? el.className
581 - : "";
582 -
583 - return /(^|[\s_-])(box|card|tile|panel|role|check|service|source|call|area|detail|resource|topic|warn|info)([\s_-]|$)/i.test(c);
584 - }
585 -
586 - function boxLike(el){
587 - if(
588 - !visible(el,MIN_W,MIN_H)||
589 - excluded(el)
590 - ){
591 - return false;
592 - }
593 -
594 - var s=getComputedStyle(el);
595 - var r=el.getBoundingClientRect();
596 -
597 - var border=
598 - num(s.borderTopWidth)+
599 - num(s.borderRightWidth)+
600 - num(s.borderBottomWidth)+
601 - num(s.borderLeftWidth);
602 -
603 - var radius=Math.max(
604 - num(s.borderTopLeftRadius),
605 - num(s.borderTopRightRadius),
606 - num(s.borderBottomLeftRadius),
607 - num(s.borderBottomRightRadius)
608 - );
609 -
610 - var bg=
611 - s.backgroundColor&&
612 - s.backgroundColor!=="rgba(0, 0, 0, 0)"&&
613 - s.backgroundColor!=="transparent";
614 -
615 - var shadow=
616 - s.boxShadow&&
617 - s.boxShadow!=="none";
618 -
619 - return (
620 - namedLikeBox(el)||
621 - border>=1||
622 - (bg&&radius>=3)||
623 - (shadow&&r.width>=180)
624 - );
625 - }
626 -
627 - function pickTarget(child){
628 - if(!visible(child,MIN_W,MIN_H))return null;
629 -
630 - if(boxLike(child))return child;
631 -
632 - var cr=child.getBoundingClientRect();
633 - var q=[];
634 -
635 - Array.from(child.children||[]).forEach(function(el){
636 - q.push({el:el,depth:1});
637 - });
638 -
639 - var best=null;
640 - var bestScore=-Infinity;
641 -
642 - while(q.length){
643 - var item=q.shift();
644 - var el=item.el;
645 -
646 - if(!visible(el,MIN_W,MIN_H))continue;
647 -
648 - var r=el.getBoundingClientRect();
649 -
650 - if(
651 - r.width>=cr.width*.68&&
652 - boxLike(el)
653 - ){
654 - var widthFit=
655 - 1-Math.min(
656 - 1,
657 - Math.abs(cr.width-r.width)/
658 - Math.max(1,cr.width)
659 - );
660 -
661 - var topFit=
662 - 1-Math.min(
663 - 1,
664 - Math.abs(cr.top-r.top)/100
665 - );
666 -
667 - var score=
668 - widthFit*6+
669 - topFit*3+
670 - Math.min(r.height,900)/450+
671 - Math.min(r.width*r.height,900000)/900000;
672 -
673 - if(score>bestScore){
674 - best=el;
675 - bestScore=score;
676 - }
677 - }
678 -
679 - if(item.depth<SEARCH_DEPTH){
680 - Array.from(el.children||[]).forEach(function(next){
681 - q.push({
682 - el:next,
683 - depth:item.depth+1
684 - });
685 - });
686 - }
687 - }
688 -
689 - return best;
690 - }
691 -
692 - function groupRows(entries){
693 - var groups=[];
694 -
695 - entries
696 - .slice()
697 - .sort(function(a,b){
698 - return (
699 - a.rect.top-b.rect.top||
700 - a.rect.left-b.rect.left
701 - );
702 - })
703 - .forEach(function(entry){
704 - var group=null;
705 -
706 - for(var i=0;i<groups.length;i++){
707 - if(
708 - Math.abs(
709 - groups[i].top-
710 - entry.rect.top
711 - )<=ROW_TOLERANCE
712 - ){
713 - group=groups[i];
714 - break;
715 - }
716 - }
717 -
718 - if(!group){
719 - group={
720 - top:entry.rect.top,
721 - entries:[]
722 - };
723 - groups.push(group);
724 - }
725 -
726 - group.entries.push(entry);
727 - });
728 -
729 - return groups;
730 - }
731 -
732 - function validRow(group){
733 - if(group.entries.length<2)return false;
734 -
735 - var lefts=
736 - group.entries
737 - .map(function(e){return e.rect.left;})
738 - .sort(function(a,b){return a-b;});
739 -
740 - if(
741 - lefts[lefts.length-1]-
742 - lefts[0]<
743 - 80
744 - ){
745 - return false;
746 - }
747 -
748 - var widths=
749 - group.entries
750 - .map(function(e){return e.rect.width;})
751 - .filter(function(w){return w>0;});
752 -
753 - if(widths.length<2)return false;
754 -
755 - var minW=
756 - Math.min.apply(Math,widths);
757 -
758 - var maxW=
759 - Math.max.apply(Math,widths);
760 -
761 - return (
762 - maxW/
763 - Math.max(1,minW)<=
764 - 1.9
765 - );
766 - }
767 -
768 - /* ---------- Known ARSN first section bars ---------- */
769 -
770 - function knownBar(el){
771 - var text=
772 - normalizeText(
773 - el.textContent
774 - );
775 -
776 - return (
777 - text==="HIER STARTEN"||
778 - text==="ORGANISIEREN & DOKUMENTIEREN"||
779 - text==="ENTSCHEIDEN"||
780 - text==="START HERE"||
781 - text==="GET STARTED"||
782 - text==="ORGANISE & DOCUMENT"||
783 - text==="ORGANIZE & DOCUMENT"||
784 - text==="DECIDE"
785 - );
786 - }
787 -
788 - function findKnownBar(card){
789 - var cardRect=
790 - card.getBoundingClientRect();
791 -
792 - var rows=
793 - Array.from(
794 - card.querySelectorAll(
795 - "div,p,span,strong,h3,h4,h5,h6"
796 - )
797 - )
798 - .filter(function(el){
799 - if(!visible(el,20,6))return false;
800 - if(!knownBar(el))return false;
801 -
802 - var r=el.getBoundingClientRect();
803 -
804 - var rel=
805 - r.top-
806 - cardRect.top;
807 -
808 - return (
809 - rel>=35&&
810 - rel<=
811 - cardRect.height*.75
812 - );
813 - })
814 - .sort(function(a,b){
815 - return (
816 - a.getBoundingClientRect().top-
817 - b.getBoundingClientRect().top
818 - );
819 - });
820 -
821 - return rows[0]||null;
822 - }
823 -
824 - function alignKnownBars(cards){
825 - var rows=
826 - cards.map(function(card){
827 - var bar=
828 - findKnownBar(card);
829 -
830 - if(!bar)return null;
831 -
832 - var cr=
833 - card.getBoundingClientRect();
834 -
835 - var br=
836 - bar.getBoundingClientRect();
837 -
838 - return {
839 - bar:bar,
840 - relativeTop:
841 - br.top-
842 - cr.top
843 - };
844 - });
845 -
846 - if(
847 - rows.some(function(row){
848 - return !row;
849 - })
850 - ){
851 - return false;
852 - }
853 -
854 - var target=
855 - Math.max.apply(
856 - Math,
857 - rows.map(function(row){
858 - return row.relativeTop;
859 - })
860 - );
861 -
862 - rows.forEach(function(row){
863 - var delta=
864 - target-
865 - row.relativeTop;
866 -
867 - if(delta<=1)return;
868 -
869 - saveOriginal(
870 - row.bar,
871 - originalMarginTop,
872 - "margin-top"
873 - );
874 -
875 - var current=
876 - num(
877 - getComputedStyle(
878 - row.bar
879 - ).marginTop
880 - );
881 -
882 - row.bar.style.setProperty(
883 - "margin-top",
884 - (
885 - current+
886 - delta
887 - )+"px"
888 - );
889 -
890 - row.bar.setAttribute(
891 - "data-sn-first-section-aligned",
892 - "7"
893 - );
894 -
895 - sectionManaged.add(
896 - row.bar
897 - );
898 - });
899 -
900 - return true;
901 - }
902 -
903 - /* ---------- Generic first content after heading ---------- */
904 -
905 - function heading(card){
906 - var cr=
907 - card.getBoundingClientRect();
908 -
909 - var rows=
910 - Array.from(
911 - card.querySelectorAll(
912 - "h1,h2,h3,h4,h5,h6,.box-title,[role=heading]"
913 - )
914 - )
915 - .filter(function(el){
916 - if(!visible(el,20,8))return false;
917 -
918 - var r=el.getBoundingClientRect();
919 -
920 - var rel=
921 - r.top-
922 - cr.top;
923 -
924 - return (
925 - rel>=0&&
926 - rel<=
927 - Math.min(
928 - 160,
929 - cr.height*.45
930 - )
931 - );
932 - })
933 - .sort(function(a,b){
934 - return (
935 - a.getBoundingClientRect().top-
936 - b.getBoundingClientRect().top
937 - );
938 - });
939 -
940 - return rows[0]||null;
941 - }
942 -
943 - function firstContent(card,h){
944 - if(!h)return null;
945 -
946 - var cr=
947 - card.getBoundingClientRect();
948 -
949 - var hr=
950 - h.getBoundingClientRect();
951 -
952 - var rows=
953 - Array.from(
954 - card.querySelectorAll(
955 - "p,div,ul,ol,dl,blockquote"
956 - )
957 - )
958 - .filter(function(el){
959 - if(
960 - el===h||
961 - h.contains(el)||
962 - el.contains(h)
963 - ){
964 - return false;
965 - }
966 -
967 - if(!visible(el,30,8))return false;
968 -
969 - var text=
970 - String(el.textContent||"")
971 - .replace(/\s+/g," ")
972 - .trim();
973 -
974 - if(text.length<3)return false;
975 -
976 - var r=el.getBoundingClientRect();
977 -
978 - if(
979 - r.top<
980 - hr.bottom-1
981 - ){
982 - return false;
983 - }
984 -
985 - if(
986 - r.top-cr.top>
987 - Math.min(
988 - 280,
989 - cr.height*.65
990 - )
991 - ){
992 - return false;
993 - }
994 -
995 - if(
996 - r.height>
997 - cr.height*.58
998 - ){
999 - return false;
1000 - }
1001 -
1002 - return true;
1003 - })
1004 - .sort(function(a,b){
1005 - var ar=
1006 - a.getBoundingClientRect();
1007 -
1008 - var br=
1009 - b.getBoundingClientRect();
1010 -
1011 - return (
1012 - ar.top-br.top||
1013 - ar.height-br.height
1014 - );
1015 - });
1016 -
1017 - return rows[0]||null;
1018 - }
1019 -
1020 - function alignGeneric(cards){
1021 - var rows=
1022 - cards.map(function(card){
1023 - var h=
1024 - heading(card);
1025 -
1026 - var c=
1027 - firstContent(
1028 - card,
1029 - h
1030 - );
1031 -
1032 - if(!h||!c)return null;
1033 -
1034 - var cr=
1035 - card.getBoundingClientRect();
1036 -
1037 - var rr=
1038 - c.getBoundingClientRect();
1039 -
1040 - return {
1041 - content:c,
1042 - relativeTop:
1043 - rr.top-cr.top
1044 - };
1045 - });
1046 -
1047 - if(
1048 - rows.some(function(row){
1049 - return !row;
1050 - })
1051 - ){
1052 - return false;
1053 - }
1054 -
1055 - var target=
1056 - Math.max.apply(
1057 - Math,
1058 - rows.map(function(row){
1059 - return row.relativeTop;
1060 - })
1061 - );
1062 -
1063 - rows.forEach(function(row){
1064 - var delta=
1065 - target-
1066 - row.relativeTop;
1067 -
1068 - if(delta<=1)return;
1069 -
1070 - saveOriginal(
1071 - row.content,
1072 - originalMarginTop,
1073 - "margin-top"
1074 - );
1075 -
1076 - var current=
1077 - num(
1078 - getComputedStyle(
1079 - row.content
1080 - ).marginTop
1081 - );
1082 -
1083 - row.content.style.setProperty(
1084 - "margin-top",
1085 - (
1086 - current+
1087 - delta
1088 - )+"px"
1089 - );
1090 -
1091 - row.content.setAttribute(
1092 - "data-sn-first-content-aligned",
1093 - "7"
1094 - );
1095 -
1096 - contentManaged.add(
1097 - row.content
1098 - );
1099 - });
1100 -
1101 - return true;
1102 - }
1103 -
1104 - function applyRow(group){
1105 - if(!validRow(group))return false;
1106 -
1107 - var cards=[];
1108 - var seen=new Set();
1109 -
1110 - group.entries.forEach(function(entry){
1111 - if(!seen.has(entry.target)){
1112 - seen.add(entry.target);
1113 - cards.push(entry.target);
1114 - }
1115 - });
1116 -
1117 - if(cards.length<2)return false;
1118 -
1119 - if(
1120 - !alignKnownBars(cards)
1121 - ){
1122 - alignGeneric(cards);
1123 - }
1124 -
1125 - var maxHeight=0;
1126 -
1127 - cards.forEach(function(card){
1128 - maxHeight=
1129 - Math.max(
1130 - maxHeight,
1131 - card.getBoundingClientRect().height
1132 - );
1133 - });
1134 -
1135 - maxHeight=
1136 - Math.ceil(
1137 - maxHeight
1138 - );
1139 -
1140 - if(maxHeight<MIN_H)return false;
1141 -
1142 - cards.forEach(function(card){
1143 - saveOriginal(
1144 - card,
1145 - originalMinHeight,
1146 - "min-height"
1147 - );
1148 -
1149 - card.style.setProperty(
1150 - "min-height",
1151 - maxHeight+"px"
1152 - );
1153 -
1154 - card.setAttribute(
1155 - "data-sn-equal-height-managed",
1156 - "7"
1157 - );
1158 -
1159 - heightManaged.add(card);
1160 - });
1161 -
1162 - return true;
1163 - }
1164 -
1165 - function calculate(force){
1166 - if(applying)return;
1167 -
1168 - var width=
1169 - Math.round(
1170 - window.innerWidth
1171 - );
1172 -
1173 - var meaningful=
1174 - lastWidth<0||
1175 - Math.abs(
1176 - width-
1177 - lastWidth
1178 - )>=
1179 - MIN_WIDTH_CHANGE;
1180 -
1181 - if(
1182 - hasApplied&&
1183 - !force&&
1184 - !meaningful
1185 - ){
1186 - return;
1187 - }
1188 -
1189 - applying=true;
1190 -
1191 - try{
1192 - harmoniseCustomCallouts();
1193 -
1194 - if(width<=MOBILE_MAX){
1195 - if(hasApplied){
1196 - resetRuntime();
1197 - }
1198 -
1199 - hasApplied=false;
1200 - lastWidth=width;
1201 - return;
1202 - }
1203 -
1204 - if(hasApplied){
1205 - resetRuntime();
1206 - }
1207 -
1208 - var parents=
1209 - Array.from(
1210 - root.querySelectorAll("*")
1211 - )
1212 - .filter(function(parent){
1213 - return (
1214 - visible(
1215 - parent,
1216 - MIN_W,
1217 - MIN_H
1218 - )&&
1219 - parent.children&&
1220 - parent.children.length>=2&&
1221 - parent.children.length<=
1222 - MAX_PARENT_CHILDREN
1223 - );
1224 - });
1225 -
1226 - var touched=
1227 - new Set();
1228 -
1229 - parents.forEach(function(parent){
1230 - var entries=[];
1231 -
1232 - Array.from(
1233 - parent.children
1234 - ).forEach(function(child){
1235 - if(
1236 - !visible(
1237 - child,
1238 - MIN_W,
1239 - MIN_H
1240 - )
1241 - ){
1242 - return;
1243 - }
1244 -
1245 - var target=
1246 - pickTarget(child);
1247 -
1248 - if(!target)return;
1249 -
1250 - entries.push({
1251 - target:target,
1252 - rect:
1253 - target.getBoundingClientRect()
1254 - });
1255 - });
1256 -
1257 - groupRows(
1258 - entries
1259 - ).forEach(function(group){
1260 - if(!validRow(group))return;
1261 -
1262 - var targets=
1263 - group.entries.map(function(entry){
1264 - return entry.target;
1265 - });
1266 -
1267 - if(
1268 - !targets.some(function(el){
1269 - return !touched.has(el);
1270 - })
1271 - ){
1272 - return;
1273 - }
1274 -
1275 - if(applyRow(group)){
1276 - targets.forEach(function(el){
1277 - touched.add(el);
1278 - });
1279 - }
1280 - });
1281 - });
1282 -
1283 - lastWidth=width;
1284 - hasApplied=true;
1285 - }finally{
1286 - applying=false;
1287 - }
1288 - }
1289 -
1290 - function resize(){
1291 - if(resizeTimer){
1292 - clearTimeout(
1293 - resizeTimer
1294 - );
1295 - }
1296 -
1297 - resizeTimer=
1298 - setTimeout(
1299 - function(){
1300 - resizeTimer=0;
1301 - calculate(false);
1302 - },
1303 - RESIZE_DEBOUNCE
1304 - );
1305 - }
1306 -
1307 - function waitImages(){
1308 - var images=
1309 - Array.from(
1310 - root.querySelectorAll("img")
1311 - );
1312 -
1313 - return Promise.all(
1314 - images.map(function(img){
1315 - if(img.complete){
1316 - return Promise.resolve();
1317 - }
1318 -
1319 - return new Promise(function(resolve){
1320 - var done=function(){
1321 - resolve();
1322 - };
1323 -
1324 - img.addEventListener(
1325 - "load",
1326 - done,
1327 - {once:true}
1328 - );
1329 -
1330 - img.addEventListener(
1331 - "error",
1332 - done,
1333 - {once:true}
1334 - );
1335 - });
1336 - })
1337 - );
1338 - }
1339 -
1340 - async function initial(){
1341 - if(
1342 - document.readyState!==
1343 - "complete"
1344 - ){
1345 - await new Promise(function(resolve){
1346 - addEventListener(
1347 - "load",
1348 - resolve,
1349 - {once:true}
1350 - );
1351 - });
1352 - }
1353 -
1354 - if(
1355 - document.fonts&&
1356 - document.fonts.ready
1357 - ){
1358 - try{
1359 - await document.fonts.ready;
1360 - }catch(error){}
1361 - }
1362 -
1363 - await waitImages();
1364 -
1365 - // Exactly one initial layout calculation.
1366 - calculate(true);
1367 - }
1368 -
1369 - addEventListener(
1370 - "resize",
1371 - resize,
1372 - {passive:true}
1373 - );
1374 -
1375 - initial();
1376 -})();
1377 -</script>
1378 -
1379 -<!-- SN_HORIZONTAL_BOX_HARMONIZER_END -->
1380 -{{/html}}\n