egatari 0.6.4 → 0.6.5-rc.1

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.
Files changed (383) hide show
  1. package/NOTICE +36 -0
  2. package/README.ja.md +16 -4
  3. package/README.md +16 -4
  4. package/bin/egatari.mjs +86 -3
  5. package/components.lock.json +246 -123
  6. package/components2.lock.json +824 -1
  7. package/kit/article-steps.mjs +27 -0
  8. package/kit/build.mjs +50 -1
  9. package/kit/check-messages.mjs +15 -7
  10. package/kit/check.mjs +40 -7
  11. package/kit/cli-hint.mjs +27 -0
  12. package/kit/core/article-cite.mjs +188 -0
  13. package/kit/core/article-links.mjs +174 -0
  14. package/kit/core/article-messages.mjs +115 -0
  15. package/kit/core/article-page.mjs +183 -0
  16. package/kit/core/article-render.mjs +410 -0
  17. package/kit/core/article-text.mjs +501 -0
  18. package/kit/core/article.mjs +266 -0
  19. package/kit/core/build-core.mjs +49 -9
  20. package/kit/core/citeproc-credit.mjs +3 -0
  21. package/kit/core/colab-core.mjs +1 -1
  22. package/kit/core/components-lock.mjs +18 -0
  23. package/kit/core/llm-fix.mjs +2 -1
  24. package/kit/core/llm-pack-assemble.mjs +5 -3
  25. package/kit/core/llm-pack-data.mjs +63 -80
  26. package/kit/core/new-deck.mjs +1 -1
  27. package/kit/core/part-labels.mjs +17 -5
  28. package/kit/core/parts2.mjs +11 -1
  29. package/kit/core/player.mjs +1 -1
  30. package/kit/core/portable.mjs +132 -16
  31. package/kit/core/quote-ja.mjs +5 -0
  32. package/kit/core/themes-lock.mjs +16 -0
  33. package/kit/core/tier-a.mjs +47 -3
  34. package/kit/deck.js +195 -45
  35. package/kit/instruction-version.json +3 -0
  36. package/kit/layouts.css +11 -10
  37. package/kit/panes.js +1288 -0
  38. package/kit/player.json +1 -1
  39. package/kit/player.lock.json +2 -2
  40. package/kit/tools.js +81 -20
  41. package/kit/track.js +308 -0
  42. package/package.json +20 -3
  43. package/render/only.mjs +21 -0
  44. package/render/render.mjs +11 -8
  45. package/tools/ids.mjs +74 -9
  46. package/tools/portable.mjs +2 -0
  47. package/tools/sheet.mjs +5 -3
  48. package/vendor/components/CATALOG.md +4 -4
  49. package/vendor/components/sha256/00e4bdbb7b9964c92809177fe7bb574e7184ed603dbc5008a485d82603d9a7bf/CHANGELOG.md +37 -0
  50. package/vendor/components/sha256/00e4bdbb7b9964c92809177fe7bb574e7184ed603dbc5008a485d82603d9a7bf/README.md +58 -0
  51. package/vendor/components/sha256/00e4bdbb7b9964c92809177fe7bb574e7184ed603dbc5008a485d82603d9a7bf/demo.html +121 -0
  52. package/vendor/components/sha256/00e4bdbb7b9964c92809177fe7bb574e7184ed603dbc5008a485d82603d9a7bf/index.js +894 -0
  53. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/CHANGELOG.md +44 -0
  54. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/README.md +32 -0
  55. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/demo.html +57 -0
  56. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/ABCJS-ADAPTER.md +101 -0
  57. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/LICENSE-abcjs.txt +21 -0
  58. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/chords.json +89 -0
  59. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/doremi.json +261 -0
  60. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/extras.json +192 -0
  61. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/kaeru.json +521 -0
  62. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/rhythm.json +248 -0
  63. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/fixtures/ties.json +360 -0
  64. package/vendor/components/sha256/011b72fe1a9c24b980192931847484b12ae736e989d453c63c4d5b099962bfe0/index.js +474 -0
  65. package/vendor/components/sha256/027a8fea4060337ccc0a926c1488066f1ae7a6c102a15032eae974304e12cb3b/CHANGELOG.md +28 -0
  66. package/vendor/components/sha256/027a8fea4060337ccc0a926c1488066f1ae7a6c102a15032eae974304e12cb3b/README.md +21 -0
  67. package/vendor/components/sha256/027a8fea4060337ccc0a926c1488066f1ae7a6c102a15032eae974304e12cb3b/demo.html +32 -0
  68. package/vendor/components/sha256/027a8fea4060337ccc0a926c1488066f1ae7a6c102a15032eae974304e12cb3b/index.js +139 -0
  69. package/vendor/components/sha256/03550bb20d425aa926258bab18b03bbc0cee292072e01bb6c78c429b3ae92c34/README.md +42 -0
  70. package/vendor/components/sha256/03550bb20d425aa926258bab18b03bbc0cee292072e01bb6c78c429b3ae92c34/index.js +250 -0
  71. package/vendor/components/sha256/07013c263cc595382dbcfd4931ca8b016f9dfb673440adf28911c95bd465cf9d/README.md +22 -0
  72. package/vendor/components/sha256/07013c263cc595382dbcfd4931ca8b016f9dfb673440adf28911c95bd465cf9d/index.js +41 -0
  73. package/vendor/components/sha256/0703ec58997237fceda0008c28dfa3e3370c21cdcb6d0cc99c29a83e4b9d0f11/CHANGELOG.md +25 -0
  74. package/vendor/components/sha256/0703ec58997237fceda0008c28dfa3e3370c21cdcb6d0cc99c29a83e4b9d0f11/README.md +35 -0
  75. package/vendor/components/sha256/0703ec58997237fceda0008c28dfa3e3370c21cdcb6d0cc99c29a83e4b9d0f11/demo.html +40 -0
  76. package/vendor/components/sha256/0703ec58997237fceda0008c28dfa3e3370c21cdcb6d0cc99c29a83e4b9d0f11/index.js +731 -0
  77. package/vendor/components/sha256/0b85af3a688ca012d7d1df082dab1f405048589dce78d411d4cffc1fb3a81998/CHANGELOG.md +19 -0
  78. package/vendor/components/sha256/0b85af3a688ca012d7d1df082dab1f405048589dce78d411d4cffc1fb3a81998/README.md +21 -0
  79. package/vendor/components/sha256/0b85af3a688ca012d7d1df082dab1f405048589dce78d411d4cffc1fb3a81998/demo.html +33 -0
  80. package/vendor/components/sha256/0b85af3a688ca012d7d1df082dab1f405048589dce78d411d4cffc1fb3a81998/index.js +106 -0
  81. package/vendor/components/sha256/0cf00baed0da1bc3ce5460eb1eff0a8dd5f7789168e83aaef751135cd3f8af89/CHANGELOG.md +21 -0
  82. package/vendor/components/sha256/0cf00baed0da1bc3ce5460eb1eff0a8dd5f7789168e83aaef751135cd3f8af89/README.md +34 -0
  83. package/vendor/components/sha256/0cf00baed0da1bc3ce5460eb1eff0a8dd5f7789168e83aaef751135cd3f8af89/demo.html +77 -0
  84. package/vendor/components/sha256/0cf00baed0da1bc3ce5460eb1eff0a8dd5f7789168e83aaef751135cd3f8af89/index.js +200 -0
  85. package/vendor/components/sha256/0eca723150eb30db0b3d3fdbd35b973d5344ac0d0e2ea8ab89d143a0870ab4fd/CHANGELOG.md +31 -0
  86. package/vendor/components/sha256/0eca723150eb30db0b3d3fdbd35b973d5344ac0d0e2ea8ab89d143a0870ab4fd/README.md +43 -0
  87. package/vendor/components/sha256/0eca723150eb30db0b3d3fdbd35b973d5344ac0d0e2ea8ab89d143a0870ab4fd/demo.html +47 -0
  88. package/vendor/components/sha256/0eca723150eb30db0b3d3fdbd35b973d5344ac0d0e2ea8ab89d143a0870ab4fd/index.js +484 -0
  89. package/vendor/components/sha256/0f47d93b78df1c0661a91d5fc46d6f7f5d1c45349065aab6bd3e659e07e317dd/CHANGELOG.md +23 -0
  90. package/vendor/components/sha256/0f47d93b78df1c0661a91d5fc46d6f7f5d1c45349065aab6bd3e659e07e317dd/README.md +44 -0
  91. package/vendor/components/sha256/0f47d93b78df1c0661a91d5fc46d6f7f5d1c45349065aab6bd3e659e07e317dd/demo.html +43 -0
  92. package/vendor/components/sha256/0f47d93b78df1c0661a91d5fc46d6f7f5d1c45349065aab6bd3e659e07e317dd/index.js +266 -0
  93. package/vendor/components/sha256/12704ccb92a1f864a18cce824a2400e8e3141e8dba7db34805cb1d8522aae08e/CHANGELOG.md +34 -0
  94. package/vendor/components/sha256/12704ccb92a1f864a18cce824a2400e8e3141e8dba7db34805cb1d8522aae08e/README.md +44 -0
  95. package/vendor/components/sha256/12704ccb92a1f864a18cce824a2400e8e3141e8dba7db34805cb1d8522aae08e/demo.html +56 -0
  96. package/vendor/components/sha256/12704ccb92a1f864a18cce824a2400e8e3141e8dba7db34805cb1d8522aae08e/index.js +429 -0
  97. package/vendor/components/sha256/149e8ddefbc384aafa8b961d48f8f56ad68ff75cc2429bd8c1ad6d8da661f5f6/CHANGELOG.md +25 -0
  98. package/vendor/components/sha256/149e8ddefbc384aafa8b961d48f8f56ad68ff75cc2429bd8c1ad6d8da661f5f6/README.md +42 -0
  99. package/vendor/components/sha256/149e8ddefbc384aafa8b961d48f8f56ad68ff75cc2429bd8c1ad6d8da661f5f6/demo.html +115 -0
  100. package/vendor/components/sha256/149e8ddefbc384aafa8b961d48f8f56ad68ff75cc2429bd8c1ad6d8da661f5f6/index.js +384 -0
  101. package/vendor/components/sha256/1ccdd24c9e0e7ca2661450c52eb6dcf9dbc2fb48d05fed2d01e2b9cfd5df1365/CHANGELOG.md +19 -0
  102. package/vendor/components/sha256/1ccdd24c9e0e7ca2661450c52eb6dcf9dbc2fb48d05fed2d01e2b9cfd5df1365/README.md +38 -0
  103. package/vendor/components/sha256/1ccdd24c9e0e7ca2661450c52eb6dcf9dbc2fb48d05fed2d01e2b9cfd5df1365/demo.html +72 -0
  104. package/vendor/components/sha256/1ccdd24c9e0e7ca2661450c52eb6dcf9dbc2fb48d05fed2d01e2b9cfd5df1365/index.js +248 -0
  105. package/vendor/components/sha256/240bd2ff9a1707c557f0a1af7f278a3f7661a8e680d3b932e367d4b337a3ad13/CHANGELOG.md +19 -0
  106. package/vendor/components/sha256/240bd2ff9a1707c557f0a1af7f278a3f7661a8e680d3b932e367d4b337a3ad13/README.md +36 -0
  107. package/vendor/components/sha256/240bd2ff9a1707c557f0a1af7f278a3f7661a8e680d3b932e367d4b337a3ad13/demo.html +70 -0
  108. package/vendor/components/sha256/240bd2ff9a1707c557f0a1af7f278a3f7661a8e680d3b932e367d4b337a3ad13/index.js +167 -0
  109. package/vendor/components/sha256/2a6b20b93f1169ef2435cdf3bfca57d24c9111fe9aaf8e61f0d049cf8a70e9df/CHANGELOG.md +34 -0
  110. package/vendor/components/sha256/2a6b20b93f1169ef2435cdf3bfca57d24c9111fe9aaf8e61f0d049cf8a70e9df/README.md +32 -0
  111. package/vendor/components/sha256/2a6b20b93f1169ef2435cdf3bfca57d24c9111fe9aaf8e61f0d049cf8a70e9df/demo.html +51 -0
  112. package/vendor/components/sha256/2a6b20b93f1169ef2435cdf3bfca57d24c9111fe9aaf8e61f0d049cf8a70e9df/index.js +302 -0
  113. package/vendor/components/sha256/2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097/CHANGELOG.md +41 -0
  114. package/vendor/components/sha256/2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097/README.md +35 -0
  115. package/vendor/components/sha256/2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097/demo.html +66 -0
  116. package/vendor/components/sha256/2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097/index.js +352 -0
  117. package/vendor/components/sha256/328a440e91684524068076e96cba5771cdceaa274d4b90033656259f05467135/CHANGELOG.md +35 -0
  118. package/vendor/components/sha256/328a440e91684524068076e96cba5771cdceaa274d4b90033656259f05467135/README.md +35 -0
  119. package/vendor/components/sha256/328a440e91684524068076e96cba5771cdceaa274d4b90033656259f05467135/demo.html +40 -0
  120. package/vendor/components/sha256/328a440e91684524068076e96cba5771cdceaa274d4b90033656259f05467135/index.js +747 -0
  121. package/vendor/components/sha256/3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c/CHANGELOG.md +35 -0
  122. package/vendor/components/sha256/3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c/README.md +43 -0
  123. package/vendor/components/sha256/3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c/demo.html +89 -0
  124. package/vendor/components/sha256/3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c/index.js +323 -0
  125. package/vendor/components/sha256/34b1375b0897f881b8d43e5dbaa928485cfab240e87c53a5868e714879a20f79/CHANGELOG.md +24 -0
  126. package/vendor/components/sha256/34b1375b0897f881b8d43e5dbaa928485cfab240e87c53a5868e714879a20f79/README.md +40 -0
  127. package/vendor/components/sha256/34b1375b0897f881b8d43e5dbaa928485cfab240e87c53a5868e714879a20f79/demo.html +70 -0
  128. package/vendor/components/sha256/34b1375b0897f881b8d43e5dbaa928485cfab240e87c53a5868e714879a20f79/index.js +561 -0
  129. package/vendor/components/sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/CHANGELOG.md +27 -0
  130. package/vendor/components/sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/README.md +50 -0
  131. package/vendor/components/sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/demo.html +44 -0
  132. package/vendor/components/sha256/37ea0051e8a1f2d7c2fa2d38e57730e5a3b1afabe9037a74fcad6e6f05356c09/index.js +464 -0
  133. package/vendor/components/sha256/39c84138e7e4c6040eeb3d82d1c7fc801f513b2c26ac431ac8cc121a01f81698/CHANGELOG.md +23 -0
  134. package/vendor/components/sha256/39c84138e7e4c6040eeb3d82d1c7fc801f513b2c26ac431ac8cc121a01f81698/README.md +44 -0
  135. package/vendor/components/sha256/39c84138e7e4c6040eeb3d82d1c7fc801f513b2c26ac431ac8cc121a01f81698/demo.html +56 -0
  136. package/vendor/components/sha256/39c84138e7e4c6040eeb3d82d1c7fc801f513b2c26ac431ac8cc121a01f81698/index.js +402 -0
  137. package/vendor/components/sha256/3c36a26fd78dffdfa114bd7c9ca5cae494117bbcdda14bee5c2a01351e5f2eb2/CHANGELOG.md +27 -0
  138. package/vendor/components/sha256/3c36a26fd78dffdfa114bd7c9ca5cae494117bbcdda14bee5c2a01351e5f2eb2/README.md +49 -0
  139. package/vendor/components/sha256/3c36a26fd78dffdfa114bd7c9ca5cae494117bbcdda14bee5c2a01351e5f2eb2/demo.html +44 -0
  140. package/vendor/components/sha256/3c36a26fd78dffdfa114bd7c9ca5cae494117bbcdda14bee5c2a01351e5f2eb2/index.js +354 -0
  141. package/vendor/components/sha256/3c60c8e63279b8ee86957a5874c80f86a44f9ed92c1f615eace4a9dea1789da5/CHANGELOG.md +20 -0
  142. package/vendor/components/sha256/3c60c8e63279b8ee86957a5874c80f86a44f9ed92c1f615eace4a9dea1789da5/README.md +50 -0
  143. package/vendor/components/sha256/3c60c8e63279b8ee86957a5874c80f86a44f9ed92c1f615eace4a9dea1789da5/demo.html +61 -0
  144. package/vendor/components/sha256/3c60c8e63279b8ee86957a5874c80f86a44f9ed92c1f615eace4a9dea1789da5/index.js +141 -0
  145. package/vendor/components/sha256/3dba49cbbf7853212a6e5c393de030430d02b8b1a2ba4c8b722db2bb8afad12f/CHANGELOG.md +42 -0
  146. package/vendor/components/sha256/3dba49cbbf7853212a6e5c393de030430d02b8b1a2ba4c8b722db2bb8afad12f/README.md +32 -0
  147. package/vendor/components/sha256/3dba49cbbf7853212a6e5c393de030430d02b8b1a2ba4c8b722db2bb8afad12f/demo.html +54 -0
  148. package/vendor/components/sha256/3dba49cbbf7853212a6e5c393de030430d02b8b1a2ba4c8b722db2bb8afad12f/index.js +315 -0
  149. package/vendor/components/sha256/40452368224bdcd8c4910222285e6af9e120df17dbd1c3177c0abe9cb69075d1/CHANGELOG.md +30 -0
  150. package/vendor/components/sha256/40452368224bdcd8c4910222285e6af9e120df17dbd1c3177c0abe9cb69075d1/README.md +38 -0
  151. package/vendor/components/sha256/40452368224bdcd8c4910222285e6af9e120df17dbd1c3177c0abe9cb69075d1/demo.html +72 -0
  152. package/vendor/components/sha256/40452368224bdcd8c4910222285e6af9e120df17dbd1c3177c0abe9cb69075d1/index.js +267 -0
  153. package/vendor/components/sha256/4a5971c1f83efc1f57c444ce7d3fbf242b2bcca65c5c6e4b0b0d75eeb2751150/CHANGELOG.md +16 -0
  154. package/vendor/components/sha256/4a5971c1f83efc1f57c444ce7d3fbf242b2bcca65c5c6e4b0b0d75eeb2751150/README.md +27 -0
  155. package/vendor/components/sha256/4a5971c1f83efc1f57c444ce7d3fbf242b2bcca65c5c6e4b0b0d75eeb2751150/demo.html +42 -0
  156. package/vendor/components/sha256/4a5971c1f83efc1f57c444ce7d3fbf242b2bcca65c5c6e4b0b0d75eeb2751150/index.js +121 -0
  157. package/vendor/components/sha256/4e0e5eb48fc20ffc554786a7db66c4f5cee0c42eb0554bdc8c98323cdb168eb4/CHANGELOG.md +33 -0
  158. package/vendor/components/sha256/4e0e5eb48fc20ffc554786a7db66c4f5cee0c42eb0554bdc8c98323cdb168eb4/README.md +41 -0
  159. package/vendor/components/sha256/4e0e5eb48fc20ffc554786a7db66c4f5cee0c42eb0554bdc8c98323cdb168eb4/demo.html +70 -0
  160. package/vendor/components/sha256/4e0e5eb48fc20ffc554786a7db66c4f5cee0c42eb0554bdc8c98323cdb168eb4/index.js +592 -0
  161. package/vendor/components/sha256/50db2d3b84ee33b36c09a9a216ef6b337d2e5da2154e8aa62e790b0e63401796/CHANGELOG.md +23 -0
  162. package/vendor/components/sha256/50db2d3b84ee33b36c09a9a216ef6b337d2e5da2154e8aa62e790b0e63401796/README.md +43 -0
  163. package/vendor/components/sha256/50db2d3b84ee33b36c09a9a216ef6b337d2e5da2154e8aa62e790b0e63401796/demo.html +47 -0
  164. package/vendor/components/sha256/50db2d3b84ee33b36c09a9a216ef6b337d2e5da2154e8aa62e790b0e63401796/index.js +483 -0
  165. package/vendor/components/sha256/546ec63feccdc65569b7167e58b2e36a85be52f2538743dd2ecc3fc29ed6b883/CHANGELOG.md +19 -0
  166. package/vendor/components/sha256/546ec63feccdc65569b7167e58b2e36a85be52f2538743dd2ecc3fc29ed6b883/README.md +34 -0
  167. package/vendor/components/sha256/546ec63feccdc65569b7167e58b2e36a85be52f2538743dd2ecc3fc29ed6b883/demo.html +60 -0
  168. package/vendor/components/sha256/546ec63feccdc65569b7167e58b2e36a85be52f2538743dd2ecc3fc29ed6b883/index.js +209 -0
  169. package/vendor/components/sha256/556e7d45a761c4fa749cde186fb53f6c526ba6ede0b8f0f0bba5ac9e25e0d6f4/CHANGELOG.md +30 -0
  170. package/vendor/components/sha256/556e7d45a761c4fa749cde186fb53f6c526ba6ede0b8f0f0bba5ac9e25e0d6f4/README.md +79 -0
  171. package/vendor/components/sha256/556e7d45a761c4fa749cde186fb53f6c526ba6ede0b8f0f0bba5ac9e25e0d6f4/demo.html +50 -0
  172. package/vendor/components/sha256/556e7d45a761c4fa749cde186fb53f6c526ba6ede0b8f0f0bba5ac9e25e0d6f4/index.js +351 -0
  173. package/vendor/components/sha256/577008a069e7eb08057705a0800d975e82c8dfe0d0ba5fbf4f8974af7b298a7f/README.md +53 -0
  174. package/vendor/components/sha256/577008a069e7eb08057705a0800d975e82c8dfe0d0ba5fbf4f8974af7b298a7f/index.js +310 -0
  175. package/vendor/components/sha256/5a9959f8626f2c5280d0954c476baeadf03fecebda2443c3e83b8203ad554167/CHANGELOG.md +20 -0
  176. package/vendor/components/sha256/5a9959f8626f2c5280d0954c476baeadf03fecebda2443c3e83b8203ad554167/README.md +75 -0
  177. package/vendor/components/sha256/5a9959f8626f2c5280d0954c476baeadf03fecebda2443c3e83b8203ad554167/demo.html +50 -0
  178. package/vendor/components/sha256/5a9959f8626f2c5280d0954c476baeadf03fecebda2443c3e83b8203ad554167/index.js +342 -0
  179. package/vendor/components/sha256/5b44b272b917246219d2709f1b001964f87a3e07786cc9950087bbb8add3c721/CHANGELOG.md +24 -0
  180. package/vendor/components/sha256/5b44b272b917246219d2709f1b001964f87a3e07786cc9950087bbb8add3c721/README.md +26 -0
  181. package/vendor/components/sha256/5b44b272b917246219d2709f1b001964f87a3e07786cc9950087bbb8add3c721/demo.html +48 -0
  182. package/vendor/components/sha256/5b44b272b917246219d2709f1b001964f87a3e07786cc9950087bbb8add3c721/index.js +97 -0
  183. package/vendor/components/sha256/5c8ae7714fd8243c9b37539a5f0f8488d3ba20316ba81179e97b6160116d13c2/CHANGELOG.md +22 -0
  184. package/vendor/components/sha256/5c8ae7714fd8243c9b37539a5f0f8488d3ba20316ba81179e97b6160116d13c2/README.md +64 -0
  185. package/vendor/components/sha256/5c8ae7714fd8243c9b37539a5f0f8488d3ba20316ba81179e97b6160116d13c2/demo.html +97 -0
  186. package/vendor/components/sha256/5c8ae7714fd8243c9b37539a5f0f8488d3ba20316ba81179e97b6160116d13c2/index.js +875 -0
  187. package/vendor/components/sha256/68c9e866e3cd3e2f8179ede44a005c7f31cef0ed07fd5770ec33f0cc3aa80a41/CHANGELOG.md +21 -0
  188. package/vendor/components/sha256/68c9e866e3cd3e2f8179ede44a005c7f31cef0ed07fd5770ec33f0cc3aa80a41/README.md +50 -0
  189. package/vendor/components/sha256/68c9e866e3cd3e2f8179ede44a005c7f31cef0ed07fd5770ec33f0cc3aa80a41/demo.html +63 -0
  190. package/vendor/components/sha256/68c9e866e3cd3e2f8179ede44a005c7f31cef0ed07fd5770ec33f0cc3aa80a41/index.js +219 -0
  191. package/vendor/components/sha256/693e2aa59e822d38c48eca7271cc020f8e0a6f6189f2409895318ed2a3f0b809/CHANGELOG.md +28 -0
  192. package/vendor/components/sha256/693e2aa59e822d38c48eca7271cc020f8e0a6f6189f2409895318ed2a3f0b809/README.md +35 -0
  193. package/vendor/components/sha256/693e2aa59e822d38c48eca7271cc020f8e0a6f6189f2409895318ed2a3f0b809/demo.html +73 -0
  194. package/vendor/components/sha256/693e2aa59e822d38c48eca7271cc020f8e0a6f6189f2409895318ed2a3f0b809/index.js +228 -0
  195. package/vendor/components/sha256/6b24ab9b90b4f2275af9f61073fe9d65b8b9d16573d639ae07352f29b8b067a1/CHANGELOG.md +34 -0
  196. package/vendor/components/sha256/6b24ab9b90b4f2275af9f61073fe9d65b8b9d16573d639ae07352f29b8b067a1/README.md +65 -0
  197. package/vendor/components/sha256/6b24ab9b90b4f2275af9f61073fe9d65b8b9d16573d639ae07352f29b8b067a1/demo.html +97 -0
  198. package/vendor/components/sha256/6b24ab9b90b4f2275af9f61073fe9d65b8b9d16573d639ae07352f29b8b067a1/index.js +920 -0
  199. package/vendor/components/sha256/6c25dc07f75697e7388564ad689303c370d49142aab9e6672baec15a0313a2fa/CHANGELOG.md +31 -0
  200. package/vendor/components/sha256/6c25dc07f75697e7388564ad689303c370d49142aab9e6672baec15a0313a2fa/README.md +39 -0
  201. package/vendor/components/sha256/6c25dc07f75697e7388564ad689303c370d49142aab9e6672baec15a0313a2fa/demo.html +66 -0
  202. package/vendor/components/sha256/6c25dc07f75697e7388564ad689303c370d49142aab9e6672baec15a0313a2fa/index.js +304 -0
  203. package/vendor/components/sha256/75a20673474b3104da24a7cb0d0483394bed380ff1c108a9a529bcdd1de0f1fb/CHANGELOG.md +31 -0
  204. package/vendor/components/sha256/75a20673474b3104da24a7cb0d0483394bed380ff1c108a9a529bcdd1de0f1fb/README.md +40 -0
  205. package/vendor/components/sha256/75a20673474b3104da24a7cb0d0483394bed380ff1c108a9a529bcdd1de0f1fb/demo.html +92 -0
  206. package/vendor/components/sha256/75a20673474b3104da24a7cb0d0483394bed380ff1c108a9a529bcdd1de0f1fb/index.js +424 -0
  207. package/vendor/components/sha256/8534966fead40ce56110b49bd8cabcd3fb703665e7c164abdfcc9aa29f3ce018/CHANGELOG.md +26 -0
  208. package/vendor/components/sha256/8534966fead40ce56110b49bd8cabcd3fb703665e7c164abdfcc9aa29f3ce018/README.md +57 -0
  209. package/vendor/components/sha256/8534966fead40ce56110b49bd8cabcd3fb703665e7c164abdfcc9aa29f3ce018/demo.html +121 -0
  210. package/vendor/components/sha256/8534966fead40ce56110b49bd8cabcd3fb703665e7c164abdfcc9aa29f3ce018/index.js +875 -0
  211. package/vendor/components/sha256/85f2da6dbed2b9beedaf3ffdea237f3f7940f9b1d4c0d056caa67e937d2dad8d/CHANGELOG.md +20 -0
  212. package/vendor/components/sha256/85f2da6dbed2b9beedaf3ffdea237f3f7940f9b1d4c0d056caa67e937d2dad8d/README.md +46 -0
  213. package/vendor/components/sha256/85f2da6dbed2b9beedaf3ffdea237f3f7940f9b1d4c0d056caa67e937d2dad8d/demo.html +112 -0
  214. package/vendor/components/sha256/85f2da6dbed2b9beedaf3ffdea237f3f7940f9b1d4c0d056caa67e937d2dad8d/index.js +443 -0
  215. package/vendor/components/sha256/87ca8b6a8995a8fe11206e2def2d6df54075092d15f2f900b25767dbe9bf998e/CHANGELOG.md +22 -0
  216. package/vendor/components/sha256/87ca8b6a8995a8fe11206e2def2d6df54075092d15f2f900b25767dbe9bf998e/README.md +35 -0
  217. package/vendor/components/sha256/87ca8b6a8995a8fe11206e2def2d6df54075092d15f2f900b25767dbe9bf998e/demo.html +69 -0
  218. package/vendor/components/sha256/87ca8b6a8995a8fe11206e2def2d6df54075092d15f2f900b25767dbe9bf998e/index.js +217 -0
  219. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/CHANGELOG.md +46 -0
  220. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/LICENSE-strokesvg.txt +115 -0
  221. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/OFL.txt +93 -0
  222. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/README.md +30 -0
  223. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/demo.html +40 -0
  224. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/index.js +749 -0
  225. package/vendor/components/sha256/8af8e00fd248f55ce84fe9989e531ae60bf0eb5d0f059f3a28aa3d9c92a8e1d8/strokes-CHANGES.md +20 -0
  226. package/vendor/components/sha256/9043427ed434c76fba5b11ddd863c40d99b6157e194cfc729895cbaa4940496c/CHANGELOG.md +40 -0
  227. package/vendor/components/sha256/9043427ed434c76fba5b11ddd863c40d99b6157e194cfc729895cbaa4940496c/README.md +36 -0
  228. package/vendor/components/sha256/9043427ed434c76fba5b11ddd863c40d99b6157e194cfc729895cbaa4940496c/demo.html +52 -0
  229. package/vendor/components/sha256/9043427ed434c76fba5b11ddd863c40d99b6157e194cfc729895cbaa4940496c/index.js +268 -0
  230. package/vendor/components/sha256/9bec862c19d5442f80a2a548a5c24911219469332a6b7fc63689a56f1f3209f4/CHANGELOG.md +31 -0
  231. package/vendor/components/sha256/9bec862c19d5442f80a2a548a5c24911219469332a6b7fc63689a56f1f3209f4/README.md +46 -0
  232. package/vendor/components/sha256/9bec862c19d5442f80a2a548a5c24911219469332a6b7fc63689a56f1f3209f4/demo.html +112 -0
  233. package/vendor/components/sha256/9bec862c19d5442f80a2a548a5c24911219469332a6b7fc63689a56f1f3209f4/index.js +481 -0
  234. package/vendor/components/sha256/9cf9789f26ceaae205d48bb083e823e768413e3b2227f87de09e3cde2105a68b/CHANGELOG.md +36 -0
  235. package/vendor/components/sha256/9cf9789f26ceaae205d48bb083e823e768413e3b2227f87de09e3cde2105a68b/README.md +73 -0
  236. package/vendor/components/sha256/9cf9789f26ceaae205d48bb083e823e768413e3b2227f87de09e3cde2105a68b/demo.html +76 -0
  237. package/vendor/components/sha256/9cf9789f26ceaae205d48bb083e823e768413e3b2227f87de09e3cde2105a68b/index.js +805 -0
  238. package/vendor/components/sha256/a034214e470de8f6fa3032f65c8534c87862859525105bdfe94e347ad6a33587/CHANGELOG.md +24 -0
  239. package/vendor/components/sha256/a034214e470de8f6fa3032f65c8534c87862859525105bdfe94e347ad6a33587/README.md +35 -0
  240. package/vendor/components/sha256/a034214e470de8f6fa3032f65c8534c87862859525105bdfe94e347ad6a33587/demo.html +53 -0
  241. package/vendor/components/sha256/a034214e470de8f6fa3032f65c8534c87862859525105bdfe94e347ad6a33587/index.js +481 -0
  242. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/CHANGELOG.md +41 -0
  243. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/LICENSE-strokesvg.txt +115 -0
  244. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/OFL.txt +93 -0
  245. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/README.md +33 -0
  246. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/demo.html +40 -0
  247. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/index.js +749 -0
  248. package/vendor/components/sha256/a5ba78e0e95bf216bcd02295d1aa76ab8c3688b07931a3bfd9401448c4a34106/strokes-CHANGES.md +20 -0
  249. package/vendor/components/sha256/a6486154cbfe25c500a64cbb2128be45c2e2365e848c34d4c5c10e9a93f6e73c/CHANGELOG.md +35 -0
  250. package/vendor/components/sha256/a6486154cbfe25c500a64cbb2128be45c2e2365e848c34d4c5c10e9a93f6e73c/README.md +35 -0
  251. package/vendor/components/sha256/a6486154cbfe25c500a64cbb2128be45c2e2365e848c34d4c5c10e9a93f6e73c/demo.html +53 -0
  252. package/vendor/components/sha256/a6486154cbfe25c500a64cbb2128be45c2e2365e848c34d4c5c10e9a93f6e73c/index.js +521 -0
  253. package/vendor/components/sha256/a6ad6867e21b4ffab426919d62f4293cbb447c7307f8f92e4a8c8d7c285fca6a/CHANGELOG.md +32 -0
  254. package/vendor/components/sha256/a6ad6867e21b4ffab426919d62f4293cbb447c7307f8f92e4a8c8d7c285fca6a/README.md +39 -0
  255. package/vendor/components/sha256/a6ad6867e21b4ffab426919d62f4293cbb447c7307f8f92e4a8c8d7c285fca6a/demo.html +70 -0
  256. package/vendor/components/sha256/a6ad6867e21b4ffab426919d62f4293cbb447c7307f8f92e4a8c8d7c285fca6a/index.js +166 -0
  257. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/CHANGELOG.md +56 -0
  258. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/README.md +35 -0
  259. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/demo.html +57 -0
  260. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/ABCJS-ADAPTER.md +101 -0
  261. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/LICENSE-abcjs.txt +21 -0
  262. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/chords.json +89 -0
  263. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/doremi.json +261 -0
  264. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/extras.json +192 -0
  265. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/kaeru.json +521 -0
  266. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/rhythm.json +248 -0
  267. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/fixtures/ties.json +360 -0
  268. package/vendor/components/sha256/abbe3a79cdd442191cb76ac572a7fa62af694850c115c4abba30356bae5f475f/index.js +508 -0
  269. package/vendor/components/sha256/ae4f864445dff17a19df30c528cb44741558217080f8e6563e0c364025a4d0a6/CHANGELOG.md +31 -0
  270. package/vendor/components/sha256/ae4f864445dff17a19df30c528cb44741558217080f8e6563e0c364025a4d0a6/README.md +34 -0
  271. package/vendor/components/sha256/ae4f864445dff17a19df30c528cb44741558217080f8e6563e0c364025a4d0a6/demo.html +77 -0
  272. package/vendor/components/sha256/ae4f864445dff17a19df30c528cb44741558217080f8e6563e0c364025a4d0a6/index.js +222 -0
  273. package/vendor/components/sha256/b9ee9d0f48ab61977d3aa618e6155ccc3453dbf452235f438fa15db6f554f961/CHANGELOG.md +30 -0
  274. package/vendor/components/sha256/b9ee9d0f48ab61977d3aa618e6155ccc3453dbf452235f438fa15db6f554f961/README.md +50 -0
  275. package/vendor/components/sha256/b9ee9d0f48ab61977d3aa618e6155ccc3453dbf452235f438fa15db6f554f961/demo.html +61 -0
  276. package/vendor/components/sha256/b9ee9d0f48ab61977d3aa618e6155ccc3453dbf452235f438fa15db6f554f961/index.js +171 -0
  277. package/vendor/components/sha256/bd590a6619f80d659299e4e558f770e75244360450939d504a4eaf7989b0eb97/README.md +21 -0
  278. package/vendor/components/sha256/bd590a6619f80d659299e4e558f770e75244360450939d504a4eaf7989b0eb97/index.js +93 -0
  279. package/vendor/components/sha256/bd79435195d9657ad2cb690b49da192bbd20bf1fe25088ba63988dbacafa6f3d/CHANGELOG.md +18 -0
  280. package/vendor/components/sha256/bd79435195d9657ad2cb690b49da192bbd20bf1fe25088ba63988dbacafa6f3d/README.md +21 -0
  281. package/vendor/components/sha256/bd79435195d9657ad2cb690b49da192bbd20bf1fe25088ba63988dbacafa6f3d/demo.html +32 -0
  282. package/vendor/components/sha256/bd79435195d9657ad2cb690b49da192bbd20bf1fe25088ba63988dbacafa6f3d/index.js +53 -0
  283. package/vendor/components/sha256/be709cea3ba3d0a69138d4c55796f59f6322d97ad0bb8c3a75c3e9fcae5a0419/CHANGELOG.md +20 -0
  284. package/vendor/components/sha256/be709cea3ba3d0a69138d4c55796f59f6322d97ad0bb8c3a75c3e9fcae5a0419/README.md +40 -0
  285. package/vendor/components/sha256/be709cea3ba3d0a69138d4c55796f59f6322d97ad0bb8c3a75c3e9fcae5a0419/demo.html +92 -0
  286. package/vendor/components/sha256/be709cea3ba3d0a69138d4c55796f59f6322d97ad0bb8c3a75c3e9fcae5a0419/index.js +399 -0
  287. package/vendor/components/sha256/c252d5ceed6735b7ca8095ac8ef035dfc79f8492b2624d7d2eb94d2a27fafe2b/CHANGELOG.md +28 -0
  288. package/vendor/components/sha256/c252d5ceed6735b7ca8095ac8ef035dfc79f8492b2624d7d2eb94d2a27fafe2b/README.md +36 -0
  289. package/vendor/components/sha256/c252d5ceed6735b7ca8095ac8ef035dfc79f8492b2624d7d2eb94d2a27fafe2b/demo.html +70 -0
  290. package/vendor/components/sha256/c252d5ceed6735b7ca8095ac8ef035dfc79f8492b2624d7d2eb94d2a27fafe2b/index.js +179 -0
  291. package/vendor/components/sha256/c882093b0dc9215cf79d8f42afc5db46dce07c8b677f85148a3efa7355d7221b/CHANGELOG.md +25 -0
  292. package/vendor/components/sha256/c882093b0dc9215cf79d8f42afc5db46dce07c8b677f85148a3efa7355d7221b/README.md +32 -0
  293. package/vendor/components/sha256/c882093b0dc9215cf79d8f42afc5db46dce07c8b677f85148a3efa7355d7221b/demo.html +54 -0
  294. package/vendor/components/sha256/c882093b0dc9215cf79d8f42afc5db46dce07c8b677f85148a3efa7355d7221b/index.js +251 -0
  295. package/vendor/components/sha256/cd714d22f82d64c80db8fdef33ca03aa618803e8114662ee2692fc7c6ac7168c/CHANGELOG.md +34 -0
  296. package/vendor/components/sha256/cd714d22f82d64c80db8fdef33ca03aa618803e8114662ee2692fc7c6ac7168c/README.md +35 -0
  297. package/vendor/components/sha256/cd714d22f82d64c80db8fdef33ca03aa618803e8114662ee2692fc7c6ac7168c/demo.html +69 -0
  298. package/vendor/components/sha256/cd714d22f82d64c80db8fdef33ca03aa618803e8114662ee2692fc7c6ac7168c/index.js +244 -0
  299. package/vendor/components/sha256/d0fbcd5e36c0f38c2d8352acee060e783b58cd2ab1ff0f9e7a60da4b2a6e3232/CHANGELOG.md +19 -0
  300. package/vendor/components/sha256/d0fbcd5e36c0f38c2d8352acee060e783b58cd2ab1ff0f9e7a60da4b2a6e3232/README.md +44 -0
  301. package/vendor/components/sha256/d0fbcd5e36c0f38c2d8352acee060e783b58cd2ab1ff0f9e7a60da4b2a6e3232/demo.html +44 -0
  302. package/vendor/components/sha256/d0fbcd5e36c0f38c2d8352acee060e783b58cd2ab1ff0f9e7a60da4b2a6e3232/index.js +334 -0
  303. package/vendor/components/sha256/d159f55bb5a72bc67c4ffa856bf9e1735d3c37f5cad9673accffc1e1953182e0/CHANGELOG.md +37 -0
  304. package/vendor/components/sha256/d159f55bb5a72bc67c4ffa856bf9e1735d3c37f5cad9673accffc1e1953182e0/README.md +43 -0
  305. package/vendor/components/sha256/d159f55bb5a72bc67c4ffa856bf9e1735d3c37f5cad9673accffc1e1953182e0/demo.html +75 -0
  306. package/vendor/components/sha256/d159f55bb5a72bc67c4ffa856bf9e1735d3c37f5cad9673accffc1e1953182e0/index.js +348 -0
  307. package/vendor/components/sha256/d29e8fbfd371edf4dea02996c8b43028af511a5f1c212e3b5d89fff68a54e55e/CHANGELOG.md +20 -0
  308. package/vendor/components/sha256/d29e8fbfd371edf4dea02996c8b43028af511a5f1c212e3b5d89fff68a54e55e/README.md +39 -0
  309. package/vendor/components/sha256/d29e8fbfd371edf4dea02996c8b43028af511a5f1c212e3b5d89fff68a54e55e/demo.html +70 -0
  310. package/vendor/components/sha256/d29e8fbfd371edf4dea02996c8b43028af511a5f1c212e3b5d89fff68a54e55e/index.js +134 -0
  311. package/vendor/components/sha256/d4159ba1206d094364b7735750e5e2532aeabbc299e0d6858e3a0edb84495e11/README.md +22 -0
  312. package/vendor/components/sha256/d4159ba1206d094364b7735750e5e2532aeabbc299e0d6858e3a0edb84495e11/index.js +59 -0
  313. package/vendor/components/sha256/d92842c606795528d1246ddb050ac275e1b72659629185750a6e9ac7fdb763a3/README.md +20 -0
  314. package/vendor/components/sha256/d92842c606795528d1246ddb050ac275e1b72659629185750a6e9ac7fdb763a3/index.js +162 -0
  315. package/vendor/components/sha256/de611e2477042b14eb9c04bb98ad0bbe6d7b44ca829213dd1a7a2b94d8f946ae/CHANGELOG.md +33 -0
  316. package/vendor/components/sha256/de611e2477042b14eb9c04bb98ad0bbe6d7b44ca829213dd1a7a2b94d8f946ae/README.md +46 -0
  317. package/vendor/components/sha256/de611e2477042b14eb9c04bb98ad0bbe6d7b44ca829213dd1a7a2b94d8f946ae/demo.html +43 -0
  318. package/vendor/components/sha256/de611e2477042b14eb9c04bb98ad0bbe6d7b44ca829213dd1a7a2b94d8f946ae/index.js +278 -0
  319. package/vendor/components/sha256/de90044c2961a30c88570e41d0c41bfc5037fe691f6f81e12d8e9d3545cd6ec4/CHANGELOG.md +15 -0
  320. package/vendor/components/sha256/de90044c2961a30c88570e41d0c41bfc5037fe691f6f81e12d8e9d3545cd6ec4/README.md +25 -0
  321. package/vendor/components/sha256/de90044c2961a30c88570e41d0c41bfc5037fe691f6f81e12d8e9d3545cd6ec4/demo.html +48 -0
  322. package/vendor/components/sha256/de90044c2961a30c88570e41d0c41bfc5037fe691f6f81e12d8e9d3545cd6ec4/index.js +88 -0
  323. package/vendor/components/sha256/de9607f86221006e7bad43f1f661c751d9a6f8f9c62da5c7e0d7f1249b9afcd6/README.md +25 -0
  324. package/vendor/components/sha256/de9607f86221006e7bad43f1f661c751d9a6f8f9c62da5c7e0d7f1249b9afcd6/index.js +122 -0
  325. package/vendor/components/sha256/e6b022135d0a0bd85a508404f46005986b14d0d175af7ca54b4d024b1e490318/CHANGELOG.md +20 -0
  326. package/vendor/components/sha256/e6b022135d0a0bd85a508404f46005986b14d0d175af7ca54b4d024b1e490318/README.md +23 -0
  327. package/vendor/components/sha256/e6b022135d0a0bd85a508404f46005986b14d0d175af7ca54b4d024b1e490318/demo.html +236 -0
  328. package/vendor/components/sha256/e6b022135d0a0bd85a508404f46005986b14d0d175af7ca54b4d024b1e490318/index.js +572 -0
  329. package/vendor/components/sha256/e6bbe784ee452d52d534b8fb3a0924e65c49bbb5926139ef5eabd9193500b357/CHANGELOG.md +29 -0
  330. package/vendor/components/sha256/e6bbe784ee452d52d534b8fb3a0924e65c49bbb5926139ef5eabd9193500b357/README.md +23 -0
  331. package/vendor/components/sha256/e6bbe784ee452d52d534b8fb3a0924e65c49bbb5926139ef5eabd9193500b357/demo.html +33 -0
  332. package/vendor/components/sha256/e6bbe784ee452d52d534b8fb3a0924e65c49bbb5926139ef5eabd9193500b357/index.js +121 -0
  333. package/vendor/components/sha256/eb5efa15920d9883af15d105cc0f7a9b2c781d792faae34a43d44738138b219f/CHANGELOG.md +29 -0
  334. package/vendor/components/sha256/eb5efa15920d9883af15d105cc0f7a9b2c781d792faae34a43d44738138b219f/README.md +32 -0
  335. package/vendor/components/sha256/eb5efa15920d9883af15d105cc0f7a9b2c781d792faae34a43d44738138b219f/demo.html +56 -0
  336. package/vendor/components/sha256/eb5efa15920d9883af15d105cc0f7a9b2c781d792faae34a43d44738138b219f/index.js +232 -0
  337. package/vendor/components/sha256/ebded96e5827ecf359b73ac0d50a807227d9a06294bd5dabc84263e32c0eeebe/CHANGELOG.md +25 -0
  338. package/vendor/components/sha256/ebded96e5827ecf359b73ac0d50a807227d9a06294bd5dabc84263e32c0eeebe/README.md +71 -0
  339. package/vendor/components/sha256/ebded96e5827ecf359b73ac0d50a807227d9a06294bd5dabc84263e32c0eeebe/demo.html +76 -0
  340. package/vendor/components/sha256/ebded96e5827ecf359b73ac0d50a807227d9a06294bd5dabc84263e32c0eeebe/index.js +777 -0
  341. package/vendor/components/sha256/ed44804fc14b2755a82960d94cb0322858732ad789fd9a46704ee88955bd65e6/CHANGELOG.md +33 -0
  342. package/vendor/components/sha256/ed44804fc14b2755a82960d94cb0322858732ad789fd9a46704ee88955bd65e6/README.md +28 -0
  343. package/vendor/components/sha256/ed44804fc14b2755a82960d94cb0322858732ad789fd9a46704ee88955bd65e6/demo.html +236 -0
  344. package/vendor/components/sha256/ed44804fc14b2755a82960d94cb0322858732ad789fd9a46704ee88955bd65e6/index.js +600 -0
  345. package/vendor/components/sha256/ee8519d664179e6b6bb6d2f8cc5b1c07a0ebf3871a8681d28ddd08fecd5f3388/CHANGELOG.md +16 -0
  346. package/vendor/components/sha256/ee8519d664179e6b6bb6d2f8cc5b1c07a0ebf3871a8681d28ddd08fecd5f3388/README.md +38 -0
  347. package/vendor/components/sha256/ee8519d664179e6b6bb6d2f8cc5b1c07a0ebf3871a8681d28ddd08fecd5f3388/demo.html +115 -0
  348. package/vendor/components/sha256/ee8519d664179e6b6bb6d2f8cc5b1c07a0ebf3871a8681d28ddd08fecd5f3388/index.js +361 -0
  349. package/vendor/components/sha256/ef969fa27f1e11aa52a174874292366c7c8201c7c0d8236a7aef7d7eacf6a177/CHANGELOG.md +27 -0
  350. package/vendor/components/sha256/ef969fa27f1e11aa52a174874292366c7c8201c7c0d8236a7aef7d7eacf6a177/README.md +27 -0
  351. package/vendor/components/sha256/ef969fa27f1e11aa52a174874292366c7c8201c7c0d8236a7aef7d7eacf6a177/demo.html +42 -0
  352. package/vendor/components/sha256/ef969fa27f1e11aa52a174874292366c7c8201c7c0d8236a7aef7d7eacf6a177/index.js +233 -0
  353. package/vendor/components/sha256/f268cf809438c8af63a42f9c9121110fc7263e4d705c40c6206ce46cf7ec167b/README.md +23 -0
  354. package/vendor/components/sha256/f268cf809438c8af63a42f9c9121110fc7263e4d705c40c6206ce46cf7ec167b/index.js +180 -0
  355. package/vendor/components/sha256/f3f55f5ee11ebc66656ca40ff23cd2df6a48f09a2380469f96f8f48033ddf2f7/CHANGELOG.md +31 -0
  356. package/vendor/components/sha256/f3f55f5ee11ebc66656ca40ff23cd2df6a48f09a2380469f96f8f48033ddf2f7/README.md +36 -0
  357. package/vendor/components/sha256/f3f55f5ee11ebc66656ca40ff23cd2df6a48f09a2380469f96f8f48033ddf2f7/demo.html +50 -0
  358. package/vendor/components/sha256/f3f55f5ee11ebc66656ca40ff23cd2df6a48f09a2380469f96f8f48033ddf2f7/index.js +263 -0
  359. package/vendor/components/sha256/fa8c1e548234bdbfa401bb4b085c5ef24d607a006c377c8c1cf3bcfc52427a5e/CHANGELOG.md +20 -0
  360. package/vendor/components/sha256/fa8c1e548234bdbfa401bb4b085c5ef24d607a006c377c8c1cf3bcfc52427a5e/README.md +39 -0
  361. package/vendor/components/sha256/fa8c1e548234bdbfa401bb4b085c5ef24d607a006c377c8c1cf3bcfc52427a5e/demo.html +66 -0
  362. package/vendor/components/sha256/fa8c1e548234bdbfa401bb4b085c5ef24d607a006c377c8c1cf3bcfc52427a5e/index.js +258 -0
  363. package/vendor/components/sha256/fadd24868e2730ec14b8f3f1e9cb75b8577a48b8d71beaa12ef089f7a3ba0a7d/README.md +22 -0
  364. package/vendor/components/sha256/fadd24868e2730ec14b8f3f1e9cb75b8577a48b8d71beaa12ef089f7a3ba0a7d/index.js +37 -0
  365. package/vendor/components/sha256/faf6a2f0b5df589639de624e75c5b20594f517e4426f6415d152809249b00b92/README.md +19 -0
  366. package/vendor/components/sha256/faf6a2f0b5df589639de624e75c5b20594f517e4426f6415d152809249b00b92/index.js +200 -0
  367. package/vendor/components/sha256/fd07adeb4b775e139092dd69a3fcbca4528d08e67be6b9e9cf53d4fd06be775b/CHANGELOG.md +25 -0
  368. package/vendor/components/sha256/fd07adeb4b775e139092dd69a3fcbca4528d08e67be6b9e9cf53d4fd06be775b/README.md +32 -0
  369. package/vendor/components/sha256/fd07adeb4b775e139092dd69a3fcbca4528d08e67be6b9e9cf53d4fd06be775b/demo.html +51 -0
  370. package/vendor/components/sha256/fd07adeb4b775e139092dd69a3fcbca4528d08e67be6b9e9cf53d4fd06be775b/index.js +270 -0
  371. package/vendor/components/sha256/ffac8bd95044aeb032b20dc8412ced70d09759d993955ef66697d4f2aa7f97a5/CHANGELOG.md +19 -0
  372. package/vendor/components/sha256/ffac8bd95044aeb032b20dc8412ced70d09759d993955ef66697d4f2aa7f97a5/README.md +34 -0
  373. package/vendor/components/sha256/ffac8bd95044aeb032b20dc8412ced70d09759d993955ef66697d4f2aa7f97a5/demo.html +60 -0
  374. package/vendor/components/sha256/ffac8bd95044aeb032b20dc8412ced70d09759d993955ef66697d4f2aa7f97a5/index.js +209 -0
  375. package/vendor/components-2/manifest-2.2.0.json +1868 -0
  376. package/vendor/csl/SOURCE.json +17 -0
  377. package/vendor/csl/locales/locales-en-US.xml +864 -0
  378. package/vendor/csl/locales/locales-ja-JP.xml +676 -0
  379. package/vendor/csl/styles/apa.csl +2278 -0
  380. package/vendor/csl/styles/ieee.csl +519 -0
  381. package/vendor/csl/styles/sist02.csl +273 -0
  382. package/vendor/egatari-spec/SOURCE.json +3 -3
  383. package/vendor/egatari-spec/schema/deck-meta.schema.json +6 -0
@@ -0,0 +1,920 @@
1
+ // m-timeline:年表。出来事を時間の軸の上に 1 つずつ出す。期間(end のある node)は帯にして、重なる期間は段を分ける
2
+ // <m-timeline style="height:420px"><script type="application/json">
3
+ // {"nodes": [{"label": "明治維新", "when": "1868"}, {"label": "憲法の発布", "when": "1889-02-11", "note": "2 月 11 日"},
4
+ // {"label": "夏目漱石", "when": "1867", "end": "1916", "lane": "作家"}]}
5
+ // (JSON の終わり)</m-timeline>
6
+ // 座標はデータに書かない(docs/conventions.md §2)。時刻 when は数か "YYYY" "YYYY-MM" "YYYY-MM-DD"。end があれば期間(帯)
7
+ // 出来事(end も lane もない node):軸の上の点と、日付と名前の箱。箱は軸の上と下に交互に(v なら左と右に)。混んでいれば 2 段にする
8
+ // 期間(end のある node):軸の下(v なら右)の段(lane)に帯で描く。重なる期間は自動で別の段に積む。lane(文字列)で名前の付いた
9
+ // 段のまとまりに分け、まとまりの名前を左(v なら上)に書く。lane のある出来事(end なし)は、その段の中の ◆(節目)になる
10
+ // 期間があるときは軸に目盛りを付け、出来事の箱はすべて軸の上(v なら左)に置く
11
+ // 段階:既定は時刻の順に 1 つずつ(per-step で n 個ずつ、node の step で直接、at で段階の中の開始秒)。軸は最初の出来事と一緒に出る
12
+ // 見せ方(docs/conventions.md §2.5):fade(既定。箱が軸の側から 12 px 寄りながら現れてから軸からの線を引く)・draw(軸からの線を先に引き、
13
+ // その先に箱が軸の側から 12 px 寄りながら出る。帯は始まりから終わりへ引く)・grow(箱が軸の側から 12 px 寄りながら 0.92 → 1 に大きくなる。
14
+ // 帯は両端が 12 px ずつ伸びる)。箱の動きはどれも 12 px まで。段階の数・長さ・合図・最後の中身はどれも同じ
15
+ // 字の幅は字数から見積もる(字の読み込みを待たない)。入らなければ字を 24px まで縮め、それでも入らなければ ctx.report("size", …)
16
+ // 工程表:node の after(前の作業の id。終わり → 始まりの直角の矢印。あれば作業ごとに 1 段)・progress(0–100 % を濃く塗る)、
17
+ // 属性 today(今日の縦の線)・unit(day・week・month の目盛り。書かなければ今まで通り)。どれも書かなければ描き方は今までと同じ
18
+ // 2.0(Egatari spec §6.1 の部品):base の MotionElement・el・mtext・prog・lerp・variant・previewOpacity を使い、プレイヤーのグローバルは使わない。
19
+ // 式(tex)は組み立てのときに KaTeX で描く(spec §6.2):build.fields の nodes[].tex を作り手が描いて texHtml を足し、
20
+ // この部品は markup-reader で決まった要素と属性だけを読んで置く(再生のときに KaTeX は動かない)。描いた結果がなければ tex を字のまま出して知らせる。
21
+ // データと属性の問題、入らないときは ctx.report で知らせる(1.x の console.warn の代わり)。言語は ctx.lang(mount で this.ja)。
22
+ // 配置を決める内部の関数は arrange(size)(1.x の layout(size)。2.0 の layout(ctx) は再生器が呼ぶので名前を分けた)
23
+ egatariParts.define({name: "timeline", version: "2.0.2", requires: {base: "1.1.0", "markup-reader": "1.0.1"}, element: "m-timeline"}, function(deps){
24
+ "use strict";
25
+ var base = deps.base, MR = deps["markup-reader"];
26
+ var Part = class extends base.MotionElement {
27
+ static partName = "timeline"; // the registry name (define meta name), for report prefixes
28
+ // 組み立てのときに描く欄(spec §6.2)。式の意味は字(tex)でも持つので、KaTeX の出力は HTML だけ
29
+ static build = {fields: {"nodes[].tex": "katex"}, options: {katex: {output: "html"}}};
30
+ static variants = ["fade", "draw", "grow"];
31
+ // データの形(kit/shape.js)
32
+ static shape = {
33
+ schema: {type: "object", additionalProperties: false, required: ["nodes"], properties: {
34
+ nodes: {type: "array", minItems: 1, items: {type: "object", required: ["when"], properties: {
35
+ id: {type: ["string", "integer"]}, label: {type: "string"}, tex: {type: "string"}, texHtml: {type: "string"}, note: {type: "string"}, tone: {type: "string"},
36
+ when: {type: ["number", "string"]}, whenLabel: {type: "string"}, end: {type: ["number", "string"]}, lane: {type: "string"}, step: {type: "integer"}, at: {type: "number"},
37
+ after: {type: "array", items: {type: ["string", "integer"]}}, progress: {type: "number"}}}},
38
+ edges: {type: "array", items: {type: "object", required: ["from", "to"], properties: {
39
+ from: {type: ["string", "integer"]}, to: {type: ["string", "integer"]}, label: {type: "string"}, tone: {type: "string"}, dash: {type: "boolean"},
40
+ step: {type: "integer"}, at: {type: "number"}}}},
41
+ renderers: {type: "object"}}},
42
+ example: {nodes: [{id: "a", label: "明治維新", when: "1868", whenLabel: "明治元年"}, {id: "b", label: "憲法の発布", when: "1889", note: "2 月 11 日"},
43
+ {id: "c", label: "日清戦争", when: "1894", end: "1895", tone: "emph"}]},
44
+ note: "when / end: a number or \"YYYY\", \"YYYY-MM\", \"YYYY-MM-DD\"; end is exclusive (\"1912\" is the start of 1912). whenLabel: the date text shown instead of the computed one (when still sets the position). A node with end is a period (a band); lane groups bands into named lanes",
45
+ };
46
+ static props = {
47
+ orient: {type: "string", default: "h", doc: "h(左から右へ)か v(上から下へ)"},
48
+ scale: {type: "string", default: "time", doc: "time(時間に比例した間隔)か even(等間隔。間がとても不ぞろいなとき)"},
49
+ "per-step": {type: "number", default: 1, doc: "1 段階に出す出来事の数(0 = 全部を段階 1 で)"},
50
+ size: {type: "number", default: 26, doc: "名前の字の大きさ(px。入らなければ 24 まで縮める)"},
51
+ dur: {type: "number", default: 0.6, doc: "1 つの出来事が現れる秒数"},
52
+ stagger: {type: "number", default: 0.3, doc: "同じ段階の出来事の出だしのずれ(秒)"},
53
+ unit: {type: "string", default: "", doc: "目盛り:day・week・month"},
54
+ today: {type: "string", default: "", doc: "今日の線(YYYY-MM-DD)"},
55
+ };
56
+ get steps(){
57
+ if (this.getAttribute("steps") !== null) return +this.getAttribute("steps");
58
+ var m = 0;
59
+ this.plan().items.forEach(function(o){ m = Math.max(m, o.step); });
60
+ this.plan().edges.forEach(function(o){ m = Math.max(m, o.step); });
61
+ return m;
62
+ }
63
+ plan(){
64
+ if (this._plan) return this._plan;
65
+ var notes = this._notes = []; // データの問題:mount が ctx.report("data", …) で知らせる(段階の数を数えるときには ctx がない)
66
+ var P = this.props, per = P["per-step"], data = this.data || {}, items = [], T = parseTime;
67
+ (data.nodes || []).forEach(function(n, idx){
68
+ var a = T(n.when);
69
+ if (!a){ notes.push("[timeline] when=" + JSON.stringify(n.when) + " is not a time (number, \"YYYY\", \"YYYY-MM\" or \"YYYY-MM-DD\"); skipped"); return; }
70
+ var b = null;
71
+ if (n.end !== undefined){
72
+ b = T(n.end);
73
+ if (!b) notes.push("[timeline] end=" + JSON.stringify(n.end) + " is not a time; drawn as an event");
74
+ else if (b.v < a.v){ notes.push("[timeline] end " + JSON.stringify(n.end) + " is before when " + JSON.stringify(n.when) + "; swapped"); var x = a; a = b; b = x; }
75
+ }
76
+ items.push({n: n, idx: idx, a: a, b: b, kind: b ? "band" : n.lane !== undefined ? "ms" : "point"});
77
+ });
78
+ // 時刻の順(同じ時刻は書いた順)
79
+ items.sort(function(p, q){ return p.a.v - q.a.v || p.idx - q.idx; });
80
+ var seen = {}, axisStep = Infinity;
81
+ items.forEach(function(o, j){
82
+ o.step = o.n.step !== undefined ? o.n.step : per > 0 ? Math.floor(j / per) + 1 : 1;
83
+ axisStep = Math.min(axisStep, o.step);
84
+ });
85
+ items.forEach(function(o){
86
+ var i = seen[o.step] = (seen[o.step] || 0) + 1;
87
+ o.at0 = o.n.at !== undefined ? o.n.at : +((i - 1) * P.stagger).toFixed(3);
88
+ // 軸と同じ段階なら、軸が引かれ始めてから
89
+ o.at = +(o.at0 + (o.step === axisStep ? 0.35 : 0)).toFixed(3);
90
+ });
91
+ var byId = {};
92
+ items.forEach(function(o){ if (o.n.id !== undefined) byId[o.n.id] = o; });
93
+ var edges = (data.edges || []).map(function(e){
94
+ var a = byId[e.from], b = byId[e.to];
95
+ if (!a || !b){ notes.push("[timeline] an edge refers to an unknown node: " + JSON.stringify(e.from) + " → " + JSON.stringify(e.to) + " (not drawn)"); return null; }
96
+ var step = e.step !== undefined ? e.step : Math.max(a.step, b.step), at = 0;
97
+ [a, b].forEach(function(o){ if (o.step === step) at = Math.max(at, o.at + P.dur); });
98
+ return {e: e, a: a, b: b, step: step, at: e.at !== undefined ? e.at : at};
99
+ }).filter(Boolean);
100
+ // after(終わり → 始まりの矢印):期間か節目どうし。矢印は後に出るほう(ふつうは後の作業)の段階で、その作業と一緒に引く
101
+ var deps = [];
102
+ items.forEach(function(b){
103
+ if (b.n.after === undefined) return;
104
+ (Array.isArray(b.n.after) ? b.n.after : [b.n.after]).forEach(function(id){
105
+ var a = byId[id];
106
+ if (!a){ notes.push("[timeline] after " + JSON.stringify(id) + " is not the id of a node; no arrow"); return; }
107
+ if (a === b || a.kind === "point" || b.kind === "point"){ notes.push("[timeline] after " + JSON.stringify(id) + " needs two periods or lane milestones (lane); no arrow"); return; }
108
+ var w = a.step > b.step ? a : b;
109
+ deps.push({a: a, b: b, step: w.step, at: w.at});
110
+ });
111
+ });
112
+ return (this._plan = {items: items, edges: edges, deps: deps, axisStep: axisStep === Infinity ? 1 : axisStep});
113
+ }
114
+ mount(ctx){
115
+ var P = this.props, D = base, self = this, seen = {};
116
+ this.variant = base.variant(this);
117
+ this.plan();
118
+ this._notes.forEach(function(m){ ctx.report("data", m); });
119
+ // arrange は字の大きさごとに何度も呼ばれるので、同じ知らせは 1 回だけ
120
+ this.rep = function(code, msg){ if (seen[code + msg]) return; seen[code + msg] = true; if (code === "attr") ctx.report("attr", msg); else if (code === "range") ctx.report("range", msg); else if (code === "layout") ctx.report("layout", msg); else ctx.report("data", msg); };
121
+ this.texSink = MR.sink(this, ctx);
122
+ this.style.display = "block"; this.style.position = "relative";
123
+ var W = this.W = this.clientWidth, H = this.H = this.clientHeight;
124
+ this.hz = P.orient !== "v";
125
+ this.ja = /^ja\b/i.test(ctx.lang);
126
+ var svg = this.svg = D.el("svg", {viewBox: "0 0 " + W + " " + H, width: W, height: H, "aria-hidden": "true", style: "display:block;overflow:visible"}, this);
127
+ // 字の大きさ:size から 24 まで、入るまで 2px ずつ縮める。24 より小さい size は 24 に、数でなければ既定の 26
128
+ var s0 = P.size;
129
+ if (!(typeof s0 === "number" && isFinite(s0))){ ctx.report("attr", "[timeline] size=\"" + this.getAttribute("size") + "\" is not a number (26 is used)"); s0 = 26; }
130
+ else if (s0 < 24){ ctx.report("attr", "[timeline] size=\"" + this.getAttribute("size") + "\" is below 24 (text is at least 24px; 24 is used)"); s0 = 24; }
131
+ var L = null;
132
+ for (var s = s0; ; s = Math.max(24, s - 2)){
133
+ L = this.arrange(s);
134
+ if (L.fits || s <= 24) break;
135
+ }
136
+ if (!L.fits) ctx.report("size", "[timeline] the timeline does not fit its box even at 24px (" + L.why + "); make the element larger, shorten the labels or use per-step / scale=\"even\"");
137
+ this.draw(L);
138
+ // 読み上げ:最後の形(時刻の順のすべての出来事と期間)を 1 文で。作者の aria-label があればそれを使う(上書きしない)
139
+ if (this._aria === undefined) this._aria = this.getAttribute("aria-label");
140
+ this.setAttribute("role", "img");
141
+ if (!this._aria) this.setAttribute("aria-label", this.summary(this.ja));
142
+ this.texSink.flush(); // what the formulas have to report, once per kind (spec §6.2)
143
+ }
144
+ // 最後の形を 1 文で(読み上げの名前):「年表:1867年〜1916年 夏目漱石(作家)、1868年 明治維新、1889年2月11日 憲法の発布(2 月 11 日)。
145
+ // つながり:…。作業の順:…。今日:…」。end は含まない終わりなので、期間は「〜」で書く
146
+ summary(ja){
147
+ var pl = this.plan(), P = this.props, one = function(n){ return String(n.label || n.tex || "").replace(/\s*\n\s*/g, " ").replace(/\*/g, ""); };
148
+ var it = pl.items.map(function(o){
149
+ var w = o.n.whenLabel !== undefined ? String(o.n.whenLabel) : fmtTime(o.a, ja) + (o.b ? (ja ? "〜" : " to ") + fmtTime(o.b, ja) : "");
150
+ var ex = [o.n.lane ? String(o.n.lane) : "", o.n.note || "", o.kind === "band" && typeof o.n.progress === "number" && isFinite(o.n.progress) ? (ja ? "進み " : "progress ") + Math.max(0, Math.min(100, o.n.progress)) + "%" : ""].filter(Boolean);
151
+ return w + " " + one(o.n) + (ex.length ? (ja ? "(" + ex.join("、") + ")" : " (" + ex.join(", ") + ")") : "");
152
+ });
153
+ var s = (ja ? "年表:" : "Timeline: ") + it.join(ja ? "、" : "; ");
154
+ var ed = pl.edges.map(function(x){ return one(x.a.n) + " → " + one(x.b.n) + (x.e.label ? (ja ? "(" + x.e.label + ")" : " (" + x.e.label + ")") : ""); });
155
+ if (ed.length) s += (ja ? "。つながり:" : ". Links: ") + ed.join(ja ? "、" : ", ");
156
+ var dp = pl.deps.map(function(x){ return one(x.a.n) + " → " + one(x.b.n); });
157
+ if (dp.length) s += (ja ? "。作業の順:" : ". Order of work: ") + dp.join(ja ? "、" : ", ");
158
+ if (this.L && this.L.today) s += (ja ? "。今日:" : ". Today: ") + fmtTime(parseTime(P.today), ja);
159
+ return s;
160
+ }
161
+ // ---- 配置(u:軸に沿った位置、c:軸に直交する位置。h なら u = x、v なら u = y)
162
+ arrange(size){
163
+ var self = this, P = this.props, hz = this.hz, W = this.W, H = this.H, Lu = hz ? W : H, Lc = hz ? H : W;
164
+ var pl = this.plan(), its = pl.items, ja = this.ja;
165
+ var STEM = 30, ROWG = 10, GAP = 14, LANEG = 6, GROUPG = 16, why = [];
166
+ // 工程表(after があるとき):作業ごとに 1 段(書いた順)、段の間を矢印が通れるだけ空ける
167
+ var gantt = pl.deps.length > 0;
168
+ if (gantt){ LANEG = 12; GROUPG = 24; }
169
+ var points = its.filter(function(o){ return o.kind === "point"; }), lanesIt = its.filter(function(o){ return o.kind !== "point"; }), hasL = lanesIt.length > 0;
170
+ points.forEach(function(o){
171
+ var lines = [{text: o.n.whenLabel !== undefined ? String(o.n.whenLabel) : fmtTime(o.a, ja), size: 24, fill: tone(o.n.tone), weight: 700}].concat(labelLines(o.n, size, textFill(o.n.tone)));
172
+ // 強調の箱(--emph-tint の地)の中の補足は --fg(--muted では 4.5:1 に届かない。共通の決まり §2.3)
173
+ if (o.n.note) lines.push({text: o.n.note, size: 24, fill: o.n.tone === "emph" ? "var(--fg)" : "var(--muted)"});
174
+ o.bs = boxSize(self, lines);
175
+ o.eu = hz ? o.bs.w : o.bs.h; o.ec = hz ? o.bs.h : o.bs.w;
176
+ });
177
+ // 段のまとまり(lane):出てくる順
178
+ var groups = [], gi = {};
179
+ lanesIt.forEach(function(o){
180
+ var key = o.n.lane === undefined ? "" : String(o.n.lane);
181
+ if (!(key in gi)){ gi[key] = groups.length; groups.push({name: key, items: []}); }
182
+ groups[gi[key]].items.push(o);
183
+ });
184
+ var named = groups.some(function(g){ return g.name; });
185
+ var M = !named ? 0 : hz ? Math.max.apply(null, groups.map(function(g){ return g.name ? est(g.name, 24, self, true) * 1.05 : 0; })) + 22 : 44;
186
+ // 時刻 → u
187
+ var ts = [];
188
+ its.forEach(function(o){ ts.push(o.a.v); if (o.b) ts.push(o.b.v); });
189
+ var uniq = ts.slice().sort(function(a, b){ return a - b; }).filter(function(v, i, a){ return !i || v !== a[i - 1]; });
190
+ // 今日(期間の段があるときだけ):時間の範囲に入れる(目盛りの元の時刻には入れない)
191
+ var today = null;
192
+ if (P.today){
193
+ today = parseTime(P.today);
194
+ if (!today) self.rep("attr", "[timeline] today=" + JSON.stringify(P.today) + " is not a time; no today line");
195
+ else if (!hasL){ self.rep("attr", "[timeline] today needs a period (a node with end); no today line"); today = null; }
196
+ else ts.push(today.v);
197
+ }
198
+ var tmin = Math.min.apply(null, ts), tmax = Math.max.apply(null, ts);
199
+ var pad0 = gantt ? 30 : 16, pad1 = 36;
200
+ // 工程表:いちばん後の節目(◆)の名前が右に書けるだけ空ける(矢印が前から入るので)
201
+ if (gantt && hz) lanesIt.forEach(function(o){
202
+ if (o.kind !== "ms" || o.a.v < tmax) return;
203
+ var w = Math.max.apply(null, labelLines(o.n, size).map(function(l){ return l.tex ? texWidth(self, l) : est(l.text, size, self); }));
204
+ pad1 = Math.min(Lu * 0.3, Math.max(pad1, 21 + w + (o.n.note ? est(" " + o.n.note, 24, self) : 0) + 4));
205
+ });
206
+ if (!hasL && points.length){
207
+ pad0 = Math.min(points[0].eu / 2, Lu * 0.15);
208
+ pad1 = Math.min(points[points.length - 1].eu / 2, Lu * 0.15) + 24;
209
+ }
210
+ var uA = M + pad0, uB = Lu - pad1, even = P.scale === "even";
211
+ var U = function(v){
212
+ if (tmax === tmin) return (uA + uB) / 2;
213
+ if (even){
214
+ var i = uniq.indexOf(v);
215
+ if (i < 0){
216
+ // 使った時刻のあいだ(今日)は前後の時刻のあいだに比例して置く
217
+ if (v <= uniq[0]) return uA;
218
+ if (v >= uniq[uniq.length - 1]) return uB;
219
+ for (i = 1; uniq[i] < v; i++);
220
+ return uA + (uB - uA) * (i - 1 + (v - uniq[i - 1]) / (uniq[i] - uniq[i - 1])) / (uniq.length - 1);
221
+ }
222
+ return uA + (uB - uA) * i / (uniq.length - 1);
223
+ }
224
+ return uA + (uB - uA) * (v - tmin) / (tmax - tmin);
225
+ };
226
+ points.forEach(function(o){ o.u = U(o.a.v); });
227
+ // 出来事の箱:側(-1 = 上・左、1 = 下・右)と段(0 = 軸の近く)。期間があれば全部 -1 の側
228
+ var tryRows = function(rows){
229
+ var bins = {}, disp = 0, over = false;
230
+ points.forEach(function(o, j){
231
+ o.side = hasL ? -1 : j % 2 ? 1 : -1;
232
+ o.row = rows === 1 ? 0 : hasL ? j % 2 : Math.floor(j / 2) % 2;
233
+ var key = o.side + ":" + o.row;
234
+ (bins[key] = bins[key] || []).push(o);
235
+ });
236
+ Object.keys(bins).forEach(function(key){
237
+ var r = pack(bins[key], 0, Lu, GAP);
238
+ disp = Math.max(disp, r.disp); over = over || r.over;
239
+ });
240
+ var ext = {"-1": [0, 0], "1": [0, 0]};
241
+ points.forEach(function(o){ ext[o.side][o.row] = Math.max(ext[o.side][o.row], o.ec); });
242
+ var se = function(s){ var e = ext[s]; return e[0] ? STEM + e[0] + (e[1] ? ROWG + e[1] : 0) : 0; };
243
+ return {rows: rows, disp: disp, over: over, ext: ext, above: se(-1), below: se(1)};
244
+ };
245
+ // 混んでいて箱が点から離れすぎる(か入らない)なら 2 段
246
+ var R = tryRows(1);
247
+ if (points.length > 2 && (R.over || R.disp > 70)){
248
+ var R2 = tryRows(2), crossOK = function(r){ return r.above + r.below + 16 <= Lc; };
249
+ if ((R2.disp < R.disp || R.over) && (crossOK(R2) || !crossOK(R))) R = R2;
250
+ else R = tryRows(1);
251
+ }
252
+ if (R.over) why.push("the event boxes are wider than the timeline");
253
+ // 期間の段:帯の名前を中・右・左(v なら中・下・上)に置き、u の区間が重ならない段に積む
254
+ var tickExt = 0, ticks = [];
255
+ lanesIt.forEach(function(o){
256
+ // 名前は \n で何行でも(帯を太くするか、帯の横に行を重ねる)。note は最後の行に続けて小さく
257
+ var labs = labelLines(o.n, size), nl = labs.length, lab = labs[0], ws = labs.map(function(l){ return l.tex ? texWidth(self, l) : est(l.text, size, self); });
258
+ ws[nl - 1] += o.n.note ? est(" " + o.n.note, 24, self) : 0;
259
+ var tw = Math.max.apply(null, ws), lb = nl * size * 1.25;
260
+ o.tw = tw; o.lab = lab; o.labs = labs;
261
+ // 進み(%):帯の名前の後ろに書けるときだけ書く(24px)
262
+ o.pct = null; o.showPct = false;
263
+ if (o.kind === "band" && typeof o.n.progress === "number" && isFinite(o.n.progress)){
264
+ if (o.n.progress < 0 || o.n.progress > 100) self.rep("range", "[timeline] progress " + o.n.progress + " is outside 0–100; clamped");
265
+ o.pct = Math.max(0, Math.min(100, o.n.progress));
266
+ o.pctText = " " + (Math.round(o.pct * 10) / 10) + "%";
267
+ }
268
+ var twP = o.pct === null ? tw : Math.max(tw, ws[nl - 1] + est(o.pctText, 24, self));
269
+ // 帯(h)と節目の段の太さ:1 行なら今まで通り 1.7 字
270
+ o.need = Math.max(Math.round(size * 1.7), Math.ceil(lb + (o.kind === "band" ? size * 0.45 : 4)));
271
+ if (o.kind === "band"){
272
+ var u0 = U(o.a.v), u1 = U(o.b.v), len = u1 - u0, th = size * 1.3 * nl;
273
+ o.u0 = u0; o.u1 = u1;
274
+ if (hz){
275
+ o.where = tw + 20 <= len ? "in" : u1 + 10 + tw <= Lu ? "after" : u0 - 10 - tw >= M ? "before" : "in";
276
+ if (o.pct !== null) o.showPct = o.where === "in" ? twP + 20 <= len : o.where === "after" && u1 + 10 + twP <= Lu;
277
+ if (o.showPct && o.where === "after") o.tw = tw = twP;
278
+ o.lo = o.where === "before" ? u0 - 10 - tw : u0; o.hi = o.where === "after" ? u1 + 10 + tw : u1;
279
+ if (o.where === "in" && tw + 8 > len) why.push("the band \"" + lab.text + "\" is too short for its name");
280
+ } else {
281
+ o.where = th + 8 <= len ? "in" : u1 + 6 + th <= Lu ? "after" : u0 - 6 - th >= M ? "before" : "in";
282
+ if (o.pct !== null){ o.showPct = true; o.tw = tw = twP; }
283
+ o.lo = o.where === "before" ? u0 - 6 - th : u0; o.hi = o.where === "after" ? u1 + 6 + th : u1;
284
+ }
285
+ } else {
286
+ var u = U(o.a.v);
287
+ o.u0 = o.u1 = u;
288
+ if (hz){
289
+ o.where = u + 21 + tw <= Lu ? "after" : "before";
290
+ o.lo = o.where === "before" ? u - 21 - tw : u - 11; o.hi = o.where === "after" ? u + 21 + tw : u + 11;
291
+ } else { o.where = "after"; o.lo = u - Math.max(11, lb / 2 + 2); o.hi = u + Math.max(11, lb / 2 + 2); }
292
+ }
293
+ });
294
+ var lanesExt = 0;
295
+ groups.forEach(function(g, gk){
296
+ g.subs = [];
297
+ if (gantt) g.items.slice().sort(function(p, q){ return p.idx - q.idx; }).forEach(function(o){ o.group = gk; o.sub = g.subs.length; g.subs.push([o]); });
298
+ else g.items.slice().sort(function(p, q){ return p.lo - q.lo || p.idx - q.idx; }).forEach(function(o){
299
+ // 前の帯の終わりと次の帯の始まりが同じ時刻で、名前が外に出ていなければ、同じ段に続けて置ける
300
+ var ok = function(sub){
301
+ var last = sub[sub.length - 1];
302
+ var touch = last.kind === "band" && o.kind === "band" && last.where !== "after" && o.where !== "before" && last.b.v <= o.a.v;
303
+ return touch ? o.lo >= last.hi - 0.5 : o.lo >= last.hi + 10;
304
+ };
305
+ var sub = g.subs.filter(ok)[0];
306
+ if (!sub) g.subs.push(sub = []);
307
+ sub.push(o);
308
+ o.group = gk; o.sub = g.subs.indexOf(sub);
309
+ });
310
+ g.thick = g.subs.map(function(sub){
311
+ var m = 0;
312
+ if (hz){ sub.forEach(function(o){ m = Math.max(m, o.need); }); return m; }
313
+ sub.forEach(function(o){ m = Math.max(m, o.kind === "band" ? o.tw + 24 : 30 + o.tw + 10); });
314
+ return Math.ceil(m);
315
+ });
316
+ g.ext = g.thick.reduce(function(a, b){ return a + b; }, 0) + LANEG * (g.thick.length - 1);
317
+ lanesExt += g.ext + (gk ? GROUPG : 0);
318
+ });
319
+ var weekends = [], unit = P.unit;
320
+ if (unit && !/^(day|week|month)$/.test(unit)){ self.rep("attr", "[timeline] unit=\"" + unit + "\" is not day, week or month; automatic ticks"); unit = ""; }
321
+ // 時刻が数だけ(日付でない)なら、日・週・月の目盛りに意味がない
322
+ if (unit && its.every(function(o){ return o.a.p === "n" && (!o.b || o.b.p === "n"); })){ self.rep("attr", "[timeline] unit=\"" + unit + "\" needs dates (\"YYYY-MM-DD\"), but every when / end is a plain number; automatic ticks"); unit = ""; }
323
+ if (hasL){
324
+ if (unit){ var ut = unitTicks(unit, tmin, tmax, U, ja, hz, M, Lu, uA, uB, self); ticks = ut.ticks; weekends = ut.weekends; }
325
+ else ticks = makeTicks(its, tmin, tmax, uniq, U, uA, uB, even, ja, hz, M, Lu, self);
326
+ tickExt = hz ? 50 : 18 + Math.max(0, Math.max.apply(null, ticks.map(function(x){ return est(x.text, 24, self) * 1.1; }))) + 22;
327
+ }
328
+ // c の配置:全体を中央に
329
+ var todayText = ja ? "今日" : "Today", todayExt = !today ? 0 : hz ? 40 : Math.ceil(est(todayText, 24, self) * 1.05) + 16;
330
+ // 今日の三角(軸の上)の場所:上に出来事がなければ 14px 空ける
331
+ var triExt = today && R.above < 14 ? 14 - R.above : 0;
332
+ var total = hasL ? R.above + triExt + tickExt + lanesExt + todayExt : R.above + R.below + 16;
333
+ var off = Math.max(0, (Lc - total) / 2), axisC = hasL ? off + R.above + triExt : off + R.above + 8;
334
+ if (!hasL && !R.above) axisC = off + 8;
335
+ if (total > Lc + 0.5) why.push("needs " + Math.ceil(total) + "px across the axis, has " + Lc);
336
+ // 出来事の箱の位置
337
+ points.forEach(function(o){
338
+ var ext = R.ext[o.side], near = STEM + (o.row ? ext[0] + ROWG : 0);
339
+ o.c0 = o.side < 0 ? axisC - near - o.ec : axisC + near;
340
+ // 側の段の中で、軸に近い辺をそろえる
341
+ o.cn = o.side < 0 ? o.c0 + o.ec : o.c0;
342
+ });
343
+ // 段の位置
344
+ var c = axisC + tickExt;
345
+ groups.forEach(function(g, gk){
346
+ if (gk) c += GROUPG;
347
+ g.c0 = c; g.subC = [];
348
+ g.thick.forEach(function(t, j){ g.subC.push(c); c += t + (j < g.thick.length - 1 ? LANEG : 0); });
349
+ g.c1 = c;
350
+ });
351
+ return {fits: !why.length, why: why.join("; "), size: size, points: points, lanesIt: lanesIt, groups: groups, ticks: ticks, M: M, axisC: axisC,
352
+ axisU0: hasL ? M : 0, axisU1: Lu - 4, hasL: hasL, gantt: gantt, LANEG: LANEG, tickExt: tickExt, lanesEnd: c, weekends: weekends,
353
+ today: today ? {u: U(today.v), text: todayText} : null};
354
+ }
355
+ // (u, c) → [x, y]
356
+ xy(u, c){ return this.hz ? [u, c] : [c, u]; }
357
+ draw(L){
358
+ var D = base, self = this, P = this.props, hz = this.hz, svg = this.svg, size = L.size, ja = this.ja;
359
+ var gLane = D.el("g", {}, svg), gStem = D.el("g", {}, svg), gAxis = D.el("g", {opacity: 0}, svg), gBand = D.el("g", {}, svg),
360
+ gDot = D.el("g", {}, svg), gBox = D.el("g", {}, svg), gEdge = D.el("g", {}, svg);
361
+ this.L = L;
362
+ // 軸(印 class="axis":試験が軸を横切る字を探す)と矢じり、目盛り
363
+ var a0 = this.xy(L.axisU0, L.axisC), a1 = this.xy(L.axisU1, L.axisC);
364
+ this.axis = {g: gAxis, line: D.el("line", {class: "axis", x1: a0[0], y1: a0[1], x2: a0[0], y2: a0[1], stroke: "var(--muted)", "stroke-width": 5}, gAxis),
365
+ head: D.el("path", {d: "M0,0L-16,-7L-16,7Z", fill: "var(--muted)"}, gAxis), p0: a0, p1: a1, ang: hz ? 0 : 90,
366
+ ticks: D.el("g", {opacity: 0}, gAxis)};
367
+ L.ticks.forEach(function(k){
368
+ var p = self.xy(k.u, L.axisC), q = self.xy(k.u, L.axisC + (k.minor ? 7 : 11));
369
+ D.el("line", {x1: p[0], y1: p[1], x2: q[0], y2: q[1], stroke: "var(--muted)", "stroke-width": k.minor ? 1.5 : 2}, self.axis.ticks);
370
+ if (k.minor) return;
371
+ if (hz) D.el("text", {x: k.x.toFixed(1), y: (L.axisC + 40).toFixed(1), "text-anchor": k.anchor, "font-size": size, fill: "var(--muted)"}, self.axis.ticks).textContent = k.text;
372
+ else D.el("text", {x: (L.axisC + 18).toFixed(1), y: (k.u + 9).toFixed(1), "font-size": size, fill: "var(--muted)"}, self.axis.ticks).textContent = k.text;
373
+ });
374
+ // 土日(unit="day"):段の後ろに薄く
375
+ if (L.weekends.length){
376
+ this.weekG = D.el("g", {opacity: 0}, gLane);
377
+ var w0 = L.axisC + L.tickExt - 2;
378
+ L.weekends.forEach(function(w){
379
+ var p = self.xy(w[0], w0), q = self.xy(w[1], L.lanesEnd + 2);
380
+ D.el("rect", {x: Math.min(p[0], q[0]).toFixed(1), y: Math.min(p[1], q[1]).toFixed(1), width: Math.abs(q[0] - p[0]).toFixed(1), height: Math.abs(q[1] - p[1]).toFixed(1), fill: "var(--line)", opacity: 0.3}, self.weekG);
381
+ });
382
+ }
383
+ // 段のまとまりの名前と、まとまりの間の線
384
+ this.laneLabels = L.groups.map(function(g, gk){
385
+ var e = D.el("g", {opacity: 0}, gLane);
386
+ if (g.name){
387
+ if (hz) D.el("text", {x: 0, y: ((g.c0 + g.c1) / 2 + 8).toFixed(1), "font-size": 24, "font-weight": 700, fill: "var(--fg)"}, e).textContent = g.name;
388
+ else D.el("text", {x: g.c0.toFixed(1), y: (L.M - 14).toFixed(1), "font-size": 24, "font-weight": 700, fill: "var(--fg)"}, e).textContent = g.name;
389
+ }
390
+ if (gk){
391
+ var cs = g.c0 - 8, p = self.xy(L.axisU0, cs), q = self.xy(L.axisU1, cs);
392
+ D.el("line", {x1: p[0], y1: p[1], x2: q[0], y2: q[1], stroke: "var(--line)", "stroke-width": 1.5, "stroke-dasharray": "4 6"}, e);
393
+ }
394
+ var first = Infinity;
395
+ g.items.forEach(function(o){ first = Math.min(first, o.step); });
396
+ return {g: e, step: first};
397
+ });
398
+ var rects = {};
399
+ // 出来事:点、軸からの線、箱
400
+ this.points = L.points.map(function(o){
401
+ var col = tone(o.n.tone), bs = o.bs, r = hz ? {x: o.u0b, y: o.c0, w: bs.w, h: bs.h} : {x: o.c0, y: o.u0b, w: bs.w, h: bs.h};
402
+ var dot = D.el("circle", {cx: self.xy(o.u, L.axisC)[0], cy: self.xy(o.u, L.axisC)[1], r: 8, fill: col, stroke: "var(--bg)", "stroke-width": 2.5, opacity: 0}, gDot);
403
+ // 箱の軸に近い辺の、点にいちばん近いところへ線を引く
404
+ var ua = Math.max(o.u0b + 14, Math.min(o.u0b + o.eu - 14, o.u));
405
+ var p0 = self.xy(o.u, L.axisC), p1 = self.xy(ua, o.cn);
406
+ var stem = D.el("line", {x1: p0[0], y1: p0[1], x2: p0[0], y2: p0[1], stroke: "var(--muted)", "stroke-width": 3, opacity: 0}, gStem);
407
+ var g = D.el("g", {opacity: 0}, gBox);
408
+ D.el("rect", {class: "box", x: r.x.toFixed(1), y: r.y.toFixed(1), width: bs.w, height: bs.h, rx: 10, fill: boxFill(o.n.tone), stroke: col, "stroke-width": o.n.tone === "emph" ? 3 : 2.2}, g);
409
+ boxDraw(self, g, r.x, r.y, bs);
410
+ rects[o.n.id] = r;
411
+ // 軸から箱へ向かう向き(箱は軸の側から寄ってくる)
412
+ return {o: o, g: g, dot: dot, stem: stem, p0: p0, p1: p1, cx: r.x + bs.w / 2, cy: r.y + bs.h / 2, dir: hz ? [0, o.side] : [o.side, 0]};
413
+ });
414
+ // 期間(帯)と節目(◆)
415
+ this.lanes = L.lanesIt.map(function(o){
416
+ var g0 = L.groups[o.group], c0 = g0.subC[o.sub], th = g0.thick[o.sub], col = tone(o.n.tone);
417
+ var g = D.el("g", {opacity: 0}, gBand), lg = D.el("g", {}), rect = null, dia = null, r;
418
+ var noteSpan = function(t){ if (o.n.note){ var s = D.el("tspan", {"font-size": 24, fill: "var(--muted)"}, t); s.textContent = " " + o.n.note; } return t; };
419
+ // 名前の行を、行の塊の中心 yc に合わせて書く
420
+ var text = function(x, yc, anchor, lh){
421
+ var nl = o.labs.length, y0 = yc - (nl - 1) * lh / 2 + size * 0.36;
422
+ o.labs.forEach(function(l, j){
423
+ if (l.tex){ MR.texFrame(lg, x, y0 + j * lh, l.src, "tex", {size: size, anchor: anchor, color: "var(--fg)", w: o.tw + 8, h: size * 1.6}, self.texSink).firstChild.style.verticalAlign = "top"; return; }
424
+ var t = D.mtext(lg, x, y0 + j * lh, l.text, {"text-anchor": anchor, "font-size": size, fill: "var(--fg)"});
425
+ if (j === nl - 1){
426
+ noteSpan(t);
427
+ if (o.showPct){ var ps = D.el("tspan", {"font-size": 24, "font-weight": 700, fill: "var(--fg)"}, t); ps.textContent = o.pctText; }
428
+ }
429
+ });
430
+ };
431
+ if (o.kind === "band"){
432
+ // 隣の帯と線が重ならないように両端を 1.5px 内へ
433
+ var u0 = o.u0 + 1.5, u1 = Math.max(o.u0 + 3, o.u1 - 1.5);
434
+ r = hz ? {x: u0, y: c0, w: u1 - u0, h: th} : {x: c0, y: u0, w: th, h: u1 - u0};
435
+ rect = D.el("rect", {class: "box", x: r.x.toFixed(1), y: r.y.toFixed(1), width: r.w.toFixed(1), height: r.h.toFixed(1), rx: 8, fill: tint(col, 26), stroke: col, "stroke-width": 2}, g);
436
+ // 進み(progress):始まりの側から濃い色で塗る(枠の内側。終わりの側の角は 100% のときだけ丸い)
437
+ if (o.pct !== null){
438
+ var pl0 = (u1 - u0) * o.pct / 100;
439
+ o.progU = [u0, u0 + pl0];
440
+ if (pl0 > 0) o.progEl = D.el("path", {class: "progress", d: progPath(hz, u0 + 1, c0 + 1, pl0 - 2, th - 2, o.pct >= 100), fill: tint(col, 50)}, g);
441
+ }
442
+ if (hz){
443
+ var by = c0 + th / 2, lhh = size * 1.25;
444
+ if (o.where === "in") text((u0 + u1) / 2, by, "middle", lhh);
445
+ else if (o.where === "after") text(o.u1 + 10, by, "start", lhh);
446
+ else text(o.u0 - 10, by, "end", lhh);
447
+ } else {
448
+ var bx = c0 + th / 2, th2 = size * 1.3, blk = th2 * o.labs.length;
449
+ if (o.where === "in") text(bx, (u0 + u1) / 2, "middle", th2);
450
+ else if (o.where === "after") text(bx, o.u1 + 6 + blk / 2, "middle", th2);
451
+ else text(bx, o.u0 - 6 - blk / 2, "middle", th2);
452
+ }
453
+ } else {
454
+ var mc = hz ? [o.u0, c0 + th / 2] : [c0 + 15, o.u0];
455
+ dia = D.el("path", {d: "M0,-12L12,0L0,12L-12,0Z", fill: col, stroke: "var(--bg)", "stroke-width": 2, transform: "translate(" + mc[0].toFixed(1) + " " + mc[1].toFixed(1) + ")"}, g);
456
+ r = {x: mc[0] - 12, y: mc[1] - 12, w: 24, h: 24};
457
+ if (hz) text(o.where === "after" ? o.u0 + 21 : o.u0 - 21, mc[1], o.where === "after" ? "start" : "end", size * 1.25);
458
+ else text(c0 + 33, o.u0, "start", size * 1.25);
459
+ }
460
+ g.appendChild(lg); // 名前は帯の上に(帯と同じ g の中:試験は帯の中の字を除く)
461
+ rects[o.n.id] = r;
462
+ return {o: o, g: g, lg: lg, rect: rect, dia: dia, r: r, mc: dia ? (hz ? [o.u0, c0 + th / 2] : [c0 + 15, o.u0]) : null,
463
+ cx: r.x + r.w / 2, cy: r.y + r.h / 2};
464
+ });
465
+ // ほかのつながり(edges):破線、箱の縁から縁へ。名前が避けるもの:箱・帯・節目と、軸(期間があれば目盛りの字まで)
466
+ var box2 = function(u0, c0, u1, c1){ var p = self.xy(u0, c0), q = self.xy(u1, c1); return {x: Math.min(p[0], q[0]), y: Math.min(p[1], q[1]), w: Math.abs(q[0] - p[0]), h: Math.abs(q[1] - p[1])}; };
467
+ var obst = this.points.map(function(o){ return box2(o.o.u0b, o.o.c0, o.o.u0b + o.o.eu, o.o.c0 + o.o.ec); })
468
+ .concat(this.lanes.map(function(o){ var g0 = L.groups[o.o.group], c0 = g0.subC[o.o.sub]; return box2(o.o.lo, c0, o.o.hi, c0 + g0.thick[o.o.sub]); }));
469
+ obst.push(box2(L.axisU0, L.axisC - 10, L.axisU1, L.axisC + 10 + (L.hasL ? L.tickExt : 0)));
470
+ this.edges = this.plan().edges.map(function(x){
471
+ var e = x.e, A = rects[e.from], B = rects[e.to];
472
+ if (!A || !B) return null;
473
+ var ac = [A.x + A.w / 2, A.y + A.h / 2], bc = [B.x + B.w / 2, B.y + B.h / 2], dx = bc[0] - ac[0], dy = bc[1] - ac[1], Lh = Math.hypot(dx, dy) || 1;
474
+ var cut = function(R, c, sx, sy){ var s = Math.min(sx ? (R.w / 2 + 6) / Math.abs(sx) : Infinity, sy ? (R.h / 2 + 6) / Math.abs(sy) : Infinity); return [c[0] + sx * s, c[1] + sy * s]; };
475
+ var p0 = cut(A, ac, dx / Lh, dy / Lh), p1 = cut(B, bc, -dx / Lh, -dy / Lh), col = e.tone ? tone(e.tone) : "var(--muted)";
476
+ var g = D.el("g", {opacity: 0}, gEdge), ux = (p1[0] - p0[0]), uy = (p1[1] - p0[1]), l2 = Math.hypot(ux, uy) || 1;
477
+ D.el("line", {x1: p0[0].toFixed(1), y1: p0[1].toFixed(1), x2: (p1[0] - ux / l2 * 14).toFixed(1), y2: (p1[1] - uy / l2 * 14).toFixed(1), stroke: col, "stroke-width": 3, "stroke-dasharray": e.dash === false ? "none" : "8 6"}, g);
478
+ D.el("path", {d: "M0,0L-16,-7L-16,7Z", fill: col, transform: "translate(" + p1[0].toFixed(1) + " " + p1[1].toFixed(1) + ") rotate(" + (Math.atan2(uy, ux) * 180 / Math.PI).toFixed(1) + ")"}, g);
479
+ if (e.label){
480
+ // 名前は線の横に(線・軸と目盛り・箱・帯と重ならない所。なければ知らせる)
481
+ var at = sideLabel(p0, p1, est(e.label, 24, self), 30, obst, self.W, self.H);
482
+ if (!at.ok) self.rep("layout", "[timeline] the label \"" + e.label + "\" of the edge " + JSON.stringify(e.from) + " → " + JSON.stringify(e.to) + " has no free place beside its line (it may overlap; make the element larger or the label shorter)");
483
+ D.mtext(g, at.x, at.y, e.label, {"text-anchor": "middle", "font-size": 24, fill: e.tone ? col : "var(--muted)"});
484
+ }
485
+ return {g: g, step: x.step, at: x.at};
486
+ }).filter(Boolean);
487
+ // after:前の作業の終わりから後の作業の始まりへ、直角に折れる矢印(--muted、3px)。帯を横切らない縦の位置を選ぶ
488
+ this.deps = [];
489
+ if (this.plan().deps.length){
490
+ var gDep = D.el("g", {}, svg);
491
+ this.deps = this.plan().deps.map(function(x){
492
+ var pts = routeDep(L, x.a, x.b, size), path = "", len = 0;
493
+ // 最後の区間は矢じりの分だけ短く(矢じりは最後の区間の向き)
494
+ var q = pts.map(function(p){ return p.slice(); }), n = q.length, du = Math.sign(pts[n - 1][0] - pts[n - 2][0]), dc = Math.sign(pts[n - 1][1] - pts[n - 2][1]);
495
+ q[n - 1][0] -= 14 * du; q[n - 1][1] -= 14 * dc;
496
+ var dxy = self.xy(du, dc), ang = Math.atan2(dxy[1], dxy[0]) * 180 / Math.PI;
497
+ q.forEach(function(p, j){ var xy = self.xy(p[0], p[1]); path += (j ? "L" : "M") + xy[0].toFixed(1) + "," + xy[1].toFixed(1); if (j) len += Math.abs(p[0] - q[j - 1][0]) + Math.abs(p[1] - q[j - 1][1]); });
498
+ var g = D.el("g", {class: "dep", opacity: 0}, gDep), end = self.xy(pts[n - 1][0], pts[n - 1][1]);
499
+ var line = D.el("path", {d: path, fill: "none", stroke: "var(--muted)", "stroke-width": 3, "stroke-linejoin": "round", "stroke-dasharray": len.toFixed(1) + " " + (len + 2).toFixed(1)}, g);
500
+ var head = D.el("path", {d: "M0,0L-16,-7L-16,7Z", fill: "var(--muted)", transform: "translate(" + end[0].toFixed(1) + " " + end[1].toFixed(1) + ") rotate(" + ang + ")"}, g);
501
+ return {g: g, line: line, head: head, len: len, step: x.step, at: x.at, pts: pts.map(function(p){ return self.xy(p[0], p[1]); }), from: x.a.n.id, to: x.b.n.id};
502
+ });
503
+ }
504
+ // 今日:期間の段を縦に通る線と「今日」(--accent2)。軸の上には小さな三角。帯と名前の下に描く(帯の字を線が消さない)
505
+ this.today = null;
506
+ if (L.today){
507
+ var gT = D.el("g", {class: "today", opacity: 0}, svg);
508
+ svg.insertBefore(gT, gBand);
509
+ var tu = L.today.u, c0 = L.axisC + L.tickExt - 6, c1 = L.lanesEnd + 6;
510
+ var p0 = this.xy(tu, c0), p1 = this.xy(tu, c1), tri = this.xy(tu, L.axisC - 2);
511
+ D.el("path", {d: "M0,0L-9,-12L9,-12Z", fill: "var(--accent2)", transform: "translate(" + tri[0].toFixed(1) + " " + tri[1].toFixed(1) + ") rotate(" + (hz ? 0 : -90) + ")"}, gT);
512
+ var tl = D.el("line", {x1: p0[0].toFixed(1), y1: p0[1].toFixed(1), x2: p1[0].toFixed(1), y2: p1[1].toFixed(1), stroke: "var(--accent2)", "stroke-width": 3}, gT);
513
+ var tw = est(L.today.text, 24, self) * 1.05, tt;
514
+ if (hz){
515
+ var tx = Math.max(L.M + tw / 2, Math.min(this.W - tw / 2, tu));
516
+ tt = D.el("text", {x: tx.toFixed(1), y: (c1 + 26).toFixed(1), "text-anchor": "middle", "font-size": 24, "font-weight": 700, fill: "var(--accent2)"}, gT);
517
+ } else tt = D.el("text", {x: (c1 + 8).toFixed(1), y: (tu + 8).toFixed(1), "font-size": 24, "font-weight": 700, fill: "var(--accent2)"}, gT);
518
+ tt.textContent = L.today.text;
519
+ this.today = {g: gT, line: tl, u: tu};
520
+ }
521
+ }
522
+ duration(k){
523
+ var P = this.props, pl = this.plan(), d = k === pl.axisStep ? 0.5 : 0;
524
+ pl.items.forEach(function(o){ if (o.step === k) d = Math.max(d, o.at + P.dur); });
525
+ pl.edges.forEach(function(o){ if (o.step === k) d = Math.max(d, o.at + 0.4); });
526
+ return d;
527
+ }
528
+ // 同じ段階の 2 つ目からの出来事の開始時刻(口述原稿の {cue} に合わせられる)
529
+ cues(k){
530
+ var c = [];
531
+ this.plan().items.forEach(function(o){ if (o.step === k && o.at0 > 0 && c.indexOf(o.at) < 0) c.push(o.at); });
532
+ return c.length ? c.sort(function(a, b){ return a - b; }) : null;
533
+ }
534
+ render(k, t, ctx){
535
+ var D = base, P = this.props, self = this, vr = this.variant, T = P.dur, hz = this.hz;
536
+ var lecture = !!ctx.preview, pl = this.plan(), FAINT = 0.45;
537
+ if (lecture) FAINT = base.previewOpacity(this);
538
+ // 段階 s の、start から len 秒の進み(前の段階なら 1、後の段階なら 0)
539
+ var pr = function(s, start, len){ return s < k ? 1 : s > k ? 0 : D.prog(t, start, len); };
540
+ // 授業の表示:後の段階は最後の形を薄く(テーマの --preview-opacity、ないときは 0.45)、今の段階はその薄さから濃くなる。形は動かさない(どの見せ方でも同じ)
541
+ var faint = function(s, start){ return s < k ? 1 : s > k ? FAINT : FAINT + (1 - FAINT) * D.prog(t, start, T); };
542
+ // 軸
543
+ var A = this.axis, ea = lecture ? 1 : pr(pl.axisStep, 0, 0.5);
544
+ var ax = D.lerp(A.p0[0], A.p1[0], ea), ay = D.lerp(A.p0[1], A.p1[1], ea);
545
+ A.line.setAttribute("x2", (hz ? ax - 12 * Math.min(1, ea * 8) : ax).toFixed(2)); A.line.setAttribute("y2", (hz ? ay : ay - 12 * Math.min(1, ea * 8)).toFixed(2));
546
+ A.head.setAttribute("transform", "translate(" + ax.toFixed(2) + " " + ay.toFixed(2) + ") rotate(" + A.ang + ") scale(" + Math.min(1, ea * 8).toFixed(3) + ")");
547
+ A.g.setAttribute("opacity", lecture ? faint(pl.axisStep, 0).toFixed(3) : ea > 0 ? 1 : 0);
548
+ A.ticks.setAttribute("opacity", (lecture ? 1 : pr(pl.axisStep, 0.2, 0.4)).toFixed(3));
549
+ this.laneLabels.forEach(function(o){ o.g.setAttribute("opacity", (lecture ? faint(o.step, 0) : pr(o.step, 0, 0.45)).toFixed(3)); });
550
+ var setLine = function(ln, p0, p1, e){
551
+ ln.setAttribute("x1", p0[0].toFixed(2)); ln.setAttribute("y1", p0[1].toFixed(2));
552
+ ln.setAttribute("x2", D.lerp(p0[0], p1[0], e).toFixed(2)); ln.setAttribute("y2", D.lerp(p0[1], p1[1], e).toFixed(2));
553
+ ln.setAttribute("opacity", e > 0 ? 1 : 0);
554
+ };
555
+ // 箱の動きは 12 px まで(docs/conventions.md §1.2:どの見せ方も fade より遠くへ動かさない)。箱は軸の側から寄ってくる
556
+ var OFF = 12;
557
+ var place = function(g, cx, cy, s, d, e){
558
+ var dx = -d[0] * OFF * (1 - e), dy = -d[1] * OFF * (1 - e);
559
+ g.setAttribute("transform", s >= 1 && Math.abs(dx) < 0.01 && Math.abs(dy) < 0.01 ? "" :
560
+ "translate(" + (cx + dx).toFixed(2) + " " + (cy + dy).toFixed(2) + ") scale(" + s.toFixed(4) + ") translate(" + (-cx).toFixed(2) + " " + (-cy).toFixed(2) + ")");
561
+ };
562
+ this.points.forEach(function(o){
563
+ var s = o.o.step, st = o.o.at, boxO, boxS = 1, e = 1, dotO, stemE;
564
+ if (lecture){ boxO = dotO = faint(s, st); stemE = 1; o.stem.setAttribute("opacity", 1); }
565
+ else if (vr === "draw"){
566
+ // 軸からの線を先に引き、その先に箱が軸の側から 12 px 寄りながら出る
567
+ dotO = pr(s, st, 0.2 * T); stemE = pr(s, st, 0.5 * T); e = boxO = pr(s, st + 0.45 * T, 0.55 * T); boxS = 0.92 + 0.08 * e;
568
+ } else if (vr === "grow"){
569
+ // 線を引きながら、箱が軸の側から 12 px 寄り、0.92 → 1 に大きくなる
570
+ dotO = pr(s, st, 0.2 * T); stemE = pr(s, st, 0.4 * T);
571
+ e = pr(s, st + 0.25 * T, 0.75 * T); boxO = Math.min(1, e * 1.6); boxS = 0.92 + 0.08 * e;
572
+ } else {
573
+ // fade:箱が軸の側から 12 px 寄りながら現れてから、線を引く
574
+ e = pr(s, st, 0.75 * T); boxO = dotO = e; boxS = 0.92 + 0.08 * e; stemE = pr(s, st + 0.5 * T, 0.5 * T);
575
+ }
576
+ o.g.setAttribute("opacity", boxO.toFixed(3));
577
+ place(o.g, o.cx, o.cy, boxS, o.dir, lecture ? 1 : e);
578
+ o.dot.setAttribute("opacity", dotO.toFixed(3));
579
+ setLine(o.stem, o.p0, o.p1, stemE);
580
+ if (lecture) o.stem.setAttribute("opacity", dotO.toFixed(3));
581
+ });
582
+ // 期間と節目:段は軸の下(v なら右)。fade と grow は軸の側から 12 px 寄りながら現れる(grow は帯が両端 12 px ずつ伸びる)。
583
+ // draw は帯を始まりから終わりへ引き(線を引くのと同じ)、名前は後から
584
+ var ld = hz ? [0, 1] : [1, 0];
585
+ this.lanes.forEach(function(o){
586
+ var s = o.o.step, st = o.o.at, gO = 1, labO = 1, e = 1, w = 1, grow = 0, diaS = 1;
587
+ if (lecture) gO = faint(s, st);
588
+ else if (vr === "fade"){ e = gO = pr(s, st, 0.75 * T); }
589
+ else if (vr === "grow"){ e = pr(s, st, 0.75 * T); gO = Math.min(1, e * 1.6); grow = 1 - e; if (o.dia) diaS = 0.92 + 0.08 * e; }
590
+ else {
591
+ w = pr(s, st, 0.7 * T); labO = pr(s, st + 0.6 * T, 0.4 * T); gO = w > 0 ? 1 : 0;
592
+ if (o.dia){ diaS = pr(s, st, 0.4 * T); labO = pr(s, st + 0.4 * T, 0.6 * T); gO = diaS > 0 ? 1 : 0; }
593
+ }
594
+ o.g.setAttribute("opacity", gO.toFixed(3));
595
+ o.lg.setAttribute("opacity", labO.toFixed(3));
596
+ place(o.g, o.cx, o.cy, 1, ld, e);
597
+ if (o.rect){
598
+ var r = o.r, len = hz ? r.w : r.h, l = len * w, p = hz ? r.x : r.y;
599
+ if (grow > 0){ var cut = Math.min(len * 0.15, 2 * OFF) * grow; l = len - cut; p += cut / 2; }
600
+ o.rect.setAttribute(hz ? "x" : "y", p.toFixed(2)); o.rect.setAttribute(hz ? "width" : "height", Math.max(0, l).toFixed(2));
601
+ // 進みの塗りは見えている帯の中だけ(draw・grow の途中でも帯からはみ出さない)
602
+ var it = o.o, L = self.L;
603
+ if (it.progEl){
604
+ var pe = Math.min(p + l, it.progU[1]), c0p = L.groups[it.group].subC[it.sub], thp = L.groups[it.group].thick[it.sub];
605
+ it.progEl.setAttribute("d", progPath(hz, p + 1, c0p + 1, pe - p - 2, thp - 2, it.pct >= 100 && pe >= it.progU[1] - 0.01));
606
+ }
607
+ }
608
+ if (o.dia) o.dia.setAttribute("transform", "translate(" + o.mc[0].toFixed(1) + " " + o.mc[1].toFixed(1) + ")" + (diaS < 1 ? " scale(" + diaS.toFixed(4) + ")" : ""));
609
+ });
610
+ this.edges.forEach(function(o){ o.g.setAttribute("opacity", (lecture ? faint(o.step, o.at) : pr(o.step, o.at, 0.4)).toFixed(3)); });
611
+ // after の矢印:作業が出る間に、始まりから矢じりへ引く(どの見せ方でも同じ)
612
+ this.deps.forEach(function(o){
613
+ var e = lecture ? 1 : pr(o.step, o.at + 0.3 * T, 0.7 * T);
614
+ o.g.setAttribute("opacity", (lecture ? faint(o.step, o.at) : e > 0 ? 1 : 0).toFixed(3));
615
+ o.line.setAttribute("stroke-dashoffset", (o.len * (1 - e)).toFixed(2));
616
+ o.head.setAttribute("opacity", Math.max(0, Math.min(1, (e - 0.85) / 0.15)).toFixed(3));
617
+ });
618
+ // 今日の線と土日:軸の目盛りと一緒に
619
+ var tickO = lecture ? faint(pl.axisStep, 0) : pr(pl.axisStep, 0.2, 0.4);
620
+ if (this.today) this.today.g.setAttribute("opacity", tickO.toFixed(3));
621
+ if (this.weekG) this.weekG.setAttribute("opacity", tickO.toFixed(3));
622
+ }
623
+ };
624
+
625
+ // ---- 下の関数は m-timeline の中だけで使う(字の幅の見積もり・箱の中の行・詰め方・目盛り)
626
+ // 時刻:{v: 年を単位にした数, p: "n" | "y" | "m" | "d", y, m, d}。読めなければ null(日付の計算は Date を使わない)
627
+ // 線 p0 → p1 の名前(幅 w、高さ h)の置き場:線の真ん中(次に 1/3・2/3・1/4・3/4・端の近く)の横に、線から離して(近くになければ 24・48 px 遠くへ)。
628
+ // 上(か左)の側を先に試す。箱 obst と枠の外を避ける。返すのは字の基線の中心 {x, y, ok}(m-cycle と同じ)
629
+ function sideLabel(p0, p1, w, h, obst, W, H){
630
+ var ux = p1[0] - p0[0], uy = p1[1] - p0[1], l = Math.hypot(ux, uy) || 1, nx = -uy / l, ny = ux / l, first = null;
631
+ if (ny > 0 || (ny === 0 && nx > 0)){ nx = -nx; ny = -ny; }
632
+ var ts = [0.5, 0.35, 0.65, 0.25, 0.75, 0.1, 0.9];
633
+ for (var ex = 0; ex <= 48; ex += 24) for (var i = 0; i < ts.length; i++) for (var sd = 1; sd >= -1; sd -= 2){
634
+ var d = Math.abs(nx) * w / 2 + Math.abs(ny) * h / 2 + 8 + ex;
635
+ var cx = p0[0] + ux * ts[i] + sd * nx * d, cy = p0[1] + uy * ts[i] + sd * ny * d;
636
+ var b = {l: cx - w / 2, r: cx + w / 2, t: cy - h / 2, b: cy + h / 2};
637
+ var at = {x: cx, y: cy + 8, ok: true};
638
+ if (!first) first = at;
639
+ if (b.l < 0 || b.r > W || b.t < 0 || b.b > H) continue;
640
+ if (obst.some(function(o){ return b.l < o.x + o.w + 4 && o.x - 4 < b.r && b.t < o.y + o.h + 4 && o.y - 4 < b.b; })) continue;
641
+ return at;
642
+ }
643
+ return {x: first.x, y: first.y, ok: false};
644
+ }
645
+ function parseTime(v){
646
+ if (typeof v === "number") return isFinite(v) ? {v: v, p: "n", y: v} : null;
647
+ var m = /^\s*(-?\d{1,4})(?:-(\d{1,2})(?:-(\d{1,2}))?)?\s*$/.exec(String(v));
648
+ if (!m) return null;
649
+ var y = +m[1], mo = m[2] ? +m[2] : 1, d = m[3] ? +m[3] : 1;
650
+ var leap = (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0;
651
+ var ml = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
652
+ if (mo < 1 || mo > 12 || d < 1 || d > ml[mo - 1]) return null;
653
+ var doy = d - 1;
654
+ for (var i = 0; i < mo - 1; i++) doy += ml[i];
655
+ return {v: y + doy / (leap ? 366 : 365), p: m[3] ? "d" : m[2] ? "m" : "y", y: y, m: mo, d: d};
656
+ }
657
+ function tone(t){ return "var(--" + (/^(term|emph|muted|accent2|series-[1-4])$/.test(t || "") ? t : "term") + ")"; }
658
+ // 箱の地と字の色(m-tree・m-fishbone と同じ決まり):term と emph はテーマの薄い色の地、emph は字も emph
659
+ function boxFill(t){ return t === "emph" ? "var(--emph-tint)" : /^(muted|accent2|series-[1-4])$/.test(t || "") ? tint(tone(t), 12) : "var(--term-tint)"; }
660
+ function textFill(t){ return t === "emph" ? "var(--emph)" : "var(--fg)"; }
661
+ function tint(c, p){ return "color-mix(in srgb," + c + " " + p + "%,var(--bg))"; }
662
+ // 字の幅(px):base の textWidth(font の要素の字で測った幅)。mtext の *_^ は数えない(plain:mtext を通らない字)
663
+ function est(s, fs, font, plain){ return base.textWidth(s, fs, {font: font, mark: !plain}); }
664
+ // KaTeX の式の幅:一度置いて測る
665
+ function texWidth(el, l){
666
+ var g = base.el("g", {opacity: 0}, el.svg), fo = MR.texFrame(g, 0, 0, l.src, "tex", {size: l.size, anchor: "start"}, el.texSink);
667
+ var w = Math.max(0, (+fo.getAttribute("width") || 4) - 4);
668
+ el.svg.removeChild(g);
669
+ return w;
670
+ }
671
+ function labelLines(n, size, fill){
672
+ fill = fill || "var(--fg)";
673
+ if (n.tex) return [{tex: n.tex, src: n, size: size, fill: fill}];
674
+ return String(n.label || "").split("\n").map(function(s){ return {text: s, size: size, fill: fill}; });
675
+ }
676
+ // 箱の大きさと行の位置(基線は前の行の下 0.3 字 + 今の行の 1.12 字:字の箱どうしが重ならない)
677
+ function boxSize(el, lines){
678
+ var w = 0, y = 10, prev = null;
679
+ lines.forEach(function(l){
680
+ l.w = l.tex ? texWidth(el, l) : est(l.text, l.size, el) * (l.weight ? 1.05 : 1);
681
+ w = Math.max(w, l.w);
682
+ y += prev ? 0.3 * prev.size + 1.12 * l.size : 0.9 * l.size;
683
+ l.y = y; prev = l;
684
+ });
685
+ return {w: Math.ceil(w + 32), h: Math.ceil(y + 0.28 * prev.size + 10), lines: lines};
686
+ }
687
+ function boxDraw(el, g, x, y, bs){
688
+ bs.lines.forEach(function(l){
689
+ if (l.tex) MR.texFrame(g, x + bs.w / 2, y + l.y, l.src, "tex", {size: l.size, anchor: "middle", color: l.fill, w: l.w + 8, h: l.size * 1.6}, el.texSink).firstChild.style.verticalAlign = "top";
690
+ else base.mtext(g, x + bs.w / 2, y + l.y, l.text, {"text-anchor": "middle", "font-size": l.size, fill: l.fill, "font-weight": l.weight || 400});
691
+ });
692
+ }
693
+ // 箱を軸に沿って並べる:望む位置(o.u)を中心に、重ならないように塊にまとめてずらす(順は変えない)。o.u0b に左(上)端
694
+ function pack(list, A, B, gap){
695
+ var cl = [];
696
+ list.slice().sort(function(p, q){ return p.u - q.u; }).forEach(function(o){
697
+ var c = {items: [o], ext: o.eu, want: o.u - o.eu / 2};
698
+ c.start = Math.max(A, Math.min(B - c.ext, c.want));
699
+ cl.push(c);
700
+ while (cl.length > 1){
701
+ var p = cl[cl.length - 2], q = cl[cl.length - 1];
702
+ if (p.start + p.ext + gap <= q.start + 0.01) break;
703
+ // 塊をまとめ、望む位置の平均に置く
704
+ var items = p.items.concat(q.items), ext = 0, sum = 0;
705
+ items.forEach(function(x, j){ sum += x.u - x.eu / 2 - ext; ext += x.eu + (j < items.length - 1 ? gap : 0); });
706
+ cl.splice(cl.length - 2, 2, {items: items, ext: ext, want: sum / items.length, start: Math.max(A, Math.min(B - ext, sum / items.length))});
707
+ }
708
+ });
709
+ var disp = 0, over = false;
710
+ cl.forEach(function(c){
711
+ if (c.ext > B - A + 0.5) over = true;
712
+ var s = c.start;
713
+ c.items.forEach(function(x){ x.u0b = s; disp = Math.max(disp, Math.abs(s + x.eu / 2 - x.u)); s += x.eu + gap; });
714
+ });
715
+ return {disp: disp, over: over};
716
+ }
717
+ function fmtTime(a, ja){
718
+ var neg = a.y < 0, y = Math.abs(a.y);
719
+ if (a.p === "n") return (a.v < 0 ? "−" : "") + String(Math.abs(a.v));
720
+ if (ja){
721
+ var s = (neg ? "前" : "") + y + "年";
722
+ return a.p === "y" ? s : a.p === "m" ? s + a.m + "月" : s + a.m + "月" + a.d + "日";
723
+ }
724
+ var p2 = function(n){ return (n < 10 ? "0" : "") + n; };
725
+ return (neg ? "−" : "") + y + (a.p === "y" ? "" : "-" + p2(a.m) + (a.p === "d" ? "-" + p2(a.d) : ""));
726
+ }
727
+ // 目盛り(期間があるときだけ):time は切りのよい間隔(年・月・数)、even は使った時刻ごと。字が重なるものは間引く
728
+ function makeTicks(its, tmin, tmax, uniq, U, uA, uB, even, ja, hz, M, Lu, font){
729
+ var out = [], T = parseTime;
730
+ var minGap = function(w){ return hz ? w + 24 : 24 * 1.3 + 10; };
731
+ if (even){
732
+ var txt = {};
733
+ its.forEach(function(o){ [o.a, o.b].forEach(function(a){ if (a && !(a.v in txt)) txt[a.v] = fmtTime(a, ja).replace(/年$/, ""); }); });
734
+ uniq.forEach(function(v){ out.push({u: U(v), text: txt[v]}); });
735
+ } else if (tmax > tmin){
736
+ var fine = its.some(function(o){ return o.a.p === "m" || o.a.p === "d" || (o.b && (o.b.p === "m" || o.b.p === "d")); });
737
+ var span = tmax - tmin, px = (uB - uA) / span;
738
+ if (fine && span <= 4){
739
+ var y0 = Math.floor(tmin), m0 = 0;
740
+ [1, 2, 3, 6, 12].some(function(stp){
741
+ out = [];
742
+ for (var mi = y0 * 12; mi <= Math.ceil(tmax) * 12; mi += stp){
743
+ var y = Math.floor(mi / 12), m = mi - y * 12 + 1, v = T(y + "-" + m).v;
744
+ if (v < tmin - 1e-9 || v > tmax + 1e-9) continue;
745
+ out.push({u: U(v), y: y, m: m});
746
+ }
747
+ out.forEach(function(k, j){ k.text = ja ? (j === 0 || k.m === 1 ? k.y + "年" : "") + k.m + "月" : k.y + "-" + (k.m < 10 ? "0" : "") + k.m; });
748
+ var wmax = Math.max.apply(null, out.map(function(k){ return est(k.text, 24, font); }).concat([0]));
749
+ return out.length < 2 || px * stp / 12 >= minGap(wmax);
750
+ });
751
+ } else {
752
+ var ints = its.every(function(o){ return o.a.p !== "n" || Math.round(o.a.v) === o.a.v; });
753
+ var cands = [];
754
+ for (var e = -3; e <= 6; e++) [1, 2, 5].forEach(function(m){ cands.push(m * Math.pow(10, e)); });
755
+ cands.some(function(stp){
756
+ if (ints && stp < 1) return false;
757
+ var dg = Math.max(0, -Math.floor(Math.log10(stp) + 1e-9));
758
+ out = [];
759
+ for (var v = Math.ceil(tmin / stp - 1e-9) * stp; v <= tmax + 1e-9; v += stp) out.push({u: U(v), text: (v < 0 ? "−" : "") + Math.abs(v).toFixed(dg)});
760
+ var wmax = Math.max.apply(null, out.map(function(k){ return est(k.text, 24, font); }).concat([0]));
761
+ return out.length <= 12 && px * stp >= minGap(wmax);
762
+ });
763
+ }
764
+ }
765
+ return placeTicks(out, hz, M, Lu, font);
766
+ }
767
+ // 目盛りの字の位置と寄せ:両端で外に出ないように。重なるものは間引く(字のない細かい目盛り minor はそのまま)
768
+ function placeTicks(out, hz, M, Lu, font){
769
+ var kept = [], last = -Infinity;
770
+ out.forEach(function(k){
771
+ if (k.minor){ kept.push(k); return; }
772
+ var w = est(k.text, 24, font);
773
+ if (hz){
774
+ k.x = k.u; k.anchor = "middle";
775
+ if (k.u - w / 2 < M){ k.x = Math.max(M, k.u - 6); k.anchor = "start"; }
776
+ if (k.u + w / 2 > Lu){ k.x = Lu; k.anchor = "end"; }
777
+ var lo = k.anchor === "start" ? k.x : k.anchor === "end" ? k.x - w : k.x - w / 2;
778
+ if (lo < last + 16) return;
779
+ last = lo + w;
780
+ } else {
781
+ if (k.u - 24 < last + 6) return;
782
+ last = k.u + 8;
783
+ }
784
+ kept.push(k);
785
+ });
786
+ return kept;
787
+ }
788
+ // ---- 工程表(after・progress・today・unit)
789
+ // 進みの塗り:(u, c) から長さ len・太さ th。始まりの側の角は丸く、終わりの側は round のときだけ丸い(2 次ベジェの角で、h と v のどちらでも同じ式)
790
+ function progPath(hz, u, c, len, th, round){
791
+ if (len <= 0) return "";
792
+ var r0 = Math.min(7, len / 2, th / 2), r1 = round ? r0 : 0, P = function(a, b){ return (hz ? [a, b] : [b, a]).map(function(x){ return x.toFixed(2); }).join(","); };
793
+ var e = u + len, d = c + th;
794
+ return "M" + P(u + r0, c) + "L" + P(e - r1, c) + "Q" + P(e, c) + " " + P(e, c + r1) + "L" + P(e, d - r1) + "Q" + P(e, d) + " " + P(e - r1, d) +
795
+ "L" + P(u + r0, d) + "Q" + P(u, d) + " " + P(u, d - r0) + "L" + P(u, c + r0) + "Q" + P(u, c) + " " + P(u + r0, c) + "Z";
796
+ }
797
+ // 終わり → 始まりの矢印の折れ線(u, c の点の列)。前の作業の終わり(帯の右端の中ほど、または終わり近くの帯の縁から縦に)から、
798
+ // 後の作業の始まり(帯の左端の中ほど)へ、横から入る。候補を順に試し、ほかの作業の帯と名前を横切らない最初のものを選ぶ(なければ
799
+ // 横切る数のいちばん少ないもの):右端から出て縦に下りる → 縁から縦に出る → 後の作業の段の手前の隙間を通って回り込む(始まりが前の
800
+ // 作業の終わりに近すぎるとき)。名前が帯の右に書いてある前の作業は、縁からだけ出る
801
+ function routeDep(L, a, b, size){
802
+ var row = function(o){ var g = L.groups[o.group]; return {c0: g.subC[o.sub], c1: g.subC[o.sub] + g.thick[o.sub], first: o.sub === 0, last: o.sub === g.subs.length - 1}; };
803
+ var A = row(a), B = row(b), ca = (A.c0 + A.c1) / 2, cb = (B.c0 + B.c1) / 2, down = cb >= ca ? 1 : -1;
804
+ var eu = b.kind === "band" ? b.u0 + 1.5 : b.u0 - 12, uMin = L.M + 4;
805
+ // b の段の手前(a の側)の隙間の中ほど
806
+ var cg = down > 0 ? B.c0 - (B.first ? 16 : L.LANEG / 2) : B.c1 + (B.last ? 8 : L.LANEG / 2);
807
+ var xl = Math.max(uMin, eu - 22);
808
+ // 縦の区間(u, c の範囲 p〜q)が横切る、ほかの作業の帯と名前(lo〜hi)の数
809
+ var hits = function(pts){
810
+ var n = 0;
811
+ for (var j = 1; j < pts.length; j++){
812
+ if (Math.abs(pts[j][0] - pts[j - 1][0]) > 0.01) continue;
813
+ var u = pts[j][0], lo = Math.min(pts[j][1], pts[j - 1][1]), hi = Math.max(pts[j][1], pts[j - 1][1]);
814
+ L.lanesIt.forEach(function(o){
815
+ if (o === a || o === b) return;
816
+ var r = row(o);
817
+ if (r.c1 > lo + 1 && r.c0 < hi - 1 && u > o.lo - 8 && u < o.hi + 8) n++;
818
+ });
819
+ }
820
+ return n;
821
+ };
822
+ var cands = [], side = [], su = a.kind === "band" ? a.u1 - 1.5 : a.u0 + 12, x0 = su + 10;
823
+ // 縁から:帯の終わりから 20px 手前(同じ日に始まる後の作業にも横から入れる。同じ前の作業からの矢印は縦の線を共にする)、
824
+ // ふさがっていれば 24・28・12・8px 手前(節目は ◆ の下か上の角)
825
+ var sc = a.kind === "band" ? (down > 0 ? A.c1 : A.c0) : ca + down * 12, svs = [];
826
+ if (a.kind === "band") [20, 24, 28, 12, 8].forEach(function(d){ if (a.u1 - 1.5 - d >= a.u0 + 5.5) svs.push(a.u1 - 1.5 - d); });
827
+ else svs.push(a.u0);
828
+ if (!svs.length) svs.push((a.u0 + a.u1) / 2);
829
+ // 後の作業の a の側の縁に、始まりの近くで縦に入る(始まりが前の作業の終わりと同じ日のとき。節目は ◆ の角へ)
830
+ var eb = b.kind === "band" ? (down > 0 ? B.c0 : B.c1) : cb - down * 12;
831
+ var topOK = function(x, c){ return Math.abs(eb - c) >= 22 && (b.kind === "band" ? x >= b.u0 + 5.5 && x <= Math.min(b.u1 - 7.5, b.u0 + 25.5) : Math.abs(x - b.u0) < 0.01); };
832
+ if (a.where !== "after"){
833
+ if (topOK(x0, ca)) side.push([[su, ca], [x0, ca], [x0, eb]]);
834
+ if (b.kind === "ms" && b.u0 >= x0) side.push([[su, ca], [b.u0, ca], [b.u0, eb]]);
835
+ }
836
+ svs.forEach(function(v){ if (topOK(v, sc)) side.push([[v, sc], [v, eb]]); });
837
+ // 後の作業の名前が始まりの手前に書いてあれば、横からは入らない
838
+ if (b.where === "before") cands = cands.concat(side);
839
+ if (a.where !== "after") for (var u = x0; u <= eu - 22; u += 4) cands.push([[su, ca], [u, ca], [u, cb], [eu, cb]]);
840
+ svs.forEach(function(v){ if (eu - 22 >= v) cands.push([[v, sc], [v, cb], [eu, cb]]); });
841
+ if (b.where !== "before") cands = cands.concat(side);
842
+ if (a.where !== "after") cands.push([[su, ca], [x0, ca], [x0, cg], [xl, cg], [xl, cb], [eu, cb]]);
843
+ svs.forEach(function(v){ cands.push([[v, sc], [v, cg], [xl, cg], [xl, cb], [eu, cb]]); });
844
+ var best = null, bh = Infinity;
845
+ for (var k = 0; k < cands.length; k++){ var h = hits(cands[k]); if (h < bh){ bh = h; best = cands[k]; if (!h) break; } }
846
+ return best;
847
+ }
848
+ // 日付 ↔ 通しの日(1970-01-01 = 0。グレゴリオ暦。Date は使わない)
849
+ function dnum(y, m, d){
850
+ y -= m <= 2 ? 1 : 0;
851
+ var era = Math.floor(y / 400), yoe = y - era * 400, doy = Math.floor((153 * (m + (m > 2 ? -3 : 9)) + 2) / 5) + d - 1;
852
+ return era * 146097 + yoe * 365 + Math.floor(yoe / 4) - Math.floor(yoe / 100) + doy - 719468;
853
+ }
854
+ function civil(z){
855
+ z += 719468;
856
+ var era = Math.floor(z / 146097), doe = z - era * 146097, yoe = Math.floor((doe - Math.floor(doe / 1460) + Math.floor(doe / 36524) - Math.floor(doe / 146096)) / 365);
857
+ var doy = doe - (365 * yoe + Math.floor(yoe / 4) - Math.floor(yoe / 100)), mp = Math.floor((5 * doy + 2) / 153), d = doy - Math.floor((153 * mp + 2) / 5) + 1, m = mp + (mp < 10 ? 3 : -9);
858
+ return {y: yoe + era * 400 + (m <= 2 ? 1 : 0), m: m, d: d};
859
+ }
860
+ function yearLen(y){ return (y % 4 === 0 && y % 100 !== 0) || y % 400 === 0 ? 366 : 365; }
861
+ // 年を単位にした時刻(parseTime の v)↔ 通しの日
862
+ function dayOf(v){ var y = Math.floor(v); return dnum(y, 1, 1) + (v - y) * yearLen(y); }
863
+ function vOfDay(z){ var c = civil(z); return c.y + (z - dnum(c.y, 1, 1)) / yearLen(c.y); }
864
+ function weekday(z){ return ((z % 7) + 7 + 4) % 7; } // 0 = 日曜 … 6 = 土曜
865
+ // unit = day | week | month の目盛り。字の間隔が足りるいちばん細かい刻みを選び(字は 24px のまま)、刻みの間の目盛りは字なしの短い線にする
866
+ function unitTicks(unit, tmin, tmax, U, ja, hz, M, Lu, uA, uB, font){
867
+ var z0 = Math.ceil(dayOf(tmin) - 1e-6), z1 = Math.floor(dayOf(tmax) + 1e-6), weekends = [];
868
+ var gapOK = function(list){
869
+ for (var j = 1; j < list.length; j++){
870
+ var need = hz ? (est(list[j - 1].text, 24, font) + est(list[j].text, 24, font)) / 2 + 24 : 24 * 1.3 + 10;
871
+ if (list[j].u - list[j - 1].u < need) return false;
872
+ }
873
+ return true;
874
+ };
875
+ var md = function(c){ return c.m + "/" + c.d; };
876
+ var cands = [], best = null;
877
+ if (unit === "month"){
878
+ var c0 = civil(z0), c1 = civil(z1), mi0 = c0.y * 12 + c0.m - 1 + (c0.d > 1 ? 1 : 0), mi1 = c1.y * 12 + c1.m - 1;
879
+ [1, 2, 3, 6, 12, 24, 60, 120].forEach(function(stp){
880
+ var all = [], lab = [];
881
+ for (var mi = mi0; mi <= mi1; mi++){
882
+ var y = Math.floor(mi / 12), m = mi - y * 12 + 1, k = {u: U(vOfDay(dnum(y, m, 1))), y: y, m: m};
883
+ if ((mi - mi0) % stp === 0) lab.push(k); else all.push({u: k.u, text: "", minor: true});
884
+ }
885
+ lab.forEach(function(k, j){ k.text = ja ? (j === 0 || k.m === 1 || stp >= 12 ? k.y + "年" : "") + (stp >= 12 && k.m === 1 ? "" : k.m + "月") : k.y + "-" + (k.m < 10 ? "0" : "") + k.m; });
886
+ cands.push({lab: lab, minor: all});
887
+ });
888
+ } else {
889
+ var steps = unit === "week" ? [7, 14, 28, 56, 91, 182] : [1, 2, 7, 14, 28, 56];
890
+ steps.forEach(function(stp){
891
+ var all = [], lab = [], wk = 0, prev = null;
892
+ for (var z = z0; z <= z1; z++){
893
+ var isMon = weekday(z) === 1, u = U(vOfDay(z));
894
+ if (unit === "week" && !isMon) continue;
895
+ var on = stp < 7 ? (z - z0) % stp === 0 : isMon && (wk++ % (stp / 7)) === 0;
896
+ if (on){
897
+ var c = civil(z);
898
+ lab.push({u: u, text: unit === "day" && stp < 7 && prev && prev.m === c.m ? String(c.d) : md(c)});
899
+ prev = c;
900
+ } else all.push({u: u, text: "", minor: true});
901
+ }
902
+ cands.push({lab: lab, minor: all});
903
+ });
904
+ }
905
+ for (var i = 0; i < cands.length && !best; i++) if (gapOK(cands[i].lab)) best = cands[i];
906
+ best = best || cands[cands.length - 1];
907
+ // 刻みの間の目盛りは、間隔が 8px 以上あるときだけ
908
+ var pxMinor = best.minor.length > 1 ? Math.abs(best.minor[1].u - best.minor[0].u) : Infinity;
909
+ var out = best.lab.concat(pxMinor >= 8 ? best.minor : []).sort(function(p, q){ return p.u - q.u; });
910
+ if (unit === "day"){
911
+ // 土日:土曜の始まりから月曜の始まりまで(時間の範囲の中だけ)
912
+ for (var z = z0 - 1; z <= z1; z++) if (weekday(z) === 6){
913
+ var p = Math.max(uA, U(vOfDay(z))), q = Math.min(uB, U(vOfDay(z + 2)));
914
+ if (q > p + 1) weekends.push([p, q]);
915
+ }
916
+ }
917
+ return {ticks: placeTicks(out, hz, M, Lu, font), weekends: weekends};
918
+ }
919
+ return Part;
920
+ });